texts: install the same extension twice(to work seperatly)

texts:
I installed this extension:
https://github.com/MagePsycho/magento2-custom-shipping
in order to have a custom shipping method in my magento 2 store and it works fine.

I neet to have another shipping method with fixed price so I would like to install this extension again...

I guess I should change some files but I don't know exactly which files to edit and where..

Thanks for the help!


texts: Magneto 2 project on new VPS loading wrong design

texts:
I have successfully installed my magneto 2 version 2.3.3 project on my new vps service using Ubuntu with php 7.3.13.
But the design seems to have failed to load correctly. It's all over the place. And images seem to be missing.
My site also displays the "Default welcome message" in the top navigation bar. Any idéas thanks?

I have set up my database and added the correct information in app/etc/env.php
Using these instructions:

How to setup magento 2.1 from existing project

I have redone and imported the root files multiple times using this command.

ssh root@IP tar cf - /var/www/html/magento2 > /var/www/html/magento2.tgz

I followed these instructions when I moved my project:

How to move magento shop to another server
https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/upgrade-with-plugin.html


texts:
I'm new with magento. I'm accidentally changed Use Custom Admin URL value into Yes and added a custom admin url (which is doesn't exist). Now everytime i tried to access my magento admin it always redirect to that custom admin url and gives error because that URL doesn't exist. I have tried to return it to No and click save but i always get webadmin-sit-ecomm.tbsgroup.co.id’s server IP address could not be found.

I have also tried to change it from the core_config_data table but still the same. All I need to do is return Use Custom Admin URL value to No. Can Anyone please help?


texts: Magento2: How can load subcategory based on catagories dropdown option value?

texts:
I have checked that reference link for Magento1

but i want to do in Magento2 using object manager. Anyone have an idea for that please?


texts:
I want to markup prices but Magento2 provides only a discounted option (I don't know how it is possible!). I'm trying to modify the expression in Magento\CatalogRule\Model\Indexer\ ProductPriceCalculator

From
case 'by_percent':
$productPrice = $productPrice * (1 - $ruleData['action_amount'] / 100);
To
case 'by_percent':
$productPrice = $productPrice * (1 + $ruleData['action_amount'] / 100);

It should work because the math formula is correct but when I apply the rule in the frontend it shows only the regular price. I suppose there is something other that limits the price to be not over the regular price but I'm not able to find and manage it.
The full code is as below:
<?php

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

namespace Magento\CatalogRule\Model\Indexer;

/**
 * Product price calculation according to rules settings.
 */
class ProductPriceCalculator
{
    /**
     * @var \Magento\Framework\Pricing\PriceCurrencyInterface
     */
    private $priceCurrency;

    /**
     * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
     */
    public function __construct(\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency)
    {
        $this->priceCurrency = $priceCurrency;
    }

    /**
     * Calculates product price.
     *
     * @param array $ruleData
     * @param null $productData
     * @return float
     */
    public function calculate($ruleData, $productData = null)
    {
        if ($productData !== null && isset($productData['rule_price'])) {
            $productPrice = $productData['rule_price'];
        } else {
            $productPrice = $ruleData['default_price'];
        }

        switch ($ruleData['action_operator']) {
            case 'to_fixed':
                $productPrice = min($ruleData['action_amount'], $productPrice);
                break;
            case 'to_percent':
                $productPrice = $productPrice * $ruleData['action_amount'] / 100;
                break;
            case 'by_fixed':
                $productPrice = max(0, $productPrice - $ruleData['action_amount']);
                break;
            case 'by_percent':
                $productPrice = $productPrice * (1 + $ruleData['action_amount'] / 100);
                break;
            default:
                $productPrice = 0;
        }

        return $this->priceCurrency->round($productPrice);
    }
}


texts: How to add QTY box in recently viewed product in magento 2.3.5 version

texts: I want add qty box in recently viewed product in magento 2.3.5. All recently viewed product using knockout js. please suggest any way


texts: swatches option validation for ajax add to cart issue detail page

texts:
I have installed Magento2.1.9  I have enabled ajax add to cart functionalities for product detail page.
By following code

<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "catalogAddToCart": {
                "bindSubmit": true //by default it was "false" for ajax cart i have changes to "true"
            }
        }
    }
</script>

Ajax add to cart button is not validation the swatches option of configurable product on click it's going to submit without any validation of swatches option.

But when i have disabled ajax add to cart it's working fine.

Please help on above issue.Any references and suggestion is highly appreciated.


texts: $order->getCustomerName() returned ?? for unicode customer name

texts:
Under Magento EE 1.14, I have unicode characters in the customer name, the following code does return correct name in unicode for the first time:

$order  = Mage::getSingleton("sales/order")->loadByIncrementId(166690006338);
$order->getCustomerName();

however, after I add the following db close connection lines, the return becomes malformed ??. Any clue for how to fix the problem?

$db = Mage::getSingleton('core/resource')->getConnection('sales_read');
$db->closeConnection();

// the return becomes malformed ?? after the closeConnection, however, any non Unicode characters still shows correctly

$order  = Mage::getSingleton("sales/order")->loadByIncrementId(166690006338);
$order->getCustomerName();


texts: In a custom model, should I overwrite `afterLoad()` or `_afterLoad()`?

texts:
Magento\Framework\Model\ResourceModel\Db\AbstractDb declares two methods as follows:

/**
 * After load
 *
 * @param \Magento\Framework\Model\AbstractModel $object
 * @return void
 */
public function afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
    $this->_afterLoad($object);
}

