texts: You are submitting requests too quickly. Please retry your requests at a slower rate. Amazon API

texts:
Hi this is the error Im getting when calling the api from amazon on my magento products , I get few responses back and then this error at the bottom :

Fatal error: Uncaught SoapFault exception: [aws:Client.RequestThrottled] AWS Access Key ID: *****************. You are submitting requests too quickly. Please retry your requests at a slower rate. in /var/www/html/AmazonApi.php:93 Stack trace: #0 /var/www/html/AmazonApi.php(93): SoapClient->__soapCall('ItemLookup', Array) #1 /var/www/html/apicall/itemSearch.php(35): AmazonAPI->sendRequest(Array) #2 {main} thrown in /var/www/html/AmazonApi.php on line 93

The question is how to slow down number of requests ?

This is my amazon api :

AmazonApi.php

class AmazonAPI{
private static $instance;

private $public_key;
private $secret_key;
private $associate_tag;//This is only for Amazon affiliates

private $wsdl_url='http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl';
private $webservices_url='https://webservices.amazon.com/onca/soap?Service=AWSECommerceService';

public function __construct($publicKey, $secretKey, $associateTag){
    if(!empty($publicKey)){
        $this->public_key = $publicKey;
    }

    if(!empty($secretKey)){
        $this->secret_key = $secretKey;
    }

    if(!empty($associateTag)){
        $this->associate_tag = $associateTag;
    }
    }

    //Send a request to amazon
    public function sendRequest($request_params){
    $params['Request']=$request_params;
    $operation=$request_params['Operation'];

    if(isset($this->associate_tag)){
        $params['AssociateTag']=$this->associate_tag;
    }

    $soapy=new SoapClient(
        $this->wsdl_url,
        array('exceptions'=>1)
    );

    $soapy->__setLocation($this->webservices_url);

    $current_timestamp=gmdate("Y-m-d\TH:i:s\Z");
    $req_sig=$this->createSignature($operation,$current_timestamp);

    $headers_array=array(
        new SoapHeader(
            'http://security.amazonaws.com/doc/2007-01-01/',
            'AWSAccessKeyId',
            $this->public_key
        ),
        new SoapHeader(
            'http://security.amazonaws.com/doc/2007-01-01/',
            'Timestamp',
            $current_timestamp
        ),
        new SoapHeader(
            'http://security.amazonaws.com/doc/2007-01-01/',
            'Signature',
            $req_sig
        )
    );
    $soapy->__setSoapHeaders($headers_array);

    return $soapy->__soapCall($operation,array($params));
    }

//Create signature for request
protected function createSignature($operation,$timestamp){
    $the_string=$operation.$timestamp;
    return base64_encode(hash_hmac("sha256",$the_string,$this->secret_key,true));
}
}

itemLookup.php

  <?php
   require('../AmazonApi.php');

  //Create API access object
  $public_key = 'PUBLIC-KEY';
  $secret_key = 'SECRET-KEY';
  $associate_tag = 'TAG';
  $amazon_api = new AmazonAPI($public_key, $secret_key, $associate_tag);

         $collection = Mage::getModel('catalog/product')
->getCollection()
->addStoreFilter(Mage_Core_Model_App::ADMIN_STORE_ID) // default store
->addAttributeToSelect('sku');

   //  foreach($collection as $product)
{
  // $product->getSku();
 //$asin = substr($sku,0,10);
 }

 //Array of request parameters
 foreach($collection as $product)
 {
 $params_array = array(
'Operation' => 'ItemLookup',
'IdType' => 'ASIN',
'ItemId' => $asin = substr($sku,0,10) ,
'ResponseGroup' => 'Tracks'
 );

// returns a list of items for the search query 'Slow Magic'
$response = $amazon_api->sendRequest($params_array);

echo '<pre>';
print_r($response);
echo '</pre>';
}
foreach($parsed_xml->OperationRequest->Errors->Error as $error){
echo "Error code: " . $error->Code . "\r\n";
echo $error->Message . "\r\n";
echo "\r\n";
}

Thank you for any useful information.


texts: How to increase session time of magento 2.4 admin panel

texts:
It is annoying to log in to the magento admin every few minutes, I find this solution to increase the time I hope it helps you
en la version actual 2.4 debes ir
Store-> Configuración-> Avanzado-> Admin-> Security-> Admin Session Lifetime (segundos)


texts: how to apply and show qty based discounts

texts:
I'm pretty new to using Magento, I am running 1.9 CE. I have messed about with configurable products, bundled, simple and grouped - but in all honesty I think I'm going about this the wrong way.

Let me set the scene...

The store sells single sheets of A4 paper in various different colours.
I have added the A4 sheets as simple products.

I'm looking for advice on how best to collate these products with various options and promotions, for example - I have then created  a grouped product named A4 and added all the different colour simple products as associated products linked to the grouped product.... this then gives the end user the ability to set the quantity for the different colours.  For example,

End user visits A4 Grouped Product and is presented with the different colours for each sheet. They can then select the QTY of each colour that they would like.

1x A4 Paper (any colour) cost £5.00
5x A4 Paper (any colour) cost £15.00

I have managed to create a Shopping Cart Rule which applies a discount  when applied to the cart however, I need the ability to show the price prior to being added to the cart.

I cannot seam to apply catalog price rules using QTY.

Any assistance would be greatly appreciated!


texts: I need to change "h2 class" in the logo for the seo

texts:
I know where magento put the phtml and css file but i don't know css style.

An SEO expert, told me to remove the h2 from their.
The problem is that in the theme, the h2 has a style applied

How can I change this parameter to maintain this style ?


texts:
In my category/view.phtml, I have tried this code for some test purpose. However I am facing some problems with my filtering. Filtering code look like this.

//gets current category
$current_category = Mage::registry('current_category');

//get essential datas
$category_id = (int)$current_category->getId();
$store = (int)$current_category->getStoreId();

//loads parent category lies in level 2
$parent_category = Mage::getModel('catalog/category')->getCollection()
                        ->addAttributeToSelect(array('level','id','is_active','children'))
                        ->addAttributeToFilter('level', array('eq' => 2))
                        //->addAttributeToFilter('store_id', array('eq' => $store))
                        ->addAttributeToFilter('is_active', array('eq' => 1))
                        //->addAttributeToFilter('children', array('in' => array($category_id)))
                        ->load();

print_r($parent_category->toArray());

It gives me this result in frontend

Array
(
    [10] => Array
        (
            [entity_id] => 10
            [entity_type_id] => 9
            [attribute_set_id] => 12
            [parent_id] => 3
            [created_at] => 2007-08-23 11:45:22
            [updated_at] => 2008-08-08 00:01:18
            [path] => 1/3/10
            [position] => 10
            [level] => 2
            [children_count] => 2
            [is_active] => 1
            [children] => 22,23
        )

    [13] => Array
        (
            [entity_id] => 13
            [entity_type_id] => 9
            [attribute_set_id] => 12
            [parent_id] => 3
            [created_at] => 2007-08-24 13:31:01
            [updated_at] => 2008-08-08 00:02:23
            [path] => 1/3/13
            [position] => 13
            [level] => 2
            [children_count] => 13
            [is_active] => 1
            [children] => 8,12,15
        )

    [18] => Array
        (
            [entity_id] => 18
            [entity_type_id] => 9
            [attribute_set_id] => 12
            [parent_id] => 3
            [created_at] => 2007-08-24 15:44:31
            [updated_at] => 2008-08-07 23:54:16
            [path] => 1/3/18
            [position] => 18
            [level] => 2
            [children_count] => 6
            [is_active] => 1
            [children] => 4,5,19,24
        )
        ...
)

I am facing two problems with this code

Problem-1. shows error when I add store filtering : See my code. When I uncomment this line of code ->addAttributeToFilter('store_id', array('eq' => $store)), it shows following error.

Fatal error: Call to a member function getBackend() on a non-object in /home/rajeev/public_html/magento/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816

What is the reason for this error ? (store_id is 1 here)

2.problem-2 : children filtering is also not working

I am standing in category page which has an id 12. With that said, if I uncomment this line ->addAttributeToFilter('children', array('in' => array($category_id))) (commented the store filtering line), it returns me null. It can't, because as you can see I have a category available with category-12 as its children. (check category 13 above).

So why does it returns empty result ?

Please point out the errors that I have made in my code.

Thanks


texts: How does Magento 2 pick up the best seller products? What is the logic behind that? (I have the code ,  but want to know the logic)


texts: Magento 2 css/js/urls not working after change domain name

texts:
After changing domain name css js and links admin are not working in my site http://www.shopbrow.com/ i have change the base url and secure url and clean the cache folder after changing it but its not work
After that i have followed the following tutorial
Magento 2 CSS and JavaScript not loading from correct folder

its also not working for me can any one help me


texts: Magento backend Dashboard is empty when Login?

texts:
Friends i had installed a Extension called Update Layout a purchased extension. after installation i had cleared my cache storage and logged out & logged in. . while logging in the dashboard is showing nothing. so please help me out here. .
i  had attached the snapshot of my login page.


texts: Bank transfer payment not working for not logged in customers?

texts:
I am running a Magento 2.1.12 shop and set up bank transfer payment. It works for logged in users. Not logged in users get a 302 redirect in checkout/onepage/success/ and are being redirected to the cart, no order is placed. The logs show nothing suspicious.

Any idea where to start looking?

Thanks!


texts: how can i use the magic methods correctly?

texts:
I've thought about magic methods(based on php)in Magento help developers work more easily.Especially, getter method is pretty useful to create own custom module.

As far as i know, get methods has some rules for existing

use camelCase like getName() , getLastName()
format like $this->getVariable

Actually, i've search on Google, i couldn't find the what extactly i have to write on gray part. I mean that i don't know what i write as variablemeans extactly.

is it from field name base on table ? or any other stuffs?

And i want to know the part what i checked as $order->getShippingdescription() , $product->getName(). is it called frontname?

Thank you so much!


texts: How to create "Delete And Continue" button on UI Component Form

