texts:
I'm trying to display the shipping costs in the top cart with the following code in sidebar.phtml:

<?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>

But on the website in the cart it returns a total of 0.00.
Does anybody know what code snippet to use to display the shipping costs in the top cart


texts:
I want to setup Magento 2 with docker and system of containers are ubuntu.

Can anyone help me, how to setup docker file?


texts: Ajax add to cart is not working after products loaded by other ajax request

texts:
I have different ajax based product carousels in my home page

The problem is ajax add to cart is not working on carousel products after products loaded through ajax


texts: Magento 2: Checkout page is loading very slow

texts:
The checkout page on our Magento 2 store is loading insanely slow. Does anyone know what causes this or how to fix this?

Customers are cancelling the orders in this last step. Really frustrating.

Thanks a lot!

UPDATE:

I provided a screenshot of the chrome waterfall. As you can see, some files are queued at 8+ seconds. Some files take over 30 seconds to load.

How can we speed this up? I checked the TTFB by enabling profiling, but that didn't show any significantly slow things. Please check screenshot.


texts: Remove 'View All Category' link from RWD theme's navigation

texts:
How do I remove the View All link from the menu in rwd theme?

This is the current set of categories I have and how I want it to show in the menu

Category 1
-- Subcategory 1
---- Subcategory 1
-- Subcategory 2

Category 2
-- Subcategory 1

When using rwd it shows the menu like this

Category 1
--View All Category 1
-- Subcategory 1
---- View All Subcategory 1
---- Subcategory
-- Subcategory 2

Category 2
-- Subcategory 1

I've tried searching but can't find a solution to this.


texts: Error 500 after upgrade to 1.9.3.6 Cronjob failing?

texts:
I just did an update from 1.9.3.1 to 1.9.3.6 with the connect manager.
Since then the website is unreachable. It sometimes works if I refresh multiple times but I get an error 500 most of the time.

I checked the log and it seems the cronjob is spamming this error:

  2017-11-02T12:37:28+00:00 ERR (3): Warning: shell_exec(): Unable to execute '/bin/sh '/html/my-shop/cron.sh' 'cron.php' -malways 1 \> /dev/null 2\>\&1 \&'  in /html/my-shop/cron.php on line 67

The host is a shared hosting solution so I am not able to see apache or nginx logs. Maybe the cronjob failing is causing the host to shutdown further connections ? How can I fix this issue?


texts: Magento2 Working site suddenly Stop working giving 500 error?

texts: I am a newbie in Magento2. I am working on a site which was working perfectly until last night. I have not committed any changes but suddenly my site is giving HttpError 500. What's wrong with my site Please refer me any solution. It's my first project in Magento2.


texts: Calling loader show/hide function in magento 2 js template

texts:
I have been creating a custom component to load cart items in Magento 2 modal widget. I have to show a loader only in a custom div tag. Here is the code of my custom js component.

 define([
        'ko',
        'uiComponent',
        'mage/url',
        'mage/storage',
    ], function (ko, Component, urlBuilder, storage) {
        'use strict';
        var self = this;
        return Component.extend({
            defaults: {
                template: 'RLTSquare_PartialCheckout/cart'
            },

            //models are defined here
            cartItemsList: ko.observableArray(),
            shouldShowLoader: ko.observable(false),

            initialize: function () {
                self = this;
                this._super();
                this.loadList();
            },
            loadList: function () {
                self.shouldShowLoader(true);
                var serviceUrl = urlBuilder.build('rltsquare_partialcheckout/cart/get');
                return storage.post(
                    serviceUrl, ''
                ).done(
                    function (response) {
                        self.cartItemsList.removeAll();
                        var list = response;
                        for (var i = 0; i < list.length; i++) {
                            self.cartItemsList.push(list[i]);
                        }
                        self.shouldShowLoader(false);
                    }
                ).fail(
                    function (response) {
                        self.shouldShowLoader(false);
                        alert(response);
                    }
                );
            }
        });
    });

Is there a way I can get magento 2 loader in my .html file or .js file?
I have already bound it to my .html template as:

I already went through mage/loader component defined in M2 but could not find its usage properly.

Is there a way I can get the absolute url of this image in js component?


texts: How to get store admin email address and name in Magento 2 in a Block?

texts:
I would like to know the equivalent Magento 2 code to give me access to display these values on the frontend.

/* Name */
Mage::getStoreConfig('trans_email/ident_sales/name');

/* Email */
Mage::getStoreConfig('trans_email/ident_sales/email');

How to get store admin email address and name in Magento 2?

I have seen this solution but I do not understand the need for a Controller/Index in order to display values such as Store Email Address.


texts: Cant access orders after migration using cart 2 cart

texts:
Yesterday i used cart 2 cart to migrate all my orders and customers from my oscommerce site to my magento site All the orders and customers appear is the appropriate grids. However when i click into my orders i get this error

Fatal error: Call to a member function getMethodInstance() on a non-object in /home/mysite/public_html/app/code/core/Mage/Sales/Model/Order.php on line 750

The line it is talking about is this

if (!$this->getPayment()->getMethodInstance()->canEdit()) {
    return false;
}

in the public function canEdit

What is causing this error? and how can i fix it?


texts:
We alway's have free shipping on all products. Is it possible that you can create a shopping cart price rule with shipping costs?

Like:

CODE: 10%OFF

Shipping Costs: 4,95


texts: Is there clue yet regarding the Magento2 solution specialist exam passing score, questions, and is there anyone who has given this exam yet?

texts:
I have been registered for Magento2 solution specialist exam. As Magento has not revealed anything regarding the passing score as it normally does for other exams, I have few questions regarding it, listing them below.

Is any one who has given this exam yet? If yes, need your valuable
input.
Is there any clue regarding the passing mark?
Is there any clue regarding the real questions?

Thanks


texts: Permission issue when installing with nginx

texts:
I have installed different Magento sites using nginx. I have 5 sites, 4 of them use php7.1 and there's one that uses php7.0.

I have created two different sites-availaible:

And both of them have sites as these one: (the other magento2.1 uses php7.0 and I comment and uncomment because I still haven't discovered how to use both at the same time -> fastcgi_backend gives error if both are working at the same time)

Now the issue comes when, once all Magento files added, installed and nginx properly set up it gives me an permissions error:

2019/03/15 11:20:31 [error] 3266#3266: *19 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught RuntimeException: Can't create directory /var/www/html/parera_dev.com/generated/code/Magento/Directory/Helper/Data/.
Class Magento\Directory\Helper\Data\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. in /var/www/html/parera_dev.com/vendor/magento/framework/Code/Generator.php:135
Stack trace:
#0 /var/www/html/parera_dev.com/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Directo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Directo...')
#2 [internal function]: spl_autoload_call('Magento\\Directo...')
#" while reading response header from upstream, client: 127.0.0.1, server: parera.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "www.parera.com"

The permissions I set up where these:

sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
sudo chown -R raul:www-data .;
sudo chmod u+x bin/magento;
sudo systemctl restart nginx.service;

With these permissions, my other 7.1 sites work, well, 1 of 4 work, the other 3 give me this exact error.

Exceptionally I added this command to try and fix it but no luck:

sudo chmod -R 777 var/*
sudo chmod -R 777 var/

I compile and deploy after but no change.

I share the nginx conf because it might be some kind of nginx conf error.

Thank you


texts: What is the meaning for area="frontend" in email_templates.xml

texts:
Today I am checking the email_templates.xml and found 1 thing which is not getting me.

<template id="customer_create_account_email_no_password_template" label="New Account Without Password" file="account_new_no_password.html" type="html" module="Magento_Customer" area="frontend"/>

Here what is the meaning of area="frontend"?

Thanks,


texts: Override comment history order in backend

texts:
I'm trying to override the template for the comment history of a order (the part next to the total of the order).

this is my path to layout .xml :

  app/code/Portail/Fournisseur/view/adminhtml/layout/sales_order_addcomment.xml

this is my path to my .tpl file

  app/code/Portail/Fournisseur/view/adminhtml/templates/order/view/history.phtml

and this is my xml file :

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root">
        <referenceBlock name="order_history">
            <action method='setTemplate'>
                <argument name='template' xsi:type='string'>Portail_Fournisseur::order/view/history.phtml</argument>
            </action>
        </referenceBlock>
    </container>
</layout>

My module is enabled, i've done this :

setup:upgrade
setup:di:compile
setup:static-content:deploy
cache:clean
cache:flush

A similar issue added /Magento_Sales, but not working either. I'm on magento 2

  app/code/Portail/Fournisseur/view/adminhtml/Magento_Sales/layout/sales_order_addcomment.xml

EDIT : I've also updated my module version


texts: Magento 1 get list of all attributes with specific value

texts:
I want to get a list of all attributes that do have the value Used in Product Listing and Used for Sorting in Product Listing set to Yes.

How can I easliy get all attributes with this value?


texts: Magento 2.3 - Mandatory Custom Section add in Create account page

texts:
I have added the checkbox to my sign-up page. but I want that every user should check the button to create an account. I have tried to make it with Javascript.
I am using Magento 2.3.0
Here is the code.

    <input type="checkbox" required id="checkBoxRequired">
        Privacy & Policy
    </input>

function validateForm() {
    var checkbox = document.getElementById("checkBoxRequired");
    if (checkbox.checked == false) {
        document.getElementById("span").innerHTML = "*Checking the checkbox";
        document.getElementById("span").style.color = "red";
        document.getElementById("span").style.display = "block";
        return false;
    }
}

I have added onsubmit="return validateForm()" inside begining form tag!


texts: how to display sidebar in both left side bar and right side bar in 3 columns page layout on category page magento 2

texts:
I select 3 columns page layout on a category listing page.

It shows sidebar in left side but it does not show sidebar on right side.

How to show sidebar in both sides?


texts: CSS inlining error: DOMXPath::query(): Invalid expression in selector in Magento 2.2.5

texts:
In magento 2.2.5, I am using the custom theme and I have used the blank theme's files. In mail I am getting this error :

  CSS inlining error: DOMXPath::query(): Invalid expression in selector
  input[type="text"] in /root/vendor/pelago/emogrifier/Classes/Emogrifier.php on line 372.

I have tried these solutions:
1. link 1


texts: Magento 2 : Intercept sending email and get the email data

texts: I'm in a process of integrating Magento 2 with email marketing, i want to stop some of the Magento 2 emails and use the email marketing instead. For example customer registration success, newsletter subscription success, and many others. Instead of creating a plugin or observer for each action, i just need one observer or plugin that can read the email template id and the email data, then stop the email from getting send. Is there a way to this?


texts: Product Page View: How can I display bundled items using multiple columns?

texts:
I have created a bundled product called 'Top Brass Buffet'. There are 4 Bundled Items: Entree1 SideDish1 Entree2 SideDish2
Each Entree can be chosen from 8 items ( radio buttons ) and each Side Dish can be chosen from 8 items ( radio buttons )

When viewing the product page, all the bundled items are listed below each other. I have also installed this extension: http://www.magentocommerce.com/magento-connect/display-bundle-product-s-bundled-items-images-2.html

This creates a long page for the user. I would like to create 4 columns instead (larger heading print would be great too ) -
Thanks in advance - please ask for more info if I have been unclear in my explanation / request

Here's the product page - thanks again !!
http://chefchipper.com/index.php/silver-service/tb-buffet.html/


texts: How to add product image in sales order grid?

texts:
How to add product image in sales order grid.
Using Observer.

I have to create custom module,
in this module i have to add product image that selected in place order.

i have to use observer for getting data. from the tables.

observer.php file

<?php

class Sigmasolve_Customordergrid_Model_Observer
{

    public function salesOrderGridCollectionLoadBefore($observer)
    {
        $collection = $observer->getOrderGridCollection();
        //$select = $collection->getSelect();
        $collection->getSelect()->joinLeft
                (array
                    ('payment' => $collection->getTable('sales/order_payment')),
                     'payment.parent_id=main_table.entity_id',
                      array('payment_method' => 'method')
                );

         $collection->join
                (array
                    ('soa' => 'sales/order_address'),
                     'soa.parent_id=main_table.entity_id and soa.address_type = "billing"',
                        array('full_address'=>'CONCAT(soa.firstname, " " , soa.lastname, ",
", soa.street, ",
", soa.city, ",
", soa.region, ",
", soa.postcode)' ),
                        null,'left'
                );

         $collection->join
                (array
                    ('soas' => 'sales/order_address'), 'soas.parent_id=main_table.entity_id and soas.address_type = "shipping"',
                        array('full_address_ship'=>'CONCAT(soas.firstname, " " , soas.lastname, ",
", soas.street, ",
", soas.city, ",
", soas.region, ",
", soas.postcode)' ),
                        null,'left'
                );

        $customer_entity = Mage::getSingleton('core/resource')->getTableName('customer_entity');
        $collection->getSelect()->join(
               $customer_entity,
               'main_table.customer_id = '.$customer_entity.'.entity_id', array('customer_email' => 'email')
               );

        $collection->getSelect()->join(
                    'sales_flat_order_item',
                    '`sales_flat_order_item`.order_id=`main_table`.entity_id',
                        array(
                              'skus' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.sku SEPARATOR ", ")'),
                              'names' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.name SEPARATOR ",")'),
                              'productids' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.product_id SEPARATOR ",")'),
                              'quantityordereds' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.qty_ordered SEPARATOR ",")'),
                              'types' => new Zend_Db_Expr('group_concat(`sales_flat_order_item`.product_type SEPARATOR ",")')
                             )
                 );

        $collection->getSelect()->group('main_table.entity_id');
    }
}


texts:
In magento 2 Suddenly i got this error on product-> catalog -> relevant product  . And round circle keep sniping in console I got this

select.js:67 Uncaught TypeError: data.some is not a function
at findFirst (select.js:67)
    at UiClass.clear (select.js:285)
    at UiClass.setInitialValue (select.js:299)
    at UiClass.setInitialValue (wrapper.js:109)
    at UiClass.initialize (abstract.js:70)
    at UiClass.initialize (wrapper.js:109)
    at UiClass._super (wrapper.js:106)
    at UiClass.initialize (select.js:119)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)


texts: while in production, deploy static files, but style changes aren't visible if we don't clean pub/static folder first

texts:
We are making style changes while working in developer mode.

Then we push the files to our server which is in production.

Then we run
$ magento setup:static-content:deploy en_GB

but the changes aren't showing.

If we first delete folders in pub/static and then run $ magento setup:static-content:deploy en_GB then the changes are showing up.

What command can we run on our production server to first clean the pub/static folder? I don't think it is safe to run rm -rf pub/static/* every time we push to production


texts:
Is there any way to implement tier pricing for different variations of a configurable product. For example, the site would have the option of buying 12 products and receive a 10% discount.
The user would be able to add from all type of variations (small, medium, large) to get to 12 and receive the discount.

Thanks


texts:
I wanted to remove the discount voucher option from my checkout. I copied checkout.xml to the folder I created for my theme overrides. I commented out the section for the discount voucher and it worked, it removed it. However, beforehand I put an exclamation on the label 'Shopping Cart' just to make sure the override was being picked up. The exclamation doesn't show! So, clearly the override is working but I can only think the shopping cart label is being pulled in from somewhere else.

My point is, is there a way to tell what file is creating any piece of html on the page? It would be so handy to point to a heading and for it to give this answer. Just like developer tools do with CSS. All the explanations I've seen so far tell people to look through the list of files to find the one you want etc. With modern tools this just seems a pain and in any case, where you have a situation like mine it would be nice to have the certainty that the code is coming from a particular place as that might be different from the place i would expect it to be coming from.

Would really appreciate any advice.


texts: How to use synonyms in Magento 2.3.2 for ElasticSearch6

texts:
Hello Magento Community,

I am new to Magento and have been tasked with updating our search from MySQL to use ElasticSearch6 (6.8).

I would like to use search synonyms but I see that there is a message on the search synonyms admin screen which indicates that Synonyms entered won't be used. Are synonyms not supported at all with the use of elasticsearch6? The ElasticSearch documentation shows that synonyms are supported.

Any guidance would be greatly appreciated.


texts: Defer parsing of javascript. Which files to edit?

texts:
gtmetrix.com suggest I defer parsing of 35 js files to increase page load time.  I have 2 questions.  I am very new to this and a little lost, so apologise in advance if I shouldn't be here asking such simple things.

Is there an easy way to know which js should be delayed for the quickest page load time.  Which will not affect functionality?  I have only identified 5 js files currently which I would be fairly confident would not affect the main page loading.
I am also unsure which file/files I should place the following code into to defer the javascript.  (I know, I have huge gaps in my knowledge)  Will the files be unique to my site, or is it the htaccess fie or a generic file that will be the same regardless of the installation.  I am completely lost.

source: http://www.feedthebot.com/pagespeed/defer-loading-javascript.html

<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "defer.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>


texts: set-cookie response header on every request causing varnish miss

texts:
I've deployed a couple of Magento installs (2.3) on dedicated servers, with Varnish.
Out of the box, everything seems to be ok, but it seems once we developers onto the installations to add themes, change settings etc, Magento starts sending set-cookie headers on every request, which in turn is causing Varnish misses on every request.
It's actually setting the cookiet wice, and there is also a form-key cookie which is being set on each page load also.
I've noticed this behaviour on two installations now, both unrelated to each other and not using the same themes.
Headers are as below, real domain obfuscated.

set-cookie: PHPSESSID=4k1dcb8sm6ha3clucobol0kc3i; expires=Wed, 03-Apr-2019 12:00:06 GMT; Max-Age=3600; path=/shop; domain=xxxxxx.com; HttpOnly
set-cookie: PHPSESSID=4k1dcb8sm6ha3clucobol0kc3i; expires=Wed, 03-Apr-2019 12:00:06 GMT; Max-Age=3600; path=/shop; domain=xxxxxx.com; HttpOnly
set-cookie: form_key=o0u78GIjo9s9ammV; expires=Wed, 03-Apr-2019 12:00:06 GMT; Max-Age=3600; path=/shop; domain=xxxxxx.com

Can anyone confirm if this is expected behaviour, or where it may be coming from?
Edit - on further reading it appears that form_key is being set for CSRF protection purposes, i'm assuming themes which have inline carts or forms are setting this.  I'd be interested in known if/how anyone is managing Varnish caching in this situation?


texts: SQL error after clearing logs: Integrity constraint violation: 1062 Duplicate entry '12953' for key 'PRIMARY'

texts:
> SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
> '12953' for key 'PRIMARY' Trace:
> #0 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/lib/Zend/Db/Statement.php(283):
> Zend_Db_Statement_Pdo->_execute(Array)
> #1 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/lib/Zend/Db/Adapter/Abstract.php(457):
> Zend_Db_Statement->execute(Array)
> #2 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/lib/Zend/Db/Adapter/Pdo/Abstract.php(230):
> Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
> #3 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/lib/Varien/Db/Adapter/Pdo/Mysql.php(281):
> Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
> #4 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/lib/Zend/Db/Adapter/Abstract.php(535):
> Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
> #5 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Log/Model/Mysql4/Visitor.php(125):
> Zend_Db_Adapter_Abstract->insert('log_visitor_inf...', Array)
> #6 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Log/Model/Mysql4/Visitor.php(79):
> Mage_Log_Model_Mysql4_Visitor->_saveVisitorInfo(Object(Mage_Log_Model_Visitor))
> #7 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(373):
> Mage_Log_Model_Mysql4_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
> #8 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Model/Abstract.php(251):
> Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor))
> #9 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Log/Model/Visitor.php(159):
> Mage_Core_Model_Abstract->save()
> #10 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Model/App.php(1239):
> Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
> #11 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/Mage.php(303):
> Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
> #12 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Controller/Varien/Action.php(454):
> Mage::dispatchEvent('controller_acti...', Array)
> #13 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Controller/Front/Action.php(45):
> Mage_Core_Controller_Varien_Action->preDispatch()
> #14 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Controller/Varien/Action.php(365):
> Mage_Core_Controller_Front_Action->preDispatch()
> #15 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(248):
> Mage_Core_Controller_Varien_Action->dispatch('index')
> #16 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/code/core/Mage/Core/Controller/Varien/Front.php(158):
> Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
> #17 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/app/Mage.php(459):
> Mage_Core_Controller_Varien_Front->dispatch()
> #18 /data01/virt27417/domeenid/www.kinkeraamat.ee/gizmos/index.php(65):
> Mage::run()
> #19 {main}


texts: Duplicated the search , but only one works properly?

texts: I'm using magento 2 , and I duplicated the search block , cause I need one for the desktop version , and one for the mobile version , so basically when I go mobile , I hide the desktop one , and opposite on desktop. My problem is that when I go mobile and click on the magnifier icon , nothing pops up , cause it takes the other one(desktop one) to pop up , but that one is hided. What I need to do the get the mobile one to pop up ?


texts:
I am using Magento 1.9.0.1

Where can i change the results section from the search results page to show only 1 column?

Now it shows search results with class="col-lg-9 col-md-9 col-sm-9 col-xs-12" and in the sidebar the layered nav (col-lg-3)

i do not need the sidebar... what and where would i need to change do i need to do it in an xml file or phtml file?

Thanks
Carlo


texts: Get Order Items details in SenderBuilder Magento 2.3

texts: I want to get product custom attribute value of order items in plugin which i am extending class -  Magento\Sales\Model\Order\Email\SenderBuilder


texts: How do I get all the fields of an order?

texts:
I'm working with Magento, I have orders and I print them like this:

echo $order->getId();
echo $order->getCustomerEmail();

My problem is that I don't know all the name of the get methods so how or where can I find all the list of get available?

My goal is export all the orders in an external database, is there a faster way to do it without pass for each field?


texts: Make merged js and css file asynchronous in magento

texts:
Hello actually is anyone know how to make the merged js and css file load asynchronous in magento

i try add

<param>defer</param>

into

<action method="addItem"><type>skin_js</type><name>js/bundle.js</name><param>defer</param></action>

for every js file,

But it's not get any impact, actually where the best way to do this

and for css i try :

<script>

  function loadCSS(href){
    var ss = window.document.createElement('link'),
        ref = window.document.getElementsByTagName('head')[0];

    ss.rel = 'stylesheet';
    ss.href = href;

    // temporarily, set media to something non-matching to ensure it'll
    // fetch without blocking render
    ss.media = 'only x';

    ref.parentNode.insertBefore(ss, ref);

    setTimeout( function(){
      // set media back to `all` so that the stylesheet applies once it loads
      ss.media = 'all';
    },0);
  }
  loadCss('things.css');
</script>
<noscript>
  <!-- Let's not assume anything -->
  <link rel="stylesheet" href="things.css">
</noscript>

but i'm not sure where to put this script since everything, i mean the js and css loaded by xml,

hope someone can figure this out

Cheers


texts:
I would like to add Google Optimize snippet on my Magento 1.9.3.1 site. I added the Optimize snippet to the site via Admin -> System -> Configuration -> General -> Design -> HTML Head. However, the snippet does not register with Google. Screenshot below. Code snippet below. How can we fix this issue?

    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-XXXXXX-1', 'auto');
    ga('require', 'GTM-XXXXX');
    ga('send', 'pageview');


texts: Use or not local.xml instead module layout.xml

texts: Is it recommended and necessary to use local.xml for layout updates instead the module layout.xml, does not create redundancy and overload in code ?


texts: making a custom installable theme package

texts: I have completed developing my custom theme in magento and now I want to make it installable or I want to package my design like other magento themes so that I can just put it in htdocs and go through the installation steps to install that custom theme. Can any body provide me a clue on how to make the custom theme installable?


texts: I need to redirect product add to cart button to checkout page instead of cart page

texts: I have BuyNow button on my product page when I clicked on button it should redirect to checkout page and product should be added to cart page, please tell me proper solution over this how to do this.


texts: Add custom Dropdown Column to Manage Product > Images Tab in Admin section

texts:
Magento 1.9.1.0 version

My Requirement is to add a new DropDown type Column in "Images" Tab in "Manage Products"Section in Admin Section.

It may be more helpful if anybody can tell me that how magento is saving images details and fetching them.

[EDITED]

I have gone through the detailed issue and find out that there is a function
getImagesJson()
in
/app/code/core/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php

which is responsible to show content in Images tab, but still want to find out that how and where magento used to save data for images, i gone through saveAction() in productController, but get unsaved JSON data of new added image.

Any one can help me that how can i get value Id of newly saved image.


texts: Two tables in a single module MAGENTO 1.9

texts:
I have two tables for my module. First table are: Main table:

value_id | website_id | name

Second table are a relationship of two tables:

value_id | entity_id

My Controller.php:

$postData = $this->getRequest()->getPost();
$ramoModel2 = Mage::getModel('integravet_associar/associacao');
if ($this->getRequest()->getParam('id') <= 0) {
    $ramoModel = Mage::getModel('integravet_associar/associar')->load($this->getRequest()->getParam('id'));
} else {
    $ramoModel = Mage::getModel('integravet_associar/associar');
}

$entitys = $postData['entity_id'];
$ramoModel->setCreatedTime(Mage::getSingleton('core/date')->gmtDate());
$ramoModel->setId_erp($postData['id_erp'])
    ->setName($postData['name'])
    ->setWebsite_id($postData['website_id'])
    ->setId()
    ->save();
$ramoModel2->setId(1)
    ->setEntity_id(1)
    ->save();
$this->_redirect('*/*/');

I can not make it work, what i'm doing wrong?


texts: How to get the value of field in backend model of another field in magento 2 admin configuration?

texts: How to get the value of field in backend model of another field in magento 2.


texts: Programmatically get Most purchased/placed products and assign it to specific category

texts:
I have a category called  Most Purchasing. Here I need to get most purchased/placed products and assign it to specific category programmatically. How can I achieve this?

Note : Here I need to get product collection based on customer purchased/ordered products.

Any help welcome with thanks.


texts:
Hello!  Currently Running Magento 1.8.1

Looking to add a ShoppingCart Icon which links to Shopping Cart / Checkout at right side of header.

Would like to know

Steps to Upload and Show ShoppingCart [RIGHT HEADER]
Steps to Resize ShoppingCart
Steps to Add/Remove Links in Quick Access Container (My account, Checkout, etc.)


texts: Static block not working in categories page

texts:
I added security patches a while ago, not sure if this is was the trouble maker or not.

I have a page that should show all the categories as thumbs and it is broken.
It is configured via template that has built in option to show any static block assigned(venusthemes) and if I assign an other block from admin it will work fine, but if I put my categories block it will not.

If I go cms-> static blocks and open my block I have
{{block type="catalog/navigation" template="catalog/navigation/categories.phtml"}}

and this is what is not working, if I type random text then I can see it, but with block I get blank page
I went to system -> permissions -> blocks and added catalog/navigation to allowed list and cleared my cache which is disabled even now but no use :(

And the same code I am using in /categories.phtml I am using also in the frontpage and it works....oh why is this like that??


texts:
I have upgraded the Magento from 2.3 to 2.4.2, Now on the product page getting an error:
Uncaught TypeError: widget.getProductId is not a function

File path: Magento_InventorySwatchesFrontendUi/js/swatch-renderer.js


texts: Magento layered navigation filter out configurable product out of stock

texts:
I have configurable products with size variations, for example small, medium and large.

In product X, the simple product for the small size is out of stock.

If I set in the layered navigation to filter by small size, this product X still shows in my product list, but when I navigate into product page, the size is not available.

I am looking for a way to filter out product X if I choose to filter for the size small.

I have looked at all the questions on Magento stackexchange suggested, but none of them seems to solve the problem.


texts: Magento 2 how to get Multi source inventory names website wise?

texts:
How to get source names website wise from multisource inventory?

I have below code for getting all names from a collection of inventory sources:

    use Magento\Inventory\Model\ResourceModel\Source\Collection as InventoryCollection;

    public function __construct(
        Context $context,
        InventoryCollection $inventoryCollection
    ){
        parent::__construct($context);
        $this->_inventoryCollection = $inventoryCollection;
    }

    public function getInventorySources()
    {
        $sourceListArr = $this->_inventoryCollection->load();
        $sourceList=[];
        $sourceAllList=[];

        $sourceList = array();
        foreach ($sourceListArr as $sourceItemName) {
            $sourceList['sourceName'] = $sourceItemName->getName();
            $sourceAllList[] = $sourceList;
        }
        return $sourceAllList;
    }

It will return all the sources, Here I want to get website wise source names,

How can I achieve this functionality?


texts: Override Third Party Module's Block File in Magento 2

texts:
I Installed Third party module under app/code folder. I created another module under same app/code directory to override the third party module.
I specified

<preference for="[Third party Name Space]\Block\File" type="[Name Space]\[My Module]\Block\File" />

in di.xml but still I cannot override the Block file of third party module.


texts: Magento: How to remove particular store from Store View Switcher

texts:
I am using Magento 1.13.

I have 4 stores and want to remove one from the Store Switcher.

Went to System > Manage Stores
I disabled store view and cleared cache and also reindexed.

But front-end store switcher, still shows the link of that disabled store.

How to remove the link from Store View Switcher?


texts:
This is my code:

$invoice = Mage::getModel('sales/order_invoice')->load($invoice_id)
$block = $this->getLayout()
        ->createBlock('mynamespace_mymodule/pdf_invoice')
        ->setData('invoice', $invoice)
        ->setTemplate('mynamespace_mymodule/pdf/invoice.phtml');
var_dump($block->toHtml());

The result of the var_dump is empty. Smth I am missing. What should I have to check ? thx

This is the xml from layout:

<mynamespace_mymodule_pdf_index>
        <reference name="content">
            <block type="mynamespace_mymodule/pdf_invoice" template ="mynamespace_mymodule/pdf_invoice.phtml" output="toHtml" name="email_invoice_pdf"/>
        </reference>
<mynamespace_mymodule_pdf_index>


texts: Ajax infinite scroll not working after filter product magento 2

texts:
This my product listing page.
http://45.56.70.30/pospaper/full-catalog/inkjet-cartridges.html

I have installed lof_ajaxscroll extension.when page loads first time then ajax infinite scroll working smoother.

When I click on any attribute like (Brother) then infinite scroll stops working.

This is my layered navigation js file code.

function callAjax(url)
{
    ajaxcall = true;
    $(".wk_layer_loader_bg").show();
    $.ajax({
        url     :   url,
        type    :   "GET",
        success :   function (data) {
            var body;
            var dom = document.createElement("html");
            dom.innerHTML = data;
            if ($(window).width() >=750) {
                if (($(data).find('.columns').length>0)) {
                    body = $(".columns", dom);
                    $(".columns").html(body.html());
                    $(".wk_layer_loader_bg").hide();
                } else {
                    $(".wk_layer_loader_bg").hide();
                    body = $("#maincontent", dom);
                    $("#maincontent").html(body.html());
                }
            } else {
                if (($(data).find('.columns').length>0)) {
                    body = $(".columns", dom);
                    $(".columns").html(body.html());
                    $(".wk_layer_loader_bg").hide();
                } else {
                    body = $("#maincontent", dom);
                    $("#maincontent").html(body.html());
                    $(".wk_layer_loader_bg").hide();
                }
            }
            $('[class=filter-options-content]').each(function () {
                $(this).css('display','none');
            });
            $(".attr_filter_input").trigger('keyup');
            window.history.pushState("object", "current title", url);
            location.reload();
        }
    })
}

Currently I am using location.reload() function.

This is my ajax infinite scroll file path.
http://45.56.70.30/pospaper/pub/static/frontend/Pospaper/theme/en_US/Lof_AjaxScroll/js/script.js

So which function I need to use for ajax infinite scroll after select an attribute.

Your help would be appreciated.


texts: How to make notification popup in admin Magento 2?

texts:
how to make notification popup in admin as a module.

Any help? Thank in advance.


texts: How to set proper permissions for Magento on server?

texts:
I'm getting lot of issues with permissions.

In magento admin panel:

  Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.

When I upload images from cms:

  The directory is not writable by server.

If anyone access this url: http://example.com/app/etc/modules/

they can see easily configuration settings.

Using FTP account: I'm not able to override any file and some times I'm not able copy any local folder to server through FTP.

My application place is /var/www/html.

with senior developer advice I execute following commands:

find <foldername> -type d -exec chmod 755 {} \;
find <foldername> -type f -exec chmod 664 {} \;

and below are present permissions for each folder.

drwxr-xr-x 12 root     root     4096 Jun 10 13:06 var
drwxr-xr-x  3 root     root     4096 Jun 10 13:06 www
drwxr-xr-x 15 www-data www-data 4096 Jun 18 07:29 html

root@web-server-magento:/var/www/html# ls -l

total 14644
-rw-rw-r--  1 www-data www-data     2834 Nov 26  2013 api.php
drwxr-xr-x  6 www-data www-data     4096 Jun 17 11:16 app
-rw-rw-r--  1 www-data www-data     2831 Nov 26  2013 cron.php
-rw-rw-r--  1 www-data www-data      717 Nov 26  2013 cron.sh
-rw-rw-r--  1 www-data www-data  2454234 Oct 26  2011 data.sql
drwxr-xr-x  8 www-data www-data     4096 Jun 11 07:21 downloader
drwxr-xr-x  3 www-data www-data     4096 Nov 26  2013 errors
-rw-rw-r--  1 www-data www-data     1150 Nov 26  2013 favicon.ico
-rw-rw-r--  1 www-data www-data     5979 Nov 26  2013 get.php
drwxr-xr-x  2 www-data www-data     4096 Nov 26  2013 includes
-rw-rw-r--  1 www-data www-data    11510 Jun 10 13:06 index1.html
-rw-rw-r--  1 www-data www-data     2642 Nov 26  2013 index.php
-rw-rw-r--  1 www-data www-data     2366 Nov 26  2013 index.php.sample
-rw-rw-r--  1 www-data www-data     6441 Nov 26  2013 install.php
drwxr-xr-x 12 www-data www-data     4096 Jun 18 06:28 js
drwxr-xr-x 13 www-data www-data     4096 Nov 26  2013 lib
-rw-rw-r--  1 www-data www-data    10421 Nov 26  2013 LICENSE_AFL.txt
-rw-rw-r--  1 www-data www-data    10679 Nov 26  2013 LICENSE.html
-rw-rw-r--  1 www-data www-data    10410 Nov 26  2013 LICENSE.txt
-rw-rw-r--  1 www-data www-data    10327 Jun 11 14:48 logo.png
-rw-rw-r--  1 www-data www-data     1319 Nov 26  2013 mage
drwxr-xr-x 13 www-data www-data     4096 Jun 18 07:29 media
-rw-rw-r--  1 www-data www-data      886 Nov 26  2013 php.ini.sample
drwxr-xr-x  2 www-data www-data     4096 Nov 26  2013 pkginfo
-rw-rw-r--  1 www-data www-data   585086 Nov 26  2013 RELEASE_NOTES.txt
drwxr-xr-x  2 www-data www-data     4096 Nov 26  2013 shell
drwxr-xr-x  5 www-data www-data     4096 Nov 26  2013 skin
drwxr-xr-x  9 www-data www-data     4096 Jun 18 06:57 var

Please comment if any extra information needed.


texts: M1 code converted to M2 code - Custom Product Attribute

texts:
I hope someone can help me out with this one.
I have Magento 1 code that needs to be converted to Magento 2 code.
The function of the code is to display values from a custom product attribute on the product page.
Each product uses one of many possible attribute sets.
The Magento 1 layout code below references the template file:
<block type="catalog/product_view" name="product.info.key_features" as="product_info_key_features" template="catalog/product/view/key-features.phtml" />

And the key-features.phtml code is:
<?php /* @var Mage_Catalog_Block_Product_View $this */ ?>
<?php
/** @var Mage_Catalog_Model_Product $_product */
/** @var Mage_Eav_Model_Entity_Attribute_Set $attributeSet */
/** @var array $attributes */
$_product       = $this->getProduct();
$attributeSetId = $_product->getAttributeSetId();
$attributeSet   = Mage::getModel('eav/entity_attribute_set')->load($attributeSetId);
$attributes     = Mage::getModel('catalog/product_attribute_api')->items($attributeSetId);
$limit          = (is_null($this->getData('limit')) ? 999 : $this->getData('limit'));
?>
<?php foreach ($attributes as $attribute) : ?>
<?php /** @var array $attribute */ ?>
<?php $attribute_code = $attribute['code']; ?>
 <?php if ($_product->getResource()->getAttribute($attribute_code)->getStoreLabel() == 'Key Features') : ?>
<?php
$key_features = $_product->getAttributeText($attribute_code);
if (!empty($key_features) && !is_array($key_features)) {
$key_features = array($key_features);
?>
<?php if (!empty($key_features) && count($key_features) > 0) : ?
<?php $key_features = array_slice($key_features, 0, $limit); ?>

<?php foreach ($key_features as $key_feature) : ?>

<?php echo $key_feature; ?>

<?php endforeach; // $key_features as $key_feature ?>

<?php break; ?>
<?php endif; // is_array($key_features) s?>
<?php endif; // $_product->getResource()->getAttribute($attribute_code)->getStoreLabel() == 'Key Features' ?>
<?php endforeach; // $attributes as $attribute ?>

So now I need the equivalent code but for Magento 2.
The custom attribute values display on the product page in the same place.
Thank you for reading and hopefully someone can help me.
Andy


texts: how to remove the "x qty" from product options in email confirmation?

texts: I want to hide the 'x' + qty in the table of the options of an item in the email order. It shown only when the qty is bigger than 1. I am using advanced custom options.


texts: Use original image, not cached, in pinterest pin it button

texts:
Is there a way to use the original image path instead of the cached one for the pinterest pinit button for products with multiple images?

domain_name/media/catalog/product/p/l/image.png

instead of:

domain_name/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/p/l/image.png

Using this line of code

$_baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
$_baseUrl."catalog/product".$_product->getImage()

loads only the base image, regardless of the selected image

This is the code used in view.phtml for loading the pin it button:

<?php
  $_pinlink['url'] = $_product->getProductUrl();
  $_pinlink['media'] = $_baseUrl."catalog/product".$_product->getImage();
  $_pinlink['description'] = $_helper->productAttribute($_product, $_product->getName(), 'name') . " - " . strip_tags($_product->getDescription());?>
  <a href="http://pinterest.com/pin/create/button/?<?php echo http_build_query($_pinlink) ?>" class="pin-it-button" count-layout="horizontal">

Thank you,


texts: Memory limit set to -1 is the good approach?

texts: In one of my custom script a memory exhaust issue showing.so i did set memory_limit to -1 now it is working fine.But is this the good approach to do this or need to increase the size of memory_limit variable on server?


texts: What controller files read the checkout page?

texts: I need to override the controller file that is used on the checkout page ?


texts: Magento2, How to create Duplicate add to cart process

texts: How to create Duplicate add to cart process in magento2.


texts:
I need to apply a 60% discount to a maximum of ONE item from Category A, or its 6 subcategories. The discount will also to apply to any number of items from Category B.

The customer can order any number of items from Category A, but the discount will only apply to ONE item from Category A (or any of its subcategories).
How do I do this?


texts: Magento 2.X: Locate setCouponcode($string) method

texts: can someone help me Locate setCouponCode($string) method in magento2 ?


texts: How can I add a Google Sitelinks Search Box to my home page?

texts:
In September Google announced an improved search box within search results for webmasters. Following their guidelines demonstrated in the Google Developers section, they state that you can implement it on your home page either using JSON-LD or Microdata.

I'm trying to implement it using Microdata on my CMS home page, here's the dummy example:

    <meta itemprop="url" content="https://www.example-petstore.com/"/>
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
        <meta itemprop="target" content="https://query.example-petstore.com/search?q={search_term_string}"/>
        <input itemprop="query-input" type="text" name="search_term_string" required/>
        <input type="submit"/>
    </form>

If you put this directly into the Content section of your CMS page, it becomes replaced with:

<form><input type="text" name="search_term_string" /> <input type="submit" /></form>

When including it with a template file, like this:

{{block type="core/template" template="namespace/sitelinkssearchbox.phtml"}}

Where the content of sitelinkssearchbox.phtml is:

    <meta itemprop="url" content="http://www.mywebsite.com/"/>
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
        <meta itemprop="target" content="http://www.mywebsite.com/catalogsearch/result/?q={search_term_string}"/>
        <input itemprop="query-input" type="text" name="search_term_string" required/>
        <input type="submit"/>
    </form>

When clicking Submit, I get forwarded to the following URL:

http://www.mywebsite.com/?search_term_string=4670k

What am I doing wrong? Is this the correct behavior - and if so, can I make this div hidden?


texts: Magento 2.3.5 Content Security Policy (CSP) data:image

texts:
Has anyone found a way to integrate the data:image/png as csp_whitelist?

[Report Only] Refused to load the image 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=' because it violates the following Content Security Policy directive: "img-src widgets.magentocommerce.com www.googleadservices.com www.google-analytics.com t.paypal.com www.paypal.com www.paypalobjects.com fpdbs.paypal.com fpdbs.sandbox.paypal.com *.vimeocdn.com s.ytimg.com *.cloudflare.com https://cdn.klarna.com *.paypal.com https://s.ytimg.com *.usercentrics.eu 'self' 'unsafe-inline'".


texts: Unable to extend class extends AbstractCollection in Grid/Collection Magento 2

texts: Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, Magento\Framework\Event\ManagerInterface $eventManager, $mainTable, $eventPrefix, $eventObject, $resourceModel, $model = 'Magento\Fr...') should be compatible with Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::_construct()


texts:
I want to add confirmation popup on place order button at final check out step.The flow is like

if (click on I understood){
   //then proceed
}
else{
   //cancel
}

I tried to add simple jquery and calling it on onclick event bit it is not working.

need help asap


texts: Magento 1 - Predict Order Id Before creating the order

texts:
I have a use-case where I need to know the order id from Magento before completing the order.

The idea is that I essentially call an API and if the API call is successful, then I proceed to complete the order, otherwise, I don't.
The problem is that when I send the API call I need to send the order id as well.

I did this:

Mage::getModel("sales/order")->getCollection()->getLastItem()->getIncrementId() + 1

This obviously does not seem safe assuming multiple people are using the shop at the same time. Is there any way to predict what the final order id will be? Or to essentially get the last order id + "reserve" that order id + 1, and not affect the orders of other people that might be logged in at the same time?


texts: How to change backend admin theme in Magento 2.0.7 +

texts: How and what to add to be able to override any of the magento-backend module templates and what is the sequence order of the custom module or theme


texts: How to shown all the category on home page in magento2

texts:
public function getShopCategories()
{
    $objectManagerr = \Magento\Framework\App\ObjectManager::getInstance();
    $categoryFactory = $objectManagerr->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');

    $categories = $categoryFactory->create()
                                  ->addAttributeToSelect('*')
                                  ->addAttributeToFilter('is_active', 1) //only active categories

    return $categories;
}


texts: Issue in sales order email template in magento2

texts: I have a custom payment method. For that, if I sent order confirmation email from back-end, means specific information like Credit card number, Auth code, etc. These parameters are coming when the email is sent from back-end but while placing that order in front end using the same credit card, means those information is not coming in email but if I sent from back-end means, it's working fine. Please help me to solve this issue.


texts: Can I Use Different Price For Google Product Schema in Magento 2.3?

texts:
I have an attribute called google_price. Can this be used in the product schema for Google instead of the price listed in Magento?
I'm looking at my final_price.phtml file and it only uses the "final_price" ID.


texts: Magento - Different amount of stock/availability on different DATES

texts:
The only thing holding me back from moving from woo to magento is because I sell tour packages with varying amount of seats/"stocks" on different days.

Magento does not offer an extension nor solution that helps me not only sell, but manage these stocks/dates.

Is there a solution / work around ?


texts: Magento2: Media image type attribue not visible in product add/edit section

texts:
I have created a Media image type product attribute section and assign this attribute in default attribute set.
But attribute not visible in product add/edit section.
Attribute created:

Assigned in default attribute set:-

Not visible in product add/edit section:-

Please help me how to use media type product attribute in magento2.


texts: Magento 2 firstname, lastname, vat_id custom validation

texts:
I want to change the validation of firstname, lastname and vat_id in checkout. I've already changed the telephone validation by changing validation item in checkout_index_index.xml like so:

<item name="telephone" xsi:type="array">
    <item name="validation" xsi:type="array">
        <item name="phoneCustom" xsi:type="string">true</item>
    </item>
</item>

The problem is that I cannot find where firstname, lastname and vat_id declarations are. In which xml should I look?


texts: How do I change "city" to "suburb" when customers are checking out?

texts: I want to change the "city" section to "suburb" please. how do I do that?


texts: Magento1.9 : How to get database tables name

texts:
I need to add some checks on database all tables for this want to get all tables name which are exist in database.

Is there any way to get all tables name from database in magento1.9?


texts: How to create an artifact from a module in app/code to transfer to vendor

texts:
I heard that there is a way to archive a module with its description in the composer as an artifact. After that, during the composer install, the module will be added automatically to the vendor.
Tell me how this can be implemented?


texts:
i want to do edit order with out creating new order but issue is that invoice is already created for that order.[I know that after invoice order can not be edit but i want to know that is there any hack or any hard trick available?]

Is there any other option available for me.

Any help will be appreciated

Thank you


texts:
I want to apply patch 8788 in my magento 1.7.0.2 but can't get it installed as it is throwing few errors such as: Hunk #1 FAILED at 154. etc..

I googled it and found that patch 1533 might be the reason of this issue.

I checked applied.patches.list file and found the patch 1533 installed:

015-04-19 17:26:58 UTC | SUPEE-1533 | EE_1.12 | v1 | _ | n/a | SUPEE-1533_EE_1.12_v1.patch
patching file app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
patching file app/code/core/Mage/Adminhtml/controllers/DashboardController.php

I think i have to remove this patch 1533 in order to install patch 8788. But I can't find any .sh file related to the patch 1533 in the root of magento. That means i can't technically remove patch 1533 from magento if i dont know where this file is located.

Can any one help me to remove patch 1533 however i don't have any idea where the .sh file is located.


texts: How to get grouped products in a product collection Magento 2

texts:
How can I get only grouped products in a product collection in Magento 2?

is there any filter for that?


texts: Magento2: Error: Call to undefined method addViewsCount()

texts:
I have got the error below:

Error: Call to undefined method Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor::addViewsCount()

<?php

namespace Vendor\Mostviewed\Block;

class Mostviewed extends \Magento\Catalog\Block\Product\AbstractProduct
{
    protected $_filesystem ;
    protected $_imageFactory;

protected $_productCollectionFactory;

public function __construct(
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Filesystem $filesystem,
    \Magento\Framework\Image\AdapterFactory $imageFactory,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    array $data = []
) {

    $this->_productCollectionFactory = $productCollectionFactory;
    parent::__construct($context, $data);
}

/**
 * Get Product Collection of MostViewed Products
 * @return mixed
 */
public function getMostViewProductCollection()
{
    $currentStoreId = $this->_storeManager->getStore()->getId();

    // get today and last 30 days time
    $today = time();
    $last = $today - (60*60*24*30);

    $from = date("Y-m-d", $last);
    $to = date("Y-m-d", $today);

    $collection = $this->_productCollectionFactory->create()
        ->addAttributeToSelect(
            '*'
        )->addViewsCount()->setStoreId(
            $currentStoreId
        )->addStoreFilter(
            $currentStoreId
        )->setPageSize(10);

    $items = $collection->getItems();
    //var_dump($items);
    return $items;
}

// pass imagename, width and height
public function resize($image, $width = null, $height = null)
{
    $absolutePath = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath('custom_module/posts/').$image;
    if (!file_exists($absolutePath)) return false;
    $imageResized = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath('resized/'.$width.'/').$image;
    if (!file_exists($imageResized)) { // Only resize image if not already exists.
        //create image factory...
        $imageResize = $this->_imageFactory->create();
        $imageResize->open($absolutePath);
        $imageResize->constrainOnly(TRUE);
        $imageResize->keepTransparency(TRUE);
        $imageResize->keepFrame(FALSE);
        $imageResize->keepAspectRatio(TRUE);
        $imageResize->resize($width,$height);
        //destination folder
        $destination = $imageResized ;
        //save image
        $imageResize->save($destination);
    }
    $resizedURL = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).'resized/'.$width.'/'.$image;
    return $resizedURL;
  }

}

I want to get the most-view product collection. Please help me in this.


texts: Magento return 404 on every page including admin

texts:
Our store returns a 404 error on every possible request.
I've tried cleaning cache, indexes, redis, etc.. But no success. (NB Cache was already turned off)
I deployed all the files (works on local) again to be sure there was no error in a file. But still there was a 404 error.
When I tried running the Dev database on the live server the site runs perfectly. So I reckon it's a database issue of the live database.

When I tried to use the core_config_data table of the dev database, the shop still doesn't function and returns a 404 error on every request. So I suppose it is not a config error as well. I tried the same with the core_url_rewrite table (lots of relation errors), but still 404 everywhere (frontend + admin).

Another very interesting fact is that the shop is still running from the Chrome browser of my colleague (but only that specific browser).


texts: How to Import Product Meta Title for Multi Store Website in magento 2

texts:
I have multi store website in Magento 2. I want to import different different Meta Title as per store by CSV file.
i am using bellow format but its not working for me.
SkU     store_view_code    meta_title


texts:
I removed the folder app/code//, removed entry from setup_module table, removed entry from config file and dropped tables from DB. But the code is still being referenced somewhere. I am unable to proceed with any command. Below is the error.

PHP Warning:  require(/chroot/home/abc/abc.com/html/vendor/composer/../payu/magento2-payment-gateway/registration.php): failed to open stream: No such file or directory in /chroot/home/abc/abc.com/html/vendor/composer/autoload_real.php on line 70
PHP Warning:  require(/chroot/home/abc/abc.com/html/vendor/composer/../payu/magento2-payment-gateway/registration.php): failed to open stream: No such file or directory in /chroot/home/abc/abc.com/html/vendor/composer/autoload_real.php on line 70
PHP Fatal error:  require(): Failed opening required '/chroot/home/abc/abc.com/html/vendor/composer/../payu/magento2-payment-gateway/registration.php' (include_path='/chroot/home/abc/abc.com/html/vendor/magento/zendframework1/library:.:/opt/nexcess/php71u/root/usr/share/pear:/opt/nexcess/php71u/root/usr/share/php:/usr/share/pear:/usr/share/php') in /chroot/home/abc/abc.com/html/vendor/composer/autoload_real.php on line 70


texts: How do I edit the drop down 'Sign In' option on One Page checkout for guest customers? - Magento 2.2

texts:
How do I edit the drop down 'Sign In' form on One Page checkout for guest customers in Magento 2.2?

I preferably want to insert a CMS block just underneath the password box.
This drop down is not a static block, it is not something I've created.


texts: Magento 2 customizable option stops my custom module working

texts:
I have created a custom module which added a phtml file just below the add to cart button. It works perfectly fine until I add a customizable option for the product. After adding customizable option, my phtml file not loading.
Here is my layout and phtml files.
Layout file at location \app\code\Custom\Module\view\frontend\layout\catalog_product_view.xml
<?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">
<head>
    <css src="Custom_Module::css/embroideries.css" />
    <link src="Custom_Module::js/embroideries.js"/>
</head>
<body>
    <referenceBlock name="product.info.addtocart">
        <block class="Custom\Module\Block\Catalog\Product\Block\Index" name="embroideries" template="Custom_Module::catalog/product/view/embroideries.phtml">
        </block>
    </referenceBlock>

</body>

My phtml file:
 app\code\PurpleCommerce\GenerateJson\view\frontend\templates\catalog\product\view\embroideries.phtml
<?php
echo "loaded";

My Block class:
\app\code\Custom\Module\Block\Catalog\Product\Block\Index.php
<?php
namespace Custom\Module\Block\Catalog\Product\Block;

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

protected $_embroideries;
protected $_varFactory;
public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Registry $registry,
    \PurpleCommerce\GenerateJson\Block\Index $embroideries,
    array $data = []

) {
    parent::__construct($context, $data);
    $this->_registry = $registry;
    $this->_embroideries = $embroideries;
}

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