/**
 * Perform actions after object load
 *
 * @param \Magento\Framework\Model\AbstractModel|\Magento\Framework\DataObject $object
 * @return $this
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
    return $this;
}

In a custom resource model, if I need to manipulate some data as it comes out of the database, before exposing it to the rest of the application, which of these is it best to overwrite?

If _afterLoad (with the underscore) was private, rather than protected, I'd have my answer, but I'm not sure.


texts: How to Get List of Coupons Available for Customer Using REST API

texts: I need to get the List of Coupons Available for Logged in customers using REST API.


texts: Magento custom url added with current page url

texts:
I am printing my custom URL's in footer which I am getting from database, Some thing like this
Assume this contains www.google.com link.

<a href="<?php echo $links['link_url']?>"><?php echo $links['title'] ?>

When I click on this link at footer it rediecting with my current page url
www.mydomainname.com/www.google.com

How can I avoid attaching my current domain name to it?
It should be redirect to "www.google.com"


texts: Check if given product will trigger any promo?

texts:
Is there any possibility in Magento 2 to check if given product will trigger any promotion?
I've tried this way. Products in given cart are qualifying to promotion but I got empty array:
  foreach ($products as $product) {
        $rulesApplied[] = $this->rulesApplier->applyRules($product, $rulesCollection, false, "");
    }

RulesApplier is Magento\SalesRule\Model\RulesApplierclass


texts: Indonesia language pack for Magento CE 1.9

texts:
I need an Indonesia language pack to integrate with my Indonesian site for one of my Indonesian clients. I found the beta version on the Magento website it is not working fine.

If anyone has an Indonesian verson please share it with me.

Thanks in advance.


texts: Error while trying to install in AWS Ubuntu Instance

texts:
I have properly setup Magento 2.3.4 in my localhost. But whenever I try to deploy this to AWS Uuntu Instance I get the following error.

[ERROR] Magento\Framework\Exception\LocalizedException: Area code is not set in /opt/alogic/public_html/vendor/magento/framework/App/State.php:153
Stack trace:

I have gone through several questions here but haven't found any proper solution.


texts: extension that inject tag to header without any additional config

texts:
I'm writing an extension for the community and I need it to inject an html tag to the head, which is not constant, eg:

<script>var something = "this value comes from php code";</script>

what's the best way to inject such a tag, to all site pages, without require the admin to do any additional config on the admin panel?

thanks!

EDIT:

Based on Bernhard Prange's answer, here's the solution for future reference (note - it just do alert don't actually inject any meaningful javascript, but you can easily put anything in the template):

app\design\frontend\base\default\template\page\html\inject_js.phtml

<script>alert("TEST")</script>

app\design\frontend\base\default\layout\test.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="head">

                <block type="page/html" name="dynamicJs" as="dynamicJs" template="page/html/inject_js.phtml" />

        </reference>
    </default>
</layout>

app\code\community\SomeName\Test\etc\config.xml

  <!-- note, DON'T put this inside the <global> tag! -->
    <frontend>
      <layout>
        <updates>
          <test>
            <file>test.xml</file>
          </test>
        </updates>
      </layout>
    </frontend>


texts: custom customer attributes are not shown at checkout register in Magento 2

texts: i have created custom customer attributes, it will working fine in customer registration form but not shown at checkout register page in Magento 2


texts:
This error appears on setup upgrade
| SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Cp_WishlistApi' for key 'PRIMARY', query was: INSERT INTO `setup_module` (`module`, `schema_version`) VALUES (?, ?)


texts: How to get base url in a layout xml file

texts:
I'm using Magento 1.9 and in app/design/frontend/mytheme/mytheme/layout/page.xml I got the following code snippet:

<reference name="head">
<block type="core/text" name="stylescss">
    <action method="setText">
        <css><![CDATA[<link rel="stylesheet" type="text/css" href="https://www.example.com/css/styles.css?v=1.0" media="all" />]]></css>
    </action>
</block>

This was done originally in order to be able to control the version of the stylesheet, and bypass several layers of caching, forcing the user browser to fetch a different version of the file.

Is there a way to replace www.example.com for a variable containing the baseurl?

P.S. Any alternative solution to add versioning to a file, is more than welcome :)

Thank you


texts: Magento 2 - Short Description is not showing!

texts:
Short description is not showing for some reason, I have declared the block again in a new container after price block, yet not showing!

    <referenceBlock name="product.info.description" remove="true"/>
    <referenceBlock name="product.info.overview" remove="true"/>

    <referenceBlock name="content">
        <container name="product.content.overview" htmlClass="overview" htmlTag="div" after="product.info.price">
            <block as="shortdescription" class="Magento\Catalog\Block\Product\View\Description" group="detailed_info" name="product.content.shortdescription" template="Magento_Catalog::product/view/attribute.phtml">
                <arguments>
                    <argument name="at_call" xsi:type="string">getShortDescription</argument>
                    <argument name="at_code" xsi:type="string">short_description</argument>
                    <argument name="css_class" xsi:type="string">overview</argument>
                    <argument name="at_label" xsi:type="string">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Overview</argument>
                    <argument name="add_attribute" xsi:type="string">itemprop=&quot;description&quot;</argument>
                </arguments>
            </block>
        </container>

        <container name="product.content.essentials" htmlClass="essentials" htmlTag="div" after="product.info.media">
            <block as="description" class="Magento\Catalog\Block\Product\View\Description" group="detailed_info" name="product.content.description" template="Magento_Catalog::product/view/attribute.phtml">
                <arguments>
                    <argument name="at_call" xsi:type="string">getDescription</argument>
                    <argument name="at_code" xsi:type="string">description</argument>
                    <argument name="css_class" xsi:type="string">description</argument>
                    <argument name="at_label" xsi:type="string">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Details</argument>
                </arguments>
            </block>
        </container>
    </referenceBlock>

    <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View" group="detailed_info" name="product.info.deliveryandreturns" template="Magento_Catalog::product/view/deliveryandreturns.phtml">
            <arguments>
                <argument name="title" translate="true" xsi:type="string">Delivery &amp; Returns</argument>
            </arguments>
        </block>
        <block class="Magento\Catalog\Block\Product\View" group="detailed_info" name="product.info.sizechart" template="Magento_Catalog::product/view/attribute.phtml">
            <arguments>
                <argument name="at_call" xsi:type="string">getSizechart</argument>
                <argument name="at_code" xsi:type="string">sizechart</argument>
                <argument name="css_class" xsi:type="string">sizechart</argument>
                <argument name="at_label" xsi:type="string">none</argument>
                <argument name="add_attribute" xsi:type="string">itemprop=&quot;sizechart&quot;</argument>
                <argument name="title" translate="true" xsi:type="string">Size Chart</argument>
            </arguments>
        </block>
    </referenceBlock>

    <move element="product.info.details" as="product-tabs" destination="product.content.essentials" after="product.content.description"/>

</body>


texts: Magento 2 Related Product Image is not Accurate

texts:
In Related Product Slider,
All Images are of different size and default Magento is not resizing them.
Screenshot : https://prnt.sc/oax7yl

I want to show all images of the same size.

In view.xml, I have added the width and height of Image but not worked.

<image id="related_products_list" type="small_image">
              <width>240</width>
              <height>300</height>
            </image>

Please suggest me some solution.


texts: Magento 2 : Moving the Magento media directory to S3

texts: Is there any way to load images directly from external url[amazon s3], instead of importing images in to the server? How to add external url to csv files while importing configurable products.


texts: Will Magento version 1.4.2.0 work with MySQL version 5.6?

texts:
We have MySQL version 5.5 installed on our server and plan to upgrade to version 5.6. However, we have an old website using Magento version 1.4.2.0. Does anybody know of any issues with this version of MySQL and an old version of Magento?

Thanks


texts: Magento Extension Manager -System Upgrade - Blank page

texts:
I had a 'Please Wait' problem on the Extension Manager and after saw the solution below and replaced the line 181, Extension Manager and System upgrade shows Blank page , I restored backup of the module.php but the problem remains and when i click on System Config keys are not being saved.

Cache flushed but same ,Magento 2.2.5

**setup/src/Magento/Setup/Model/Grid/Module.php
line 181
replace with
$item['moduleName'] = isset($item['moduleName']) ? $item['moduleName'] : $this->packageInfo->getModuleName($item['name']);**


texts: PWA Studio: Using a Different UPWARD Endpoint

texts:
It's been pointed out to me that it's not only possible to use Magento's PHP implementation of an UPWARD server, but that Magento themselves are using it for their own Cloud Servies.
Given this is the case -- what's required to point a PWA Studio Buildpack application at a different UPWARD server?  Is it as simple as setting a different API Base or is there more involved here?


texts: Global Payment method showing Blank Screen after successful Transaction

texts:
I am using Global Payment method in one of my website and since 2 months I am not getting any proper solution to resolve blank screen after successful payment transaction. Please provide me solution ASAP those who anyone knows about it.
Thanks,


texts: List orders history using Customer token?

texts: There is no option to get all customer orders without setting there admin rights. So is there is an API to call like /V1/orders/mine ?


texts:
Im very new to Magento - first time actually.

We had outsourced to other developers to change my nav bar to what it is currently

http://flavourdevelopment.co.za/

Please tell me how to change it to a normal thin nav bar like most sites?

Basically i just want to get rid of the blocks and have a normal bar

I have tried to edit the css and i only get as far as changing the sf-menu (seems to be the only one that makes any difference) from a height of 110 to 50px but the blocks do not resize to fit in the container - i see the container hs infact changed but the menu stays the same - i tried changing the LI elements but this is not a solution at all - And regarding your comment - no one is asking you to solve my problem i was asking if anyone knows how to do it as I am new - all i need is a direction. I am a long time member of stackexchange and know very well how things work thanks.


texts: Is it possible for a customer to download a file after paying for the order?

texts:
I sell electrical products and I want customers to download or receive an email with the instruction manual for the product.

I don't want that the manual viewable on the website before the customer pays for the order.

What steps do I need to perform to achieve this?


texts:
I am trying to use Mark Shust's repo to install Magento 2 with Docker.

For some strange reason, I am getting this error:

I tried all the answers here.

For more details:
https://github.com/markoshust/magento-docker/issues/80

Would really appreciate some help.

Update

I am logged in as root and have tried all variations of chmod -R 777 var. The files that refuse to change ownership are all from /var/www/html/var/composer_home/.

Here are current permissions for folder:

total 40
-rwxrwxrwx 1 app  app    189 Jan 16 18:44 auth.json
drwxr-xr-x 6 root root   192 Aug 31 19:57 cache
-rwxrwxrwx 1 app  app     63 Sep  4 22:14 composer.json
-rw-r--r-- 1 root root 21034 Sep  4 22:03 composer.lock
-rwxrwxrwx 1 app  app    799 Sep  4 18:10 keys.dev.pub
-rwxrwxrwx 1 app  app    799 Sep  4 18:10 keys.tags.pub
drwxr-xr-x 9 root root   288 Sep  4 22:14 vendor

Sample error:

chown: changing ownership of '/var/www/html/var/composer_home/.htaccess': Operation not permitted


texts:
Im working on a magento store with two different types of gift message. If a customer chooses to create a gift message I need to be able to display it in the invoice.
What would be the best way to approach this? Should I make a custom module or just copy the invoice/sales module in local and edit it?
I'll obviously appreciate any help/answer but the less the answer assumes I know the better. Thanks in advance!!


texts: Magento 1.7: Different sku and custom option sku for ERP System import

texts:
The customer should get the sku of the product in the catalog, cart and checkout process to avoid missunderstanding as this standard sku is communicated in the price list, the custom options has no price difference as it handles technical features like country specific cables or different frequencies.

For the import to the erp system we need the custom option sku as it definies the product variant in the erp system.

Example:
product sku ABC
custom option colour
blue sku ABC_00
red sku ABC_01

The object modell of the saved product should have the standard sku (ABC) and in the custom options the variant sku (ABC_01).

In our ERP System Navision the item (sku) has a standard number and optional variant codes.

Questioin: Which file / function defines the sku and the custom option sku?


texts: Magento 1 multi ajax request on one page checkout

texts:
I added cart block to checkout and qty product are updated by ajax request.
for first request we do not have any problem but when shipping method or payment method are changed we get 403 error. I think the form key is already sent and expired .
how I can fix this problem or how I can send ajax request without form key?

 var request2 = new Ajax.Request(
        '<?php echo mage::getUrl("base/index/getO") ?>',
        {
            method: 'get',
            onSuccess: function(response) {
                jQuery('.opc-wrapper-opc').html(response.responseText);

            }
        }
    );


texts: How to fix product import Add/Update loading issue?

texts:
On my product import page, I am unable to edit or upload new products as the circle never disappears.

How can I resolve this?


texts: Magento Paypal onAuthorization error on return to success page

texts:
I have a fresh install of Magento 2.3.6. I enabled the default paypal payment method, and I am trying to debug it using sandbox mode.
I am able to complete the process of the payment on Paypal, but when it suppose to return to the site, it just hangs on Processing... in Paypal site (see image below), and in devtools I see that there is a request to magento url paypal/express/onAuthorization that is pending.

After exactly 60 seconds, I am getting an error in the UI:

The backend is using nginx->php-pfm setup. In nginx log I see error 499:
10.244.43.27 - - [30/Apr/2021:14:54:06 +0000] "POST /index.php/paypal/express/onAuthorization/ HTTP/1.1" 499 0 "http://example.com/index.php/checkout/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36" "10.244.43.0, 10.244.226.77

The onAuthorization link is showing 504 error:

There is nothing in php-pfm that correlates to that time. There is nothing relevant in var/log/* files.
The payment on Paypal is actually successful. The seller account received the payment.
I also enabled debug on magento config for (Sales=>Paypal=>Advanced=>Debug mode), and I see, about 10 seconds after the confirmation of the pay on paypal site, var/log/payment.log with a response of  'PAYMENTINFO_0_PAYMENTSTATUS' => 'Completed'.
I tried to increase timeouts both in nginx and in php-pfm.
php-pfm:
# php -i | grep timeout
hard_timeout => 2 => 2
Read timeout => 86400
default_socket_timeout => 600 => 600
opcache.force_restart_timeout => 180 => 180

nginx:
# grep fastcgi_read_timeout /var/www/html/magento2.conf
        fastcgi_read_timeout 100s;
    fastcgi_read_timeout 600;

How to debug this from here?


texts: Magento on admin order create and frontend checkout returns 500 error after update to 1.9.4.2

texts:
Hi guys I have just updated my site to 1.9.4.2. But when I attempt to create an order in admin I get a 500 error. Same happens on frontend onepage checkout.

Tried turning errors on nothing shows.

For enabling error reporting, I did the following:

In Index page change the following:

error_reporting(E_ALL | E_STRICT);

to

error_reporting(E_ALL);

Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true

and uncomment this line

#ini_set('display_errors', 1);

In Errors folder rename local.xml.sample to local.xml.

In the .htaccess file I added

SetEnv MAGE_IS_DEVELOPER_MODE=true
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag  log_errors on
php_value error_log  /var/www/html/mag19/mag19errorphp.log

The update works well on my local site and no errors. But, on the prod site which is nearly like for like as local site, it throws the 500 redirect error. Refreshing the page on frontend checkout, before the http 500 error is shown, whilst refreshing, I can shortly see
the red cross for error on chrome dev tools. This however disappears before you get to see the error as the http 500 error kicks in.

**

UPDATE 05/07/19:
  Been awhile and and I am none the wiser as to why this happened. I have
  reverted back down to 1.9.4.1 and all is working well.

Backtracing, by carrying out each new change individually. I believe I have stumbled across the root cause. It has to be one of the changes in the Authorizenet module in core. As soon as I carry out those the afore stated error occurs.

Why this module causes issues is beyond me. We do not even use it!!

**

Files changed in Authorizenet module:

**

Update 08-07-19:
        The validate function in the Directpost.php model file looks to be the
        issue cause;

public function validateResponse()
{
    $response = $this->getResponse();
    $hashConfigKey = !empty($response->getData('x_SHA2_Hash')) ? 'signature_key' : 'trans_md5';

    //hash check
    if (!$this->getConfigData($hashConfigKey)
        || !$response->isValidHash($this->getConfigData($hashConfigKey), $this->getConfigData('login'))
    ) {
        Mage::throwException(
            Mage::helper('authorizenet')->__('Response hash validation failed. Transaction declined.')
        );
    }
    return true;
}

**

**

UPDATE 10/07/19:
I have looked into this further and I believe the issue is because production server runs 5.4.x whereas local server is on 5.6.x. Whereby, as per the php official documentation:

  Note: Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

Thus, when PHP is going to parse this, it will result in a parse error.

Now, as per Magentos' official documentation they "are" supporting:

Whereby, 5.4 support is listed as supported but evidently it does not support this clearlly.
**


texts:
IN some scenario for configurable product , when we update the url-key , it is storing in the "catalog_product_entity_url_key" but in the admin panel it is the old key , we also flushed the cache and did reindexing from shell, still it is showing the same  url-key .

Now when we update the description it throws error

Product with the '-------' url_key attribute already exists.

If we update the url-key and the description it gets updated , but url-key is still the same .


texts:
Is it possible to set column default value to display selected type of block?

what I mean is if the page is opened for the first time "slide" is already selected as a default?

Field definition:

        $this->addColumn('is_slide', array(
        'header'    => Mage::helper('cms')->__('Slide/Block'),
        'index'     => 'is_slide',
        'type'      => 'options',
        'options'   => array(
            0 => Mage::helper('cms')->__('Block'),
            1 => Mage::helper('cms')->__('Slide'),
            2 => Mage::helper('cms')->__('Banner')
        ),
    ));

and my _construct()

    parent::__construct();
    $this->setId('cmsBlockGrid');
    $this->setDefaultSort('block_identifier');
    $this->setDefaultDir('ASC');
    $this->setDefaultFilter(array('is_slide'=>'Slide'));


texts:
I have try to assign  products to category but get error:

 SQLSTATE[HY000]: General error: 1114 The table 'catalog_category_product_index_tmp' is full, query was: INSERT INTO `catalog_category_product_index_tmp` (`category_id`, `product_id`, `position`, `is_parent`, `store_id`, `visibility`) SELECT 2 AS `category_id`, `cp`.`entity_id` AS `product_id`, IF(ccp.product_id IS NOT NULL, ccp.position, 0) AS `position`, IF(ccp.product_id IS NOT NULL, 1, 0) AS `is_parent`, 10 AS `store_id`, IFNULL(cpvs.value, cpvd.value) AS `visibility` FROM `catalog_product_entity` AS `cp` INNER JOIN `catalog_product_website` AS `cpw` ON cpw.product_id = cp.entity_id INNER JOIN `catalog_product_entity_int` AS `cpsd` ON cpsd.entity_id = cp.entity_id AND cpsd.store_id = 0 AND cpsd.attribute_id = 97 LEFT JOIN `catalog_product_entity_int` AS `cpss` ON cpss.entity_id = cp.entity_id AND cpss.attribute_id = cpsd.attribute_id AND cpss.store_id = 10 INNER JOIN `catalog_product_entity_int` AS `cpvd` ON cpvd.entity_id = cp.entity_id AND cpvd.store_id = 0 AND cpvd.attribute_id = 99 LEFT JOIN `catalog_product_entity_int` AS `cpvs` ON cpvs.entity_id = cp.entity_id AND cpvs.attribute_id = cpvd.attribute_id AND cpvs.store_id = 10 LEFT JOIN `catalog_category_product` AS `ccp` ON ccp.product_id = cp.entity_id WHERE (cpw.website_id = '1') AND (IFNULL(cpss.value, cpsd.value) = 1) AND (IFNULL(cpvs.value, cpvd.value) IN (2, 3, 4)) AND (cp.entity_id IN ('44357')) GROUP BY `cp`.`entity_id` ON DUPLICATE KEY UPDATE `category_id` = VALUES(`category_id`), `product_id` = VALUES(`product_id`), `position` = VALUES(`position`), `is_parent` = VALUES(`is_parent`), `store_id` = VALUES(`store_id`), `visibility` = VALUES(`visibility`)

Anyone know how to solve it ?


texts: Magento 2: Detect Closed Event On Modal JS

texts:
I have created a modal popup using the modal UI component. See below:

require(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function(
        $,
        modal
    ) {
        var options = {
            type: 'popup',
            responsive: true,
            innerScroll: false,
            title: 'Modal Title Goes Here',
            buttons: [{
                text: $.mage.__('Continue'),
                click: function () {
                    this.closeModal();
                },
            }]
        };

        var popup = modal(options, $('#modal'));

        $('#modal').modal('openModal');
    }
);

Is there any way that you can detect when the user closes the modal and trigger a function once this event fires?


texts: Overcoming Magento’s WYSIWYG Few Tags Disappear

texts:
This option allows you to set a rule for empty elements being valid.Default settings will currently remove these empty elements from the code after you save. Example:

Solution

Step1 : Go to js folder in root of your magento installation

js/mage/adminhtml/wysiwyg/tiny_mce/setup.js

Step2 :

Once you have this file open do a search for “var settings = {“. then add following line

extended_valid_elements: '+a[],+span[]',

+a[*] is example but you use any html element that disappearing after save.


texts: Make "Account Dashboard" link to redirect to two different dashboards based on customer type

texts:
Now based on two different user groups named "Customers"(the default ones in magento) and "Members"(our customized ones), I have different info. to display and so two different dashboards for both type of users.

The functions related to "Members" is handled by our custom module of membership.

But at the same time, the group "Members" retain functionality of being both "Customers" as well as "Members". So when a Member login he can see the same left navigation as normal customers.

But the part is here "Account Dashboard" is a link that always redirects to a normal customer dashboard rather than the Member ones.

So i want that, when a normal customer logs-in, that should redirect to a normal dashboard but when a Member logs-in, it should redirect to a Member dashboard from each page!

How do I achieve this????
Thanks in advance......


texts: Magento 2.2.1: Customer custom attribute, sort order irregularity

texts:
I have added a Customer custom attribute called about,

$eavSetup->addAttribute(
    \Magento\Customer\Model\Customer::ENTITY, 'about', [
        'type' => 'varchar',
        'label' => 'About',
        'input' => 'text',
        'sort_order' => 1000,
        'required' => false,
        'visible' => true,
        'system' => 0,
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
    ]
);

The attribute is shown in Customer's Account information tab, and is successfully saving and retrieving.

The only issue is with the sort_order, whatever number I gave there (10, 10000, 500), the attribute always shows at the top of the list (above Associate to Website).

I have tried cache clean and flush, also upgraded and compiled.

What should I do to bring it to the bottom of the list?


texts: Magento 1.9. Need help with product name

texts:
I'm trying to get product name in title tag on catalog-product-view presentation in page/block/html/head.php file.
Tried both this:

$product = Mage::registry('current_product');
if($product && $product->getId()){
            $title = Mage::getStoreConfig('design/head/title_prefix') . ' ' . $product->getName() . ' ' . Mage::getStoreConfig('design/head/title_suffix');
        }

and this

$currentUrl = Mage::helper('core/url')->getCurrentUrl();
        $url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
        $path = $url->getPath();
        $oRewrite = Mage::getModel('core/url_rewrite')->setStoreId(Mage::app()->getStore()->getId())
            ->loadByRequestPath(ltrim($path,'/'));
        $pId = $oRewrite->getProductId();

        if($pId > 0) {
            $title = Mage::getStoreConfig('design/head/title_prefix') . ' ' . $pId  . ' ' . Mage::getStoreConfig('design/head/title_suffix');
        }

both not working. Except this I've another modificators for title tag such as category or (for home page) default title.

Any help or explanation, why listed above snippets didn't work will be appreceated. Thanks in advance.

UPD:

Moved all logic into themename/template/page/html/head.phtml with following rules:

<?php
        $routeName = Mage::app()->getRequest()->getRouteName();
        $identifier = Mage::getSingleton('cms/page')->getIdentifier();
        $category = Mage::registry('current_category');
        $parentCategory = Mage::getModel('catalog/category')->load($category->getParentId());
        $product = Mage::registry('current_product');
        if ($category && !$product) {
            if($parentCategory !== "Default Category") {
                echo '<title>' . Mage::getStoreConfig('design/head/title_prefix') . ' ' . $parentCategory->getName() . ' ' . $category->getName() . ' ' . Mage::getStoreConfig('design/head/title_suffix') . '</title>';
            } else {
                echo '<title>' . Mage::getStoreConfig('design/head/title_prefix') . ' ' . $category->getName() . ' ' . Mage::getStoreConfig('design/head/title_suffix') . '</title>';
            }
        }
        if($product) {
            echo '<title>' . Mage::getStoreConfig('design/head/title_prefix') . ' ' . $product->getName() . ' ' . Mage::getStoreConfig('design/head/title_suffix') . '</title>';
        }
        if($routeName == 'cms' && $identifier == 'home') {
            echo '<title>' . $this->getTitle() . '</title>';
        }
?>

But still at catalog-product-view page get only category title.

UPD2: Probably here is another possible way to get result I need - sql query to massive update products meta-title? Final result I need to get is following string for categories: "default shop name" + "|" + "parent category name"  + "category/brand name"

and for products
"default shop name" + "|" + "product name"


texts: Can any one help me how to edit the checkout page street address label in magento2.


texts:
Based on a Store Pickup Module.
How can I hide the "SHIP TO" sidebar when the customer  pick this supplier ?


texts: Google Analytics tracking across different secured and unsecured domains

texts:
I have a Magento 1.7 site (soon to be upgraded to 1.9 if that makes any difference) that has two separate domains for the unsecure and secure parts of the site.

In addition to this, there is a 3rd party payment gateway (redirect page). I am using Google AdWords.

The flow is:

Visitor clicks on Adwords Ad
Directed to page on unsecured site (www.example.com)
Shops and puts products into cart
Checks out (as guest/logs in), sent to secure area (shop.secureexample.com) to enter address, etc
Directed to 3rd party payment gateway page (www.3ppayexample.com), enters card details
Directed back to success/failure page on secured site (shop.secureexample.com)

The problem I have is tracking the visitor from first click on an Adword to the success page.

Because there are effectively 3 domains involved here, there is no end to end tracking, which means I cant measure conversions and other metrics.. All I see is referrals from shop.secureexample.com that result in sales.

Unfortunately I cant use the same domain on both secure and unsecure areas of the site (out of my hands), so that isn't an option.

Can you suggest a way to accomplish this?


texts: how to save contact form in magento2 database

texts:
i am very new to magento 2 and need to save in a database the details that users enter in the magento 2 contact form
but I didn't make it, can someone help me?


texts: How to fix XSS in website in url ? Magento 1

texts:
I can see that browsing url like this
https://www.anywebsite.com/?p=%3Cscript%3Ealert(document.cookie)%3C/script%3E

shows alert into browser window.
Is their any way to prevent it ? its XSS.


texts: Recommendations for study material on Magento designing

texts:
I am very new to Magento but with help of some sites
I have installed magento 1.7 and it's working fine.

Now I would like to change the design of the homepage and I could really use some tutorials on how to do that.

Can anyone suggest some sites of tutorials that might help me?


texts: How to hide item with qty 0 after shipment created

texts:
I just very curiously how magento can process this . Default when create shipment with set item qty to zero. It's will not visible in shipment
But i can't find file to process this
Can anyone show me the file or any snippets


texts:
I've a block Which show a bootstrap modal by a template file.

So I've making a Bootstrap module with require js located in
app/code/Vendor/Bootstrap/view/web/requirejs-config.js with this code :

var config = {
    paths: {
        "jquery.bootstrap": "//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min"
    },
    shim: {
        'jquery.bootstrap': {
            'deps': ['jquery', 'jquery/ui']
        }
    }
};

I put in dependencies jQuery ui because I get this error when I try to open my modal

  "cannot call methods on modal prior to initialization"

(I found this on the web).

So my template (from another module) looks like :

<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#callMeBack">OPEN THE MODAL</button>

                <button type="button" class="close" data-dismiss="modal">&times;</button>

Modal Header

                // some content

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

Then my problem isn't fixed, I have always the error

  "Error: cannot call methods on modal prior to initialization;
  attempted to call method 'toggle'"

I don't know why I get this error and where I miss the fix. Can you help me ?


texts:
I'm using the following to filter my collection:

                $collection = Mage::getModel('catalog/product')
                ->getCollection()
                ->setStoreId($storeId)
                ->addAttributeToSelect('sepdate')
                ->addStoreFilter($storeId)
                ->addAttributeToFilter('status', array('eq' => 1))
                ->addAttributeToFilter('sepdate', array('eq' => 'Yes'))
                ->getAllIds();

The attribute 'sepdate' is a yes/no attribute and it is added to the product list eav.

My problem is that the above doesn't work. When removing the:

->addAttributeToFilter('sepdate', array('eq' => 'Yes'))

The collection works fine, but when that is added nothing gets selected.

I have checked that there actually are products with the attribute set for 'Yes' and I have also tested with 1 instead of 'Yes'.

Can anyone help me with what i'm doing wrong here?

EDIT:

Okay, looked at the sql it made and think I found the culprit. The sql looks like this:

SELECT `e`.*, `at_sepdate`.`value` AS `sepdate` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_entity_int` AS `at_sepdate` ON (`at_sepdate`.`entity_id` = `e`.`entity_id`) AND (`at_sepdate`.`attribute_id` = '144') AND (`at_sepdate`.`store_id` = 0) INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = '1' WHERE (at_sepdate.value = 1)

Where this is causing the trouble:

AND (`at_sepdate`.`store_id` = 0)

The store_id should be 1 and I can't quite understand why it isn't since i'm setting both setStoreID() and addStoreFilter(). ?


texts: What's causing a massive delay for Time to First Byte on my Magento e-store?

texts:
I'm no specialist, and even after scouring the web for answers, I couldn't really find a solution to my issue. The next is obviously hire a specialist, but I'd like to see if the excellent (avid reader here) StackExchange community can't offer some help first.

My Magento e-store is slow (http://preview.tinyurl.com/n7pccsf). And though there are pending optimizations to be carried out, the biggest issue by far is the time to first byte -- this hovers at anywhere between 1.6 seconds and 2.2 seconds; sometimes even more. That's especially annoying, and is most visible in the product page (smartphones).

I've failed to diagnose what's causing this -- I've even been touch with my hosting provider, and they've demonstrated to me that this is not an issue on their end. Again, I'm no expert, but any help will be appreciated, and I'll do my best to follow through (techie, but not a programmer here). They also told me that, since I'm on a Pro plan, but still a shared one, Varnish cannot be installed. They've installed APC for me though, and there's built-in support for Memcached (set to 64M) for Pro members.

Thanks in advance folks!

EDIT: I've just added an FPC extension (http://www.magentocommerce.com/magento-connect/lesti-fpc.html) -- that seemed to lower load times dramatically. But from what I understand, this solution mostly sweeps the problem under the rug than fixing an actual issue. Am I right?


texts:
We are facing some major problems with the browser cache. After we have done the development on our website, the changes are not reflecting to the end user and they need to clear the browser cache at each and every time when the new changes occurs. Its really annoying and affects our business.
How can we stop this issue?


texts: How to use a subquery while performing left join in magento

texts:
I want my query to filter only distinct product_id from the table catalog_category_product . The raw sql query goes like this :

SELECT * FROM catalog_category_entity AS catalog_category_table
LEFT JOIN (SELECT DISTINCT(product_id),category_id FROM catalog_category_product GROUP BY product_id) catalog_category_product_table ON catalog_category_product_table.category_id = catalog_category_table.entity_id

can anyone suggest how to write the sub query while performing the left join magento way. Thanks in advance


texts:
I know this question has been answered 100s times but non of them solved this issue.

There is no problem accessing admin panel from other browsers but Chorme.

When I clear cookies(F12>Resources>Cookies) I can Login to dashboard.

table value and Core file also been modified.

But still  no luck. Can you help me with this?


texts: Unable to get value from core_config_data in M2

texts:
I am developing one extension in which I have one configuration form, after filling form when I click save button it successfully save the data in core_config_data, but to retrieve that data from table I need to flush M2 cache.
How can I get data from DB without flushing cache.

I am using below code to get data from DB:

$data   =  $this->_scopeConfig->getValue('user', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);


texts: Display simple product urls in magento 2 bundle selections

texts:
In a bundled product I would like to be able to show the product url from a simple product or the selected item within the bundled product as a "view item" link.

So when this is selected the user is able to view the simple product details via the link.

I have been looking and trying different code but cannot get this to show so I would say no need to place code in here as it does not work.

I am kind of new to the backend side of Magento 2 so hopefully someone can help, if you have a link on how to achieve would be great as well.


texts: Select shipping method from previous order and set it as default for next order Magento 2

texts:
I'd like to have an functionality that
select the last order shipping method & set that shipping method for the next order for user.
Is their any event , can be used to achieve this functionality ?


texts:
Magento 2.2.5 version tax is not calculating, It always show 0(zero) in cart page and checkout page.

I have been lot of search but not luck, please anyone help to fix this issue.

or

How i can alter tax amount?

Note: Tax class already assigned to product, Tax rule already in admin so please except any other solution.


texts: problem in magento default order status changes

texts:
I have a problem with magento order status, when i place an order with cc-avenue payment method, order status first assign as "Processing" and then "Pending". i am using citruspay payment gateway module.i have assigned "pending" as default order status in citruspay configuration from backend. can anybody help me where to change to get it resolved???

Thanks


texts:
So we have a module which has to return a specific view using a layout. However we can not get an empty page rendered to add my layout too.

So our code does the following:

We have a massaction that redirects us to a custom URL order/massAction and that works. On that URL we load the following layout XML:

  app/code/Vendor/Module/view/adminhtml/layout/vendor_module_order_massaction.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" layout="empty">

    <title>
        Order
    </title>

    <block class="Magento\Framework\View\Element\Template" name="Preview" template="Vendor_Module::order/view.phtml"/>

</page>

Setting the layout to empty causes the sidemenu to be loaded and the body to not be loaded, leaving the layout attribute of the page element empty makes it load the body but with a lot of other stuff.

The order/view.phtml is as follows:

  app/code/Vendor/Module/view/adminhtml/templates/order/view.phtml

Isn't HTML amazing?

There is very minimal HTML in the phtml so I /doubt/ that would be the issue. When using template hinting I can't see the block being loaded at all.

The controller we use to do the redirect and layout rendering is as follows:

  app/code/Vendor/Module/Controller/Adminhtml/Order/MassAction.php

<?php

namespace ***\***\Controller\Adminhtml\Order;

use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
use Magento\Backend\App\Action;
use ***\***\Model\Label;

class MassAction extends Action
{
    // Objects
    protected $resource;
    protected $pageFactory;
    protected $collectionFactory;
    protected $label;
    protected $filter;

    // Class vars
    public $orderIds = array();

    public function __construct(
        Context $context,
        PageFactory $pageFactory,
        CollectionFactory $collectionFactory,
        Filter $filter,
        Label $label
    ) {
        parent::__construct($context);
        $this->pageFactory = $pageFactory;
        $this->collectionFactory = $collectionFactory;
        $this->filter = $filter;
        $this->label    = $label;
    }

    public function _isAllowed()
    {
        return $this->_authorization->isAllowed('Vendor::module');
    }

    public function execute()
    {
        $this->label->setShippingAddresses($this->getOrderIds());

        $pageObject = $this->pageFactory->create();

        return $pageObject;
    }

    public function getOrderIds()
    {
        $collection = $this->filter->getCollection($this->collectionFactory->create());
        foreach ($collection->getItems() as $order) {
            $this->orderIds[] = $order->getId();
        }
        return $this->orderIds;
    }
}

This appears to be working except weird stuff is being printed out rather than our layout + view. If anyone knows what we are doing wrong it is greatly appriciated.

PLEASE READ: The vendor name and module name have been altered in the code. Where possible Vendor/Module is being used and where not possible due to the possibility of confusion ***/*** is being used.