texts:
I'm new at Magento 2, and I'm trying to create a custom button on an UI Component form. But I don't know what to put in the "actionName" field of the button.
When I put the "save, back, delete, save_and_continue" it works, but I'm trying to call another controller that I made, that is "SaveHeader" but I don't know where I configure this...
I want to use this button as a "delete and continue"...
Is there any way to create a custom "action name" for the button ?
My intention is only to delete a few fields of the form and continue editing.
<button name="delete_header" >
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="buttonClasses" xsi:type="string">custom-button-class</item>
                <item name="actions" xsi:type="array">
                    <item name="0" xsi:type="array">
                        <item name="targetName" xsi:type="string">api_data_form.api_data_form_data_source</item>
                        <item name="actionName" xsi:type="string">SaveHeader</item>
                    </item>
                </item>
            </item>
        </argument>
        <settings>
            <displayAsLink>false</displayAsLink>
            <title translate="true">Delete Header</title>
        </settings>
    </button>


texts: How to display New product in home page slider? Magento 1.9

texts:
Can you please help to display new product/Sale product on home page slider.

on my website only out of stock old product coming. I just want to hide the out of stock products from Home page slider.

magento 1.9


texts: magento 1.9 Navigation left side menu keeps going to middle column

texts:
Problem I'm having;

I'm trying to add a Left sidebar navigation, I got advice yesterday to edit my layout.xml, catalog.xml and create a myleft.phtml file. I even set the layout to 2 column with left bar in the back end. I have done all of this but still no left navigation. So I installed this addon

Which even though I set in the back end settings to "left column" it still ends up on the top above all other content as shown here

I will post a new comment with my layout.xml and catalog.xml as I can't post any more characters

Thanks,
Stephen


texts: Magento2: How to get free shipping product details on cart page?

texts:
How to get free shipping product details on cart page?

I have added some product under the cart price rule and set free shipping condition.

I need to display free shipping promotion message on the cart page. Message should be showing only which free shipping product rules apply.

Magento 2.x


texts: Magento admin login and admin panel are extremely slow

texts:
I have problem with speed of magento admin panel, login in backend and other sections of admin panel are very extremely slow.
I did all items in below links but speed did not change:

https://www.cloudways.com/blog/how-to-speed-up-magento-admin-panel/
Speeding up magento backend (now slow)
https://suyati.com/blog/speed-up-magento-admin-backend/


texts: Magento 2: How do I modify the layout of all pages using the 2columns-left layout?

texts:
According to the Magento 2.1 frontend developer documentation (http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-types.html#layout-types-page) it should be possible to create a 2columns-left.xml specific layout file at <Magento_Theme_module_dir>/view/frontend/page_layout/2columns-left.xml but I do not wish to do this for a specific module. I need to modify the layout of all 2columns-left pages (from any module) for my entire theme.

I've tried creating the file at <Magento_Theme>/Magento_Theme/view/frontend/page_layout/2columns-left.xml but it is NOT working, it seems like this file is being completely ignored.

I have successfully modified page layouts using other handle specific layout files but can not get it to work with any of the CMS page selectable handles (2columns-left, 2columns-right, etc).

Has anyone else experienced this problem and found a solution?


texts: Magento 1.8 - Cant access frontend - Access Forbidden - 403 Status Code

texts:
I can't access my magento frontend. I get:

  Access forbidden! You don't have permission to access the requested
  object. It is either read-protected or not readable by the server.

Backend works.
I executed this inside the project folder to fix the permissions:

find . -type f -print0 | xargs -0 chmod 644
find . -type d -print0 | xargs -0 chmod 755

But that was not changing anything. I also deleted the cache after it.

I also tried:

find . -type f -print0 | xargs -0 chmod 777
find . -type d -print0 | xargs -0 chmod 777

...temporarily. No difference...

I also deleted my .htaccess file and tried it again. But still Access forbidden!

Im not sure what is going on?


texts: Overridden (extended) Block function still called

texts:
I have made an extension for magento 2 (that filters the products shown depending on user). I have extended the file module-catalog/Block/Product/ListProduct.php for this and overwrittien the _getProductCollection() function. Whenever a user views products from the menu, the new _getProductCollection() function is called from the new Block file and the products are filtered. Perfect so far.

But whenever a user tries to view products by searching them (instead of using the menu) the products are not filtered. It turns out that when using search the old _getProductCollection() from the extended Block file module-catalog/Block/Product/ListProduct.php is called.

I find this very strange since it is the same .phtml file that is used in both cases (module-catalog/view/frontend/templates/produc/list.phtml).

So the problem is that both the new and the old (overwritten) block files are called from the same .phtml file. I have no clue how to proceed so any help is appreciated.


texts: XS Vulnerability - Failed.XSS Patch not detected (APPSEC-1716) - How to fix?

texts:
Apply the Magento 2.2.5/2.1.14 Security Update immediately. Review your site for signs of compromise. Find more information about Security Best Practices.
This issue is reported in a security report by the security scan tool for Magento Ver. 2.3.6 and there is no patch available at the download link but the complete release of Magento 2.2.5.

Status: FAIL

Group: Patch

Scan Name: XS Vulnerability


texts: How can I exclude a product from a promotion code

texts:
I'm running Magento version 1.9.3.6. I have created a promotion code to offer a 10% discount. There are 2 products that I would like to exclude from this promotion code. How can I do that?

I couldn't find any solution for this issue.

Thanks for the help.


texts: Magento 2 - Multi Flat shipping not showing frontend checkout

texts:
I am using Meetanshi Flatshipping extension. I have added flat rate in admin based on country but flat shipping is not showing on checkout page.I have 5 shipping methods for UK, only 4 are showing on checkout. I also add flat rate for Canada but not showing.

I have also used another Flat shipping extension but facing same issue.

Screenshots


texts: Magento 1 - Change Magento custom options date values

texts:
Hello I am simply trying to find the array of defaults for the product custom-option date

my goal is to change the month from "01,02,03....12" to a string with the month name "Jan. , Feb. , Mar. - Dec."

I believe I found the date custom-option file in

app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php

and in there you see the 'month' array being called but I can't find the declaration file.

I am new to this stuff so pardon my ignorance if this is obvious or I am making it more convoluted.


texts: Can I show different image on hover on products?

texts: Can I show a different image when I hover on product image ?


texts: Component Manger/Web Setup Wizard redirects to "updating application" immediately

texts:
I need to install a module via the Component Manager for an M2 2.1.2 instance that seems to be broken here and there to put it midly. There does not seem to be a Composer option, unfortunately, for this module (Shipworks). I'll check with SW, but I'm trying to figure out why the Component Manager is broken.

This instance's Component Manager or Web Setup Wizard as named in the admin menu (mysite.com/setup) immediately redirects to the New Purchases page (mysite.com/update/index.php), where it says "Update application is running" and gets stuck there.

There is no log of any kind, and the page constantly makes a call out to mysite.conm/update/index.php/status every few seconds. to no end Response back is always the same saying isUpdateInProgress is true.

What could be wrong that I can't go to the Component Manager page?


texts: loading custom .phtml template using custom block

texts:
I am trying to load a custom .phtml template using custom block. But the template isn't loading. I saw similar problems here and tried to figure out a solution, but couldn't find out where the problem is. My controller is working correctly. The url http://localhost/magento/test/index loads view correctly, but without testlayout.phtml contents.

Hers's my code

\app\code\local\Impulse\Test\controllers\IndexController.php

<?php

class Impulse_Test_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {
        $this->loadLayout(false);
        $this->renderLayout();
    }

    public function testAction() {
        echo "This is test!";
    }
}

\app\code\local\Impulse\Test\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Impulse_Test>
            <version>1.0.0</version>
        </Impulse_Test>
    </modules>
    <global>
        <blocks>
            <impulse_test>
                <class>Impulse_Test_Block</class>
            </impulse_test>
        </blocks>

    </global>
    <frontend>
        <routers>
            <impulse_test>
                <use>standard</use>
                <args>
                    <module>Impulse_Test</module>
                    <frontName>test</frontName>
                </args>
            </impulse_test>
        </routers>
        <layout>
            <updates>
                <impulse_test>
                    <file>test.xml</file>
                </impulse_test>
            </updates>
        </layout>
    </frontend>
</config>

\app\design\frontend\impulse\theme\layout\test.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <impulse_test_index_index>
        <reference name="content">
            <block type="impulse_test/testblock" name="testlayout_testblock" output="toHtml" template="test/testlayout.phtml"></block>
        </reference>
    </impulse_test_index_index>
</layout>

\app\code\local\Impulse\Test\Block\Testblock.php

<?php
class Impulse_Test_Block_Testblock extends Mage_Core_Block_Template {
    public function methodblock() {
        return "this is returned";
    }
}

\app\design\frontend\impulse\theme\template\test\testlayout.phtml

<?php
    echo $this->methodblock();
?>


texts: Magento 2 : Call Static block wysiwyg images not using editor

texts: Any one have idea for how to call images in Static block not using editor like {{media url="wysiwyg/demo.jpg"}}?


texts: Magento 2 adminhtml getUrl not working as expected

texts:
I want to make a post request to a backend custom controller, which does not work

My controller resides in

Namespace/ModuleName/Controller/Adminhtml/Discount/Index.php

<?php namespace Namespace\ModuleName\Controller\Adminhtml\Discount;
class Index extends \Magento\Backend\App\Action
{

    public function execute()
    {
        $discountAmount = $this->getRequest()->getParam('discountAmount');

        die("now");
    }

}

My routes.xml in Namespace/ModuleName/etc/adminhtml/routes.xml looks like this

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="adminhtml" frontName="adminhtml">
            <module name="Namespace_ModuleName" />
        </route>
    </router>
</config>

In my block I'm calling the url by <?php echo $this->getUrl('adminhtml/discount/index'); ?>

This does not seem to create the correct url anyway,because when I try to use this url, it simply redirects to the dashboard


texts: Onepage checkout progress not working anymore

texts:
I've recently (yesterday) upgraded from magento v1.7.7 to 1.9.2.2 . The problem is now that my onepage checkout progress doesn't work anymore. The 4 steps are shown but not the progress of them.

When I'm going the steps he shows in my Network:

But normally he should show something like this:

As you can see there's a difference with prevStep and toStep. Also the progress response isn't empty in the second case ... .

What could be the problem of this?


texts: Magento 2 : Display Custom Product Attribute If it has a Value

