texts: Do we need to compile after applying Magento Patches?

texts:
There is a patch available: Magento Commerce v2.3.6/2.4.1 CAPTCHA in checkout not working
The patch does include new classes.
My Question: Do we need to compile after applying the patch?

Magento just suggests clearing the cache after applying the
patch.


texts:
How can we create a package product in magento.
For eg.
A product is having 1g weight and base price = 10$
But when same product is purchased at a smaller quantity say 1 g * 10 pouch its price is not 10*10 = 100, but will be 90.
Similarly if I have a new package under the same product of say 2g*10 its price will be
150 and not 200. I hope my question is understandable. Please comment if anything is unclear.

Think in a way, that i need a product something related to pharmaceuticals. And I have pouches with different weights of tablets. And a user can add both the pouches which are associate to a same product.
Please help me in this condition
Thanks


texts:
I want to add a link at my top navigation i am not getting what is happening at my code:

The module is active and here is the config.xml

<config>
    <modules>
        <StorePickupLink_PickUpLink>
           <version>0.1.0</version>
        </StorePickupLink_PickUpLink>
    </modules>
    <fronted>
    <layout>
        <updates>
            <storepickuplink_pickuplink module="StorePickupLink_PickUpLink">
                <file>storepickuplink_pickuplink.xml</file>
            </storepickuplink_pickuplink>
        </updates>
    </layout>
</fronted>
</config>

And here is the layout called by config file

<layout>
<default>
    <reference name="top.links">
    <action method="addLink" translate="label title" module="StorePickupLink_PickUpLink">
        <name>store_pickup_link</name>
        <path>storepickuplink_pickuplink/index</path>
        <label>Our Stores</label>
        <title>Our Stores</title>
        <position>10</position>
    </action>
    </reference>
</default>

Any idea what is happening with my code? Thanks


texts:
I'm having an issue with the inventory of some of my stores, some products are going to 0 qty in stock, and still available. I have two catalog logger modules installed, and none of them can catch this "to 0 update".

The problem is not the stock status, the product should be available because there is no order/change, but for some reason the quantity was set to 0.

As you can see on the image below, the product have its stock changed from 0 to 1 at day "23", and 2 weeks later, its stock changed from "0 to 1" again. There is no log of the change from "1 to 0".

These are the events that my logger modules observe:

catalog_product_save_after
cataloginventory_stock_item_save_after
order_cancel_after
checkout_submit_all_after
cataloginventory_stock_revert_products_sale
sales_order_payment_refund

What I've already checked/know:

Backorders settings
There is no orders with those items
No refunds
This happens with all kind of products (simple, configurable, bundle)
Inventory updates via API is register by the logger module

Extra Info:

Magento version: 1.5 (yeah, i know its old =/)


texts:
I am getting stuck with the prices of configurable products on magento 2

I have made a configurable product with 6 simple products in it. Alle the simple products have received their own price. But when I select the product in my webshop the product dont show the right prices. The first product shows the good price, but the others just show the price difference.

In the shopping cart the prices are right.

See pictures below. It is not in English but in Dutch, but probably understandable.

Anyone who knows how to solve this? Am I missing a setting? Thanks in advance.

All settings in the configurable product, with the right prices:

first product is selected as standard, with the right price:

when I select the second product, the price will shown the difference instead of the new price:

In the shopping cart it shows the right prices:


texts: After Flush Catalog Images cache from magento2 admin images not showing in frontend

texts:
In Magento admin System > Cache Management and then click on button Flush Catalog Images Cache.

Then Images not showing in frontend.

But If I apply below command then Images showing

php bin/magento catalog:image:resize

Can I need everytime apply this command? or Is any some server configuration missing?


texts: Enterprise Gift registry is using default wishlist template (view.phtml) instead of gift registry template

texts:
I'm using Magento Enterprise Gift Registry.
It is a comprehensive Enterprise core module and comes with serveral own templates. Also a wishlist view. This template provides an option to add a product from the wishlist into the gift registry.
But Magento is always using the default wishlist view (frontend/base/default/template/wishlist/view.phtml) instead the one from enterprise gift registry.

I'm using my own theme in the enterprise package. System->Configuration->Design shows me "Enterprise" is set as package - so this supposed to be okay. Furthermore Gift registry is enabled.

Does anyone know what is causing the issue?

Thank you so much!


texts: how to remove item from cart after 10 Minutes using cron job

texts:
i have tried to delete item from cart after 10 Minutes but it does't work
`

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')->addAttributeToSelect('*')->addAttributeToFilter('in_cart',1 )->load();

                        foreach($productCollection as $product){
                              $quote = $objectManager->create('Magento\Checkout\Model\Cart')->getQuote();
                              $item = $quote->getItemByProduct($product);
                              //did't get any item in $item

                        }`


texts:
After I installed a theme in Magento 2 I have logged in to the admin panel that is showing this error:

There has been an error processing your request.  Exception printing is disabled by default for security reasons.
Error log record number: 1965137376".

How can I fix this error?


texts: Magento2, admin-panel Ui Component, xml is missing the target

texts:
Considering below code, what changes in xml is necessary to make the link recognize the 'target' => '_blank'?

xml file:

 <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
        <actionsColumn name="login_as_customer" class="vendor\Module\Ui\Component\Listing\Column\Actions">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">Login</item>
                    <item name="indexField" xsi:type="string">entity_id</item>
                </item>
            </argument>
        </actionsColumn>
    </columns>

Actions.php

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $hidden = !$this->_authorization->isAllowed('vendor_Module::login_button');
            foreach ($dataSource['data']['items'] as &$item) {
                $item[$this->getData('name')]['edit'] = [
                    'href' => $this->urlBuilder->getUrl(
                        'loginascustomer/login/login',
                        ['customer_id' => $item['entity_id']]
                    ),
                    'label' => __('Login As Customer'),
                    'hidden' => $hidden,
                    'target' => '_blank',
                ];
            }
        }

        return $dataSource;
    }


texts: can not install any extension from magento connect

texts:
I installed magento 1.9 and used a extension called Inchoo_PHP7

but not i cant installed any extension from magento connect, it gives me a error saying that the extension doesnt support my php version.


texts: Website breaks after adding external font to default_head_blocks.xml

texts:
I created a custom theme that inherits from another theme that in turn inherits from Magento Luma theme.

I added the the file default_head_blocks.xml to my theme:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
        <link src="//fonts.googleapis.com/css?family=Shadows+Into+Light" src_type="url" rel="stylesheet" type="text/css"/>
        <css src="owl.carousel/assets/owl.carousel.css" />
        <css src="fancybox/css/jquery.fancybox.css" />
        <css src="icon-fonts/css/porto-icons-codes.css" />
        <css src="icon-fonts/css/animation.css" />
        <script src="jquery.js" />
        <script src="fancybox/js/jquery.fancybox.js" />
    </head>
</page>

After that everthing was still working. But when I add the follwoing line to the file then the site breaks which means empty page in Firefox. Chrome says 500.

<link src="//fonts.googleapis.com/css?family=Exo+2" src_type="url" rel="stylesheet" type="text/css"/>

After adding the line to the file. I execute

magento cache:clean
magento setup:di:compile

There are neither errors in the browser console nor in the server logs.

Why is the site breaking when I add this line?


texts: How to dispaly data in table for form field in Admin edit form?

texts:
In my custom module I am saving data from front and it will display in the admin something like inquiry.

In admin side edit form I have to display some products data in table.

For example customer fill Name, Email, Message and multiple products Id.

so in Admin when we edit record from grid it will be like

Name: Test
Email : test@gmail.com
Message: Message
Product Data :

Product ID	Product Name

1	Product 1

2	Product 2


texts:
I have a Magento 2 based website on an AWS EC2 and a AWS RDS . I would like to setup AWS ElastiCache Redis however the only information I found is for Magento 1 and written back in 2014 that says I would end the app/etc/local.xml file

So my question is how would I write the needed code to go into the app/etc/env.php file which is I believe where I would need to edit. I believe I need to edit the section of the file that reads

'session' =>
    array (
           'save' => 'files',
    ),

However I am not sure what to replace that with.

thanks


texts: How to handle Global style sheet for my custom theme?

texts:
I have created custom theme then creating _extend.less file under

app\design\frontend\My_vendor\mytheme\web\css\source_extend.less

and did some customization.
Where can I declare global style sheet (Common Components) like primary color, secondary color, primary button color, h1 tag,  tag, for all the repeated design for whole pages.


texts: Magento 2 add column to attributes set admin grid

texts: At present, my Attribute set grid only has a column Set. I want to override 'Attribute set' code to add column id into its grid. Where I can find the grid code and How I can change it for suitable?


texts: Magento 2: How can I change the frontend mobile menu position and transition

texts: The mobile menu does a transition from the left side of the screen and shows a small part of the background in the right, how can I change the transition to start from the right and leave the background on the left side?


texts: How to get the toDate of a catalog rule programatically?

texts:
$discounted_price = Mage::getResourceModel('catalogrule/rule')->getRulePrice(
    Mage::app()->getLocale()->storeTimeStamp($store_id),
    Mage::app()->getStore($store_id)->getWebsiteId(),
    Mage::getSingleton('customer/session')->getCustomerGroupId(),
    $_product->getId()
);

I used this to get the catalog rule price for a product. Now i want to get the toDate of the catalog rule applied to a product how can i achieve it? And also as a developer is there a documentation which i can refer to find functions like these?


texts: Magento2: Invalid configuration file: config.php

texts:
I see issue during update cron:

Ran jobs by schedule.
Invalid configuration file: '/home/domains/domain.com/public_html/app/etc/config.php'
Ran jobs by schedule.

In this file I see module status. Anyone have any solution how to solve?


texts:
I am trying to create a simple module based on this answer https://magento.stackexchange.com/a/125519/45358

I just need a function to check if customer is logged or not in a custom theme header.phtml. I am new to Magento 2 and I can't understand how this works. I tried by following some tutorials but I am getting a lot of errors, like class not found and many more. I just need a complete example and then I will understand how actually work.

Here all files in my module

app/code/George/Core

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
  \Magento\Framework\Component\ComponentRegistrar::MODULE,
  'George_Core',
  __DIR__
 );

Block/Userlogin/Login

<?php
namespace George\Core\Block\Userlogin;

