texts: nginx multiple stores - PRODUCT NOT FOUND

texts:
There is a website that has multiple subcatogories which are stores in magento:

www.website.com/sub1
www.website.com/sub2
www.website.com/sub3

The server used is ngnix. everything is set up. And used to work, the nginx conf file for this site need to be reconstructed.

at the moment when for example www.website.com/sub1 is requested this wil set the store to store to sub1. which works fine. However when a product is asked i.e. www.website.com/sub1/product this returned a "page not found" error.

If the store is set to sub1 the url www.website.com/product DOES FIND the product without any issues. on the other hand f the store was not set previously, www.website.com/product DID NOT FIND the product.

it seemed that once a store is set the following happens e.g. www.website.com/sub1/product :

sub1->sub1->product == error (because of sub1->sub1)

this should be:

sub1->product.

note that setting the store when www.website.com/sub1/product is requested and then redirecting the site to www.website.com/product is not an option.
everything used to work fine! The store setup had not been changed. only the the nginx conf file should be adjusted. any sugestions?

server {

        listen 80 default;
        server_name website.com;
        root /www_folder;
        client_max_body_size 10M;

location / {
                index index.php;
                try_files $uri $uri/ @handler;
                expires 30d;
        }

location /mage/ {
                try_files $uri $uri/ @magehandler;
                expires 30d;
                }

    location @handler {
        ## Remove trailing slash
       rewrite ^/(.*)/$ /$1 permanent;
        ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location @magehandler {
        ## Adds a trailing slash to any urls that is missing a trailing slash
        rewrite ^(.*[^/])$ $1/ permanent;
        ## Magento uses a common front handler
       rewrite /mage/ /mage/index.php;
    }

    ## These locations would be hidden by .htaccess normally, protected
    location ~ (/mage/(app/|includes/|lib/|pkginfo/|var/|errors/local.xml|shell/|tmp/|cron.+)|/\.git/|/\.ht.+)
        {deny all;}

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }

location  /. { ## Disable .htaccess and other hidden files
                return 404;
    }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ \.php$ {
        add_header X-UA-Compatible 'IE=Edge,chrome=1';
        try_files $uri =404;
        expires off;
        fastcgi_index index.php;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        #fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SERVER_PORT 80;
        fastcgi_param HTTPS $fastcgi_https;
    }
}


texts:
I have my own theme derived from the default RWD theme in 1.9.2.1. However, I want to change the products page. so, it looks like figure one rather than the defualt rwd one with the tabs.  However, im not the biggest expert in magento and have no idea how to go about doing, so was wondering if anyone could guide me to what I have to?

figure 1:


texts: How to find the average time until a customer bought the same product again

texts:
I want to find the average time a customer took to buy the same product in his consecutive orders.Suppose if a customer bought product X today in his first order and two days after he bought the same product X in his second order and like this many orders.

So is it possible to find the average time/Percentage of customers who bought the same order?

Magento Version : 1.9


texts: how translate.csv affect the frontend product page?

texts:
My product page have a labels like Qty: , My Cart and others and I want to translate these text fields with translate.csv file in my theme folder (app / design / frontend / FOLDER / THEME / locale / pt_BR / translate.csv), but to have created the pt_BR folder and cleared the cache after inserting the file, the display on the product page continues the native language of theme (english) i want to change to portuguese-brasilian.

Part of my code is:

"Video", "Video"
"Information", "Informação"
"Special products" and "Produtos Especiais"
"Qty", "Quant."
"Mage_Catalog :: Add to Cart", "Adicionar ao carrinho"
"Mage_Checkout :: Add to Cart", "Adicionar ao carrinho"

How do you translate correctly?


texts: Magento 2.4 Pick from store default option selected

texts: I am using Magento 2.4 pick from store option. I only have 1 store, is it possible that store is already selected when pick from store option is clicked? Because currently users have to click on search store first.


texts: Magento Certified Professional Cloud Developer Exam Reading Material

texts:
Recently Magento announced  Certified Professional Cloud Developer exam for Magento2.

  https://u.magento.com/magento-certified-professional-cloud-developer

I have some questions about this Certified Professional Cloud Developer exam.

What is the passing score for magento cloud developer exam?
Which study materials useful for preparation of this exam except Free study Guide?
What is the retake policy for this exam?
How many free retakes are available?
What is difference between professional and cloud certification?


texts: How do I update Magento 2 phtml files in Grunt?

texts:
I have updated the file and added some text to:

app/code/Magento/Theme/view/frontend/templates/html/header.phtml

I have checked the website and nothing is reflecting on the site. I have cleared my cache in my browser and cookies. I have ran all of these commands too with successful message feedback yet still nothing on the front end.

# php bin/magento setup:static-content:deploy
# grunt deploy
# bin/magento deploy:mode:show


texts: Help to bulk update SKUs and Cost Prices

texts:
Good morning I am migrating my product portfolio from Magento 1 to Magento 2 and I need to bulk upload new SKU codes and new cost prices from an XL or CSV file how do I do this?

Also on Magento 2 there is no longer a product ID which was a code our clients used to identify products - is this no longer a feature and can we use the SKU code instead? If so how do we show this on the site?

Thanks so much in advance
Anthony


texts: Advice on most performant approach to get variables once per session

texts:
I need to pass deviceType and userState(IL, IN, IA, KS, etc) variables to GTM for marketing purporses and wondering what’s the best way to do it.

To calculate deviceType I will use mobiledetect php library. For user userState - GeoIP2 php library.

Since these variables are constant per session and in fact per device/user, I am looking at the ways to make it most performant.

I have following ideas:

1] Use Mage::getSingleton to call mobiledetect/GeoIP2 functions

This way it load function once per page load (http request)

2] To further improve 1] since deviceType and userState are same per session I am thinking to write them in session and read from it.

Like this

Mage::getSingleton('core/session')->setDeviceType ($deviceType); -write
Mage::getSingleton('core/session')->setDeviceType(); - read when needed it

I assume reading from session will be more performant than recalculating on every page load/http request.

3] To further improve 2] since deviceType and userState variables are not needed for above the fold (not crucial contant), I am thinking about loading functions on document ready using ajax. This way first time they are calculated will not effect page speed. Something like this:

$(window).load(function () {
    $.ajax({
        url: "deviceType_State.php",
    });
});

Here we can also add check if the session variable already exists than do not do ajax call.

4] If 3] is good idea, to further improve it instead of writing variables into session on our server side, we could write it into session storage on client’s browser or maybe even better local .
sessionStorage.setItem(device', $deviceType); or localStorage.setItem(device', $deviceType);
When checking some of big sites i saw they keep similar marketing variables in localStorage.

Please tell if my thinking is right, and what's the best way to achieve the goal.


texts: Redirect to url of Programatically created Product

texts:
once we click on button in product view page, we are creating New Product Programatically & displaying pop up with message : "new product created"  Instead of displaying pop up , i need to redirect to Newly created Product's url.

public function createSimpleProductAndRedirectAction()
    {
        $originalProductId = $this->getRequest()->getParam("id");
        $originalProduct = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($originalProductId);

        $_productUrl = Mage::getModel('catalog/product')->load($product->getId())->getUrlKey();

        if ($product = $this->_createProduct(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, true, $originalProduct, $newImagePath))
        {
            if(Mage::getSingleton('customer/session')->isLoggedIn())
            {
                return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode("new Product created"));
            }
        }
    }

protected function _createProduct($type, $doSave = true, $originalProduct, $newImagePath = "")
    {

        try {
            if (isset($login) && (is_array($login) && !empty($login)) || ($login != "")) {
                $designId = Mage::getSingleton('core/session')->getData('mydesign_id');
                $session->login($login['username'], $login['password']);
                $result['redirect'] = $this->_getRefererUrl() ? $this->_getRefererUrl() : Mage::getUrl('customer/account', array(
                    '_secure' => true
                ));
                $result['success'] = true;

                $customerId = Mage::getSingleton('customer/session')->getCustomerId();

                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
                return $this;
            } else {
                $customerId = "";

            }

            if(Mage::getSingleton('customer/session')->isLoggedIn()) {
                $res = $this->saveProduct($type, $doSave, $originalProduct, $newImagePath);
                $result['success'] = true;
                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
                return $this; exit;
            } else {

            }

        } catch (Mage_Core_Exception $e) {}

        } catch (Exception $e) { }
    }

public function saveProduct($type, $doSave = true, $originalProduct, $newImagePath) {

            Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

            $product = Mage::getModel('catalog/product');

            $product->setName($originalProduct->getName());
            $product->save();

            return $product;
    }

I tried replacing this code :

return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode("new Product created"));

by below code :

$_productUrl = Mage::getModel('catalog/product')->load($product->getId())->getUrlKey();
return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($_productUrl));

Error :

Fatal error: Call to undefined method Amasty_Example_AmastyController::getId() in line

$_productUrl = Mage::getModel('catalog/product')->load($product->getId())->getUrlKey();

Is i am using code in wrong place ? because echo  $_productUrl gave empty value.


texts: Using product options/attributes to add a separate line item during add to cart