please help.


texts: Magento 2 - Bulk update stock programmatically - Using database query

texts:
I have 10 products; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
I want to be able to bulk change 1, 3, 4, 5 and 9 to 0 quantity and out of stock and 2, 6, 7, 8 and 10 to 100 quantity and in stock.
How can I do this programmatically?
I have and am running magento 2.3.


texts:
Trying to translate magneto 2 Smartwave/proto theme with not luck.
When i try to add translation file to theme like lt_LT.csv add line: "You have no items in your shopping cart.","Jūs neturite prekių savo krepšelyje.",module,Magento_Checkout it translates to me in both languages, in en_US and lt_LT. Is there any way to fix this? Any help would be greatly appreciated.
I did try removing redeploying static files, translate it with inline-translate, clearing caches still no luck.


texts:
I'm working on a Magento 2 site but the postcode field does not show up on checkout.

It must be disabled somewhere in the code, but I just can't see where.
I've changed to blank theme and disabled all external modules, but still no postcode.

I've looked in the config, but can't see anything there either.

Help?


texts: How to create a new page in magento 2, i don't want to use block. When i click on "rubrique x"   it will lead me to  my URL /nameoff my page and not /my page.html


texts: Is there any option for Magento to mobile app?

texts: Am new to magento and I have developed one magento website. If I want to make the site for mobile application,how can I do that? Is there any way or option or plugins availble or else I need to do new app separately. Anyone can give me solution or any link is available to proceed for app?