class Login extends Magento\Framework\View\Element\Template
{
    public function isCustomerLoggedIn()
{
   return $this->_session->isLoggedIn();
  }

}

Model/Index/Index.php

<?php
namespace George\Core\Model\Index;

class Index extends \Magento\Framework\App\Action\Action
{
   protected $_session;

public function __construct(
\Magento\Customer\Model\Session $session,

) {
$this->_session = $session;
  }

}

etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="George_Core" setup_version="0.0.1"/>
</config>

Also I found that need to add somewhere a preference, I understand that preference should be inside /etc/di.xml but how the actual di.xml file should look?

 <preference for="Block\That\Renders\The\Template"
        type="Vendor\Module\Block\Your\Custom\Block" />

Also in my case I can't understand which is Block\That\Renders\The\Template and Vendor\Module\Block\Your\Custom\Block

Now how can I call this inside custom theme header.phtml template, because if I try that, website stops loading.

if ($block->isCustomerLoggedIn()) {
// Customer is logged in
} else {
// Customer is not logged in
}

If someone can provide me a simple complete example will be very helpful.


texts: How to exclude Brand Category Path from Product URL but keep Brand Name included?

texts:
I want to get rid of the "Brands" and "Brand Name" in the following Product URL:

http://example.com/brands/brand-name/Ladies-jeans-5464.html

But I need the Product URL to include the "Brand Name" and always look like this (regardless of the path that is used to get to the Product Page):

http://example.com/brand-name-Ladies-jeans-5464.html

Is this possible?


texts: How can i get card info along customer data? Magento2

texts:
I get informational cards, but I need to show it to the customer, for example, to show a specific product, name, price, and the customer which bought this product.
Getting cart info

class Index extends \Magento\Framework\View\Element\Template
  {

     public function __construct(

    \Magento\Backend\Block\Template\Context $context,

    \Magento\Checkout\Model\Cart $cart,

    array $data = []

   )

   {

    $this->cart = $cart;

    parent::__construct($context, $data);

   }

   public function getCartInfo()
   {

    return $this->cart->getQuote()->getItemsCollection();

   }

 }

Can somebody help?


texts:
I have setup where i sell mp3 products with 3 options.

A) Download only (Type: downloadable product - no shipping)
B) Physical product CD only (Type: simple product - shipping)
C) Download + CD (Type: ? - shipping)

What is important here is that option B and C needs to have shipping enabled but not A, bacause i need shipping for external webservice (labels + automatically import tracking number etc.).

So far i have tried a bundled product with 3 associated products (1 downloadable, 1 simple and 1 ?). This works fine for option A and B but not C.

I am unsure if this is the right approach. I am also considering adding option C as simple product and then somehow include downloadlink in mail and customer account for only one simple product.

What is right approach for this setup? Any suggestions would be much appreciated.


texts:
I exported the logo into an svg file, using Illustrator and Photoshop. The logo displays on Firefox and Safari but not on Chrome and Opera. Any idea why?

Am I suppose to export it w some sort of settings?


texts:
Although I am familiar with Magento1, I am relatively new to Magento2. I need add functionality where a customer buy X product and get different Y product as free. I am overriding the Buy X and get Y free action. I am not able to achieve it. I would appreciate  if anyone provide inputs on where to started for this issue.

Below is the code which is not working-

  module-sales-rule/Model/Rule/Action/Discount/BuyXGetY.php

 public function calculate($rule, $item, $qty)
    {
<snip>
    if($rule->getSimpleAction()=='buy_x_get_y' && ($item->getSku())=='24-UG06'){
                $cart->addProduct('24-UG07','1')->save();
<snip>
            }

I am aware that it is not the best practice to edit core files. I am just playing around the code.


texts: magento2: How to get address' region while checkout selecting address

texts:
use Magento\Quote\Model\Quote\Address\RateRequest;
    $destCountryId = $request->getDestCountryId();
    $destState = $request->getDestRegionCode();
    $destCity = $request->getDestCity();

use this code I can get the address in my custom shipping method.
but if people select address no entered into input,sometime I can't get RegionCode,getDestRegionCode() return null.
After observation, I found if State/Province is entered into input not select from Magento after checkout the address will be saved.Next time to select this address in Shipping Address page, getDestRegionCode() return null.
What's wrong with my code? How to get State/Province reliably?

In this way getDestRegionCode() return null not 'zhejiang '

In this way entered zhejiagn getDestRegionCode() can get right value 'zhejiang'


texts:
I have a Magento Cloud server. In which I need to disable a Module. From my local environment, I have changed the app/etc/config.php "My_Module" => 0.

And committed the changes. But my changes not moved to the cloud server.

Can anyone help me with this?


texts: Is there any way that one swatch is selected by default (magento configurable swatches)

texts:
I am trying use Magento Configurable swatches in my website (for colors).

But I am facing some issues,

in Product details page, we have to select one color swatch.
In Product Listing Page, we are not able to add product to the cart (due to no color swatch is selected by default)
Is there any way that we can define independent prices for all color options? (currently the price of individual option is being
added to the price of configurable/main product).


texts: How to use the vault in custom payment module.

texts:
I am working on custom payment module with Authorize technique using XML API based.

I need to use Magento out of box vault module to save customer card details.
Any one have knowledge on this How Can I use this vault to save card.?

Thanks.


texts: How to create a button in Magento 2 configuration section?

texts:
How can I add a button in Magento 2 backend configuration section and call a simple PHP method when clicked the button?

This method call can be an AJAX call.


texts: Bulk update products to include new websites

texts:
A client has 20000+ products with 7 websites. They used to have 4 websites and most products are associated to 4 websites. What is the best & quickest way to iterate through the products and update the products to include the new websites.

I have the following code however it is far too slow:

$productCollection = Mage::getModel('catalog/product')->getCollection()
    ->addFieldToFilter('sku', array('like' => '02%'));
foreach ($productCollection as $product) {
    echo $product->getSku();
    $product->setWebsiteIds(array(1,2,3,4,5,6,7));
    try {
        $product->save();
        echo " - saved.";
    } catch (Exception $e) {
        echo ' - '.$e->getMessage();
    }
    echo "\n";
}

I were thinking of using the iterator walk method however I understand that the store/website isn't exactly an attribute so it can't be easily updated on its own.


texts:
Due to a migration, some products have a wrong (not existing) attribute group.

Is there a simple way to change this with a SQL query?

If yes, where can I see wich attribute-group is wich...


texts: Multi-multistore (Multiple brands, multiple languages): setting store view code & Add Store Code to Urls

texts:
we have several brands in 1 Magento install. Each with different language sites.

Our situation

Brand A, Brand B, brand C are set on Store Name level...
Languages are set on Store View level
All brands have more than 1 language: nl, de and en (set in Store View Code)
Brand A and B use the Add Store Code to Urls setting to add /en /de etc..
Brand C has unique root domains per country

I have two questions that we don't know how to handle. Help appreciated.

I noticed that I cannot set the Store View Code to EN for Brand B when there is already a Store View Code for Brand A; but both have EN as a language. I can imagine more Magento installs have this situation. How is this generally solved?
The setting Add Store Code to Urls is a global setting. Brand C uses a unique domain per language, whilst brand B uses the /en /de method. If I set Add Store Code to Urls to YES then it will add the store code also to the brand website that uses unique domain. Can these two methods co-exist?

Been Googling for a while now. Could not find a fitting answer.

Thanks in advance

Images of these settings


texts: Cache problem - prevent my module block to be cached

texts:
I have a module which includes block to each page. The block template prints javascript which displays notification to user.

First I defined observer in module config file:

 <frontend>
    <events>
        <controller_action_layout_load_before>
            <observers>
                <mymodule_add_block_at_end_of_main_content>
                    <type>singleton</type>
                    <class>mymodule/observer</class>
                    <method>addBlockAtEndOfMainContent</method>
                </mymodule_add_block_at_end_of_main_content>
            </observers>
        </controller_action_layout_load_before>
    </events>
 </frontend>

Then model

class Company_Mymodule_Model_Observer
{
    public function addBlockAtEndOfMainContent(Varien_Event_Observer $observer)
    {
        $layout = $observer->getEvent()->getLayout()->getUpdate();
        $layout->addHandle('add_my_block');
        return $this;
    }
}

And layout file

<layout>
    <add_my_block>
      <reference name="content">
          <block type="mymodule/mymodule" name="myblockname" after="-" template="mymodule/notification.phtml"/>
      </reference>
    </add_my_block>
</layout>

When user closes notification, cookie is stored. Inside mymodule.php I check with php if cookie exists. If exists, the notification with that cookie is not showed again.

$collection->addFieldToFilter('cookie_id',array('nin' => $deniedIds))

THE PROBLEM:

This module is installed on many stores and some of them have cache modules, such as Varnish cache and others. Some of cache modules cache my module block and therefore notification is showed every time, no matter if user closed it. It doesn't come to addFieldToFilter because the entire block was already cached.

Does anybody have any idea how I can avoid this? Is any better way to include the block to each page and not being cached?

Thank you!


texts: All of functionality is running , but if this code is on console command execute(), is not working

texts:
I am looking for magento 2 developer.
I need to build a extension that clear the cart every day by cron job.
So I made the extension for this work. all of the functionality is OK on testing mode

I made testing controller to clear cart. this is ok.
Also cron module is OK
command testing module is OK

But just when clearing cart function execute on cron or command, this function is not working.
   public function execute()
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cart = $objectManager->get('\Magento\Checkout\Model\Cart');
        $allItems = $cart->getQuote()->getAllVisibleItems();
        foreach ($allItems as $item) {
            $itemId = $item->getItemId();
            $cart->removeItem($itemId)->save();
        }
}

this code is for controller. this functionality is running
protected function execute(
        InputInterface $input,
        OutputInterface $output
    ) {
        $output->writeln("Clear cart from cmd: start");

    }

this code is for command. printed "Clear cart from cmd: start" message
But when execute below code, this function is not running
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cart = $objectManager->get('\Magento\Checkout\Model\Cart');
        $allItems = $cart->getQuote()->getAllVisibleItems();
        foreach ($allItems as $item) {
            $itemId = $item->getItemId();
            $cart->removeItem($itemId)->save();
        }