texts:
I would like to get the last order Number saved in the database of the store and increment it to get what the current order number would be before it is saved as I would like to pass the order number in my API as a reference when posting.

I currently try to get the order number this way

$quote = Mage::getModel('checkout/session')->getQuote();
$quoteData= $quote->getData();
$orders = Mage::getSingleton('checkout/session')->getLastRealOrderId();
Mage::log($orders,true);
$test =  substr($orders,0,7);
$test2 =  substr($orders,7);
$number = $test2++;

But the minute I clear the cache or restart my pc and attempt to create a new order there is no order number - I am currently testing on my local machine and using the Magento demo store to build my module.

How would I get the order number stored in the database?

Thank you.


texts: How to add product reviews progmatically to add data on custom field

texts:
$review = Mage::getModel('review/review')
->setEntityPkValue(intval($pressquote->product_id)) //product id
->setStatusId(intval($pressquote->status))
->setDetail($pressquote->text)
->setTitle('')
->setEntityId(1)
->setStatusId(intval($pressquote->status))          //approved
->setCustomerId(null)                       //null is for administrator
->setNickname($pressquote->source)
->setLink($pressquote->link)                            //custom field
->setLinktext($pressquote->linktext)                   //custom field
->setYear($pressquote->year)                            //custom field
->setStoreId(1)
->setStores(array('base'))
->save();

