texts:
how to call cms page in anchor tag in phtml file any one help me I used below code but it  does not work.

     <a href="<?php echo $this->getUrl('wrapper'); ?>">wrapper


texts: Page builder product carousel hide on changing the screen size issue Magento 2.3

texts: On my website I added product carousel using page builder. But there is an issue, when I change the screen desktop to ipad or iphone and iphone to desktop in browser. Product Slider of home page gets hide.


texts: Magento 2.3: How can I change the language of the tiny editor?

texts:
I am currently trying to type with a Spanish keyboard and it does not allow me to type accents.

As I show in the image, when I try to write an accent, it adds the character without first writing the letter.
I have looked everywhere for settings and there is nothing.


texts: Displaying Bundle products in my own custom design in magento 1.x

texts: How to display a bundle product in my design. Just need to display using the core function. Bundled product is more challenging.


texts: Magento 2 programmatically online refund

texts:
I'm trying to make online refund using this method:

// \Magento\Sales\Model\Order\Invoice $_invoiceModel
// \Magento\Sales\Model\Order\CreditmemoFactory $_creditmemoFactory
// \Magento\Sales\Model\Service\CreditmemoService $_creditmemoService

$invoiceobj = $this->_invoiceModel->loadByIncrementId('000000073');
$creditmemoObject = $this->_creditmemoFactory->createByOrder($order);
$creditmemoObject->setInvoice($invoiceobj);
$this->_creditmemoService->refund($creditmemoObject);

And I'm receiving following error:

We don't have enough information to save the parent transaction ID.


texts: Am using Magento 2.3.5, I have created two Cart rules, one is 1+1 offer another one is 2+2 Offer, When I added these products in cart discount calculation is wrong. check the attached image. in this scenario discount total should be 89.67, and Buy 1 Get 1 discount total should be 19.67,  But the order total summary showing Total discount is 159.67 and But 1 Get 1 Discount is 89.67. we should show the exact discount totals. How can i fix this problem.


texts: Study Guide/ Topics for Magento 2 Certified Associate Developer exam

texts:
I am planning to attempt Magento 2 Certified Associate Developer exam, But unable to fine any Study Guide or Study Material.

Please suggest if someone have any idea regarding this.


texts: I want to reach out to and network with Magento professionals. Where can I do that?

texts:
The Magento community in my area is less than thriving. Is there a place I can network with other professionals and grow my knowledge base.

Thanks a lot.


texts: how to change the shpping cart icon in magento 2 and make to change color on mousehover

texts:
I wanted to change the shopping cart icon in magento 2 and make to change color on mouse hover. I found the block name  I dont find how to change the image icon in the block.

thanks in advance


texts:
I am using this below code to add a product to the cart from a phtml file:

<form data-role="tocart-form" action="<?php echo $addToCartUrl; ?>" method="post">
    <?php echo $block->getBlockHtml('formkey')?>

        <button type="submit" title="Add to Cart" class="action tocart primary">
            Add to Cart
        </button>

 </form>

But at $addToCartUrl, I receive some extra characters like this:

  www.webi.com/checkout/cart/add/uenc/aHR0cHM6Ly93d3cudGliby50di8yMDE4OS9ibGk%2C/product/2/

The part before /product/2/ adds these characters: %2C and in this way, I can't add the product to cart!