like
    protected function execute(
        InputInterface $input,
        OutputInterface $output
    ) {
        $this->_appState->setAreaCode('frontend');
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $cart = $objectManager->get('\Magento\Checkout\Model\Cart');
        $allItems = $cart->getQuote()->getAllVisibleItems();
        foreach ($allItems as $item) {
            $itemId = $item->getItemId();
            $cart->removeItem($itemId)->save();
            $output->writeln("Clear cart from cmd: start2");
        }
    }

How can I run this function?


texts: Move title between sort by and number of items

texts:
I need my title of the category page to be placed between the number of items and the sort by option. What should I do?

Which container has to be moved to which destination?


texts: How to create a Shopping Cart Price rule for free shipping for all items, with some exclusions?

texts:
I have a clean build of CE 1.9.1.1 and have loaded the sample data provided by Magento. I want to set up a Shopping Cart Price Rule for free shipping on all items except 2 SKUs (one simple SKU and it's parent configurable SKU).

I've created a rule with no conditions (to apply to all products), and in the Actions tab have set the Free Shipping to 'Matching Products only.'

Within the 'Apply the rule only to cart items matching the following conditions' section, I have

If ALL  of these conditions are TRUE :
   SKU  is not one of  wbk000c-Pink-L, wbk002c

But after adding wbk000c-Pink-L to my cart, it is getting free shipping applied.

How do I create a Shopping Cart Price rule for free shipping for all items, but with some exclusions?


texts: Magento 2: Run a uninstall script when module is uninstalled via command line?

texts:
I am creating a module and I am progressing it. I am new to Magento 2 so there are a lot of things that I am not yet familiar too. As a module creator, I am curious how to run an uninstall script when someone uninstalled your module via command line.

I know I can execute the module uninstall command like this:

php bin/magento module:uninstall -r Vendor_Module


texts: I have create a form which can upload a image and it saved in to db. in admin side i have a grid to display the table. and it have view action it show all details from db. it only show the image url how to display the image.


texts: Remove everything that's under page-wrapper

texts:
I need to remove everything that's under page-wrapper but keep any text that's added through Admin panel.

Is that possible and how can I do it?


texts: Difference between magento-cloud variable:list and vendor/bin/ece-tools env:config:show

texts: I'm having issues setting the CRYPT_KEY environment variable in production mode. I can see CRYPT_KEY and env:CRYPT_KEY using the magento-cloud variable:list command, but it isn't recognized when I run docker commands. Inside bin/magento-docker bash, if I run vendor/bin/ece-tools env:config:show, I see the admin email and password that are used to login to the docker container. It looks like ece-tools inside magento-docker bash show the environment variables that are used, and the environment variables from magento-cloud variables:list aren't copied to docker. Would someone be able to explain the difference between these two commands, and how to set CRYPT_KEY inside magento-docker?


texts: Grouped product with fixed amount of single products

texts:
We have single products in our magento.

Black Product, White Product and Grey Product.

We need to create a "grouped product" composed by 9 (or 16, or 32, but a fixed number) of this simple products.

The user have to select the number of simple ones: i.e:

x Black, y White, z Grey

The problem we have is that x+y+z = 9. (not more, not less)

Did someone knows some way to do it. (module, or whatever is needed)


texts:
I Don't know the exact reason, why fedex shipping method not appearing on front end after filling

"Account ID", "Meter Number", "Key" & "Password".

Though i set these field to yes

1. Enabled for Checkout = Yes

2. Sandbox Mode = Yes

How to solve this issue ? What the exact problem in this ?
Thanks in advance.


texts: Get product on cart page using attribute

texts:
I want to display a specific product on cart page using attribute . on cart page phtml file i am implementing php code but its not been working . any help appreciated.

based on comment

<?php $_item = $this->getItem()?> <?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
<?php echo $_product->getResource()->getAttribute('cartvalue')->getFrontend()->getValue($_product); ?>


texts: Magento 2 Outdated JS Libraries - Failed. Outdated AngularJS library found Issue

texts:
We are using magento ver 2.2.4 and after run magento security scan tool, In generated report we found following error:-

  Outdated JS Libraries - Failed.Outdated AngularJS library found,
  response body contains unexpected Security Update 'AngularJS
  v1.2.17-build.178+sha.2406084'

We have to apply the Magento 2.2.7/2.1.16 Security Update for solve above issue but my question is if we look into above security update (https://magento.com/security/patches/magento-2.2.7-and-2.1.16-security-update) then there are PRODSECBUG-2074 patch mentioned but i couldn't found this patch in magento resource download.

Anybody know how to apply PRODSECBUG-2074 patch in magento store? Thanks


texts: Magento 2 unique constraint violation found when submit order

texts:
I am facing an issue of unique constraint violation found while submit order from magento backend. This issue only comes if my previous order was failed due to some technical reason and I am trying to re-submit that order again by filling details again on that order create screen.
I am using credit card payment method. I have tried below solution:
https://community.magento.com/t5/Magento-2-x-Technical-Issues/Magento-2-unique-constraint-violation-found-when-generating/m-p/450745#M14359
but it won't work. Can anyone help me out as soon as possible? as website is live and I am facing this critical issue. Below is screenshot for your reference:


texts: How to group numeric attribute ranges similar to prices in layered navigation?

texts:
I have a numeric attribute that is a size (in cm). I would like to group products into ranges of the attribute similar to how prices are grouped.

So if I have several products with sizes 151cm, 152 cm, 153cm it should group them into a "150cm - 155cm" option in layered navigation.

What is the best way to go about doing this?


texts: How to get Custom Attributes in Carts Item REST API?

texts:
End Point: /rest/V1/carts/mine/

Added Custom Attribute Name: Unit

Type: Dropdown

Response:

{
  "id": 10,
  "created_at": "2019-10-19 10:23:20",
  "updated_at": "2019-11-01 09:27:51",
  "is_active": true,
  "is_virtual": false,
  "items": [
    {
      "item_id": 9,
      "sku": "Test",
      "qty": 1,
      "name": "Test",
      "price": 100,
      "product_type": "simple",
      "quote_id": "10",
      "extension_attributes": {
        "item_weight": 500
      }
    }
  ],
  "items_count": 1,
  "items_qty": 1,
  "customer": {
    "id": 5,
    "group_id": 1,
    "created_at": "2019-10-19 10:23:18",
    "updated_at": "2019-11-01 12:51:21",
    "created_in": "Default Store View",
    "email": "test@testmail.com",
    "firstname": "elan",
    "lastname": "m",
    "store_id": 1,
    "website_id": 1,
    "addresses": [
      {
        "id": 3,
        "customer_id": 5,
        "region": {
          "region_code": "TN",
          "region": "Tamil Nadu",
          "region_id": 563
        },
        "region_id": 563,
        "country_id": "IN",
        "street": [
          "chrnnai"
        ],
        "telephone": "8678944602",
        "postcode": "600096",
        "city": "chennai",
        "firstname": "elan",
        "lastname": "m"
      }
    ],
    "disable_auto_group_change": 0,
    "extension_attributes": {
      "is_subscribed": false
    }
  },
  "billing_address": {
    "id": 499,
    "region": null,
    "region_id": null,
    "region_code": null,
    "country_id": null,
    "street": [
      ""
    ],
    "telephone": null,
    "postcode": null,
    "city": null,
    "firstname": null,
    "lastname": null,
    "customer_id": 5,
    "email": "test@testmail.com",
    "same_as_billing": 0,
    "save_in_address_book": 0
  },
  "orig_order_id": 0,
  "currency": {
    "global_currency_code": "INR",
    "base_currency_code": "INR",
    "store_currency_code": "INR",
    "quote_currency_code": "INR",
    "store_to_base_rate": 0,
    "store_to_quote_rate": 0,
    "base_to_global_rate": 1,
    "base_to_quote_rate": 1
  },
  "customer_is_guest": false,
  "customer_note_notify": true,
  "customer_tax_class_id": 3,
  "store_id": 1,
  "extension_attributes": {
    "shipping_assignments": [
      {
        "shipping": {
          "address": {
            "id": 297,
            "region": null,
            "region_id": null,
            "region_code": null,
            "country_id": null,
            "street": [
              ""
            ],
            "telephone": null,
            "postcode": null,
            "city": null,
            "firstname": null,
            "lastname": null,
            "customer_id": 5,
            "email": "test@testmail.com",
            "same_as_billing": 0,
            "save_in_address_book": 0
          },
          "method": null
        },
        "items": [
          {
            "item_id": 9,
            "sku": "Test",
            "qty": 1,
            "name": "Test",
            "price": 100,
            "product_type": "simple",
            "quote_id": "10",
            "extension_attributes": {
              "item_weight": 500
            }
          }
        ]
      }
    ]
  }
}

I need an Custom Attribute in each item.


texts: magento 2 : Give id to "column main" div in product listing page

texts:
For the product listing page I want to give id to to "column main" class div like shown in following picture.

So to do so in in my custom theme catalog_category_view.xml

I've given code like following

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

        <referenceContainer name="columns" htmlClass="columns container">
            <container name="main" label="Main Content Container" htmlTag="div" htmlClass="column main" htmlId="hello" />
        </referenceContainer>
    </body>
</page>

But that makes whole div empty without setting up id in it, Can anyone tell what mistake I'm making?? Or please explain me what process I should follow to do so ...


texts: Magento 2 Upgrade 404 Error (document root set to PUB folder)

texts:
As I'm sure you are aware, there is a new version of Magento 2 (2.0.3 at the time of writing).

I can not follow the update instructions given in the Magento developer docs (using the System Upgrade utility) as my document root points to the pub folder, not the main Magento installation folder. The setup wizard is not in the pub directory for security reasons and the best practice is to use the pub folder as the document root.

The only way I can think of using the setup wizard to upgrade the system is to change the doc root to the main Magento installation folder, upgrade the system, change the doc root back to the pub folder.

Does anyone know of any other work around or a way to upgrade with the setup wizard? I installed Magento via the command line using the compressed package (decompressed and installed via the command line tool)


texts:
There is Translation Strategy option with two values

Dictionary (Translation on Storefront side)
Embedded (Translation on    Admin side)

Path: Stores -> Configuration -> Advanced -> Developer -> JavaScript Setting -> Translation Strategy

What's the pros and cons of these two strategies?


texts:
I am trying to send mail from any option. magento doesn't send any single mail.
Its return following error

exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/XXXXXX/public_html/lib/Zend/Mail/Transport/Sendmail.php:143
Stack trace:
#0 /home/XXXXXX/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/XXXXXX/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/XXXXXX/public_html/app/code/core/Mage/Core/Model/Email/Template.php(452): Zend_Mail->send()
#3 /home/XXXXXX/public_html/app/code/core/Mage/Core/Model/Email/Template.php(509): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#4 /home/XXXXXX/public_html/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('customer_passwo...', 'support', Array, Array, Array, '1')
#5 /home/XXXXXX/public_html/app/code/core/Mage/Customer/Model/Customer.php(719): Mage_Core_Model_Email_Template_Mailer->send()
#6 /home/XXXXXX/public_html/app/code/core/Mage/Customer/Model/Customer.php(736): Mage_Customer_Model_Customer->_sendEmailTemplate('customer/passwo...', 'customer/passwo...', Array, '1')
#7 /home/XXXXXX/public_html/app/code/core/Mage/Customer/controllers/AccountController.php(763): Mage_Customer_Model_Customer->sendPasswordResetConfirmationEmail()
#8 /home/XXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Customer_AccountController->forgotPasswordPostAction()
#9 /home/XXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('forgotpasswordp...')
#10 /home/XXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/XXXXXX/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/XXXXXX/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/XXXXXX/public_html/index.php(83): Mage::run('', 'store')
#14 {main}

I tried following code for checking mail enable or not.

<?php
$to = "you.mail@domain.com";
$subject = "Test email";
$message = "This is a test email.";
$from = "you.mailid@domain.com";
$headers = "From:" . $from;
if (mail($to, $subject, $message, $headers)) {
    echo("Your message has been sent successfully");
} else {
    echo("Sorry, your message could not be sent");
}
?>

Always return else part. also set cron job.

Also tried following code

<?php
if(function_exists('mail')) {
    echo 'mail() is enabled';
} else {
    echo 'mail() is not enabled';
}
?>

Return mail() is enable.

I am using magento 1.9.3.8.

magento 1.9.2.2 not sending any emails

Magento unable to send eMail, exeption error

Also tried to follow above links but not working in this case.


texts:
On my local test system, 1.9.1 performed ok in the ab benchmark:

Requests per second:    2.42 [#/sec] (mean)
Time per request:       2065.882 [ms] (mean)
Time per request:       413.176 [ms] (mean, across all concurrent requests)
Transfer rate:          60.29 [Kbytes/sec] received

After upgrading to 1.9.2, results are significantly worse:

Requests per second:    1.33 [#/sec] (mean)
Time per request:       3769.256 [ms] (mean)
Time per request:       753.851 [ms] (mean, across all concurrent requests)
Transfer rate:          33.14 [Kbytes/sec] received

No errors are reported in the log. Is this normal? 1.9.2 update were supposed to improve the performance.

Or is performance benefit visible only when cache is enabled? (I have it disabled on a test system)


texts: Grouped Product: Price and product list not showing on template

texts: I've created a new grouped product and I've added 3 already created simple product in the associated product section.  I saved everything and go and view it on the website itself and there is no price next to the add cart button nor the included product list? Does anyone know of a fix for this.


texts: How to override JS with Module in Magento 2.2

texts:
I've seen a couple of questions about this and ending coming up with a module properly installed with a /Custom/AgreementPage/view/frontend/web/js/view/checkout-agreements.js with just a console log addind to the original file and this as requiredjs-config

Custom/AgreementPage/view/frontend/requirejs-config.js

What's wrong in this?
Thanks

    map: {
        '*': {
            'Magento_CheckoutAgreements/js/view/checkout-agreements.js':'Custom_AgreementPage/js/view/checkout-agreements.js'
        }
    }
};


texts: Backorder products displaying Out of Stock label

texts:
My employer has a range of products that we make to order. As such, we don't keep any on hand so our inventory on the Magento 2 backend is always set to 0.
I have lowered the out of stock threshold so that these products can be backordered.
However, we are still facing the issue of the products displaying as 'Out of Stock' on the frontend.
I don't want to write out this feature entirely from our website's code, because we have a large catalog and some products do actually need to display as out of stock.
Is there any way I can hone in on these products or their category so I can exempt them from the 'Out of Stock' label?
Thanks in advance.


texts: Address custom attribute needs to move to correct export object

texts:
I have a custom address attribute jd_edwards_id added to both the billing and shipping address tabs. The values may be the same number or they might be different. The client uses these numbers in their billing systems.

I have an export and I need to have those values included in the export but the values never make it to the appropriate billing and shipping address objects.

                        <xsl:value-of select="$sepstart" /><xsl:value-of select="../../billing/jd_edwards_id"/><xsl:value-of select="$sepend" />
                    <xsl:value-of select="$sepstart" /><xsl:value-of select="../../shipping/jd_edwards_id"/><xsl:value-of select="$sepend" />

I have some code that processes the JDE IDs where i am using a fieldset to set those fields

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
    <fieldset id="customer_address">
        <field name="jd_edwards_id">
            <aspect name="to_billing_address" />
        </field>
    </fieldset>
    <fieldset id="sales_convert_quote_address">
        <field name="jd_edwards_id">
            <aspect name="to_order_address" />
        </field>
    </fieldset>
    <fieldset id="order_address">
        <field name="jd_edwards_id">
            <aspect name="to_shipping_address" />
        </field>
    </fieldset>
</scope>

How do i address the data to his the correct properties in the billing and shipping objects? I can provide other info if needed.

Thanks,

Bastien


texts: Product price won't update on product page front end. Cache stuck

texts:
I have a product that has a sale price of 199.99 and an original price of 240.
In my index table I can see that the price has been indexed: (catalog_product_index_price):
'123', 'cust_grp', 'website_id', 'tax_class', '240.000000', '199.990000', '199.990000', '199.990000', NULL
'123', 'cust_grp', 'website_id', 'tax_class', '240.000000', '199.990000', '199.990000', '199.990000', NULL
'123', 'cust_grp', 'website_id', 'tax_class', '240.000000', '199.990000', '199.990000', '199.990000', NULL
.......
.......

This goes on for all stores, customer groups and tax combos. The indexed data is correct.
The product page shows the 240.00 price and when you add the product to the cart it shows a price of 199.00. I have flushed everything but FPC.
** Flushing FPC is not an option in our workflow since we rely on varnish with our traffic level.
I have banned the URL from varnish on all varnish nodes as usual with:
sudo varnishadm ban req.url '~' '<my product url>'

I have saved the product, I have checked the indexes, I have flushed the magento caches (minus FPC), I have flushed the URL for the specific URL in varnish and witnessed the uncached page load the same incorrect price over and over again.

How can I flush the Product Display Page without flushing FPC?


texts: Magento 2: I want to clone the Media folder as well while cloning the Magento 2 GIT repository

texts: How can I clone the Media folder while cloning the Magento 2 GIT repository?


texts: Add Video button not working on product page

texts:
I'm having issues with the add video button on the product pages in Magento 2.2.1.  The button doesn't open the modal window even though I have added my Youtube api key and its enabled.  I've done some digging and their arent any js errors.  In fact, I can see all of the js scripts, for adding a video, load when I click on the "Images and Videos" fieldset wrapper.  However, the required modal code isn't being injected into the page, so the onclick cant finds the modal in order to open it.

I'm at a loss on what could be preventing the modal code injection since I'm not seeing any errors.

EDIT:
I've done a bit more digging and can varify that my youtube api key is working correctly.  I found this in get-video-information.js

googleapisUrl = 'https://www.googleapis.com/youtube/v3/videos?id=' +
                    id + '&part=snippet,contentDetails,statistics,status&key=' +
                    this.options.youtubeKey + '&alt=json&callback=?';\

I hardcoded a video ID and my api key (copied directly out of the db) and used chrome to submit the request.  I got a valid json response back with all of the video information.  So, I suppose that proves my api key is working correctly.


texts: Bannerslider not compatible with Magento 2.1?

texts:
I did multiple times try to install the extension Bannerslider "https://github.com/Magestore/Bannerslider-Magento2", but I always get errors when it's done. My Store won't load anymore. I did install it once via composer and once with file transfer and always followed all the install instructions.

Did anyone get the banner slider to work with magento 2.1? Or do you know any good alternatives?

Thanks a lot!

Error I get after enabling the extension:

Please upgrade your database: Run "bin/magento setup: upgrade" from the Magento root directory.
The following modules are outdated:
Magestore_Bannerslider schema: current version - 1.7.1, required version - 1.7.0

After I run bin/magento setup:upgrade:

  Uncaught exception 'RuntimeException' with message 'Can't create
  directory
  /home/user/public_html/store.com/var/generation/Magento/Framework/App/ResourceConnection/.'
  in
  /home/user/public_html/store.com/vendor/magento/framework/Code/Generator.php:115
  Stack trace: #0
  /home/user/public_html/store.com/vendor/magento/framework/Code/Generator/Autoloader.php(35):
  Magento\Framework\Code\Generator->generateClass('Magento\Framewo...')

  [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...')

  [internal function]: spl_autoload_call('Magento\Framewo...') #3 /home/user/public_html/store.com/vendor/magento/framework/Code/Reader/ClassReader.php(19):

  ReflectionClass->__construct('Magento\Framewo...') #4
  /home/user/public_html/store.com/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44):

  Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...')

  /home/user/public_html/store.com/vendor/mage in /home/user/public_html/store.com/vendor/magento/framework/Code/Generator.php
  on line 115


texts: Images from custom theme are not in sources list on live website

texts:
SOLVED

I had a typo on file name. M2 only includes images if they are being used.

On my computer all images from mythemes/web/images folder are under

/pub/static/frontend/Training/default/images (right side of screenshot),

But when I visit the site and check sources (left side of screenshot) there aren't any images from my theme there.

Any idea why?


texts: Category page layout meta update - add og:image

texts:
Can I update layout at category page to add og:image tag?
I need to use special image as og:image, not category image nor thumbnail image.

Thanks


texts: Does anyone know of any way to add a section on the checkout page where a customer can leave a comment/instructions that can be tied to their order?


texts: Removal decimals from Quantity on Orders Page

texts: How do I remove the Decimals from the Quantity Column on the Orders Page? The products cannot be ordered in decimals, so the extra characters are pointless.


texts: Default magento cron.sh generating infinite number of processes

texts:
I am struggling with something really strange here. When I set up the Magento cron.sh, it spawns an infinite number of "ps" processes which bring down my server.

The content of the file is the default one:

#!/bin/sh
# location of the php binary
if [ ! "$1" = "" ] ; then
    CRONSCRIPT=$1
else
    CRONSCRIPT=cron.php
fi

MODE=""
if [ ! "$2" = "" ] ; then
        MODE=" $2"
fi

PHP_BIN=`which php`

# absolute path to magento installation
INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'`

#       prepend the intallation path if not given an absolute path
if [ "$INSTALLDIR" != "" -a "`expr index $CRONSCRIPT /`" != "1" ];then
    if ! ps auxwww | grep "$INSTALLDIR$CRONSCRIPT$MODE" | grep -v grep 1>/dev/null 2>/dev/null ; then
        $PHP_BIN $INSTALLDIR$CRONSCRIPT$MODE &
    fi
else
    if  ! ps auxwww | grep "$CRONSCRIPT$MODE" | grep -v grep | grep -v cron.sh 1>/dev/null 2>/dev/null ; then
        $PHP_BIN $CRONSCRIPT$MODE &
    fi
fi

Cron.php is also default, however for some reason cron.sh is flooding the server with the mentioned "ps" processes. Can someone please help?


texts: Two observer methods that occur on same event don't work

texts:
I have 2 functions in the same Observer class: setQuotationName and setShippingMethod. They are handled at this event: mynamespace_module_before_send_quotation

Here's the config.xml part concerning these methods:

<mynamespace_quotationcart_before_send_quotation>
    <observers>
       <mynamespace_quotationcustomize_before_send_quotation>
            <class>quotationcustomize/observer</class>
            <method>setQuotationName</method>           <!-- for quotation NAME -->
       </mynamespace_quotationcustomize_before_send_quotation>
    </observers>
</mynamespace_quotationcart_before_send_quotation>
<mynamespace_quotationcart_before_send_quotation>
   <observers>
      <mynamespace_quotationcustomize_before_send_quotation>
           <class>quotationcustomize/observer</class>
           <method>setShippingMethod</method>           <!-- for quotation SHIPPING method -->
      </mynamespace_quotationcustomize_before_send_quotation>
   </observers>
</mynamespace_quotationcart_before_send_quotation>

I also tried putting the 2 <class> and <method> parts in the same event node, like this:

<mynamespace_quotationcart_before_send_quotation>
        <observers>
           <mynamespace_quotationcustomize_before_send_quotation>
                <class>quotationcustomize/observer</class>
                <method>setQuotationName</method>           <!-- for quotation NAME -->
                <class>quotationcustomize/observer</class>
                <method>setShippingMethod</method>          <!-- for quotation SHIPPING method -->
           </mynamespace_quotationcustomize_before_send_quotation>
        </observers>
    </mynamespace_quotationcart_before_send_quotation>

... and also having declared the <class> just once and then the 2 <method>s, but none works flawlessly. Once either one of the methods works and the other doesn't OR one of them works and everything else is broken, etc.

So, how can I declare in the config.xml 2 observer methods that are handlen upon the same event occurrence?


texts: Redirect to homepage after submitting e-mail in Forgot password page?

texts: When customer submit his email in Forgot Password page he is redirected to the Login or Create an Account page. How could I redirect users to the Homepage or to the Onepage Checkout page?


texts:
I have tried to save the image in product page in Magento 1.10, but give me this type of error:
jquery this.images.toJson() not a function.

Please See this screenshot

Please help me find the solutions


texts: Is it possible to have two stores sharing one backend and the same inventory?

texts:
I have two stores targeting different markets selling the same products.  I want to charge different prices on each site (high end and then budget) but I want them to share the same inventory so I can do stock control.

Is that possible?

Thanks


texts: Adding a "Layout Update XML" textarea to a custom module?

texts:
I have a few custom modules (content sliders etc) that have their own config sections in System->Configuration. I'd like to be able to add custom layout updates that would apply to the pages these sliders are added to via the admin, instead of a local.xml file (or module xml) - the same way you can for cms pages and categories etc:

I see that the cms pages use the following (in app/code/core/Mage/Cms/Helper/Page.php):

    $action->loadLayoutUpdates();
    $layoutUpdate = ($page->getCustomLayoutUpdateXml() && $inRange)
        ? $page->getCustomLayoutUpdateXml() : $page->getLayoutUpdateXml();
    $action->getLayout()->getUpdate()->addUpdate($layoutUpdate);
    $action->generateLayoutXml()->generateLayoutBlocks();

...so I guess it would be something similar to that. Is it possible to do this for a custom module? And if so, any general pointers on how to accomplish it?


texts: cron_schedule table is not getting populate magento2

texts: I am not getting transaction mails. I think it's because of cron job,cron_schedule table is not getting populated


texts: Magento 1.9 sort collection by one of the fields value

texts:
Whetever I do it still gives me the same results.
Querying cms_block ids:

    $collection = Mage::getModel( 'cms/block' )
        ->getCollection()
    // can't add addAttributeToSelect(whatever name here or esterisk because it is casing ..error)
        ->addFieldToFilter( 'is_active', 1 )
        ->addFieldToFilter( 'is_slide', 1 )
    ;
    $collection->getSelect()
        ->order('position ASC');

Tried various sort methods but ... no luck.
Any ideas how to get cms/block ids sorted by position ?


texts: Magento Upgrade from 1.10.0.1 to 1.14.8 504 gateway timeout

texts:
We are upgrading Magento from 1.10.0.1 to 1.11.0.2 now.
We have the below environment.
1) PHP = 5.6.32
2) Mysql = Ver 15.1 Distrib 5.5.56-MariaDB
3) Ngnix = 1.12.2
4) centos = centos-release-7-4.1708.el7.centos.x86_64
We are using AWS environment where EC2 instance is used for application and RDS instance for database.