texts:
This is a bit hard to describe so please bear with me and hopefully it will all make sense.
My basic goal is to have product options/attributes function to add a second, separate line-item to the cart. For example, on product page "conference camera" we would like to include (3) mounting options: "no mount", "ceiling mount", "wall mount". If a person selects the "ceiling mount" option and clicks add to cart, it would add one line item for "conference camera" and another for "ceiling mount".
Our store previously migrated from Volusion, which utilized two similar product option features: "jump to product code" and "is product code". "Is product code" is essentially what I am trying to recreate. Here is the description offered by Volusion:

Is Product Code enables you to associate options with additional products, so that when an option is selected that product is "bundled" with the product being viewed.

Just a bit on the reasoning for this request:
We currently use a secondary back-end software and the dynamically generated SKUs from configurable products are seen as "assemblies" (i.e. they need to be put together from a variety of constituent products). In the end, this is causing issues for us maintaining our inventory, getting appropriate run rates, and prioritizing order queue correctly.
I have looked into bundled products and grouped products, but those don't seem to truly accomplish the intended effect, but if I'm wrong on that then please let me know. Beyond that, I'd be happy to look into any possible development options with my team (or externally) or purchase a module with those features.
Thanks in advance for any responses.


texts: How to start with Magento 2 ? for newbs in Magento 2

texts:
I really know this might be off-topic, but I already, "red" the https://magento.com/
https://devdocs.magento.com/
I just have started in a company with 50+ employees and most of them are even greater newbs from me.
They have a website ran on Magento2 and, it is just those little country from the Balkaines that don't know much English. So here is the deal. They want me to support the website and also to make modifications, backups all the things. New to Magento2. And the boss wants to make just a new Magento2 website for another brand of his products.
So just where to start? Like A,B,C
How to choose hosting, how to install Magento2, how to choose theme, how to modify it if the boss says I don't like this. Just something for total newbs, cause from the magento.com I'm even more confused then from the start, without knowing a thing. I mean what is CRON for example ? Why I just can't make the Magento2 installation for 10 minutes, like the famous WordPress 5 mins install? Things like that.
And pls, I beg you show me a working guide, cause I already failed in a migration from one server 2 another, and also failed in installing a new Magento2 installation.
Thanks in advance.


texts: Magento 2.X How to keep the payment in pending when a new order is created

texts:
Current situation. When a new order is created, the status is changed to processing and the payment is completed.
What I want to change. After a new order is created, the status is changed to processing, but the payment is kept in pending until someone manually verifies the order. After everything is ok, change the status to completed and payment is completed.


texts: Get the options and attribute titles of an order item in a specific language programmatically

texts:
I need the options and attribute titles of an order item  in a specific language programmatically.

$options = $sItem->setStoreId(2)->getProductOptions();

Is not working


texts: Create IPN file magento 1.9 Paypal payment Standard

texts: please help me how can I create IPN  file in my magento and What i have to write in ipn.php File? Thanks


texts: Magento 2 admin user role not displaying anything

texts:
I have created a custom module, everything is working fine, but when i take the admin user roles it is displaying nothing.

My acl.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Contact::contacts">
                    <resource id="Suyati_Scontact::contact_manage" title="Manage Conatcts"/>
                </resource>
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Suyati_Scontact::scontact" title="Contacts Section" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

System.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="suyati" translate="label" sortOrder="210">
            Suyati Scontact
        </tab>

            Contacts
            <tab>suyati</tab>
            <resource>Suyati_Scontact::scontact</resource>
            <group id="email_template" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1"
                   showInStore="1">
                Suyati Contact Options
                <field id="pincode" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Is Pincode Required?
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="location" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Is Location Required?
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="mobile" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Is Mobile Number Required?
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="comment" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    Is Comment Required?
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>

            </group>

    </system>
</config>