texts: its about a plugin construction question`

texts:
sir please can you provide me steps and files about
how to create a plugin in which

i can increament quantiuty of product b y 1

if there is qty is default 1 and i add to cart the view cart page show me total qty 2

mans increment by 1 in view cart

but max of 5 product i can increase for any particular product

please sir can you help me.. please


texts: Possible orphans in cataloginventory_stock_item?

texts:
Should every record in cataloginventory_stock_item link to a record in catalog_product_entity?  When I run the following SQL I get 15,874 products in cataloginventory_stock_item that do not match a record in catalog_product_entity.

select count(*) from cataloginventory_stock_item where product_id NOT IN (select entity_id from catalog_product_entity);


texts: coupon code should apply once we cancel the order

texts:
If we applied coupon code and completed order.

Once we cancel the order, then coupon code should become applicable again, but it can't be used anymore. Please help me, it's strange default Magento behavior.

Please help me soon.


texts: Add second price calculation factor to cart item

texts:
I need to add a second price factor to the cart.

Besides amount/quantity I have to add a second (integer) value that comes from a custom option, so the calculation isn't

base price x amount

but

base price x "custom option value" x amount

Background: Custom option is "number of days" for a rentable product.

Note: I do not need to incorporate anything after the checkout process, since the Magento install is configured to act as "inquiry only" system (no invoicing and such).

I presume there is some event I can observe for doing so?


texts:
Wherever I can, I like to develop software following a Test Driven Development (TDD) approach. Usually, in PHP that means using PHPUnit.

Ideally, I would like to write both fine and coarse-grained tests. Unittests to help guide the design and quality of my code, integration tests to make sure it all hangs together and high-level outside in acceptance tests to make sure I actually deliver what my customer has asked me to deliver.

Are there any test frameworks out there tailored for Magento which facilitate TDD?


texts: Magento 2 How to override sales.order.items.renderers block in sales_order_view page?

texts:
I am trying to override sales_order_view.xml file sales.order.items.renderers block, I have followed below mentioned code but not worked:

overriding sales_order_view.xml in custom module :

Method 1 :

 <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="order_items">
                <block class="Magento\Framework\View\Element\RendererList" name="sales.order.items.renderers" as="renderer.list" template="Vendor_Namespace::order/items/renderer/default.phtml"/>
            </referenceBlock>

        </body>
    </page>

Method 2 :

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="sales.order.items.renderers">
               <arguments>
                    <argument name="template" xsi:type="string">Vendor_Namespace::order/items/renderer/default.phtml</argument>
                </arguments>
            </referenceBlock>
        </body>
    </page>

Method 3 :

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="sales.order.items.renderers">
                <action method="setTemplate">
                   <argument name="template" xsi:type="string">Vendor_Namespace::order/items/renderer/default.phtml</argument>
               </action>
            </referenceBlock>
        </body>
    </page>

and I created order/items.renderer/default.phtml file in custom module, but it is not overriding.

Any help will appreciate.


texts: What are the different Magento 2 cron jobs doing?

texts:
Magento 2 specifies three cron jobs to be run:

* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log
* * * * * <path to php binary> <magento install dir>/update/cron.php >> <magento install dir>/var/log/update.cron.log
* * * * * <path to php binary> <magento install dir>/bin/magento setup:cron:run >> <magento install dir>/var/log/setup.cron.log

https://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

What are each of these three cron jobs doing, specifically?


texts:
I am new to Magento. I am facing problem while using Customweb subscription extension. so there is an error in file causing by this extension. what I want to know is, what is this code doing?

$quote = Mage::getSingleton('checkout/cart')->getQuote();
...
$subscriptionPlan = Mage::getModel('customweb_subscription/cartPlan')->loadByIndex($index);
...
$quote->setSubscriptionPlan($subscriptionPlan)->collectTotals()->save();

I am trying to search "setSubscriptionPlan" in every files in the Customweb Subscription folder, but can't find this method defined. What exactly this method do, and where can I find this method in a file?

Thanks in advance.

EDIT: add complete code.

class Customweb_Subscription_IndexController extends Customweb_Subscription_Controller_Abstract {

    /**
     * Apply subscription plan to cart
     */
    public function applyPlanAction(){
        $quote = Mage::getSingleton('checkout/cart')->getQuote();

        /**
         * No reason continue with empty shopping cart
         */
        if (!$quote->getItemsCount()) {
            $this->_redirect('checkout/cart');
            return;
        }

        $index = $this->getRequest()->getParam('subscription_plan');
        if ($index != '') {
            $subscriptionPlan = Mage::getModel('customweb_subscription/cartPlan')->loadByIndex($index);
        }
        else {
            $subscriptionPlan = null;
        }

        $oldSubscriptionPlan = $quote->getSubscriptionPlan();

        if ($subscriptionPlan == null && $oldSubscriptionPlan == null) {
            $this->_redirect('checkout/cart');
            return;
        }

        try {
            $quote->setSubscriptionPlan($subscriptionPlan)->collectTotals()->save();

            if ($subscriptionPlan != null) {
                Mage::getSingleton('checkout/session')->addSuccess(
                        $this->__('You subscribed to the plan <em>%s</em>.', Mage::helper('core')->htmlEscape($subscriptionPlan->getDescription())));
            }
            else {
                Mage::getSingleton('checkout/session')->addSuccess($this->__('The subscription plan was removed.'));
            }
        }
        catch (Mage_Core_Exception $e) {
            Mage::getSingleton('checkout/session')->addError($e->getMessage());
        }
        catch (Exception $e) {
            Mage::getSingleton('checkout/session')->addError($this->__('Cannot apply the subscription plan.'));
            Mage::logException($e);
        }

        $this->_redirect('checkout/cart');
    }
}


texts: Magento 2 how to disable or add form key to adminhtml controller?

texts:
How can I add a form key to my controller? it's redirecting me to dashboard everything it finishes.
this is my code
use Magento\Backend\App\Action;
use Magento\Framework\App\RequestInterface;
use Transom\Pakke\Logger\Logger;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Framework\Controller\ResultFactory;

class Pdf extends Action
{
    /**
     * @var PageFactory
     */
    protected $request;
    protected $logger;
    protected $orderRepository;
    protected $resultRedirectFactory;
    protected $_redirect;
    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */

    protected $_publicActions = ['index'];

    public function __construct(
        RequestInterface $request,
        Logger $logger,
        OrderRepositoryInterface $orderRepository,
        ResultFactory $resultRedirectFactory,
        \Magento\Framework\App\Response\RedirectInterface $redirect,
        \Magento\Backend\App\Action\Context $context
    ) {
        parent::__construct($context);
        $this->request = $request;
        $this->logger = $logger;
        $this->orderRepository = $orderRepository;
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->_redirect = $redirect;
        $this->execute();
    }

    /**
     * Index action
     *
     * @return \Magento\Backend\Model\View\Result\Page
     */
    public function execute()
    {

        $completeState = \Magento\Sales\Model\Order::STATE_COMPLETE;
        $entregadoStatus = "entregado";
        $order_id = $this->request->getParam('order_id');

            $order = $this->orderRepository->get($order_id);
            $order->setStatus($entregadoStatus)->setState($completeState);
            $this->orderRepository->save($order);

            $resultRedirect = $this->resultRedirectFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setUrl('sales/order/view/order_id/'.$order_id.'/');
            return $resultRedirect;

    }
}

it should work with this:
protected $_publicActions = ['index'];

but it's not doing anything


texts: Where is "Search Engine Robots" configuration panel in Magento 2.2?

texts: I see, that "Search Engine Robots" should be in "Stores / Configuration / General / Design" path. I see that this panel was there in Magento 2.1. But I cannot see "Design" section at all in the fresh Magento 2.2.0 installation:


texts: How to get all product data from oracle netsuite through php api

texts: I have been created the connection between PHP and Netsuite but now I want to load all product data from NetSuite to my PHP API so how can I do this? is there any solution for that...


texts:
We need to show to customers a list or products that are in the same category, but we don't want to list other products of that category.

Specific example:
We have a categories "t-shirts" and we want to link from a banner to all t-shirts that contain "Mickey Mouse". We have the ID's of the products from the backend of course.

Is there a way or an extension to achieve this?

Sth. like ../index.php?products=1,7,11,13?

If there is no solution out of the box, how would you achieve this programmatically? Using the standard listing/grid of the shop (same templates).


texts: Multistore: share product/category data between storeviews

texts:
I need to share some product and category data (mostly text/textarea fields) between multiple storeviews ...

website 1

b2c

de (use default)
en
...

b2b

en (same data as in "b2c-en" view)
...

Everytime I update i.e. product/category attribute in "b2c-en" it should also be saved/reused in "b2b-en" storeview.

Is there a way to manipulate SQL-query that saves proudct/category data to save it for serveral storeviews? Or any other ideas?


texts: Why would a customer's IP address not show on orders sometimes?

texts:
In the Dashboard: System > Configuration > Sales > Sales...

I have "Hide Customer IP: No"

and this means the customers IP is shown on orders and invoices, etc...

This works on almost every order, but a couple orders just don't show an IP at all. This is very rare, and maybe 1 out of every 100 orders don't show an IP.

Well, what would cause this? I was asked why this is, but I just didn't have an answer, and now I'm curious.

Thanks all.


texts:
I am building a carousel for products I have all the relevant information e.g name price image but I need an add to cart button for each one of these currently I have got an add to cart button for them all but it adds the main product to the basket for whatever product page I am on. How do I achieve something which adds the relevant product to cart. See my code below.

<?php

$category_id = 577; // if you know static category then enter number

$catagory_model = Mage::getModel('catalog/category')->load    ($category_id); //where $category_id is the id of the category

 $collection = Mage::getResourceModel('catalog/product_collection');

    $collection->addCategoryFilter($catagory_model); //category filter

    $collection->addAttributeToFilter('status',1); //only enabled product

    $collection->addAttributeToSelect(array('name','url','small_image','price')); //add product attribute to be fetched

    //$collection->getSelect()->order('rand()'); //uncomment to get products in random order

    $collection->addStoreFilter();

    if(!empty($collection))

    {

            foreach ($collection as $_product):

        echo "
";
    echo 'init($_product, 'small_image')->resize(150,150) . '"/>';
           echo "";
            echo $_product->getName();   //get product name
           echo "";
           echo " ";
            $getPrice =  "£" . $_product->getPrice();

           $snip_string = substr($getPrice , 0 , -2);
           echo $snip_string;
           echo '';

           echo "<button type = 'button' title='Add to Cart' id = 'product-addtocart-button' class = 'button btn-cart'
           onclick = 'productAddToCartForm.submit(this)'>";
           echo '';
           echo '';
             echo 'Add to Cart';
           echo '';
           echo '';
           echo '</button>';

        echo '
';

        endforeach;

    }else

        {

            echo 'No products exists';

    }

?>


texts: Catching shipping/billing address field values from admin create order

texts:
I need to catch billing/shipping(either will do) address values when it saved "not from database" but from its direct values sent from view. I realized that Magento has little support for backend coding maneuverability but at this point, I don't care if its directly in the vendor or anything.
What do you want those values for? - I need to send those values to my "backup" kinda server.
Why do you not take them from DB after its saved? - Some personal problems which I will fix later


texts: Access Magento session from external site

texts: How do you log in an existing customer/user from external application or bypass his session after logging into Magento to other application?


texts: Attribute label 'Color' is not translated in frontend

texts:
on my frontend the attribute label 'Color' is still in English. It should be in Dutch 'Kleur'.

In Catalog > Attributes > Manage Attributes > Color > Manage Label i put here also the Dutch translation 'Kleur'.

Why it's not translated in the frontend?

Thanks!


texts: Magerun - Can't connect to local MySQL server through socket error message in console

texts:
By running this command on my localhost:

./n98-magerun.phar sys:cron:list

or

./n98-magerun.phar sys:check

I am getting this error messages:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/pdo_mysql.so' - /usr/lib/php5/20131226/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/pdo_mysqli.so' - /usr/lib/php5/20131226/pdo_mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0

and

  [Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
  [PDOException]
  SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Do you how can I get rid of of these messages?


texts: Programatically load default billing and shipping address

texts: Magento 2 programatically load default billing and shipping address..


texts: Strategry Infinite scrolling not working in Magento 1.9

texts:
When scrolled down, The next products are loaded. When debugged in it gets a JSON response. When switched to console I get the error Error: Syntax error, unrecognized expression:
I will upload the Json response screenshot.


texts: Magento2: cannot open "content > themes" from admin panel, all other oages are fine

texts:
I can login to my admin panel (Magento 2.3), I can walk through any page of the admin panel, except for one page: content > themes. when I try to open this page, it seems that apache doesn't resolve the request forever,I don't know, its like you try to run a super big query on mySQL with PHP in a server configured with a long max_execution_time in its apache configuration. (it seems similar to it, but facts are against it)
So, what does it mean? I checked these:
Server stats are fine, no memory limit, no timeout, no short on RAM or CPU usage, nothing.
exception log of Magento is empty: var/log/exception.log.
apache error log logs nothing as well.
I restarted apache service, mySQL, even the server itself. Nothing changed.
I mean, how is it possible? what technical difference can a page have that this issue only occurs to it and not any other pages?


texts:
i want to show custom url parameter in page created via module

what is did i created a module to show page with custom page

issue is how to pass and show parameter in url like product id  of parent product

With my module i am able to open url with dummy content: like below

abc.com/related

i want to pass and show parameters like

abc.com/releted/productid/11

Below is code of my module MY_Related

1: app\code\local\MY\Related\Block\Index.php

<?php
class MY_Related_Block_Index extends Mage_Core_Block_Template{

}

2: app\code\local\MY\Related\controllers\IndexController.php

<?php
class MY_Related_IndexController extends Mage_Core_Controller_Front_Action{
    public function IndexAction() {

      $this->loadLayout();
      $this->getLayout()->getBlock("head")->setTitle($this->__("Titlename"));
            $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
      $breadcrumbs->addCrumb("home", array(
                "label" => $this->__("Home Page"),
                "title" => $this->__("Home Page"),
                "link"  => Mage::getBaseUrl()
           ));

      $breadcrumbs->addCrumb("titlename", array(
                "label" => $this->__("Titlename"),
                "title" => $this->__("Titlename")
           ));

      $this->renderLayout();

    }
}

3: app\code\local\MY\Related\etc\config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <MY_Related>
      <version>0.1.0</version>
    </MY_Related>
  </modules>
  <frontend>
    <routers>
      <related>
        <use>standard</use>
          <args>
            <module>MY_Related</module>
            <frontName>related</frontName>
          </args>
      </related>
    </routers>
        <layout>
          <updates>
            <related>
              <file>related.xml</file>
            </related>
          </updates>
        </layout>
  </frontend>
  <global>
    <helpers>
      <related>
        <class>MY_Related_Helper</class>
      </related>
    </helpers>
    <blocks>
      <related>
        <class>MY_Related_Block</class>
      </related>
    </blocks>
  </global>
</config>

4: app\code\local\MY\Related\Helper\Data.php

<?php
class MY_Related_Helper_Data extends Mage_Core_Helper_Abstract
{
}


texts: Category Products can be purchased standalone like Recurring Profile

texts:
In magento, Is it possible to make selected categories products can be purchased standalone, currently this feature is available for recurring profile enabled products.

I need this feature for particular categories products.

In this category i have simple or virtual products only.

When i add this product to cart, it need to check whether some products is already in cart, if not it can be added to cart else it should report error message,

This products can order individually not combined with other products.

Any Ideas?


texts: How to add customer Attribute inside custom tab section insted of "Account Information" in magento 2?

texts:
I have created customer Attribute programmatically and need that attribute to outside of "Account information" tab... means in custom tab.

I have tried with customer group.... ui component file as below

<fieldset name="custom_fields">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Custom Fields</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="opened" xsi:type="boolean">true</item>
        </item>
    </argument>
    <field name="customer_blood_group">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Blood Group</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">number</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">customer_blood_group</item>
            </item>
        </argument>
    </field>
</fieldset>

but it's not working... any other way to sort out this issue ?

thanks in advance


texts: How to defer unused CSS and avoid an excessive DOM size in magento1.9?

texts: How to defer unused CSS and avoid an excessive DOM size? Any one knows how to defer unused css and avoid dom size in magento1.9 using pagespeed?


texts: All the thumbnails on the product page went blurry. See attached screenshot:


texts:
Magento 2.3.3

Store is strictly downloadable mp3 products. Thus max quantity for each product is one (adding more than one would not make sense). I'd like to check if a product is already in the cart, and if so, I'll hide the Add to Cart button.

(Current default behavior is that if the product is already in the cart, clicking the button sends you to the product page with an error message. I'd like to skip this.)

I've found this, but it doesn't work:

How to check whether a product is in the cart?

The $productInfo array in the above example is empty, even when there are items in the cart.

This also did not help me: how to check if product is already in cart


texts: Add new option to existing product attribute

texts:
I am trying to use the function addAttributeOption to add a new option to an attribute. I do not want to change the current option order or defaults but simply want to append a new option to the end of the list.

Firstly I tried to get all the options on the attribute and simply append the new one as follows.

$attributeModel->getSource()->getAllOptions();

But then it complains about the lack of default value. Ideally I do not want to have to reformat the array returned from getAllOptions as it only returns value and label.


texts: Datepicker is not show current date in magento grid module

texts:
Here is my code :

$not_allowed_date=$fieldset->addField('not_allowed_date', 'date', array(
        'name'      => 'not_allowed_date',
        'label'     => Mage::helper('po')->__('Not Allowed Date'),
        'required'  => true,
        'image'  => $this->getSkinUrl('images/grid-cal.gif'),
        'format' => 'dd-MM-yyyy',
        'note' => "dd-mm-yyyy",
        'time' => true
    ));


texts: Bulk Product Import Issue in Magento 1.9.2 throws red esclamatory error

texts:
I am using Magento 1.9.2 CE edition, Whenever I do a product import, system allows me to import only 42 products maximum, I have tried increasing PHP memory, file size and upload limit as well however still facing the same issue.

Please help, I have attached the error screen as well.


texts: Different email headers when registering new users

texts:
Edited Question
I have a customer registration form with an additional field to fill in a group.
Depending on this field, the user should get one or another email.
Original Question:
I need some way to identify users, then to manually define them in a group, so I need to have different headers to be seen what the user wants in the group, and what not
how i can do this?
Thanks


texts: Duplicated the Search form , but works properly only on one

texts:
I'm using Magento 2, and what I'm trying to do is to duplicate the search form, one for the desktop version and one for mobile, hiding one and another on different versions.

The problem is that on mobile, when I click the search icon, the window doesn't show up, cause it calls the desktop version, and that one is hidden.

I've duplicated already the .phtml file, and tried to solve this, but no success, any idea?


texts: I had developed website in Magento 2.3 but by default it is coming with http only and now my requirement is by default it has to open with https only.


texts: How to override getAvailableMethods method in Magento\Payment\Model\MethodList

texts:
anyone have idea how to override getAvailableMethods method from

Magento\Payment\Model\MethodList class.


texts: Magento 2.3.3 Upgrade Error - You cannot define a correlation name 'stock_item' more than once

texts:
Getting Error on Bundle Product page on Magento 2.3.3 after Upgrade.

Exception #0 (Zend_Db_Select_Exception): You cannot define a correlation name 'stock_item' more than once

Thanks


texts: download image with original size in magento2

texts: I tried upload big image for product in backend but magento crop it, change size. How i can upload image with original size? Is in backend configuration for it?


texts:
This was asked at least three times between Magent.StackExchange and StackOverFlow, but the provided solutions are just not working for me. What im trying to do is get the image of each of the items in the orders, I tried using                         'image_url' =>  Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail') as explained in the other answers but im always getting an empty object. I made sure the product have a thumbnail assigned from the magento admin. Everything else is working just fine for the item details, just can't get the image or thumbnail url.

protected function _retrieveCollection() {

    // get the customer
    $login_hash = $this->getRequest()->getParam('login_hash');
    $customer = Mage::getModel('customer/customer')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addAttributeToFilter('login_hash',$login_hash)
                ->load()
                ->getFirstItem();

    $orders = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect('*')
        ->addFieldToFilter('customer_id', $customer->getId() )
        ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
        ->setOrder('created_at', 'desc');

    $collection = new Varien_Data_Collection();

    foreach ($orders as $order) {

        $items = $order->getAllVisibleItems();
        $items_arr = [];

        foreach ($items as $item) {
            //Mage::Log(print_r($item, true));
            $items_arr[] = array(
                    'id' =>  $item->getItemID(),
                    'name' => $item->getName(),
                    'desc' => $item->getDescription(),
                    'price' => $item->getPrice(),
                    'quantity' => $item->getQtyOrdered(),
                    'original_price' => $item->getOriginalPrice(),
                    'product_type' => $item->getProductType(),
                    'image_url' =>  Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail')
                );

        }

        $order_arr = array(
                'id' => $order->getRealOrderId(),
                'date_created' => $order->getCreatedAt(),
                'total' => $order->getGrandTotal(),
                'tax_amount' => $order->getTaxAmount(),
                'shipping_amount' => $order->getShippingAmount(),
                'subtotal' => $order->getSubtotal(),
                'shipping_address_id' => $order->getShippingAddressID(),
                'billing_address_id' => $order->getBillingAddressID(),
                'total_item_count' => $order->getTotalItemCount(),
                'items' => $items_arr
            );

        $varienObject = new Varien_Object();
        $varienObject->setData($order_arr);
        $collection->addItem($varienObject);

    }

    return $collection;

}


texts: magento installation on localhost giving creating admin account error

texts:
i have installed magento on local host successfully but one small problem m facing is when m trying to create admin account it is showing message "Only registered domain accounts are allowed" when m entering my email address.
can any person help me ?

Even we are facing this problem with actual site also when customer buy some product from our site and come back to buy another products magento shows the same message even when person click on forgot password it shows same message again.


texts:
So i create an xml for form like this

<field name="password">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Password</item>
                <item name="dataType" xsi:type="string">password</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

so i want to the field to be like the usual html password field.

i've tried to change the data type to password and nothing happen.

what should i do to accomplish this?

thanks


texts:
How to include images in js,
My code :
if (firstStore.address && firstStore.state && firstStore.zip && firstStore.store_hours_weekdays && firstStore.store_hours_weekend_days && firstStore.phone ) {

    homeAddress = '
' + firstStore.address + ',' + firstStore.state + ' ,' + firstStore.zip + '

 ' <<add image here>> + firstStore.store_hours_weekdays +'
 ' +firstStore.store_hours_weekend_days+ '

 ' <<add image here >> + firstStore.phone + '
';

}


texts: custom admin module edit data field not retrieve data

texts:
I am creating custom admin module where grid, edit, new, delete work as same as product grid.
Everything working fine but when i click on grid row to edit item it redirects correctly but the text field does't contains data. currently i am having one field called name
my editAction as follows:

public function editAction()
    {
     $id = $this->getRequest()->getParam('id', null);
        $model = Mage::getModel('fondation/fondation');
        if ($id) {
            $model->load((int) $id);
            if ($model->getId()) {
                $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
                if ($data) {
                    $model->setData($data)->setId($id);
                }
            } else {
                Mage::getSingleton('adminhtml/session')->addError(Mage::helper('fondation')->__('Example does not exist'));              $this->_redirect('*/*/');
            }
        }
        Mage::register('fondation_data', $model);
        $this->loadLayout();
        $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
        $this->renderLayout();
}


texts: Ajax request from key validation in magento 2

texts:
I need to done an ajax request in Magento 2. But for security purpose, I need to check XSS attacks all possible case. In Magento 1 form key validation and in Magento 2 form key validation is quite different.
I need to validate if the form key match or not. One thing is customer may be logged in or logged out. So I can't validate by customer session.

var formKey = jQuery("[name='form_key']").val();
jQuery.ajax({
    url: "<?php echo $baseUrl.'testing/test/index';?>",
    type: "POST",
    data: {form_key:formKey},
    success: function(response){
        try {
        console.log(response);

        }catch(err) {}
    }
});

Now from the controller, I need to validate for XSS attack.


texts:
On my test-server im running magento 2.3.1 after doing composer upgrade the system updated my addons but now when i want to php bin/magento setup:upgrade i recieve the following error:

Source class "\Magento\Framework\Mail\EmailMessageInterface" for "Magento\Framework\Mail\EmailMessageInterfaceFactory" generation does not exist.

Now the result is i cant access my server anymore on http but only on ssh.

Anybody have an idea? :)


texts: Magento 2 error - Uncaught TypeError: Cannot read property 'trim' of undefined

texts:
Error while clicking on place order button, how to trace this error (in which file ),

in order to fix it - Uncaught TypeError: Cannot read property 'trim' of undefined


texts: I have newly installed magento 2.4.1 in my localhost(ubuntu), but the problem is that I cannot see the URL admin panel login screen

texts:
My general customer view frontend is working fine.
 But when I tried to login into the admin area , then
I enter this in address of chrome web browser -
http://127.0.0.1/local_m241/lcl_m241/index.php/admin_17r9pn
Then got auto-redirected to this -
http://127.0.0.1/local_m241/lcl_m241/admin_17r9pn/admin/index/index/key/6a5ef2a519b65baf9f4c74860c9e7a6a45ae537c24a35f1e77683f5cf0f4f5d1/
and this page shows 404 error as shown in below picture.


texts: Magento Shipping Estimation Script Not Working

texts:
PHP Shipping Estimation script (From StackExchange )

    <?php
//require_once("Mage.php");
ob_start();
require_once(__DIR__ . '/app/Mage.php');
umask(0);
ini_set('display_errors',true);
ini_set('memory_limit', '1024M');
Mage::app()->loadArea('frontend');

// require_once 'app/Mage.php';
// Mage::app('main');

//Mage::app();

function getShippingEstimate($productId,$productQty,$countryId,$postcode ) {

    $quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore('default')->getId());
    $_product = Mage::getModel('catalog/product')->load($productId);

    $_product->getStockItem()->setUseConfigManageStock(false);
    $_product->getStockItem()->setManageStock(false);

    $quote->addProduct($_product, $productQty);
    $quote->getShippingAddress()->setCountryId($countryId)->setPostcode($postcode);
    $quote->getShippingAddress()->collectTotals();
    $quote->getShippingAddress()->setCollectShippingRates(true);
    $quote->getShippingAddress()->collectShippingRates();

    $_rates = $quote->getShippingAddress()->getShippingRatesCollection();

    $shippingRates = array();
    foreach ($_rates as $_rate):
            if($_rate->getPrice() > 0) {
                $shippingRates[] =  array("Title" => $_rate->getMethodTitle(), "Price" => $_rate->getPrice());
            }
    endforeach;

    return $shippingRates;

}
echo "<pre>";
//product id, quantity, country, postcode
print_r(getShippingEstimate('14419','1',"IN","642001"));
echo "</pre>";

?>

Error :

Fatal error:  Uncaught Mage_Core_Model_Store_Exception in /home/abc/public_html/app/code/core/Mage/Core/Model/App.php:1377
Stack trace:
#0 /home/abc/public_html/app/code/core/Mage/Core/Model/App.php(861): Mage_Core_Model_App->throwStoreException()
#1 /home/abc/public_html/sp_cost.php(17): Mage_Core_Model_App->getStore('default')
#2 /home/abc/public_html/sp_cost.php(43): getShippingEstimate('14419', '1', 'IN', '642001')
#3 {main}
  thrown in /home/abc/public_html/app/code/core/Mage/Core/Model/App.php on line 1377

How to solve the error and get estimation shipping charge?


texts:
I am a Magento newbie and today I am trying to apply Slick Slider to my Magento website as a custom module.

I have created a blank module with some simple 'echo' and HTML and they all worked well. However, I don't know what to do with the Slick directory. Should I put it in the website root directory or somewhere? And after that, how can I apply those Js and Css into my module?

Please provide some guidance


texts:
Is there a way to create a linkable category image which is uploaded on Category --> General information --> Image?

One way i could think of is to create a static block with an linkable image inside it and asign that block to a specific category. But for ease of administrative purpouses i would like to create an input where administrator could paste a link and category image becomes linkable in the frontend.

For example:


texts:
In my extension's config.xml I'm observing the sales_quote_remove_item event.  I'd like to get the SKU of the item that was removed from the cart.

I've the steps mentioned in https://stackoverflow.com/questions/4255083/magento-how-to-check-if-a-product-has-already-been-removed-from-the-cart to no avail.  var_dump() on the $observer object spits out too much info to be intelligible.

I have a custom extension that adds bonus products depending on certain groups.  I'd like for it to continue listening on sales_quote_remove_item but to ignore any of the bonus SKUs themselves.


texts: Shipping step missing when bundle product is in cart?

texts:
On my Magento 2.2.8 store the shipping step is missing when I have a bundle product in my cart. Not sure if this is the reason, but the checkout is also not working. As soon as I mix it with a normal product, everything works. The trace is:

{"message":"Auf dem Server ist ein Fehler aufgetreten. Bitte versuchen Sie die Bestellung erneut aufzugeben.","trace":"#0 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Checkout\\Model\\PaymentInformationManagement->savePaymentInformationAndPlaceOrder(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#1 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->___callParent('savePaymentInfo...', Array)\n#2 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->Magento\\Framework\\Interception\\{closure}(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#3 \/html\/magento2\/generated\/code\/Magento\/Checkout\/Model\/PaymentInformationManagement\/Interceptor.php(26): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)\n#4 [internal function]: Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->savePaymentInformationAndPlaceOrder(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#5 \/html\/magento2\/vendor\/magento\/module-webapi\/Controller\/Rest\/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#6 \/html\/magento2\/vendor\/magento\/module-webapi\/Controller\/Rest.php(244): Magento\\Webapi\\Controller\\Rest\\SynchronousRequestProcessor->process(Object(Magento\\Framework\\Webapi\\Rest\\Request\\Proxy))\n#7 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#9 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#10 \/html\/magento2\/generated\/code\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#11 \/html\/magento2\/vendor\/magento\/framework\/App\/Http.php(136): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#12 \/html\/magento2\/generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#13 \/html\/magento2\/vendor\/magento\/framework\/App\/Bootstrap.php(257): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#14 \/html\/magento2\/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#15 {main}"}

The error means something like: There was an error on the server. Please try to replace your order. I can see savePaymentMethod in the trace, so maybe thats related? The order is placed anyway, I can see it in the order grid in admin, but on frontend it looks like it hasnt.

Thanks for any help!


texts:
I tried to copy:  the description
is a page where all categories are showed. I imagine that I need to take the attribute.phtml and put it before or after the price but how?


texts: How to update cart total on payment page dynamically in Magento 2

texts: How can I update cart total on payment page in Magento 2, I tried using jQuery and PHP both, but I am unable to update cart total.Can anyone please direct me in right direction.


texts: Some Security patches Shows Error executing check in magereport

texts:
I have checked my URL in mage report for security patch but it has shown Error executing check message in some security patch. so I want to know why this type of message comes from magerepot and how to solve it.My Magento version is Magento 1.9.2.2
Note: I have to try to install security patch but still I am getting the same error.

From the comment of Christoph Farnleitner,I use this link https://github.com/magesec/magesecuritypatcher but getting this error.


texts: Changing the Top Menu from Displaying Categories to Page Links?

texts:
If this is a duplicate question, please be kind enough to point me in the right direction to a solution as I've searched already :(

Just configuring a Magento CE 1.9 template (by Templatemela) and have a question.

How can I change the Top Level Nav Menu (id=advancedmenu) to display custom website links, e.g. Contact, About Us, Terms and Conditions, Delivery etc... instead of Categories?
I have found the top.phtml file and where the Categories menu is built, but not how to add menu top level menu links.

Link to Home Page

I assume that there must be an easy way or something I've missed in configuring the Categories.

Thank you for any help,

Alan.


texts: Magento 2 - How to create new product tag?

texts:
How can I add a new product tag like 'New', 'Promo'.

And need to display it with the product edit page as a toggle.

In category pages, it should be near to the product list.


texts: Magento 1.9 cron running, but stops on one method

texts:
I have a small bug and have no clue where or how to debug. I have one cron task which runs on production but stops or stuck always on one method. On local env it works like a charm, but on prod not. Here is my code:

$stores = Mage::app()->getStores();
        foreach ($stores as $store) {
            if ($store->getIsActive()) {

                Mage::log("store ID " . $store->getId() . ": " . $store->getCode(), null, 'myextension.log');

                // call update check
                Mage::log( "before runUpdateCheck()", null, 'myextension.log');

                $update_done = Mage::helper('privacypolicy/service')->runUpdateCheck($store);
                Mage::log( "after runUpdateCheck()", null, 'myextension.log');

                if ($update_done AND ! $updated) {
                    $updated = true;
                }
            }

            Mage::log('Cron: Update check finished', null, 'myextension.log');
        }

So it works until $update_done = Mage::helper('privacypolicy/service')->runUpdateCheck($store);

Then nothing happened. Tried to add logging into this method. Nothing happened.

As I mentioned above - on local it works fine. Have no idea how to fix it on prod.


texts: Setting shipping method in the order creation process

texts:
I want to set a shipping method in order to create an order, but i got the following message error: "Please specify a shipping method". This is my code:
First try:

$shippingAddress->setFreeShipping( true )
            ->setCollectShippingRates(true)->collectShippingRates()
            ->setShippingMethod('freeshipping')
            ->setPaymentMethod('cashondelivery');

Second try:

$quote->getShippingAddress()->setShippingMethod('freeshipping');

None of these are not working. Any idea how to solve this is welcomed. Thx in advance


texts: Custom registry is not retrieved in block magento2

texts:
I am setting custom registry in my module like below.

here is my controller file code.

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Category;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Session\SessionManagerInterface;

class Childcategory extends Action
{
protected $categoryRepository;
protected $resultJsonFactory;
protected $_coreSession;
protected $_coreRegistry = null;

public function __construct(
        Context $context,
        CategoryRepositoryInterface $categoryRepository,
        JsonFactory $jsonFactory,
        SessionManagerInterface $coreSession,
        \Magento\Framework\Registry $coreRegistry
        )
{
    $this->categoryRepository = $categoryRepository;
    $this->resultJsonFactory = $jsonFactory;
    $this->_coreSession = $coreSession;
    $this->_coreRegistry = $coreRegistry;
    parent::__construct($context);
}

public function execute()
{
    $parentId = $this->getRequest()->getParam('category_id');
    $this->_coreRegistry->register('category_parent_id', $parentId);
    $category = $this->categoryRepository->get($parentId);
    $childrenData = [];
    return $this->resultJsonFactory->create()->setData($childrenData);
 }

  }

Block file code.

 class Category extends \Magento\Framework\View\Element\Template{
protected $categoryFactory;
protected $_storeManager;
protected $_categoryCollectionFactory;
protected $_coreRegistry;
public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Catalog\Model\CategoryFactory $categoryFactory,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory,
    \Magento\Framework\Registry $coreRegistry
)
{
    $this->categoryFactory = $categoryFactory;
    $this->_storeManager = $storeManager;
    $this->_categoryCollectionFactory = $categoryCollectionFactory;
    $this->_coreRegistry = $coreRegistry;
    parent::__construct($context);
}

public function getCatId()
{
    $sessionId = $this->_coreRegistry->registry('category_parent_id');
    if(isset($sessionId) && $sessionId != ''){
        return $sessionId;
    }else{
        return;
    }
    }
 }

If i try to access the registry value in my template file like below.

$registryId = $block->getCatId();

I am not getting the value, but i have set it in my controller.

Where i am doing wrong, can anyone help me please.


texts: Magento 2 Custom module default.xml CSS not called

texts:
I've my module files as following

  app/code/Vendor/GeoIp/view/frontend/layout/default.xml

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

My CSS file at following path

  app/code/Vendor/GeoIp/view/frontend/web/css/popup.css

Other code of module is working fine, I cleared cache,s:upgrade,s:s:d many times but it isn't working.

I can't find any mistake in above code. What is wrong?


texts: Magento 2 how to save values of 'checkboxes' type into 'core_config_data' table?

texts:
I am currently working on a Magento 2 extension. In my task, I need a field in admin grid to show a list of product's default attributes. My current solution is to use 'multiselect' to generate the UI. So in system.xml, the piece of code below has been added:

<field id="default" translate="label" type="multiselect" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Default Attributes </label>
    <source_model>...\DefaultAttributeSource</source_model>
</field>

By doing so, everything works fine. However, the requirement is to use checkboxes for this field. So, I have to change type="checkboxes" in the preceding code, this is where the problem came from.

After I click some of the checkboxes and press [Save Config] button, only the the last checkbox is checked, and only the one value is saved in the core_config_data table .

By looking at the Html source code, I guess the problem might be caused by the name attribute in <input type="checkbox" ...> element, it should be named as a array, like name="values[]". I also found when I check the checkboxes, Magento doesn't add checked="checked" to the element, instead, it adds a :after Pseudo class for it.

So, my question is how to save all the checked checkboxes to 'core_config_data' as a 'multiselect' does, such as:

| scope   | scope_id | path                | value              |
|---------|----------|---------------------|--------------------|
| default |    0     | attributes/default  | 128,111,97,100 ... |


texts: Magento 2: How to setup ReCaptcha on Registration form and forgot password form?

texts: Anyone know the best method to activate ReCaptcha on Customer registration form? and Forgot Password form? any plugin or any class snippet can help?


texts: Auto generate Meta Description for imported products

texts:
i create a module for Auto generate of meta description but it's not workin for imported products but i want this also work for imported product & i am using an extension instead of magento's default import/Export
code is

app/etc/modules/Easylife_Meta.xml
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Meta>
<codePool>local</codePool>
<active>true</active>
<depends>
<Mage_Catalog />
</depends>
</Easylife_Meta>
</modules>
</config>

app/code/local/Easylife/Meta/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Meta>
<version>0.0.1</version>
</Easylife_Meta>
</modules>
<global>
<models>
<easylife_meta>
<class>Easylife_Meta_Model</class>
</easylife_meta>
</models>
</global>
<adminhtml>
<events>
<catalog_product_save_before><!-- observe the event -->
<observers>
<easylife_meta>
<class>easylife_meta/observer</class>
<method>autoMetaDescription</method>
</easylife_meta>
</observers>
</catalog_product_save_before>
</events>
</adminhtml>
</config>
app/code/local/Easylife/Meta/Model/Observer.php

<?php
class Easylife_Meta_Model_Observer {
public function autoMetaDescription($observer) {
$product = $observer->getEvent()->getProduct();

$meta_description = $product->getMetaDescription();
$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName = $attributeSetModel->getAttributeSetName();

if($attributeSetName == "Books"){
$publisher_attribute = $product->getResource()->getAttribute('publisher');
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at booksnclicks.com | Buy New Book | Authorised seller for ".$publisher_attribute->getFrontend()->getValue($product);
$product->setMetaDescription($metaDescription);
}

if($attributeSetName == "Gadgets"){
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at booksnclicks.com | Buy New Gadgets |Authorised seller for ". $product->getAttributeText('brand_gadgets');
$product->setMetaDescription($metaDescription);
}

if($attributeSetName == "Stationery"){
$metaDescription = "Buy ". $product->getName()." for Rs ".number_format($product->getFinalPrice(), 2)." at sbooksnclicks.com | Buy New Stationery | Authorised seller for ". $product->getAttributeText('brand_stationery');
$product->setMetaDescription($metaDescription);
}

}
}


texts: How to run php code once block is rendered?

texts:
I have a custom Block, and I want to run some code before this block will be rendered. How to achieve this?

I don't want to place my code inside Block method and run it from the template.

I don't want to place my code inside __construct, because it's no good for performance.

I think there is a maybe some event in Magento, that I can use for this.

I will be glad to any thoughts. Thanks.


texts: Localization for Cart/Quote APIs doesn't work properly in magento 2

texts:
I checked this api:

rest/{{store_code}}/V1/carts/mine/totals

It will return Items in JSON response.

But if a cart is created in English Store in the very first place. And we try to switch the store by passing Arabic store code in above URL. It doesn't convert the Product Name into Arabic even if We provided Name in Arabic in Arabic store view from Backend.

In the following output, you will see the Item Name marked in Bold is not converted to Arabic store. It is just an example. In Magento 2, All Quote related APIs doesn't support localization.

json O/P:

  {
      "grand_total": 90,
      "base_grand_total": 90,
      "subtotal": 75,
      "base_subtotal": 75,
      "discount_amount": 0,
      "base_discount_amount": 0,
      "subtotal_with_discount": 75,
      "base_subtotal_with_discount": 75,
      "shipping_amount": 15,
      "base_shipping_amount": 15,
      "shipping_discount_amount": 0,
      "base_shipping_discount_amount": 0,
      "tax_amount": 0,
      "base_tax_amount": 0,
      "weee_tax_applied_amount": null,
      "shipping_tax_amount": 0,
      "base_shipping_tax_amount": 0,
      "subtotal_incl_tax": 75,
      "shipping_incl_tax": 15,
      "base_shipping_incl_tax": 15,
      "base_currency_code": "USD",
      "quote_currency_code": "USD",
      "items_qty": 3,
      "items": [
          {
              "item_id": 912,
              "price": 25,
              "base_price": 25,
              "qty": 3,
              "row_total": 75,
              "base_row_total": 75,
              "row_total_with_discount": 0,
              "tax_amount": 0,
              "base_tax_amount": 0,
              "tax_percent": 0,
              "discount_amount": 0,
              "base_discount_amount": 0,
              "discount_percent": 0,
              "price_incl_tax": 25,
              "base_price_incl_tax": 25,
              "row_total_incl_tax": 75,
              "base_row_total_incl_tax": 75,
              "options": "[{\"value\":\"Italian Bread arabic\",\"label\":\"Bread arabic\"},{\"value\":\"Plain
  Bread\",\"label\":\"Customize\"},{\"value\":\"honey Mustard Sauce,
  Mustard Sauce\",\"label\":\"Sauces\"}]",
              "weee_tax_applied_amount": null,
              "weee_tax_applied": null,
              "name": " Aloo Patty "
          }
      ],
      "total_segments": [
          {
              "code": "subtotal",
              "title": "Subtotal",
              "value": 75
          },
          {
              "code": "shipping",
              "title": "Shipping & Handling (Flat Rate - Fixed)",
              "value": 15
          },
          {
              "code": "tax",
              "title": "Tax",
              "value": 0,
              "extension_attributes": {
                  "tax_grandtotal_details": []
              }
          },
          {
              "code": "grand_total",
              "title": "Grand Total",
              "value": 90,
              "area": "footer"
          }
      ] }

Is there any solution for this ?

Thanks in advance.


texts: Magento 2 : optimize customer attributes save code

texts:
i am trying to save data using customer attributes and the below code work fine, can i further optimize below code

Thankyou

<?php
namespace Tatva\Loginpopup\Controller\Index;

use Magento\Framework\App\Action\Context;
use Magento\Framework\App\Filesystem\DirectoryList;

class save extends \Magento\Framework\App\Action\Action
{

protected $_resultPageFactory;
protected $customerFactory;
protected $customer;

public function __construct(
    Context $context,
    \Magento\Customer\Model\Customer $customer,
    \Magento\Customer\Model\ResourceModel\CustomerFactory $customerFactory,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
    $this->customer = $customer;
    $this->customerFactory = $customerFactory;
    $this->resultPageFactory = $resultPageFactory;
    parent::__construct($context);

}

public function execute()
{
    $params = $this->getRequest()->getParams();
    $customerId = $params['customer_id'];
    $industry = $params['industry'];
    $job_profile = $params['job_profile'];

    $customer = $this->customer->load($customerId);
    $customerData = $customer->getDataModel();
    $customerData->setCustomAttribute('industry_attribute',$industry);
    $customerData->setCustomAttribute('jobProfile_attribute',$job_profile);
    $customer->updateData($customerData);

    $customerResource = $this->customerFactory->create();
    $customerResource->saveAttribute($customer, 'industry_attribute');
    $customerResource->saveAttribute($customer, 'jobProfile_attribute');
}
}


texts: Is it feasible to host Magento on a windows platform for live sites?

texts:
I have Magento running locally on Windows for development and I notice it's very much slower than my Virtual Box version running Linux.

I understand there are a lot of factors involved here i.e Resources available, programs running, background tasks etc and it's true that my virtual box has dedicated resources which are only used by Magento whereas I have lots more going on in Windows.

Does anyone host live Magento sites on Windows? Is it fast enough (will there be a difference assuming there is enough hardware)

Also, should I go with something like Xammp or would a direct installation of PHP on IIS work our faster?


texts: The magento custom sorting functionality is not working

texts:
I am creating a Magento module to add a sorting option of a bestseller on the category page. For doing so I have to override few classes in the core. In the beginning, I have created config.xml file. It is as below

<config>
    <modules>
        <Example_Catalog>
            <version>0.1.0</version>
        </Example_Catalog>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <product_list_toolbar>Example_Catalog_Block_Product_List_Toolbar</product_list_toolbar>
                </rewrite>
            </catalog>
        </blocks>
        <models>
            <catalog>
                <rewrite>
                    <config>Example_Catalog_Model_Config</config>
                </rewrite>
            </catalog>
            <catalog_resource>
                <rewrite>
                    <product_collection>Example_Catalog_Model_Resource_Product_Collection</product_collection>
                </rewrite>
            </catalog_resource>
        </models>
    </global>
</config>

As per the config file, the overriding of toolbar under blocks class is as below

class Example_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
{
    public function setCollection($collection)
    {
        parent::setCollection($collection);
        if ($this->getCurrentOrder()) {
            if($this->getCurrentOrder() == 'qty_ordered') {
                $this->getCollection()->getSelect()
                     ->joinLeft(
                            array('sfoi' => $collection->getResource()->getTable('sales/order_item')),
                             'e.entity_id = sfoi.product_id',
                             array('qty_ordered' => 'SUM(sfoi.qty_ordered)')
                         )
                     ->group('e.entity_id')
                     ->order('qty_ordered ' . $this->getCurrentDirection());

            } else {
                $this->getCollection()
                     ->setOrder($this->getCurrentOrder(), $this->getCurrentDirection())->getSelect();
            }
        }

        return $this;
    }
}

for adding the option in the sorting drop-down, in the category page, in the config.php file is as below

<?php class Example_Catalog_Model_Config extends Mage_Catalog_Model_Config
{
    public function getAttributeUsedForSortByArray()
    {
        return array_merge(
            parent::getAttributeUsedForSortByArray(),
            array('qty_ordered' => Mage::helper('catalog')->__('Sold quantity'))
        );
    }
}

The overriding of collection class in collection.php file is as below

<?php
class Example_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection
{
    protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
    {
       $this->_renderFilters();
       $countSelect = (is_null($select)) ?
           $this->_getClearSelect() :
           $this->_buildClearSelect($select);

       if(count($countSelect->getPart(Zend_Db_Select::GROUP)) > 0) {
           $countSelect->reset(Zend_Db_Select::GROUP);
       }

       $countSelect->columns('COUNT(DISTINCT e.entity_id)');
       if ($resetLeftJoins) {
           $countSelect->resetJoinLeft();
       }
       return $countSelect;
    }
}

The module has been created and I can see the option in the drop-down, but when I click on the Sold quantity option, the Toolbar class that I have overridden has been loaded. But the setCollection method under the toolbar class in not being called at all and the default sorting is happening. Kindly let me know what should I do to make this work properly.


texts: PayPal Express Checkout redirecting to cart: error in exception.log

texts:
Magento CE 1.9.0.1 running on Ubuntu 14.04

PayPal Express Checkout

Not sure at all where this issue cropped up from. In the process of upgrading from 1.7 to 1.9 and had checked PayPal integration off the list. I didn't make any changes outside of styling during the time which this error began occurring.

Here is the logged error:

2014-09-09T20:24:35+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'PayPal NVP gateway errors: Array Correlation ID: 964dcac6ee158. Version: 72.0.' in /var/www/html/app/code/core/Mage/Paypal/Model/Api/Nvp.php:1062
Stack trace:
#0 /var/www/html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1008): Mage_Paypal_Model_Api_Nvp->_handleCallErrors(Array)
#1 /var/www/html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(616): Mage_Paypal_Model_Api_Nvp->call('SetExpressCheck...', Array)
#2 /var/www/html/app/code/core/Mage/Paypal/Model/Express/Checkout.php(381): Mage_Paypal_Model_Api_Nvp->callSetExpressCheckout()
#3 /var/www/html/app/code/core/Mage/Paypal/Controller/Express/Abstract.php(108): Mage_Paypal_Model_Express_Checkout->start('http://staging.p...', 'http://staging.p...', false)
#4 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Paypal_Controller_Express_Abstract->startAction()
#5 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('start')
#6 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#8 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /var/www/html/staging/store/index.php(87): Mage::run('staging', 'website')


texts: I got the error 'Unable to serialize value' after upgrading the magento version to the 2.2.1

texts:
I have upgraded website 2.2.1 and facing Unable to serialize value error in particular product categories.

When I disabled the page cache (FPC) from the admin cache management then it works fine but when I enabled the page cache then I got the error.

But I need to enable page cache for optimization. Can you guys please help me!!!!

  {"0":"Unable to serialize value.","1":"#0 /home/infiniar/public_html/vendor/magento/framework/App/PageCache/
      Kernel.php(153): Magento\Framework\Serialize\Serializer\Json->serialize(Array)\n#1 /home/infiniar/public_html/vendor/
      magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(96): Magento\Framework\App\PageCache\Kernel->process
      (Object(Magento\Framework\App\Response\Http\Interceptor))\n#2 /home/infiniar/public_html/vendor/magento/framework/
      Interception/Interceptor.php(146): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(Object(
      Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(
      Magento\Framework\App\Response\Http\Interceptor))\n#3 /home/infiniar/public_html/vendor/magento/framework/
      Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->
      Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))\n#4 /home/infiniar/
      public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26):
      Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)\n#5 /home/infiniar/
      public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(
      Object(Magento\Framework\App\Response\Http\Interceptor))\n#6 /home/infiniar/public_html/vendor/magento/framework/App\
      /Bootstrap.php(256): Magento\Framework\App\Http->launch()\n#7 /home/infiniar/public_html/index.php(39):
      Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))\n#8 {main}","url":"/products/
      computer-cases.html","script_name":"/index.php"}


texts: Switch currency based on custom customer attribute

texts:
If all my customers had a custom field containing either 'GBP' or 'EURO' for example, is it possible for the store to switch currency based on this custom field value once they login?

So EURO customers see Euro pricing, and GBP see GBP pricing.


texts: Magento 2 - Prevent addresses to be saved when placing order

texts: When a customer is placing an order its addresses are automatically saved, I would like to prevent this behavior but I'm not able to find in which file Magento is saving addresses ?


texts: Recurring Profiles with Authorize.net Automated Recurring Billing

texts:
I've read that Recurring Profiles only work with Paypal. However Authorize.net has an add on service called "Automated Recurring Billing" which is a tool for submitting and managing recurring, or subscription-based, transactions. http://www.authorize.net/solutions/merchantsolutions/merchantservices/automatedrecurringbilling/

I'm wondering what needs to be setup for this to work with Magento's Recurring Profiles?


texts: How to display text if Product Type is Equal to?

texts:
I'm trying to display some text IF Product Type = General. This edit is being made within a phtml file.

How'd I'd normally do it for a Product Attribute called Example

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

<?php if ($_product->getExample()): ?>

Example

<?php endif; ?>

I'd also like to know how that could be achieved by checking for an Attribute Set.


texts: Emails footer.html not in en_US localization (multistore)

texts:
I think since an update to 1.9.2.4, I have problems with the email footer (/app/locale/en_US/template/email/html/footer.html). In my default-shop in german (de_DE) the content of footer.html is shown, in other stores with en_US, not. The integration is the same {{template config_path="design/email/footer"}}, the content nearly (only translated).

What could be the problem?


texts: custom module not working after installation of new extension

texts: i have created a custom module form and then for email functionality i installed Mageplaza extension but then my form module stopped working and when i disable Mageplaza extension module then only custom module is working. I don't understand why this happening to me. i am new to magento and want to create a form that sends email notification to admin and customer that is why i installed smtp extension but due to this my module is not working. any help will be appreciated


texts: Magento 2 Add new column in Customer Page from data from database

texts:
I would like to ask if there is an effective way to add column in Customer's Page Grid in magento admin. I have viewed all tutorials and same problems in the web but no luck on displaying the data. I would like to display the updated_at column from the database to customer's page grid

Please refer to the attached email.

Thank you


texts: Discount on certain grand total of a specific category

texts:
What is the best way to do this discount on a category level? That category is a specific brand which 93 products there all apply so i don't want to make a ton of actions and conditions. Is this possible?

11.88 total give 3.96 discount
20.88 total give 6.96 discount
29.97 total give 9.99 discount


texts: I customized luma-theme and every thing is fine but header is not displaying on checkout page


texts:
I'm creating a service to import data from another cart to magento. Due to the amount of data we're importing, I'm importing straight into the magento db to create the customers, addresses, orders, products, etc.

Can someone point me to the best way to add a column to the tables that will hold the old store ids for cross referencing back to the old data - AND for it to be seen in admin.

Thanks


texts: how to reproduce password hash from password

texts:
I need to write php script to convert password value to password hash value.

for example convert the below password into password hash as per magento 2 format.

qwer@123 -> b3ef5674b8ae2a4ce0cefb10671fb5b2546475b020548275cad2ea070f2d435c:pQJccCQInyMFaDzVyqCbYCGE56o6avDo:1

any help would be much appreciated


texts: 500 internal server error after terminal commands

texts:
I have an issue with Magento 2 commands. Every time I do :
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
bin/magento cache:clean
rm pub/static, etc...
...
I get 500 internal server error and I need to refresh 2 to 5 times my browser to see my changes.
Anyone knows what's happening ?
Thank you


texts: Issue while reindexing customer_grid 2.1.7

texts:
I have migrated the data from m1.9 to m2.1.7 but I find that customers are not loaded into the grid where I checked the table customers are present.

As I googled I tried to update the indexer_status table and do a reindex for customer_grid

It throws me "Invalid foreign key" any help would be appreciated


texts:
So I'm creating a plugin wherein a customer can have grocery lists.

I have two created models - GroceryList and GroceryListItem. A grocery list contains one or many grocery list items. I can fetch data using GET /V1/grocerylist that fetches grocery lists for the logged in costumer.

This is the example response:

// GET /V1/grocerylist
[
    {
        "list_name": "Daddy's grocery list",
        "items": [
            {
                "name": "shampoo"
            },
            {
                "name": "soap"
            }
        ]
    },
    {
        "list_name": "Mommy's grocery list",
        "items": [
            {
                "name": "corned beef"
            },
            {
                "name": "baby diapers"
            }
        ]
    }
]

This data, however, are seeded data. So, I haven't created an API endpoint for creating a grocery list (POST /V1/grocerylist). My model classes already contain getter and setter methods (together with the corresponding API data interface, resource model classes, collection classes -- all barebones, just to make it work), but I have no idea how to associate GroceryListItem to GroceryList, and I'm not even sure I'm doing getItems() method right.
And I think it's not as simple as this --

$this->setData('grocery_list_item', $items);

since this is not a simple field in a record (e.g. name of the grocery list).

My POST /V1/grocerylist right now accepts this request body:

{
    "data" :{
        "list_name": "New grocery list",
        "items": [
            {
                "name": "new item 1"
            },
            {
                "name": "new item 2"
            }
        ]
    }
 }

My expected results are:

Return what's mentioned in data attribute (for testing purposes only)
Save the grocery list, together with the respective items to database

Here are some of the related files:

Model/GroceryListRepository.php

<?php
class GroceryListRepository implements GroceryListRepositoryInterface
{
    /**
     * @param int $customerId
     *
     * @return \Grocer\GroceryList\Api\Data\GroceryListInterface[]
     */
    public function getList($customerId)
    {
        return $this->listCollectionFactory->create()->getItemsByColumnValue('customer_id', $customerId);
    }

    /**
     * @param int $customerId
     * @param \Grocer\GroceryList\Api\Data\GroceryListInterface $data
     */
    public function createList($customerId, $data)
    {
        // TODO: Create grocery list
    }

Model/GroceryList.php

<?php
/*...*/
use Grocer\GroceryList\Model\ResourceModel\GroceryListItem\CollectionFactory as ItemCollectionFactory;
/*...*/

class GroceryList extends AbstractModel implements GroceryListInterface
{

    /*...*/

    public function __construct(ItemCollectionFactory $itemCollectionFactory)
    {
        $this->itemCollectionFactory = $itemCollectionFactory;
    }

    /**
     * @param GroceryListItemsInterface[] $items
     * @return $this
     */
    public function setItems(array $items = null)
    {
        // TODO: Set grocery list items to grocery list
    }

    /**
     * @return GroceryListItemsInterface[]
     */
    public function getItems()
    {
        return $this->itemCollectionFactory->create()
            ->getItemsByColumnValue('list_id', $this->getId());
    }

    /*...*/

}

Please enlighten me on this matter. Thank you.


texts:
I am trying to retrieve customer data with customer Object.

Below is the code:-

protected $customerRepository;
public function __construct(
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
) {
   $this->customerRepository = $customerRepository;
  }

public function getUser($userId) {
    $customerObj = $this->customerRepository->getById($userId);
    $customerEmail = $customerObj->getEmail();
    $customerAmount = $customerObj->getAmount();
}

I am getting below error when used above code:-

 Uncaught Error: Call to undefined method
 Vendor\\Module\\Model\\Data\\Customer::getAmount()

So I am using below code now to get amount value by thinking amount value is not set for that customer:-

 if(!isset($customerObj->getAmount())){
    $amount= '';
}else{
    $amount= $customerObj->getAmount();
}

Now I am getting below error:-

  PHP Fatal error:  Cannot use isset() on the result of an expression (you can use "null !== expression" instead)

How can I check the condition if that attribute value is not set, then I will set it as empty.

Is that can be checked? Please, anyone suggest me


texts: Change product attribute type in magento 2

texts:
Hope everything is well at all of your end.
I am changing type of product attribute. But I am bit confuse after changing type of attribute, it will assigned to all products the same or not.
Please share your thoughts.


texts: Exporting Products with their website specific attributes

texts:
I have a product that has Tax Class "Taxable Goods" on one website A but has Tax Class "None" on a website B.  When I export it it comes out with 'tax_class_name' as 'Taxable Goods'.  I was expecting it to export both values, one for site A and the other for site B.
I think it is giving the site A value because it's the default value.  Is there any way to make it export both values?


texts:
In my custom theme,

i cannot get mini cart and checkout cart delete confirm popup can anyone help how to get it in custom theme.


texts: How to create a static block to get other products from the current page PRODUCT MANUFACTURER

texts:
I need to create a static block and place the block in view.phtml.

Static block should collect and display 5 random products from the Manufacturer.

Is it possible? if yes anybody give me the code?


texts: How can I translate main menu navigation for multiple languages?

texts:
I'm trying to translate the Main Menu into different languages but I can't figure out how this is done since all the translate I have done has been done through static blocks.
The main menu shown below with the links needed to be translated to with red arrows are not a static block.
This menu includes home and the option to add whichever "categories" you create as links to this main menu.
Any help?  would be greatly appreciated

here is the page incase code needs to be inspected: https://fixlcdscreens.com/italian/


texts: Updating cms page content for specific stores

texts:
Have two pages where i wanna update the content, both with the identifier 'home', one is on default(0) and the other is on store german(2).

If i do the following iteration, i get the correct pages but save() tries to save a new page what causes an exception.
What's wrong or what can i change?

$oMagePageModel = Mage::getModel('cms/page');
foreach ($aHomePageTeaserContent as $iStoreId => $sHomePageTeaserContent) {
  $oMagePageModel->setStoreId($iStoreId);
  $oMagePageModel->load('home', 'identifier');

  $sHomePagePrevContent = $oMagePageModel->getContent();
  $oMagePageModel->setContent($sHomePagePrevContent . $sHomePageTeaserContent);

  $oMagePageModel->save();

  $oMagePageModel->clearInstance();
}


texts: What Version of Magento CE adopted Magento Connect 2.0?

texts:
What's the first version of Magento Community edition to ship with a Magento Connect 2.0, and what's the general history of this feature?

That is, to download an extension from Magento Connect you need to choose a Magento Connect 1.0 or 2.0 URL

Which version of Magento Connect started requiring a 2.0 URL?  I have vague memories of a version of CE shipping with 2.0 support built in (sometime around 1.4.2 or 1.5.0) before the 2.0 system was ready. However, I can't remember the specifics and was hoping to avoid an archeology expedition to figure this out myself.


texts: how to set Postion of static block on homepage?

texts:
I have created a static block programmatically on homepage. but it shows after the heading title. i want to set position for it.

I want this New Block block between Registered Customer and New Customer blocks. anyone help me how can i do this programmatically?

code for this:
in layout :

<block class="Magento\Customer\Block\Form\Newblock" name="customer.newblock" template="form/newblock.phtml"/>

In block:

 <?php
 namespace Magento\Customer\Block\Form;
class Newblock
   extends \Magento\Framework\View\Element\Template
{
   public function getTitle()
  {
      return "New Block";
  }
}

In templates :

<?php echo $block->getTitle(); ?>


texts:
I know that this is a silly question, and ignores all UX practices, but I have a requirement to call the OneStepCheckout from LotusBreath into a lightbox or popup.

Is this possible?

Last resort would be to call the normal checkout within an iframe, but I'm not keen on that as a solution.

EDIT: moved from Stackoverflow


texts:
While doing a Google search for a brand we carry, I noticed the page title had our name listed twice in the search results.  Is there something I can do to change the appearance of the title since obviously I don't want the name to appear twice.

http://vvcap.net/db/mOCAEIchArBxcm1gdYXH.htp


texts: Configuring Magento 2.2.7 document root to pub

texts:
In relation to this earlier question at Difference between root index.php and pub directory index.php in Magento2?

I'm using a cPanel hosted domain and am wondering if I should just set the document root as ~/Magento_Folder/pub in the settings. Will it break anything or do I need access to the httpd.conf files which I can't get to?

Thanks in advance.


texts: Magento 2 - move terms and conditions position in checkout

texts:
By default, when we turn terms and conditions on in Magento 2, it's default position is under/ inside each payment method, and it is not shown until customer have clicked on a payment method. I would like to move the terms and conditions out from payment methods, and make it viewable when page is loaded. In other words, I would simply like to have the terms and conditions displayed same way as it was in Magento 1.9

any ideas?


texts: Magento 2 Enterprise Edition - Need to run app:config:import every time in centralized database

texts:
I am working in centralized database in Magento 2 Enterprise Edition, Every time someone changes anything (even from admin configuration)

I need to run app:config:import everytime if anythings changed

  1 exception(s): Exception #0
  (Magento\Framework\Exception\LocalizedException): The configuration
  file has changed. Run app:config:import or setup:upgrade command to
  synchronize configuration.

  Exception #0 (Magento\Framework\Exception\LocalizedException): The
  configuration file has changed. Run app:config:import or setup:upgrade
  command to synchronize configuration.


texts:
I'm being attacked by .ru bots on my Magento 1.3.

Is there any plugin that works for this old version?  Or a way to block them?


texts: How to get Email address in my phtml file in magento 2

texts:
I want to display email address stored in backend into my header part.
How can i get email address into my header.phtml file in magento2


texts: Magento 2 "All Customers" page does not work

texts:
Why doesn't load this page?
What is wrong?


texts: How does Magento2 generate the specific ExtensionFactory and ExtensionAttributeInterface?

texts:
I would like to wrap my head around using extension attributes, for example for quote items.
It is no problem adding a custom attribute to such an entity using a setup class like in Magento 1, this isn't what this question is about.
At the moment the magic overwhelms me when I want to expose such an attribute that was added by an extension via the entities API as an extension attribute.

UPDATE: I know how the regular factories are generated. This question is about the special factories that instantiate the generated implementations for the generated extension attribute interfaces.

Here are the steps I take to get it to work. I'm adding these so whoever attempts to answer doesn't need to go into those details.
My question is HOW or WHY it works.

Steps for exposing an extension attribute via an entity API:

Create an etc/extension_attributes.xml that adds the attribute to the entity interface
Create a plugin to add the attribute value to the entities ExtensionAttributes instance.

In order to do the second point, the entities ExtensionAttributes instance is needed. For this reason the plugin depends on a factory, which the object manager supplies via DI.

For the quote item example Magento\Quote\Api\Data\CartItemExtensionFactory has to be used.
I guess the type of this factory somehow must be the trigger for the generation magic.

Magento then generates the matching interface \Magento\Quote\Api\Data\CartItemExtensionInterface with the setters and getters for all the extension attributes.
However, it does not seem generate the concrete implementation for that interface. At lease PHPStorm isn't seeing it.

How does Magento gather the information it needs to generate the class? How can the generated interface methods be called on a concrete instance? Is it a class that just gets generated in memory only?

I'm happy it works, but that isn't really satisfying. Magentos capability to use attributes created automatically by extensions is one key factor to its success. As a module developer, I believe I need a thorough understanding of the whole process.
Should I have time I'd just dig into this myself, but I would prefer if I just could get an explanation.

UPDATE 2: Took a little time to read through \Magento\Framework\Api\Code\Generator\ExtensionAttributesInterfaceGenerator and \Magento\Framework\Api\Code\Generator\ExtensionAttributesGenerator. Now I at least have a rough idea what is going on. If no one beats me to it I'll write a description of the full process at one point, as I think it would be a useful reference.


texts: Fetch sub categories of parent Magento 1.9.2

texts:
I am attempting to fetch the sub-categories of a parent category in Magento 1.9.2. I've created a file 'subcategories.phtml' and reference this in a static block. I know the reference in the static block works as it shows the words 'test'.

However, if I update the file with the code below it shows only a blank page. Can anyone please advise an update to get this working?

<?php
//If there are sub categories
$categories = $this->getCurrentChildCategories();
$categoriescount = $this->getCurrentChildCategories()->count();
if ($categoriescount > 0):
?>

    <?php
    //Loop through categories
    foreach ($categories as $category):
    ?>

        <a href="<?php echo $this->getCategoryUrl($category)?>" class="cat-image">
        <?php
        // If there is a thumbnail set for the category - Display it
        if($imgUrl = Mage::getModel('catalog/category')->load($category->getId())->getThumbnail()):?>
        <img src="<?php echo $this->getBaseUrl()."media/catalog/category/".$imgUrl ?>" width="220" height="110" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
        <?php endif; ?>

            <a href="<?php echo $this->getCategoryUrl($category)?>" class="sub-link"><?php echo $category->getName()?>
            <a href="<?php echo $this->getCategoryUrl($category)?>" class="btn">View All

    <?php endforeach; ?>

<?php else:?>

No Sub Categories

<?php endif; ?>


texts: Magento CE 1.9 Rest Api - Redirecting to Customer Account after submitting Customer Login form to generate access token?

texts:
I am getting issue while creating Magento Rest Api for Mobile Application.
I have a php file containing logic to access Magento Rest Api.
Whenever I am hitting the file it is redirecting to me customer authorization login form after entering the details it sending to customer dashboard but i want it to redirect to my php file with json response.
My php file Code is :

$callbackUrl = "host/Makery/prashant.php";

$temporaryCredentialsRequestUrl = "host/Makery/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);`

