texts:
I have been trying add products to cart via ajax call by following the procedure given in http://excellencemagentoblog.com/magento-add-product-to-cart-ajax and I have successfully added products to add too. But my problem is, while returning from ajax call, I'm trying to return updated cart count and mini cart html. But this is not working properly.

Following is my controller action

public function addAction(){

    $cart   = $this->_getCart();

    $params = $this->getRequest()->getParams();

    if($params['isAjax'] == 1){
        $response = array();
        try {
            if (isset($params['qty'])) {
                $filter = new Zend_Filter_LocalizedToNormalized(
                array('locale' => Mage::app()->getLocale()->getLocaleCode())
                );
                $params['qty'] = $filter->filter($params['qty']);
            }

            $product = $this->_initProduct();
            $related = $this->getRequest()->getParam('related_product');

            /**
             * Check product availability
             */
            if (!$product) {
                $response['status'] = 'ERROR';
                $response['message'] = $this->__('Unable to find Product ID');
            }

            $cart->addProduct($product, $params);
            if (!empty($related)) {
                $cart->addProductsByIds(explode(',', $related));
            }

            $cart->save();

            Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

            /**
             * @todo remove wishlist observer processAddToCart
             */
            Mage::dispatchEvent('checkout_cart_add_product_complete',
            array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
            );

            if (!$this->_getSession()->getNoCartRedirect(true)) {
                if (!$cart->getQuote()->getHasError()){
                    $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));
                    $response['status'] = 'SUCCESS';
                    $response['message'] = $message;
                    $this->loadLayout();
                    $toplink = Mage::helper('checkout/cart')->getSummaryCount();
                    $sidebar = $this->getLayout()->getBlock('minicart_content')->toHtml();
                    $response['count'] = $toplink;
                    $response['cartitems'] = $sidebar;
                }
            }
        } catch (Mage_Core_Exception $e) {
            $msg = "";
            if ($this->_getSession()->getUseNotice(true)) {
                $msg = $e->getMessage();
            } else {
                $messages = array_unique(explode("\n", $e->getMessage()));
                foreach ($messages as $message) {
                    $msg .= $message.'<br/>';
                }
            }

            $response['status'] = 'ERROR';
            $response['message'] = $msg;
        } catch (Exception $e) {
            $response['status'] = 'ERROR';
            $response['message'] = $this->__('Cannot add the item to shopping cart.');
            Mage::logException($e);
        }
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
        return;
    }else{
       return parent::addAction();
    }
}

Please help


texts: Images not display both frontend and backend after import

texts:
I have try to import bulk images, after i import i got successful message, right after check front and back end there is no image,

excel format :

https://www.dropbox.com/s/ruh3bg6htuirybp/ready.csv?dl=0


texts: how to set order total $0 if below $1 after applying discount code or wallet?

texts:
I have removed decimal point using this extension. But after applying coupon code order total is in decimal but using this extension decimal value is not showing on frontend.
In this case, If customer using his wallet for the order so he will pay only order total which is showing. So it is creating issue for decimal value which is not showing.
How can I set order total $0(Zero) if decimal value below $1(Like: $0.2, $0.5 etc.)


texts: how to display image over breadcrumbs in category

texts:
hi currently am looking for a solution to add catg image over breadcrumbs. i have added a static block inside catg and displaying both catg and product is there any solution for this.

i just want this image above the breadcrumbs.
thanks in advance

update
i have tried to override breadcrumbs.phtml file in my custom theme and called a static block and the result is working fine over catg page but this image is also visible on home page which i dont want.
my phtml file

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>

<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('catg-image')
->toHtml();
?>

<?php if ($crumbs && is_array($crumbs)) : ?>

        <?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
            <li class="item <?= $block->escapeHtmlAttr($crumbName) ?>">
            <?php if ($crumbInfo['link']) : ?>
                <a href="<?= $block->escapeUrl($crumbInfo['link']) ?>"
                   title="<?= $block->escapeHtml($crumbInfo['title']) ?>">
                    <?= $block->escapeHtml($crumbInfo['label']) ?>

            <?php elseif ($crumbInfo['last']) : ?>
                <?= $block->escapeHtml($crumbInfo['label']) ?>
            <?php else : ?>
                <?= $block->escapeHtml($crumbInfo['label']) ?>
            <?php endif; ?>

        <?php endforeach; ?>

<?php endif; ?>

pls refer the image below

update
i have already solved this issue thank you if anyone needs and ans can post a question and i will help him

working .phtml code

<?php if ($crumbs && is_array($crumbs)) : ?>

        <?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
            <li class="item <?= $block->escapeHtmlAttr($crumbName) ?>">
            <?php if ($crumbInfo['link']) : ?>
                <a href="<?= $block->escapeUrl($crumbInfo['link']) ?>"
                   title="<?= $block->escapeHtml($crumbInfo['title']) ?>">
                    <?= $block->escapeHtml($crumbInfo['label']) ?>

            <?php elseif ($crumbInfo['last']) : ?>
                <?= $block->escapeHtml($crumbInfo['label']) ?>
            <?php else : ?>
                <?= $block->escapeHtml($crumbInfo['label']) ?>
            <?php endif; ?>

        <?php endforeach; ?>

<?php endif; ?>


texts: Special price not showing in the submitted web order

texts:
Special prices are not getting pulled when a customer places an order on website.
We are on 1.8.1 community version

Special prices show on the checkout page of wishlists or individual shopping carts however when customer places an order, it pulls regular full price.

Any idea what could be an issue?


texts: Magento 2.2.2 remove other shipping methods and enable only free shipping if consumer total more than 100

texts:
We are using Magento 2.2.2, We have more then 5 shipping methods enabled in our site.

We needs to remove other shipping methods and enable only free shipping if the cost of their order totals to more then 100.

And if it totals less then 100 then all other shipping methods will enabled.


texts: How to get all configurable options of a configurable product including "Out of Stock" status in Magento 2

texts:
I am using this code which is return all configurable options array excluding "Out of Stock" product option.

$data = $_product->getTypeInstance()->getConfigurableOptions($_product);

So, It works fine when all simple products are In the stock of a configurable product but if any simple products are "Out of stock" then this product configurable option not returning this function.

How can I get all configurable options array of a configurable product?

Please advice.


texts: Magento 2: Rest api add custom attributes to shipping information

texts:
I added custom attributes to shipping information. I can get them in beckend and order view on frontend.

But I can get it in rest API orders. How can I add custom attributes to shipping information in orders list rest API.


texts:
Related to this- Newsletter Checkbox on contact us page in magento 2

I am using magento 2.1.7 version. I created this module and it gives me error as:-

  Fatal error: Uncaught TypeError: Argument 1 passed to
  Stackoverflow\Contact\Helper\Data::__construct() must be an instance
  of Magento\Framework\App\Helper\Context, instance of
  Magento\Framework\ObjectManager\ObjectManager given, called in
  G:\xampp2\htdocs\magento2\test\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php
  on line 93 and defined in
  G:\xampp2\htdocs\magento2\test\app\code\Stackoverflow\Contact\Helper\Data.php:34
  Stack trace: #0
  G:\xampp2\htdocs\magento2\test\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(93):
  Stackoverflow\Contact\Helper\Data->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))
  1 G:\xampp2\htdocs\magento2\test\vendor\magento\framework\ObjectManager\Factory\Compiled.php(88):
  Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Stackoverflow\Co...',
  Array) #2
  G:\xampp2\htdocs\magento2\test\vendor\magento\framework\ObjectManager\ObjectManager.php(71):
  Magento\Framework\ObjectManager\Fac in
  G:\xampp2\htdocs\magento2\test\app\code\Stackoverflow\Contact\Helper\Data.php
  on line 34.

How to fixed this?


texts:
I tried every possible solution on this forum and nothing works:

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento setup:static-content:deploy

core_config_data dev/static/sign to 0