texts: Magento 2 admin this webpage has a redirect loop

texts:
Magento 2 just released last night and I can't wait to work on it.
I tried installing it with all prerequisites.

Frontend works fine but when I tried to open backend it says "this webpage has a redirect loop".
Magento created "admin_r2sxkn" as a unique backend URL.
My Admin URL is http://localhost/magento2/admin_r2sxkn

As a solution, I tried deleting cache which did not work.

P.S I have xampp on mac, with latest versions of PHP and MySql, installed PHP extension incl as required.

Any help would be appreciated.


texts: Block fails on (live) server but works on localhost?

texts:
I've added a custom block to catalog/product/view.phtml using echo $this->getLayout()->createBlock('colorchart/colorchart')->setTemplate('colorchart/colorchart.phtml')->toHtml(); and it's working great on my localhost (Wamp) but I get this error when pushing to my live server:
 Fatal error: Uncaught Error: Call to a member function toHtml() on boolean in /var/www/..../template/catalog/product/view.phtml

I've also tried just using echo $this->getLayout()->createBlock('colorchart/colorchart')->toHtml(); in my view.phtml file and then the following in my block (app/code/local/MyName/ColorChart/Block/ColorChart.php):

 public function __construct()
{
    $this->setTemplate('colorchart/colorchart.phtml');
}