$adminAuthorizationUrl = 'host/Makery/oauth/authorize';`

$accessTokenRequestUrl = 'host/Makery/oauth/token';`

$apiUrl = 'http://127.0.0.1/Makery/api/rest';`

$consumerKey = 'ed28ffc6263b00337cb9de3eaae17b1d';`

$consumerSecret = '045422b7d1cb5c5bfb025c4411a18162';`

session_start();`

if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {`

     $_SESSION['state'] = 0;`

}

try {

      $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;`

      $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);`
    $oauthClient->enableDebug();`

    if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
        $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
        $_SESSION['secret'] = $requestToken['oauth_token_secret'];
        $_SESSION['state'] = 1;
        header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
        exit;
    } else if ($_SESSION['state'] == 1) {
        $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
        $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
        $_SESSION['state'] = 2;
        $_SESSION['token'] = $accessToken['oauth_token'];
        $_SESSION['secret'] = $accessToken['oauth_token_secret'];
        header('Location: ' . $callbackUrl);
        exit;
    } else {
        $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);

        $resourceUrl = "$apiUrl/products";
        $oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json'));
        //$productsList = json_decode($oauthClient->getLastResponse());
        //var_dump($productsList);
        echo $oauthClient->getLastResponse();
    }
} catch (OAuthException $e) {
    print_r($e->getMessage());
    echo "&lt;br/&gt;";
    print_r($e->lastResponse);
}


texts:
I'm trying to import more than 1000 products.
And import takes like 10s or less and hangs, imports like 10 products.. checked system.log only found warnings like  ERR (3): Notice: Undefined index: _media_lable
Tried to increase memory limit but no luck as well..
Anyone know the solution? Any information would be very helpful.


texts: Change catalog product layout view by code?

texts: My catalog product use 3 Columns Layout. The layered navigation in the right The product in the center The cart in the left. my problem when i don't have a product in the category the right column is empty. I wish when my category is empty ma catalog product transform from 3 columns to 2  columns. Can i do that by code ?


texts:
I have updated Magento version 2.3.5-p1 to Magento 2.4.0 but after upgrade products not showing in front side.
I have reset index also it's showing valid

I've tried the following things in an attempt to fix it, but none of them helped:

Re-indexing Checking Visibility is set to Catalog & Search for all
products
Checking Status is set to Enabled for all products
Checking   Inventory is greater than 0 and status is set to 'In Stock' for all
products Checking Website is set to base for all products
Flushing all Caches
Switching to default Luma theme to see if it was a theme bug (didn't work)
Disable All 3rd Party plugin.
In Product collection, it's showing 0 counts but when I run collection query in DB then products come in result
Source assigned to the website


texts:
I have a Magento 1.14 with Magmi installed, so my server notified me that I have an infected with Malware with this message below (it's an encrypted).

  Warning: File possibly compromised: ./magmi/plugins/shell.php
  (php.malware.generic.040). Manual review recommended.

Is it an attack?


texts:
I would like to display total quantity of items in cart in the minicart. Basically, we sell items in multiple quantities inside a box, if a user adds 1 box, technically they are adding 10 items. 1 box holds 10 items in it. When I look at checkout and header cart dropdown, it shows as 1 item in cart, however I want it to show me quantity count in cart. I want it to show me the total quantity instead of total item.

For Example :

Item 1 : Qty 10

Item 2 : Qty 20

so currently is showing 2 items in mini cart
but i want show number of product quantity in mini cart

so it should show 30 Qty in mini cart

Thanks in advance

Here's a screenshot of what I meant


texts: Is there any code for disposble email block in the Magento 1.9

texts:
I am getting a lot of fakes registration and form submission on WordPress and Magento 1.9. Please suggest some ideas.
Thank you


texts:
Magento2.2.7.

Want to auto select first shipping method while multiple shipping there or auto select while single method there on checkout page.

Already try this solution but not working for me.


texts: How to install Magento PWA Studio on DigitalOcean?

texts:
I have an installed & working Magento 2.4.1 on a DigitalOcean server and trying to install a PWA Studio on top of it (on the same server).
Currently, the PWA Studio is somehow installed by following this (https://magento.github.io/pwa-studio/venia-pwa-concept/) guide but it’s not working properly.
I also installed UPWARD connector together with UPWARD-PHP and configured it in admin panel and now on some pages I see the following error: {"error":"No definition for veniaResponse.status"}.
You can access the site here: 46.101.96.222.
Can you help or share a step-by-step guide on how to install it on DigitalOcean?
Thanks in advance!


texts:
I wonder if it is possible to use a DOT (.) in a product URL in Magento. I want to create a product URL that looks something like this:

http://www.domain.com/galaxy-tab4-10.1.html

But when I try to do this then after saving the product the DOT in 10.1 is automatically changed in a DASH (-) and the URL becomes:

http://www.domain.com/galaxy-tab4-10-1.html

I have seen other websites that have DOTs in the path part of their URLs. I'm not sure why Magento doesn't accept them.

Any thoughts are welcome!