texts:
I have created a custom product attribute and added the code below to display them within the grouped product table.

<td data-th="<?= $block->escapeHtml(__('Breaking Strain')) ?>" class="col item">
        <?= $my_attr = $this->getProduct()->getResource()->getAttributeRawValue($_item->getId(),'breakingstrain',$_item->getId()); ?>
</td>

(/public_html/vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml)

However not every product will use this custom attribute, so I don't want the td to be visible if there is no data set within the attribute.


texts: Magento 2.3.5-p1 - Language not changing on home page only

texts:
As the title says, I'm experiencing a rather strange issue on my Magento instance (2.3.5-p1).
We have two languages, English and French, and thus have a language switcher allowing users to switch back and forth. This works as expected on every pages on the site except on the Home Page (as far as I've tested).
You can try this live by going to shop.icrc.org.

Switch the language to "Français". The page reloads, but the language is not updated.
Naviguate to any other page, and the site should now be in French.
From there, go back to the Home Page and the site is back in English.

What is really strange is that:

this behavior does not exist on our staging environment, which is also a 2.3.5-p1 instance.
If you take a look at the Cookies set by Magento, you'll see that the one named store (which I suppose is used to indicate the current store language) is properly set even on the Home Page to the selected language (i.e. It exists with a value of fr after changing the language to "Français"). It's as if the Home Page did not care about the value of this cookie for whatever reason...

Alright, so... I have no idea where to look or investigate to try and fix this problem...
Would anyone have any clue as to what could cause this behavior? Even a somewhat vague intuition would be fine by me... Is this a back-office configuration issue? A code issue? A server misconfiguration? I'll take anything :D


texts:
I'm using cloudflare with magento 2 and their magento plugin says that they purge the cache whenever the magento cache is purged so is there a way to set the time when the magento cache is cleared or does it do it all automatically?

I read that the crontab changes the indexes and sends out email but I saw nothing about clearing the cache


texts: Trying to pass details from last order event/observers

texts:
I am getting this issue now. I can pass the productId but the foreach it looks like it does not work, When customer order 2 items the result i get is just the last item productId.

Here is the code:

class Order_OrderExport_Model_Export
{

    public function exportOrder($order,$sku)
    {
        $dirPath = Mage::getBaseDir('var') . DS . 'export';

        if (!is_dir($dirPath)) {
            mkdir($dirPath, 0777, true);
        }

        foreach ($order->getAllItems() as $item) {

        $data = array(

            'getIncrementId'        => $order->getIncrementId(),
            'created_at'            => $order->getCreatedAt(),
            'customer_id'           => $order->getCustomerId(),
            'customer_firstname'    => $order->getCustomerFirstname(),
            'customer_lastname'     => $order->getCustomerLastname(),
            'customer_email'        => $order->getCustomerEmail(),

            'telephone'             => $order->getBillingAddress()->getTelephone(),
            'street'                => $order->getBillingAddress()->getStreet(),
            'get_city'              => $order->getBillingAddress()->getCity(),
            'postcode'              => $order->getBillingAddress()->getPostcode(),
            'region'                => $order->getBillingAddress()->getRegion(),
            'get_country'           => $order->getBillingAddress()->getCountry(),

            'tax_amount'            => $order->getTaxAmount(),
            'shipping_amount'       => $order->getShippingAmount(),
            'remote_ip'             => $order->getRemoteIp(),

            'total_qty_ordered'     => $order->getTotalQtyOrdered(),
            'subtotal'              => $order->getSubtotal(),
            'grand_total'           => $order->getGrandTotal(),
            'order_currency_code'   => $order->getOrderCurrencyCode(),

    //Here is the output of the items

            'item'                  => $item->getProductId(),

            );

        $xml = new SimpleXMLElement('<root/>');
        array_walk_recursive($data, array ($xml, 'addChild'));
        file_put_contents(
        $dirPath. DS .$order->getIncrementId().'.xml',
        $xml->asXML()

        );
     }

}

The XML i am outputting display only on product. Thank you


texts: Magento2 Display all associated simple products if all of sizes are out of stock?

texts:
sizes options not showing on configurable products if all sizes out of stock.
Any way to show out of stock sizes?


texts:
I have added a attribute "publishers" in product upload form.
The publisher list is coming from ajax call from the database like auto suggestion and showing like drop-down list.

The problem is when I click on the list and set the attribute value though the actual value is showing as the input value, but not saving when I click on save button. What I type in the input field is saving.

I am not sure why this is happening. Please suggest.


texts: Invoice automatically created when i am placing an prepaid(Razor Pay) order in magento 2.2.7?

texts: Can any one help me on this, When I am placing a prepaid order in magento, the invoice gets generated automatically. Before it was I manually created an invoice but now it's automatically genrated,what happened here I don't know. Is this is due to any configuration changes? please answer on this.


texts: Magento: how to use removeItem for js files added by extension programatically

texts:
I have a 3rd party extension adding JS in via an observer:

<?php
class Anowave_Owl_Model_Observer extends Mage_Core_Model_Abstract
{
    public function dispatch(Varien_Event_Observer $observer)
    {
        if (Mage::app()->getLayout()->getBlock('owl') && Mage::app()->getLayout()->getBlock('owl')->getSlider())
        {
            $format = Mage::app()->getLayout()->getBlock('owl')->getFormat();

            if ($format instanceof Anowave_Owl_Block_Format)
            {
                $format->addCss()->addJs();
            }
        }

        return $this;
    }
}

Where addJs is defined in a block class as:

public function addJs()
{
    $script = 'js/jquery-1.11.0.min.js';
    Mage::app()->getLayout()->getBlock('head')->addItem('skin_js', $script);
 }

Rather than hack the module, I'm trying to remove the loaded jquery via removeItem i.e.

   <default>
     <reference name="head">
        <action method="removeItem">
            <type>skin_js</type>
            <name>js/jquery-1.11.0.min.js</name>
        </action>
    </reference>
   </default>

In local.xml. But it does not work.
I know that my syntax and pathing are correct because I can unload/remove other JS files this way in the same folder (ones which are specified by their extension's layout XML instead).
I thought local.xml was processed after all other layout registration steps, but I guess not (?)
So I don't think removeItem in layout is an option.
I'd be willing to use

        Mage::app()->getLayout()->getBlock('head')->removeItem('skin_js', $script);

In a custom module, but how would i know that all the previous addJS() processing has finished executing?

Any ideas or solutions appreciated!


texts: Magento global notification not showing after upgrade

texts:
After the upgrade to Magento to 1.9.2.0 the global message block is not shown anymore. The block is called in the template.

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

Any help will be appreciated...


texts:
Totals block in shopping cart page is stuck.

The Error in console is:

POST http://www.demomage.com/rest/default/V1/carts/mine/totals-information 500 (Internal Server Error)
Uncaught SyntaxError: Unexpected token < in JSON at position 0


texts: adding attribute to catalog_category on store scope

texts:
I've created a custom attribute programmatically by a resource setup script:

/** @var $installer Mage_Catalog_Model_Resource_Setup */
$installer->addAttribute('catalog_category', 'some_attr', array(
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'group' => 'Display Settings',
    'input_renderer' => 'some/renderer',
    'input' => 'select',
    'label' => 'some label',
    'note' => 'some note',
    'required' => false,
    'sort_order' => 200,
    'source' => 'catalog/category_attribute_source_page',
    'type' => 'int',
));

The problem is with saving value to the created attribute. When I want to save any value to the category on a store scope the value is not saved. But when I first save the value on the global scope, then on the store scope everything works as expected - after that I can change the global scope value back to blank and the store scope is still working.

So I guess some kind of "initialization of the attribute" is executing when saving the global scope, but why is that? Did I do something wrong?


texts: How to change add cart button text to backorder text while backorder product?

texts:
i use backorder for some products ut change add to cart text to backorder text
its apply to all product types & list,product detail,search list page.Also any event to know backorder products before load html?Kindly reply me


texts: Append Url Query Parameters to Request without affecting the url path?

texts:
If requesting /catalogsearch/result/index?q=search-term and the query parameters dir and order aren't specified, I'd like to append them ( example? $request->setParam('dir','asc'); ) to the requesting query string so that they can effect the search results page request.

My previous question figured out how to do this partially. The problem seems to be that the URL Path is affected?

The base path turns into /catalogsearch/result/index/dir/[dir-value]/order/[order-value]/

instead of remaining /catalogsearch/result/index


texts: Custom renderered column sorting not working magento2

texts:
I have created the custom grid with one custom column(Products) by renderer method which shows product name. When I tried to apply sorting it looks the custom table in which other columns exists but this field is not available in that table as it rendered, later it shows application went wrong error.

app/code/local/Module/Name/view/adminhtml/ui_component/list.xml

    <column name="products" class="Module\Name\Ui\Component\Listing\Column\Products">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="indexField" xsi:type="string">pdt_id</item>
                        <item name="label" xsi:type="string" translate="true">Products</item>
                        <item name="sortOrder" xsi:type="number">200</item>
                    </item>
                </argument>
     </column>

app/code/local/Module/Name/Ui/Component/Listing/Column/Products.php

namespace Module\Name\Ui\Component\Listing\Column;

use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;

/**
 * Class BlockActions
 */
class Products extends Column
{
    /**
     * @var Magento\Sales\Model\Order
     */
    protected $_productCollectionFactory;

    /**
     * Constructor
     *
     * @param ContextInterface $context
     * @param UiComponentFactory $uiComponentFactory
     * @param UrlInterface $urlBuilder
     * @param array $components
     * @param array $data
     */
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        CollectionFactory $product,
        array $components = [],
        array $data = []
    ) {
        $this->_productCollectionFactory = $product;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                $pdtNames = array();
                $productCollection = $this->_productCollectionFactory->create();
                $productCollection->addAttributeToSelect('*');
                $productCollection->addAttributeToFilter('developer',array('eq' =>$item['name']));

                foreach ($productCollection as $collection){
                    $pdtNames[] = $collection->getName();
                }
                $partnerPdts = implode(', ', $pdtNames);
                $item['partners_products'] = $partnerPdts;
            }
        }

        return $dataSource;
    }
}


texts: Pricing Rules Runs Successfully, but Discount does not seem to apply