Again, this works perfectly on my localhost but not on the live server?
I run the same PHP & magento version on localhost and the server...?

I've mostly been working with Magento 2, so I'm a bit lost with Magento 1.9.3?
I don't think I need a controller as I'm not targeting an URL or rendering a full page?
Maybe I need to create a layout XML file, but I can't figure out where to put this for my custom block/module in Magento 1.9.3?
Here is my code:

app/code/local/MyName/ColorChart/Block/ColorChart.php:

<?php
class MyName_ColorChart_Block_ColorChart extends Mage_Core_Block_Template
{/** MyName_ColorChart_Block_ColorChart constructor. */
public function __construct()
{
    $this->setTemplate('colorchart/colorchart.phtml');
}
public function getColorProducts($id) {
   // several functions below here
}

app/code/local/MyName/ColorChart/etc/config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <MyName_ColorChart>
      <version>0.1.0</version>
    </MyName_ColorChart>
  </modules>
  <global>
    <blocks>
      <colorchart>
        <class>MyName_ColorChart_Block</class>
      </colorchart>
    </blocks>
  </global>
</config>

app/design/frontend/myname/mytheme/template/colorchart/colorchart.phtml:

<?php $mainProduct = Mage::registry('current_product'); ?>
    <?php if ($mainProduct->getColorChart()) : ?>
        <?php $selectValues = $this->allNewFunction($mainProduct->getId()); ?>