I am not be able to save data on custom field above commented  for custom field.


texts: Which of my magento 2 extensions that changed my product page layout?

texts:
once i downloaded one of the extensions that viewed in the image that attached .. it had change my product page layout .. and make the product image appears in different column and different size .. so i need to know which extensions made that change .. i need to get the default configuration of my magneto 2 system to be effective again and remove the extension ....
 thanks

note : the default configuration of product page not effect my layout product page anymore


texts: Adding an attribute from a simple to Magento 2 configurable page

texts:
I’d like to be able to show an attribute from the selected simple on my configurable pages in M2.2.5

Using the example attribute with name of ‘serves’

Each simple has a value in serves e.g, 5 or 10-12

It’s an attribute I use to show how many portions you get from a meat joint so as the confurable uses weight as the drop down, I need to then show average servings or portions.

When someone picks a simple, I want to show that attribute above the SKU and have it dynamically update from simple to simple.

I don’t need to carry it through checkout or anything, it’s only really needed on the product page.

Would appreciate your help everyone.


texts: Jquery conflict with elastislide.js and prototype.js

texts:
Again I am here with my nightmare Conflict issue.

This question seems like a duplicate but I have read all other answer that suggests use no conflict after jquery  but it's not working.

Can anyone briefly describe why and when we use jquery and what to  if there more then 2 jquery and prototype version.