chmod -R 777 var/* pub/*
chown -R user:webgroup pub/static

app/etc/di.xml
Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

rewrite_mod enable

1) Set Magento 2 developer mode.

sudo php bin/magento deploy:mode:set developer
2) Remove Static Content for adminhtml.

sudo rm -rf pub/static/adminhtml/*
3) try forced Content Deploy

sudo php bin/magento setup:static-content:deploy -f
4) Give permission to pub, var, generated

sudo chmod -Rv 777 pub var generated

I deleted also the cache, the static/* , put the .htaccess from pub folder, I tried everything so please somebody help me with this nightmare.

Magento is for make everything easier but I totally disagree, since I use magento everything is more complex and always something is failing.


texts: Magento 2 : I want to validate post code with 6 digit in checkout

texts:
I want to validate the post code exact 6 digit.
Means user can not add more than or less than 6 digits.
And this I need in checkout page of Magento 2.

Thanks in advance.


texts: How to create custom atribute set using upgradeData in magento 2

texts:
I am trying to create custom attribute set by using upgradeData script in magento 2, but it doesn't create.

Can anyone give me an advice?


texts:
I am planning to migrate the Magento from 1 to 2. so, I like to install the Magento2 first, then the Magento 2 installation I found the following procedures

1) Using composer
2) Git clone.
3) Using Web Setup Wizard

May I know which one is the best way to install the Magento2 and why?

Thanks in advance for your ideas and support


texts: Magento 2 : Css and Javascript not loading

texts:
I have a big problem with magento, my css and javascript are not loading, I already did:

Content deploy;
Deleted the static folder but kept the .htacess;

but nothing seems to work.


texts: Getting data from quote items collection issue in M1

texts:
This is my collection:

$collection =

Mage::getModel('checkout/cart')->getQuote()->getItemsCollection()
                    ->addFieldToFilter('product_type', ['eq' => 'bundle']);
$collection->getSelect()
      ->joinLeft(
            ['sfqio' => 'sales_flat_quote_item_option'],
            'main_table.item_id = sfqio.item_id'
      )->where('code = ?', 'additional_options');
//$collection->getSelect()->columns('sfqio.value');

I want to get the data from the value column, but it is null:

foreach ($collection as $items => $item){
     var_dump($item->getData('value'));
}

If I display the query and executed directly in phpmyadmin(for instance) , I got the value column with a serialized data.  In my var_dump case , it is always null. Why ?


texts: Add, get, and update sales rule condition in Magento 2

texts:
I want to be able to add,upadate and get conditions programmatically for  salesrule, the sales rule condition:

My salesrule condition is => minimum subtotal == 10000 && product skus is one of sku123,sku2333

skus is seperated by comma

i want to be able to add, update and get the minimum subtotal and skus,for example:

public function addSalesRuleCondition($salesRuleId,$minimumAmount,$skus){
  $salesRule = $this->salesRule->create()->load(salesRuleId);
   // add condition for minimum subtotal and skus
}

public function updateSalesRuleCondition($salesRuleId,$minimumAmount,$skus){
  $salesRule = $this->salesRule->create()->load(salesRuleId);
   // update condition for minimum subtotal and skus
}

public function getSalesRuleCondtion($salesRuleId){
   // retrieve the minimum subtotal and the skus
   $salesRule = $this->salesRule->create()->load(salesRuleId);
   $result = array("minimum_subtotal","skus");
   return $result
}


texts:
Can someone explain why a custom option of type percent is calculated using the final item price on a quote?

See here:

# File: app/code/core/Mage/Catalog/Model/Product/Option/Value.php
public function getPrice($flag=false)
{
    if ($flag && $this->getPriceType() == 'percent') {
        $basePrice = $this->getOption()->getProduct()->getFinalPrice();
        $price = $basePrice*($this->_getData('price')/100);
        return $price;
    }
    return $this->_getData('price');
}

It doesn't seem to make sense to do this. Here's an example to illustrate the problem:

Laptop Computer
---
  Price: 500.00

  Custom Options
  ---
  1-YR Warranty: 20%

As I attempt to add this item to my cart along with the warranty option, my total cost as shown on the product view page will be 600.00. That looks good, because 20% is applied to the final price of 600.00 at that moment (100.00).

But what happens in the cart if this method is called, after the option has already been applied to the item?

According to the getPrice method above, it will show as 120.00 (20% of 600.00) ... clearly this is not right. And curiously, a stock installation of CE 1.x does not render custom option prices in the cart (only row totals).

Has anybody encountered this before? Or maybe more likely, what am I not understanding correctly here?


texts: How to take payment on edited PayPal order

texts:
Is it possible to re-authorise/re-take payment on the new order that is created when you 'Edit' an existing order?

I'm running Magento 1.8.1.0 for a client's website that is currently in development. They will be using PayPal standard payments as their only payment method and I currently have this set up with my sandbox details for testing purposes.

If a customer makes a purchase through the website using PayPal as the payment method, an order is created as usual.
This order remains at status 'Pending Payment' until the customer completes the PayPal standard payment process, at which stage the PayPal IPN sends the transaction ID back to Magento and the order status is updated to 'Processing'.
If the website admin then 'Edits' this order, a new order is created. This new order carries across the PayPal payer ID.

At this stage, is it possible to capture payment for the new order?

If I refund the original order within PayPal, the IPN notifies Magento which then automatically closes the original order and creates a credit memo. I'm just stuck at how to request/assign a new payment against the newly created order.


texts: magento 2 theme suddenly stopped working

texts:
Created a custom magento 2 theme and started working with it. It was working fine.
Suddenly, one day the theme is not working in frontend. In admin panel i can see the theme name, but in frontend it is showing default magento theme which is my parent theme.
I had removed the theme and re-installed. But, still not working.

The same theme, in local development is working and also on another magento setup. I think, there is some database problem.

Can anybody help me out on this problem.


texts:
This is my xml:

<global>
    <blocks>
        <mynamespace_mymodule>
            <class>Mynamespace_Mymodule_Block</class>
        </mynamespace_mymodule>
        <adminhtml>
            <rewrite>
                <customer_edit_tab_view_accordion>Mynamespace_Mymodule_Block_Adminhtml_Customer_Edit_Tab_View_Accordion</customer_edit_tab_view_accordion>
            </rewrite>
        </adminhtml>
    </blocks>

This is the php code:

class Mynamespace_Mymodule_Block_Adminhtml_Customer_Edit_Tab_View_Accordion extends Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion
{
    protected function _prepareLayout()
    {
        echo 1;
        exit();
    }
}

What did I missed ?


texts: Error Call to a member function getDescription()

texts:
Getting these errors below the footer of the category pages.

  Fatal error: Uncaught Error: Call to a member function
  getDescription() on null in
  /var/www/html/app/design/frontend/ultimo/default/template/page/2columns-left.phtml:77
  Stack trace: #0
  /var/www/html/app/code/core/Mage/Core/Block/Template.php(241):
  include() #1
  /var/www/html/app/code/core/Mage/Core/Block/Template.php(272):
  Mage_Core_Block_Template->fetchView('frontend/ultimo...') #2
  /var/www/html/app/code/core/Mage/Core/Block/Template.php(286):
  Mage_Core_Block_Template->renderView() #3
  /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(919):
  Mage_Core_Block_Template->_toHtml() #4
  /var/www/html/app/code/core/Mage/Core/Model/Layout.php(556):
  Mage_Core_Block_Abstract->toHtml() #5
  /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(390):
  Mage_Core_Model_Layout->getOutput() #6
  /var/www/html/app/code/core/Mage/Catalog/controllers/CategoryController.php(161):
  Mage_Core_Controller_Varien_Action->renderLayout() #7
  /var/www/html/app/code/community/Vinagento/Vpager/controllers/CategoryController.php(30):
  Mage_Cat in
  /var/www/html/app/design/frontend/ultimo/default/template/page/2columns-left.phtml
  on line 77

Please help me to solve this..


texts: Where should I implement home page's HTML code?

texts:
Where should I implement home page's html code?

I should add this in the admin panel:

content/pages/edit homepage/content editor?


texts:
When I try to add or edit a product I receive the following error:

Mage registry key "_singleton/weee/observer" already exists
Trace:
#0 app/Mage.php(222): Mage::throwException('Mage registry k...')
#1 app/Mage.php(476): Mage::register('_singleton/weee...', false)
#2 app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('weee/observer')
#3 app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('adminhtml_catal...', Array)
#4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(143): Mage::dispatchEvent('adminhtml_catal...', Array)
#5 app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#6 app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#7 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml()
#8 app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#9 app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#10 app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs')
#11 app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'product_tabs')
#12 app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#13 app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#14 app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#15 app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#16 app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#17 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(207): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#18 app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Catalog_ProductController->newAction()
#19 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('new')
#20 app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#22 app/Mage.php(683): Mage_Core_Model_App->run(Array)
#23 index.php(124): Mage::run('catalog', 'website')
#24 {main}

Magento ver. 1.7.0.0
Compiler turned off
cleared cache
rebuilt index
no updates or new extensions have been installed it just quit working

Any help would be appreciated!


texts: Magento2: unable to override methods in Magento\Catalog\Model\ResourceModel\Product\Collection

texts:
I want to override the model class(Magento\Catalog\Model\ResourceModel\Product\Collection.php)

Flow the below process to override the addUrlRewrite method but not working.

di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Catalog\Model\ResourceModel\Product\Collection" type="MyModule\Custom\Model\ResourceModel\Product\Collection" />
</config>

Collection.php

<?php
    namespace MyModule\Custom\Model\ResourceModel\Product;

    class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
    {

        public function __construct(
            \Magento\Framework\Data\Collection\EntityFactory $entityFactory,
            \Psr\Log\LoggerInterface $logger,
            \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
            \Magento\Framework\Event\ManagerInterface $eventManager,
            \Magento\Eav\Model\Config $eavConfig,
            \Magento\Framework\App\ResourceConnection $resource,
            \Magento\Eav\Model\EntityFactory $eavEntityFactory,
            \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper,
            \Magento\Framework\Validator\UniversalFactory $universalFactory,
            \Magento\Store\Model\StoreManagerInterface $storeManager,
            \Magento\Framework\Module\Manager $moduleManager,
            \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState,
            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
            \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory,
            \Magento\Catalog\Model\ResourceModel\Url $catalogUrl,
            \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
            \Magento\Customer\Model\Session $customerSession,
            \Magento\Framework\Stdlib\DateTime $dateTime,
            \Magento\Customer\Api\GroupManagementInterface $groupManagement,
            \Magento\Framework\DB\Adapter\AdapterInterface $connection = null
        ) {
            parent::__construct(
                    $entityFactory,
                    $logger,
                    $fetchStrategy,
                    $eventManager,
                    $eavConfig,
                    $resource,
                    $eavEntityFactory,
                    $resourceHelper,
                    $universalFactory,
                    $storeManager,
                    $moduleManager,
                    $catalogProductFlatState,
                    $scopeConfig,
                    $productOptionFactory,
                    $catalogUrl,
                    $localeDate,
                    $customerSession,
                    $dateTime,
                    $groupManagement,
                            $connection
                );

        }
         public function addUrlRewrite($categoryId = '')
        {
            echo '<pre>';exit(var_dump("Hello Test"));
        }

    }

Please, can you help on above issue? any references and suggestion are highly appreciated.


texts: syntax error, unexpected 'namespace' (T_NAMESPACE)

texts:
while i try to compile magento 2, the compilation is getting paused at (1/7) stage and an error is getting logged in error log file.
please find the error details below.

Magento version 2.1.7
PHP Version 5.6.35

Error details:
[04-Dec-2018 07:15:06 UTC] PHP Parse error:  syntax error, unexpected 'namespace' (T_USE) in /app/code/Magebuzz/Testimonial/Helper/Data.php on line 1


texts: I need a multiple product chooser for a widget. Can anyone please help me with some directions how can I implement something like that?


texts: How to override adminhtml template file in magento 2

texts:
I want to override one adminhtml template file located at /vendor/magento/module-sales/view/adminhtml/templates/order/create/form/account.phtml
What steps i need to follow?


texts:
My client wants to split the onepage checkout from magento into a multipage one. In his case, he wants to put the login(sign up)/shippingmethod in one page, and the billingmethod/paymentmethod/review in another one.

Is there an easy way to do this?

I'm pretty much a beginner in magento, so I have no idea if what I'm asking is completely crazy... Hope not!

Cheers!
André


texts:
i'm new here and started using Magento a couple of days ago for study. Now i am at the frontend part and i want to make some changes.

Magento store is version 1.8.1.0 and i installed it on my localhost using xampp.

What i'm trying to do is to see my modifications to a Static Block or a Page in frontend. For example if i change the text for a page, save the content, go in frontend and refresh the page nothing happens, no modification is made.

As i assume, is a problem with Cache Management or Index Management but i don't know how to set them up.

Please help me resolve this issue, what changes do i have to make in order to work or what steps do i have to follow?

Thanks, George


texts: Uncaught TypeError: is not a conscructor after update to 1.9.3

texts:
After updating from Magento 1.9.2 to 1.9.3 on my dev site the tabs on my item page broke. I looked in console for the dev site and see this error-

Uncaught TypeError: Product.optionsPrice is not a constructor
at http://www.example.com/circuit-breaker-1-pole-c-curve-2-amp-ul1077:573:24(anonymous function) @ circuit-breaker-1-pole-c-curve-2-amp-ul1077:573

That code is-

<script type="text/javascript">
var optionsPrice = new Product.optionsPrice([]);
if( jQuery ){
    jQuery( "#ja-tab-products" ).ready( function($) {
        $( "#ja-tab-products" ).jaContentTabs();
    } );
}
jQuery(document).ready(function() {
        urllocation =  window.location;

        if(urllocation.toString().indexOf("#review-form") > 0){
           jQuery("ul.ja-tab-navigator").find("a[href='#ja-tabitem-reviewform']").trigger("click");
           window.location = "#ja-tabitem-reviews";
        }
});

The line of code that is throwing the error is-

var optionsPrice = new Product.optionsPrice([]);

The production site on 1.9.2 with the exact same code works fine. Why am I getting an error? How do I get the tabs functioning again?


texts:
I am making REST API calls to magento website for order placement. Below is the sequence of my calls.

Create a cart  rest/V1/guest-carts/
Get the cart rest/V1/guest-carts/bae0af147b83f1561f66cc4e3c97916e
Add products to cart rest/V1/guest-carts/24/items
Add billing information, set payment method and place order rest/V1/guest-carts/24/payment-information

In this sequence the order is getting the placed with order status "pending". I am wondering how the payment is captured through api if any payment gateway(Ex. PayPal) is involved to process payment and generate invoice.

Is there any api missing in the above flow for capturing payments.


texts: How to change label in customer dashboard magento2

texts:
I have created custom module in Magento2. I have created succesfuly added custom link in customer dashboard. But I want to change existing label of customer dashboard account. I have attached screenshot.

Please Give me any suggestions.


texts: Magento 2.1.9, Apache/2.4.10 (Debian) - The header "Cache-Control: private" is adding to all my static files and images

texts:
We have a Magento 2.1.9 installation on a Debian Jessie server. It is configured to be connected with Cloudfront CDN for media and static files. The problem is that all the files that are served to CDN contain the header Cache-Control: private, so the Cloudfront behaves as a transparent proxy just forwarding the request to the Origin.

Preconditions

Magento 2.1.9
Connection with Cloudfront CDN

Steps to reproduce

.htaccess in /pub/static/ contains:

<FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|html|swf|eot|ttf|otf|woff|woff2)$>
    Header append Cache-Control public
</FilesMatch>

.htaccess in /pub/media/ contains:

<FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$>
    Header append Cache-Control public
</FilesMatch>

Expected result

All files that are forwarding to CDN, except the ones that contain a non-cacheable block, to contain the header:

-Cache-Control: public

Actual result

All files that are forwarding to CDN contain 2 headers:

-Cache-Control: public
-Cache-Control: private

In this configuration, Cloudfront behaves as a transparent proxy just forwarding the request to the Origin and we don't not benefit from Cloudfront caching.


texts: Magento - Associated products are not showing under configurable product

texts:
I'm using Magento Community Edition 1.9.3.2.

I created configurable product and created an associated products also. My issue is,

Configurable products are not displaying front page
Associated products also not displaying backend. but if i click on
reset filter button it is showing simple products which belongs to
some other configurable products.

And i have checked:

Stock Availability
Qty
Website
Visibility
Catalog
Price

All are correct. Does any one know what was the issue?


texts: Which event to use in order to execute a function after a frontend order?

texts: Which event should I use in order to execute a function after a frontend order? In other module, a colleague used  but I think this is for backend orders.


texts: unable to register new user (ERROR 500 - Internal Server Error!). Magento 1.9

texts:
I am working on live site tuxedosonline. its in magento1. My problem is as a guest user i am able to click any link ,categories, or etc.  when i am trying to register new user or login with account and click on any link it display me
 Error 500 internal server error!
 If you get this message repeatedly please contact the webmaster.
 I had checked all my previous updated file there is no new file in my server i don't know how to remove this . please guide me
Thanks


texts:
I have a magento Installation which has had several image imports done by the client and its got wrong images in the wrong products, toasters with fridge freezers as the initial import had the wrong img names.  After a further import via CSV it seems to have appended the images rather than change them.

I need to delete all product images on the site, then re-do the CORRECT import so all the images are correct.

Is there a quick way to delete all images then do a fresh import via Dataflow Profiles and re-map the correct fields?

Any help would be awesome!


texts: Magento 2: Change the action of add to cart button on product and category pages to checkout page?

texts:
I am new to Magento 2 and want to change the action of add to cart button on product and category pages directly to the checkout page.

Magento 2: Skipping Shopping Cart Page after Add to Cart

I referred to the solution given in above link, but not able to find the directory which is required to be updated -- event.xml


texts: magento dev:urn-catalog:generate command fails to detect secret file

texts:
I'm running the following command "magento dev:urn-catalog:generate .idea/misc.xml
"  to use the functionality of Magento 2 to automatically resolve all my URN's so PhpStorm will stop giving me warnings and errors.

But i get this error:
File ".idea/misc.xml" cannot be opened Warning!fopen(.idea/misc.xml): failed to open stream: No such file or directory

Although i do work with PhpStorm, and the folder and file:  .idea/misc.xml do exist.

Any suggestions..?
Thank you


texts: Showing all options in layered navigation

texts:
I have a dropdown attibute. It is visible in the layered navigation. But it always shows all the options. Even when one of the options is selected.

I think this is changed from the default setting by our previous web-builder.
I can't ask him anymore. Where do I have to look to change this back?

I have a little experience with Magento, but i can't find it.
Would love your help!


texts: override admin system account controller in magento

texts:
click

  System > My Account

When I click on 'save account' button,it will call saveAction() method,saveAction() location is "Mage/Adminhtml/controllers/System/AccountController.php",I tried to override saveAction() method but i can't, I also delete cache but it doesn't override system accountcontroller,please check my code where is my mistake ?

  app/code/local/Test/Module/etc/config.xml

<config>
    <modules>
       <Test_Module>
         <version>0.0.1</version>
       </Test_Module>
     </modules>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Test_Module before="Mage_Adminhtml">Test_Module_Adminhtml</Test_Module>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

  app/code/local/Test/Module/controllers/Adminhtml/AccountController.php

     <?php
  //require_once 'Mage/Adminhtml/controllers/System/AccountController.php';
 require_once(Mage::getModuleDir('controllers','Mage_Adminhtml_System').DS.'AccountController.php');

    class Test_Module_Adminhtml_AccountController extends Mage_Adminhtml_System_AccountController
    {
        public function saveAction()
        {
            die('override');
        }
    }
    ?>

  app/etc/modules/Test_Module.xml

<config>
    <modules>
        <Test_Module>
            <active>true</active>
            <codePool>local</codePool>
        </Test_Module>
    </modules>
</config>


texts: Can migration to magento2 break live magento1 site?

texts:
We plan on migrating soon and I want to try out the migration tool. It worked fine with a dump of our live website db, but that's bad practice since delta won't work this way.

Can the migration process affect our live magento1 website in anyway ? Does it have any chance of breaking it ? Do we NEED to put the website in maintenance mode before doing it ?


texts: How can I fetch the tracking number and inset it to my image link URL?

texts:
I'm trying to create a new email template where I have an image saying "Track Order" and it will go to the parcelsapp website. What I want to happen is the link is variable to the tracking number of the order, i.e. https://parcelsapp.com/en/tracking/%tracking_number
I can't seem to find how to fetch the tracking number so it goes to the "%tracking_number" part.
I keep finding instructions that need me to override a module, however I'm not the web developer of this website and he's honestly being useless right now. So if there's any way I can do this without going through him and simple coding on the email template html space, please let me know!


texts: How to include a js file into a custom module in Magento 2?

texts:
Added app/code/Namespace/Customtab/view/frontend/layout/customtab_index_index.xml

<?xml version="1.0"?>
 <head>

    <css src="Namespace_Customtab::css/viewer3d.css" />

</head>
</page>

And paste the file in Namespace/Customtab/view/frontend/web/css/viewer3d.css

Done di:compile, but the file is not in the viewsource . Please help me to find a solution.


texts: Bypassing the different server PHP versions to install extensions

texts:
My SSH version is 5.4 but my server version is 7.1.
i used
composer install --ignore-platform-reqs
to bypass the errors and install Magento 2.3 but now i want to install extensions  using
bin/magento setup:upgrade.... the error  of SSH version of 5.4 is incompatible with it. i need to upgrade..

QUESTIONS are

is there any command i can add to 'bin/magento setup:upgrade' to bypass the errors
what commands do i used to upgrade php version 5.4 to 7.1.

Remember I am on a shared hosting platform


texts: Order Total on Checkout Success page for Bing Ads - Magento 2.1

texts:
I'm trying to get just the order total on the checkout success page to be reported to Bing ads for a client.

In magento 1, this code is used in the checkout/success.phtml template:

<script>
<?php $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order')->load($lastOrderId); ?>

window.uetq = window.uetq || [];
window.uetq.push({ 'gv': '<?php echo $order->getBaseGrandTotal(); ?>'});
</script>

How can I accomplish this in Magento 2.1?

also, is the path for this template different than magento 1?

  app/design/frontend/[theme]/template/checkout/success.phtml

Thank you :)


texts:
A new attribute was added such as "bust"  and ,"Catalog Input Type for Store Owner" was set to "text field".
If I don't fill any text as a product attributes value, the frontend shows "Bust: No".
This happens even if the "Values Required" attribute property is set to "No".

I would like the attribute to not be shown if I did not fill any value for it.


texts: How to add custom text after payment name radio button on checkout page?

texts:
I want add custom text after payment name on checkout page and different custom text on different stores

for ex :

Cash on deliver               (Custom text 1)
Paypal                        (Custom text 2)


texts: Magento 2 - Customer session lost in controller

texts:
I encountered a strange error while getting customer session in a Controller execute method as below:

$resultPage = $this->_resultPageFactory->create();
$this->_customerSession->isLoggedIn(); // return true;
$resultPage->getConfig()->getTitle();
$this->_customerSession->isLoggedIn(); // return false;

Why the customer session will be cleared at line 4?


texts: View the weight of the products in the invoice

texts:
I need to show the weight of the products in the invoice PDF.

I modified the following files:

Model/Order/Pdf/Shipment.php
Model/Order/Pdf/Invoice.php

and:

Model/Order/Pdf/Items/Invoice/DefaultShipment.php
Model/Order/Pdf/Items/Invoice/DefaultInvoice.php

In DefaultShipment.php works $item->getWeight() perfectly.
In DefaultInvoice.php there is not $item->getWeight().

How can i recover the weight of the products?


texts:
On Amazon, I don't have to type login ID & password info whenever I visit the amazon so I can shop instantly

but on our Magento site, customer have to login every time they visit after close the browser

Is there any way customer don't have to login even if they close browser and visit few days later until the customer click 'logout' like Amazon?


texts: Accidentally deleted customers Magento 1.9

texts:
We recently had BOTs setting up accounts on our website, 2000 or so.

We accidentally clicked delete all instead of delete all visible and lost about half of our accounts.

I have a database backup from a few weeks ago that I can use, what would be the best way to get the customers from the old database without effecting the customers that weren't deleted?


texts:
During my work, i have faced an issue with a magento site. When i check product social meta-tags  with inspect element they are located inside "head" tag . But when i open  "view the page source" i notice that social meta-tags (for example: "meta property="og:title") are located after "/head".

What to do in this case ?
Thank you in advance


texts: How to add multiselect stores in frontend

texts:
I'm working on a groupon like website and there is a frontend merchant dashboard to insert deals.
I need to show, in the frontend dashboard,  this multiselect from the backend. It just uses store views


texts: Prices display incorrectly in the source code

texts:
I am wondering if i could get some advice for a bug fix in regards to our Magento system.

The issue is as follows:

Our website (http://www.optimusprotein.co.uk) by default displays all of item sale prices to two decimal places (e.g 0.49 for 49 pence) however, once a transaction is complete, the prices track in the back end of the source code as 4 decimal places (e.g 0.4900) This is not causing us any major issues, however we have just become a member of an affiliate program and they are requesting that the prices need to track consistently to 2 decimal places accordingly.

I have tried everything in regards to downloading extensions etc, but nothing seems to work so I believe the problem must lie deep in the source code.

Any advice you can give me would be great.


texts:
i am a newbie in magento community edition CMS and
i just install a theme and add 2 categories like mobiles and Pen Drives under the default category.
Also add a root category like namely cloths and add two sub categories like Menu and  Woman

How can i add the cloths root directory to my front end. any body pls help me... front end screen shot attached


texts: List categories which contain products with specific product attribute

texts:
I'm trying to get a list of categories (ID, Name). However, only categories that contain products with a certain product attribute value can be listed.

I've already tried the following;

<?php
        $categories = Mage::getModel('catalog/category')
        ->getCollection()
        ->addAttributeToFilter('product_supplier', '5');

        foreach($categories as $category) {
            echo $category->getName().'<br>';
        }

And;

<?php
        $category = Mage::getModel('catalog/category');
        $catTree = $category->getTreeModel()->load();
        $catIds = $catTree->getCollection()
        ->addAttributeToFilter('product_supplier', '5')
        ->getAllIds();
        $cats = array();
        if ($catIds){
            foreach ($catIds as $id){
                $cat = Mage::getModel('catalog/category');
                $cat->load($id);
                $cats[$cat->getId()] = $cat->getName();
            }
        }

But, I keep getting the error: Call to a member function getBackend() on a non-object

I found out that this error occurs when the collection tries to filter on the category, so i guess it thinks i i meant to filter by the category attribute product_supplier. I really don't know what to try next.

Suggestions?

=> My solution so far:

$catIds = array();
$validCategories = array();

//get the filtered product collection
$productCollection = Mage::getModel('catalog/product')->getCollection()
   ->addAttributeToSelect('*')
   ->addAttributeToFilter('product_supplier', '5');

// Loop through products, throw category id's into array
foreach($productCollection as $product) {
    $catIds = array_merge($catIds,$product->getCategoryIds());
}

/**
 * Loop through category id's, load categories and get name,
 * create the final array
 */