 .... a lot of HTML code and PHP logic ....

app/design/frontend/myname/mytheme/template/catalog/product/view.phtml:

//...snip...
<?php if ($_product->getShortDescription()):?>
    // code from magento here
<?php endif;?>

    <?php
    echo $this->getLayout()->createBlock('colorchart/colorchart')->toHtml();
    ?>

   <?php if (!$this->hasOptions()):?> //
// ...snip...

- - - EDIT - - -

I tried including the block using XML:

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

and removing $this->getLayout()->createBlock('colorchart/colorchart')->toHtml()from view.phtmland this also works on my localhost but not on my live server?


texts: Magento 2.2.6 readiness check says bcmath, intl not installed, php -m says they are

texts:
I am trying to install Magento CE V2.2.6 on a CentOS server.

Readiness check says bcmath and intl PHP extensions are not installed.

Hosting provider says they are. php -m lists them

$ php -m bcmath
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
intl

However they are not listed on phpinfo output, so I wrote this code snippet and...

<?php
echo "curl: ", extension_loaded ("curl") ;
echo "
";
echo "intl: ", extension_loaded ("intl") ;
echo "
";
echo "bcmath: ", extension_loaded ("bcmath") ;
echo "
";
echo "mcrypt: ", extension_loaded ("mcrypt") ;
?>

It returns -

curl: 1
intl:
bcmath:
mcrypt: 1

So I don't understand why they are installed according to php -m but they are NOT installed for php code, and neither it seems neither does my hosting provider.

I see several questions relating to this problem, but none with these exact symptoms. The replies generally say "install bcmath and intl", but here php -m says they ARE installed.

Any help would be appreciated.

I am using Chrome 69 on Ubuntu. Using ssh to run commands.

php -v
PHP 7.0.32 (cli) (built: Sep 13 2018 16:50:42) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.0, Copyright (c) 2002-2018, by ionCube Ltd.
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

I notice that the /etc/php.d folder has 2 files: 20-bcmath.ini and 20-intl.ini but these files are NOT listed in the "additional .ini files parsed" section of phpinfo.


texts: Magento Multi-Store with Domain Alias - 404 Error on 2nd Store

texts:
I am trying to configure my magento app for a multistore configuration, I followed the recommended step according to the magentocommerce tutorials below. I am getting a 404 error on the Home page for the 2nd store and cannot find where the configuration is failing. Below are my steps taken, tutorials used and troubleshooting steps taken.

Any help would be appreciated!

Steps Taken

Set Default Root Categories – Packaging
   Using same catalog - so using the same default root category
    CATALOG>MANAGE PRODUCTS>
     Enabled Website = C*****-wholesale for products
Create new Website, Store & Store Views:
  SYSTEM>MANAGE STORES>
   Website Name = C*****-wholesale
    Code = wholesale
   Store Name = Distributors
    Root Category = Packaging
   Store View - Distributors-English
    Code = dist
Create Design Change for Wholesale Theme
 SYSTEM>DESIGN>ADD DESIGN CHANGE>
   Website = C*****-wholesale
   Store = Distributors
   Store View= Distributors-English
   Design =default/modern
Changed Design template for scope - C*****-wholesale
 SYSTEM>CONFIGURATION>
   Current Config Scope: C*****-wholesale
 GENERAL>DESIGN>

disabled "Use Default"
theme>template = modern

Add instance of home page for Store View = Distributor-English
 CMS>PAGES>
      Page Title = Home
      Store View = Distributors-English
Change Base URLs - Mag Admin
SYSTEM -> CONFIGURATION -> GENERAL -> WEB
Changed base urls for scope = C*****-wholesale
 http://dist.c*****ment.com/
 https://dist.c*****ment.com/
Add environment directives to htaccess:
  SetEnvIf Host www.dist.c*****ment.com MAGE_RUN_CODE=wholesale
  SetEnvIf Host www.dist.c*****ment.com MAGE_RUN_TYPE=website
  SetEnvIf Host ^dist.c*****ment.com MAGE_RUN_CODE=wholesale
  SetEnvIf Host ^dist.c*****ment.com MAGE_RUN_TYPE=website
Reset server and magento app.

Restart server
Reindexed
SYSTEM>INDEX MANAGEMENT
Cleared caches:
SYSTEM>CACHE MANAGEMENT
Recompiled
SYSTEM>TOOLS>COMPILATION
Manually deleted cache folders var/cache

Tutorials Used

magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
  magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup
  magentocommerce.com/images/uploads/multistore_webinar-flv/multistore_webinar-flv.html

Troubleshooting

Use Web Server rewrites - Disabling didn't solve.
magento.stackexchange.com/questions/19382/magento-new-website-store-products-links-404-error
Do not use same name for Website name and Store Name.
 lotusseedsdesign.com/blog/do-not-use-the-same-name-for-website-name-and-store-name


texts: File .sql sample-data in magento 2 in folder?

texts:
I want to know the file sample-data.sql in magento 2 located in the folder?
thank you.


texts: Cron not working, No Heartbeat task found Check if cron is configured correctly

texts:
non of my scheduled talks are working, no emails are being sent.

in System> Scheduler I get an error message

No heartbeat task found. Check if cron is configured correctly

AS far as I can tell Cron is set up correctly and I'm a loss as to how to fix it

what am I doing wrong?


texts: Is there a preinstalled zoom / product magnify feature in magento 2?

texts:
I've read that it should have installed with it already working. It's not. Any suggestions how to get this going?

V 2.0.13 Luma child theme


texts: Magento2:I can't the send email to admin after Customer Register

texts:
I have create the observer when the customer is register to get notification to admin