Currently, I am trying to solve following problem .It's feel like issue with js/jquery.elastislide.js file but can't find what is the issue here.

brief answer about conflict will appreciate.

<!-- other magento default js  -->
<script type="text/javascript" src="http://example.com/js/iwd/all/jquery-1.10.2.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/response.0.6.0.min.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/select-menu.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.selectbox-0.1.3.min.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.ui.totop.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.tweet.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/jquery.elastislide.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/ajaxwishlist.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/noty/jquery.noty.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/noty/layouts/top.js"></script>
<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/noty/themes/default.js"></script>

<script type="text/javascript" src="http://example.com/skin/frontend/meigeetheme/default/js/script.js"></script>

  Uncaught TypeError: jQuery(...).elastislide is not a function script.js:296

jQuery(document).ready(function(){
   jQuery('#brands-carousel').elastislide({
        imageW      : 163,
        margin      : 0,
        current     : 0,
        border      : 0,
        minItems    : 2,
        easing      : 'easeInBack'
    });
});


texts: After installing the patch-9767 I am unable to move to the next step from payment information in onepage checkout page.


texts: Magento2: How to remove checkout login popup and redirect to login page?

texts:
I am using magento2.4.1 and I want to remove checkout login popup and redirect customer to login page when customer click on "Proceed to checkout" button and after login redirect to checkout step.
What is the best way to do this in magento2?
please advice.
Thanks


texts: Getting 403 Forbidden response with REST API on CE 1.9.1.0

texts:
I'm using this link as my model for testing the REST API, and I get all the way through the authorize prompt to a "403 Forbidden" response (this is for both the customer and admin examples).

Invalid auth/bad request (got a 403, expected HTTP/1.1 20X or a redirect)
{"messages":{"error":[{"code":403,"message":"Access denied"}]}}

STEP 1 - I access this example URL: http://mywebsite.net/oauth_admin.php

STEP 2 - I see the login prompt and log in, along with seeing the token in the URL: http://mywebsite.net/admin/oauth_authorize?oauth_token=a35aa73f8bda2fce1d5d4db25628129d

STEP 3 - I get the desired authorize prompt:

STEP 4 - I click authorize and I get the above 403 response.

I have setup the REST user and role as according to the instructions at the above link, and believe I have followed all other steps - multiple times. I'm at a loss as to why this fails.

Has anyone else experienced this issue? I've also tried using the Firefox and Chrome API extensions with the same result.

UPDATE:
I found that someone else solved this issue when the request was passed over HTTPS. There is nothing in the tutorials mentioning a prereq SSL. Has anyone else successfully used REST without SSL? See their solution here--> Why do I get unauthorized for REST API


texts:
I am performing regular backups of my store, however, when I navigate to /var/backups/, I don't see the backup files.  I only see the old backups from a month ago (and earlier) in the backups directory.

When I perform a backup, the backup shows in the admin (System > Tools > Backups).  I do not see the older backups that I see in the /var/backups folder.

Did Magento change the location of the storage for these physical backups (perhaps with a new security patch)?  Where can I see what the path is?  I want to copy it to my network as a plan B.

I am using Magento 1.9.1.


texts:
i created a newsletter email template and schedule the time 3-july-2015 4:49 pm, but still the news letter subscription user not get the news letter mail .

Here i attached the newsletters subscription users and newsletter queue


texts:
I have a magento 1.9.0.1 and all caches are turned on, why is var/cache empty? I can only empty the cache from the backend, but when this is broken, I have a problem.

Where does magento write the cache files?


texts: How to add class in ko template in magento2

texts:
I want to add class in ko template

In js:

define([
        'jquery',
        'ko',
        'uiComponent',
        'underscore',
        'mage/translate',
        'mage/storage',
        'Magento_Checkout/js/model/url-builder',
        'Magento_Customer/js/model/customer',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/checkout-data'
    ], function ($, ko, Component, _, $t, storage, urlBuilder, customer, quote, checkoutData) {
        'use strict';
        return Component.extend({
            errorMessage: ko.observable(false),
            showElement: ko.observable(),

            initialize: function () {
                this._super();
                this.showElement = this.resolveInitialVisibility();
                return this;
            },

            resolveInitialVisibility: function () {
                if (checkoutData.getInputFieldEmailValue() !== '') {
                    return checkoutData.getInputFieldEmailValue() === checkoutData.getCheckedEmailValue();
                }

                return false;
            }
        });
    }
);

I need to add disable class for <div class="col-md-12 pdl0"> if the showElement returns true.

How to do that

Thanks.


texts:
I'm trying to list the name of products inside the table cataloginventory_stock_item that are out of stock. Below the code I used:

<?php

use \Magento\Framework\App\Bootstrap;

include 'app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->get('Magento\Framework\Registry')->register('isSecureArea', true);

$productRepository = $objectManager->create('Magento\Catalog\Model\ProductRepository');
$productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$productcollection = $productCollectionFactory->create()
                    ->addAttributeToSelect('*')
                    ->joinField('stock_item',
'cataloginventory_stock_item', 'qty', 'product_id=entity_id', 'qty=0')
                    ->setPageSize(8)
                    ->load();

foreach ($productcollection as $product){
 echo 'Name  =  '.$product->getName().'<br>';
}

This code return page blank as the out of stock products are present inside the table. I tried changing a different quantity and the script returns the right list.

Just a note: These products are set out of stock automatically using a REST API call function.

Any idea?


texts:
MAGMI has been successfully set up on my Magento environment (and Magento was set up via MS's web platform installer and is kicked off via MS's Webmatrix), and I can use it quite happily to import products, change stock and prices.  However, I'm now trying to automate this data import process.