foreach ($catIds as $x => $catId) {
    $cat = Mage::getModel('catalog/category')->load($catId);
    $validCategories[$cat->getId()] = $cat->getName();
}


texts: emptying Url Key when duplicating product

texts:
I'm looking for a way to completely empty out the Url Key when a product is duplicated.

i've already tried:

 $newProduct->setUrlKey(NULL);

in a rewrite of Mage_Catalog_Model_Product.
but this just results in magento regenerating the Url Key.

i also read this question but there is no answer.

Thanks in advance!


texts: Fatal error: Call to a member function getSortedChildren() on a non-object in configurable.phtml on line 32

texts:
I have a Magento v 1.9.2.4 CE  Community Edition site. I am using a custom theme I purchased off a template site. Apparently the theme does not support configurable item swatches. So I followed the tutorial here

How to use Magento 1.9.1.0 Configurable Swatches in Default package theme (or a custom theme)?

Now when I go to the product I where I would expect to see the swatches I see the below error
Fatal error: Call to a member function getSortedChildren() on a non-object in app/design/frontend/default/ma_sahara_digital3/template/catalog/product/view/type/options/configurable.phtml on line 32

The line this refers to is

$_renderers = $this->getChild('attr_renderers')->getSortedChildren();

I saw some other posts on here about the same issue but none of them have a working resolution?? I am hoping someone might know a fix for this.