texts:
I'm having an issue currently where we have Daily Deals running on the site, where two products will be selected on a daily basis for a 50% discount. When calling $_product->getFinalPrice(); no discounts appear to be actually on the item. The item appears at full price on the daily deal page and in the cart.

Where would I check this, and how does Magento determine if there's a discount on the item? Thanks in advance.


texts:
I have title suffix in magento 1.7 system configuration.

I would like to remove title suffix from all cms pages or from cms pages besides home page.

How to do this?


texts: how to add {{htmlescape var=$order.getCustomerName()}} for transaction email tempalte

texts:
i am creating the custom module and i need to send status update email to customer. i am getting the template data but not able able to process the template.

$customemailTemplate  = Mage::getModel('core/email_template')
            ->load($storetemplate);

            //$orderdata=$this->object_to_array($order);
            $customemailTemplate->getTemplateFilter();
            $orderarray=array();
  $orderarray['increment_id']=$order->getIncrementId();
  $orderarray['customer_name']=$order->getCustomerName();

$processedTemplate = $customemailTemplate->getProcessedTemplate($orderarray);

echo $processedTemplate;

any hep will be appreciated.


texts: The Enterprise GiftCard's gift card generation seems to be firing at the wrong time

texts:
The Enterprise_GiftCard module's generateGiftCardAccounts() fires off of sales_order_save_commit_after.

This seems to be causing the gift cards to be generated even when the order isn't actually placed (due to an invalid credit card let's say).

From a quick test, I changed the observer to sales_order_place_after and it appears to work like a charm.

I'm seeing this on EE 1.12.0.2, but I've checked the latest EE (1.13.1.0) and it uses the same observer.

UPDATE: I think maybe my actual question wasn't clear.  So the question is - do you know whether this is a known issue for the EE GiftCard module?  Is there any simple fix for this.

It seems like changing the Generate Gift Card Account when Order Item is config value from Ordered to Invoiced might fix the issue.  But if that's the case, it seems like there is a core bug with the Ordered value, which would be good to know.


texts: Magento-2.3.3 getting "Request validation failed for action" error while accessing front controller url when receiving data from third party webhook

texts:
I have created one front controller in my project in order to receive data from third party webhook (e.g. sendgrid). However, when webhook access this url magento logs below error in debug.log file

Request validation failed for action "Namespace\Modulename\Controller\Email\Index\Interceptor" [] []

Does anyone has idea regarding this? I already gone through couple of stack overflow solutions but it didn't work.

Thanks,


texts: Magento 2 getting error Source class "\Magento\Framework\Filter\Zend" for "Magento\Framework\Filter\ZendFactory" generation does not exist

texts:
I am getting this error on the checkout page

  Source class "\Magento\Framework\Filter\Zend" for
  "Magento\Framework\Filter\ZendFactory" generation does not exist.

I deleted var folder
I deleted the generation folder
I run di compile cmd nothing working
but nothing working for me plz need a mentoring.

we tried in both ssh and in a manual way. but still cache folder is not deleting.

if it deletes also, within a minute cache folder will recreate with all following folders.

  mage-0, mage-1, mage-2............ mage-9 , mage-a, mage-b,

I run di compile cmd nothing working
but nothing working for me plz need a mentoring.

  mage-c....etc


texts:
I went through an article about MAGENTO 2 CACHING OVERVIEW https://alankent.me/2014/12/09/magento-2-caching-overview/

It tells Magento uses ajax and basically rely on JS for showing private content.

But if we search in magento vendor directory, It uses ESI tags.

protected function _wrapEsi(
    \Magento\Framework\View\Element\AbstractBlock $block,
    \Magento\Framework\View\Layout $layout
) {
    $url = $block->getUrl(
        'page_cache/block/esi',
        [
            'blocks' => json_encode([$block->getNameInLayout()]),
            'handles' => json_encode($layout->getUpdate()->getHandles())
        ]
    );
    // Varnish does not support ESI over HTTPS must change to HTTP
    $url = substr($url, 0, 5) === 'https' ? 'http' . substr($url, 5) : $url;
    return sprintf('<esi:include src="%s" />', $url);
}

I am not sure, how magento uses ESI. Hope if anybody could explain.


texts:
Is there an API call to retrieve reward points for a customer please in Magento 2? Can't seem to find it.
Thanks,
Kurt


texts: Magento 2, adding block to a template which does not have xml file

texts:
I need to add below block (my custom moudule) to <referenceContainer name="content"></referenceContainer>strictly, but the target template (third-party module) is created via plugin and controller as I found and there is no xml file for it . How to add below block to it?

<referenceContainer name="content">
            <block class="MyVendor\MyCustomModule\Block\Product\Map"
                   name="map"
                   as="stores_map"
                   template="MyVendor_MyCustomModule::product/view/map.phtml"/>
</referenceContainer>

Below is the target template in controller:

$customProducts = $layout->createBlock(
            \ThirdpartyVendor\ThirdpartyModule\Block\Products::class, 'bottom_products', [
                'data' => [
                    'bottom_products' => "$response",
                    'action_name' => $actionName
                ]
            ]
        )->setData('area', 'frontend')->setTemplate('ThirdpartyVendor_ThirdpartyModulen::products/bottomproducts.phtml');


texts: magento 2 : Load latest version jquery in custom module

texts:
I want to load the latest version (v3.2.1) jquery in my Magento 2 custom module.

Actually, I want to use materializes in luma theme but for that jquery version must be 3.2.1. I tried to replace the current version with the new one but I got other jquery errors.

So I want to load the latest version only in my custom module.

Anyone know how to do it?


texts: Get applied sales rule ids for quote in Magento 2

texts:
I want to retrieve all salesrule ids applied to the quote, by using my quote id

for example:

$quote = $this->quote->create()->loadActive($quoteId);
$salesruleIds = $quote->getSalesRuleIds(); // how ??
$discounts = array();
foreach($salesruleIds as $salesruleId){
  $rule = $this->salesRule->load($salesruleId);
  $discount['name'] = $rule->getName();
  $discount['description'] = $rule->getDescription();
  $discount['discount_amount'] = $rule->getDiscountAmount();
  $discounts[] = $discount;
}
return $discounts;


texts:
I am using Magento 2.3.1 I have installed the Mageplaza Smpt module with its latest core module.
When I'm testing a test mail button, this error occurs.
I am using yahoo mail to send an mail.

  A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.


texts: Magento 2.4.2 cacheable search results (past first page)

texts:
We have seen that Magento after first page (whenever there is a p request parameter) the code forcibly makes the page un-cacheable.
Is there a reason for allowing the first page to be cached and not the rest?
The code in \Magento\CatalogSearch\Controller\Result\Index:105-11 removes the "q" parameter and then if it sees any other parameter it flags the results as non-cachable.
We wish to enable caching in search results (all pages) but wish to be sure it wont break anything.
(we use varnish)


texts:
I added in the invoice ID to the order grid using the code below which shows them fine! However when I try and search by Invoice ID I get the following error. Any help is appreciated!

BUMP: Still stuck!