After I copy file for Magento 1.11.0.2. While upgrading database via web, I am getting 504 gateway timeout. When I checked DB I can see some of database scripts are executed. It suggest me that My database connection is getting lost. How to reslove this. I have already updated PHP max_execution_time to 300. and request_terminate_timeout to 300, but still having same problem.


texts: Is there a way to use item weight in a Shopping Cart Price Rule condition?

texts: I have a product that has two weights options, 1lbs and 2lbs. Is it possible to set a Shopping Cart Price Rule condition for only the 2lbs item?


texts: Need to add another product code in magento 2 other than Sku

texts: We use the Sku number for products but I need to add company ref# too other than the sku#, where and what is the best way to add this number which is not going to be visible to customer frontend. Thanks


texts: How to get order list of customer using graphql?

texts:
How to get order list of customer using graphql.

I have below code to get order list using graphql but can't get it.

schema.graphqls

type Query {
    salesOrder (
        customer_id: Int @doc(description: "Id of the Sales Order")
    ): SalesOrder @resolver(class: "<vendor>\\<Module>\\Model\\Resolver\\CustomerOrder") @doc(description: "The Sales Order query returns information about a Sales order")
}

type SalesOrder @doc(description: "Sales Order graphql gather Data of specific order information") {
    order_array: [String] @doc(description: "Array of order list.")
}