 <event name="customer_register_success">
    <observer name="sendmail_toadmin" instance="Namespace\Module \Observer\SendMailToAdmin"/>
</event>

Observer path is app/code/Namespace/Module/Observer/SendMailToAdmin

namespace Namespace\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class SendMailToAdmin implements ObserverInterface
{

const XML_PATH_EMAIL_RECIPIENT = 'trans_email/ident_general/email';
protected $_transportBuilder;
protected $inlineTranslation;
protected $scopeConfig;
protected $storeManager;
protected $_escaper;

public function __construct(
    \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
    \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\Escaper $escaper
) {
    $this->_transportBuilder = $transportBuilder;
    $this->inlineTranslation = $inlineTranslation;
    $this->scopeConfig = $scopeConfig;
    $this->storeManager = $storeManager;
    $this->_escaper = $escaper;
}

public function execute(\Magento\Framework\Event\Observer $observer)
{

    $customer = $observer->getData('customer');

    $this->inlineTranslation->suspend();
    try
    {
        $error = false;

        $sender = [
            'name' => $this->_escaper->escapeHtml($customer->getFirstName()),
            'email' => $this->_escaper->escapeHtml($customer->getEmail()),
        ];
        $postObject = new \Magento\Framework\DataObject();
        $postObject->setData($sender);
        $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
        $transport =
            $this->_transportBuilder
            ->setTemplateIdentifier('1') // Send the ID of Email template which is created in Admin panel
            ->setTemplateOptions(
                ['area' => \Magento\Framework\App\Area::AREA_FRONTEND, // using frontend area to get the template file
                'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,]
            )
            ->setTemplateVars(['data' => $postObject])
            ->setFrom($sender)
            ->addTo($this->scopeConfig->getValue(self::XML_PATH_EMAIL_RECIPIENT, $storeScope))
            ->getTransport();
        $transport->sendMessage(); ;
        $this->inlineTranslation->resume();

    }
    catch (\Exception $e)
    {
        \Magento\Framework\App\ObjectManager::getInstance()->get('Psr\Log\LoggerInterface')->debug($e->getMessage());
    }

}
}

I got the error

  we cant save the customer

please help me


texts: Magento 2.3 REST API Json response format issue

texts:
How I can change the json format from

[
    [
        {
            "success": [
                {
                    "code": 200,
                    "response": {
                        "collection": [
                            {
                                "id": "1",
                                "title": "camp1",
                                "description": "vishal desc",
                                "start_date": "2019-02-28 00:00:00",
                                "end_date": "2001-02-22 00:00:00",
                                "status": "0",
                                "desktop_image": "images\\yourope.jpg",
                                "mobile_image": "images\\yourope.jpg",
                                "created_at": "2019-02-28 06:50:25",
                                "updated_at": "2019-03-11 10:16:48",
                                "other": null
                            }
                        ]
                    }
                }
            ]
        }
    ]
]

To this

{
   "data": [
        {
            "success": [
                {
                    "code": 200,
                    "response": {
                        "collection": [
                            {
                                "id": "1",
                                "title": "camp1",
                                "description": "vishal desc",
                                "start_date": "2019-02-28 00:00:00",
                                "end_date": "2001-02-22 00:00:00",
                                "status": "0",
                                "desktop_image": "images\\yourope.jpg",
                                "mobile_image": "images\\yourope.jpg",
                                "created_at": "2019-02-28 06:50:25",
                                "updated_at": "2019-03-11 10:16:48",
                                "other": null
                            }
                        ]
                    }
                }
            ]
        }
    ]
}


texts:
We recently started store using Magento. We are happy with jewellery and clothing. Because having some default attributes on my theme but at the same time we are facing some problem with groceries because there is no attributes. We are trying to create but we unable to do. I need some help with you guys.
Here the  details:

I need groceries products should be like bigbasket.com>> groceries
List item option automatically update by product price change by weight like bigbasket.com
How to create an attribute for grocery?


texts: Does Magento use any JS frame work such as Node.JS? if not is it possible for us to include? We would like to know bottom of this before we proceed on Magento. I did few research about it but couldn't find a black and white answer. Therefore it would be great full if I got a direct answers. I already contact the magento community 2 days ago but they did not replied me yet.


texts: How To Create Customer Custom Attribute In Magento 2.0

texts: How to create a customer custom attribute in magento2?


texts: How to send attachments in magento 1.9 mail?

texts:
$name           = $post["name"];
                $email          = $post["email"];
                $address_line_1 = $post["address"];
                $attachment     = $post["attachment"];
                $body           = "";

                $to      = "abc@gmail.com";
                $subject = "Career Inquiry";
                $body   .= "
New Career Inquiry.
";
                $body   .= "
Name : " . $name . "
";
                $body   .= "
Email  : " . $email . "
";
                $body   .= "
Address Line 1 : " . $address_line_1 . "
";
                //$body   .= "
Address Line 2 : " . $address_line_2 .   "
";
                //$body   .= "
Address Line 3 : " . $address_line_3 . "
";
                //$body   .= "
City : " . $city . "
";
                //$body   .= "
Post Code : " . $postcode . "
";
                //$body   .= "
Country : " . $country . "
";

                $body .= "
Kind regards,

example Admin
";

                $from = $email;

                $mail = Mage::getModel('core/email');
                $mail->setToName('Pranav');
                $mail->setToEmail($to);
                $mail->setBody($body);
                $mail->setSubject($subject);
                $mail->setFromEmail($from);
                $mail->setFromName($name); //Set from name
                $mail->setType('html');// YOu can use Html or text as Mail format
                //$mail->setBodyHTML($body);  // your content or message

                //add attachment start
                $base_path = Mage::getBaseDir('base');
                $uploadfile = $base_path."\media\\resume\\" . basename($_FILES['attachment']['name']);
                $filename =$_FILES['attachment']['name'];
                move_uploaded_file($_FILES['attachment']['tmp_name'], $uploadfile);
                $mail->addAttachment($uploadfile, $filename);
                //add attachment end

                $mail->send();

                Mage::getSingleton('core/session')->addSuccess('Your inquiry     was submitted and will be responded to as soon as possible. Thank you for     contacting us.');
                $this->_redirect('*/*/');
                return;


texts:
Below I have pasted my observer and config as I currently have them.

app/code/local/Skytiger/Redirection/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <models>
        <redirection>
            <class>Skytiger_Redirection_Model</class>
        </redirection>
    </models>
    <frontend>
        <events>
            <controller_action_predispatch_cms_page_view>
                <observers>
                    <skytiger_redirection>
                        <type>model</type>
                        <class>skytiger_redirection/observer</class>
                        <method>controllerActionPredispatchCmsPageView</method>
                    </skytiger_redirection>
                </observers>
            </controller_action_predispatch_cms_page_view>
        </events>
    </frontend>
</config>

app/code/local/Skytiger/Redirection/Model/Observer.php:

<?php
class Skytiger_Redirection_Model_Observer/* extends Mage_Core_Model_Observer*/
{
    public function controllerActionPredispatchCmsPageView(Varien_Event_Observer $observer)
    {
        /** code here ... */

    }
}

When trying to hit the /home page (which should then be redirected to /), I get the following error:

  Warning: include(Mage/Skytiger/Redirection/Model/Observer.php): failed
  to open stream: No such file or directory  in
  /var/www/clean.magento.181/magento/lib/Varien/Autoload.php on line 93

Now, the error tells me that it's not looking for the correct file. It says it's looking for Mage/Skytiger/Redirection/Model/Observer.php instead of for Skytiger/Redirection/Model/Observer.php, which means that there is an error in my config.xm somewhere. Need some help finding that problem, though.


texts: Login problems after Update to Magento 1.9

texts:
My customers can't log in to their account. When click log in on log-in page. It should be log in on their account but it redirects the same page.
This problem arise after upgrade magento from 1.7 to 1.9


texts: I installed Full Page Cache and now after I click on "Add to Cart" - it says: There are 0 items in your cart

texts:
Magento 1.9.1
Full Page Cache program from Amasty

Our website was often extremely slow so I installed a Full Page program from Amasty and now sometimes (like right now) when I go through the order process - after I click on the "Add to cart" button - it says:

Product XYZ was added to your shopping cart.

And right below that it says:

There are 0 items in your cart.
Grand Total $0.00
Subtotal    $0.00

I think it's a reason why we are getting only about 10% of the orders we used to get. Any ideas on how to fix this?

*After I deleted all Cache and tried to add 1 item into the cart - it says:

There are 4 items in your cart.

Meaning those are the 3 I tried to add before plus the one I added now.

ADDED ON JUNE 29TH, 2017:

As per the suggestion of Raj Purswani and the following link forwarded to me from Amasty:

https://amasty.com/docs/doku.php?id=magento_1:full_page_cache#how_to_hole_punch_cart_welcome_blocks

I did what it says in the manual for "How to hole punch cart/welcome blocks" and added the following list into the amfpc.xml file:

<google_analytics cart="1" />
<welcome cart="1" />
<top.links cart="1" />
<wishlist_link cart="1" />
<root cart="1" />
<head cart="1" />
<js_cookies cart="1" />
<optional_zip_countries cart="1" />
<addthis_smartlayers cart="1" />
<shopgate.framework.mobile cart="1" />
<fullajax_js cart="1" />
<sticky_header cart="1" />
<head.child7 cart="1" />
<home_slider cart="1" />
<global_notices cart="1" />
<custom_notice cart="1" />
<header cart="1" />
<store_currency cart="1" />
<store_language cart="1" />
<compare_link cart="1" />
<top.search cart="1" />
<top.search.content cart="1" />
<ANONYMOUS_76 cart="1" />
<minicart cart="1" />
<catalog.topnav cart="1" />
<topnav.sidemenu cart="1" />
<topnav.sidemobilemenu cart="1" />
<sidemenu cart="1" />
<mobile.nav cart="1" />
<bml.center.logo cart="1" />
<home_slider cart="1" />
<ANONYMOUS_77 cart="1" />
<global_messages cart="1" />
<ajaxcart_mask cart="1" />
<page_content_heading cart="1" />
<messages cart="1" />
<ANONYMOUS_78 cart="1" />
<cart_sidebar cart="1" />
<catalog.compare.sidebar cart="1" />
<right.reports.product.viewed cart="1" />
<global_cookie_notice cart="1" />
<sale.reorder.sidebar cart="1" />

Does that suppose to exclude those elements? I haven't been able to verify whether that made any difference because right after the change - the problem was the same so I had to delete all Cache from within the Admin panel. And every time I did that in the past - the problem just went away.

I also started to have another problem and that is when customers tried to add a product to the shopping cart - it would add a completely different product! (I guess this is what simonthesorcerer says below) Any suggestions on how to fix that?


texts: Magento 2.1 Update Product Stock in Cron Job

texts: I need to be able to programmatically update product stock in my Cron job.  I have an array that contains both the SKU of the product needing updating and the Stock value of that product.  How can I select a product by SKU and then update the stock?


texts: Moving quick search below welcome message in header.phtml

texts:
I am currently trying to move the quick search below my welcome message on all pages.  I've gone to my theme/template/page/html/header.phtml and moved the welcome-msg above the 'topSearch', but it is not changing anything.  I've looked at theme/layout/page.xml but I can't figure out if there's anything that I can change there to make it work.  I'm new to PHP and XML so any help would be appreciated.

Here is my page.xml