I have enabled MAGMI Import URL plugin.

The folder structure on my webserver of the Magento set up is as follows:

The data .CSV files are being uploaded via FTP to /data/upload.

When I try to execute:

  localhost:3502/magmi/web/magmi_run.php?mode=xcreate&profile=Orcus&engine=magmi_productimportengine:Magmi_ProductImportEngine&CSV:filename=/data/upload/muk_000000049_productupdate.csv -O /dev/null

MAGMI fails because it cannot find the .CSV data file with:

  ...
  Standard Attribute Import-1.1-Dweeves-
  1:/data/upload/muk_000000049_productupdate.csv -O /dev/null not found -
  Import Ended

Why can't it find the file? What I am I doing wrong?


texts: How can I override attributes.phtml file?

texts:
I want to override vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml file in my theme.

I've tried putting it in app/code/Infortis/Ultimo/Magento_Catalog/templates/product/view/attributes.phtml

but that doesn't do anything at all

I've also tried app/design/frontend/Infortis/ultimo/Magento_Catalog/templates/product/view/attributes.phtml

but this just creates a duplicate file in var/view_preprocessed/pub/static/app/design/frontend/Infortis/ultimo/Magento_Catalog/templates/product/view/attributes.phtml

instead of overriding the file in var/view_preprocessed/pub/static/vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml

Any help is very appreciated


texts: color swatch that works with group products and configurable products

texts: in my store there are two type of configurable products 'product-1' with attributes color,size and 'product-2' with attributes just color and these two configurable products are linked with grouped product so unfortunately Color swatch that i found from Google paid and free just works with configurable products so please share with me any color swatch extension which also works with grouped products


texts: Magento 2.3 - Can't translate product name

texts:
After I upgrade my store to latest Magento 2.3.3 version, I can't translate Product Name in the Backend there is not any checkbox or something.

Like this is now:

So there is not anyway to translate the product name, not any "Use Default Value" checkbox. I keep a copy of my Old store and there the translation work and "Use Default Value" checkbox is there too:

Anyone have the same issue? Is there anyway to fix the problem?

Thank you in advance


texts: How do I add the customer quick access bar to top of site?

texts:
I have two sites, one of which has the customer quick access bar (shown below) showing on all pages, the other doesn't have this and I can't find it in the settings on the magento dashboard so assume I will have to edit a .phtml file?

Any help would be much appreciated!

Thanks.


texts: What is Repository in Magento2 and Why use?

texts: What is Repository in Magento2? Why use this. I want to know more detail about Repository.


texts: Top Nav menu not showing after vanrish cache flush

texts:
For a long time I've been having an issue with the top navigation bar in Magento 2.3 not showing the first time a page is requested after varnish cache is cleared. On subsequent requests of the same page (e.g hitting Refresh) the nav bar shows normally. This happens on any page: Home page, Category Page, Product page, Search etc.

The issue is obviously related to varnish because the <esi:include> for the nav bar is left intact but other <esi:include> are processed normally.

I've tried clearing caches, setup:di:compile, redeploying static content but nothing worked so far.  I am at a loss as to how to troubleshoot the issue.

Using Magento 2.3.4 with Varnish 4.0.2. I cannot really modify varnish configuration/VCLs as this is managed by my host (Cloudways)

Related logs:
Varnish log
Apache access log
magento2_recv.vcl
magento2_backend.vcl

(Please note logs have been truncated to only include related requests, but still they are to large to embed in the question)


texts: How to extend rest API request or check request from web or rest API?

texts:
I have created a module for checkout payment methods event.
But I need to check request is getting from web or rest API.

I mean something like:

if(request from rest API)
{
    echo "REST API";
}
else
{
    echo "WEB";
}

Please Help me


texts: Getting this error message: dbModel read resource does not implement Zend_Db_Adapter_Abstract

texts:
I put my magento project on a linux server. First the error log messages shown up, but the folder var was missed. Then I created the var folder, I give it the 777 permissions and same with cache, report,session. In the error file from the report folder I got this message:

a:5:{i:0;s:65:"dbModel read resource does not implement Zend_Db_Adapter_Abstract";i:1;s:3543:"#0 /home/myfolder/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Varien_Data_Collection_Db->setConnection(false)
#1 /public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(MKleine_LanguageRoutes_Model_Resource_Languageroute))
#2 /public_html/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('mk_languagerout...', Object(MKleine_LanguageRoutes_Model_Resource_Languageroute))
#3 /public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('mk_languagerout...', Object(MKleine_LanguageRoutes_Model_Resource_Languageroute))
#4 /public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('mk_languagerout...', Object(MKleine_LanguageRoutes_Model_Resource_Languageroute))
#5 /public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#6 /public_html/app/code/community/MKleine/LanguageRoutes/Model/Translation.php(150): Mage_Core_Model_Abstract->getCollection()
#7 /public_html/app/code/community/MKleine/LanguageRoutes/Model/Translation.php(129): MKleine_LanguageRoutes_Model_Translation->getRouteCollection(1)
#8 /public_html/app/code/community/MKleine/LanguageRoutes/Model/Translation.php(91): MKleine_LanguageRoutes_Model_Translation->translateToFront('install', 1)
#9 /public_html/app/code/community/MKleine/LanguageRoutes/Model/Core/Url.php(75): MKleine_LanguageRoutes_Model_Translation->translateRouteToFront('install')
#10 /public_html/app/code/core/Mage/Core/Model/Url.php(398): MKleine_LanguageRoutes_Model_Core_Url->getRouteFrontName()
#11 /public_html/app/code/core/Mage/Core/Model/Url.php(763): Mage_Core_Model_Url->getBaseUrl()
#12 /public_html/app/code/core/Mage/Core/Model/Url.php(995): Mage_Core_Model_Url->getRouteUrl('install', Array)
#13 /public_html/app/Mage.php(394): Mage_Core_Model_Url->getUrl('install', Array)
#14 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(711): Mage::getUrl('install', Array)
#15 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(689): Mage_Core_Controller_Varien_Action->setRedirectWithCookieCheck('install', Array)
#16 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(474): Mage_Core_Controller_Varien_Action->_redirect('install')
#17 /public_html/app/code/core/Mage/Core/Controller/Front/Action.php(69): Mage_Core_Controller_Varien_Action->preDispatch()
#18 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#19 /public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#20 /public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#22 /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#23 /public_html/index.php(83): Mage::run('', 'store')
#24 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

So what could cause this problem ? WHY ? and I do I solve it ?


texts: Send Magento order confirmation after succesful checkout

texts:
Here's my problem: When a customer in my Magento store places an order, the confirmation mail is being sent right away. Even when the payment procedure is not done.

I want the order confirmation mail only to be sent when the payment is done. For example when someone chooses PayPal and clicks on Place Order button, the person is redirected to PayPal, makes the payment: confirmation mail send. But when the person is cancelling the payment in PayPal, nothing should be sent.

Next to that I still need blind copy or separate order confirmation mail to ourselves.

I did not find a solution on Google or Stackoverflow, so I hope someone can help me out here. Thanks in advance!


texts: Multiple Warehouse with multiple shipping rates

texts: I want to create multiple warehouse and i assign different shipping rate for each warehouse in same website.  Example: I have different product from different place so i create different warehouse so if customer order both i want to assign different shipping rate for each warehouse


texts:
I have a problem using the bulk and rabbit api.
I'm launching 50 update requests on 50 articles every two minutes.
I observe that in the first request of the 50 requests, they enter as success 8 and the rest are waiting, from the second batch of 50 requests, another 8 or 9 success enter, leaving 100 - 8 + 9 in state 4.
Can anyone give me some idea why this happens?
Thank you very much.


texts: W3 validator CSS error : Value Error : speak none is not a speak value : none

texts:
W3 validator CSS error: Value Error: speak none is not a speak value: none - there are so many errors like that so I need to fix so help me
https://prnt.sc/uzm6pb


texts: Magento2 in How to Remove Duplicate button in product create?

texts: How to Remove Duplicate button in product Create/Edit page - Magento2.


texts: Price not updating on front end after API product update

texts:
I have an issue in that whenever I update a product price using the asynchronous endpoint

POST http://base.test/rest/all/async/V1/products

(running Rabbit MQ), the price does not change on the product description page or listing page.

If I clear the BLOCK_HTML cache, it then shows OK.

This only happens with the asynchronous endpoint. Regular endpoint

 POST http://base.test/rest/all/V1/products

updates the price right away.

Weirdly, I notice that it DOES update straight away on my local machine, just not on our host's server.

Anyone have any experience or suggestions on what this could be?


texts:
Is there any Event or Observer to Add BCC in Shipment Email
  Programmatically

Task Is Shipment Mail Send 2 Person 1st is customer and 2nd is dynamic email

Please Provide me Suggestion How To Add Programmatically BCC in Shipment Email ?

How Can I Do This ??


texts:
I am trying to creating customer with below code.

class Customer
{
    protected $_storeManager;
    protected $customerRepository;
    protected $accountManagement;
    protected $customerFactory;
    protected $addressFactory;
    protected $customerInterfaceFactory;
    protected $encryptInterface;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        AccountManagementInterface $accountManagement,
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
        \Magento\Customer\Model\CustomerFactory $customerFactory,
        \Magento\Customer\Model\AddressFactory $addressFactory,
        \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerInterfaceFactory,
        \Magento\Framework\Encryption\EncryptorInterface $encryptInterface
    ) {
        $this->_objectManager = $objectManager;
        $this->_storeManager = $storeManager;
        $this->accountManagement = $accountManagement;
        $this->customerRepository = $customerRepository;
        $this->customerFactory  = $customerFactory;
        $this->addressFactory  = $addressFactory;
        $this->customerInterfaceFactory  = $customerInterfaceFactory;
        $this->encryptorInterface  = $encryptInterface;
    }

    public function customerUpdate {
        // Get Website ID
        $websiteId  = $this->_storeManager->getWebsite()->getWebsiteId();
        try{
            $customer = $this->customerFactory->create();
            $customer->setWebsiteId($websiteId);
            $customer->setEmail('test@gmail.com');
            $customer->setFirstname('testname');
            $customer->setLastname('lastname');
            $customer->setPassword('123456');
            $customer->setData("custom_attribute",'Test');

            $customer->save();
            $customerId = $customer->getId();
            if($customerId > 1){
                $main_customer = $this->customerFactory->create();
                $main_customer ->setWebsiteId($websiteId);
                $main_customer ->setEmail('test123@gmail.com');
                $main_customer ->setFirstname('test1');
                $main_customer ->setLastname('last1');
                $main_customer ->setPassword('456789');
                $main_customer ->setData("custom_attribute",'Test1');

                $main_customer ->save();
                $main_customeId = $main_customer->getId();
            }
        }
        catch(\Exception $e)
        {
            print_r($e->getMessage());
        }
    }
}