CustomerOrder.php

<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
declare(strict_types=1);

namespace <Vendor>\<Module>\Model\Resolver;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
/**
 * Description of CustomerOrder
 *
 * @author dharmendra
 */
class CustomerOrder implements ResolverInterface
{
    public function __construct(
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory
    ) {
        $this->orderCollectionFactory = $orderCollectionFactory;
    }

    /**
     * @inheritdoc
     */
    public function resolve(
        Field $field,
        $context,
        ResolveInfo $info,
        array $value = null,
        array $args = null
    ) {
        $salesData = $this->getSalesData($args['customer_id']);
        return $salesData;
    }

    /**
     * @param int $orderId
     * @return array
     * @throws GraphQlNoSuchEntityException
     */
    public function getSalesData(int $customerId): array
    {
        try {
            $orders = $this->orderCollectionFactory->create();
            $orders->addFieldToSelect('*');
            $orders->addFieldToFilter('customer_id',$customerId);
            $orders->setOrder('created_at','desc');

            $orderCollection = [];
            foreach($orders as $order) {
                $orderCollection[] = [
                    'increment_id' => $order->getIncrementId(),
                    'grand_total' => $order->getGrandTotal(),
                    'customer_id' => $order->getCustomerId(),
                ];
            }
            $orderData['order_array'] = $orderCollection;
        } catch (NoSuchEntityException $e) {
            throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);
        }
        return $orderData;
    }
}

I have getting single order details perfect using graphql. But I want to get list of all order placed by customer using graphql.


texts: hreflang multi language with backend URL?

texts:
I am adding hreflang-tags to a multi-language Magento store.
I found the code below on here and used it in the page header.
It does what it's supposed to, but I'm looking for another solution.

<?php
$website = Mage::app()->getWebsite()->getStores();
foreach ( $website as $store) {
$lang = $store->getConfig('general/locale/code');
    if (strtolower($lang) == 'en_us'){
        $lang = 'en-us'; // en-us or other
        }
    if (strtolower($lang) == 'nl_nl'){
        $lang = 'nl-nl'; // nl-nl or other
        }
    echo '<link rel="alternate" href="' . $store->getCurrentUrl() . '" hreflang="' . $lang . '"/>' . "\n";
}
?>

This returns a tag like:

<link rel="alternate" href="https://example.com/category?___store=english&amp;___from_store=english" hreflang="en-us"/>

But I would rather have a code that returns a tag with the actual URL as specified in the backend.

For example:

A product named "shoulder-bag" in category "bags"
returns an URL in English as: example.com/bags/shoulder-bag
And in Dutch as: example.com/tassen/schouder-tas

I'm also missing the code to specify a "default"

Can anybody help me out? Thanks!


texts: Naming Convention in imports - use \class vs use class

texts:
I found that, "Magento 2, At its core is PSR-4 compliant".

Then I got into this:
https://www.php-fig.org/psr/psr-4/

and the table at the bottom:

FULLY QUALIFIED CLASS NAME -> \Acme\Log\Writer\File_Writer

So I see from the most of Magento2 Code cases, that it uses:

use Magento\Catalog\Helper\Data;

shouldn't it be like :

use \Magento\Catalog\Helper\Data;

when it points to a class ?

and then when it comes to Constructors in Magento2 I can clearly see that this kind of syntax is used:

    \Magento\Catalog\Helper\Data;

Is used

mb I'm missing some core fundamentals but I'm curious about it :D