        <block type="page/html_header" name="header" as="header">
            <block type="page/template_links" name="top.links" as="topLinks"/>
            <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
            <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                Navigation Bar
                <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
            </block>
            <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                Page Header
                <action method="setElementClass"><value>top-container</value></action>
            </block>
        </block>

And my header.phtml

        <?php if ($this->getIsHomePage()):?>

<?php echo $this->getLogoAlt() ?><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />

        <?php else:?>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><?php echo $this->getLogoAlt() ?><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
        <?php endif?>

<?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?>

            <?php echo $this->getChildHtml('topSearch') ?>
            <?php echo $this->getChildHtml('topLinks') ?>
            <?php echo $this->getChildHtml('store_language') ?>

1(888)641-7988

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

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

Any help would be greatly appreciated.


texts:
We are using Magento 2 and have international delivery available on our site.

However lets say, the customer wants delivery to Australia, the UK price is still shown present to the customer.

How do I hide a delivery option, so the customer can not see the UK delivery price when selecting a different country.

Thanks


texts: Layered Navigation is not coming in sidebar

texts:
I am using a theme on category page but, no Layered Navigation is coming.

I installed FME Layered Navigation which worked on many themes but not in this one.

I commented the active theme folder in template then FME Layered Navigation is coming.

When i comment layout folder then it comes as shown in picture.
In page.xml what  must be there to show layered navigation in sidebar.

Its 2coloumn-left

If i replace the layout folder with fresh folder then its shown, but i did many changes in this case i have to do those changes again


texts: Magento Page creation without hitting URL and save that Page in Varnish Cache

texts: Can a Magento 2.x Page be created without hitting URL(I mean without CURL Request) and save that Page in Varnish Cache? If possible then the Cache Warming can be faster. Now it takes a lot of time.


texts: How to call a phtml file in all pages (frontend & backend) using custom magento module?

texts:
I am using magento 2.4.1
I have created a basic module,
I am trying to call a phtml file in all pages.
I am using default.xml file (Separate for each scope)
& calling a phtml file.
But there is some issue in default.xml file.
Can you please post proper code for default.xml for calling phtml in it ?
Thankyou


texts: I have below sql query, how do I turn this to Magento get data method to retrieve data?

texts:
I have below sql query, how do I turn this to Magento get data method (collection?) to retrieve data (not using ObjectManager)? Please help.
public function  getNewCustomer()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $query = "SELECT entity_id FROM customer_entity WHERE created_at >=  (NOW() - INTERVAL 10 DAY);";
    $result = $connection->fetchAll($query);

    return $result;
}


texts:
I'm new to Magento and when first installed on my localhost there was no errors, but yesterday setting up second project of Magento on my localhost the following errors appeared:

[2019-12-20 13:17:30] main.CRITICAL: Invalid template file: 'F:/xampp/htdocs/magento2/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2019-12-20 13:17:30] main.CRITICAL: Invalid template file: 'F:/xampp/htdocs/magento2/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []

Please help that how can I resolved it?


texts: Custom product price for 1 item of many the same product in cart Magento 1.9

texts:
I have a custom module to create orders. And in the module, can customize a product value. But, i have a problem. For the example, If I add 10 qtd of the product and apply a custom price in 1 product only, the magento applies the discount in all the same products and the value is wrong. The code that apply the discount is as follows:
//Calculating total products
foreach ($array_produtos as $produto_id) {
    $product_loaded = Mage::getModel('catalog/product')->load($produto_id);
    $preco_custom_produto = $product_loaded->getPrice() - $desconto_vlr_custom;
    $preco_total_produtos = $preco_total_produtos + $preco_custom_produto;
}
$total_produtos = count($array_produtos);
$posicao_array_produto = 0;
foreach ($array_produtos as $produto){
    $posicao_array_produto++;
    $p = Mage::getModel('catalog/product')->load($produto);

    if($p->getTypeId()=="simple"){
        $quoteItem = $quote->addProduct($p, new Varien_Object(array('qty' => 1)));

        $preco_custom = $quoteItem->getProduct()->getPrice() - $desconto_vlr_custom;
        $quoteItem->setCustomPrice($preco_custom);
        $quoteItem->setOriginalCustomPrice($preco_custom);

        //IF is the last product in the cart
        if ($posicao_array_produto == $total_produtos) {
            if ($vlr_custom != $preco_total_produtos) {
                //Calculating the difference
                $diferenca = number_format($vlr_custom - $preco_total_produtos,2);

                $preco_custom_corrigido = $preco_custom + $diferenca;
                $quoteItem->setCustomPrice($preco_custom_corrigido);
                $quoteItem->setOriginalCustomPrice($preco_custom_corrigido);
            }
        }
        $quoteItem->getProduct()->setIsSuperMode(true);
    }else{

        $produtos_bundle = $p->getTypeInstance(true)->getSelectionsCollection($p->getTypeInstance(true)->getOptionsIds($p), $p);

        $options_bundle = array();

        foreach($produtos_bundle as $produto_bundle){
            $options_bundle[$produto_bundle->option_id][] = $produto_bundle->selection_id;
        }

        $item_quote = $quote->addProduct($p, new Varien_Object(array('qty' => 1, 'bundle_option' => $options_bundle, 'related_product' => "")));

        $item_quote = ( $item_quote->getParentItem() ? $item_quote->getParentItem() : $item_quote );

        $preco_custom = $item_quote->getProduct()->getPrice() - $desconto_vlr_custom;
        $item_quote->setCustomPrice($preco_custom);
        $item_quote->setOriginalCustomPrice($preco_custom);

        //IF is the last product in the cart
        if ($posicao_array_produto == $total_produtos) {
            if ($vlr_custom != $preco_total_produtos) {
                //Calculating the difference
                $diferenca = number_format($vlr_custom - $preco_total_produtos,2);

                $preco_custom_corrigido = $preco_custom + $diferenca;
                $item_quote->setCustomPrice($preco_custom_corrigido);
                $item_quote->setOriginalCustomPrice($preco_custom_corrigido);
            }
        }
        $item_quote->getProduct()->setIsSuperMode(true);
    }
}

In this case, I need to apply in some situations, the discount in 1 product only in the cart, not in all of the same.
Note: $array_produtos is an array that have ids of the products that will add on cart; $vlr_custom have a value of the custom order value that the user needs and $desconto_vlr_custom have the value that needs to discount in the product.


texts: Add to cart not redirecting to cart page

texts: I Am using my custom design , it is not been redirecting the add to cart button to Cart page. is there any function or url i need to set in admin panel ?


texts:
I would like to exclude a number of child categories from my catalogue collection in order to amend a mega menu I am creating.

I have tried the following:

$subAcc = $acc->getChildrenCategories();
$subAcc->addAttributeToFilter('category_id', array('nin' => array(321, 322)));

But this errors. What is the correct way to do this?


texts: Unable to set up cron job on GoDaddy hosting

texts: I am trying to set up my indexer using GoDaddy hosting with cPanel. The indexer is not refreshed and asks me to check that the cron job is running. How do I set up the cron job?


texts: How to automatically cancel pending orders after a specified amount of time?

texts:
We found that we sometimes run out of stock/inventory due to orders pending payment. In our case, when the customer cancels PayPal payment, or doesn't pay through Bank Deposit.

Is there a way to "release" those stock/inventory after a specified amount of time, automatically, without us having to check regularly for orders pending payment and cancelling manually?

We realize there are extensions that do this, but was wondering if there's a built-in way in Magento to do it.


texts: add jquery to parameters in custom widget type in magento2

texts:
I have created a custom widget type using below code

<widget id="test" class="Namespace\Modulename\Block\Widget\Test">
    Namespace - Test
    <description>Test Block</description>
    <parameters>
        <parameter name="Test_title" xsi:type="text"  visible="true" sort_order="1" >
            Test Title
        </parameter>
        <parameter name="Test_url" required="true" xsi:type="text"  visible="true" sort_order="1" >
            Test URL
            <depends>
                <parameter name="Test_type" value="0"/>
            </depends>
        </parameter>
        <parameter name="Test_new" required="true" xsi:type="text"  visible="true" sort_order="1" >
            Paste anything
            <depends>
                <parameter name="Test_type" value="1"/>
            </depends>
        </parameter>
        <parameter name="Test_description" required="true" xsi:type="text"  visible="true" sort_order="1" >
            Test Description
        </parameter>
    </parameters>
</widget>

Now i want to add some jquery code to parameter Test_new to validate user data or something similar. How i can do that.

Or how i can add a button attach to that parameter Test_new to open a text field or text area and add some jquery code to that functionality?

Any suggestion or reference would be helpful!!