thank you


texts:
In login and registration forms, there is a validation. Whenever the user directly click the submit button before fill in the data to the input fields, there is message called 'This is a required field'. But I want to hide that validation message when user filled the data. It should be hide on fly.

In order to do that, where I have to update?

Could any one please help me?


texts: Getting the wrong chinese string in search query result!! Magento 1

texts:
I have a store in chinese language. When I search for any product it works fine.
But when I sort the result page by sku, name or price it does not work. It seems that I've got the wrong url for sorting.
Please help me!!!! How can I get the proper string url for the sorting option?
Please see the screenshot!!


texts: Magento 2 - How to create a custom select field in registration form and store it in database table?

texts: I want to create a custom select field of select a course in registration form in which i have  5 options and when user click on create account its value should store in a course column in customer_entity table in magento 2 how to do this?


texts: Is there a fast way to flush cache and empty static folders using putty commands? I am in developer mode and sometimes I dont know what I need to do so that the site updates my edits. Can one combine commands in putty and run at once?


texts: Applying PHP 5.4 support patch for magento CE 1.7 in a windows environment

texts:
I am talking about this patch:
http://www.magentocommerce.com/blog/magento-now-supports-php-54/

How to apply it in a XAMPP-Windows 7 environment ?

I am hoping this patch will enable me to use the APC cache extension as currently my apache instance crashes when enabling APC and running a magento site.


texts: One or more of the indexers are not valid. Please add Magento cron file to crontab or launch cron.php manually

texts:
I received the above system message error on the top right hand of the screen after logging into the Admin page of Magento 2.0

When I run -> php cron.php in my magento 2.0 installation directory I get the message below

PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
Could not open input file: cron.php

What could be wrong and how do I fix it?

Thanks in advance.


texts: How is the frontend header's Sign In link rendered?

texts: I would like to show like this in my theme


texts: Security Patch SUPEE-10752 - Possible issues?

texts:
A new security patch is out for Magento 1, addressing 25 APPSEC issues

https://magento.com/security/patches/supee-10752

What common issues do you have to watch out for when applying this patch?

  SUPEE-10752, Magento Commerce 1.14.3.9 and Open Source 1.9.3.9 contain multiple security enhancements that help close authenticated Admin user remote code execution (RCE), cross-site request forgery (CSRF) and other vulnerabilities.

  Information on all the changes in 1.14.3.9 and 1.9.3.9 releases is available in the Magento Commerce and Magento Open Source release notes.

  Patches and upgrades are available for the following Magento versions:

  Magento Commerce 1.9.0.0-1.14.3.9: SUPEE-10752 or upgrade to Magento Commerce 1.14.3.9.

  Magento Open Source 1.5.0.0-1.9.3.9: SUPEE-10752 or upgrade to Magento Open Source 1.9.3.9.


texts: Placing order Via Sandbox Authorize.net Payment Method but Getting Error "an error occured on the server please try to place order again"

texts:
I'm using "Sandbox Authorize.net" payment method to place an order via Magento2.2.4 but getting following error:-

"an error occurred on the server please try to place order again"

Here is the screenshot for the same:-

Here is the Authorize.net settings:-

https://nimb.ws/r68hP1

Note:-Few days back, it was working fine but don't know why for now it's not working,i tried R&D but issue didn't resolve. during R&D  I found following:-