texts:
When I manually Generate sitmap.xml from admin's Catalog>Google Sitemap, it throws the following error in the browser:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@TheDomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache error_log
[Fri Dec 25 10:15:12 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml
[Fri Dec 25 10:26:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/
[Fri Dec 25 10:31:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/
[Fri Dec 25 10:41:07 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/sitemap/index/key/e6...22/
[Fri Dec 25 10:46:35 2015] [error] [client MyIP] Script timed out before returning headers: index.php, referer: https://TheDomain/cms_page/index/key/56...9c/
[Fri Dec 25 10:47:40 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml
[Fri Dec 25 10:47:52 2015] [error] [client HostIP] client denied by server configuration: /home/DIRECTORY/public_html/MAGENTO/app/etc/local.xml
[Fri Dec 25 11:13:04 2015] [notice] SIGUSR1 received.  Doing graceful restart
[Fri Dec 25 11:13:05 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 25 11:13:05 2015] [notice] Digest: done
[Fri Dec 25 11:13:06 2015] [warn] RSA server certificate CommonName (CN) `www.DOMAIN.com' does NOT match server name!?
[Fri Dec 25 11:13:06 2015] [notice] Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4 configured -- resuming normal operations

This could be a browser time out issue!
Can this command be executed from shell ssh?


texts: Switch order of attribute after creating a lot of products?

texts:
How do you change the order of attributes, that are already in use in configurable products?

For example I have an attribute with the sizes: S, M, XL, L. These attributes have different "Position" values? And I have a lot of products using these attributes. What happens if I change XL to be L? That would mean it would loose all of these connections?

S  : 1
M  : 2
XL : 3
L  : 4

This is a simplified version of what I have. I have 12-15 different attributes, with maybe 50-200 different attribute values.

Any easy solution? Or explaination why this is not easy achievable?


texts: Load catalog/product/list.phtml for Custom Module collection

texts:
I am writing a new module to get a filtered Collection.
Currently I am using my own template file to show the results but I want to use directly my templates catalog/product/list.phtml file to keep evreything simple and centralized.

Currently what I have in my controllers index action is :

$block = $this->getLayout()->getBlock('brands');//get the block instance
$block->setData("collection",$collection)->setTemplate('cantek_brand/brand.phtml'); //set collection and the template

In my modules layout xml

 <layout>
  <brand_index_index>
     <reference name="content">
         <block type="core/template" name="brands" as="brands" />
     </reference>
  </brand_index_index>
 </layout>

So, with this way I have the collection set and the template that I created. But this way the list views are not identical on the website.

My Question is:
How can I use catalog/product/list.phtml for my custom module template?


texts:
How do you preview a cms page on the frontend which is disabled?
I want to add content to a page and before making it live I want to see what it looks like


texts: I recently installed Magento 2 on a development server to test it. When I create new Magento users I get You did not sign in correctly or your account is temporarily disabled. when I try to login with them. All of the new users have status Active. The admin account I created during the setup process works, and is the only one working.


texts: Magento 2.3 - Get child categories of parent

texts:
In Magento 2.2 I've written this little script.

    /**
     * Index constructor.
     *
     * @param Context               $context
     * @param StoreManagerInterface $storeManager
     * @param CategoryRepository    $categoryRepository
     * @param array                 $data
     */
    public function __construct(
        Context $context,
        StoreManagerInterface $storeManager,
        CategoryRepository $categoryRepository,
        $data = []
    ) {
        $this->_storeManager       = $storeManager;
        $this->_categoryRepository = $categoryRepository;
        parent::__construct($context);
    }

    /**
     * @return ResponseInterface|Interceptor|ResultInterface|null
     * @throws NoSuchEntityException
     */
    public function execute()
    {
        $request = $this->getRequest();

        if ($request->isAjax() && $this->getRequest()->getParam('id') !== '0' ) {
            $parent_category_id = $this->getRequest()->getParam('id');
            $categoryObj        = $this->_categoryRepository->get($parent_category_id);
            $data               = $categoryObj->getChildrenCategories();

            /** @var Interceptor $resultJson */
            $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
            $resultJson->setData($data);

            return $resultJson;
        }

        return null;
    }

In the execute function the parent category id is send in the ajax request and works.

With that parent category id I ask the categoryRepository to get that category.

After that I ask the category object to get it's children categories.

This is send to the ResultFactory which should return a JSON string with the children categories.

In Magento 2.2 this works, in Magento 2.3 the ResultFactory returns an empty JSON string.

I've looked in the release notes, but I could not find anything about a refactor in the categoryRepository.


texts: Composer Based Modules and PSR4 Autoloaders

texts:
Is it safe to assume that any composer based module package will have a PSR 4 autoloader section whose prefix is the full module name?  i.e.

"autoload": {
    "psr-4": {
        "Foo\\Bar\\": "src/"
    }
}

or are people doing different, clever things with autoloaders in Magento 2?  If so what are those different clever things?


texts: Attempt to load value of nonexistent EAV attribute for entity type Magento\Catalog\Api\Data\ProductInterface magento 2.3

texts:
Actually i am getting this error while editing products from product
  grid magento2.3

  Actually i deleted some custom attribute using code as
  well as manually from backend  after this i got this error in var/log/system.xml


texts: Add custom text to each product in cart - Magento 1.9X

texts:
how can I attach a custom text to a product which will be added into the cart along with the product itself when adding it to cart and furthermore being passed through the whole order process like in order page in back office or on pdf invoices and so on??

Ex :

When customer is on my product page he has the opportunity to
"customize" the product wih the help of a configuration wizard I
have built with javascript/jquery.
List item At the end of this process customer can add customized
product to cart which now has a custom price and a custom
"ordertext" for me as the shop-owner to get all the customization
information
When clicking on add-to-cart-button
product is added to cart with new customprice and customtext

Please note that my custom text is not entered by customer. Instead it's gonna be generated by programmatically.


texts: magento status Use Default Value for all products

texts:
I did a bulk action, to enable and disable all products for a storeview in my product overview.

But now all the products are not using the default value anymore for status.
Is there way to check the "Use Default Value" back again?


texts: Magento 2 in SEO Checker - "The Accessible Index Page is Configured wrong"

texts:
So I run our site (on Magento 2.2.3) thru an SEO checker and it flagged up an interesting issue:

The Accessible Index Page is Configured wrong.

Search engines see your https://www.xyz.co and https://www.xyz.co/index.html (or https://www.xyz.co/index.php) as different pages. With a variety of URLs, it's more challenging to get consolidated metrics for a specific piece of content.
If you don't explicitly tell Google which URL is canonical, Google will make the choice for you, or might consider them both of equal weight, which might lead to unwanted behavior.

Is this actually an issue that can be fixed?

My understanding is that xyz.co./index.php is the 'real' URL, but that the index.php part is removed using the web server rewrites function in Magento backend.


texts: How to add order price total next to cart icon in header?

texts:
I need to add the totals next to the cart icon, atm the last developers made a JS script in the header that loaded the total to there, it worked poorly but now we updated to 2.3 and works even more poorly the total is most of the time at 0.00. So I want to delete this thing they made and do a proper one, the problem is, what's the best way to accomplish that?
I want something like this
But with the right value, that is the broken one but gives an idea.
Thanks in advance :D


texts: How to move Magento Coupon Block from the Cart page to the one page checkout

texts:
I would like to move the coupon code block from the cart page to the checkout page if this is possible or add an extra block on to the onepage checkout
I am using CE 1.7.


texts:
Hi I am following this flow to add products to a guest cart:

1.Create a guest cart (this will give me the cartID)-> POST: http://192.168.1.5:8100/magento/index.php/rest/V1/guest-carts

2. Get cart details-> GET: http://192.168.1.5:8100/magento/index.php/rest/V1/guest-carts/{cartID}

3. add items to cart-> POST: http://192.168.1.5:8100/magento/V1/guest-carts/19/items

BODY: {
  "cartItem": {
      "sku" : "For JAIIB Principles and Practices Of Banking (English) ",
  "qty": 1,
"quoteId":19
}
}

3rd step gives 404 not found. IS there something missing?

UPDATE:

The endpoint was wrong for the third request. But also, the first request generates the guest cartID, something like this 6089be92f22d8cd70f24d33d3588c1c2. We need this cart id to be added as a quoteId parameter for the third request. Not the "id" received in the 2nd request. If it was for a customer (not guest) then we would use the "id" instead.


texts: Does Magento 2 Enterprise aka Commerce only work if my theme is based on luma theme?

texts:
One of our subcompanies plans to upgrade to Magento 2 Commerce. Their agency claims they have to reprogramm our theme to make it based of of the Luma theme, otherwise it won't work with enterprise/commerce, as they claim. They ask for a couple of hundred thousand € to upgrade to commerce.

In my eyes this is totally bs and makes no sense. I upgraded our test site of another shop where the theme is based on luma, and I did not had to change anything in the theme or extensions, it just worked out of the box. I also switched to magento/base and the enterprise features were still present. Why should it only work with luma?


texts: How to get Product Target Path programmatically in product edit page

texts:
I'm trying to get the latest Target Path to show up in the backend of Magento in the product edit page.

I've tried everything I can think of to try to get it but I usually get NULL.

I've managed to do this to get the url key...

$productId = $this->getProductId();
$path = Mage::getResourceSingleton('catalog/product')->getAttributeRawValue($productId, 'url_key', Mage::app()->getStore());
echo $path;

Which gives 'sample-url-key', however I'm trying to get the latest Target Path - the actual path on the frontend since 2 products have this URL and this products target path is actually 'sample-url-key-14'.

I can't seem to get it to load by using

 $rewrite = Mage::getModel('core/url_rewrite')->loadByRequestPath($path)

or

$rewrite = Mage::getModel('core/url_rewrite')->loadByIdPath($path)

These both return NULL.

I've also tried another method I read about

$product_collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('entity_id', $productId)
->addUrlRewrite();
$path = $product_collection->getFirstItem()->getProductUrl();
echo $path;

This $path returns https://example.com/index.php/catalog/product/view/id/14/

I'm trying to find a way to show what the actual URL will be when viewing this product on the frontend, not what is just in the url key field since thats not accurate for duplicate/rewritten URLs.


texts: Need Related Products in bottom of product detailed page

texts:
I need to display related products below the description(bottom of the page) but in theme it is coming right side of the page(we are using Porto theme).
Could anyone please tell me how to display related products bottom of the page ?

For reference please find the attached image.

Any help will be appreciated. Thanks in advance.


texts: Countdown timer in a static block with values from admin config

texts:
I want to create a widget/static block with a countdown to the next shipment.

The shipment times should be changeable from the admin config, so I assume using PHP or PHTML are my options. (even though you can put JS code directly in a block, I believe it is not possible to call the values from config that way)

How do I make my static block execute a PHP code?

Edit

This is what I have:

app\design\frontend\default\default\template\test.phtml

<?php

echo "test";

Content of my static block:

{{block type="core/template" template="test.phtml"}}

The block doesn't display anything, what am I missing?


texts: Products showing up in layered navigation after saving them again from admin panel

texts:
This is Very weird problem i am into right now, Its a clothing store where i have uploaded 50 products for an example and they are successfully visible in both front and back end.
Now if i apply layered navigation filters on them for I.E BRAND name they are not visible under there brand name. So when i go back in admin panel and just open the product and save it without any changes and refresh the front end it is visible to all. I am not able to understand why i have to save them from back end again to see them in filters list. I am  using amasty layered navigation plugin
Please help.


texts: Magento - Meta tag automatically generated

texts:
I have a multi language store in magento 1.8ce

Meta title
Same as The title of The product

Meta desciption
I use a combination of The title, sku and description (with The html tags)

Meta keywords
The description with The html tags

How can this be automated?
And The html tags being striped from The description?
And also automatically use The description and title from The right language store.


texts: Is it possible to move customer Telephone number from billing address fields to customer create account section

texts:
Is it possible to move Telephone fields from billing address to the customer create account section?
I need to modify account creation page by directly making changes on core files.
Is that possible ? Or there are any settings available in adminpanel to fetch customer address also during registration ?

I just tried by adding

*<?php echo $this->__('Telephone') ?>

                            <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />

to persistent/customer/form/register.phtml file. Now the field is visible in create page. But its not getting saved.

Thanks in advance!


texts: How to display tax amount separately in Magento 2?

texts:
I want to configure tax rule separately but showing tax rate amount is the addition of tax rule. I want to show the tax amount separately on the checkout summary page and order summary.

Result:-

Expected output:-


texts:
I am currently to add a new tab just above add to cart button that will check the pin-code option but i failed to achieve this here is my code:-

catalog_product_view.xml

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

        <referenceContainer name="product.info.main">
            <block class="Learn\Module\Block\Catalog\Product\View\CheckDelivery" name="textblock" as="textblock" after="-" template="catalog/product/view/zipcode.phtml" />
        </referenceContainer>

</page>

vendor/module/Block/product/view/CheckDelivery.php

<?php

namespace Learn\Module\Block\Product\View;

use Magento\Framework\Registry;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class CheckDelivery extends Template
{
    protected $_registry;

    public function __construct(
        Context $context,
        Registry $registry,
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->_registry = $registry;
    }

    public function getCurrentProduct()
    {
        return $this->_registry->registry('current_product');
    }
}

vendor/module/view/frontend/templates/product/view/zipcode.phtml

<?php?>
<?php $_product = $block->getProduct() ?>

<?php echo 'My Product Name Is: ' . $_product->getName(); ?>

but this not displaying on frontend PDP any help on this


texts: API to add an option gives me an error: {"message":"%fieldName is a required field.","parameters":{"fieldName":"option"}}

texts:
I've been using the Magento API for a while now, and create products via it, as I am now using 'Option' in a dropdown I want to populate it if the option is not found....

As such, I am using the following JSON:

{
  "option": {
    "label": "14",
    "value": "14",
    "sort_order": 0,
    "is_default": true,
  }
}

Looking at the swagger document, this should be accepted! I'm posting to the following URL:

/index.php/rest/V1/products/attributes//options

I get the following error:

{"message":"%fieldName is a required field.","parameters":{"fieldName":"option"}}

But, I'm specifying option in the JSON.

Appreciate any help.


texts: Examples of front-end and back-end enrollment forms (module) (Magento 1)

texts: Examples of front-end and back-end enrollment forms (Magento 1)


texts: CMS blocks disappeared after 1.9.2.2 update

texts:
Last night my backend was auto updated to 1.9.2.2 release.
Today all my static block on CMS pages have disappeared.
They wereconfigured for all store views and I tried each of the views and they are not showing up.
However, I also use static blocks on category pages, but that is showing up fine.
Anyone else experiencing this problem? Any suggestions? Thanks!


texts: Magento 2 set child product image from URL

texts:
Magento 2.3.5 How to set child product image from URL for configurable product on the product detail page
Example -
product URL is - http://xyx.com/product.html#447=5439
dropdown is selecting according to attributes and with their values but the image is not updating
How can we show children product images based on their attributes and their values?


texts: Magento2 get applied fees (if any) in order

texts:
I'm updating an Invoicing module for Magento2,
and I'm trying to add a block of code by which I check if in the order is applied any fee for payment, shipping, and so on.
Surfing the net I found this guide: https://magecomp.com/blog/magento-2-get-order-details-with-custom-extension-attributes-using-rest-api/
I installed an external plugin that uses extension attributes to add fee to the cart, and I configured this to add a 5€ fee when I choose the 'Cash on delivery' payment method.
I'm inspecting my code but the extensions attributes are empty.
This is my OrderLoadAfter.php modified for debug reasons:
<?php
namespace Vendor\App\Observer;

use Magento\Framework\Event\ObserverInterface;

class OrderLoadAfter implements ObserverInterface
{
    protected $_orderExtension;

    public function __construct(
        \Magento\Sales\Api\Data\OrderExtension $orderExtension,
        \Vendor\App\Helper\Data $helper
        )
    {
        $this->_orderExtension = $orderExtension;
        $this->helper = $helper;
    }
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
            $order = $observer->getOrder();
            $extensionAttributes = $order->getExtensionAttributes();
            $this->helper->trace('prova :', json_encode($extensionAttributes));
            if ($extensionAttributes === null)
            {
                $extensionAttributes = $this->_orderExtension;
            }
            $deliverycharge = $order->getData('delivery_charge');
            $paymentcharge = $order->getData('payment_charge');

            $extensionAttributes->setData('delivery_charge',$deliverycharge);
            $extensionAttributes->setData('payment_charge',$paymentcharge);

            $order->setExtensionAttributes($extensionAttributes);
    }
}

Any suggestions? thanks


texts: What kind of solutions magento 2 have for global product codes except SKU like GTIN?

texts: We want to have one solution for products for unique global codes. Is there any solutions in magento for this to create GTIN codes or any other kind of Globally accepted unique codes?


texts: Magento 2 - The words "admin" and "index" appear twice in the admin URL

texts:
I have Magento 2.1.9 installed. After a futile attempt to change the admin URL, it resulted to me not gaining access to the admin panel. After resolving that issue, the admin URL displays like this: http://www.example.com.ng/admin/admin/index/index/key/fd90f73bc589242812ccb991b515dc5672066759dd7e43fb7354a11cc6d38744/

The following is what I have it the app/etc/env.php file:

return array (

  'backend' =>

  array (

    'frontName' => 'admin',

  ),

It would be great, if I can have this URL: http://www.exaple.com/admin/. But if not, I would simply opt to revert back to Magento 2 default setting. How to I achieve this?

Any insight would be much appreciated. And thanks in advance.


texts: Magento 2. Declarative schema. What is the use of the memory engine?

texts:
When creating tables using the Declarative Schema one can set the engine="" attribute value as memory.

I can't seem to find an example in the core. What is a use-case for this configuration, how does it behave and how you retrieve|store values in|from such a table?

Reference M2 Dev Docs


texts: Get real order id inside transitional emails

texts:
I need to customize some parts on the most "important" templates, like new order, status update etc, and I wanna put a link that takes the buyer directly to the order view page, which structure is:

http://mystore.com/sales/order/view/order_id/13/

So, my doubt is about how to get the real order id that ends the url, and the point is: when we use the variable {{var order.increment_id}}, system gets something like 100000013, and I need only "13", as we can see at the url above.

Is it possible to get only the real order id, without that "1000000..." ?


texts: Magento website getting some extra content in home page. How to remove that?

texts:
My website name is http://kopanaacreations.com/

In top of the website I am getting some code as " page content".
So how to remove this ?


texts:
I have Following widget and its working in cms page but now I want it to display  in phtml file

{{widget type="Magento\Catalog\Block\Widget\RecentlyViewed" uiComponent="widget_recently_viewed" page_size="10" show_attributes="name,image,price,learn_more" show_buttons="add_to_cart,add_to_compare,add_to_wishlist" template="product/widget/viewed/grid.phtml" type_name="Recently Viewed Products"}}


texts: Adding Magento coupon code in (last) step of onepage checkout

texts:
I have seen many extension on this matter. But I am looking for the clean, easy, close to core solution. Actually I am surprised that Magento/Ebay did not incorporate this simple win in a previous Magento release.

When a client goes directly to checkout (instead of via cart) - they are never confronted with a box to enter a coupon code. We have just launched a national ad - and the below article is true ... it is almost ridiculous how many emails we receive on this matter: "Hi, we would like to buy but cannot find where to enter the coupon code"

http://www.commandc.com/2014/01/29/top-reasons-for-cart-abandonment-2-difficulty-with-promo-codes/

Question: What is the best and most simple manner to add/integrate the coupon box in the steps of checkout.

many thanks in advance


texts:
I would like to get product image in reviews, can anyone help with some advice on how to do it?

Currently I have magento reviews -

And what I would like to get is like this -

Thank you a lot!


texts: I am creating a Magento 2.3 website from scratch. I am having phpcs.xml file on Magento root which contains the rules for PHPCS. These rules get triggered when the build is executed. I am confused about which rules should I use for this XML file ? Thanks in advance!


texts: Only partial order object in `sales_order_invoice_pay` observer when subtotal is zero

texts:
I have an observer for the sales_order_invoice_pay event with the following code.
public function execute(\Magento\Framework\Event\Observer $observer) {
  $order = $observer->getEvent()->getInvoice()->getOrder();
  $orderId = $order->getId();
  $incrementId = $order->getIncrementId();
}

This works fine most of the time. However, when the invoiced total is 0 (e.g. because of a coupon), then $order->getId() is empty. $incrementId is still available, but I'm not able to get the associated order either. It seems that the order is only partially set in this case.
Is it possible to get the complete order object in this case, or do I need to use another event? It is not clear to me what's the difference, because it works if the invoiced total is more than 0. Note that the "Zero Subtotal Checkout" is enabled.
Also, I don't seem to be able to print / debug these objects. All the suggested variants crash in my case (e.g. $order->debug(), $order->getData(), print_r, var_dump). Any suggestions on how to this are appreciated. I currently use the Psr logger.


texts: Multiple email attachments in Magento 2.4.1

texts:
How to send Multiple email attachments in mail Magento 2.4.1?
I tried etc\di.xml
<preference for="\Magento\Framework\Mail\Template\TransportBuilder" type="\Vendor\Module\Magento\Mail\Template\TransportBuilder" />
and in mail function:-
$transport = $this->transportBuilder->setTemplateIdentifier($template)
            ->setTemplateOptions($templateOptions)
            ->setTemplateVars(['data' => $postObject])
            ->setFrom($from)
            ->addTo($to)
            ->addAttachment($file, $name)
            ->addAttachment($file2, $name2)
            ->getTransport();


texts:
I want to move LOGO of site to center and want to add some text on the place of logo. I am able to add text from file but logo is not moving to center of container.

I have extended LUMA theme.
Screen Shot is attached as what i want achieve


texts:
I am using magento RWD theme for my project and have made some customization in the theme.

But my search is not working in it.

Few things I have tried are:-

Reindexing data.
Flush magento cache.
Went to System > Configuration > Catalog > Catalog Search and set Search Type to Combine (Like and Fulltext)
http://magento.stackexchange.com/questions/7335/magento-search-not-working

All are of no avail.
I have created a gist of required files.
https://gist.github.com/bhargavmehta/4aee123a93e07b4db60c

Can Anyone point out the error?

Demo url :- http://infigic.com/ds4u/


texts: Ignore platform requirements for sample data installation using Composer

texts:
I have a module installed via Composer where the latest master version requires PHP 7.0.x, while the updated version I'm using allows PHP 7.1.x which I have installed.

This causes a problem that on each composer update, it gives a platform requirement error. This can easily be solved by adding --ignore-platform-reqs to the command.

However, I want to install some stuff with Composer using Magento 2 CLI. Specifically, the sample data:

bin/magento sampledata:deploy

Gives the Composer error that the PHP version is incorrect.

  [my_module x.x.x] requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP vers                              ion (7.1.17) does not satisfy that requirement.

Is there a way to ignore platform requirements while deploying sample data?


texts: Files and Folders permission issue after I copied all files

texts:
I recently copied all files to other directory and it seems all files and folder permission changed so I run

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;

and I still got some issues with file or folder permission

for example, I got this error when I try upload a product image

  'Destination folder is not writable or doen't exist'

but the issue solved after I changed this folder and all sub folders permission to 777 /www/media/tmp/catalog

I also got some modules error which works from old one (I solved some after I changed to permission 777) .. so I guess I need to setup files and folder permission correctly

What folder and files I have to setup as permission 777 to prevent other issue?


texts: magento 2 Show a confirmation pop up in check out page while submitting the form

texts: can you please help me how to Show a confirmation pop up in check out page while submitting the form in magento2.


texts:
That question is generic.

I can't understand because when i include a bit of javacript code, only for testing something in magento, the following error returns:

Uncaught TypeError: Cannot read property

Anyone could give me an exemple of how a testing code should be?

This is the code I tested:

$("a").removeAttr("href");


texts: Magento computed column value in 'filter_index'

texts:
I have Magento CE 1.9.2.1 installed in my site.

Now in the Invoice grid, I have calculated "Grand Total Excl. Tax" in the Grid's collection query and also set that as a column with the below query customization:

$collection->getSelect()->join(array('invoice' => 'sales_flat_invoice'),
    'invoice.entity_id = main_table.entity_id', null)
    ->columns('(invoice.grand_total - invoice.tax_amount) AS grand_excl_tax');

It shows fine, but when I try to filter the grid by that column, then it generates error as following:

  Column not found: 1054 Unknown column 'invoice.grand_excl_tax' in
  'having clause', query was: SELECT COUNT(*) FROM
  sales_flat_invoice_grid AS main_table

My column code:

$this->addColumn('grand_excl_tax', array(
    'header' => Mage::helper('customer')->__('Amount Excl. Tax'),
    'index' => 'grand_excl_tax',
    ##'filter_index' => 'invoice.grand_excl_tax',
    'filter_condition_callback' => array($this, '_applyMyFilter'),
    'type' => 'currency',
    'align' => 'right',
    'currency' => 'order_currency_code',
));

_applyMyFilter function code:

protected function _applyMyFilter(Varien_Data_Collection_Db $collection, Mage_Adminhtml_Block_Widget_Grid_Column $column)
{
    $select = $collection->getSelect();
    $field = $column->getIndex();
    $value = $column->getFilter()->getValue();
    $select->having("invoice.grand_excl_tax=?", $value['from']);
}


texts: Why marketplace.magento.com does not show Magento 1 extensions?

texts:
I login to marketplace.magento.com and when I try to download my old purchased (free ones or not) of extensions, all of them goes to 404.
I search some extensions for Magento 1.9 and in marketplace I only find the filter of version for Magento 2 and above.
Why marketplace limit the extensions to Magento 2. And if they are exist in other places I want to know.


texts: Call to a member function getName() on a non-object product view page

texts:
I have the following code on my product view page, calling the product's containing category title :

<?php echo $_category->getName(); ?>

The issue I have is that if a user visits the page directly (i.e. not through a category) then this results in a call to non-object error. Can anyone suggest an edit so that when the user visits the product page directly the category title will not display?


texts: dropdown attribute with city instead country

texts:
is possibile to duplicate country_of_manufactor changing the source data and show region (or city) instead country?
I try to find a solution but nothing

thank you


texts: Sellers Invoice email sent again after a week for old orders in magento

texts:
We are using Magento and integrate it with Webkul marketplace extension i stopped the email sent to the sellers after order placed but we have a problem now invoice email for old orders were sent to sellers again after about 5 days.

So please if you can help us to know what are the reasons of this problem?


texts: Get all items in the compare list and filter them by visitor_id?

texts:
I want to get all items from the product compare list, but only for a certain visitor. This is what I tried:

$_productCollection = Mage::helper('catalog/product_compare')->getItemCollection();
$test = $_productCollection->addFieldToFilter('visitor_id', 2)->getItems();

This should return nothing, because in my catalog_compare_item table is no row for visitor_id 2. But it returns everything no matter if I use a filter or not. Whats the correct way of doing that?

Thanks!


texts: How can I switch database from remote to localhost

texts:
I'm running a Magento 1.8.0.0 instance that connects & functions successfully with a remote database when specified in app/etc/local.xml as the connection host.

However, when I switch to using 'localhost' as the connection host, it gives me the following error:

  Error in file: "app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'core_resource' already exists

I'm not trying to create a new installation - the site is practically complete. Deleting the table it says 'already exists' just pulls up the same error, but with a different table referenced. If I delete all 'core_...' tables, it re-creates them, then throws the same error, saying that they exist. I have tried this on Windows and Linux environments.


texts:
I will start with a strange problem that I cannot find its solution for a week.

In my template, there are a lot of kind of headers. In the most of them there is a problem.

They have a line in top in which there is the text "Free Shipping On Orders Over $59".

Is there anyone that can help me changing this?

Thanks a lot.


texts: Magento 1.9.3 Advanced Admin Login is Case Sensitive

texts:
I'm about to put a site live and I altered the following within the admin on Magento 1.9.3
System>Advanced>Admin>Security>Login is Case Sensitive to equal Yes

It kicked me out of the admin immediately and now I can't login back in using my username and password?

I have tried the following:
clearing all sessions, cache via FTP
changed the bruteforce settings in bruteforce.ini
running the following SQL to alter my password:

  UPDATE admin_user SET password = CONCAT(MD5('lemein'), ':23') WHERE
  username = 'admin';

I can't get access to the admin, is there away to reset Login is Case Sensitive back to NO via the database or code so I can get back in to the admin section?

Regards


texts: How do I import newsletter subscribers into M2?

texts: Can anyone tell me the php code to import Newsletter subscribers into M2? I have thousands of subscribers I'd like to import but don't know enough php to do it without a guide.


texts: Magento 2 - How to add custom customer attributes to sales order API?

texts:
I have created custom attributes in the customer table.
I want to add those attributes in order API. How can I do this? Thanks.


texts: How to get customer address by customer ID?

texts:
How to get customer address/billing address by customer ID? here's what I've done so far:

$customerId = $_POST["customer_id"];
$customer = $this->_customerRepository->getById($customerId);
$address = $this->_addressRepository->getByCustomerId($customerId);//error


texts: Mega-Menu dropdown doesn't display on hover?

texts:
I am using Magento 1.9x with Ultimo Theme.
There is a small issue with my mega-menu display on hover.

Dropdown Menu on hover displays fine here
But menu doesn't display on hover when I am at this page

Can you please help and propose a solution? Please guide which html/css files to edit as I am very new to Web developmen, thank you!


texts: Update price of item before adding to cart!

texts:
Just like the title says I want to change the price of the item before it hits the cart.  A customer configures an item before purchasing and different combinations equal different prices.  As a result I need to change the price of that specific (red shirt) not all red shirts!  Which should be related to quote item I believe.

I have a variable constantly updating that represents the new price while they are configuring their item.  Is there a way to pass this variable if it's stored in an ID and update the price for that quote item to the value of that ID before adding to the cart?

Let me know if there is anything I can clarify!
Similar to this:
https://stackoverflow.com/questions/30048776/how-to-change-the-price-before-adding-to-cart-in-magento

But I want to use the variable I have and set the price to that!


texts: Magento catalog price rules not working when applying condition for manufacturer

texts: I have one issue regarding catalog price rules,when i am creating any catalog price rule with the condition including manufacturer attribute in it, i am getting some catrgories 404 not found error on front end..can anyone help me regarding to this? it would be great help for me.


texts: why magento custom category layout showing product list twice

texts:
here is the custom layout xml i am using:

 <reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">

            <action method="setColumnCount"><columns>4</columns></action>

               </block>

i am seeing products twice in front end.


texts: Magento 2: Extract Currently Selected Product ID or SKU on Product Page

texts:
Assuming a system is using the default luma or blank themes, is it possible to programmatically extract the currently selected product ID or SKU from the product listing page.

In other words, I have a page state like this

Is there a way via javascript to examine what product SKU is currently selected?  If not, is there a way to extract which attributes are currently selected and back solve from there?

So far I've been able to pull out the configurable product ID, as well as the values of the selected attributes via

jQuery('#product_addtocart_form').serializeArray()

I think Magento 1 had a javascript object that would let you use the above information to pull out a simple product ID.  Maybe Magento 2 has the same?


texts: How to exclude or include specific category in catalog search result?

texts:
I need something like this diagram:

Navigate in Category A/B/C (Area1) -> on the left panel show a Search Module -> if the user search a term from that module i invoke Mage Catalogsearch module with a new parameter (eg: /catalogsearch/result/?q=term1&a=area1) and the result of the search have to be only from that categories.

If i search the term from the main search form (the top one) i see result from every category.

Is this possible? I've to extend/overwrite something? Any hint or suggestion?

I also see How to exclude specific category id in catalog search result?


texts: How to load default 4 items in a row in my website. Magento 1.7

texts: This is the website I'm working https://www.joliefi.com as you can see if you maximize your web browser by default and refresh the homepage you will notice on page load it loads 3 column and later on become 4 column when the whole page is finished loading. I don't know exactly what code to edit, if it's .css or .js. I believe some of the experts here can help. Thanks in advance.


texts: Not getting Product Attribute Value in Listing page

texts:
I have created an product attribute. initially its property "Used in Product Listing" was "No". So when i try to fetch its value in listing page it was returning an empty value. Therefore i changed its value to "Yes" then reIndexed all the Index from admin panel. But still no value is returning in the listing page. However i'm able to get its value in Product details page.

Am i missing something. ?

Please help.!

EDIT Adding code :

private function findPointsPercentage(){

        $attribute = $this->role."_fbp";

        /*
         * Get master Product using the productcode
         */

        $product =  $this->product;
        $isMasterProduct = (int)$product->getIsMasterRecord();
        if(!$isMasterProduct){
            $masterPdtCollection = Mage::getModel('catalog/product')->getCollection()
                                            ->addAttributeToFilter('is_master_record',1)
                                            ->addAttributeToFilter('productcode',$product->getProductcode());
            if($masterPdtCollection instanceof Varien_Data_Collection && $masterPdtCollection->getSize()){
                $product = $masterPdtCollection->getFirstItem();
            }

        }
        $percentage = $product->getData($attribute);
}

The variable $this->role will be based on user. In my case role is general. So value of $attribute will be 'general_fbp'.

I'm using the same function in the details page where i'm able to pull the value for general_fbp

More Details :

This function is defined in a model. And the value of the is $this->product is value from the forloop in list.phtml i.e

<?php $_i = 0; foreach ($_productCollection as $_product): ?>


texts: Loading product view in category list with AJAX

texts:
Im trying to load the product view block in the category list page with AJAX using Ajaxify.
Everything works fine the only issue being that the options box (childhtml "container1") is not loaded correctly. It does not show the options.

Does anyone have experience with this, maybe tried something like this?
I set the active product in the controller using

$productId  = (int) $this->getRequest()->getParam('product_id');
Mage::helper('catalog/product')->initProduct($productId, $this);

before rendering the layout.

I think it has something to do with the fact that the options are added to the view in an other part of the catalog.xml

[...]
<PRODUCT_TYPE_configurable translate="label" module="catalog">
   Catalog Product View (Configurable)
   <reference name="product.info">
      <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
         <block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
            Product Extra Info
         </block>
      </block>
   </reference>
   <reference name="product.info.options.wrapper">
      <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml"/>
   </reference>
</PRODUCT_TYPE_configurable>
[...]

but I'm not sure what the precise issue is.

I hope someone can point me in the right direction.

Regards,
Sander Mangel


texts: Price in layered navigation dropdown not in sequence

texts:
I am getting issue in price dropdown in layered navigation. It is displaying as below

But it should appear in order like
10 - 20
20 - 30
30 - 40
40 - 50
But as you can see, it is not at all in order and I am not getting from where I should start debugging.
Please let me know if anybody face this type of issue earlier and give some guidance in fixing this and what can be the issue?
Any help will be appreciated.


texts: Magento 2.X: Add text to customer registration form

texts:
I need to add some text on the customer registration page site/customer/account/create/

How would be the right way to do so? It's just some information text in 3 languages.


texts: 404 Not Found when viewing product detail page after customer logging in magento 2

texts: Without logging in, I can see my product on the product page, but after logging in it shows a 404. I can see the product in category view, but when I click on the product, it shows a 404.


texts: sql error while adding any products to category : M2

texts:
Something went wrong while saving the category.SQLSTATE[23000]:
  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails
  (mydb.catalog_category_product, CONSTRAINT
  CAT_CTGR_PRD_PRD_ID_SEQUENCE_PRD_SEQUENCE_VAL FOREIGN KEY
  (product_id) REFERENCES sequence_product (sequence_value) ON
  DELETE CA), query was: INSERT INTO catalog_category_product
  (category_id,product_id,position) VALUES (?, ?, ?), (?, ?, ?),
  (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)

Getting this error when trying to add any product to category.

I have already try with re-indexing, url regenerate, but still not working.


texts: Need to add new file format to upload from front end and add it to cart on Magento 1.8

texts: I have Magento 1.8. I added the custom options in the product to upload the file. That product will work like configurable product and will get added to the cart. Now i want to have the .stl file format to also get uploaded but it's not working.


texts:
I am new to Magento 2 development and stuck on changing .header .content css class.I have tried with creating a _theme.less file inside my local theme but the css is not overriding.

Can you please suggest me how to override some of the existing css inside my local theme.my theme is inherited from blank theme.

Thanks in advance to all of you


texts:
I have modified a themes account_links.phtml file.  Client has requested that it just says "Login" and if logged in it should just show "My Account".

This is the code I came up with:

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

?>

    <?php if ($customerSession->isLoggedIn()): ?>

                <a href="<?php echo $block->getUrl('customer/account') ?>">My Account

    <?php else: ?>

                <a href="<?php echo $block->getUrl('customer/account/login') ?>">Login

    <?php endif; ?>

This works if the cache is disabled but if cache is enabled then it always shows "Login".

How do I make it so that this isn't broken by the cache as site needs the cache enabled.


texts: Why the Network in Chrome Developer Tool is not showing the actual product image size?

texts:
We have the image resolution for product images as below:

For Single page - 960x1200
For Double page - 1920x1200

But when I check the Network in Chrome developer tool, it's showing the product image dimension as 560x700.

Why the Image dimension showing differently in Chrome developer tool? Is this something related to the theme?

Please reply with your thoughts.


texts: Get all Module list with status - whether it's enable or disable in Magento 2

texts:
I tried below code which gives me all modules name not specifying the status whether it is enable or disable.

  __construct

public function __construct(
\Magento\Framework\Module\ModuleList $moduleList
) {
$this->moduleList = $moduleList;
}

and here's the list

$modules = $this->moduleList->getAll();

Any idea to get module names with it's status ?


texts: Custom swatch message 'This is a required field'

texts:
Is there a way to customize the 'This is a required field' message when you don´t select a swatch option?

I want to change it to "Please select a color" and "Please select a size"

Thanks!


texts: I need to add a CSS/JS and HTML to CMS page is that even possible? I wrote a "Calculator" offline, styled it and now facing a problem. How can I add the JS/jQuery and CSS to a CMS page so I can keep my format? I'm using Magento 2.1.8


texts:
I'm developing a new magento 2 theme to an existing website. However, I have no idea how to remove the content inserted on the home page that always appears above my theme content.

I have edited the page "home" and configured the content to show a specific block of my theme.

Even if I remove the old theme folder, the old content appears.

If this content isn't on page "home", where is it?

The website is vitaringa.com.br


texts: Cannot create creditmemo for processing order

texts: So a few days ago there was a malfunction with the payment service which caused some of our orders to complete after Magento decided the payment failed. This resulted in some orders being put on Processing, but now there is no way to either cancel the order or set a creditmemo. Those options are simply not there. Has anyone encountered this before and knows how we can get these orders out of the system?


texts:
In Magento how to do you set the cost of an item in the product?

For example all the e-commerce platforms I have been working with like Volusion have a cost of item field that allows you to input how much you pay for the actual item before you sell it. I saw several post of COGS but it refers to a more complicated feature than what I am looking for.

I just want to track how much I paid for the item and how much I sold it for, the difference it the profit and be able to put it into a report.

It should be a pretty standard out of the box solution for e-commerce but have some what a challenge to get it done in Magento


texts:
Is there any way to get the url to only load one filter

Let me brief a bit.I am talking about one filter say size

I have modified the filters to select multiple items at a time

But if a user has selected 3 out of 6 filters. and now the user wants to select only 4 th filter. when user clicks on the that link across the 4 th filter all the other 3 active filters should clear and select only 4 th filter.

$_item->getUrl();
$_item->getRemoveUrl();

But all these urls will have the active filters in them. Is there any magento method for this?

Or should i do little tweeking??

I used $_item->getValueString() to get the values, but it always return the current active  plus the filter.Since the price bucket already have , i am not able to use that as delimiter while exploding. Anybody know how to change the , to some any other character in method $_item->getValueString()


texts: How to update magento 2.3.0 to 2.3.1 in cloud

texts:
Magento just released new versions of Magento Commerce and Open Source to increase product security, performance, and functionality.
One of it is the Magento Commerce and Open Source 2.3.1.

My question is, how to update Magento 2.3.0 to the latest version 2.3.1 in cloud using command line?


texts: How can I get the correct store context in the product save observer?

texts:
I'm using the observer called catalog_product_save_after to track changes to a product. Whenever this observer fires, I don't have access to the store context. I would like to get only the store contexts that the product has been modified in.

How can I get only the stores that a product has been modified for in the catalog_product_save_after event observer?


texts: Magento 2.4.1 Checkout Error - Current Customer Does Not Have An Active Cart

texts:
I have a weird issue here...
When the user tries to complete their order, they get the error seen below. However, the order completes. There's nothing alarming in the logs either. Can anyone point me in the right direction? Thank you


texts: Not seeing my wsdl.xml in /api/v2_soap?wsdl=1

texts:
EDIT: SOLVED

When I go to /api/v2_soap?wsdl=1 on my site I am not seeing what I have added in my module wsdl.xml file.

Under <xsd:complexType name="salesOrderItemEntity"> my element that I added is not being displayed.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
             name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
            <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
            <complexType name="salesOrderItemEntity">
                <all>
                    <element name="belongs_to_sku" type="xsd:string" minOccurs="0" />
                </all>
            </complexType>
        </schema>
    </types>
</definitions>

Am I misunderstanding how it works and everything is as it should be?


texts: Setting up different invoice number sequence for multi store

texts: How would I get two stores in a magento installation to start with same invoicing numbers for ex both stores should have invoive numbers starting from 100, since they both are different stores they should increment independently based on the orders in each store


texts: Varien Profiler won't turn on for front end

texts:
I am using magento 1.9.3 and I have followed all the steps to turn on Varien Profiler but when I go to the frontend it still won't show up.

1) enabled it in system -> configuration -> advanced -> developer -> debug(profiler) = enabled

2) Varien_Profiler::enable() is uncommented in index.php

3) Cleared cache

I also have https://www.mgt-commerce.com/magento-developer-toolbar.html and its worth noting that the toolbar is showing up in the admin section but not on the frontend.

I have also enabled sql profiling.

Any idea what I am missing?

UPDATE

The allowed IP's is blank for every configuration. Also, its worth noting that im using a custom theme. However, turning this theme off and going to default or rwd doesn't seem to change anything.


texts: Order is complete send order confirmation email only to "admin email address" not to customer magento 2.4.0

texts:
Email Confirmation
When order is "complete" send order confirmation email only to "admin email address"
not to customer
for every payment method.
Advance Thanks for help.


texts: Custom customer attribute not showing on frontend

texts:
I've seen this question many times, but all the solutions I've tried didn't work.
I've generated a module that creates three custom attributes in customer's information.
Since I'm new to Magento (Magento 2 especially) I've done this trough Silk
https://www.silksoftware.com/magento-module-creator/magento2-module-creator.php

I can see the three attributes fine in the backend, now I need to show them on the frontend so customers can edit them. How can I do that?

This is part of my CustomerSetup.php that defines one of the attributes.

    $customerSetup -> addAttribute(\Magento\Customer\Model\Customer::ENTITY,
        'cf',
        [
        'label' => 'Codice fiscale / p.IVA',
        'system' => 0,
        'position' => 104,
        'sort_order' =>104,
        'visible' =>  true,
        'note' => '',
        'type' => 'varchar',
        'input' => 'text',
        ]
    );

    $customerSetup -> getEavConfig() -> getAttribute('customer', 'cf')->setData('is_user_defined',1)->setData('is_required',0)->setData('default_value','')->setData('used_in_forms', ['adminhtml_customer', 'checkout_register', 'customer_account_create', 'customer_account_edit', 'adminhtml_checkout']) -> save();

Now, on edit.phtml I've tried something like

<?php $block->getCustomer()->getCf() ?>

But I can't see anything. Can anyone help? Thanks!

EDIT

I've tried the suggestion. I've edited my CustomerSetup.php with provided code and created UpgradeData.php, coping pasting InstallData.php, changing Install with Upgrade and adding a 1 to the version
(should I also change installAttributes in upgradeAttributes?)

<?php

namespace Alfabet\ClientiAttributi\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
* @codeCoverageIgnore
*/
class UpgradeData implements UpgradeDataInterface
{
/**
 * EAV setup factory
 *
 * @var EavSetupFactory
 */
private $eavSetupFactory;

/**
 * Init
 *
 * @param EavSetupFactory $eavSetupFactory
 */
public function __construct(EavSetupFactory $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 */
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    if (version_compare($context->getVersion(), '1.1.0') < 0){

            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $customerSetup = $objectManager->create('Alfabet\ClientiAttributi\Setup\CustomerSetup');
            $customerSetup->installAttributes($customerSetup);

    }

}
}

but even after running php bin/magento setup:upgrade i can't see any difference.
I've also tried changing module's version in module.xml, but it causes the site to crash.


texts:
I want to call show.phtml file which will print database records from entry.phtml file.Here is the code of my files having-

show.phtml

<?php
 $model=Mage::getModel('entry/entry')->getCollection()->getData();
 echo "
";
 print_r($model);
 exit();

 ?>

entry.phtml

HELLO

<form enctype="multipart/form-data" method="post" action="<?php echo $this->getBaseUrl().'entry/index/save' ?>">
    <input type="text" name="name" placeholder="Enter Name">
    <input type="text" name="email" placeholder="Enter Email">
    <input type="text" name="mobile" placeholder="Enter Mobile">
    <input type="submit" value="Enter">

</form>


texts: Magento 2 : How to reload minicart from Plugin?

texts:
I've written plugin for Magento\Checkout\Controller\Cart::Delete

Plugin works great and removed my desirable product from cart.

As much as I know Minicart is render with local storage. So that we have to update it with sections.xml.

But I looked into it and found that sections.xml only contains actions.

So How can I reload minicart whenever I use plugin ?

UPDATE

Thing is like I want to remove one specific product when any changes made to the cart Like, Update qty, Remove existing item from cart etc.

If any of above changes occur than let's say I've product ID-5 that product needs to be remove from automatically.

Example:

I've 4 products in cart including my free product(has price USD 0)

Item Name  -   Qty
Product-1  -   1
Product-2  -   2
Product-3  -   1
Product-4  -   1
(Free product)

If any changes to qty happens to products expect free product than free product needs to be removed and qty update will be there for that product.

PS: I've disabled qty update for free product.

What I've tried.

public function beforeExecute(
        \Magento\Checkout\Controller\Cart\Delete $subject
    )
    {
        $items = $this->checkoutSession->getQuote()->getAllVisibleItems();

        foreach ($items as $item) {
            $product = $this->product->load($item->getProductId());
            if($product->getSku() == $this->helperData->getGeneralConfig('free_product')){ // get product sku
                $this->cart->removeItem($item->getItemId())->save();

                $this->checkoutSession->getQuote()->collectTotals()->save();
            }
         }

        $customerBeforeAuthUrl = $this->url->getUrl('checkout/cart/');
        $this->responseFactory->create()->setRedirect($customerBeforeAuthUrl)->sendResponse();
        die();

    }

Above is working but minicart isn't update. along with side bar total on cart page.

  If you have any other solution rather than plugin than add your
  solution too.

Any help would be appreciated.  Thanks in Advance.


texts:
I want to completely edit the code that gets used when this is called

  {{layout handle="sales_email_order_items" order=$order
  area="frontend"}}

I've tried editing

  app\design\frontend\Mgs\ethan\Magento_Bundle\templates\email

but no changes show up, i dont have an email folder in magento_sales.

I want to remove the SKU information from the email and change the table structure.

Thanks

Simon


texts:
Getting this error
"Class 'Zend\Barcode\Barcode' not found " when I upgraded magento to 2.4.2.
It was working fine 2.3.4
This Barcode class I used in My custom Module


texts: Magento 2 : tabs positioning before/after not working

texts:
I created a custom tab extending catalog_product_view.xml and now I don't know how to order my custom tab, it's displayed the first by default. I want to be displayed after the "Details" tab for example but it's not working the after neither before instructions.

<?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.details">
            <block class="Magento\Catalog\Block\Product\View" name="custom.tab" as="custom"
                   template="Vendor_Module::product/custom.phtml" group="detailed_info" after="product.info.description">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom tab</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

What am I doing wrong? The "Details" tab is named product.info.description right?

I found some solutions, but all consist rewriting all tabs and ordering as you want, but I think it has to be better solutions because rewriting the structure, what will happen if another extension does the same?


texts:
What happens with 2 (or more) (catalog/shopping cart) price rules with the same priority?
Which one will be applied first?


texts: Exclude a specific category from breadcrumbs

texts:
Say I place a product in the following categories:

  Microsoft

and

  Software > Operating Systems > Windows

At the moment, all products when accessed through the "Windows" category display the following as a breadcrumb:

  Home > Microsoft > Product Name

I don't want this. I want to completely exclude the "Microsoft" category from showing up in the breadcrumbs. Is there a way of doing this?


texts: Get difference between model versions after save

texts: Is there any possibility to get attribute data difference between model versions? I create observer for catalog_product_save_after action, and now i want to make some changes only if attribute product_versions has changed.


texts: Trying to override magento2 product view breadcrumbs

texts:
So i tried to change the breadcrumbs.html JS template for magento 2.3 product view breadcrumbs in <themedir>/Magento_Theme/web/templates/breadcrumbs.html, but ive been stuck on this for half a day or so now, the template inheritance does not seem to be working with this file the same as it does others, since creating the file in my theme directory ive deleted static files in pub/static, my browser cache is turned off on the page, this is the replacement template :

  <% _.each(breadcrumbs, function(crumb) { %>
      <li class="breadcrumb-item <%- crumb.name %>">
          <% if (crumb.link) { %>
          <a href="<%= crumb.link %>" title="<%- crumb.title %>"><%- crumb.label %>
          <% } else if (crumb.last) { %>
          <%= crumb.label %>
          <% } else { %>
          <%= crumb.label %>
          <% } %>

  <% }); %>

which does not seem to override the default template located at app/code/Magento/Theme/view/frontend/web/templates/breadcrumbs.html

i can see the breadcrumbs are called through magento JS, im not sure quite exactly what is going on with it, this is the phtml that magento calls to create the breadcrumbs in php from Magento_Catalog/templates/product/breadcrumbs.phtml but that is just building a JSON object to pass into magento JS

    <?php
    /**
     * Copyright © Magento, Inc. All rights reserved.
     * See COPYING.txt for license details.
     */
    /** @var \Magento\Theme\Block\Html\Breadcrumbs $block */
    /** @var \Magento\Catalog\ViewModel\Product\Breadcrumbs $viewModel */
    $viewModel = $block->getData('viewModel');
    ?>

i can see in the theme directory there is a breadcrumbs file at: app/code/Magento/Theme/view/frontend/web/js/view/breadcrumbs.js
I have not tried to override this file yet, is there some reason why i can override other JS html templates but not breadcrumbs.html in magento theme

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

    define([
        'jquery',
        'mage/template',
        'Magento_Theme/js/model/breadcrumb-list',
        'text!Magento_Theme/templates/breadcrumbs.html',
        'jquery/ui'
    ], function ($, mageTemplate, breadcrumbList, tpl) {
        'use strict';

        /**
         * Breadcrumb Widget.
         */
        $.widget('mage.breadcrumbs', {

            /** @inheritdoc */
            _init: function () {
                this._super();
                this._render();
            },

            /**
             * Render breadcrumb.
             *
             * @private
             */
            _render: function () {
                var html,
                    crumbs = breadcrumbList,
                    template = mageTemplate(tpl);

                this._decorate(crumbs);

                html = template({
                    'breadcrumbs': crumbs
                });

                if (html.length) {
                    $(this.element).html(html);
                }
            },

            /**
             * Decorate list.
             *
             * @param {Array} list
             * @private
             */
            _decorate: function (list) {

                if (list.length) {
                    list[0].first = true;
                }

                if (list.length > 1) {
                    list[list.length - 1].last = true;
                }
            }
        });

        return $.mage.breadcrumbs;
    });


texts: Error - Front controller reached 100 router match iterations

texts:
Recently, I installed Blog extension from the magento connect store in my magento system. After setting up everything, I added a new blog post (http://jainculture.pavaiyacart.com/blog). This page works fine but as soon as I click on the blog page to read more, it redirects me to another url (http://jainculture.pavaiyacart.com/blog/hello-world.html) but there I get an error page. The error log says the following:

a:5:{i:0;s:52:"Front controller reached 100 router match iterations";i:1;s:469:"#0 /home/pavaiyacart/public_html/jainculture/app/code/core/Mage/Core/Controller/Varien/Front.php(180): Mage::throwException('Front controlle...')
#1 /home/pavaiyacart/public_html/jainculture/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#2 /home/pavaiyacart/public_html/jainculture/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#3 /home/pavaiyacart/public_html/jainculture/index.php(83): Mage::run('', 'store')
#4 {main}";s:3:"url";s:22:"/blog/helloworld.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}


texts: Magento 2 - Page Variation caching issue

texts:
I've been trying to setup a dynamic tax display in Magento 2.x but without any luck. What I did is to create a plugin for \Magento\Framework\App\Http\Context::getVaryString that adds selected tax display to context and it does it well but when page gets reloaded the previous content is showing, in effect it doesn't refresh the cache although context value is different.

/**
 * Set unique identifier for context
 *
 * @param \Magento\Framework\App\Http\Context $subject
 */
public function beforeGetVaryString(\Magento\Framework\App\Http\Context $subject)
{
    $subject->setValue(\Tax\Switcher\Helper\Data::CONTEXT_TAX, $this->getCurrentTaxDisplay(), $this->getDefaultTaxDisplay());
}

Any ideas what could be causing this? Do I have to refreh the cache manually, seems like a bad idea?

Appreciate your help!


texts: Magento 2.x Overcoming FPC for Prices/Private Data

texts:
So, i've a requirement to write some functionality for a B2B store which requires some aspect of dynamic pricing - or at least the price not to be cached.

The basic requirement is to write up a VAT Switcher which allows the user to toggle between tax displays.

Now, I've already wrote a block using a custom UI Component  for the dropdown itself to make sure that block is not cached. This works great, it shows the selected display or default display if untouched and is invalidated via a section declaration.

However, to move the whole core pricing blocks/templates to be not cached would be a bit of work. More than anything i'm after suggestions of how to best go about the task in hand.

I don't want any answers telling me to simply add cacheable="false" into the product price blocks, this would render any page showing price uncachable and is simply not a solution. Also, $_isScopePrivate is deprecated so again, not an option.

I've definitely toyed with the idea of rewriting the price blocks so that they are managed via UI Components, defining sections that would be invalidated upon certain requests my extension would make to trigger a change in pricing.

Any Ideas?


texts: Magento2.3.1: Transactional emails are not going to the customer

texts:
The transactional emails are not coming to the customer when the user placed an order from my website.

Website is : https://www.depoto.com/.

I have checked the SMTP configuration and it's fine.
I tried to send test email from the server. Its working fine and recipient received the email with test details. I am using GODADDY
CRON is also working fine. I checked by using this command: php bin/magento cron:run
I have already checked with the DNS for emails also. Everything is configured properly.
I checked in var/system.log and exception.log also. Didn't find any issues.


texts: Correct way to block checkout step progress due to invalid postcode

texts:
I'm trying to switch the default shipping and billing address postcode validation, where instead of showing a warning if the postcode isn't valid for the selected country, it should show an error and crucially block progression to the next step. It's straightforward enough to switch from warn to error by extending e.g the vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rates-validator.js through a mixin, however, what's less clear is the best way to block the progression to the next checkout step if the postcode validation isn't met.
I've seen some SO posts where this rule has been suggested, but it doesn't do what i'm looking for so I'm not sure if this is applicable to my use case:
<item name="validation" xsi:type="array">
      <item name="zip-range" xsi:type="string">true</item>
</item>

I've also been looking at the validateShippingInformation function in vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js but this seems like it would be quite a clunky approach if I have to override this function to explicitly try and block progression if the postcode isn't validated.
Grateful if anyone has any pointers on what the best approach is here.


texts:
If I have URL like this -

  mainpage.com/products?test_category=99

and want it to be rewritten to this

  mainpage.com/testproducts

Since magento2 URL rewrite won't take query how can this be achieved with apache and nginx rewrites?


texts: How to take price from customer and use taken price in cart?

texts:
I want to set up product in which some custom options. For this i have created custom options from product, but for price i want to take it from customer and use that price in cart.

Product like this
http://www.getrxd.com/gift-card.html

Please give some solution.


texts: Error after changing to less compilation in admin

texts:
I am pretty new to magento. After I change to client-side less compilation. I get the following.

1 exception(s):
Exception #0 (Exception): Notice: Undefined variable: template in
/var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php on line
357

Exception #0 (Exception): Notice: Undefined variable: template in
/var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php on line
357
#0
/var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php(357):
Magento\Framework\App\ErrorHandler->handler(8, 'Undefined varia...',
'/var/www/html/v...', 357, Array)
#1
/var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php(239):
Magento\Framework\View\Page\Config\Renderer-
>renderAssetHtml(Object(Magento\Framework\View\Asset\PropertyGroup))
#2
/var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php(226):
Magento\Framework\View\Page\Config\Renderer-
>renderAssetGroup(Object(Magento\Framework\View\Asset\PropertyGroup))
#3 /var/www/html/vendor/magento/module-
developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php(87):
Magento\Framework\View\Page\Config\Renderer->renderAssets(Array)
#4 /var/www/html/vendor/magento/framework/View/Page/Config/Renderer.php(99):
Magento\Developer\Model\View\Page\Config\ClientSideLessCompilation\Renderer-
>renderAssets(Array)
#5 /var/www/html/vendor/magento/framework/View/Result/Page.php(249):
Magento\Framework\View\Page\Config\Renderer->renderHeadContent()
#6 /var/www/html/vendor/magento/framework/View/Result/Layout.php(170):
Magento\Framework\View\Result\Page-
>render(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58):
Magento\Framework\View\Result\Layout-
>renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138):
Magento\Framework\View\Result\Page\Interceptor-
>___callParent('renderResult', Array)
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153):
Magento\Framework\View\Result\Page\Interceptor-
>Magento\Framework\Interception\{closure}
(Object(Magento\Framework\App\Response\Http\Interceptor))
#10
/var/www/html/generated/code/Magento/Framework/View/Result/Page/Interceptor.
php(26): Magento\Framework\View\Result\Page\Interceptor-
>___callPlugins('renderResult', Array, Array)
#11 /var/www/html/vendor/magento/framework/App/Http.php(139):
Magento\Framework\View\Result\Page\Interceptor-
>renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#12 /var/www/html/vendor/magento/framework/App/Bootstrap.php(256):
Magento\Framework\App\Http->launch()
#13 /var/www/html/pub/index.php(37): Magento\Framework\App\Bootstrap-
>run(Object(Magento\Framework\App\Http\Interceptor))
#14 {main}

Any help is appreciated.


texts: Google Tag - Event snippet for sales conversion page

texts:
I am trying to implement a Google Tag from the PPC account of my clients. This code is on my sales conversion page. I believe I am along the right lines, but I'm not confident my PHP will pull in the correct Magento data.

I wish to insert the Value of the conversion and the Transaction ID.

<!-- Event snippet for Sales conversion page -->
<?php
  $order_details = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
  $adwords_saleamt = $order_details->subtotal;
  $transaction = Mage::getModel('sales/order_payment_transaction');
  $transaction_id = $transaction->setOrderId(1);
?>
<script>
  gtag('event', 'conversion', {
  'send_to': 'XX-XXXXXXXXX/XXXXXXXXXXXXXX',
  'value': '<?php echo $adwords_saleamt; ?>',
  'currency': 'GBP',
  'transaction_id': '<?php echo $transaction_id; ?>'
});
</script>


texts: Best way to assign simple product to configurable

texts: I have 15k simple products with custom options, is there any way to convert it in to configurable products?


texts: M2: How is the bundle price in the category page defined?

texts:
I have a bundle consisting out of 2 simple products. I don't understand the price which gets displayed before I customize the bundle. How is it set up? $21 is clear, but why does it show $69 in first place?

Image 1

Image 2

After I press Customize and Add to Cart the price shows different and understandable. Below you can see my configuration, pretty standard I would think


texts: Magento 2.3: cache issue - changes are uploading with long delay

texts:
We have got installed Magento 2.3 on our production server.

Whenever we do changes to css file or other Magento files it takes ages to reflect the page on the live website. The brutal method to get the changes to be visible on the live page is to deploy static content, sometimes it helped to clear the static content, but sometimes the same doing didn't help, we have tried also to clear the preprocessed cache folder and all cache in the var folder, but it keeps regenerating with the old cache.

We are now out of ideas on why it is behaving in this way.

We have got the stagging server where we do the same changes and they are applied straight away.

Anyone would know why?

We don't have CDN and the server was checked. Our server is on Linux.