a:5:{i:0;s:835:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'invoice_id' in 'where clause', query was: SELECT COUNT(*) FROM (SELECT `main_table`.*, `sales_flat_invoice`.`increment_id` AS `invoice_id`, COALESCE(`_table_customer_rba_account`.`value`,`_table_guest_customer_rba_account`.`customer_rba_account`) AS `customer_rba_account` FROM `sales_flat_order_grid` AS `main_table`
 LEFT JOIN `sales_flat_invoice` ON main_table.entity_id = sales_flat_invoice.order_id
 LEFT JOIN `customer_entity_varchar` AS `_table_customer_rba_account` ON _table_customer_rba_account.entity_id = main_table.customer_id  AND _table_customer_rba_account.attribute_id = 289
 LEFT JOIN `am_customerattr_guest` AS `_table_guest_customer_rba_account` ON _table_guest_customer_rba_account.order_id = main_table.entity_id WHERE (`invoice_id` LIKE '%100050%')) AS `a`";i:1;s:6824:"#0

My code below:

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $this->setCollection($collection);
        $collection->getSelect()->joinLeft('sales_flat_invoice', 'main_table.entity_id = sales_flat_invoice.order_id', 'increment_id as invoice_id');
        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {

      $this->addColumn('invoice_id', array(
          'header'=> $this->__('Invoice'),
          'width' => '80px',
          'type'  => 'text',
          'index' => 'invoice_id',
      ));

etc...


texts: Rendering Custom Customer Attribute issue

texts:
This is my code:

$attributeCode = 'customer_custom_field';
$attributeData = array(
    'label'         => 'Customer Custom Field',
    'input'         => 'text',
    'type'          => 'text',
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'       => 1,
    'required'      => 0,
    'user_defined'  => 1,
    'backend'            => 'mynamespace_mymodule/attribute',
    'input_renderer'     => 'mynamespace_mymodule/customer_attribute'
);

and in the mynamespace/mymodule/Block/Customer/Attribute.php file I have:

class Mynamespace_Mymodule_Block_Customer_Attribute extends Varien_Data_Form_Element_Text
{
    public function getAfterElementHtml()
    {
        echo 1; exit();
        $html = parent::getAfterElementHtml();
        return $html."  <script>
                        $('".$this->getHtmlId()."').disable();
                        </script>";
    }

}

I never get the echo 1; exit (). Why ? The "input_renderer"
 is not available for customer attributes ? thx

[UPDATE]

<?xml version="1.0"?>
<config>
    <modules>
        <Mynamespace_Mymodule>
            <version>0.10.0</version>
        </Mynamespace_Mymodule>
    </modules>
    <global>
        <blocks>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Block</class>
            </mynamespace_mymodule>
        </blocks>
        <helpers>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Helper</class>
            </mynamespace_mymodule>
        </helpers>
        <models>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Model</class>
            </mynamespace_mymodule>
        </models>
    </global>
</config>


texts: Magento Admin - add new row order totals

texts:
I am a newbie in Magento development.

Do you know how to add a new row to totals in admin order view to show the resulting computation of subtotal + shipping?

I create path folder with Sketchkode/Totalgst/etc/config.xml

<config>
   <global>
      <blocks>
        <adminhtml>
        <rewrite>
             <sales_order_totals>Sketchkode_Totalgst_Block_Adminhtml_Sales_Order_Totals</sales_order_totals>
      </rewrite>
      </adminhtml>
   </blocks>
</global>

After I create Based on config   Sketchkode/Totalgst/Block/Adminhtml/Sales/Order/Totals.php

<?php
  class Sketchkode_Totalgst_Block_Adminhtml_Sales_Order_Totals extends Mage_Adminhtml_Block_Sales_Order_Totals{
     /**
     * Initialize order totals array
     *
     * @return Mage_Sales_Block_Order_Totals
      */
     protected function _initTotals()
     {

      parent::_initTotals();
       $order_id=$this->getOrder()->getId();

     $amount=5;

    if ($amount) {
        $this->addTotalBefore(new Varien_Object(array(
            'code'      => 'fee',
            'value'     => $amount,
            'base_value'=> $amount,
            'label'     => $this->helper('sales')->__('Fee'),
        ), array('shipping', 'tax')));
 }

    return $this;
   }
}

I get blank Order Totals


texts:
I have created a custom customer attribute that is shown in the tab with all the general information when you edit the customer.

Now I need to get that attribute inside a custom tab that I have created.

The attribute is created with an InstallData script as a Customer attribute.
The custom tab is created with adding customer_form.xml ui_component and adding a new fieldset inside that.

I just need to move the field from the general tab to that custom tab
Any idea?

Thanks!


texts: Magento tiny tweaks for conversion & capture email as first step

texts:
I was viewing this when I realized the following amongst many other tips.

Capture the email address asap
Follow up using email

Currently Magento offers a first step where one can continue as guest or login. Previously we had a plugin to skip the first step and this increased conversion. Currently that doesnt work with our template.

I was thinking: with all this knowledge. I have never seen an extension that focuses solely on the in between page (first step) and offers enter your email here field (JS to save) OR social logins.

http://www.magentocommerce.com/media/webinars/conversion-engineering-tiny-tweaks-huge-reward

Question: Does an extension exist that focuses on the in between step and is aimed at capturing the email address asap? (either via input or social login)

UPDATE: http://www.practicalecommerce.com/articles/2848-4-Ways-of-Capturing-More-Email-Addresses-and-Increasing-Conversion


texts: Get Product Image Array - Email Order Confirmation

texts:
I'm developing a new order conformation page in magento 1.9.3 and I have everything working yet I can't seem to get the image from this here,

'imgUrl' => Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getThumbnail()),

what I get as a result is,

< img src="https://mycompany.com/media/catalog/product/" alt="product title works">

I can't seem to get this straight, can anyone help me understand why this isn't working.

my full code is everything else works fine but I can't seem to get the full path of the image correctly

$_order = $this->getOrder();

if ($_order){
$wa_data = array(
'symbol' => Mage::app()->getLocale()->currency(Mage::app()->getStore()
  ->getCurrentCurrencyCode())->getSymbol(),
 'items' => $_order->getAllItems(),

);

foreach ($wa_data['items'] as $key => $value) {
$vars = get_object_vars ($value);
$_product = Mage::getModel('catalog/product')
->setStoreId($value->getOrder()->getStoreId())
->load($value->getProductId());
$item = array(
'url' => $_product->getProductUrl(),
'imgUrl' => Mage::getModel('catalog/product_media_config')->getMediaUrl(
$_product->getThumbnail()),
'name' => $value->getName(),
'sku' => $vars['_data']['sku'],
'description' => $vars['_data']['description'],
'number' => $vars ['_data']['product_id'],
'qty' => intval($vars['_data']['qty_ordered']),
'price' => $wa_data['symbol'] . ' ' . intval($vars['_data']['base_price']),
'total' => $wa_data['symbol'] . ' ' . intval($vars['_data']
['base_row_total']),
);
$wa_data['items'][$key] = $item;
}

}else{
$wa_data = array(
'symbol' => Mage::app()->getLocale()->currency(Mage::app()->getStore()
  ->getCurrentCurrencyCode())->getSymbol(),
);
for($i=0; $i < 5; $i++) {
$item = array(
'url' => '#',
'imgUrl' => 'https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png',
'name' => 'Product' . $i,
'sku' => "SKU {$i}",
'description' => "Description {$i} Maecenas faucibus mollis interdum. Nulla
vitae elit libero, a pharetra augue. Fusce dapibus, tellus ac cursus commodo",
'number' => "123456number{$i}",
'price' => ($i+1) * 49,
'qty' => $i+1,
'total' => $wa_data['symbol'] . ' ' . (($i+1) * ($i+1) * 49),
);
$wa_data['items'][$i] = $item;
}
}; ?>


texts: How to restrict navigating to other page from a customer magento page

texts:
I am working on a module that implements two factor authentication.

I have created an observer to the event customer_login , so just after when the  customer has logged in, they are directed to a custom page for the two factor authentication, if authentication is successful he is directed to the home page.

But the problem is when the customer is in the custom page, he could change the URL and get to the home page(ie. without completing the two factor authentication process). How do I restrict the customer from navigating to other pages without completing the two factor authentication?


texts:
I have changed my invoice template to add some footer text, this works fine.  However recently I have been asked to change this text to correct a typo.  This I have done but the change is not showing on the invoice, it still shows the old text with the typo.

I have cleared and disabled my caches but to no avail.

The file I am changing is located at \app\code\local\Mage\Sales\Model\Order\Pdf\Invoice.php

Does anyone know as to why the changes are not showing?

Many thanks in advance.


texts: How to move attributes in magento 2.2.x?

texts: I want to move some attributes, but I don’t see any settings for this.


texts: how to configuration of elastic search in magento 2.3 beta?

texts:
I have to install elastic search and set configuration from Magento admin but still got the error when I run the command

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"wrong value for index [false] for field [country_of_manufacture]"}],"type":"mapper_parsing_exception","reason":"wrong value for index [false] for field [country_of_manufacture]"},"status":400}


texts: We can't add this item to your shopping cart right now in magento2

texts:
When click add to cart button in product details page I'm getting this error

  "We can't add this item to your shopping cart right now."

Can you please anyone help me.


texts: Admin url redirecting to localhost/admin

texts:
Admin URL frontname is set to "admin" but on hitting the URL http://www.example.com/admin it redirects to localhost/admin

Working on localhost

web/secure/base_url and web/unsecure/base_url is set to http://localhost/sitename

Using Magento 2.1.8


texts: Exporting products with Category Names instead of IDs

texts:
I am exporting the product dataflow, and in the category_ids column all I have are the numeric category IDs.

The Magento User Manual states that Each category is entered as a path, with a forward slash (/) between each level. For example: Furniture/Living Room.

However I cant seem to get the products to export in this way.

Can anyone help?

I am using Magento 1.9 and 1.4, same issue with both.


texts:
I know how to remove default Magento2 footer link.

in default.xml file add below code.

<referenceBlock name="footer_links" remove="true"/>

also I know how to add new link in footer using default.xml file

<referenceContainer name="footer">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="Our Store">
            <arguments>
                <argument name="label" xsi:type="string">Our Store</argument>
                <argument name="path" xsi:type="string">our_story</argument>
            </arguments>
        </block>
    </referenceContainer>

but I want to add footer link like I attach image for that how can I do formatting and code so I get what I want?

default.xml file code is below.And this is default magento code I didn't change anything in this file. now I want to add footer link like I show in image above.How can I do? In magento 1.x we go to footer.phtml file and place code or call cms block or page. can we do same in magento2 or do only using 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">
<body>
   <referenceContainer name="header.panel">
       <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
           <arguments>
               <argument name="css_class" xsi:type="string">header links</argument>
           </arguments>
       </block>
   </referenceContainer>
   <referenceBlock name="logo">
       <arguments>
           <argument name="logo_img_width" xsi:type="number">148</argument>
           <argument name="logo_img_height" xsi:type="number">43</argument>
       </arguments>
   </referenceBlock>
   <referenceContainer name="footer">
       <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>
   </referenceContainer>
   <referenceBlock name="report.bugs" remove="true"/>
   <move element="copyright" destination="before.body.end"/>
</body>
</page>

enter preformatted text here


texts:
UPDATE: I implemented this solution to check the loading of layout which confirms that my layout is being loaded. But not my template.

UPDATE 2: I even tried installing another version of magento 2.1.11 but the issue persists whereas everything works fine in my old project (magento2.1.5) from where I've taken out the module.
UPDATE 3: Weirdest thing is no any template of my previously working modules is loaded in these fresh installations.

I have developed a module which works perfectly and I copied that module in a fresh magento installation. My Vendor/Module/etc/frontend/routes.xml is:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="paym" frontName="paym">
            <module name="Vendor_Module" />
        </route>
    </router>
</config>

My controller is Vendor\Module\Controller\Redirect\Index.php

<?php
namespace Vendor\Module\Controller\Redirect;
class Index extends \Magento\Framework\App\Action\Action {
    protected $resultPageFactory;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }
    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}

My app/code/Vendor/Module/view/frontend/layout/paym_redirect_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Vendor\Module\Block\PaymentProcessor" name="custompayment" template="Vendor_Module::redirect.phtml" />
        </referenceContainer>
    </body>
</page>

My template is Vendor/Module/view/frontend/templates/redirect.phtml

<?php
echo 'hello';
die();
?>

The issue is template does not load. When I write echo 'hi'; die(); in controller it shows up.

Another weird thing I have noticed is when I randomly delete a matching tag in paym_redirect_index.xml and run php bin/magento setup:di:compile no error occurs. But in real any small error in .xml file would never allow any magento command to execute. I even removed

     </body>
</page>

and <?xml version="1.0"?> one by one, no error occurs in command line.
Also no error in logs, console.
I have enabled php error reporting by writing on the top of index.php:

error_reporting(E_ALL);
ini_set('display_errors', 1);

I have renamed pub/errors/local.sample.xml to local.xml.
But the thing is a blank screen loads without any error. Can anyone help me debug this issue?


texts: Wrong calculation on Configurable product when Child product price is minus

texts:
I have set for a configurable product a base price of 150. One child product with another color is 50 less so I made it -50 at the attributes (associated products)

I have discounted the product with 15% and set as "Special Price". On the product page others looks good except the product with -50 shows as new price 77.50 while it should be 85.