Here:- https://support.authorize.net/s/article/MD5-Hash-End-of-Life-Signature-Key-Replacement

I blanked MD5 but it doesn't work.

Please help me to resolve this issue!


texts:
I have an issue in Magento 1.9.

If I click on a product in the category page the product page loads fine with the 3 column layout. Great.

But if I search for the same product using the search box the layout on the product page changes to 2-column right.

I've got the layout set to apply to products in the admin panel

This is the product page after I click the product in the category page

This is the product page layout after clicking on the product on the search page


texts: how to access magento store in Lan using wampserver 2.4

texts:
i am working on magento store on local wampserver 2.4 .Ip address of my system is 192.168.15.32.these are my wamp settings

#Listen 12.34.56.78:80
Listen 80
<Directory />
    AllowOverride none
    Require all granted
</Directory>

E:\wamp\alias\phpmyadmin.confg

Alias /phpmyadmin "E:/wamp/apps/phpmyadmin4.0.4/"

# to give access to phpmyadmin from outside
# replace the lines
#
#      Order Deny,Allow
#   Deny from all
#   Allow from 127.0.0.1
#
# by
#
#        Order Allow,Deny
#   Allow from all
#

<Directory "E:/wamp/apps/phpmyadmin4.0.4/">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    Allow from localhost
</Directory>

and my wamp is online color is green when i put 192.168.15.32 on another pc within lan the wamp page is open and when i click on my magento setup folder it show the error"unable to connect" or "not found" or "forbidden" however other folders on my wamp/www are accessible even phpmyadmin also working
please help me to resolve this issue to access the magento in lan on different systems at same time


texts: Preparing for Magento 2 Associate Developer Certification

texts:
Hi am preparing for Magento 2 certification and need a lot of support from the community if anyone knows some best dumps that I could purchase will be helpful.
NO.7 You are implementing a before plugin in MyCompany_Magic. It will intercept the same method
that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml
Which two actions are required to ensure the new plugin will execute last? (Choose two.)
A. Configure plugin sequencing for both plugins in MyCompany_Magic's etc/plugin_sequence.xml
file
B. Add MyCompany_Admission as a dependency in MyCompany_Magic's etc/module.xml file
C. Set a sortOrder="10" for MyCompany_Admission's plugin in MyCompany_Magic's etc/di.xml
D. Include a sortOrder="20" on the new plugin in MyCompany_Magic's etc/di.xml file
Answer: B, C
I can understand that I need to give dependency so I can get that the answer b is correct but I don't understand the concept with the option c.
Can anyone please explain it to me


texts: catalog_product_load_after printing more than 1 product's id

texts:
catalog_product_load_after event is fired when a product loads. I'm pring the ID of the loaded product but it's printing 3-4 product Id's in log.
Here is my code

 <events>
                <catalog_product_load_after>
                    <observers>
                        <retailon_productoption>
                            <type>model</type>
                            <class>retailon_productoption/observer</class>
                            <method>catalogProductLoadAfter</method>
                        </retailon_productoption>
                    </observers>
                </catalog_product_load_after>
            </events>

Observer code

 public function catalogProductLoadAfter(Varien_Event_Observer $observer){
            $product = $observer->getProduct();
            Mage::log($product->getId(), null, 'po.log');
        }

Why so? Does recently viewed products or recommended products appearing on product page are affecting it?


texts: Magento 2 - How to display description product listing page of wishlist?

texts:
I want to display description on the product listing page of Wishlist.

Facing the Fatal error:

  Fatal error: Class 'Satish\Wishlist\Block\Description' not found in /home/decure/public_html/test/var/generation/SatishWishlist/Block/Description/Interceptor.php on line 7

description.php file in block

<?php

namespace Satish\Wishlist\Block;

class Description extends \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Info
{
    protected $_productloader;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\ProductFactory $_productloader
    ) {
        $this->_productloader = $_productloader;
        parent::__construct($context);
    }

    public function getDescription()
    {
        $id = $this->getItem()->getProduct()->getId();
        $this->_productloader->create()->load($id);
        return $product->getDescription();
    }
}


texts: Is it necessary to follow EAV with the models I create for my modules?  If not always, when should I and when shouldn't I?


texts: Change layout of transactional emails not pdf

texts:
I need to change the design/ text/ fonts  of the transactional emails, do I need to change it in code and if so what files do I need to look at and any other advice in doing it

please advise.


texts: Want to remove "Compare Prod" from SideBar?

texts:
I have successfully removed the "Compare Prd" feature from my Site, but the SideBar "Compare Prd" is still showing.

How can i remove it from the HomePage, Catalog Page & Single Prod Page ?

http://postimg.org/image/exu16gn7v/

thanks.


texts: Checkout | Products from aborted purchase attempts are not deleted

texts:
I have a problem with the checkout. Products from aborted purchase attempts are not deleted.

the following scenario

The customer has only one product in his shopping cart.
In the checkout process (onepagecheckout), he must log in.
After logging in, the product of the aborted purchase attempt is also displayed in the CheckoutSteps.

I would like to turn it off.
We sell prints. Since there is only one product per order.

maybe someone has an idea


texts: What happens if I CTRL + C halfway through a cli command?

texts:
So I'm setting the mode of the store to production. It's done the compilation etc. but hangs on the static content deployment. If I were to CTRL + C the command now, will the mode still be set to production and will my code still be "compiled"? I'd try, but I've been waiting 15 minutes as it is and don't want to start the process again if it turns out it reverts everything and haven't found anything in the docs

Thanks! :)


texts: Magento 2 : Product Quantity Update Programatically If Product Status is Disabled

texts:
We want update product quantity programatically.
If product status is Enable then quantity update properlly.
But which product status is Disable quantity not update in it.
We create one custom module for it.
Any one help me for sort out this.

Here is my module Block/Index/index.php file code.