I am creating two customers with different data, both the customers are getting created but custom attribute for second customer is not saving.

Where i am wrong ? Please someone suggest me on this.


texts:
I want to change text Payment Method to Payment Information on checkout page.

It's need to use mixin js here?

Or i can override js here directly?


texts: How to overwrite core template files from a custom module?

texts:
I want to overwrite two files. Namely the view.phtml and print.phtml of sales orders.
(path: app/design/frontend/base/default/template/sales/order/)

I am creating a module in which I want to create a path as app/design/frontend/base/default/template/<My Module Name>/sales/order/ so that the core view.phtml and print.phtml files don't get overwritten.

So please guide me how to achieve this task.


texts: v2.3.4 Customer Import - Please enter a valid region

texts:
I'm having a real nightmare trying to import customers using "Single File" right now.

I've been using Firebear Importer for this, but I've since noticed that this is happening using the native importer too and I'm stumped.

So after much trial and error with the customer import I'm working with, I've generated the sample file and used that. This is what I'm trying to import:

note, I'm working with British Addresses here

email,_website,confirmation,disable_auto_group_change,firstname,gender,group_id,lastname,middlename,password_hash,prefix,rp_token,rp_token_created_at,store_id,suffix,taxvat,website_id,password,_address_city,_address_country_id,_address_firstname,_address_lastname,_address_middlename,_address_postcode,_address_prefix,_address_region,_address_street,_address_suffix,_address_telephone,_address_vat_id,_address_default_billing_,_address_default_shipping_
jondoe@example.com,base,,0,Jon,Male,1,Doe,,703feeb7a8a5195cf1cc9b759ba1e113:V2h36OrOJRh56MyGHw9NF1J855eL9X4P,,,,0,,,1,,Campbell,GB,Jon,Doe,,95008,,Lancashire,"Main Street 1
Suite 200",,123456789,,1,1

If I attempt to import this file, I get the error

  Please enter a valid region. in row(s): 1

However, if I switch the country to "US" and the region to "California", it will import. If I switch to US and then use something other than a state name or abbreviation, it will not import either. If I do the opposite (switch country to GB and use a state name) that won't import.

It just doesn't accept anything that's not USA and I'm really struggling.

Here's some additional notes:

This works on another magento store I tested with
My store locale is Great Britain
In configuration > State Options, "State is required For" has nothing selected now.
My store was migrated from M1
The directory_ db tables are identical between this store and another that works
On the frontend, I can create a customer using any old value in the region field.

I'm puzzled. The only instance of this error message is in /vendor/magento/module-customer-import-export/Model/Import/Address.php. In typical Magento fashion, I can find absolutely no documentation for this error anywhere. It would help to know what the specifics are because I haven't a scooby.

Thanks


texts: Ui element and knockout js array subscriber/listener

texts:
I would like to do 2 thinks with knockout js and UI component

Fill in input in a grid based on entity_id - Works great
Trigger callback when one of input has changed

The second part works partly. When I am using collectionDates as string then all of the input will get same value and when one of the input are changed then valueChanged method is called.