It makes a wrong calculation as follows:

150-15%=150-22.50=127.50aed (configurable product)
100-15%=100-15=85aed it shows 77.50 (Child Product -50)

Why? it takes the discount of the mother product. 100-22.50=77.50

How can I solve this?


texts: Magento email_queue sending mails every 2 minutes

texts:
I am recieving order mails every 2 minutes. When i turn of the cron. It doesnt send any emails anymore.
I have updated my magento to 1.9.2.2 and the problems started.

Now if someone magento sends a mail it is places in the core_email_queue table. But when the mail is actueally sended it is not updating the row proccessed_at in the core_email_queue. Or doest this need to be empty.

How can is solve to problem? because i worry about my email reputation.


texts: Hide item count and pagination from category page in Magento2

texts:
Is it possible to hide pagination and item count from Magento 2? Preferably only for specific category but if not possible then for all categories...

............


texts: Magento event to calculate price when custom option text field changes

texts:
I am trying to create a product with two custom text fields: Length and Width.  When the user types in both a length and width, the price needs to calculate via custom formula.

I'm trying to find the correct event to connect an observer to - anybody know what that might be?

Here's what I know and have tried

1) the custom field text box in the product view has an onchange event that I haven't figured out how to tap into yet via an observer event -  "opConfig.reloadPrice()

2) If I build an observer on the event sales_quote_add_item, then I can change the price via formula when it's added to the cart.  With this method I still need a way to change it in the product view before it's added to cart.

3) I've also tried the event catalog_product_get_final_price but this seem to only fire when the product page is loaded, so after a product length or width is added, it doesn't re-fire.

Any ideas would be greatly appreciated!


texts: Apply custom theme to page served by custom module

texts:
How do I apply a custom theme to a page served from a custom module?

Up to this point I have been using the admin dashboard dialogues to apply custom themes through content > pages.

Am I supposed to be declaring this relationship in a layout page maybe?

I have a custom module Landing, which serves up a landing page block with landing_page.phtml, but I'd like to apply my custom theme styles to this page. Having a hard time finding any documentation that points to this...


texts:
I'm working on a Magento 2.1 project with the Navas theme. I can add products to the cart, but the minicart doesn't show any products.. I can only visit the cartpage by going directly to the page, a click on the minicart icon doesn't send me to the cartpage.

I struggle with the following error:

knockout.js:3012 Uncaught TypeError: Unable to process binding
"css: function (){return { empty:cart().summary_count == 0} }"
Message: cart is not a function

I have tried the following, without success another Magento Question in the Stack Exchange

I'm out of ideas, help would be appreciated.


texts: sales_order_place_before Changing Customer Group not working

texts:
I have a customerGroupCheck function, which is loaded successfull and every data in this functions is correct.

In some case I want to change the user group, but it won't save. Do you have any idea?

$observer = $getObserver['order'];
$getShippingAddress = $observer->getShippingAddress()->getData();
$customerGroupId = $observer->getCustomerGroupId();
$customerId = $observer->getCustomerId();

        switch($getShippingAddress['country_id']) {
            case 'DE':
                echo 'country_id: DE';
                $observer->setData('customer_group_id', 6);
            default:
                echo 'country_id: else';
                $observer->setData('customer_group_id', 11);
        }

I want to change the group by submitting the order.
This is the XML Part

        <sales_order_place_before>
            <observers>
                <namespace>
                    <type>singleton</type>
                    <class>Sales_Model_Observer</class>
                    <method>customerGroupCheck</method>
                </namespace>
            </observers>
        </sales_order_place_before>

This is my code now:

public function customerGroupCheck($getObserver) {
    $order = $getObserver['order'];
    $getShippingAddress = $order->getShippingAddress()->getData();
    $customerGroupId = $order->getCustomerGroupId();
    $customerId = $order->getCustomerId();
    $customer = $order->getCustomer();

    switch($getShippingAddress['country_id']) {
        case 'DE':
            if($customerGroupId == 4 || $customerGroupId == 6 || $customerGroupId == 11) { // B2B
                $customer->setData('group_id', 6)->save();
            }
            if($customerGroupId == 9 || $customerGroupId == 10 || $customerGroupId == 12) { // B2C
                $customer->setData('group_id', 9)->save();
            }
            break;

But it won't work at all. Do I miss something or made a bad mistake?


texts: How to show My Account link in frontend after succesfully logged in?

texts:
How can I show the My Account in header after the welcome message after successfully logged in my website?

I have got help in displaying them on customer menu but now I want to show it in header instead of customer menu.

Please see the below screenshot.


texts: While installing customer registration fields getting the following error

texts:
I'm getting the error while installing the following extension:
https://www.magentocommerce.com/magento-connect/custome-account-profile-13594.html. After the extension has been successfully installed the following error is occurred. "
Fatal error: Class 'Amar_Profile_Model_Mysql4_Setup' not found in C:\xampp\htdocs\porto\includes\src\Mage_Core_Model_Resource_Setup.php on line 234"


texts:
When I extracted the mailchimp extension in root folder. I came across this error

  Class 'Ebizmarts_MailChimp_Helper_Data' not found in /home/occasion/public_html/occasionwearforkids.com.au/app/Mage.php on line 547

This is my data.php file

And this is my config file


texts: Tapping thumbnail photo doesn't change large photo on mobile

texts:
I'm new to Magento so please bear with me.

When viewing certain products, clicking/tapping on a thumbnail image does not reload the large image. Instead, when I click/tap on the images, the browser jumps back to the top of the page and a hash (#) gets appended to the URL. This, of course, leads me to believe there's a JS problem somewhere, but I don't see anything in my console about it.

Chrome Console errors:

The key "target-densitydpi" is not supported.
cg-ball-cap-adjustable.html:114

GET http://[my url]/skin/frontend/gpmd/default/js/vendor/lightbox.min.map 404 (Not Found)
cg-ball-cap-adjustable.html:1

Safari Console errors:

[Error] Viewport argument key "target-densitydpi" not recognized and ignored.
(result, line 106)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found)
(lightbox.min.map, line 0)

These errors don't look like they could be causing my problem, but I guess I'm not 100% sure on that.

Other weirdness:

Sometimes--inconsistently but usually after reloading the page--I get this JS error:

Uncaught TypeError: Cannot read property 'config' of undefined
prototype.js:828

Chrome points me to prototype's error catch line. When I look in Firefox, Firebug gives me a little more info on this error:

TypeError: prevConfig.config is undefined
if(prevConfig.config.allowedProducts
configurable.js (line 184)

My HTML:

            View Full Size

Background info:

I didn't build this site. I inherited it and am trying to find my way through things. Therefore, I'm not sure if I've provided enough information for you all to help me. I can edit this with any additional info that may be helpful.

Any idea what's going wrong?


texts: How to add "addtowishlist" and "addtocart" in a custom phtml?

texts:
I have a custom loop for my website and I need to add addtowishlist and addtocart buttons in my foreach. How to add this buttons in Magento? I marked in the end of code where I need to insert the buttons.

$_productCollection = Mage::getModel('catalog/product')
                        ->getCollection()
                        // add sorting to collection optional
                        ->addAttributeToFilter('a_pecas_assinadas', array('eq' => 1))
                        ->addAttributeToSort('created_at', 'DESC')
                        ->addAttributeToSelect('*')
                        ->load();

foreach ($_productCollection as $_product){
    $t++;
    if($t==1){$variavel='first';}
    elseif($t==5){$variavel='last';}
    else{$variavel='';}

    if($t <= 5){
        echo '
';
            echo '
';
                echo 'getProductUrl().'">';
                    echo 'getImage().'">';
                echo '';
                echo ''.$_product->getId().'';
                echo '
';
                    echo 'getProductUrl().'">';
                        echo $_product->getName();
                    echo '';
                echo '
';
                echo '
';
                    echo '
'.money_format('%n', $_product->getPrice()).'';
                    echo '&nbsp;&nbsp;&nbsp;'.money_format('%n', $_product->getSpecialPrice()).'
';
                echo '
';
            echo '
';
        echo '
';

        -------> echo 'addtowishlist';
        -------> echo 'addtocart';


texts: Why is magento missing a type class for bundle products?

texts:
I am looking at a section of code that uses this:

if ($_item->getProduct()->getTypeId() === Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE)

to determine whether a product is configurable. I am now wanting to alter that to detect whether the product is a bundle - but it turns out, there is no Mage_Catalog_Model_Product_Type_Bundle. Nor is there a Mage_Checkout_Block_Cart_Item_Renderer_Bundle. In fact, I can't see to find any dedicated bundle classes, anywhere - it's like they don't exist!

What is the reason for this? How are developers supposed to deal with bundled products, without methods like getChildrenIds or TYPE_CODE? Are just supposed to be hardcoding things?


texts: Add code to  using a custom module & theme

texts:
I'm working on a custom theme for Magento. I'm trying to create a module for the theme that adds some code to the <head> but i'm finding it difficult to get it working.
I've created my module under app/code/Vendor/ModuleName and created the module.xml file and the registration.php file which is as follows:
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Vendor_ModuleName',
    __DIR__
);

I've installed the module and when I run php bin/magento module:status Vendor_ModuleName it tells me that the module is enabled.
Next is the part I'm unsure about. I've just copied what I've seen in other themes but i'm unsure if it's correct or if i'm missing something. In app/design/frontend/Vendor/custom_theme (which is my custom theme) I've created the following files:
app/design/frontend/Vendor/custom_theme/Vendor_ModuleName/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">
    <body>
        <referenceContainer name="head.additional">
            <block class="Magento\Framework\View\Element\Template" name="custom_head" template="html/head.phtml" after="-"/>
        </referenceContainer>
    </body>
</page>

app/design/frontend/Vendor/custom_theme/Vendor_ModuleName/templates/html/head.phtml:
<script>alert('Hello');</script>

Now when my custom theme is enabled, I would expect this to add the code to the head and see the alert box, but it's not working. I'm unsure why. Do I have this set up correctly? Magento seems to be ignoring the module's layout file that I've placed in my custom theme directory.


texts:
I see I can use custom action handlers for adminhtml grid actions. This is DOM node for action link (HTML):

Edit

I have created additional action in adminhtml grid with callback data (PHP code):

$actions['alert'] = [
    'label' => __('Alert'),
    'callback' => 'function() {alert("Action!")}'
];

This action is converted into JSON and is loaded to the grid in this format, where "callback" property is a string (JSON):

"alert": {
  "label": "Alert",
  "callback": "function() {alert(\"Action!\")}"
}

This is Magento parser for action's props (module-ui/view/base/web/js/grid/columns/actions.js). This parser process JSON data and should call action's callback in case of callback is object/array/function (see _getCallback):

getActionHandler: function (action) {
    var index = action.index,
        rowIndex = action.rowIndex;

    if (this.isHandlerRequired(index, rowIndex)) {
        return this.applyAction.bind(this, index, rowIndex);
    }
},

applyAction: function (actionIndex, rowIndex) {
    debugger
    var action = this.getAction(rowIndex, actionIndex),
        callback = this._getCallback(action);

    action.confirm ?
        this._confirm(action, callback) :
        callback();

    return this;
},

_getCallback: function (action) {
    var args = [action.index, action.recordId, action],
        callback = action.callback;

    if (utils.isObject(callback)) {
        args.unshift(callback.target);

        callback = registry.async(callback.provider);
    } else if (_.isArray(callback)) {
        return this._getCallbacks(action);
    } else if (!_.isFunction(callback)) {
        callback = this.defaultCallback.bind(this);
    }

    return function () {
        callback.apply(callback, args);
    };
},

But callback property is a string, so defaultCallback is used.

How can I use my own action handler in adminhtml grid actions?


texts: SQL error when i try to search in frontend

texts:
im very new to Magento, issue is when i try to search somrthing on my magento frontend its showing me error

please help me


texts:
We have a line of code on our site that uses HTTP which we need to change to https. It is in the  code.

Any idea which file we can find this code in to edit it?

<head>
<link href='http://fonts.googleapis.com/css?family=Lora:400,400italic,700,700italic%7cDroid+Sans:400,700' rel='stylesheet' type='text/css'>

Many Thanks


texts: Add to wishlist button not available for Products in Magento 2

texts:
In admin panel, in customer tab, I have enabled Wishlist option.Still On my homepage , it does not show add to wishlist option for Products .

I have created a custom theme for this.Previously with Luma theme, there was option for wishlist.But on my custom theme, it does not show this option.

This is my static block code to show top Products.

{{widget type="Magento\Catalog\Block\Product\Widget\NewWidget" display_type="new_products"  products_count="5" template="product/widget/new/content/new_grid.phtml"}}


texts:
I have migrated all my products from Magento 1.9 to 2.0. All the products url's are ending with .html like html.html

sample link:  http://www/domain.com/condenser-microphone.html.html


texts:
When i add a new product and it was error as the following message "There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1245911347200".


texts: How to change shipping cost per weight if is more than 10kg

texts:
Im using magento v2.2.2
Im trying to fix some shipping rates that shipping company gave me.

I have 4 options

Destination        | shipping time | price up to 10 kg | price for extra 1kg
In city            | 1day          | 3.80€             | 0.50 €
Land Destinations  | 1-2days       | 6.00€             | 0.70 €
island destinations| 1-3days       | 7.00€             | 0.80 €
inaccessible areas | 1-5days       | 8.00€             | 1.50 €

Also for inaccessible areas i have a large csv with their zip codes which i can upload in table rates.

In Table Rates Weight vs Destination csv we cant add dynamic value.The values must be fixed.

So im thinking to edit the magento module for shipping. Is this a good idea?
If i can do that whats the proper file to edit.

Also is there a way to categorize all my state/prov into those 4 destination categories so i can manage better the shipping cost given the zip or state by the customer?

Thanx for any ideas.


texts: What would be authorization endpoint for oauth in magento 2

texts:
I am trying to build an api that delivers magento resources to a third party  and for that I am using oauth for authentication purpose. On the third-party side the application asks for a authorization endpoint however, in magento dev-docs I was only able to find request token and access token endpoints.In magento 1 it used to be

  'http://magentohost/oauth/authorize'

How would I go about providing authorization endpoint. Any help is appreciated.


texts:
I need an Observer to get all customer data after registration. II created an Observer for customer_register_success event and I see some data. But I need also the password, because next step is to send all data to another server.

I tried also to make the same with customer_customer_authenticated  event, which is used by UpgradeCustomerPasswordObserver, but the result of getData('password') is always null?

Can someone explain where's the trick?

Thanks!


texts: Magento 2.3 - php 7.2.10 - Reindex error - bin/magento is not opening -

texts:
MacOS High Sierra
MAMP php webserver - 7.2.10

/Applications/MAMP/bin/php/php7.2.10/bin//php- 7.2.10

 -- usr/bin/php - 7.1.16

Nittns-MacBook-Air:~ baanallc$ cd /applications/MAMP/htdocs/23/

Nittns-MacBook-Air:23 baanallc$ php bin/magento indexer:reindex

In Abstract.php line 144:

  SQLSTATE[HY000] [2002] No such file or directory

In Abstract.php line 128:

  SQLSTATE[HY000] [2002] No such file or directory

indexer:reindex [<index>...]

Please advise, how can I reindex magento2 on localhost MAMP?


texts: Magento 2: Include header and footer in external php

texts:
I want to include header and footer layout of Magento 2 to external PHP file, I am using my own code(external PHP) to make a frontend page. how to add header and footer layout theme in Magento 2 to my own code(.php) so that it has the same theme as Magento 2 theme layout? i read this site http://www.blog.magepsycho.com/using-magento-header-footer-outside-of-magento/ but this is for magento 1 , how to do it in magento 2?

Thanks in Advanced!


texts: Please enter a value between NaN and NaN Magento 2

texts:
I added a range price slider to my product checkout. Now adding the product works fine. So basically I have a Select input where it contains a dropdown of the price value but I hidden it and made the Range slider to be visible. Below is the code I have for the HTML
This is the code of my HTML

            <?= __('Card Value in %1', $_currencyShortName); ?>

             <select style="display: none;" id="am_giftcard_amount" name="am_giftcard_amount" class="required-entry" data-amgiftcard-js="amgiftcard-amount">
                  <option value=""><?= $block->escapeHtml(__('Choose an Amount...')); ?></option>
                  <?php
                    // an array of prices
                   $listAmounts = $block->getListAmounts();
                   $selectedAmount = $block->getDefaultAmount();
                   foreach ($listAmounts as $_amount) : ?>
                        <option data-value="<?= $block->convertPrice($_amount); ?>"
                                value="<?= $block->convertPrice($_amount) ; ?>"
                                data-amgiftcard-js="amgiftcard-amount-item"
                               <?php if ($selectedAmount === $_amount) : ?> selected<?php endif; ?>><?= $block->getFormatPrice($_amount); ?></option>
                  <?php endforeach; ?>
                  <?php if ($_product->getAmAllowOpenAmount()) : ?>
                      <option value="custom"><?= $block->escapeHtml(__('Custom Amount')); ?></option>
                  <?php endif; ?>
            </select>
            <?php
                $numberOfSteps = count($listAmounts)  - 1;
            ?>

                <input name="am_giftcard_amount_slider" id="am_giftcard_amount_slider" type="range" min="0" value="0" max="<?php echo $numberOfSteps; ?>" step="1" class="gg-slider">

                    <?= __('%1%2',$_currencySymbol,$listAmounts[0]); ?>
                    <?= __('%1%2',$_currencySymbol,end($listAmounts)); ?>

And this is the JS
var sliderInput = document.getElementById('am_giftcard_amount_slider');
var sliderValues = <?php echo json_encode($listAmounts); ?>;
sliderInput.oninput = function(){
    $('#am_giftcard_amount').val(sliderValues[this.value]);
    $('#am_giftcard_amount').trigger('change');
};
sliderInput.oninput();

Now when I try to edit the product content again then click on submit I get a JS error as shown below Please enter a value between NaN and NaN.


texts: showing different currency for sidebar block

texts:
I've set up two store in CAD and USD. Now it has problem when I am on CAD the price are showing CAD but best seller and sales product block at left side bar are showing USD. And when I changed it to USD, left side bar are showing CAD but products list and product detail show USD price.
How to fix this problem?
Someone can help?


texts:
Once we add the product to our cart . It does not add the same, instead says your cart is empty. I am a novice in the same. Please if someone could help me step by step.

Thanks


texts: Error "URL key for specified store already exists" when enable "Anchor" in category in Magento 2.3.2

texts:
Categories in two different parent with same url-key.

First category in the list is saving fine when we update anything in that. But when I am enabling

  Anchor => Yes

In the second category with same url-key is not saving and showing an error: URL key for specified store already exists. If we any other data in the same category then there is no issue.

How can I fix the issue ?


texts: Error appearing after moving to a new server

texts:
we moved to a new server and the tech guys installed it properly but there are errors appeared only on the homepage, nothing else is displayed. Is there a solution for this?! Thank you.

  Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is
  deprecated in
  /home/b2zee/public_html/b2c/lib/Zend/Validate/Hostname.php on line 521

  Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is
  deprecated in
  /home/b2zee/public_html/b2c/lib/Zend/Validate/Hostname.php on line 617


texts: How to change or redirect home page to customer login?

texts:
Need to see customer account at the first before home page. used redirect from the admin panel but not working. Still, when I load my site it goes to the home page.

Mean that see customer account login instead of the home page.


texts: How can I have Master store customer account access any (sub) store in Magento 2?

texts:
I have created a multi store webshop:

www.domain.com/
www.domain.com/store1
www.domain.com/store2
www.domain.com/store3

Now how can I have Master store customer account access any (sub) store. Is that possible in Magento 2.1?


texts: Correct way to set/unset a rewrite for an URL programmatically

texts:
I want to rewrite URLs of products if they are out of stock. I want to do this by using an observer.

How can I set a URL rewrite and how can I unset it programmitcally? I want to utilize the core functions to do that.

Bonus points if you can provide a backend view for viewing and editing those rewrites.


texts: Magento admin page not rendering anything

texts:
I'm learning how to create new pages for my custom extension in magento2 admin.

However when i go to that admin page it's blank.

I've got a controller:

<?php

namespace ZET3K\Tracker\Controller\Adminhtml\Config;

class Index extends \Magento\Backend\App\Action
{
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    public $resultPageFactory;

    /**
     * Index constructor.
     *
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
    }

    /**
     * @return bool
     */
    protected function _isAllowed()
    {
        return true;
    }

    /**
     * @return \Magento\Backend\Model\View\Result\Page
     */
    public function execute()
    {
        //Call page factory to render layout and page content
        /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
        $resultPage = $this->resultPageFactory->create();
        //Set the menu which will be active for this page
        $resultPage->setActiveMenu('ZET3K_Tracker::config');
        //Set the header title of grid
        $resultPage->getConfig()->getTitle()->prepend(__('Tracker Configuration'));

        return $resultPage;
    }
}

And a layout:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="ZET3K\Tracker\Block\Adminhtml\Config" template="ZET3K_Tracker::config.phtml" />
        </referenceContainer>
    </body>
</page>

And a block:

<?php

namespace ZET3K\Tracker\Block\Adminhtml;

class Config extends \Magento\Framework\View\Element\Template
{
    public function sayHello()
    {
        return 'heyyyy';
    }
}

In the template i try $block->sayHello() but the page is empty. Only has a title. Any advice? Thanks


texts: What's the second parameter for in Mage::getModel

texts:
Sorry for asking, but I searched on google, but can't find the answer.

In app/core/Mage/Sales/Model/Convert/Order.php on line 513 there is this rule:

$this->_order = Mage::getModel('sales/order')->load($this->getOnepage()->getQuote()->getId(), 'quote_id');

But where is the second parameter for in the load function? As I know, one parameter gets the ID of the primary field right? Is this second parameter quote_id not the primary key, but it will load the record with $this->getOnepage()->getQuote()->getId()?

Thanks in advance.


texts: Event for apply discount coupon Magento 2

texts:
I want to add custom validation for Discount coupon that it can be used only on first order of any customer.

For this i want to create an observer for an event which will trigger when customer applies discount coupon code to his cart. but i cannot find that event.

Which event should i use?


texts: Worldpay extension not working with Magento

texts:
Has anyone tried to use the worldpay extension with magento and got it to work?
For some reason, if installs absolutely fine, shows up in the admin>configuration>sales as a separate payment option and when enabled from there, it shows up on the front end as an option for checkout. However, when it is selected as the option for checkout, it doesn't expand to take the card details, nor does it redirect to worldpay page to take the payment details. What happens instead is that it processes the order without taking any payment whatsoever.
Important thing to note here is, it doesn't show any errors on the page either, when using the native Magento One Page Checkout. However, when we use the TM's Firecheckout extension, it shows an error saying "Failed to load WorldpayJS", which is due to the fact that it is not supported by Firecheckout(confirmed with their developer team).

Details :
Magento version 1.9.2.4

Extension used from :

  https://github.com/Worldpay/worldpay-magento


texts: Show Prices Including and Excluding Tax Specifically On Product View Page

texts:
I know that it can be set easily under System->Configuration->Sales->Tax to change how tax is displayed for 'Price Display Setting' and 'Display Product Prices In Catalog'.

The problem being that this changes the display for both Category view and Product view.

How can I get the price to display as just the Excluding Tax on the category view and show both Including and Excluding tax for Product view page?


texts: Determine model alias or entity type by object

texts:
How would you determine the entity type for a given model instance?

For example given an object Mage_Catalog_Model_Product $entity the desired result would be catalog_product as in the eav_entity_type table.

If I could find out the model alias catalog/product, I could go from there:

Mage::getModel('eav/entity_type')->load($alias, 'entity_model')->getEntityTypeCode();

But I don't see an easy way to get the alias. Rewrites should be taken into account, so the object could have a different class that rewrites the original entity.


texts: Translate text from blocks in admin panel

texts: I am translating text in the blocks with by putting text instead of categories word{{trans "Categories"}}, but I have some text with span element and I don't know how to translate them, If anyone can help, I appreciate, see the screenshot


texts: Php script for import configurable products from csv

texts: I need to import a lot of products. So i want to use a script. So if you have any script to do that can you share the whole php file?


texts: How to display attribute values of second dropdown box in configurable product

texts:
I have created a configurable product in magento store with two attributes say color and size.

On product page second dropdown box (say size) is disabled by default untill any attribute value not select from first dropdown box(say color).

How to display attribute values of second dropdown box without selecting any attribute value from first dropdown box?

Thanks in advance.


texts: Need to add text field in custom payment method

texts:
ACL is my custom payment method now i want to add custom field below ACL Option in Checkout Page.

PFA


texts:
I'm facing this message in system.log when I open an oreder from the admin panel:

MESSAGE: Recoverable Error: Argument 1 passed to Mage_Eav_Model_Attribute_Data::factory() must be an instance of Mage_Eav_Model_Attribute, instance of Mage_Eav_Model_Entity_Attribute given, called in app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php on line 133 and defined  in app/code/core/Mage/Eav/Model/Attribute/Data.php on line 59

I have found another question similar to this, but it was related to a specific module and doesn't provide a general method to manage this error.
So, is there a way to act/a path that should be followed to find the problem and fix it? It looks like it prevents me from edit the order


texts:
I want to delete products by sctip.

They way I am doing it for test :

if(!empty($products))
        {
            foreach($products as $_product)
            {
            $sku = $_product->getSku();

            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $productRepository = $objectManager->create('\Magento\Catalog\Model\ProductRepository');
            $registry = $objectManager->create('\Magento\Framework\Registry');
            $registry->register('isSecureArea', true);
            $productRepository->deleteById($sku);
        }
    }

I am getting Error:

 [Magento\Framework\Exception\StateException]
  Unable to remove product 1000180701

EDIT:

Full Code, i am using a Product Collection:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */
        $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
        $productCollection->addFieldToSelect('*');
        $productCollection->addFieldToFilter('sku',array('nin'=> $aProductIds));
        /** Apply filters here */
        $products = $productCollection->load();

        if(!empty($products))
        {
            foreach($products as $_product)
            {
                $sku = $_product->getSku();

                $registry = $objectManager->create('\Magento\Framework\Registry');
                $registry->register('isSecureArea', true);
                $_product->delete();
            }
        }

Throwing:

[Magento\Framework\Exception\LocalizedException]
  Delete operation is forbidden for current area


texts: On Search Result: Group Products by Category

texts:
I need the search result page to list products grouped by category name.

Example: When searching for nike the result should be viewed like this:

Category "Shoes":
  - some nike shoe
  - another nike shoe

Category "Shirts":
  - some nike shirt
  - another nike shirt
  - ..

Category ...
  - ...

So far I tried to modify my list.phtml to simply cycle through all active store categories and check each found product (from getLoadedProductCollection()) if its assigned to that category. It's working, but slow as hell. So I think there must be some more Magento-like way to do this, but I don't know where to start. Anyone got some tip for me? Thanks


texts: How to get all current category products in magento 2

texts:
I want to get all the products available on the current category page I tried this code

 public function getProduct()
{
        $check = $this->_registry->registry('current_category')->getProductCollection();
        return $check->getAllIds();

now this code is working good for non-configurable products but in cofigurable products it show a null Array.
I just want to get all the Products on the current categories. Thanks in advance


texts: What is the best way to install fb pixel in magento 2 ? Using script or with extension!


texts:
I have added quick view button on category product page.

Quick view button not showing on catalogsearch page.

I want to add Quick view button on catalogsearch page.

Please help me.


texts:
How can I remove the billing phone number from checkout, or at least make it not required?

I've looked everywhere and can't find any references to the form.


texts: Updating 2500 product price using observer gives 500 internal server error

texts:
I have created a module inside admin, which is based on Gold rates,
if admin update the gold rates for specific Carat then it will update the prices for that Carat products.

Now my problem is that, if there are less no. of products like 400, it is working fine,
but when there are around 2000 products it updates the few products and then gives the 500 internal server error.

I have written the code as per the guidelines mentioned in the URL:http://www.atwix.com/magento/working-with-large-collections/

Please Please suggest, and help me.


texts: where is custom field stored in database?

texts: I have added a custom field in Magento 2, the Attribute Code is product_custom_type as shown in screen-shot. But where is this custom field stored in the database? I've ran a query to search all tables by field name product_custom_type, and I couldn't find it. Does this attribute_code has another name as the field name in the database?


texts:
I have added one new CMS page. Its redirecting to homepage if preview clicked. I have also checked with default about-us page but still its redirecting to homepage.

It should redirect to 404 Page if the page is not there but its redirecting to homepage. I have checked in System->Configuration->web->default page also. 404 Not found only selected for CMS no route page option.

Can anyone tell me why it is happening?


texts: Can't save or update products after deleting one Store

texts:
Under Magento community ver. 1.9.1.1. I have 3 stores and 9 store views (3 store views in each Store).
After deleting one store, I can no more delete products or update them.

I don't get log files or error messages.

Help.


texts:
mysql> drop database magento2;
$ cd /var/www/html/bin/
$ ./magento setup:install --admin-firstname FN --admin-lastname LN --admin-email 'email@example.com' --admin-user admin --admin-password 'abc123' --base-url 'http://example.com' --db-host='127.0.0.1' --timezone "America/Chicago" --session-save files --cleanup-database
$ ./magento indexer:reindex

I create a bunch of product attributes "attribute_a", "attribute_b", "attribute_c", ... (no other settings changed)

then I use the API to add a product

Authorization: Bearer <access token>
POST index.php/rest/V1/products
{
  "product": {
    "sku": "SKU1",
    [...]
    "custom_attributes": [
      {
        "attribute_code": "attribute_k",
        "value": "value_k1"
      },
      [...]
    ],
    [...]
  },
  "saveOptions": true
}

everything seems to work except the attribute isn't saved, and system.log shows

main.WARNING: Attempt to load value of nonexistent EAV attribute '152'
  for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []

and from the admin interface I can save value_k2 to attribute attribute_k
and I would expect to see

...
attribute_g=
...
attribute_k=value_k2
...

but instead I see

...
attribute_g=value_k2
...
attribute_k=
...

the strange part is that until I tried adding attribute_k everything seemed to be working fine...