public function updateStock($productId,$productQty)
{
    $product = $this->productFactory->create()->load($productId);

    if($product->getStatus() == 2){ // 2 => Disable , 1 => Enable

        $product->setStatus(1);

        if($product->getStatus() == 1){
            $product->setStockData([
                //'use_config_manage_stock' => 0, //'Use config settings' checkbox
                //'manage_stock' => 1, //manage product stock
                'is_in_stock' => 1, //Stock Availability
                'qty' => $productQty
            ]);

            $product->setQuantityAndStockStatus([
                'qty' => $productQty,
                'is_in_stock' => 1
            ]);
        }

        $product->setStatus(2);

        try {
            $product->save();
            echo 'Quantity update of SKU => '.$product->getSku().'
';
        } catch (Exception $e) {
            echo $e->getException();
        }

    }else{

        $product->setStockData([
            //'use_config_manage_stock' => 0, //'Use config settings' checkbox
            //'manage_stock' => 1, //manage product stock
            'is_in_stock' => 1,
            'qty' => $productQty
        ]);

        $product->setQuantityAndStockStatus([
            'qty' => $productQty,
            'is_in_stock' => 1
        ]);

        try {
            $product->save();
            echo 'Quantity update of SKU => '.$product->getSku().'
';
        } catch (Exception $e) {
            echo $e->getException();
        }
    }


texts: How to show a default message if no recently viewed products?

texts:
I am trying to show a message when there is no recently viewed products.

But after enabling Template Path Hints from the magento dashboard, I found that the reports/product_viewed.phtml is not even called if there is no recently viewed products.

Can anyone please help how to achieve this.

Thanks


texts:
I used Magento 2.3.4, but not received the site owner emails for the two specific orders.
the order has places but I didn't get Order Email, only two specific order,
I have checked all email settings, all are correct,
so I don't know now where I have to check for those order emails?
please suggest to me or assist me for this issue..
thanks in advance.


texts:
we are looking for a Magento extension to identify country and show popup/shipping message. Pref. without too much pressure on performance.

Something like they do on this site:
www.brooksbrothers.com
and this site have it
shop.nordstrom.com

Question: Is this programmed? or would extensions be available?

I know pop-up extensions exist. But there are just so many and so many examples. And none seem to do exactly the above.

Help appreciated


texts:
I would like to remove these JS from my M2:
range.js
colorpicker.js
datepicker.js
tooltip.js
polyfill.js
decorate.js
Would someone know how to achieve that ?
Thanks.
Jack


texts:
is there a way to block all modification allowed to an user account using XML or something else ?

I want to avoid my user to change password, addresses, mail etc...


texts: Should cron jobs get terminated or run forever?

texts:
When I do ps aux | grep queue I get the following list of processes that were started via cronjobs:
webmast+ 2309182  0.0  0.0 366472  4592 ?        S    Sep29   3:29 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start product_action_attribute.update --single-thread --max-messages=10000
webmast+ 2309184  0.0  0.0 366472  3104 ?        S    Sep29   3:28 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start product_action_attribute.website.update --single-thread --max-messages=10000
webmast+ 2309186  0.0  0.0 366472  3088 ?        S    Sep29   3:31 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start exportProcessor --single-thread --max-messages=10000
webmast+ 2309188  0.0  0.0 366472  3028 ?        S    Sep29   3:29 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start inventory.source.items.cleanup --single-thread --max-messages=10000
webmast+ 2309190  0.0  0.0 366604  2204 ?        S    Sep29   3:28 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start inventory.mass.update --single-thread --max-messages=10000
webmast+ 2309192  0.0  0.0 366476  2984 ?        S    Sep29   3:28 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start inventory.reservations.cleanup --single-thread --max-messages=10000
webmast+ 2309194  0.0  0.0 366476  3044 ?        S    Sep29   3:27 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start inventory.reservations.update --single-thread --max-messages=10000
webmast+ 2309196  0.0  0.0 366472  3092 ?        S    Sep29   3:28 /usr/bin/php /var/www/html/emark/shop/bin/magento queue:consumers:start codegeneratorProcessor --single-thread --max-messages=10000

They were started at 29th of September. Now it is the 2nd of October, so they run for a couple of days already. It this how it should be or should those processes get terminated already? Does that indicate something goes wrong?
Update: The actual problem seems to be what is described here. It is not the cronjob itself, rather it is about Magento's message queue processing and the env.php setting
consumers_wait_for_messages.


texts: How to create new js file and override the one from extension - Magento 2

texts:
So, I have a js file from an extension, that I need to override

the path is:  app/code/MyExtension/MyExtensionSubfolder/view/frontend/web/js/script.js

Where should I put the new JS file so that it will override script.js from above? And what else is necessary for this to work?

If I want to override a .phtml file from this extension, is simple. Create a new folder in
app/code/design/frontend/Venustheme/kasitoo with the name combined MyExtension_MyExtensionSubfolder and then follow the path from an extension and put here the phtml and it works.

But for js file from example if I create a new js file called script.js to the path
app/code/design/frontend/Venustheme/kasitoo/MyExtension_MyExtensionSubfolder/web/js/script.js is not working.

So the question is where should I put my new JS file with the modifications I made, that will override the script.js from the extension. Because if I made the changes directly in the extension, after the first update of the extension, I will lose those changes.


texts: Setup Magento2 Docker Config Apple Silicon M1

texts:
is there any way to set up a docker compatible environment for Apple M1? Unfortunately Warden doesn't support the new ARM chips for now.
are there any viable alternatives to having a working development stack?


texts: Image resize is not working on a smaller value

texts:
So I am in checkout/cart/minicart/default1.phtml. I am trying to change the image size on my minicart from 180 to 60.  When I do this magento just breaks and stops loading resources after that line. This is my default line.

            <img src="<?php echo $this->getProductThumbnail()->resize(180); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" >

This is what I have tried.

            <img src="<?php echo $this->getProductThumbnail()->resize(60); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" >

            <img src="<?php echo $this->getProductThumbnail()->resize(60,60); ?>" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" >


texts: How do I make links open in a new tab using the category link widget?

texts:
I'm using the following code to create inline text links to categories based on their ID:

{{widget type="catalog/category_widget_link" anchor_text="Some text" title="Some text" template="catalog/category/widget/link/link_inline.phtml" id_path="category/###"}}

This way, the links go directly to the store category without having to use the URL. But the problem is, I need these links to open in a new browser tab. Since I'm not using <a href=""> to create the links, I can't use the HTML target attribute to direct them to open in a new tab.

Does Magento have a target attribute equivalent for these types of links created with this widget?


texts: Display sum of Amount corresponding to some column xyz

texts:
I had created model donation to save donation information and now i want to display total amount of donation to be shown with all the other field

my table is as follows

---------------------------
  name address phone amount
  test   abc   454545  55
  test2  pqr   83294   10
  test   abc   31286   50

and desires output would be like

---------------------------
  name address phone amount
  test   abc   454545  105
  test2  pqr   83294   10

i'm trying to put code

$testmodel = Mage::getModel('donation/donation')
                ->getCollection()
                ->getSelect()->group('name')
                ->addExpressionAttributeToSelect('SUM({{amount}})', 'amount');

but it can't work.


texts: Refreshing cache is necessary to see the results of a controller action (delete)

texts: I have a table of data, I added a delete button in each row. The controller action is well executed and the row is deleted, but I need to manually refresh Magento cache (FullPageCache to be precise) to see the results. How to manage to see instantly the results without having to manually refresh the cache ?


texts: Magento 2 How to get all products from a non anchor parent category and its subcategories

texts:
I want to display all products from a non anchor parent category and its subcategories. My categories are non anchor.

http://i.prntscr.com/NOZYKxj4Sh2S2tw1yHjyLQ.png


texts:
I'd like to understand how price filter works on configurable products.

Let's say I have one config. products with 2 linked simple products.

The simple product prices are 100$ and 200$, so that the configurable one base price will be 100$.

Let's say customers filter price from 150$ to 200$.

Will that product be listed?

If not, how to show it?

Hope I was clear.
Thank you guys


texts: What event do I need to observe to see what shipping methods are available for a given quote


texts: Magento REST API / Apache and "Content-Type header is empty"

texts:
Has anyone noticed this error message "Content-Type header is empty" when POST-ing to Magento REST API? I'm using Postman for testing and very-very surely I'm sending the Content-Type header along with my request. So something cuts it off in between. Can it be misconfigured Apache / .htaccess? Never seen that problem with nginx before.

The error is thrown by Mage_Api2_Model_Request, in the very early stage of API request.


texts: Magento 2 - Sender Name doesn't appear in web-mail

texts:
In Magento 2, I defined sender names and emails in Stores > Settings > Configuration > General > Store Email Addresses.

In Sales > Emails I set the new order confirmation email sender.

But when I go to my Webmail (Gmail but same for others webmails) there is no sender name there is only an email address.

Do you know why and how to make a sender name appear in webmail?

EDIT

In admin I set :

Sender Name: Test

Sender Email: "contact@test.com"

Why in Gmail Sender Name is "contact" and not "Test" ?

Thanks


texts: How can I get the cart item id after adding product to cart

texts:
I created a basic ajax addToCart function in the CartController and it works great. I just want the cart item id in this function.

I run:

$cart->addProduct($product, $params);
$cart->save();
$this->_getSession()->setCartWasUpdated(true);

Is there no way to output the cart item id from this?


texts: M 2.2 - Swagger UI gives undefined and Request does not match any route

texts:
Failed to load API definition.
undefined https://www.example.com/rest/default/schema?services=all

While inspecting further i can see that it gives me below error.

{message: "Request does not match any route.", trace: null}
message: "Request does not match any route."
trace: null

Few other points

Website has SSL on
Developer mode is on
JS and CSS merging is off for now


texts:
This is my system:

Ubuntu 18.04
Nginx 1.14.0
MySQL 5.7.25
Magento 2.3

I installed elasticsearch and it worked fine but it gave me this error and I do not know how to fix it:

Any suggestions?

Log Errors:

elasticsearch.log

  ...

  [2019-02-11T11:10:57,773][WARN ][o.e.c.InternalClusterInfoService] [J0f87iQ] Failed to update node information for ClusterInfoUpdateJob within 15s timeout

gc.log.0.current

  2019-02-11T11:10:56.503+0100: 148.205: Total time for which application threads were stopped: 1.9227318 seconds, Stopping threads took: 0.6230841 seconds

elasticsearch_deprecation.log

  [2019-02-11T11:04:49,724][WARN ][o.e.d.c.m.MetaDataCreateIndexService] [J0f87iQ] the default number of shards will change from [5] to 1 in 7.0.0; if you wish to continue using the default of [5] shards, you must manage this on the create index request or with an index template

  [2019-02-11T11:04:50,788][WARN ][o.e.d.i.m.AllFieldMapper ] [J0f87iQ] [_all] is deprecated in 6.0+ and will be removed in 7.0. As a replacement, you can use [copy_to] on mapping fields to create your own catch all field.


texts: How to save the deleting customer book address id in customer custom attribute on Magento2?

texts: I don't know how to implement this task. I need to Save the deleting customer book address id in customer custom attribute the customer on Magento2. Could you please help me?


texts: How to add Payment method information in Gift message in Transactional email?

texts:
We want to add payment method information in to Gift message section in transactional mail.
Any one help me for set this in my magento 1.9 site.


texts: Call to a member function getFrontend() on boolean in Infortis/Brands/Block/AbstractBlock.php

texts:
im getting this error on product view page and was wondering if you could help me with this:

    Fatal error: Uncaught Error: Call to a member function getFrontend() on boolean in /home/applian1/public_html/app/code/Infortis/Brands/Block/AbstractBlock.php:161 Stack trace: #0 /home/applian1/public_html/app/code/Infortis/Brands/Block/Logo.php(116): Infortis\Brands\Block\AbstractBlock->getBrand(Object(Magento\Catalog\Model\Product\Interceptor)) #1 /home/applian1/public_html/app/code/Infortis/Brands/Block/Logo.php(103): Infortis\Brands\Block\Logo->getCurrentBrand() #2 /home/applian1/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1035): Infortis\Brands\Block\Logo->getCacheKeyInfo() #3 /home/applian1/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1093): Magento\Framework\View\Element\AbstractBlock->getCacheKey() #4 /home/applian1/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache() #5 /home/applian1/public_html/vendor/magento/framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock-> in /home/applian1/public_html/app/code/Infortis/Brands/Block/AbstractBlock.php on line 161


texts:
I'm trying to download the PHP 5.4 patch for Magento 1.x CE but I cannot find it, I think this guide is out of date:
https://devdocs.magento.com/guides/m1x/other/php5.4_patch.html


texts:
When I am in the listening product when I mark order alphabet by name I want to use two attributes. First my attribute, later name.

This is my structure name product: my_attribute name_product

I want to sort first by my_attribute when value my_attriute is the same I want to filter by name product.

I try to modify setCollection method in Mage_Catalog_Block_Product_List_Toolbar(later I create custom module) but this is no work. I tried $collection->setOrder('my_attribute, name', asc) not work. When in this function I dump ids product sort is ok, but somewhere this sort is overridden. Do you have any hints?


texts: How to get customer that birthday date is now in Magento 2

texts:
I need to send an email to the customer that birthday date is current date, currently I've been doing like this, but no luck:

public function __construct(
    ...
    \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerFactory
    ...
) {
    ...
    $this->_customerCollectionFactory = $customerCollectionFactory;
    ...
}

public function process(){
     $collections = $this->_customerCollectionFactory->create()->addFieldToFilter('birthdate',date('m-d));
}


texts: Configurable child product custom attribute gets value by parent

texts:
Is there any way to inherit custom atribute value parent to child ?
eg: i have custom attribute "test" , creating configurable product productConf with child productConf-l, changing value "test" in parent to "0" and want to set productConf-l attribute test set "0",
can any way all child products (syncronized) value same with parent ?
Actually creating backend class, in the beforeSave function set all child attribute via by object manager it works but is that any better way to do this ?


texts:
I have used the the link for create a extension to add Custom Options in the admin. Now it works in admin part, But when i create the custom view part for product, it did not work for me. First thing i cant understand where i add the bellow code in my config.xml file.

<catalog_product_view>
    <reference name="product.info.options">
        <action method="addOptionRenderer">
            <type>instagramimage</type>
            <block>webtoprint/catalog_product_view_options_type_instagramimage</block>
            <template>webtoprint/catalog/product/view/options/type/instagramimage.phtml</template>
        </action>
    </reference>
</catalog_product_view>

What is the Customized method in it

class Ikantam_Webtoprint_Block_Options_Type_Customview_Instagramimage
    extends Mage_Core_Block_Template
{
    protected $_template = 'webtoprint/options/customview/instagramimage.phtml';
}

Where it works ? I cant understand how the instagramimage.phtml display on the frontend.

<?php /** @var $this Ikantam_Webtoprint_Block_Options_Type_Customview_Instagramimage */ ?>
<?php $data = $this->getInfo(); ?>

<?php echo $data['value'] ; ?>

Al last what what is the template here and how i can use it ?

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

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

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

        <input type="text"
               id="options_<?php echo $_option->getId() ?>_instagramimage"
               class="<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?>"
               name="options[<?php echo $_option->getId() ?>]"
               value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" />

Now i can get the custom option in my admin section, But When i add some value like

Title * Input Type *          Is Required   Sort Order
Test        text(Instagramimage)   yes                  0

Price   Price Type  SKU
450.00      fixed           34

I found the input box with title given, but could not find the price value. As frontend it could not save the price value in backend also.In data base SKU value has saved but not the price value.


texts: Magento 2 function to get a list of products (simple and configurable) with special price on a given date

texts:
I have the following function which gives me a list of simple products which are on special at the moment:

 public function getSpecialProducts($config = [])
    {
        /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
        $collection = $this->_productCollectionFactory->create();
        if(isset($config['categories'])){
            $collection->joinField(
                'category_id', $this->_resource->getTableName('catalog_category_product'), 'category_id',
                'product_id = entity_id', null, 'left'
            )
            ->addAttributeToFilter('category_id', array(
                array('finset' => $config['categories']),
            ));
        }

        $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds())
        ->addAttributeToSelect('*')
        ->addStoreFilter()
        ->addMinimalPrice()
        ->addUrlRewrite()
        ->addTaxPercents()
        ->addFinalPrice();
        $collection->setPageSize(isset($config['pagesize'])?$config['pagesize']:5)
        ->setCurPage(isset($config['curpage'])?$config['curpage']:1)
        ->getSelect()->group("e.entity_id");
        $collection->getSelect()->where('price_index.final_price < price_index.price');
        return $collection;

But it totally ignores the mother product if the child product is on special.

So I tried to use this function instead:

 public function getDealsProducts($config = [])
    {
        $todayStartOfDayDate = $this->_localeDate->date()->setTime(0, 0, 0)->format('Y-m-d H:i:s');
        $todayEndOfDayDate = $this->_localeDate->date()->setTime(23, 59, 59)->format('Y-m-d H:i:s');

        /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
        $collection = $this->_productCollectionFactory->create();
        if(isset($config['categories'])){
            $collection->joinField(
                'category_id', $this->_resource->getTableName('catalog_category_product'), 'category_id',
                'product_id = entity_id', null, 'left'
            )
            ->addAttributeToFilter('category_id', array(
                array('finset' => $config['categories']),
            ));
        }
        $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds())
        ->addAttributeToSelect('*')
        ->addStoreFilter()->addAttributeToFilter(
            'special_from_date',
            [
            'or' => [
            0 => ['date' => true, 'to' => $todayEndOfDayDate],
            1 => ['is' => new \Zend_Db_Expr('null')],
            ]
            ],
            'left'
            )->addAttributeToFilter(
            'special_to_date',
            [
            'or' => [
            0 => ['date' => true, 'from' => $todayStartOfDayDate],
            1 => ['is' => new \Zend_Db_Expr('not null')],
            ]
            ],
            'left'
            )->addAttributeToFilter(
            [
            ['attribute' => 'special_from_date', 'is' => new \Zend_Db_Expr('not null')],
            ['attribute' => 'special_to_date', 'is' => new \Zend_Db_Expr('not null')],
            ]
            )->addAttributeToSort(
            'special_from_date',
            'desc'
            )
            ->setPageSize(isset($config['pagesize'])?$config['pagesize']:5)
            ->setCurPage(isset($config['curpage'])?$config['curpage']:1)
            ->getSelect()->group("e.entity_id");
            return $collection;
    }

But it is also not getting me to where I want to be.

I am new in magento 2. Please help


texts: Magento 2 Override minicart.phtml template?

texts:
This is the Magento core template path:

vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml

I would like know how to override this template with my theme.


texts: How can i filter products in a category using color,price and manufacturer in magento 2

texts:
I have tried using a single attribute filter and i got it but when applying multiple attributes i am not getting the response.please find the below code that i tried by using multiple attribute.

public function getfilterproducts()
{

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            //============load category object============//
    $categoryid = 7;
    $categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory');
    $categoryHelper = $objectManager->get('\Magento\Catalog\Helper\Category');
    $category = $categoryFactory->create()->load($categoryid);
    $productItems = $category->getProductCollection()
    ->addAttributeToSelect('*')
    ->setPageSize(20);

    $filter_arr = array(
        array('attribute'=> 'mobile_color','eq' => "57"),
        array('attribute'=> 'manufacturer','eq' => "65"),

        );
    $productItems = $this->_productCollectionFactory->create()->addAttributeToSelect('*')->addAttributeToFilter($filter_arr);
        // $productItems->setPageSize(20);

    $productItems->setVisibility($this->productVisibility->getVisibleInCatalogIds());

    foreach ($productItems as $product) {
        echo $product->getName()."</br>";

    }
}


texts: Magento 2 - How to override checkout-loader.js

texts:
I want to override magento_checkout/js/checkout-loader.js file with my custom module ( using require js ) here is my requirejs-config.js file :

var config = {
"map": {
    "*": {
        'Magento_Checkout/js/checkout-loader': 'Vendor_Module/js/checkout-loader'
    }
}
};

but it is not working.

I have flushed cache, deployed-static-content no but it doesn't load.


texts: Customer created_at date is converted to UTC twice

texts:
I've found a problem with an extension we installed for registering new customers via social networks. Every customer that registers through the extension gets the wrong created_at date. We have our own registration module and that one works just fine.

My timezone is UTC -6, so we get something like this.

Current Time       Displayed          Stored
                   (Admin panel)      (Database)
2015-05-14 08:00   2015-05-14 08:00   2015-05-14 14:00   <<== our module (correct)
2015-05-14 08:00   2015-05-14 14:00   2015-05-14 20:00   <<== their module

It looks like the date is converted to UTC twice, so when it is converted back to GMT for display, it is off by 6 hours.

I read this question and found out it's a Magento bug. But how can I overcome this? Why is it working in my module and not in the third party extension? I looked into their code and could only find $customer->save() being called once. I cannot set the correct date before saving since it will be overriden in the _beforeSave method of the customer model and I also can't edit the core model class. I don't think I can subscribe to the customerAfterSave event either since If I changed it there, the module that is currently working would be messed up.


texts: Cart items empty inside plugin for Configurable Product

texts:
I have tried many methods to get cart items inside plugin for "Magento\ConfigurableProduct\Block\Product\View\Type\Configurable" . I am trying to add additional cart item data to the "getJsonConfig" function.

No matter what I do, the cart always seems to be empty even though there are items in the cart.

<?php
namespace VENDORNAME\VENDORMODULE\Plugin\ConfigurableProduct\Product\View\Type;

use VENDORNAME\VENDORMODULE\Helper\Data as Helper;

class Configurable
{
    protected $_helper;
    protected $_jsonDecoder;
    protected $_jsonEncoder;
    protected $_customerSession;
    protected $_checkoutSession;
    protected $_cart;
    protected $_cartHelper;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        Helper $helper,
        \Magento\Framework\Json\DecoderInterface $jsonDecoder,
        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Checkout\Helper\Cart $cartHelper,
        array $data = []
    ) {
        $this->_helper = $helper;
        $this->_jsonDecoder = $jsonDecoder;
        $this->_jsonEncoder = $jsonEncoder;
        $this->_customerSession = $customerSession;
        $this->_checkoutSession = $checkoutSession;
        $this->_cart = $cart;
        $this->_cartHelper = $cartHelper;
    }

    protected function _getCartProducts() {
        $cartProducts = array();
        $cartItems = $this->_checkoutSession->getQuote()->getAllItems();
        if($cartItems && sizeof($cartItems)) {
            foreach($cartItems as $item) {
                if($item->getProductType() == 'simple' && $item->getParentItemId()) {
                    $cartProducts[$item->getProductId()] = $item->getQty();
                }
            }
        }
        return $cartProducts;
    }

    public function afterGetJsonConfig($subject, $result) {
        $config = $this->_jsonDecoder->decode($result);
        $config['cart'] = $this->_getCartProducts();
        return $this->_jsonEncoder->encode($config);
    }
}

Anyone have any ideas how to retrieve the cart items here? Or why it is missing?
Do I need a $cartId variable or something to load the cart first?
Is it possible this has something to do with caching?

I have no idea why the cart appears empty here.

Thanks in advance


texts: How to show custom customer attribute in customer grid dynamically using backend grid

texts:
In magento 2, I am working on extension manage customer attributes. I want to show custom customer attribute added to show on customer grid.

I set attribute values like is_used_in_grid=1, is_visible_in_grid=1 , is_filterable_in_grid=1 and is_searchable_in_grid=1 but still attribute is not displaying on customer grid.

I found one solution here How do you add a custom attribute to the customer grid in adminhtml (Magento2)
This solution uses Ui component, I want to show custom customer attributes dynamicaly on customer grid. How can I do this?


texts: Block will not shown if removed somewhere else

texts:
I'm facing this problem even before CE 1.9.2

In footer, I create a global custom block with page/html_wrapper type like below

<default>
    <reference name="footer">
        <block type="page/html_wrapper" name="bottom.wrapper" as="bottomWrapper">
        ...
    ...
...

In some specific pages, such as Shopping Cart, Checkout Onepage,... I don't want to show this custom block, then I remove it by

<checkout_cart_index translate="label">
    <remove name="bottom.wrapper"/>
    ...
...

or by

<checkout_cart_index translate="label">
    <reference name="footer">
        <remove name="bottom.wrapper"/>
        ...
    ...
...

or by

<checkout_cart_index translate="label">
    <reference name="footer">
        <action method="unsetChild"><name>bottomWrapper</name></action>
        ...
    ...
...

Prolem is, if the first visit page that generates the cache is a global page (such as home page), footer will be cached, included bottom.wrapper block, then all the above specific pages show bottom.wrapper as well. If the first visit page that generates the cache is one of above specific pages, footer will be cached without bottom.wrapper block, then all other pages won't see bottom.wrapper anymore.

Disabling BLOCK_HTML cache is a temporary solution. I don't want to hide bottom.wrapper block by css.

How to deal with it? How to make bottom.wrapper showing properly as desire?

UPDATE:

Because this question has marked duplicate, so I cannot give an answer for my own solution:

My bottom.wrapper is placed in bottom of the pages, doesn't mean it must be included in footer.
Instead of including in the footer, I create a new child block of the root

<default>
    <reference name="root">
        <block type="page/html_wrapper" name="bottom.wrapper" as="bottomWrapper">
        ...
    ...
...

Then in the page template, such as 1column.phtml, 2columns-left.phtml,... I insert before footer:

<?php echo $this->getChildHtml('bottomWrapper') ?>

By now, bottomWraper is cached by its own key, not attached to the footer anymore.
Other step (removing, getting,..) is just like before.


texts: M2: Using small PHP script in .html file (or) Changing .html file to .phtml

texts:
We are running into an issue where we need to run a little php script within a .html file in Magento 2, namely;
/app/design/frontend/CleverSoft/core/Magento_Checkout/web/template/minicart/content.html

When we have tried adding the ability for html files to run php via the .htaccess, it ends up causing other errors within Magento so it just ends up breaking more things. Namely, using things like;
AddType application/x-httpd-php56 .php .htm .html

or

AddType application/x-httpd-php .html .htm

Are there other alternatives to try to run php within this html file, or is it possible to change this file to .phtml like so many of the others? I would just have to find where it is originally called I assume and change that from .html to .phtml?
Thanks for the insight!


texts: This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP

texts:
I am using xampp and it's php version is 7.3.27. I am trying to install magento version-2.4.2 in ubuntu linux. But i am facing this problem.
I have found several solution to install libosodium extension on internet to solve this problem. But it is not clear, how to install it in xampp php folder, not in the usr/bin/php folder. Because i am using xampp php as default php.


texts: How to achieve "shipping countdown timer" for delivery feature?

texts:
I am trying to develop  a module/functionality shipping deadline countdown timer  on product page.

This timer will notify customers about expected delivery date if a purchase is made before the timer reaches zero

See working example here on amazon

I should able to set delivery days and cut off time for products in admin

Note: On Magento1 can be achieved via using this extension: Shipping Deadline Countdown

Any help will be highly appreciated.


texts: Magento-1.9 Catalog Price Rule exemption

texts:
I have a store with 4 or 5 Catalog Price Rules that apply 10%,20%, etc. off of all products in the store. These rules are tied to matching customer groups that make up a membership program we offer with different tiers for discounts.

Currently, the Catalog Price Rules apply to all items in the store across the board - all items get the discount at the level your membership includes.

We have released a special edition product that should be exempt from all price rules, even the Catalog Price Rules that apply to everything. This product should be sold for the listed price, regardless of what membership level you are, or what coupon code you have.

I understand how shopping cart price rules work, and how to make a product exempt from discount in the Promotions tab, however no rules seem to apply to the Catalog Price Rules, and customers are still seeing this special release item for a discounted price.

In the Promotions tab, I have created various Actions that seem to only apply to Shopping Cart Price Rules and have run out of ideas on how to make Actions for exempting a product from discount apply to the Catalog Price Rules.

Is there anything I can do since the CPR takes precedence over all other discounts?

Any advice or help would be appreciated, and if this has been asked before please advise.

Thank you in advance.


texts: How can I get full cart contents from Customer Login observer (Magento 2)

texts:
I have created an observer for customer_login event which requests the current cart contents. I have tried to use (as indicated in other posts in this forum):

public function __construct(
        ...
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Checkout\Model\Cart $cart
) {
    ...
    $this->_checkoutSession = $checkoutSession;
    $this->_cart            = $cart;
}

and

public function execute(\Magento\Framework\Event\Observer $observer)
{
    ...
    $quote = $this->_checkoutSession->getQuote();
    $contents = $quote->getAllItems();  //Have tried getAllVisibleItems() too.

or

public function execute(\Magento\Framework\Event\Observer $observer)
{
    ...
    $quote = $this->_cart->getQuote();
    $contents = $quote->getAllItems();

In each case, the code works for the 'normal' situation and $contents is correct.

However, a false situation occurs where the customer logs in, adds product(s) and logs out - or closes the window without completing the purchase

If they then return to the store, add a product before logging back in, the login observer only picks up the new product whilst the cart on screen shows the entire cart - including the original products that were left in the cart.

It makes sense to add the old product back to the cart but I'd like to pick the entire product list up with my $quote->getAllItems()...

Is this possible? Do I need a second observer to act later in the process? (And if so, is there a standard event available?)

Interestingly, if I have a second observer checkout_cart_save_after, which gets the cart details in the same way, the complete list is returned...

This makes me think the cart is not yet updated when the customer_login event triggers. How can I fix that?

Thanks all!


texts: How to Create Custom Form in Magento2 Frontend?

texts:
I want to create a custom form in frontend and using this form customer can get an appointment.

In my form, I have 4 Fields.

First Name (text filed)
Last Name (text filed)
Phone No. (numeric field)
Booking a time (with date time calendar)

So when a customer fills up this form and does submit I want to insert this data in database and show in the admin section.

How can I achieve this functionality in Magento-2.1

I have referred this link but it's not as per my functionality.


texts:
Changing site to production mode display below error on command terminal in (red color):

Enabled maintenance mode
Starting compilation
Compilation was started.
.....
.....
Generated code and dependency injection configuration successfully.
Compilation complete
Starting deployment of static content

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

Command returned non-zero exit code:
`/opt/nexcess/php70u/root/usr/bin/php -f /chroot/home/siteRoot/html/bin/magento setup:static-content:deploy en_GB en_US`

if i execute command with skip compilation: php bin/magento deploy:mode:set production -s. It works but site display messed as css and js donest load.

Site is working well in developer mode but only issues with production mode.

Update: I figure out the problem.
less files of font awesome was creating issues to change site to production mode.

Now CSS and JS is not loading in Production mode though Mode can be changed easily.

What can be reason of this?


texts: I need to add the delivery date for the cutom shipping method in magento 2

texts:
There are three different types of shipment are there I need to add the delivery for each one for shipment 1 it's standard delivery within 3 days, shipment method 2 the customer needs to choose the delivery date with date picker, shipment 3 the delivery will be within 21 days

I need to add the different delivery date for each method.


texts: Magento 2 when I click on frontend my account cannot open and it shows error

texts:
I am facing this issue.

  My XML file is app/code/Prayag/Module/view/frontend/layout/cms_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

   <referenceContainer name="content">
       <block class="Magento\Framework\View\Element\Template"  name="order_total" template="Prayag_Module::orders.phtml">
        </block>
    </referenceContainer>
    <referenceContainer name="sidebar.additional">
<block class="Magento\Framework\View\Element\Template" name="order_total_sidebar" template="Prayag_Module::orders.phtml">
</block>
</referenceContainer>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="cart_total_sidebar" template="Prayag_Module::cart_view.phtml">
</block>
</referenceContainer>

</page>

  My phtml file is app/code/Prayag/Module/view/frontend/templates/orders.phtml

<?php

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
$customerID = $customerSession->getCustomerId();

$order = $this->helper('Prayag\Module\Helper\Data')->getCollection($customerID);

foreach($order as $items){ ?>
IncrementId :<a href="<?php echo $block->getUrl('sales/order/history'); ?>"><?php echo $items->getIncrementId(); ?>

<?php
echo "Subtotal :". $items->getSubtotal(). '
';
echo "Order Status :". $items->getStatus(). '
';
echo "Date :". $items->getCreatedAt().'
';

}

  And my helper file is app/code/Prayag/Module/Helper/Data.php

<?php
namespace Prayag\Module\Helper;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
public function __construct(
\Magento\Sales\Model\OrderFactory $orderFactory
) {
$this->orderFactory = $orderFactory;
}
public function getCollection($customerID)
{
$collection = $this->orderFactory->create()->getCollection()->setOrder('entity_id', 'DESC')
->addAttributeToFilter('customer_id',$customerID);
$collection->setPageSize(5)->setCurPage(1);
return $collection;
}
}


texts: Magento2: Email checkout validation on submit only

texts: Is it possible to trigger the validation of email field when the customer click next button only? I want to remove the validation on keypress etc


texts: Magento newsletter queue grid recipients column

texts:
i am extend the newsletter module in mangento(1.9), in the newsletter queue grid having column name recipients, but in table don't have a column name like that.

May i know from where that field value is coming.

For your further reference i have attached some screen and code in grid file.

in queue grid class
-------------------
  $this->addColumn('subscribers_total', array(
            'header'    =>  Mage::helper('newsletter')->__('Recipients'),
            'type'      => 'number',
            'index'     => 'subscribers_total'
        ));

newsletter_queue table

News letter grid


texts: Change Maximum Qty Allowed in Shopping Cart programmaticaly

texts:
When I go to System -> Configuration -> Catalog -> Inventory -> Product Stock Options, I can change Maximum Qty Allowed in Shopping Cart.

I need to do that in setup script. How to do that via setup script? I tried setStoreConfig but I probably used wrong node and it is not working.