texts: Magento 2 -How to change the format datetime with yyyy/mm/dd of DOB in customer edit

texts: although I changed the locale of my account to Japan time. But it's display format of en_US.


texts:
How I change the cache-control to have the same properties of x-magento-cache-control on response Header?

Above my inspect:

cache-control: max-age=0, must-revalidate, no-cache, no-store (I Need change this)

x-magento-cache-control: max-age=86400, public, s-maxage=86400

Anyone can help-me?


texts: Terms and conditions as a static page url

texts:
I want to add a link to our terms and conditions in our newsletter, but I believe I need to create a cms page first, referencing the T's & C's from the onepage checkout.

I have come across this suggestion, Get the content of terms and conditions by url? , which might be the answer I'm looking for, but I cannot figure out where to place the folder "agreements" within my theme.

I have followed the suggestion to the best of my ability, but no matter what I do, I only get a blank page.

Can anyone help in simple terms for a newbe?


texts: Assigning different BASE_URL for developer mode only

texts:
I that possible?

I want to do this to set up a configuration like this:

https://mystore.mydomain.com/ for production (with Varnish cache)

https://mystore.mydomain.com:5001/ for development (bypassing Varnish cache)

How to do that? (note: I am using Nginx)


texts:
I created a module and want to use it through cron, and in the end I call the cron: run command, here are my files, what is wrong here?

namespace AutoAddtocart\BundleAddtocart\Cron;

class Addtocartauto
{

    protected $_logger;

    public function __construct(

        \Psr\Log\LoggerInterface $logger
    )
    {

        $this->_logger = $logger;
    }

    public function execute()
    {
        $this->_logger->debug('Cron run successfully');
        return $this;
    }

}

Cron xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job instance="AutoAddtocart\BundleAddtocart\Cron\Addtocartauto" method="execute"  name="add_to_cart_by_cron">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>


texts: How secure is the Magento 2 File Uploader

texts:
I recently added my own form to the Magento frontend. The form contains a file type input, an used the file uploader class to save the file. But I was wondering how save this class is?

I already changed the name, checked the file size (not in code below) and checked the file extension. But I'm wondering if that is enough.