When collectionDates is set as an array (so that every input can have it's own value) then the callback wont trigger when any of inputs value change. Reading knockout js documentation for observable arrays I believe this should be possible. Why magento 2 UI component does not track changes of array elements?

define([
    'jquery',
    'Magento_Ui/js/grid/columns/column'
], function ($, Column) {
    'use strict';

    return Column.extend({
        defaults: {
            collectionDates: {
                19: 100,
                21: 200
            },
            listens:{
                collectionDates: 'valueChanged'
            }
        },

        initObservable: function () {
            return this._super()
                .track(['collectionDates']);
        },
        valueChanged: function (val, val2, val3) {
            debugger
        }
    });
});

Template used for input

<input
    type="text"
    data-bind="value: collectionDates[$row().entity_id]"
/>


texts: Magento 2: How to pass variable to template from another template?

texts:
I want to pass product as variable from list.phtml to another template file which i will called there using below code

echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Test_Module::Test/view/config.phtml")->toHtml();

I've found that for Magento 1 we can use below code.

echo $this->getLayout()->createBlock('module/template_name')
->setData('key', 'some value')
->setTemplate('module/newblock.phtml')->toHtml();

And we can access of this variable to that template using below syntax

echo $this->key;

I've tried same for Magento 2 using below code but no luck.

echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setData('key', 'd')->setTemplate("Test_Module::Test/view/config.phtml")->toHtml();

I can see blank page when tried to get value using below code.

echo $this->key;

Anyone have tried similar to it?


texts: Adding custom html to 2columns-left.phtml issue

texts:
I want to add a custom html to different pages using the 2columns-left.phtml.This is the my code:

   <?php
            $request = $this->getRequest();
            $module = $request->getModuleName();
            $controller = $request->getControllerName();
            $action = $request->getActionName();
            if($module == 'customer' && $controller == 'account' && $action == 'index'){
        ?>

<?php echo $this->__('My Dashboard') ?>

        <?php
            }
            if($module == 'customer' && $controller == 'account' && $action == 'edit'){
        ?>

<?php echo $this->__('My Test') ?>

        <?php
            }
        ?>

So, I want to avoid that if conditions. Is there another way to add this header html to different pages ?


texts: Solution to Magento Always Populate Data Error, php.ini file not working?

texts:
I am trying to install Magento 2.1.5 and I'm currently stuck on the readiness check. It is currently giving this error

  PHP Settings Check * Need Help? PHP Documentation Your PHP Version is
  5.6.30, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This
  will stop the installer from running. Please open your php.ini file
  and set always_populate_raw_post_data to -1. If you need more help
  please call your hosting provider.

I have renamed the php.ini file and have included the stipulated line and still have no luck. My ini file is as follows:

; Copyright © 2013-2017 Magento, Inc. All rights reserved.
; See COPYING.txt for license details.
; This file is for CGI/FastCGI installations.
; Try copying it to php5.ini, if it doesn't work

memory_limit = 1024M
max_execution_time = 18000

; disable automatic session start
; before autoload was initialized

flag session.auto_start = off
always_populate_raw_post_data = -1
; enable resulting html compression

zlib.output_compression = on

; disable user agent verification to not break multiple image upload

suhosin.session.cryptua = off

; PHP for some reason ignores this setting in system php.ini
; and disables mcrypt if this line is missing in local php.ini

extension=mcrypt.so

; Disable PHP errors, notices and warnings output in production mode to prevent exposing sensitive information.

display_errors = Off


texts: image labels arent imported using csv in magento

texts:
I have included info in the image , thumbnail, media, small image labels colummns in my import file but nothing gets updated in magento.

When i do an export only info manually added through the front end is listed in these columns.

How can i import this data?


texts: Magento 2 Adding Extension Attribute to Quote_Item

texts:
I am trying to add an extension attributes to quote_item. I have a plugin that works perfectly well when I add a simple item to quote_item, converting it from quote_item to order_item, and when I  an order_item/order.
However, when I try to add a configurable product to a cart, the plugin becomes a mess. I keep getting the You need to choose options for your item. error even though I have set my custom_option. and I am sure that they are all correct.

Any leads on this? I have searched everywhere and have not found a solution.

Here is my body of POST API call for adding a configurable product as a quote item:

{
  "cartItem": {
    "sku": "sweater_001",
    "qty": 1,
    "quote_id": "43",
    "product_type" : "configurable",
    "product_option": {
      "extension_attributes": {
        "configurable_item_options": [
          {
            "option_id": "93",
            "option_value": 4
          }
        ]
      }
    },
    "extension_attributes":{}
  }
}

and here is the configurable product options of the product i am trying to add (retrieved using ../configurable-product/{sku}/options/all API:

[
    {
        "id": 6,
        "attribute_id": "93",
        "label": "Color",
        "position": 0,
        "values": [
            {
                "value_index": 4
            },
            {
                "value_index": 6
            }
        ],
        "product_id": 15,
        "options": [
            {
                "value_index": "4",
                "label": "black",
                "product_super_attribute_id": "6",
                "default_label": "black",
                "store_label": "black",
                "use_default_value": true
            },
            {
                "value_index": "6",
                "label": "red",
                "product_super_attribute_id": "6",
                "default_label": "red",
                "store_label": "red",
                "use_default_value": true
            }
        ],
        "product_attributes": {
            "attribute_id": 93,
            "attribute_code": "color",
            "frontend_input": "select",
            "entity_type_id": "4",
            "is_required": false,
            "options": [
                {
                    "label": " ",
                    "value": ""
                },
                {
                    "label": "black",
                    "value": "4"
                },
                {
                    "label": "blue",
                    "value": "5"
                },
                {
                    "label": "red",
                    "value": "6"
                }
            ],
            "is_user_defined": true,
            "default_frontend_label": "Color",
            "frontend_labels": null,
            "backend_type": "int",
            "backend_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Backend\\DefaultBackend",
            "source_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Table",
            "default_value": "",
            "is_unique": "0",
            "validation_rules": []
        }
    }
]

Thanks!


texts: Best practice for calling JavaScript on a specific page in Magento2

texts:
I would like to initialize a jQuery carousel plugin on the product details page, the  slide carousel.

I've found two ways to do it, but am wondering if there is a better way.

First off, I added the script to the plugin to my theme's require-config.js file with:

// app/design/frontend///require-config.js
var config = {

// When load 'requirejs' always load the following files also
deps: [
    "js/main" // path to main.js script
],
paths: {
    'slick': 'js/vendor/jquery/slick.min' // path to script in my theme
},
shim: {
    'slick': {
        deps: ['jquery'],
        exports: 'jQuery.fn.slick'
    }
}

};

Then I found that I could initialise the carousel in my main.js with:

define([
        "jquery",
        "slick"
    ],
    function($) {
        "use strict";

        $('.products-related .product-items').slick();

        return;
    }
);

But this approach means the slick.min.js file is loaded on every page, and $('.products-related .product-items').slick(); is executed on every page.

I could initialize the script only on the product details page by adding the following <script> tag to app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

<script>
    require([
        "jquery",
        "slick"
    ], function ($) {
        $('.products-related .product-items').slick();
    });
</script>

But this means I need to override a template file and use an inline script, is there a better way?  Where I would load an external script just on the product details page?

It probably has little performance impact if I just add it to main.js which is easier but I'm just curious.

Thanks!


texts:
My requirement is when user comes from and external php website via url they will pass the email id in web url request. I need to catch that email and start the magento2 customer session. I searched in google and placed my code as follows.

    $data=$this->getRequest()->getParams();

    if(isset($data['email'])){

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    // Load customer By Email

    $customer = $objectManager->create('Magento\Customer\Model\Customer')->setWebsiteId(1)->loadByEmail($data['email']);
    // Create customer session
    echo $customer->getId();
    $customerSession = $objectManager->create('Magento\Customer\Model\Session');
    $customerSession->setCustomerAsLoggedIn($customer);
    if($customerSession->isLoggedIn()) {
       echo "Customer Logged in";
    }else{
       echo "customer is Not Logged in";
    }

    // $customerSession->setCustomerDataAsLoggedIn($customer);
    $customerSession->regenerateId();

    }

I placed this in header.phtml file. Why because this file must be included everywhere. So when email presented in URL i am doing autologin. But session is not creating for user. When i click on any link called as "My Account" it is asking me to login again.


texts: Add custom field in cash on delivery as Account Id Magento 2

texts:
I need to add custom field when cash on delivery is selected it should be placed right below the COD radio button.

This field have to be saved with the order.

I tried with some articles But I cant get the logic to place them on the place.

Kindly advice me on this, We have onepage checkout.

With this links I can add custom fields on the payment form but Cant achieve my requirement.

https://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html

https://ranasohel.me/2015/11/28/how-to-add-custom-field-to-shipping-address-form-in-magento-2-onepage-checkout/


texts: Magento 2: Post Code isn't being validated as 'required' on Checkout

texts:
On my theme, the customer is allowed to proceed to the payment page of the checkout without having to add a Postcode, despite it being set as required. The other fields (Street, City) are required and validate correctly when they're left empty (the user is prevented from proceeding to the next step).

Any ideas why this is the case?


texts: Configurable product attribute dropdown to gridview?

texts:
I want to create product view like attached image . any one help me to create this type of products , which product type i use or any extension already have then please suggest.

example :

Color           Size

white           small medium large

red             small large


texts: "Php require section in composer is empty" - can't upload a package to the Marketplace

texts:
I have a problem with uploading new extension version to the Magento Marketplace. The error message is Php require section in composer is empty
My composer.json file hasn't been changed (since previous approved versions on Marketplace) and it contains only one dependency:

"require": {
  "magento/module-catalog": "~101.0.*"
}

I tried to add php dependency (tried different versions), but that doesn't help, error message remains the same.

Can't figure out what is wrong here? Have anyone experienced this issue on Marketplace?


texts: Magento 2 PWA Venia - How can I install blog module

texts: I have setup Magento PWA Venia theme, now I want to install Mageplaza Blog module which is pwa ready. I have installed it using composer require mageplaza/magento-2-blog-extension mageplaza/module-blog-graphql command. It showing in backend but not working in frontend. Cannot visit blog page, it returns 404 page not found. How can I install the module?


texts: Magento 2 Migration From custom tables (non-magento) to magento 2

texts:
I am trying to use the Magento 2 Data Migration tool in order to make the tool believe that my woocommerce database is actually M1 database.

I do this by creating views.
I commented out all steps so that only customers migrated.

However I get the error :

  [2017-05-15 18:58:25][INFO][mode: data][stage: setup triggers][step:
  Stage]: started 78% [======================>-----] Remaining Time: 1
  sec

  [Zend_Db_Statement_Exception] SQLSTATE[HY000]: General error: 1347
  'woo.customer_entity' is not BASE TABLE, query was: CREATE TRIGGER
  trg_customer_entity_after_insert AFTER INSERT ON customer_ent   ity
  FOR EACH ROW   BEGIN   INSERT INTO m2_cl_customer_entity (entity_id,
  operation) VALUES (NEW.entity_id, 'INSERT')ON DUPLICATE KEY UPDATE
  operation = 'INSERT';   END

  [PDOException]   SQLSTATE[HY000]: General error: 1347
  'woo.customer_entity' is not BASE TABLE

I have been told that tool is really customizable and can be used for any db to m2 migration.

What am I missing out on the above. Should I just create a table ?


texts: $this keyword is not available in template of core/template block

texts:
I want to execute some custom PHP code in a static CMS block. I want to do this by having a block of type core/template loading a template containing the PHP code. I have created the block and can do a "Hello, world" echo, however I can't access $this.

The code I use in the static CMS block to include the template with the PHP code is: {{block type="core/template" template="module/template.phtml"}}. core/template has been whitelisted.

Anyone has a clue why I can't use $this?
Thanks in advance.

EDIT: This is the template content.

<?php
  $_product = Mage::registry('current_product')->getName();
  $this->helper('yotpo')->showWidget($this, $_product);
?>

EDIT: I ended up fixing this by declaring the block in my themes' local.xml, instead of using a static CMS block.


texts: Upgrade Magento 2.2.0 to 2.2.5 giving problems

texts:
Please advise. Thanks

After doing this:

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.5 --no-update
composer update
authenticate correctly for repo.magento.com

I get this error:

  [u9945p7191@web0102 public_html]$ Invalid credentials for 'https://repo.magento.com/packages.json', aborting.
  [u9945p7191@web0102 public_html]$ https://repo.magento.com could not be fully loaded, package information was loaded from the local cache and may be out of date
  -bash: https://repo.magento.com: No such file or directory
  [u9945p7191@web0102 public_html]$ Updating dependencies (including require-dev)
  -bash: syntax error near unexpected token `('
  [u9945p7191@web0102 public_html]$ Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package magento/product-community-edition 2.2.5 exists as magento/product-community-edition[2.2.0, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0, 2.0.8, 2.0.9, 2.1.1, 2.0.10, 2.1.2] but these are rejected by your constraint.


texts: Multiple dependency system config in magento 2

texts:
Example:

field_1 values 1,2,3
field_2 values a,b,c

field_2 depends on field_1 value 2

Now I want to make dependency on field_3

field_3 shows only when  if field_1 value is 2 or 3 or if field_2 value is b or c

i am trying this code

<depends>
        <field id="field_1" separator="|">2|3</field>
        <field id="field_2" separator="|">b|c</field>
</depends>

but this condition is goes wrong if field_1 is 3

Any suggestion?


texts: How can I remove Signature Confirmation Service from Magento?

texts:
I am having a bad problem with Magento and USPS. I called USPS and asked them to remove the Signature Confirmation service because we don't our customers having to sign for their packages (we got many complaints).

However, when USPS did this on their end I couldn't generate labels anymore and I kept getting an error message: API Authorization Failure. User is not authorized to use API SignatureConfirmationV3.

I called USPS again and they told me that it is a problem with Magento. So my question is this: how can I remove this feature from Magento so that it stops printing shipping labels with the Signature Confirmation?


texts: Remove payment option when a specific shipping method is selected

texts:
How can I remove a specific payment option when a specific shipping method is checked?

Below is a screenshot explanation:


texts:
I have enabled HTTPS on both backend and frontend.
Problem is on the back-end the https works fine (green lock) but on the front end i have https BUT i have a grey lock icon which is described as " not fully secure".

How can the https fully work on back-end and partially work on front-end ?
And how can i resolve this ?

Thank you very much.


texts: What is the best image fromat and size for products in magento

texts:
I am new on Magento and as per my requirements, I have to import the products data along with images using CSV files and my all of products images are placed in a remote location, let say http://www.xxxxxxx.com/magentoimages/.

I have below question here.

Which image format(JPEG,PNG,GIF etc.) should use for better performance in remote location.
What should be the max image file size for each and every image for better performance.
What should be the max height and width of image for better performance.

I have gone through the below link and he suggest the below ideal Size & resolution for magento product images.

File Format: JPEG
Max. Width: 1600 pixels
Max. Height: 1200 pixels
Max. File Size: 200 kb

I am not sure on this so please help me or guide me as I have to provide the above information to my Client as soon as possible.


texts: How can I show all products in a top level category sorting by the child categories?

texts:
I have this category structure below:

When I access Men page all products of child categories are there, but they are showing in a random mode, i believe. I want to show the products in the main category (Men) sorted by child categories order.

Product Collection function:

public function getProductCollection()
    {
        $current_category = $this->_registry->registry('current_category');//get current category
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $collection->addCategoryFilter($current_category);
        $collection->setPageSize(999);
        $collection->addAttributeToSelect('*');
        return $collection;
    }


texts: All products are sold out while Stock Status index is processing

texts:
Is this behaviour normal?

All the products are appearing as beeing sold out, and when I checked in Index Managemenet Stock Status shows as 'processing'.
This didn't happened before.


texts: How to get Product review summery in a custom template file in Magento2?

texts:
I want to show star ratings in a custom phtml file. The product object is available inside that phtml file. How can I achieve the rating star summery there?

Any suggestions please.