texts: How to add 3rd party js library to Magento 2

texts:
I am trying to install the following slider to my own Module https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html.

But unfortunately, Magento has its own complicated mechanism to manage its static assets like js and css.

My question is, "Is it possible to install 3rd party js extension on Magento 2?" if yes then how to make it work?


texts: Getting Invalid Coupon messages on order placed - Magento 2

texts:
I am getting that following messages
 on placing the order.

Any Help will be appreciated,
Thanks


texts: How to Create custom home page template in magento 2.0.15

texts:
I try this solution but i can not get custom _home layout according your answer so please help me to solve this problem.

I tried this link and put you layout.xml code on this location `D:\wamp64\www\magento\app\design\frontend\Magento\Custom\Magento_Theme'

and added ypur custom_home.xml code on this location
D:\wamp64\www\magento\app\design\frontend\Magento\Custom\Magento_Theme\page_layout


texts:
In magento 2.2.5 I added a recently viewed widget block that way:

<block class="Magento\Catalog\Block\Widget\RecentlyViewed" name="category.recently_viewed" template="Magento_Catalog::product/widget/viewed/grid.phtml" after="-">
    <arguments>
        <argument name="uiComponent" xsi:type="string">widget_recently_viewed</argument>
        <argument name="page_size" xsi:type="number">4</argument>
        <argument name="show_attributes" xsi:type="string">name,image,price,learn_more</argument>
    </arguments>
</block>

It does work but noticed that products in that listing only last a few minutes before being "forgotten" is there a way to increase that cookie lifetime to few hours.


texts: Unable to generate thumbnail image for certain products

texts:
We are using Magento 2.1.8 and have an issue with image generation. All items in our catalog have the image options set for base, small, etc. For certain items in the catalog however, no thumbnail is generated and they appear blank in the list. This is visible in the Item "Ice Skating Competition Dress" on our homepage at https://www.ohfrock.com/

I have tried all I can find including completely removing and recreating the images/cache directory but I cannot get this and other products to display a thumbnail. Is there anywhere I can look at a data level that may be blocking this or some other way to debug what the issue might be


texts: Is it possible to create an iframe-based payment method in Magento?

texts:
To give a context for my question, we are actually migrating to Magento from Interspire Shopping Cart. In Interspire, the payment form would be displayed after everything else, especially the Order Review/Summary. At this last step of the checkout, we just display an iframe, which displays a payment form hosted on our payment gateway's server (since we're not PCI compliant). In Magento, however, the last part isn't the payment form, but the Order Review.

So my question is, would it be possible at all to create a payment method that uses an iframe (instead of redirecting to a payment page after "Place Order" is clicked)? This iframe would display the payment form hosted on our payment gateway's server.

I ask this because based on what I've read, and after playing with my code, it seems that it is not possible in Magento. Displaying this iframe, for example, on Step 4 (Payment Information) would mean that when the form is filled out and submitted by the user, the page would redirect to a success page, thereby bypassing Step 5 (Order Review). And even this won't work because it is actually in Step 5 (after Place Order is clicked) where the success page is even defined. So after submitting the payment form (in an iframe) in Step 4, it wouldn't know what to do next.

I also tried to research how to put this iframe in Step 5 instead of Step 4, having it appear after "Place Order" is clicked, but couldn't find anything.

So, is it possible to create an iframe-based payment method in Magento? If so could you point me to some resources, because I've googled a lot and haven't found anything useful.


texts: How to display only the Inventory Tab in admin Product edit section?

texts:
The Product edit section (Catalog->Manage Products -> edit) I want to display only the Inventory tab for a particular admin user role.

For instance an admin user with "test" as user role should only see Inventory tab while trying to edit a product.

Currently I use core_block_abstract_prepare_layout_after event to add a custom tab.

  My observer function is as follows:

public function addTestBlock($observer){
$block = $observer->getEvent()->getBlock();
$product = Mage::registry('product');
if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs && $this->_canAddTab($product)){
    $block->addTab('myentity', array(
    'label' => Mage::helper('mymodule')->__('Test'),
    'url'   => Mage::helper('adminhtml')->getUrl('adminhtml/marketplace_tendor_catalog_product/tendors', array('_current' => true)),
    'class' => 'ajax',
    ));
}
return $this;

}

  I have planned to use adminhtml_catalog_product_edit_prepare_form event to display only the "Inventory" tab for test admin user.

Can I do this using event observer?
If yes, How?

Can anyone guide me pls?

[EDIT: ]
as suggested by mpaepper I used controller_action_layout_generate_blocks_after event and my observer function was like below:

public function vendorLayout($evt){
        $tabBlock =$evt->getEvent()->getBlock('product_tabs');
        $tab_ids = $tabBlock->getTabsIds();
        foreach ($tab_ids as $tab){
            if($tab != 'inventory'){
                $tabBlock->removeTab($tab);
            }
        }
    }

checking the user role is not a problem I can add it later.
removing the "General" tab results in the following.
If i allow "General" (group_4) and "Inventory" (inventory) tabs, then it's working fine, but the requirement is only to display Inventory tab.

nothing happens if I click on that tab, I think the js script isn't loading.
what am i doing wrong?


texts:
I am new to magento.
How can I use where in clause in magento 1.
I have array of ids and I want rows from those ids from database.
Please help me here.

$stateDealersCollection = $stateDealerModel->getCollection()->distinct(true)->addFieldToFilter('state_id', array('eq' => $data['state_id']))->addFieldToSelect('dealer_id')->getData();
    $dealerIds = [];
    foreach ($stateDealersCollection as $dealer)
    {
        if (!in_array($dealer['dealer_id'], $dealerIds))
        {
            array_push($dealerIds, $dealer['dealer_id']);
        }
    }
    print_r($dealerIds);
    die;
    $dealerModel = Mage::getModel('dealers/dealer');


texts:
We have imported the simple product using

system -> Import/Export -> Dataflow profile ->  Import All Products

We want to associate this product with configurable product. How we will achieve this?


texts: Magento 2: how to mark on grey sold out products

texts:
I want display products "out of stock" in product list but I want mark this product on grey and "sold out".

Anyone know how to do or any extension ?
@

I have file in

app/design/frontend/[Vendor]/[theme]/Magento_Catalog/templates/product/list.phtml

and this file list.phtml from app/ have 17mb

and file list.phtml from vendor have only 7mb

when I overwrote this file in app/ from vendor all styles have broken down.

in my file list.phtml (I have before):

app/design/frontend/[Vendor]/[theme]/Magento_Catalog/templates/product/list.phtml

I cannot found:

<div class="product-item-info" data-container="product-grid">

By default, my "sold out" product template is displayed in this way:


texts: Why is my Magento 2 site loading very slowly?

texts:
The issue I'm experiencing didn't happen until a few days ago. I wasn't sure if it's because of the extensions because I've installed no other extension that has anything to do with speed optimization. The only speed extension I've installed did not cause the issue when I installed it over a week ago.

The symptoms are as follows:

First time when I load the page, it literally takes a minute as in, about 60 seconds to load the page.
The next time I load that same page (e.g. front page) it loads normally, about 2-3 seconds.
However, when I click another link to load a different page, it takes another 60 seconds to load.
So the 60 seconds load time only applies to pages that I haven't previously loaded during the browsing session. Pages that I've been before will load like normal. Pages that I haven't been to will take 60 seconds to load for the first time.
I have an extension on Chrome that displays page load time and this is the only clue I have. The HTTP request takes over 60,000 ms to complete for the pages that I haven't been into.

So far, I have tried the following, and none of which improves the symptoms:

Refreshing the cache. After the cache has been refreshed, the symptoms reset themselves. The pages that loaded normally will now load as if it's the first time loading again, which takes another 60 seconds
Disabling and re-enabling the cache, same result as #1
Switching to Magento 2 Production Mode.
Rebooting the server
Cleaning the cache, flushing the cache, re-indexing everything, no changes in the symptoms

Is there anything else I could try to fix it? Any leads would be appreciated

Thank you


texts:
Here is my code to add the mini cart on my custom header .Any help?
<body>
        <referenceBlock name="header.container" remove="true" />
        <referenceContainer name="page.wrapper">
            <block  class="Magento\Framework\View\Element\Template" name="custom_header" template="Magento_Theme::header.phtml" before="header.container"/>
        </referenceContainer>
        <move element="minicart" destination="custom_header.header" />

</body>


texts: Magento 2 : update existing where collection clause

texts:
I'm trying to update an existing collection where clause in _beforeLoad() function. The collection can be filtered on many attributes and I just want to replace the customer_id clause.
I was able to clear all where clauses by using the following code but I just want to clear the customer_id condition :

$this->clear()->getSelect()->reset(\Zend_Db_Select::WHERE);

Thanks !


texts:
I've added an image to my home page and when I preview the home page from CMS pages in the admin the image is responsive.

When I click on my logo the page is then fully responsive all except the image?

The URL ends index.php/home when I preview from the CMS pages panel and when I click the logo the home URL key is gone?


texts: Magento2: How to add code inside the head tag?

texts: I'm working on a Magento 2 website and I'm trying to add some code to the head tag, I already tried to add going to Content->Configuration->HTML Head and pasting the code inside "Scripts and Style Sheets" field but the code always goes under the open tag body.


texts:
I just received communication from my bank that MiGS had a security update and i need to change from from MD5 to SHA 256.

I bought the MiGS extension from Hotextension about a 15 months ago but they dont seem to exist anymore.

Can someone please help me out here...Here are the codes...

Current codes

// vpc_SecureHash must come last to exclude itself
    $formFields['vpc_SecureHash'] = $this->getHash($formFields, $storeId);
    return $formFields;
}

/**
 * Get hash
 */
public function getHash($formFields, $storeId = false)
{
    ksort($formFields);
    $md5HashData = $this->getConfigData('secure_secret', $storeId);
    foreach ($formFields as $key => $value) {
        if (strlen($value) > 0) {
            $md5HashData .= $value;
        }
    }
    return strtoupper(md5($md5HashData));
}

/**
 * Return URLs
 */
public function getApiUrl($key, $storeId = null)
{
    return Mage::getUrl(self::API_CONTROLLER_PATH . $key, array(
        '_store' => $storeId,
        '_secure' => true
    ));
}

}

Here is what i received from the bank

"How do I change from MD5 to SHA 256?
Get your developer to look at your current code and locate where the MD5 hash is being calculated. They will need to look at the logic below and replace the current MD5 hash calculation with the below SHA256 HMAC calculation.

Step 1: Create string with transaction data via the merchant application.
Create a string with field names and values in ascending order using the POST data from PHP_VPC_3Party_Order.html:

foreach($_POST as $key => $value) {
// create the hash input and URL leaving out any fields that have no value
if (strlen($value) > 0) {

?>
        <input type="hidden" name="<?php echo($key); ?>" value="<?php echo($value); ?>"/><br>
<?php
    if ((strlen($value) > 0) && ((substr($key, 0,4)=="vpc_") || (substr($key,0,5) =="user_"))) {
    $hashinput .= $key . "=" . $value . "&";
    }
}

Step 2: Create SHA256 HMAC
•   Obtain Secure Hash Secret either from the existing MD5 calculation or from Merchant Administration
•   Calculate SHA256 HMAC using the secret as a key to produce the secure hash
Add the hash to the request string to send to the gateway.

}
$hashinput = rtrim($hashinput, "&");
?>
<!-- attach SecureHash -->
<input type="hidden" name="vpc_SecureHash" value="<?php echo(strtoupper(hash_hmac('SHA256', $hashinput, pack('H*',$securesecret)))); ?>"/>

I am not exactly a developer so can someone please advise what exactly needs to be done?


texts: Magento2 Overriding Block and Model Working Only For Direct Called Class

texts:
It seems like Overriding Block and Model in magento2 work only if the class is directly being called.

For Example i want to override model file

vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php

Here is my di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Model\Layer\Filter\AbstractFilter" type="Mynamespace\Comman\Model\Layer\Filter\AbstractFilter" />
</config>

And This is my AbstractFilter.php

namespace Mynamespace\Comman\Model\Layer\Filter;

abstract class AbstractFilter extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
{
    public function __construct(
        \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Catalog\Model\Layer $layer,
        \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder,
        array $data = []
    ) {

        parent::__construct($filterItemFactory,$storeManager,$layer,$itemDataBuilder,$data);
        if ($this->hasAttributeModel()) {
            $this->_requestVar = $this->getAttributeModel()->getAttributeCode();
        }
    }

    /* i want to override this function*/
    protected function isOptionReducesResults($optionCount, $totalSize)
    {
        return $optionCount <= $totalSize;
    }
}

This is not working because AbstractFilter is not being called directly from anywhere.

If i do same thing for

vendor/magento/module-catalog/Model/Layer/Filter/Price.php

It is working fine.

I am facing same issue for class:

vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle/Option.php

Which is not working however classes

vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php

vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php

which are working fine.

Can someone guide me if i am wrong here.


texts:
I tried to install Magento 2.3, but I have problems with main page. I follow up the wizard installation and obtain the successful installation page. Now, when I try to access to my page, I see this:

I inspect the page and I get many errors

And My admin page show this

I get this result if I inspect the admin page

So, I search many post about installation errors and I find a commands to deploy static files in magento, so, I execute this

(I executed the commands in another installation)

And Now, My page don't show anything

And the admin page doesn't exist

Well, I need a little need help to resolve my problem.

Thanks


texts: Magento 2 Order confirmation page not shown

texts: When paying with PayPal Plus (Creditcards, PayPal) the user is not forwarded to the order confirmation page, but to the cart. The cart is then empty.


texts: local.xml - How Can I install Magento Files in a Shared Hosting and my Database (2GB+) in my Dedicated Server?

texts:
I have my Magento files (app, lib, media, var, etc..) in a Shared Hosting, How can I edit the local.xml to comunicate the platform with a remote database? In the remote server I'm running MySQL 5.1.73 with my database (over 2GB in products, categories, orders, etc...)

Local Files Server --------> Remote MySQL Server

Please I need help to solve this. Regards.


texts: Cannot read property 'bind' from copy of mage/menu.js

texts:
I am trying to create a custom menu in Magento 2, but I run into the following browser console error when I add the JavaScript file for it.

  main.js:27 Uncaught TypeError: Cannot read property 'bind' of undefined

For a starting point I begin with a copy mage/menu.js, instead of creating a JavaScript Mixin, I chose to copy it as I intend to override a lot of functionality in it and do not wish to change too much of Magento's navigation or menu widgets.

So, I made a copy of mage/menu.js, named it my-menu.js, and call it in my template with:

<script type="text/x-magento-init">
    {
        ".my-menu": {
            "Holly_Menu/js/my-menu": {
                "responsive":true,
                "expanded":true,
                "delay":<?= $block->escapeHtmlAttr($menuDelay) ?>,
                "mediaBreakpoint": "<?= $block->escapeHtml($breakPoint) ?>",
                "position":{
                    "my":"left top",
                    "at":"left bottom"
                }
            }
        }
    }
</script>

Here is the full Holly_Menu/js/my-menu.js file:

define([
    'jquery',
    'matchMedia',
    'jquery-ui-modules/menu',
    'jquery/jquery.mobile.custom',
    'mage/translate'
], function ($, mediaCheck) {
    'use strict';

    /**
     * Menu Widget - this widget is a wrapper for the jQuery UI Menu
     */
    $.widget('holly.megamenu', $.ui.menu, {
        // code removed to not exceed character limit of StackExchange question
        // contents are a copy from the Menu Widget in
        // https://github.com/magento/magento2/blob/2.3/lib/web/mage/menu.js#L18
    });

    $.widget('holly.mmnavigation', $.holly.megamenu, {
        // code removed to not exceed character limit of StackExchange question
        // contents are a direct copy from the Navigation Widget in
        // https://github.com/magento/magento2/blob/2.3/lib/web/mage/menu.js#L665
    });

    return {
        megamenu: $.monsoon.megamenu,
        mmnavigation: $.monsoon.mmnavigation
    };
});

As you can see the only thing which I have changed from mage/menu.js are the namespace and widget names, i.e. holly.megamenu and holly.mmnavigation.

And it produces the following browser console error:

  main.js:27 Uncaught TypeError: Cannot read property 'bind' of undefined

Any ideas what could be the cause or fix for this?

Thanks!

UPDATE

I also tried creating an alias in my module's requirejs-config.js

var config = {
    map: {
        '*': {
            'hollymenu': 'Holly_Menu/js/my-menu'
        }
    }
};

And calling in template with hollymenu instead, but it does not fix the issue.


texts:
I want to override the summary.phtml template (vendor/magento/module-review/view/frontend/templates/helper/summary.phtml) with a custom module.

The template is overridden in the catalog_product_view.xml layout file with this  code:

<referenceContainer name="content">
  <referenceBlock name="product.info.review" template="Vendor_Catalog::review/helper/summary.phtml"/>
</referenceContainer>

My template is well displayed but the data of the block is not accessible. I cannot use the default block methods (getReviewsUrl, etc).

I have tested this method but my custom template is not loaded:

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="product.info.review" >
        <arguments>
            <argument name="template" xsi:type="string">Vendor_Catalog::review/helper/summary.phtml</argument>
        </arguments>
    </referenceBlock>
    </body>
</page>

Do I have to override the block? Is there another way?


texts:
It is commonly recommended to use "Meta noindex, follow" over robots.txt to disallow pages from being indexed by google ... for example http://www.magestore.com/magento-2-tutorial/most-extreme-magento-2-seo-mistakes/

Now my question is where can I configure that in Magento 2.1?!


texts: Magento 2| How to add "Add to cart" Button functionality in jQuery?

texts:
I am adding "Add to cart" button functionality in jQuery function for calculated product quantity. I have add simple button yet. I have doing it as:

My function is:

$(document).ready(function(){
    $("#inputalgolia").keyup(function(){
        $("input").css("background-color", "grey");
        index.search(this.value, function(err, content) {
            // console.log(content.hits);
            var dataobj = content.hits;
            var product='';
            $.each(dataobj, function () {
                product+='
'+
                '
' + this.name  +'
'+
                '
' + this.sku  +'
'+
                '
'+this.image_url  +'
'+
                //'
'+ this.objectID  +'
'+
                '<input id="algolia-qty-' + this.objectID + '" data-product="' + this.objectID + '" class="qty-triggered" type="number" name="quantity" min="1" max="5">'+
                '<button type="button">Add to Cart</button>
'+
                '<input id="algolia-sqm-' + this.objectID + '" data-product="' + this.objectID + '" class="sqm-triggered" type="number">'+ '<input id="algolia-width-' + this.objectID + '" data-product="' + this.objectID + '" value="150" type="hidden">' + '<input id="algolia-height-' + this.objectID + '" data-product="' + this.objectID + '" value="400" type="hidden">' +
                '
';
                $('#productsalgolia').html(product);
            });
        });
    });
});

Can anybody explain how to do it, Thanks.


texts: Magento ver. 1.9.2.4 - Shopping cart rule issue

texts:
I am trying to set up a shopping cart rules to work like this:
if specific SKU inside the cart and quantity ordered between 20 and 59 (inclusive) - the customer will get a different price/free product etc.

As you can see in the image I got 1st part setup >=20, but when I try to add an additional line for product sub-selection to be less or equal to 59, shopping cart rule page auto-refreshes and I am back to the admin dashboard. This happens if I try to create a rule from scratch or amend an existing one. Previously everything was working fine, just a couple of days ago I tried to set this up and noticed this issue.


texts:
I created an observer for this event

  sales_order_address_save_before

<?php
namespace UV\Adressen\Observer;

use Magento\Framework\Event\ObserverInterface;

class LieferadresseEditObserver implements ObserverInterface
{
  private $customerRepository;

  public function __construct()
  {

  }

  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    print_r(get_class_methods($observer));
    exit;
  }
}
?>

However how can I get the changed address and how can I see if it is a shipping or a billing address? thanks!:-)


texts: Google Analytics not working with store views Fooman module

texts:
We have implemented the Fooman Google Analytics Plus module.  The UA tag seems to working properly when checking it with Google's tag chrome plugin.  However, it's not tracking subdirectories properly.

The way our Magento site works we have each store view under a subdirectory so ourdomain.com/us_en/ would be United States and ourdomain.com/dk_da/ would be Denmark  etc. etc.  When I go to the page source and look at what it's sending to Google Analytics, it's not recording the /us_en/ or /dk_da/ or any of the other country subdirectory page views.  However, anything that comes after the store view directory...works fine.  I have no idea why.  In Google Analytics it's showing the same.  If I go to All website data and look at Landing pages I see /news/product/something/something/something....but the country code isn't listed first.

We have a ton of views set up with filters to include only a certain subdirectory like /us_en/ but it doesn't work at all for the reasons mentioned above.

Example:
Going to ourdomain.com/us_en/ returns this:

  <!-- Google Analytics -->
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UAcoderemovedforexample','auto');

                    ga('send', 'pageview', '');

</script>
    <!-- End Google Analytics -->

Going to ourdomain.com/us_en/ambassadors and viewing source returns this:

    <!-- Google Analytics -->
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UAcoderemovedforexample','auto');

                    ga('send', 'pageview', '/ambassadors');

Going to our homepage without any subdirectory returns this which is the same as if we used a subdirectory.:

 <!-- Google Analytics -->
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UAcoderemovedforexample','auto');

                    ga('send', 'pageview', '');

As you can see...it's skipping the /us_en/ subdirectory.  To give more insight on how our site works is that when you come to it the first time it asks you your country with a lightbox and then remembers you for future visits (so it auto redirects to the proper store view/subdirectory).  Inside of Magento the base URL is set to ourdomain.com across the board.

I'm sure there will be more questions.  Any help is appreciated!


texts: ://index.php/? is adding at the end of the url for first time

texts:
when we open a site : http://ab1.domain.com/

for first time in browser, it will redirect to below url

http://ab1.domain.com/://index.php/? & give 404 Not Found 1

://index.php/? is adding as suffix. but if we open 2nd time, than its working fine.

its multi-store site, when we disabled all stores also still problem is there.

Edit

It was problem with custom module , we are using this module for displaying respective currency based on country.

i dont want to disbale the custom module. I want solution with custom module enabled.

Observer.php

class Atwix_Ipstoreswitcher_Model_Observer
{
    /**
     * redirects customer to store view based on GeoIP
     * @param $event
     */
    public function controllerActionPostdispatch($event)
    {
        $cookie = Mage::getSingleton('core/cookie');
        if ($cookie->get('geoip_processed') != 1) {
            $geoIPCountry = Mage::getSingleton('geoip/country');
            $countryCode = $geoIPCountry->getCountry();
            if ($countryCode) {
                $storeName = Mage::helper('atwix_ipstoreswitcher')->getStoreByCountry($countryCode);
                if ($storeName) {
                    $store = Mage::getModel('core/store')->load($storeName, 'name');
                    if ($store->getName() != Mage::app()->getStore()->getName()) {
                        $event->getControllerAction()->getResponse()->setRedirect($store->getCurrentUrl(false));
                    }
                }
            }
            $cookie->set('geoip_processed', '1', time() + 86400, '/');
        }
    }
}

Data.php

class Atwix_Ipstoreswitcher_Helper_Data extends Mage_Core_Helper_Abstract
{
    const DEFAULT_STORE = 'India';

    /**
     * countries to store relation
     * default is English
     * @var array
     */
    protected $_countryToStore = array(
        'IN' => 'Indian Rupees [INR]',
        'US' => 'US dollar [$]',
        'FR' => 'Europe [€]',
        'AR' => 'US dollar [$]',
       // 'BO' => 'US dollar [$]'

    );

    /**
     * get store view name by country
     * @param $country
     * @return bool
     */
    public function getStoreByCountry($country)
    {
        if (isset($this->_countryToStore[$country])) {
            return $this->_countryToStore[$country];
        }
        return self::DEFAULT_STORE;
    }
}

Edit 2

When i Go & System > Configuration > Web > Url options > Add Store Code to Urls : YES , If i set "YES" , than ://index.php/? will disappear. but Store codes are adding at the end of the url as like : http://ab1.domain.com/usa , http://ab1.domain.com/europe  , but i want to keep only http://ab1.domain.com/

Edit 3

After following @Neklo.com answer , ://index.php/? is removed from url .

i changed to NO : System > Configuration > Web > Url options > Add Store Code to Urls : No

but now its adding ?___store=storecode at the end like ?___store=europe , ?___store=usa for 1st time , but 2nd time its working fine. so i followed link1 & link2 but store codes are still adding for the first time.

As i mentioned before, once i disable the module, it will work fine.


texts: SOLD label only shows in product grid, need also to show on product page

texts:
I got this code placed in catalog/product/list.phtml, but that only makes the label SOLD for a product to show on category pages. I would like it to appear on every page where the product is shown. Should a place the code somwhere else? see live on https://www.mediaboxshop.nl/media-spelers

Thanks.

<span class="<?php if ($_product->getStockItem()->getIsInStock() == 0) { echo 'sold-out'; } ?>">
  <?php
       if ($_product->getStockItem()->getIsInStock()) {
         echo "&nbsp;";
        }else{
           echo "Sold";
         }
    ?>

I placed it after this code in list.phtml

 <ul class="products-grid category-products-grid itemgrid itemgrid-adaptive itemgrid-<?php echo $columnCount; ?>col<?php if($gridClasses) echo $gridClasses; ?>">
        <?php foreach ($_productCollection as $_product): ?>

                    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true); ?>" class="product-image">

      <div class="product-image-wrapper" style="max-width:<?php echo $imgWidth; ?>px;">


texts: How To Get Stored Database Image In Dropdown List Box?

texts:
How To Fetch Stored Database Image In Dropdown List Box?
And If Specific Image Are Select Then This Image Are Also Show At Frontend.

This Is My COde..
app\code\local\Hs\Simplebanner\Block\Adminhtml\Simplebanner\Edit\Tab\Form.php

$fieldset->addField('select', 'select', array(
'label'     => Mage::helper('simplebanner')->__('Select Your Image'),
'required'  => true,
'name'      => 'select',
));

app\code\local\Hs\Simplebanner\Block\Adminhtml\Simplebanner\Grid.php

$this->addColumn('select', array(
'header'    => Mage::helper('simplebanner')->__('Select Your Image'),
'align'     => 'left',
'width'     => '80px',
'index'     => 'status',
'type'      => 'options',
'options'   => array(
),
));


texts: Magento 2 product count issue in the layered navigation in category listing page

texts:
I am using Magento 2.2.6, i have a color attribute of multiselect type. i had assigned this attribute to all product type. when i assign one group product of color red to category "Category 1" then in the layered navigation i can see many color options like below

Color

Red (2)
Blue (1)
Green (1)
Yellow (1)

i debugged why this is coming. i found that this group product has 4 simple product of color red,blue,green & yellow.

so thats why when i added one group product i am able to see this much color option in the layered navigation

What i require is i dont want to include this simple product's color options in the layered navigation.

Any solution.

Thanks


texts: How to return global_messages as JSON string?

texts:
I am trying to echo global_messages via JSON on the frontend.

I have been looking around for some examples of how to return global_messages as a JSON string but cannot find anything that has helped with my endeavours.

So far I have been able to extend Mage_Core_Block_Messages with my own Company_Core_Block_Messages class then I have attempted to use JSON encode to when returning the $html but have been unsuccessful:

public function getGroupedHtml()
{
    $types = array(
        Mage_Core_Model_Message::ERROR,
        Mage_Core_Model_Message::WARNING,
        Mage_Core_Model_Message::NOTICE,
        Mage_Core_Model_Message::SUCCESS
    );
    $html = '';
    foreach ($types as $type) {
        if ( $messages = $this->getMessages($type) ) {
            if ( !$html ) {
                $html .= '<' . $this->_messagesFirstLevelTagName . ' class="messages">';
            }
            $html .= $this->_renderTextMessages($this->_getTextMessages($messages), $type);
            $html .= $this->_renderPopupMessages($this->_getPopupMessages($messages));
        }
    }
    if ( $html) {
        $html .= '</' . $this->_messagesFirstLevelTagName . '>';
    }
    return $html;
}

Inside my custom_messages.phtml I would like to echo the returned string but I am not sure if this is the correct way to do this and would like to ask for some guidance please...

<script>
    new Ajax.Updater('<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>');
</script>

Has anyone done something similar before?


texts: How to include phtml file using ajax or jQuery or javascript?

texts:
I tried,

 function chk_val()
 {
     var buy_now = '<?php echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Magento_Catalog::product/view/buy_now.phtml")->toHtml();?>';
     jQuery('#div_buy_now').html(buy_now);

}

Getting output as :

   getLayout()->createBlock("MagentoFrameworkViewElementTemplate")->setTemplate("Magento_Catalog::product/view/buy_now.phtml")->toHtml();


texts: ReflectionException: Class Magento\Framework\MessageQueue\Config\Reader\Xml\Converter\DeprecatedFormat does not exist

texts:
Recently I upgrade Magento 2.1.18 to 2.3.4 and got below exception error.

  1 exception(s):
  Exception #0 (ReflectionException): Class Magento\Framework\MessageQueue\Config\Reader\Xml\Converter\DeprecatedFormat does not exist

First this error was happen during setup:upgrade on Magento_Amqp module. I read online that this module is optional and It is okay to disable it.

Now I am getting this exception on checkout page. Any help would be appreciated.


texts: Magento 2 Auto deploy Script using capistrano or other tools

texts:
Does anyone have a script which will deploy magento2 to the server using Capistrano or other auto deploy scripts?

Thank you.


texts: Is it safe to stop Product Prices indexing?

texts:
To work filter fine, I will have to stop indexing of Product Prices.

Can anyone tell me whether it is safe or not?

What problem will I have to face?


texts:
I have a problem on Magento where if I sell a bundle product, despite setting the price to dynamic and overriding the default tax setting from 'None' to 'Taxable Goods' I find that every order and invoice with a sale of a bundle product shows 0 tax...

Any ideas?


texts: Magento Generate csv when a customer is registered

texts: is it possible to  generate a csv file with customer details when a customer is registered in magento website?is there any functionality default in magento?


texts: How to get session variable value in payment page?

texts: How to get session variable value from shipping page to payment page ?


texts:
We had a problem with our VPS and when we try to get in any pages using SSL, since the SSL hasn't been re-installed, we have a default ssl certificate which is not trusted. Could it be the cause of the Error 404 problem I am getting at:

https://www.naturalscents.ca/index.php/customer/account/login/

?

This matter is really urgent. Also if you think it is something else or you need any more information please ask me!


texts: Magento 2 back end not working after latest update

texts: Magento 2 back end not working. It has nor formatting and I can't do anyting