Here is my code (I'm checking file size in an earlier function):

private function uploadFile($id) {
    $uploader = $this->_fileUploaderFactory->create(['fileId' => $id]);
    $uploader->setAllowRenameFiles(TRUE);
    $uploader->setFilesDispersion(TRUE);
    $uploader->setAllowCreateFolders(TRUE);
    $uploader->setAllowedExtensions(Helper::ALLOWED_FILE_UPLOADS);

    $path = $this->_fileSystem->getDirectoryRead(DirectoryList::VAR_DIR)
      ->getAbsolutePath();

    $uploader->save($path . '/myfiles', $id . '.' . $uploader->getFileExtension());

    return '/myfiles' . $uploader->getUploadedFileName();
  }


texts: Magento 2: get product collection using category id

texts: How to get all products of category using category id in magento 2?


texts: Home text is not linking to the "home page" in login page

texts:
please visit this link :

http://schoolboards4.newtrendzonline.com/index.php/customer/account/login/

on the left side you can see Home/Login , but if click on "home", it's not linking to the home page.

this is breadcrumbs.phtml file => http://pastebin.com/3kzMRFT2

after registration, it will display " Home/ My Account".

If we click "home" on that page also, its not linking to the home page.

let me know if you need any other files.

please help me to find solution.

thanks in advance.


texts: Magento2: OnClick variation price not updated based on customer group

texts:
I have configurable product.
Customer group wise variation price not updated.
It's update but once I add to cart, onclick it's not updated.

Can anyone have any idea.


texts: Limit to number of simple products I am able to add to a Bundle

texts:
I am running version 1.6.2.0 and something has happened where by I am unable to add more than 94 simple products in total to a bundle product I have created.

I have 3 options and want to have 45 simple products per option, but as I am adding once I get up to this number of having 94 in total across all three Magento says it has saved but when I scroll down and check it has not saved the last product I tried adding to the option. I dont get any error message, everything appears to be fine, but it just doesnt add anymore products once I get to 94!

I can remove products from other options to allow me to add to others, but cannot exceed this 94 limit! It's like a 1 in one out rule!

It never used to be like this - I used to be able to have 50+ products per option. Only recent thing I can think of that might affect this is we bought a couple of 3rd party asynchronous chaching and indexing plug-ins. However, we've even treid disabling these and trying to save but the same problem remains!

Anyone any idea?


texts:
I am trying to create a "Notify me" feature if the stock is unavailable.

On search on admin panel, I could find only that a user should sign up / log in to get notified about the stock availability.

But I just want to let the user (a guest) enter only his/her email address to get notified.

How should I do this?

Please give suggestions..

EDIT:

I have got this link, which gives me a way to start.

Till now what I did is added the following code in my template file which is creating a url for redirect (thinking to do it in ajax way).

<?php
      $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
      $base64 = strtr(base64_encode($actual_link), '+/=', '-_,');
      $postUrl = "http://$_SERVER[HTTP_HOST]/efk/productalert/add/stock/product_id/" . $simpleProduct->getId() . "/uenc/". $base64;
?>

In the above code, efk is my project folder name.

After this, I have gone to productalert/add/stock controller method i.e stockAction() which is calling sign up / login form (I think so) using $model->save();.

How should I disable this save calling and add my own small overlay which holds a textbox to enter a email address?


texts: Remove Sku Column from Transactional Email

texts:
I am trying to remove sku column from New order mail template.
I tried this. But there were still no changes in mail. I made changes in both base theme as well as in rwd theme which is by current theme. Any Ideas?

I have my cache disabled.
I did the same changes in rwd too.But no changes in my emails.


texts: We can't find products matching the selection - account issue

texts:
There is one member of staff who is getting error "We can't find products matching the selection"
when he logs in to the company website. Some one else using the same PC and same browser does not have the issue so it looks to be his account (I've checked the account on Magento admin and cannot see anything different to other accounts).
Can you advise please.


texts: Full Page Cache on CE 1.8 - An FPC Magento Module? Varnish? Both?

texts:
So I am a bit confused as I go about researching Full Page Caching for Community Edition 1.8.  I have already implemented a Two Level Redis Cache, CDN, tuned MySQL's my.cnf for max performance (w/ the DB being on a separate server of course), and I have 2 servers hosting our store behind a load balancer.  I say that to point out that I am not immediately jumping for the FPC before doing the initial performance tweaks.

I've never used Varnish before on any kind of site, let alone Magento, and I have never set up an FPC in Magento either.  I understand Varnish to be a proxy that acts as a cross between a CDN and a page cache on it's own, sending data to the browser before the request even gets to the web server.  And to my understanding, an FPC Module creates a cache locally that the webserver itself dishes out.  I know that for both setups, you need to do some "Hole Punching" to get the dynamic content through to the browser (though the techniques are different, between using a module or using Varnish).  Please correct me if I am misunderstanding anything here.

Up until just now, I thought of them as two separate entities that you could implement it help out your site, but now somethings I have read seem to imply the opposite.  My original plan was to buy the "Warp Advanced Full Page Cache" module for Magento (Formerly the "Tiny Brick Lightspeed FPC", I believe) as it seems to be the most popular, if a touch on the pricier side (but, frankly, $350 isn't much for our company, especially for what it can do).  Myself and 2 of my fellow developers were planning on learning out to implement it properly and fully within our own custom, homemade theme to maximize what we can get out of it.  After that was done, at some point down the road, I figured I would look into implementing Varnish as well - but, as I said earlier, I had understood them to be separate.

Now, however, I am starting to come across extensions like this PageCache Powered by Varnish that is free, or this Vortex Cache Powered by Varnish Cache which is nearly $800 USD, that are Magento Full Page Cache modules that work directly with Varnish.

My question to you, stack exchange, is how should I be seeing a FPC and Varnish?  As separate entities?  If so, are they mutually exclusive?  Are they two sides of the same coin that I should implement together?  Or are they similar but neither exclusive nor inclusive of one another?

Can I use the Warp Advanced FPC I mentioned above with Varnish?  Should I use it with Varnish?  Or would it be better to use a different FPC if I plan on using Varnish?  OR even further, is there an FPC so good that I don't need Varnish?  Or vice-versa, should I just use Varnish and ditch the FPC idea?

Sorry for the wall of text, but I have been looking at a lot of articles, blogs, and forum posts, and I haven't been able to discern a definitive answer to those questions.  I truly appreciate your help and input in this matter =)

Oh and lastly, a quick question about Varnish and webservers.  Currently I am using the normal Apache LAMP stack setup, but for a while now I've been seeing people rave about using Nginx with Magento.  I've done some tests myself, stress and load tests, and it seems that it can definitely work a bit better in the right conditions.  As such, I was considering switching at some point in the near future.  Would this in anyway affect my desire and decision to use an FPC and/or Varnish?

Thank you!!!

EDIT:  Oh!  And one more quick question - Since I have two servers hosting my site behind a load balancer (which is also a setup that can be increased horizontally should the need arise), I make full use of Redis and Memcached hosted on a separate server from the Web and DB ones for my sessions and each level of Magento's (well, Zend's) Two Level Cache.  I assume the FPC would store it's data in one of those to systems?  Would I need to have a specific extension to store it there or do they all do it?  And while I assume not, would this affect Varnish in anyway?  Thanks again!!


texts: Error while running the integration test

texts:
I am trying to create a integration test to check if my module is enabled or not.

Following is the code in my test class

<?php

namespace Anshu\Learning\Test\Integration;

use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Module\ModuleList;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\TestCase;

class LearningConfigTest extends TestCase
{
    private $moduleName = 'Anshu_Learning';

    public function testIsModuleConfiguredAndEnabled()
    {
        /**
         * @var ObjectManager $objectManager
         */
        $objectManager = new ObjectManager($this);

        /**
         * @var DirectoryList $dirList
         */
        $dirList = $objectManager->getObject(DirectoryList::class, ['root' => BP]);

        /**
         * @var DeploymentConfig\Reader $configReader
         */
        $configReader = $objectManager->getObject(DeploymentConfig\Reader::class, ['dirList' => $dirList]);

        /**
         * @var DeploymentConfig $deploymentConfig
         */
        $deploymentConfig = $objectManager->getObject(DeploymentConfig::class, ['reader' => $configReader]);

        /**
         * @var ModuleList $moduleList
         */
        $moduleList = $objectManager->getObject(ModuleList::class, ['config' => $deploymentConfig]);

        $this->assertTrue($moduleList->has($this->moduleName), 'Module is not enabled');
    }
}

While running the test I am getting error message Use of undefined constant BP - assumed 'BP' (this will throw an Error in a future version of PHP)

And when I am changing BP to DirectoryList::ROOT then I am getting following error message

array_keys() expects parameter 1 to be array, null given
 vendor/magento/framework/App/DeploymentConfig/Reader.php:113
 vendor/magento/framework/App/DeploymentConfig.php:140
 vendor/magento/framework/App/DeploymentConfig.php:70
 vendor/magento/framework/Module/ModuleList.php:143
 vendor/magento/framework/Module/ModuleList.php:114
 app/code/Anshu/Learning/Test/Integration/LearningConfigTest.php:49

PHP version is 7.2

May someone can help me to figure out and fix the issue.


texts: How to filter product collection with 3 attributes (distinct rows)?

texts:
I have a product with 3 attributes(color,size,brand) and some other attributes.

I need to display above 3 attributes in a table with unique rows.

For example product1 values: green,12,samsung

product2 values :yellow,12,samsung

product3 vaules:green,12,samsung.

So I need to get only (product1 or product3 ) & product2 from collection.

(because product1 & product3 all values are same.So i want to avoid duplicate rows)

and my sample code:

$collection=Mage::getResourceModel('catalog/product_collection')->distinct(true);

How to write query to get above one.
Can any one help this ?
Thanks in advance.


texts: Magento 2 display if order status value contains both Delivery / delivery

texts:
We have migrated orders data but old orders we have sales_order_grid & sales_order order status is Delivered but in M2 we are considering status as delivered

We would like to adjust the order grid column to use both formats. please advise


texts: Magento 2 How to hide free shipping method at checkout?

texts:
We are using this plugin -
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Quote\Model\ShippingMethodManagement">
        <plugin name="shipping_method_management" type="Xyz\AdvancedTax\Plugin\Model\ShippingMethodManagement" disabled="false"/>
    </type>
</config>

<?php
namespace Xyz\AdvancedTax\Plugin\Model;

class ShippingMethodManagement {

    public function afterEstimateByExtendedAddress($shippingMethodManagement, $output)
    {
        return $this->filterOutput($output);
    }
    private function filterOutput($output)
    {
        $free = [];
        foreach ($output as $shippingMethod) {
            if ($shippingMethod->getCarrierCode() != 'freeshipping' && $shippingMethod->getMethodCode() != 'freeshipping') {
                $free[] = $shippingMethod;
            }
        }
        //print_r($free->getData());
        if ($free) {
            return $free;
        }
        return $output;
    }
}

It is only hiding for guest customer but it is not hiding when customer login.


texts: How should I save new or updated entities of models?

texts:
In Magento 2 we have repositories classes. Classic method save() used heavily in Magento 1.9 are deprecated, if I am correct, from 2.04 or 2.05. I was using factories to create new object and after setting properties of new, for example product i have called save():

$productFactory->create()->setName()...->save()

On the other hand we have repositories also containing method save.
I am using it in nutshell like this:

$product = $productFactory->create()->setName()...
 $productRepository->save($product)

In my code I have classes working both ways. I also have noticed that sometimes different ways means different behaviour. Has the way with repositories some additional validation of data provided?

Which way I should do it?


texts: Magetn2: How to install extension via composer with github and marketplace component

texts:
I need to install the extension via the composer without GitHub and marketplace component.

Need to install with local repo directory.

I am stuck with this. Can you please help with the same?

Thanks


texts: Display images instead of Custom option values

texts:
we are adding Custom options to the products with custom options Values as "Black" & "Green".

in frontend , its displaying like below image as in link1 :

But instead of text - Black & Green , i want to display images as below....

i uploaded Black & Green images to below path :

if custom option value is green, i want to display below image :

http://sbdev2.kidsdial.com:81/media/catalog/custom/green.png

if custom option value is black, i want to display below image :

http://sbdev2.kidsdial.com:81/media/catalog/custom/black.png

app/design/frontend/base/default/template/catalog/product/view/options/type/select.phtml

<?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Select */ ?>
<?php $_option = $this->getOption() ?>

<label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '*' ?><?php echo  $this->escapeHtml($_option->getTitle()) ?>

<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>

        <?php echo $this->getValuesHtml() ?>
        <?php if ($_option->getIsRequire()): ?>
            <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX): ?>
                <span id="options-<?php echo $_option->getId() ?>-container">
            <?php endif; ?>
        <?php endif;?>


texts: Percentage of Discount based on the Cart Subtotal?

texts: I have to apply 10% discount of subtotal in the cart page. In the backend configuration of the Magento, I could see the option of applying fixed amount discount for whole cart. But I need percentage of discount of the cart sub total. How to do it? Can I achieve it by backend configuration itself or it will need code rewriting?


texts:
How to convert this query in magento style

    `SELECT MAX(s.num) FROM (
       SELECT CONVERT(SUBSTRING_INDEX(sku,'-',-1),UNSIGNED INTEGER) AS num
       FROM catalog_product_entity
       WHERE (sku REGEXP "^[0-9]+$")
    ) as s`

If you offer a good article that will help me, then I will take it as an answer.

UPDATE

I write this query :

    $select = $connection->select()
                ->from(
                    $connection->select()->from(
                    'catalog_product_entity',
                    ['num' => new \Zend_Db_Expr('SELECT CONVERT(SUBSTRING_INDEX(sku,\'-\',-1),UNSIGNED INTEGER')]
                )->where(
                    $connection->quoteIdentifier('sku') . ' REGEXP :pattern'
                ),
                    [ new \Zend_Db_Expr('max(t.num)')]

        );
            print_r($select->__toString()); exit();

But select duplicated

SELECT max(t.num) FROM (
   SELECT SELECT CONVERT(SUBSTRING_INDEX(sku,'-',-1),UNSIGNED INTEGER AS `num`
   FROM `catalog_product_entity` WHERE (`sku` REGEXP :pattern)
) AS `t`


texts:
I want to redirect my view to the homepage after data submitted in a custom form

  $resultRedirect->setPath('//');

This code leads to redirection, for now, please help

Also is it possible to get a delay of 5-10 sec in  redirection


texts: Magento 2: get "Sort By" filter options in Rest API

texts:
Need to get Sort By List of Options category products list page using Rest API.

I have checked default REST API but can't get the same.

https://devdocs.magento.com/swagger/

Any have idea how to get Sort By List of Options of category products list page using Rest API.

Any help would be appreciated. Thanks.


texts: how to override available.phtml file of shipping method

texts:
I am using below code in our layout file -

<?xml version="1.0"?>
<layout version="1.0.1">
    <checkout_onepage_index>
        <reference name="checkout.onepage.shipping_method.available">
            <action method="setTemplate"><template>mydirectory/checkout/onepage/shipping_method/available.phtml</template></action>
        </reference>
    </checkout_onepage_index>
</layout>

But its not overriding the respective file. I am working on magento1.9.2.2.
What I am doing wrong here.
File over the respective directory is present, also setted the permission 777.


texts: Product "save and continue" redirect to dashboard?

texts:
When I add

  an iframe

into the product description textarea to display the video on the product page and then click on

  save & continue

button, it redirects to the dashboard.

But If I remove the iframe then it works fine.

Can I add iframe into description Textarea?


texts: Position sort not working on product listing page magento2.2.7

texts: But not showing correct order on category page.


texts: Product Attribute asking Values required

texts:
I have created product attribute and have given value for value required is "No". But in frontend, that product attribute is asking the value.

Below I have attached images of that. please help me to solve because it has been taking too many days.


texts: Cannot install SUPEE 10572 patch on Magento CE 1.6.0.0

texts:
Already removed SUPEE-10570v1 and install SUPEE-10570v2 but error in below files.

File app/code/core/Mage/Admin/Model/User.php
Hunk #1 FAILED at 127.

File app/code/core/Mage/Customer/controllers/AccountController.php
Hunk #2 FAILED at 812.


texts: Cache Types are Invalid. How can i resolve this permanently?

texts:
Error: One or more of the Cache Types are invalidated: Configuration, Page Cache. Please go to Cache Management and refresh cache types.
How can i resolve this permanently?


texts: Add custom File Upload attribute to admin user

texts:
I want to add Custom tab below the User Info tab, in which I want add new custom field to upload images.
How to achieve this?


texts: model name in obsever - use full or alias

texts:
When creating an observer, in config is there a preference over the two following styles and if so which and why?

            <observers>
                <me_mymodule>
                    <class>me_mymodule/observer</class>
                    <method>observe</method>
                </me_mymodule>
            </observers>

or

            <observers>
                <me_mymodule>
                    <classMe_Mymodule_Model_Observer</class>
                    <method>observe</method>
                </me_mymodule>
            </observers>

e.g. use the full class name or the class alias?


texts: Are there any restrictions on classes you can override with preference in di.xml

texts:
When overriding a class with a custom one using the di.xml, are there any restrictions on what class you can override?

I have tried overriding a class of a third party module, but it does not appear to work. This class does not implement any interface, so I thought that maybe it's only interface implementations that can be used here?

Example:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Amasty\Feed\Model\Export\Adapter\Csv" type="Engmaso\Feed\Model\Export\Adapter\Csv" />
</config>

So here I'm trying to simply add my class in place of the Amasty one, but my class is never loaded.


texts: How can i Edit Category Description File

texts:
I want to  some changes in  category Description  how can I edit this file?

its calling from.
app/design/frontend/default/spazeapparel/template/catalog/category/view.php

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>

But i am unable to find particular  description file .


texts:
Magento 2 minicart issue
Please suggest for below issue.


texts: Adding Custom Tabs in Product Detail Page

texts:
I have created an attribute with "Product Details" as Textarea in admin panel.

Now I need to make it display as "Product Details" next to description tab in product detail page for each and every product.

Any suggestions please.


texts: Magento 2 : Create order programmatically with payment

texts:
I want to create order programmatically with payment by token.

I checked many tutorials but not getting success.

Can anyone please help me to create script for that?

Thanks.


texts:
I have successfully Magento 2.3 venia theme with my backend URL. And every query was validated and theme working successfully. But the issue is I could not add products in the cart. This 400 error is what I got.

POST /rest/V1/guest-carts/Hrx6ctErQTVBWkrTU6A8rlWyj4NfA1WN/items 400 3173.894 ms - 755

Also, product images return

GET /media/catalog/product/ 404 2875.405 ms - 7259

I couldn't even guess what is the issue, I need some react or Magento experts
advice or help.


texts:
I've noticed that if you create a widget instance, then add a layout update, if you choose to add a widget instance to a single page, say cms_index_index, the next time you edit the widget instance, the block reference list only includes the blocks in default. If you wish to save a change you have to select a difference page, then change it back to re-populate the block drop down with the correct value for that page.

I've been routing around the blocks and templates for the last 20mins look for a solution. I seem to be getting some success by editing Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout::getDisplayOnContainers and doing $container['pages'] = $this->getPageGroups() before returning the $container array. This seems to ensure that when getDisplayOnContainers is called in the template, the required handles are present on the page for the current instance. I've not had enough time to dive deep enough into this to see if there are any repercussions however.

Does anybody else have any experience with this issue?

P.s. Has anybody reviewed any of this functionality in Magento 2. I've not had enough free time to look, but I'm kind of hoping they'll go a step further and allow developers to add their own 'page types'.


texts: What would cause an error in authorizing payment?

texts:
I am using Magento 1.9.3.1. I wanted to add a custom shipping module and I used this tutorial- https://code.tutsplus.com/tutorials/create-a-custom-shipping-method-in-magento--cms-23747

When I use any other shipping option everything goes through. When I use this shipping option I get "Error Authorizing Payment", with no other error information. Is there something else I need to do for a custom shipping method work? I use Chargelogic for credit card payments.

Edit:
Here is the stack trace from the log-
Stack trace:

#0 /www/sites/www.site.com/files/html/app/code/local/ChargeLogic/Connect/Model/Connect.php(96): Mage::throwException('Error in author...')
#1 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Order/Payment.php(1089): ChargeLogic_Connect_Model_Connect->authorize(Object(Mage_Sales_Model_Order_Payment), 288.6)
#2 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Order/Payment.php(342): Mage_Sales_Model_Order_Payment->_authorize(true, 288.6)
#3 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Order.php(896): Mage_Sales_Model_Order_Payment->place()
#4 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Order.php(1114): Mage_Sales_Model_Order->_placePayment()
#5 [internal function]: Mage_Sales_Model_Order->place()
#6 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#7 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#8 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#9 /www/sites/www.site.com/files/html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#10 /www/sites/www.site.com/files/html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(815): Mage_Sales_Model_Service_Quote->submitAll()
#11 /www/sites/www.site.com/files/html/app/code/core/Mage/Checkout/controllers/OnepageController.php(578): Mage_Checkout_Model_Type_Onepage->saveOrder()
#12 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#13 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#14 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /www/sites/www.site.com/files/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 /www/sites/www.site.com/files/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /www/sites/www.site.com/files/html/index.php(84): Mage::run('', 'store')
#18 {main}


texts: Updating Magento 2 using composer - zlib_decode(): data error

texts:
I'm tried update my Magento 2.1.0 to 2.1.5 using composer update and changing the composer.json file, but shows up this error message below, what can I do to run normally?

Failed to decode response: zlib_decode(): data error


texts: How to make a field dropdown with value in Dynamic Row magento 2 Admin

texts:
I just created a dynamicRow using UIform (UiComponent). In this the value field I want to make it drop-down with predefined values. How to make it a drop-down, also I want to change another field's datatype:textarea.

My form.xml:

<dynamicRows name="Sample" sortOrder="50" >
        <settings>
            <addButtonLabel translate="true">Add Value</addButtonLabel>
            <additionalClasses>
                <class name="admin__field-wide">false</class>
            </additionalClasses>
            <componentType>dynamicRows</componentType>
            <dndConfig>
                <param name="enabled" xsi:type="boolean">true</param>
            </dndConfig>
        </settings>
        <container name="record" component="Magento_Ui/js/dynamic-rows/record">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="isTemplate" xsi:type="boolean">true</item>
                    <item name="is_collection" xsi:type="boolean">true</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/dynamic-rows/record</item>
                    <item name="componentType" xsi:type="string">container</item>
                    <item name="dataScope" xsi:type="string">data.row</item>
                </item>
            </argument>
            <field name="name" formElement="input">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="dataScope" xsi:type="string">name</item>
                        <item name="fit" xsi:type="boolean">false</item>
                        <item name="label" xsi:type="string" translate="true">NAME</item>
                        <item name="dataType" xsi:type="string">text</item>
                    </item>
                </argument>
            </field>
            <field name="value" formElement="input">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="prefixName" xsi:type="string">value</item>
                        <item name="prefixElementName" xsi:type="string">option_</item>
                        <item name="dataScope" xsi:type="string">value</item>
                        <item name="fit" xsi:type="boolean">false</item>
                        <item name="label" xsi:type="string" translate="true">VALUE</item>
                        <item name="dataType" xsi:type="string">text</item>
                    </item>
                </argument>
            </field>
            <actionDelete name="action_delete">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="fit" xsi:type="boolean">true</item>
                        <item name="prefixElementName" xsi:type="string">option_</item>
                        <item name="prefixName" xsi:type="string">Params.delete</item>
                        <item name="dataType" xsi:type="string">text</item>
                    </item>
                </argument>
                <settings>
                    <dataType>text</dataType>
                    <componentType>actionDelete</componentType>
                </settings>
            </actionDelete>
        </container>
    </dynamicRows>

Thanks in advance.


texts: Magento admin form validation doesn't working?

texts:
I have a custom grid in Admin panel. When you want to edit entries to the grid it will load a form. The required field validations of this form are not working. I have define the fields as below.

$fieldset->addField('discount', 'text', array(
                'label'    => $helper->__('Discount Amount (%)'),
                'required' => true,
                'class'    => 'required-entry',
                'name'     => 'discount',
                'index'    => 'discount',
        ));

Adding below two attributes not working. It saves even if the fields are empty.

'required' => true,
'class'    => 'required-entry',

Am I missing something else here?


texts:
I am having a problem with some of my Magento websites. I get the message "The connection was reset" in Firefox or "No data received" in Chrome, while my other sites (custom build PHP sites) are working perfectly. This happens time by time (for example once in a while, like 4 to 5 days)

I have searched for apache log error but there is nothing strange there.

I have been using APC for cache and i tried without it but after some time i get this error again and it is solved only by restarting the Apache server.

Environment information:
Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 running CentOS
PHP Hander: DSO (because i am using APC)
PHP Version 5.4.24
Apache 2.4 (already had the 2.2 but the same problem)
Intel® Core™ i7-920 Quad-Core
48 GB DDR3 RAM

UPDATE: This problem happens only with Magento 1.7, i have and a 1.8 Magento site in the same server but it works fine when the other site has this problem.

I don't really understand what can cause this problem.


texts: Magento2 : Plugin for send email function

texts:
i'm trying to make plugin to custom email function, i need to create two field more first name and last name.I need to use plugin to get value of the first-name and last-name. When sending email, the value of two field will be showed. I do not know how to do it.

Any suggestion?

Thanks


texts: How to add custome tab in order page magento 2?

texts:
I need to add custom tab in magento 2.

Admin > sales > order next to action and to display content below it.


texts: When does Magento use sessions and when cookies?

texts:
I know Magento has following core functions for session and cookie handling:

Mage::getSingleton('core/cookie');
Mage::getSingleton('core/session');

When does Magento set Cookies and when PHP Sessions? What are the use cases?

I'm a bit confused, because I know Magento stores the cart information in Mage::getSingleton('checkout/session') and the status of the user in Mage::getSingleton('customer/session'). But the checkout session doesn't seem to be a session, but a cookie instead. Because when I close the browser and re-open the page the items are still in the cart.

Does that mean, that the checkout/sessionmodel sets cookies and not the global $_SESSION variable?


texts: Disallowed file format in Magento 1.9.2.2 after patch upload

texts:
I installed patch 8788 on my Magento shop, but now i get the error "Disalollowed file format." (I think they mean "Disallowed file format.") when i want to upload an image in at my products.

How is this possible and how to solve it?


texts: How dependency injection works for Interfaces in constructors

texts:
As far as I know you can set a preference for an Interface in the di.xml of an extension.
But i see several Interfaces without any reference in the di.xml.
How are these instantiated?

Examples:
app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php

The constructor contains that code:

 \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,

or
app/code/Magento/Payment/Model/Info.php

\Magento\Framework\Encryption\EncryptorInterface $encryptor


texts: How to create a dropdown option as a configuration section to update the options from backend and show it from product details page?

texts:
I want to add a select box to the product details page.
Which has several options but this is not a product attribute. It should configure as a global variable.
Admin should able to add new options too from the backend.
I tried the system.xml way and I couldn't update the new option value for the select box I created.
Can someone help me to do this, please?


texts: How to allow REST API calls from localhost or 127.0.0.1?

texts:
We are trying to develop an application (in Angular) to make REST API calls to Magento. How can we modify Magento's ".htaccess" to allow calls from http://localhost:4200 or http:\\127.0.0.1 ? This will help us a lot in development.

Our test magento store is at http://www.ngstrorefront.com/magento

Works: Calling this http://www.ngstrorefront.com/magento/rest/V1/products?searchCriteria[pageSize]=5 directly from POSTMAN (with conten-type and authorization headers)

Works: Angular application http://www.ngstrorefront.com/core/products (works.. can fetch data from Magento running on the same domain)

Fail: When we run the Angular application from localhost making calls to http://www.ngstrorefront.com/magento/V1/products?searchCriteria[pageSize]=5 we see CORS errors.


texts: Do not allow comma or point on input text

texts:
How could I validate only integer numbers on input text Magento?

The file I need to change in text.phtml and I know all of the validation terms on prototype, so I just need to know how to insert this on the code.


texts: M2.2: Using REST API, Can Clear Cart but Mini-Cart Not Clearing

texts:
We are currently integrating another checkout portal to go on top of our existing Magento 2 platform. They are using the REST API to do most of their calls to Magento 2, including that of clearing the cart. When clearing the cart on the portal, it will clear it fully, and when coming back to the Magento 2 side, the cart will be empty, however the Mini-Cart will still be populated with all the items that we're previously there before being cleared.
They are using the specific endpoint:
DELETE method : rest/V1/carts/mine/items/#ITEM_ID#

However they have not found any other means of clearing the cart, and using the above results in the mentioned issue of the mini cart still being populated.
I have done a little research and found that it appears the mini-cart information stays due to being stored in local storage. It is mentioned to try using;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cartObject = $objectManager->create('Magento\Checkout\Model\Cart')->truncate();
$cartObject->saveQuote();

or
$cart->truncate()->save();
Where $cart is an instance of \Magento\Checkout\Model\Cart.

However I wouldn't know where to make those above changes, nor aware if that will achieve the result of having both carts emptied when they use the DELETE method endpoint. Is there a different method I should have them use to clear both the cart and mini-cart while just having access to the REST API endpoints? Or something I can change on my end that will clear it for them when the endpoint is called, like hooking into the above API method and truncate the mini-cart from the Magento 2 code?


texts: Magento 2 not working after attempted upgrade to 2.4.0

texts:
I tried to upgrade magento from 2.3.5-p2 to 2.4.0 but I got an error in the frontend, so I changed back to 2.3.5-p2, deleted my whole vendor folder and executed composer update again.
But now my frontend does not work anymore and I get
There has been an error processing your request Class
Magento\Csp\Model\BlockCache does not exist

If I execute php bin/magento setup:upgrade then I get There are no commands defined in the "setup" namespace.
And if I execute php bin/magento list then I get:

Magento CLI 2.3.5-p1
Usage:   command [options] [arguments]
Options:   -h, --help            Display this help message   -q,
--quiet           Do not output any message   -V, --version         Display this application version
--ansi            Force ANSI output
--no-ansi         Disable ANSI output   -n, --no-interaction  Do not ask any interactive question   -v|vv|vvv, --verbose  Increase the
verbosity of messages: 1 for normal output, 2 for more verbose output
and 3 for debug
Available commands:   help  Displays help for a command   list  Lists
commands
In ServiceManager.php line 1129:
An abstract factory could not create an instance of
magentosetupconsolecommanddbstatuscommand(alias:
Magento\Setup\Console\Command\DbStatusCommand).
In ServiceManager.php line 940:
An exception was raised while creating
"Magento\Setup\Console\Command\DbStatusCommand"; no instance returned
In ClassReader.php line 26:
Class Vertex\Tax\Setup\Schema\Triggers\MigrateVertexInvoiceSent does
not exist
[company@company company.de]$ php bin/magento setup:upgrade
There are no commands defined in the "setup" namespace.

So I deleted my setup folder and copied another one from a working magento 2 copy, but it still fails with the same error.


texts:
I created a block to home page,
the code is:
{{block type="catalog/product_new" column_count="6" products_count="12" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

but the block title not show in the home page,

just has a '

' tag.

And I found this code in the new.phtml template file:

<?php echo $this->getBlockName(); ?>

why? how to display the block title?


texts: Automatically change an attribute based on another attribute

texts:
I am using an Observer to change an attribute value. The event used is catalog_product_save_before. I don't understand why my attribute is saved after the second save of product.

public function changeProductAttributes(Varien_Event_Observer $observer)
{
    $product = $observer->getProduct();

    $groupPrices = $product->getData('group_price');
    if(empty($groupPrices)){
        $product->setMembersOnlyPrice(false);
        $product->getResource()->saveAttribute($product, 'members_only_price');
    }
    else {
        foreach ($groupPrices as $groupPrice) {
            if($groupPrice['cust_group'] == 1){
                $product->setMembersOnlyPrice(true);
                $product->getResource()->saveAttribute($product, 'members_only_price');
                return $this;
            }
            else {
                $product->setMembersOnlyPrice(false);
                $product->getResource()->saveAttribute($product, 'members_only_price');
            }
        }
    }
    return $this;
}


texts: How to switch the entire site to https while keeping the Search Engine indexed pages working?

texts:
Magento 1.9.1
Porto theme

Apparently Google will start penalizing sites that are not completely run on https.

I have 2 questions:

How to make it so that my entire site runs on https?
How NOT to loose any of the links that are already indexed by Google? I read that Google sees the same URL with http and https as 2 completely different things

Also we seem to have a problem with  the

  "Create Permanent Redirect for old URL".

I have that checked but Google found 922 Site not found Crawl Errors

they come up with a

  "404 You might want to check that URL again or head over to our
  homepage."

Page on my site when you go to that URL.

We did change the category structure recently and I re-indexed everything after that.

When I go to CATALOG - URL REWRITE Management - it shows 330684 records. (I checked this a few days earlier and it had a Total 322505 records found which means an increase of 8000+ records in 2 days - why is that? What does this mean? And what do I need to do with it?)


texts:
I have some attribute with more that 300 values in Magento. I am trying to delete some, when I click delete the value does not show anymore so I save the attribute and the message "attribute saved" display but the value is still there when I check the attribute again.
Any idea on how to solve this will be really helpful.

Thanks


texts: Save a custom attribute from shipping method to quote_address

texts:
I have created a custom shipping method which allows delivery to a local office of the carrier. I have created a select when the shipping method is selected, so the user picks the office. Now I need to store the office ID to quote_address when it is provided.

I have managed to add that field to extension_attributes, so when the checkout form is submitted, this is passed to the back-end (@ http://website/rest/default/V1/guest-carts/e01f063c3b16e082b3546697e321e643/shipping-information:

carrier_office in extension_attributes is what I need to save.
I already created an install script, which creates a column in quote_address and its there in the database. I just need to save the value to it.

What I've done is first, I set up an extension field in in extension_attributes.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
        <attribute code="carrier_office" type="string"/>
    </extension_attributes>
</config>

Then in di.xml I set up a plugin:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Vendor_Module\Api\OfficeManagementInterface" type="Vendor_Module\Model\OfficeManagement" />
    <preference for="Vendor_Module\Api\Data\OfficeInterface" type="Vendor_Module\Model\Office" />
    <type name="Magento\Quote\Model\ShippingAddressManagement">
        <plugin disabled="false" name="Creatizmo_Speedy_Plugin_Magento_Quote_Model_ShippingAddressManagement" sortOrder="10" type="Vendor_Module\Plugin\Magento\Quote\Model\ShippingAddressManagement"/>
    </type>
</config>

Where of course Vendor_Module is replaced with my module's name.

And then in Plugin/Magento/Quote/Model/ShippingAddressManagement:

namespace Vendor_Module\Plugin\Magento\Quote\Model;

class ShippingAddressManagement
{
    protected $logger;

    public function __construct(
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->logger = $logger;
    }

    public function beforeAssign(
        \Magento\Quote\Model\ShippingAddressManagement $subject,
        $cartId,
        \Magento\Quote\Api\Data\AddressInterface $address
    ) {

        $extAttributes = $address->getExtensionAttributes();

        if (!empty($extAttributes)) {

            try {
                $address->setCarrierOffice($address->getCarrierOffice());
            } catch (\Exception $e) {
                $this->logger->critical($e->getMessage());
            }

        }

    }
}

In the last file I can see the extension attribute with the correct ID (if I dump it), but it's not saved. It seems $address->setCarrierOffice is not doing its thing or maybe it's not the right place for a hook.. I don't know

Any suggestions on what I'm doing wrong or what I should be doing are highly appreciated.


texts: display out of stock products progrmmatically in catalog product list block

texts:
I override Mage/Catalog/Block/Product/List.php block and I want to display all products out of stock and if qty is 0 as well as  in stock products progrmmatically.

protected function _getProductCollection()
    {
        parent::_getProductCollection();

        $this->_productCollection->addAttributeToSelect('*')
        ->addAttributeToFilter(
        array(
            array('attribute'=> 'is_in_stock','eq' => 0),
            array('attribute'=> 'is_in_stock','eq' => 1)
        )
        );

     echo "<pre>";
     print_r($this->_productCollection->getData());
     die();

        return $this->_productCollection;
    }


texts: How can I change what this error message says?

texts:
How would I change the error message here in Magento2 from "Something went wrong while processing your quote. Please try again later." to "Please login in to process your quote."
I can not seem to find the code to change the error message.


texts:
In particular, I'm working on a Magento site with a custom module that is only accessible if you include /index/ at the end of the module's frontend route. So the route is setup like this:

<frontend>
    <routers>
       <mycompany_mymodule>
           <use>standard</use>
           <args>
               <module>Mycompany_Mymodule</module>
               <frontName>shortname</frontName>
           </args>
       </mycompany_mymodule>
    </routers>
</frontend>

On some servers and local installs of the site, example.com/shortname/ works. However, on others you get a 404 unless you go to example.com/shortname/index/

This leads me to a few questions:

Any idea what causes the requirement for /index/ in the route on some servers?
As a whole, are "index" as a default controller and "index" as a default action hard coded into Magento or is it something that can be customized per module?
Particularly where in the code does Magento look for "index" controllers and actions?


texts: Magento 2 - How to disable cronjob temporarily

texts:
I have a crojob in my custom module and want to disable it temporarily

The xml files for the cronjob are:

app/code/Vendor/Module/etc/cron_groups.xml
app/code/Vendor/Module/etc/crontab.xml

I have tried to comment out the code fro cron scheduling

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="my_cron_id">

        <!--<job name="my_cron_name" instance="Vendor\Module\Cron\MyCron" method="execute">
            <schedule>0 3 * * *</schedule>
        </job>-->

    </group>
</config>

But after this, my module went stopped working with no error.

I just simply wants to disable it temporarily how can I do this?


texts: How can I specify a template in layout xml and use it in a controller action?

texts:
So far I have created my own module with an index controller.

public function indexAction()
{
        $this->loadLayout();
        $thing = $this->getLayout()->createBlock('Mage_Core_Block_Template','two',array('template' => 'myorg/mymod/mytemplate.phtml'));
        $this->getLayout()->getBlock('content')->append($thing);
        $this->renderLayout();
}

I have been able to specify the layout of the controller programmatically, but I would like to specify it using the layout xml if that's possible.

Also I would like to specify this in such a way that I can use the

<?php $this->getChildHtml('xxx'); ?>

function in my template.

How do I do this?

P.S I am just at Hello world in the area of custom module making so I will need to know the correct xml conventions to use to add the template.


texts: how to sort products on custom attribute and then on sku in magento 2 category page

texts:
how to sort products on custom attribute (i.e. brands) first and then on sku in magento 2 category page

For example

if 10 products have same brand then it should sort that 10 products on SKU


texts:
I'm having a problem with product images. The website built on magento version 1.9.3.1; in Back end, manage product-product-images, I do not see the uploaded images for the product.

also attach a picture to understand the problem.

How can I fix this issue?

Thanks


texts:
Is there way to create an Magento 2 extension template code as a start?

In this way, we need not learn all the naming convention, but still get it working.

More like an hello world application with various different methods like front-end page, back-end page, crons etc.


texts: How to get Label and Value both from system.xml. Magento 2?

texts:
I want to get the value and label both from the system.xml
I'm trying

  etc/adminhtml/system.xml

<field id="link" translate="label" type="select"
                sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Link</label>
                <source_model>Vender\Module\Model\Config\Source\Link</source_model>
                <depends>
                    <field id="enabled">1</field>
                </depends>
            </field>

which returns me dropdown menu now when I get tried to get value from this function then its only return me the value but I also want the label as well how can I get both of these values?


texts: Product Image Preview in Admin Not Displaying Anymore , i get to an unknown text. any suggested for this problem ?.


texts: Magento 2 Error 500 when viewing all products in a certain category

texts:
As soon as I select "limit all", i get a server error.

All other pages are working fine. I increased my memory limit to 4 GB, checked file permissions, etc.

My error log just says Error 500.

My best guess is that it could be some kind of limited resources, cause I am working with configurable products (so for every configurable product there are 30 single products).

Edit:
The error is: premature end of script. Turning of the cache works for me, however i still need to figure out how to solve it with cache turned on.


texts: Magento 2.1.7 and Engintron (nginx) multistore configuration

texts: I cannot find where to enter the environment variables for multiple websites/stores using Engintron - the Magento documentation for nginx shows virtual host config files setting MAGE_RUN_CODE, but this does not seem to work. Does anybody know where these can be set?


texts: Render Column for Widget Grid Column (Sales Order Select Customer Grid )

texts:
I need to render email address for all customer while creating new order from admin. Adding renderer class for other grids is simple, But how to add renderer class when creating column using  Magento\Backend\Block\Widget\Grid\Column class.

Below is the code of adding email column to grid (vendor/magento/module-customer/view/adminhtml/ui_component/customer_listing.xml)

<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.customer.grid.columnSet.email" as="email">
<arguments>
    <argument name="header" xsi:type="string" translate="true">Email</argument>
    <argument name="index" xsi:type="string">email</argument>
</arguments></block>

I have tried adding "renderer" argument but  didn't worked.

<argument name="renderer" xsi:type="string">{{render class path }}</argument>

How can we add renderer class here?


texts: How to override the file name.phtml in my custom module: Magento-2

texts:
Vendor\magento\module-customer\view\frontend\templates\widget\name.phtml

override into my custom module

mycompany\custommodule\view\frontend\templates\widget\name.phtml

but I can't override this phtml file . If any one knows, help me?


texts:
I need to find a solution, where different logged in users can have shown different catalogues, decided by user role.

What I need is a basic catalog, that is then extended with the category COMPANY-A and corresponding products, when logged in as user with user role COMPANY-A. I need to be able to do this for multiple different companys.

I prefer a solution where it is as easy as possible for the client to create new products and categories for a specific user role.

Does anyone have a suggestion or know a great extension for this?


texts: Magento 1.9.2. - If the current customer does not place an order in a pre-established time

texts:
I would like to create an if with php where I assign an action if the current customer registered on my site in magento does not place an order after 6 months from his last order.

if(customer not place an order in six months){
//action
} else { //ok }

How can I do?

this is my try:

Sure: $_customer = Mage::getSingleton('customer/session')->getCustomer();
        $orders = Mage::getResourceModel('sales/order_collection')
            ->addFieldToSelect('*')
            ->addFieldToFilter('customer_id', $_customer->getId())
            ->addAttributeToSort('created_at', 'DESC')
            ->setPageSize(1);

    $date_order_creation=$orders->getFirstItem()->getCreatedAt();
    $previous_date = date('Y-m-d');

    $date_a = new DateTime($date_order_creation);
    $date_b = new DateTime($previous_date);
    $interval = date_diff($date_a,$date_b);

    if($interval->format('%d') > 1){

        echo 'more 1 day';
    }else{

        echo 'not yet 1 day';
    }


texts: magento website loads 2 images for a same product

texts:
i am working a magento website which is running on magento 1.9.2.2.

while working on its optimization, on tools pingdom i found a issue that page loads two images for a product i.e. small image and thumbnail image which ultimaltely leads to more http requests

can please anyone guide how do i let website to load 1 image per product.

screenshot attached.


texts: Create new M2 breakpoint with .media-width mixin?

texts:
I want to change the breakpoint of some some styles inside a native M2 module (specifically Magento_Catalog/web/css/source/_module.less).

Here is a link to the bp in question.

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {

I need to change this from @screen__m to a custom breakpoint (800px).

Now, you can't just change that and pass in a new value willy nilly.

According to the devdocs, you have to create a new mixin rule for a custom mixin.

As best I can see, this mixin .media-width acts as a giant switch statement. And if you haven't defined a case for a breakpoint value that is passed, it simply ignores that call.

So I create a new variable in my variable.less for my new value:

@bp-xm: 800px;

I add a new mixin rule into _responsive.less (I have already ported this file into my theme already). I add it to the "mobile" section, as I want this to apply on all device types, and styles-m.css is always loaded.

& when (@media-target = 'mobile'), (@media-target = 'all') {
        ...
        @media all and (max-width: @bp-xm) {
            .media-width('max', @bp-xm);
        }
        @media all and (min-width: (@bp-xm + 1)) {
            .media-width('min', (@bp-xm  + 1));
        }
    }

I call my new rule by changing the line in the _module.less to this:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @bp-xm) {

According to the devdocs, this is all that needs doing to create a new value that is passable into the .media-width. But when I run this, the section of code I wrap this .media-width code in doesn't output at all. In the final, rendered, CSS file, this chunk of code simply doesn't exist.

I must have missed something.

How do you properly create a new breakpoint for use inside the .media-width mixin?


texts: SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine

texts:
I have deleted cache, session and reports as per some of the other threads

I've deleted some other image files and larger files to bring my disk space down and have also paid for more disk space.

I'm still getting the error.

Thanks so much!


texts: How to get the current category url (including the parameters?)

texts:
For instance when visiting pages like example.com/men?p=2

Already tried with getting the current category from the registry, but then i would get only the url of the category (so only example.com/men)

Does anyone know how this could be implemented?


texts: Changing the customer/account layout to 2columns-left in Magento 2

texts:
I was easily able to make my entire site in Magento 2 from the default to 2columns-left by a few simple changes in the admin section.

I created my own theme with the fallback of the luna theme. All overrides and modifications were done in my new theme only.

However, when it comes to the customer/account/login page, it appears as a single column page with the login section at the top and the left menu bar spans the entire bottom of the screen.

How do I change the account/login page and the account/create pages to a 2column-left layout?


texts: How to use non class file and call Actions magento1.9?

texts:
I want to use webhook 3rd party after receiving (catch a response) in magento 1.9 my code I want to use like this calling at the end a function in IndexController.php
My file is Webhook.php ubicate at Helper folder.

require_once ("D:/wamp/www/magento1.9/app/code/local/Ns/Thorleif/controllers/Adminhtml/IndexController.php");

            $input = file_get_contents('php://input');
            $obj = json_decode($input);
            echo 'test1';

            switch ($obj->event) {
                case 'onProductCreated':
                echo 'test2';
                foreach ($obj->payload->SellerSkus as $sku) {
                    echo 'test3';
                    $prod = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('sku',$sku);
                    $skus = $prod->getData('sku');
                    $img = $prod->getData('image');
                    $websites = Mage::getModel('core/website')->getCollection()->addFieldToFilter('is_default', 1);
                    $website = $websites->getFirstItem();
                    $websiteId = $website->getId();
                    $websiteCode = $website->getCode();
                    $url = Mage::getConfig()->getNode('web/unsecure/base_url', 'website', $websiteCode);
                    $url .= 'media/catalog/product'.$img;
                    $xml = '<?xml version="1.0" encoding="UTF-8" ?><Request><ProductImage>';
                    $xml .= '<SellerSkus>';
                    $xml .= '<Images><Image>';
                    $xml .=
                    $url;
                    $xml .= '</Images></ProductImage></Request>';
                    echo $xml;
                    var_dump(Ns_Thorleif_Adminhtml_IndexController::postImage($xml));

                }

            }

But I receive this kind of issues

Class 'Mage_Adminhtml_Controller_Action' not found in D:\wamp\www\magento1.9\app\code\local\Ns\Thorleif\controllers\Adminhtml\IndexController.php</b> on line 2

Or if I put it like class file I have a "expecting function" error or "Mage" class doesn't find at level "Mage::getModel".
How Can I post at the end postImage($xml) called from controllers/Adminhtml/IndexController.php?


texts:
I am trying to make an AJAX request in my Magento 2.1.8 custom module.

The Http Post Request is returning all of the data i expect it to in JSON format, However it is also adding on some of my html code after it.

What could be causing this?

returning JSON object:

if ($result->num_rows > 0) {
            $return = [];
             while($row = $result->fetch_assoc()) {
                 $return[] = [
                    'id' => $row['id'],
                    'name' => $row['name'],
                    'created' => $row['created'],
                    'posts' => $row['posts']
                ];
             }

             header('Content-type: application/json');
             echo json_encode($return);

HTTP Post Request:

$.post("https://www.mywebsite.co.uk/forum/get/categories",
     function(data, status){
       console.log(data);
     });

The data being returned is correctly formatted JSON object and then goes straight into html:

[{"id":"1","name":"Tanks - Sub Ohm","created":"15-01-18","posts":"1"}]<!doctype html>
<html lang="en-GB" dir="ltr" class="ltr">
    <head >
        <script>............

How can i remove the HTML part?

Thanks.


texts: how to reindex magento 2 in wamp server windows8

texts:
I tired to re-index magento 2.0.7 using CMD with command of php bin/magento indexer:reindex but i received php is not recognized as an internal or external command,operable program or batch file.

Please help me in this


texts: Stack trace error, possible DB issue after module installation

texts:
I have installed an extension from connect and ran into an exception problem.  The website will not load and shows this error message:

  html/app/code/local/Ktree/Brand/sql/brand_setup/mysql4-install-0.1.0.php"
  - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'brand' already exists

I cannot log into magento connect to uninstall it either :(

Running CE 1.9.3.
Any ideas?


texts: How can I migrate product images to Magento2?

texts:
How can I migrate the images of my products from Magento 1 to my Magento 2?

I'll use the official migration tool of the Magento.

Thanks


texts: block is not rendered /custom block is not called at category page magento 1.9

texts:
i am try to create static block at category page,but its not called,

try this solutions:
clear cache,
allow block from admin,
disable magento cache from admin

from category setting selected 'static blocks with product'

/app/design/frontend/rwd/default/template/catalog/navigation/category.phtml

<?php
echo "hello";

/app/design/frontend/rwd/default/layout/catalog.xml

<catalog_product_view translate="label">
 <reference name="content">
 <block type="catalog/navigation" name="catalog.category" template="catalog/navigation/category.phtml" />


texts: redirect to shopping cart page customer logged in to site

texts:
after customer logged in  to our site, it's redirecting to "my account " page.

but i want to redirect to "shopping cart" page.

i reffered this link for

  [ Creating account = > Shopping cart  page]

now we need for

  "loogged in = > "shopping cart page

please help me to find solution


texts:
This issue is only on Chrome. I got redirected to the login page after login.
I tried the following:

1. I put this

<?php echo $this->getBlockHtml('formkey'); ?>

after the <form>

2. from system->configuration->web I put the Cookie Lifetime to 9600 or 96000 or 0 the Cookie Path and Cookie Domain i left it empty and i set the Use HTTP Only to yes or no , but the thing is whatever combination settings I do i still got redirected to the login page.

3. I checked the logs file, nothing relevant. I cleared the cache etc

4. I put this code:

if (!($formKey = $this->getRequest()->getParam('form_key', null)) || $formKey != Mage::getSingleton('core/session')->getFormKey()) {
    $this->getRequest()->setParams(array('form_key' =>Mage::getSingleton('core/session')->getFormKey()));
}

in my AccountController.php in the loginPostAction function, but it changed nothing.

After I clear my browser cache on chrome it works , but i logout and login in again i am redirected to login page. Any idea ??

[update]
Im storing the session in db : <session_save>db</session_save>


texts:
I am using Magento CE 1.7.0.2 and would like to alter some parts of the .pdf invoices that can be printed from the 'invoices' section of the site.

As you can see in the image above, I would like to alter the colours of the grey area towards the top as well as remove the reference to shipping charges in the 'Shipping Methods' section.

Any pointers would be really useful as this is proving really hard for me.

Thanks for any and all replies.

UPDATE.

To get rid of the 'Total Shipping Charges' section...

Moved:

app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php

to

app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php

then on line 445

altered:

$totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " "
                . $order->formatPriceTxt($order->getShippingAmount()) . ")";

to:

$totalShippingChargesText = "";


texts: Programmatically add customer to order during "sales_order_place_before" event

texts:
I have a situation where I am trying to associate a customer membership to an order during the sales_order_place_before event.

I though it would be pretty straightforward, however, whenever I try to attach a customer ID the order does not retain this information.

Can someone tell me specifically what needs to occur in order to assign a customer during the sales_order_place_before event.

If this event is not feasible, can someone tell me the correct way to go about what it is I am doing?


texts: Change quantity to a dropdown on product page

texts:
How do I change the Quantity text input box to a dropdown on configurable products?

I've got this piece of code in my /catalog/product/view/addtocart.phtml file

 <label for="qty"><?php echo $this->__('Quantity') ?></label>
    <select class="input-text qty" name="qty" id="qty">

      <?php $i = 1 ?>
      <?php do { ?>
        <option value="<?php echo $i?>">
          <?php echo $i?>
          <?php $i++ ?>
        </option>
        <?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()) ?></select>
    </div>
    <?php endif; ?>

This works well for the simple products, showing 1 to however many items I have in stock. But on configurable products, it only shows '1' in the dropdown. (likely because the configurable product itself doesn't have inventory)

I saw this stackexchange page, but haven't been able to adapt it to what I want.

Edit: Here's a use case -

Say I've got boots available in four sizes.

Boots:
Size 6 - 3 pairs
Size 7 - 2 pairs
Size 8 - 1 pair
Size 9 - 4 pairs

When I select "Size 6," I'd like the Quantity dropdown to be 1-3. If I select size 9, it should go up to 4.


texts: How can I know if a grouped products contains any MAP products?

texts:
Basically I need to know if a grouped product contains any MAP sub product.

Is it possible to get this information without loading all product associated to it?


texts: VAT error on promotion Zero-1 - Buy X get the cheapest free

texts:
we have an ongoing problem with using the Zero-1 - Buy X get the cheapest free promotion.
We have it set across a range of products on 4+1, it works great when the customer orders, say, 3 of 1 item and 2 of another. However, when the customer orders 5 of the same product, Magento minuses the cost of the item inc. VAT (all of our products are listed ex VAT) before VAT is added, thus giving them an extra discount as well as the product free.


texts: magento 2 web rest api - Get all products with a specific attribute code

texts:
I have some products with a custom attribute called "day_special" which may have a value of 'yes' or 'no'. When I called a product (say sku: abc115) through webapi (url: domain.com/rest/V1/products/abc115), It shows all the  product details and the "day_special" attribute is there within the "custom_attributes" section and values in it.

Now I want to get all the products with a specific custom attribute. That is get all products with attributes "day_special" as "yes". Is there any rest api method which gives the mentioned results?


texts: Magento 2 setup:upgrade to update modules breaks layout and have to redeploy

texts: Many guides I read state just running setup:upgrade or clearing the cache will result in changes to modules being made apparent, but if I just clear the cache it doesn't help, even if I delete all the files in the var/generation and var/page_cache and var/di and var/cache folders and run magento cache:clean.  Running magento setup:upgrade break the site, no js or css is there at all unless I rerun setup:di:compile and setup:static-content:deploy yet the site is in development mode with caching disabled, so why do I have to re compile and re deploy for every change to a module?  It seems broken :(  Especially as all these guides say just setup:upgrade or cache:clean should show my changes, which I'm not understanding why need run if I'm in development mode with cache disabled?  Any help greatly appreciated, waiting to redeploy for any change I want to see is very time consuming.


texts: how to set only 4 products of a specific category on home page

texts:
i'm working on magento 1.9 with b-responsive theme. i want to show only 4 product of a specific categoy on my home page but unable to do so.
i have changed the product page and it shows all product without pagination on a single page for every category.

for that i have copied app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php to app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php and change the line:

$limit = 'all';

now it shows all products of that category in one page.but on my home page when i call a block i want to show only 4 product of that category.

Here is my code on my home page:

{{block type="catalog/product_list" column_count="4" category_id="16" template="catalog/product/list_notoolbar.phtml"}}

and it showing all product of that category but i want to show only four products.how can i achieve that.


texts:
I'm receiving Shipment number # empty on shipment emails.

The result is that it is not showing the Order details on the emails.

Anyone experienced this before?

Thanks.


texts: Magento 2 admin fieldset form input float issue

texts:
I have created admin form with fieldsets. The issue is it isn't accepting float values and rounding them to integer values.

$fieldset->addField(
            'free_over',
            'text',
            [
                'name' => 'free_over',
                'label' => __('Free Over'),
                'title' => __('Free Over'),
               'required' => true,
            ]
        );


texts: How to "update" Magento 2.0.2 to v 2.0.3

texts:
I just got an announcement to upgrade Magento to 2.0.3

Is there a way to go from 2.0.2 to 2.0.3 through the Admin UI Panel without destroying all the work I have done so far in my setup?


texts: Magento 2: Hide success and error messages after certain time

texts: How to hide all success and error messages after several time magento2?


texts: Magento 2.1 not loading some js and css in production mode

texts:
I am working on mageno 2.1.10 and I have tried setting mod to production from development by using the following solutions:

solution 1.

php bin/magento deploy:mod:set production

And it gave me the following error:

  Something went wrong while deploying static content. See the error log for details.

  Command returned non-zero exit code: /usr/bin/php5.6 -f
  /var/www/html/Katherine/bin/magento setup:static-content:deploy en_US

But There were no errors in error_log

After this error I have entered the following commands in terminal:

php bin/magento s:d:c (For di compile)
php bin/magento s:s:d (For static-content deploy)

And then some of the js and css were not loading on frontend.

Solution 2.

After the above solution didn't work for me then I have again set mod to developer and deployed static content which brough my store back to life.

Then I have tried the following code for setting it to production mode:

bin/magento setup:upgrade; bin/magento indexer:reindex; bin/magento deploy:mode:set production -s; bin/magento setup:di:compile; bin/magento setup:static-content:deploy

By doing this the frontend totally broke and none of the css/js were being loaded.

Also tried these in Database:

UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/merge_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/enable_js_bundling';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/js/minify_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/css/merge_css_files';
UPDATE `core_config_data` SET `value`='0' WHERE `path`='dev/css/minify_files';

This too didn't help and finally I ended up by setting it to developer mod.

  Update 1

I have tried the answer provided by "Ayaz" on local host and this seems to be working fine. But on live server none of the css or js are being loaded

Following are the errors in browser console after trying this solution on live server:

CSS: Refused to apply style from 'website.com/pub/static/frontend/Pack/Theme/en_US/ThousandMonkeys_SocialButtons/css/social.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

JS: Refused to execute script from 'website.com/pub/static/frontend/Pack/Theme/en_US/owl.carousel/owl.carousel.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

There also some js files with console error : "net::ERR_ABORTED"

  Update 2

I have checked the browser console and it is loading some css and js files which are (I think) from Magento base. The ones which are getting 404 in console are all the custom module's css/js

  Image

  Update 3

When in developer mode, I have tried to find the files in pub/static which were not found/deployed in production mode. These files were all shown as a link in FTP (FileZilla).

  Update 4

So now I have disabled all the modules that are in app/code by adding Zeros for them in config.php. I have changed the theme to Magento Blank from admin. But still, when setting mod to production is ends up with the same error:

Command returned non-zero exit code: /usr/bin/php5.6 -f /var/www/html/Katherine/bin/magento setup:static-content:deploy en_US

Following are the logs generated when tried enabling production mod:
debug.log and system.log, there was nothing in exception log.

P.S: I need to enable production mod in order to get minified css/js/html

How to debug and where should I look to fix this?

Is there any way to minify js in developer mode itself?


texts: In exception log i am getting this error in Magento2.3

texts:
An element with a "root" ID already exists.

  {"exception":"[object]
  (Magento\Framework\Exception\LocalizedException(code: 0): An
  element with a \"root\" ID already exists. at
  vendor/magento/framework/Data/Structure.php:157)"}


texts: Simple Products not Tied to Parent Configurable Product

texts:
I created a configurable product and neglected to check off "main website" for it, I then proceeded to create associated simple products, but this product didn't show up in its categories. I then added the configurable product to "main website", and then created more associated simple products which resulted in the product showing up in categories. I can't figure out how to get those simple products I created before adding the configurable product to "main website" to show up on the front end. I went through them all and added them to the same website, and made sure they have inventory, and cleared the cache and indexes. Any idea what I'm missing to make them show up on the frontend?

Any insight is appreciated, thanks!


texts: Setting up a local development environment on xampp for magento

texts: Currently we are using an ec2 as a development server, and using rds as a mysql db, we are using git as version control, but I am looking at using git to download and install a local version of the website for testing purposes. How do I do this specifically from the standpoint of the magento database working on a local environment vs current development environment? I can't find much information on how it's supposed to work.


texts: Override default model webapi output magento2

texts:
I've began creating a module for a rest api for creditmemos - which I intend on using as an alternative to the built in version.

At the moment I've started the normal way for creating a webapi module, by creating a webapi.xml which links to an interface. I've taken a slight tangent by creating a preference tag in my di.xml like so;

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <preference for="Vendor\Module\Api\MemoInterface" type="\Magento\Sales\Model\Order\CreditmemoRepository"/>
</config>

This actually has worked.

I need to know how I can get more control over the data that is output than the default api. At the moment there is a large mass of data which is output and I'm unsure how to limit and curate this data.


texts: Update billing address in checkout page dropdown address

texts:
When update the billing address in magento2 checkout payment page.
getting below JS error.

replicate for select the dropdown address and click on the update button.
getting below JS error

function e(F,E){var D=0;try{this._each(function(H){F.call(E,H,D++)})}catch(G){if(G!=$break){throw G}}return this}, function y(G,F,E){var D=-G,H=[],I=this.toArray();if(G<1){return I}while((D+=G)<I.length){H.push(I.slice(D,D+G))}return H.collect(F,E)}, function d(F,E){F=F||Prototype.K;var D=true;this.each(function(H,G){D=D&&!!F.call(E,H,G);if(!D){throw $break}});return D}, function o(F,E){F=F||Prototype.K;var D=false;this.each(function(H,G){if(D=!!F.call(E,H,G)){throw $break}});return D}, function p(F,E){F=F||Prototype.K;var D=[];this.each(function(H,G){D.push(F.call(E,H,G))});return D}, function A(F,E){var D;this.each(function(H,G){if(F.call(E,H,G)){D=H;throw $break}});return D}, function n(F,E){var D=[];this.each(function(H,G){if(F.call(E,H,G)){D.push(H)}});return D}, function n(F,E){var D=[];this.each(function(H,G){if(F.call(E,H,G)){D.push(H)}});return D}, function l(G,F,E){F=F||Prototype.K;var D=[];if(Object.isString(G)){G=new RegExp(RegExp.escape(G))}this.each(function(I,H){if(G.match(I)){D.push(F.call(E,I,H))}});return D}, function b(D){if(Object.isFunction(this.indexOf)){if(this.indexOf(D)!=-1){return true}}var E=false;this.each(function(F){if(F==D){E=true;throw $break}});return E}, function b(D){if(Object.isFunction(this.indexOf)){if(this.indexOf(D)!=-1){return true}}var E=false;this.each(function(F){if(F==D){E=true;throw $break}});return E}, function w(E,D){D=Object.isUndefined(D)?null:D;return this.eachSlice(E,function(F){while(F.length<E){F.push(D)}return F})}, function r(D,F,E){this.each(function(H,G){D=F.call(E,D,H,G)});return D}, function C(E){var D=$A(arguments).slice(1);return this.map(function(F){return F[E].apply(F,D)})}, function g(G,E){G=G||Prototype.K;var F=[],D=[];this.each(function(I,H){(G.call(E,I,H)?F:D).push(I)});return[F,D]}, function h(E){var D=[];this.each(function(F){D.push(F[E])});return D}, function f(F,E){var D=[];this.each(function(H,G){if(!F.call(E,H,G)){D.push(H)}});return D}, function s(E,D){return this.map(function(G,F){return{value:G,criteria:E.call(D,G,F)}}).sort(function(I,H){var G=I.criteria,F=H.criteria;return G<F?-1:G>F?1:0}).pluck("value")}, function w(){return s.call(this,0)}, function z(){var E=Prototype.K,D=$A(arguments);if(Object.isFunction(D.last())){E=D.pop()}var F=[this].concat(D).map($A);return this.map(function(H,G){return E(F.pluck(G))})}, function p(){return this.length}, function z(){return"["+this.map(Object.inspect).join(", ")+"]"}, function reverse() { [native code] }, function forEach() { [native code] }, function r(){this.length=0;return this}, function f(){return this[0]}, function l(){return this[this.length-1]}, function o(){return this.select(function(B){return B!=null})}, function A(){return this.inject([],function(C,B){if(Object.isArray(B)){return C.concat(B.flatten())}C.push(B);return C})}, function n(){var B=s.call(arguments,0);return this.select(function(C){return !B.include(C)})}, function q(B){return this.inject([],function(E,D,C){if(0==C||(B?E.last()!=D:!E.include(D))){E.push(D)}return E})}, function v(B){return this.uniq().findAll(function(C){return B.detect(function(D){return C===D})})}, function w(){return s.call(this,0)}


texts:
Ive been reading up on all the various ways to attack this! The closest thing to the layout I'm trying to achieve and the way it works is this.

http://www.flatspot.com/journal/blog/

I had a look through the source and couldn't work out the method of intergration i was hoping someone could put me in the right direction for achieving this kind of usability & styling.

Check the home page they pull a feed too from the blog this i would also like to achieve.

Any input greatly appreciated.

Thanks


texts:
Well, this is a very rare problem, I know. Most of times we always try to speed up reindex process in Magento. What I am reporting here is the opposite

Sometimes (it does not happen always) reindexall process takes just a few minutes to reindex all the indexes. There are no errors in logs, so we have to assume process just ended ok. I have to point that it normally takes more than 45 minutes to reindex all indexes, as this concrete catalog has more than 100k skus

So, question is...

Any developer here has experienced an issue like this? In fact, the really useful question should be: where does Magento search for data needed to be reindexed every time we run a reindexall in Magento CE?

Looking at the DB I have noticed the index_event table does not seem to be updated for the last months. This is not the case for report_event table, which is updated

All indexes mode are "update on save"

UPDATE
My (shameful) mistake, about index_event table. It has been updated, as well as report_event table


texts:
I've written a module that stores data in a separate table. Because the data needs to be in a table (for a performant SQL JOIN) and should only be valid momentarily, the table uses the session ID as a field.

Now, as the table grows with time, we need some kind of cleanup. However, as the table contains data that is still valid, as well as data that is invalid on the account of being associated with expired sessions, we need to clean only the data from invalid and/or expired sessions.

The basic question is: How can we iterate over the currently active sessions? We would then clean all data associated with sessions that are not part of the collection of active sessions, maybe with some kind of cron job.

Another possibility I would prefer is to clean the data whenever a session becomes invalid. Is there an event or any other way to run code when a session becomes invalid?


texts:
I am working with Magento 1.9.1.0

I have 2 attributes as swatches (Color and Size).

In layered Navigation:

select Blue--> shows blue swatch in filter
select XL --> shows XL in Filter
select blue and XL --> shows 2 times blue swatch in filter

Does anybody know that problem, and has maybe a solution?

Thank you!

Demo with RWD Theme


texts: Magento 2 - Request from Javascript is returned with Status code 302

texts:
I´m sending a POST request with data via XMLHttpRequest. The response that I´m getting do have the status code 302.

Javascript function:

function createCSV() {
let xhttp = new XMLHttpRequest();
xhttp.open("POST", '', false);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send(JSON.stringify(formDataObject));}

Response:

Request URL: http://localhost:8888/magento2/delivery/inputform/national
Request Method: POST
Status Code: 302 Found
Remote Address: [::1]:8888
Referrer Policy: no-referrer-when-downgrade

LAYOUT

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <!--Include CSS-->
        <css src="Magento_VersandForm::css/inputform.css" />

        <script src="Magento_VersandForm::js/inputform.js"/>
        <script src="Magento_VersandForm::js/w3.js"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Magento\VersandForm\Block\Send" name="Inputform_send" template="Magento_VersandForm::national_input.phtml" />
        </referenceContainer>
    </body>
</page>

This is my BLOCK

<?php
 namespace Magento\VersandForm\Block;

 class Send extends \Magento\Framework\View\Element\Template
 {
   public function
   __construct(\Magento\Framework\View\Element\Template\Context
   $context)
{
    parent::__construct($context);
}

/**
 * Returns description for Tooltip
 * @return string
 */
public function getRequiredFieldsDescription(){
    return 'Diese Felder müssen ausgefüllt sein';
}

}

This is my CONTROLLER

<?php
namespace Magento\VersandForm\Controller\Inputform;

use Magento\Framework\Controller\ResultFactory;

class National extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory)
    {
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    /**
     * Booking action
     *
     * @return void
     */
    public function execute()
    {
        // 1. POST request : Get Data From Javascript
        $post = (array) $this->getRequest()->getPost();
    }
}

Why does Magento want to redirect me. Please provide Information if you have excperience with this kind of error.


texts: Custom shipping Module with Multiple carriers

texts:
I would like to create a custom shipping module. As per my understanding a custom shipping module is created for single carrier. Am i correct ?

Is it possible manage multiple carriers using a single custom module? Or do i have to create different modules for each of the carriers? If i have to create different custom module for each of the carriers, then is it possible to write a function that executes before the code for each of the carriers are executed?

My aim is to do some validation and pick the carriers based on the validations result. For example i need to identify if carrier will ship a particular type of product. If they will carry that product, check whether they have pickup from seller location and delivery at the customers location. If its passes both this validation then include them in the results or otherwise remove it from the rest of the process.


texts:
I am new to Magento.

I have some product ids. I have to list this product on my custom page. These products are selected from different categories. So I cant make these products in same category and display using insert widgets.

If my product ids are 23, 32, 12, 583. How can I display these products on a page?

  UPDATE

i write the following code in my custom file (app/design/frontend/Alothemes/bencher6/Magento_Theme/templates/myphp/myphpcode.phtml)

 $_product = Mage::getModel('catalog/product')->load(20);

and I write the block in cms section

 {{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::myphp/myphpcode.phtml"}}

so I get the following error  Fatal error: Uncaught Error: Class 'Mage'

Please help.


texts: Magento 2: admin sales grid, filter column from sales_order table

texts:
I have added a column "rescue_order_name" in sales_order table.
Now i want to display the values of this column in the admin panel, sales, order grid and give the option to the admin to filter certain record on the basis of this field

I have been able to display the column in the sales grid

<columns name="sales_order_columns">
    <column name="rescue_order_name" class="\Rescuechimp\OrderManager\Ui\Component\Listing\Column\Ordername">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="sortable" xsi:type="boolean">false</item>
                <item name="label" xsi:type="string" translate="true">Order Name</item>
            </item>
        </argument>
    </column>
</columns>

and in my Class

 public function prepareDataSource(array $dataSource) {
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as & $item) {
            $order = $this->_orderRepository->get($item["entity_id"]);
            $rescueName = $order->getData("rescue_order_name");
            $item['rescue_order_name'] = $rescueName;
        }
    }

    return $dataSource;
}

I am able to get the correct values, but at the moment, i am unable to use the filters for this property.

No matter what i type in this Order Name field, my result remain the same and nothing gets filtered.

I do not want to add this column in the sales_order_grid table.


texts:
I want to set this price rule. Is it possible?

Example: 2X + 9Y = 1X or 1Y or 1Z free

Thank you very much


texts: How to use RequiredJS to execute the JS after the DOM ready?

texts:
I'd like to execute my JS after the DOM ready using RequiredJS instead of this:

$(window).load()


texts: How to create Configurable Product Programmatically

texts:
I have found some question same my own but have not found out the answer. I want to create a configurable product. I have create a form to save the product and get the child product details in configurable-matrix:

But when I'm trying to save this product, the error Option values are not specified. appear. Can someone help me to save the product or just release another way to save a configurable product. Thanks!


texts: Add product custom options in rest/V1/orders

texts:
I want to get product custom options in ordered items by rest/V1/orders.
If i use searchCriteria, i received all custom options

but in another way i can't resieved custom options. Which method i must extend ?


texts: Magento 2 migration tool MySQL server has gone away

texts:
I'm migrating data from magento 1.7.0.2 to Magento 2 and get the following error:

  MySQL server has gone away


texts: Magento 2 - Get custom attribute of child products of a configurable

texts:
I tried to get value of my custom attribute of child products in product details of a configurable but without success.
This is my code but not work:
$simple_collection = $_product->getTypeInstance()->getUsedProducts($_product);
foreach($simple_collection as $simple_product){
echo $simple_product->getResource()->getAttribute('my_custom_attribute')->getFrontend()->getValue($simple_product);
}

Thanks for any help


texts: Magento 2 $this->checkoutSession->getLastRealOrder() and $this->checkoutSession->getLastRealOrderId() returning null

texts:
$this->checkoutSession->getLastRealOrder()
$this->checkoutSession->getLastRealOrderId()

returning null after payment gateway redirect.

Strange thing is that it is working some time and after it stops working.

  What is the issue and how to get paid order on success page ?


texts: Magento 2 Knockout variable from response in controller via ajax

texts:
Assume I've got something like this

    <span data-bind="text: new String('<?= $block->escapeHtml(__('According to the block logic you are currently logged In')) ?>')">

    <span data-bind="text: new String('<?= $block->escapeHtml(__('as according to the block logic you are not currently logged in')) ?>')">

And my block logic looks a bit like this
    /**
     * Check is Customer Logged In
     * @return int
     */
    public function isCustomerLoggedIn()
    {
        $isLoggedIn = $this->customerContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);
        return (bool) $isLoggedIn ? 1 : 0;
    }

The trouble is the blockIsLoggedIn value is cached in FPC on page load. Which means you can't reliably use this approach.
Is it possible to convert this so this variable comes from an ajax lookup on a controller instead?
I'm aware of other ways in which to check whether you are logged in. This is just an example. I've had similar scenarios recently and I end up just using jQuery. When I use jQuery I feel like I'm reinventing the wheel.
Update
My logged in example has caused confusion. Let's say I want to use KO to fetch a review count for currently viewed product (I assume via ajax request) on product page - on page load - that works through FPC.


texts: Persistent Shopping Cart and Guest / Anonymous Users

texts:
Our site does not use accounts or logins, so basically all of our users go through guest checkout.

I was under the impression that the "Persistent Shopping Cart" does exactly that - saves the contents of the cart even for users who do not register.

So if an anonymous user comes to the site, adds items to the cart and leaves, his cookie is still saved in case he returns to the site.

Apparently I was mistaken - after further reading the documentation I understand that the feature is used more towards accessing the cart from multiple devices while logged on and persisting the cart.

So now, assuming I want to ANONYMOUS, GUEST users to be able to return to the site and maintain their previous cart state, what is the best way to do that?

Should I just extend the session cookie to a year? I'm not sure what are the consequences of doing that if that's the best /easiest way?

Thank you!


texts: In Magento 2.3 I can go to any order in admin and choose REORDER. It copies the data and creates a new order. Afterwards looking at the reorder nothing stands out. Nothing says this was a reorder. How can I change that? Is possible for admin to list this as a REORDER somehow marking it?


texts:
I have a template that is only rendering my product price with the _clone suffix.

This is causing the Javascript update function reload to fail because it cannot identify any place on the page where the original ID is used.

The script is looking for "product-price-1743" while the only thing on the page is "product-price-1743_clone"

ideally, I would like to adjust the template so that it drops the clone suffix, but I don't know why it's not using a blank suffix first.

The rendered HTML as an example

  $9.99

The Failing JAvascript test (line 650 of product.js)

if ($(pair.value)) {

Where pair.value equals product-price-1743


texts: Help with Displaying Magento Attributes on product page

texts:
I would like to highlight some of my product attributes on the Product View page.
The following code works for the first attribute (operating_system) but not the second.
What could be the cause of this:

    <?php if($_product->getoperating_system()): ?>
<?php $os=$_product->getAttributeText('operating_system');
$osid=$_product->getoperating_system();
 echo '
'.$os.'
' ;?>
<?php endif; ?>
<?php if($_product->getinternal_memory()): ?>
<?php $imem=$_product->getAttributeText('internal_memory');
$imemid=$_product->getinternal_memory();
 echo '
'.$imem.'
' ;?>
<?php endif; ?>