texts:
I have updated with magento version 1.7 to 1.9. I get an error when click on edit category tab "Associated blog post" or "Associated blog category". i get the following error. My store is connected with wordpress.

  SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command
  denied to user 'alisonan_wp'@'localhost' for table
  'wordpress_association', query was: SELECT DISTINCT COUNT(*) FROM
  wp_posts AS main_table LEFT JOIN
  alisonan_magento_dev.wordpress_association AS assoc ON
  assoc.wordpress_object_id = main_table.ID AND
  assoc.object_id = 401 AND assoc.type_id = 3 AND
  assoc.store_id IN ('1', 0) WHERE (main_table.post_type='post')
  AND (main_table.post_status ='publish') AND (main_table.ID IN(0))


texts: Magento2 How to set expiration time for token

texts:
I Have generated a token for API calls by using following code :

curl -X POST "http://magento2.ce/rest/V1/integration/customer/token"\
-H "Content-Type:application/json"\
-d '{"username":"john@change.me", "password":"abc123"}'

-How to set expiry time for this token?
-Can we generate token by using username? with out password.


texts: Magento 1.9 remove time from order confirmation

texts:
In my order confirmation, I have this code

echo Mage::helper('core')->formatDate($_order->getData('created_at'),Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);

and the output is
Order date: 16/03/2017 12.27.21

How do I remove the time from this output? So the correct output I want is
 Order date: 16/03/2017


texts: Mangento 2 search result page sidbar missing

texts:
It seems like am missing the sidebar in my search result page, for more deatil refer to the image below. How do I add the same sidebar that, I have on the category page?

I have tried adding widgets but that didn't work for me.

I have tried this:

Edit the search results page?

https://www.magestore.com/magento-2-tutorial/magento-2-how-to-configure-catalog-search/


texts: Adding fixed additional weight to my order final weight

texts: I can not figure out how to have every order add 1 lb before shipping calculation i.e. if my total order weight is 2lb I would like to add one more lb to it before shipping calculation so that shipping charge is calculated of 3lb.


texts: How to show Product Attributes in Magento 1.9 Frontend?

texts: How to show Product Attributes in Magento 1.9 Front-end?


texts: How display product Image in best quality

texts:
The small images I upload to my site seem to have a quality problem in the catalog. I attached images, In the image Its little bit hard to see but there is a big different in the images. I need the image in the site to look the same like the image I upload.

One thing strange that in my local test site (in mamp pro and with the same code) the images in the site are in very good quality, the same like the images I upload. why there is a different from my mamp local site to my site in the server?

this is the code I call the images from the template:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->setQuality(100); ?>" />


texts: Adding multiple configurable product variations adding first one multiple times

texts:
I'm trying to add multiple variations of a configurable product to the cart at once, and I've put the code together, but currently it's adding the right qty of products, but only using the first variation.

In other words, if I try to add 2 Green T-Shirts and 4 White T-Shirts, it's adding 6 Green T-Shirts.

This is the code I've got:

public function indexAction ()   {
   $post = $this->getRequest()->getPost();
   $attr = array_keys($post['super_attribute']);
   $cart = Mage::getSingleton('checkout/cart');
    $product = Mage::getModel('catalog/product')->load($post['product']);
    foreach ($post['super_attribute'][$attr[0]] as $optId){

        if (abs($post['qty'][$optId]) > 0){

            $options = array(
                //"product"=>$post['product'],
                "super_attribute"=>array(
                    $attr[0] => $optId
                ),
                "qty"=>$post['qty'][$optId]
            );

            echo "Add To Cart:";
            print_r($options);
            echo "

";
            $cart->addProduct($product, $options);
        }

    }

    $cart->save(); // save the cart
    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

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

And from that print_r, it's confirming that the options are correct:

 Add To Cart:Array ( [super_attribute] => Array ( [141] => 5 ) [qty] => 2 )

 Add To Cart:Array ( [super_attribute] => Array ( [141] => 4 ) [qty] => 4 )

But in the cart I'm seeing 6 of the first super_attribute.

Is there something I need to do to 'reset' the cart after adding each item or something?

Thanks!


texts: Can i know which admin user made the changes for order status in admin backend

texts: So basically we have multiple users to manage the admin backend and I wonder if we can  know which user did the changes for the order like for example order status. Is this possible?


texts: Ajax Refresh Images Composition with Attribute Selection

texts:
I've been tasked with trying to duplicate this feature of a Shopify cart on Magento:

https://savageswim.com/collections/builder/products/custom-leggings

My manager is looking for a system that let's us apply images or skins and update only that selection when the attribute is chosen on the website.

I understand that I can do this with regular images and create an image for every possible attribute combination - but for us that is 100s of images. Hoping for a cleaner solution via extension or some other kind of programming.


texts: how to reduce the size of core_url_rewrite: Magento 1.9

texts:
I have a lot of entries in the table core_url_rewrite, how can I reduce ? I'm using magento 1.9.x
Actually the table has ~3,680,554 records and 2.5 GB of size. I put in the pas about 100 redirect (manually), I cant clear it, just to delete the unnecessary records.

regards


texts: add new column with custom attribute in sales > order grid in Magento ver. 1.9.3.3

texts:
Magento ver. 1.9.3.3

I am trying  to add columns with **custom product attribute **(like publisher which was created by me) in Admin > sales >order.

Copied

app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

to

app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

& create Renderer at

app/code/local/Mage/Adminhtml/Block/Sales/Order/Renderer/Productspublisher.php

code in Productspublisher.php

    <?php
class Mage_Adminhtml_Block_Sales_Order_Renderer_Productspublisher extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
       $_item = $this->getItem());
       $product=Mage::getModel('catalog/product')->load($_item->getProductId());
       $str="";
       foreach($product as $item)
       {
         $str .= $item->getAttributeText('publisher');
       }

        unset($product);
        return $str;
    }
}
?>

code in protected function _prepareColumns() of Grid.php

$this->addColumn('publisher', array(
        'header' => Mage::helper('sales')->__('Publisher'),
        'index' => 'publisher',
        'renderer' => 'Mage_Adminhtml_Block_Sales_Order_Renderer_Productspublisher',
    ));

but getting error

  Parse error: syntax error, unexpected ')' in
  sitedomain.com\app\code\local\Mage\Adminhtml\Block\Sales\Order\Renderer\Productspublisher.php
  on line 6


texts: Magento 2 Increase guest session time and keep the items in cart for 20 days

texts:
I want t increase guest user session time in magento. If guest user add to cart and just go for lunch or any other activity putting his/her website open in browser, when user come after 5-6 hours check website after 6-7 days they see their item added to cart in website.

How can we do that?  How can i make persistent guest session so whenever guest customer come to site they see their added product in cart?

Right now if customer come after 4-5 hours cart gets empty.

Any help would be appreciated


texts: What is Exact Use of backend_model and source_model node in System.xml in Magento

texts:
I am new to Magento.

I found many time <source_model> and <backend_model> node in system.xml file.

I know for many different purpose we can define our own code in Model file. But anyone can please describe nice and brief solution for use of both of this node and its purpose.


texts: Magento 2 how to get session value in custom form

texts: Magento 2 how to get session value in the custom form that is customer name and order id in custom form.


texts:
When adding to cart, I only sometimes get the stylish Ajax "Your item was added to cart"-popup. Other times I get the ugly standard magento added to cart orange and grey buttons. When I get the default behaviour, I can't see the items in cart before refreshing the page, so I suspect it's some kind of ajax error. I have captured both Ajax requests and they are quite different. Can someone figure out the error?

Works:

$.get('http://www.propagandashop.dk/proaddto/index/add/uenc/aHR0cDovL3d3dy5wcm9wYWdhbmRhc2hvcC5kay8,/product/754/form_key/vRnRi3VEvUkNw6xa/isAjax/1')
  .done (showResult)
  .fail(showError);

  {
  "frameId": 0,
  "method": "GET",
  "parentFrameId": -1,
  "requestId": "13544",
  "tabId": 57,
  "timeStamp": 1440573329737.51,
  "type": "xmlhttprequest",
  "url": "http://www.propagandashop.dk/proaddto/index/add/uenc/aHR0cDovL3d3dy5wcm9wYWdhbmRhc2hvcC5kay8,/product/754/form_key/vRnRi3VEvUkNw6xa/isAjax/1"
}

Doesnt work:

First get:

var queryData = {
  "block[]": "options",
  "awacp": "1",
  "no_cache": "1"
};
$.get('http://www.propagandashop.dk/checkout/cart/add/uenc/aHR0cDovL3d3dy5wcm9wYWdhbmRhc2hvcC5kay9rb2trZW4,/product/235/form_key/vRnRi3VEvUkNw6xa/', queryData)
  .done (showResult)
  .fail(showError);

  {
  "frameId": 0,
  "method": "GET",
  "parentFrameId": -1,
  "requestId": "13875",
  "tabId": 57,
  "timeStamp": 1440573421999.0598,
  "type": "xmlhttprequest",
  "url": "http://www.propagandashop.dk/checkout/cart/add/uenc/aHR0cDovL3d3dy5wcm9wYWdhbmRhc2hvcC5kay9rb2trZW4,/product/235/form_key/vRnRi3VEvUkNw6xa/?block%5B%5D=options&awacp=1&no_cache=1"
}

Second get (same time):

var queryData = {
  "actionData": "{\"added_product\":\"235\"}",
  "block[]": [
    "cart",
    "sidebar",
    "topLinks",
    "skipLinks",
    "wishlist",
    "miniWishlist",
    "addProductConfirmation",
    "removeProductConfirmation"
  ],
  "awacp": "1",
  "no_cache": "1"
};
$.get('http://www.propagandashop.dk/kokken', queryData)
  .done (showResult)
  .fail(showError);

  {
  "frameId": 0,
  "method": "GET",
  "parentFrameId": -1,
  "requestId": "13876",
  "tabId": 57,
  "timeStamp": 1440573422599.8179,
  "type": "xmlhttprequest",
  "url": "http://www.propagandashop.dk/kokken?actionData=%7B%22added_product%22%3A%22235%22%7D&block%5B%5D=cart&block%5B%5D=sidebar&block%5B%5D=topLinks&block%5B%5D=skipLinks&block%5B%5D=wishlist&block%5B%5D=miniWishlist&block%5B%5D=addProductConfirmation&block%5B%5D=removeProductConfirmation&awacp=1&no_cache=1"
}


texts:
My Magento2 ecommerce website (bizzyizzysboutique.com) is returning a 401 response from PayPal on every page, including the home page (likely from the Minicart sidebar that is included on every page)

https://www.paypal.com/v1/oauth2/token

Response
{"error":"invalid_client","error_description":"Client Authentication failed"}

Is this error anything to be concerned with and/or is it expected? The PayPal integration seems to be working properly for the most part (aside from an intermittent issue that a few customers have run into but I am going to post separately about that as I don't think it is related to this error).


texts:
I'm using Magento 1.9.

In Magento System Configuration, I have set Merge JavaScript Files to Yes so that all JS will be merged into one file.

Is it fine if I defer the merged JavaScript files? If so, how? Are there any consequences if I do that?

I'm trying to defer the merged JavaScript files in hope of speeding up the page loading speed (as it was suggested by GTmetrix and PageSpeed Insight).

Also, is there any way I can minify the merged JavaScript file?


texts: Magento 2 Can't we use same name for ui_component file in different module

texts:
I wanted to know, can we use same name for ui_component file.

Ex. In \vendor\magento\module-catalog\view\adminhtml\ui_component  product_listing.xml is use to create product grid so can I use product_listing.xml in my custom module.

Ex. app\code\<namespace>\<module>\view\adminhtml\ui_component\product_listing.xml

I tried with above case but core one is loaded in place of my custom one.

How can I load my custom one?


texts:
Why the get method ajax call content like..

  /customer/section/load/?sections=messages&update_section_id=true&_=1540902816229

Thank You.


texts:
Magento 2 delete Meta Name Meta Title Meta Description ALL products
Please can someone let me know if its possible to delete the Meta Values for all products in my store
These were added during import and we want to remove them as we want to use extension to auto generate these values.
Is there anything that can be done via MYSQL to quickly remove all the entries for them.
I dont want to export all products and then update with blank it will take forever as there are 30000 + products


texts: When i click in manage category nothing is shown and this error comes to console. I am new here, someone could help me?


texts: Should I always inherit from Mage_Core_Helper_Abstract?

texts:
I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

EDIT: I saw examples in Magento code of helpers that inherit from helper abstract without using its functions (http://freegento.com/doc/d3/d82/_helper_2_string_8php-source.html). So unless someone gives me a good reason why I shouldn't do it, I think I'll go with "always inherit from helper abstract".


texts: How to hide "add to cart" button but show configurable options - Magento 2

texts:
I need to hide the add to cart button so currently, I have a plugin aroundIsSalable which sets the return to false if you are logged out.

The issue with this is that it also hides the options for a configurable product. How can I get it set saleable to false but also show the configurable options


texts: Apply Promotion to Specific Configurable Product

texts: I would like to know how to apply $10 discount coupon code for combination one configurable product and simple product. Coupon code needs to be applied for combination of any associated product of the base product and the another simple product. If I dont include the configurable product for the rule, coupon code is working.


texts:
I am working at adminside. I have added my element inside script tag as shown below:

  <script class="dialog-template" type="text/x-magento-template"
   data-title="Image Options">
          <! ..... Magento Default Code  ..... !>
        <div class="inline-labels" id="coords" class="container">
           <label>Test<input type="text" size="4" id="test"
                                   name="test_[<%- data.file_id %>]"
                                   value="" />
            </label>
        </div>
            <! ..... Magento Default Code  ..... !>
  </script>

I am not able to get access on test element. Its give undefine error while accessing it using jquery like

require([
          'jquery'
         ], function ($) {
          $(function () {
              alert($('#test').val());
          });
      });


texts: Product Collection Factory not returning products that are Not Visible Individually

texts:
Using the below code or equivelant I want to get all products regardless of visiblity or status etc. This however does not seem to return products that are "Not Visible Individually".

$category = $this->categoryFactory->create()->load($catid);
$collection = $this->_productCollectionFactory->create();
$collection->addAttributeToSelect('sku');
$collection->addCategoryFilter($category);

How can this be achieved?


texts: Magento2 display all coupon codes in custom module phtml

texts: I have to display list of all coupon codes in a phtml of custom module. Anyone can explain me the process of displaying all coupon list. I have created a custom module which is displaying hello word at frontend using module creater. what will be next step to do ?


texts: Magento2 - How to get JSON response from Controller

texts:
I've created my custom controller and I want to return the result formated with JSON. I always get a JSON parse error "JSON.parse: unexpected character at line 1 column 1 of the JSON data" and the result is always in the following format:

  array(0) { } {"Test-Message":""}

I've tried following variations of code, but nothing solved the problem

public function execute()
{
    $message = "";

    $userName = $this->_request->getParam('user_name');

    try
    {
        //Check user name
        $result = $helper->checkUserName($userName);
        if ($result)
        {
            $message = "Test";
        }
    }
    catch(\Exception $e)
    {
        $message = $e;
    }

    //$this->getResponse()->setBody($message);

/*
    $arr = array('result' => $message);
    $jsonData = json_encode(array($arr));
    $this->getResponse()->setHeader('Content-type', 'application/json');
    $this->getResponse()->setBody($jsonData);
*/

/*
   $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);
   $this->getResponse()->clearBody();
    echo $this->getResponse()->getBody();
*/

/*
    $arr = array('result' => $message);
    $jsonData = json_encode(array($arr));

    $this->getResponse()->clearHeaders();
    $this->getResponse()->representJson($jsonData);
*/

/*
    $result = $this->resultJsonFactory->create();
    return $result->setData(['message' => $message]);
*/

   /** @var \Magento\Framework\Controller\Result\Json $result */
    $result = $this->resultJsonFactory->create();

    /** You may introduce your own constants for this custom REST API */
    $result->setData(['Test-Message' => $message]);
    return $result;

 }


texts:
Each time I install new extension, and open the admin - system - configuration - module options I get 404 error.

Logging out and in helps, but  how to avoid this? The issue has something to do with the admin permissions cache, but how to refresh it programmatically, say, from the install script?

Any ideas?


texts:
I am trying to add a block inside a block in footer links. I am trying the following code.

<referenceBlock name="footer_links">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="Delivery">
        <arguments>
            <argument name="label" xsi:type="string">Delivery</argument>
            <argument name="path" xsi:type="string">living.html</argument>
        </arguments>

                <block class="Magento\Framework\View\Element\Html\Link\Current" name="jamaal">
        <arguments>
            <argument name="label" xsi:type="string">Jamaal</argument>
            <argument name="path" xsi:type="string">living.html</argument>
        </arguments>
    </block>

    </block>
</referenceBlock>


texts: Overwrite a already overwritten template(.phtml) file

texts:
The product listing page is already overwritten by a module from local codepool provided by theme. [Module name : shopby]

Inside the active theme in design area, layout > shopby.xml i can see this

<reference name="product_list">
     <action method="setTemplate">
         <template>sm/shopby/catalog/product/list.phtml</template>
     </action>
</reference>

I want to take this file list.phtml and make few modifications leaving this file untouched and want to overwrite by another custom module(just to overwrite this file/other technique). Because with this the added modifications will only be applied on active of this module.

Is it possible to overwrite this product listing page as it's already being overwritten ?


texts:
I'm having some troubles with product images in Magento.

I'm using Porto theme, in homepage I have a 4-featured-items grid (2x2). I want images to be 610x360px but I'm not able to do this. Instead I have images with white space.

Strange is, if I open the inspector and find the img url, open it in browser and I see that images have white border (added by Magento?). Can't figure it out.

I'm new in Magento, it is pretty urgent.

You can see the issue here: mobiroloshop.com (got same problem with all images in website)


texts: Magento 2 Custom Customer Attribute Save Data and edit data, i have problem

texts: I create a customer module this module working good , when I migrate data  mangento 1.x to magento 2.x wiht migration tool and i wish crete a new customer don’t save data or edit any customer don’t show data


texts:
We saved some values in backend, we are displaying those values in frontend using code written in phtml file.

Now we shifted code to block file, but now those dropdown  options are displaying in different positions as here

1) Is i am displaying code in wrong place ?

2) Is i need to call those block in phtml ?

class Company_Brand_Block_Frontend_Detail extends Mage_Core_Block_Template {

    protected $_faq;
    protected $_images;

    protected function _prepareLayout()
    {
          $brand = $this->getBrand();

        if ($brand !== false && $head = $this->getLayout()->getBlock('head')) {
            $head->setTitle($this->htmlEscape($brand->getBmodel()) . ' - ' . $head->getTitle());
        }
    }

    /**
     * Function to gather the current Brand item
     *
     * @return Company_Brand_Model_Brand The current brand item
     */
    public function getBrand() {
        if (!$this->_brand) {
            $id = intval($this->getRequest()->getParam('brand'));
            try {
                $this->_faq = Mage :: getModel('brand/brand')->load($id);

                if ($this->_faq->getIsActive() != 1){
                    Mage::throwException('Brand Item is not active');
                }
            }
            catch (Exception $e) {
                $this->_brand = false;
            }
        }

        return $this->_brand;
    }
}

$resource = Mage::getSingleton('core/resource');

$readConnection = $resource->getConnection('core_read');

$writeConnection = $resource->getConnection('core_write');

$readConnection = $resource->getConnection('core_read');

$query = 'SELECT category_id, category_name FROM ' . $resource->getTableName('Company_advance_brand_category');

$categories = $readConnection->fetchAll($query);

$brandsArr = array();

$brandSelect = '<select id="brand_select">';
$brandSelect .= '<option value="">My Brand</option>';
foreach ($categories as $category){
$cat_id = $category["category_id"];

$brandSelect .= "<option value='".$category["category_id"]."'>".$category["category_name"]."</option>";

$query = 'SELECT `Company_advance_brand`.brand_id, `Company_advance_brand`.bmodel FROM `Company_advance_brand` ';
$query .= ' inner join `Company_advance_brand_category_item` on
(`Company_advance_brand`.brand_id = `Company_advance_brand_category_item`.brand_id )';
$query .= ' where `Company_advance_brand_category_item`.category_id = '.$cat_id;

$brands = $readConnection->fetchAll($query);

$bArr = array();

foreach ($brands as $brand){
$bArr[$brand["brand_id"]] = $brand["bmodel"];
}
$brandsArr[$cat_id] = $bArr;
}
$brandSelect .= '</select>';

echo $brandSelect;
echo '<select id="model_select"><option value="">My Model</option></select>';


texts: Magento 2.3.3 Install sample data error on setup upgrade

texts:
I got the following error on setup:upgrade after installing sample data in Magento 2.3.3

Error is thrown on Module Magento_CatalogSampleData

PHP Fatal error:  Uncaught Exception: User Error: Some transactions have not been committed or rolled back in /var/www/html/mage233/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3985 in /var/www/html/mage233/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(256, 'Some transactio...', '/var/www/html/m...', 3985, Array)
#1 /var/www/html/mage233/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(3985): trigger_error('Some transactio...', 256)
#2 [internal function]: Magento\Framework\DB\Adapter\Pdo\Mysql->__destruct()
#3 {main}
  thrown in /var/www/html/mage233/vendor/magento/framework/App/ErrorHandler.php on line 61

I also tried with reset and re-install sample data but no success.

php bin/magento sampledata:reset

Any help would be appreciated.


texts: Added 1 store view - now new orders have the wrong ordernumber

texts:
after adding 1 storeview to the default, Magento chooses the new ordernumber for this storeview for each and every new order instead of using the default numbers.

Does anybody know where I can trigger this?
I thought, the default store view would be used by Magento as default for the ordernumbers, but it seems, he likes the new storeview more. That's puzzling.

Any hint or shed of light here would be greatly apprechiated!

Cheers,
Johannes


texts: is there way to run magento 2 without mcrypt

texts:
I have a server they don't allow to install mcrypt also.
my magento 2 version not running without it.
is there way to fix this.or up and running without mcrypt


texts: What is the best way to migration from shopify to magento2.3.5

texts:
I want to migrate one Shopify website to Magento 2.3.5 I need some suggestions, What will be the best way to migrate in less time with perfect efficiency.

In my Shopify website, there are 50000 products, 5000 customers, 10000 orders, etc..

I want the same product and category URLs after migration.

After migration in Magento 2.3.5 I want below things please suggest for that as well.

use elastic search
configure varnish cache

Thanks in advance!


texts: Customer eav_attribute only for a specific Country

texts:
I successfully added a custom attribute for the customer's billing and shipping addresses.

This field is mandatory only for a specific country.
How can i set Magento CE v1.9 so that this field gets asked only if the user selects that specific country?


texts: Magento 2: Product Tab Enabled only get collection using layout xml

texts:
Below my code for xml. I create product tab like below code for product-details page.
Vendor\Module\view\frontend\layout\catalog_product_view.xml

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="product.info.details">
                <block class="Vendor\Module\Block\Test" name="test.product" as="deliveryinfo" template="Vendor_Module::product/producttest.phtml" group="detailed_info" ifconfig="vendor_module/general/product_test">
                    <arguments>
                        <argument translate="true" name="title" xsi:type="string">Product Test</argument>
                    </arguments>
                </block>
            </referenceBlock>
        </body>
    </page>

Below Screenshot is product-page.

Now i try, if collection get Product Test Tab is Enabled and collection get is zero(empty) Product Test Tab is disabled.
How it posible using layout xml code?


texts: SOAP v2 catalogProductListOfAdditionalAttributes Uncaught SoapFault exception: Access Denied

texts:
Under API Roles, I have set all the permissions related to category and product data, and the ability to list such data via SOAP API.

When I set the role to All, the API call works, but that also gives the API user full access rights. This needs to be read only.

Which permission to I need to set in order for this API call to work? I have enabled all of the ones that aren't update, delete, etc.


texts: Most efficient way to product top most level category

texts:
If i have a product model instance, what is the most efficient way to get the highest level category i..e closest to root for that product?

If the product is in the following categories i want the id for categoryA

CategoryA
    CategoryC
    CategoryD
        CategoryB
            CategoryE
    CategoryF
        CategoryG


texts: Products should be removed after logout in Magento 2.2.0

texts: How can I remove the items from the cart after logout. The stuffs are still in the cart, I want them to be removed after logout or closing browser. How should I do that?


texts: Magento2 : URL key for specified store already exists while updating the existing product

texts:
I am using the magento version 2.0.9 version for my site.

I am getting this Url key for specified store is already exist while updating the product or assigning the product for custom option and click on Save button.

I have deleted all entries in URL rewrite table in the database also. But I am still getting this error while updating any product.

Any idea for this error?


texts:
I'm a front-end developer and have been given a Magento website (version 1.9.3.2 CE) to work on.

I'm relatively new to Magento and have spent the day researching but I can't seem to find the answer to my question.

Is it possible to compile sass files on the server? Or do I need a local version of the website in order to compile the files with Compass? I've got SFTP/ssh access and there's currently no version control set up so I'd need to set the website up from scratch on Git.

In this case, is it best just to create a static css file to overwrite the current styles?

Thanks so much in advance!


texts:
Can anyone help me with this error

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

please help

Thanks.


texts:
I am facing issue for order data(prices) not showing correct in reports grid Reports > Sales > Orders for particular store. all other stores having correct data.

I have selected specific store, data range and click on Show Report button. Order reports grid is showing correct order count but all records having 0 prices.

It is showing correct prices in order grid Sales > Order.

I am having multi website + multi store website.
My all stores are showing correct data(all prices) but all prices for one store is showing price 0 always.

I have checked that order table sales_flat_order is having correct data, but order reports table sales_order_aggregated_created and sales_order_aggregated_updated are having price 0.

Table: sales_flat_order:

Table: sales_order_aggregated_created:

So, as per database, Order is having correct data but reports tables don't have correct data.

I have refreshed lifttime statics every time. it generates new entries but having wrong value for one store.

I have checked Mage_Sales_Model_Resource_Report_Order_Createdat::_aggregateByField method and logged queries, after that I have run that queries to database. It is shoving 0 price for all.

That means There is something wrong when data fetch from order table and add it to reports table.

Can anyone guide me how can I debug it?


texts: Collection in Event Observer: Using parentId from simple product to remove configurable product

texts:
I have a category where I want to display only those configurable products, which have simple products with some specific sizes. If the configurable product does not have a simple product with the required size, it should not show up. I use the catalog_product_collection_load_after event in order to avoid problems with the pagination and layered navigation.

The observer is working and I am able to get the option values of the attached simple products, but I am unable to remove the parent configurable products dynamically if it has no simple product with the required size - it is working if I hardcode the parentId though. This is my function:

public function getPlusSizeProducts(Varien_Event_Observer $observer)
{
    $collection = $observer->getEvent()->getCollection();
    $plusSizes = array('59', '128'); // Show configurable products which have simple products with these sizes/option ids
    $availableSizes = array();
    $parentIds = array();

    if ($collection instanceof Mage_Catalog_Model_Resource_Product_Type_Configurable_Product_Collection)
    {
        foreach($collection->getItems() as $item)
        {
            $availableSizes[] = $item->getProductSize();    // Get option ids from product
            if (count(array_intersect($plusSizes, $availableSizes)) == 0 )
            {
                $parentIds[] = $item->getParentId();
                $collection->removeItemByKey($item->getParentId()) // does nothing
            }
        }
    }
    $collection->removeItemByKey($parentIds[0]) // does nothing, array is empty
}

How can I remove the configurable products using parentId?

Ideally I'd also like to use the catalog_product_collection_load_before event to apply some filters on the collection upfront, but I always get a 500 internal server error when trying to load the collection with ->load();

I appreciate anything which points me into the right direction =)

EDIT:
Based on Marius answer I modified my code, but I still can't get it to work. I am unable to get the parent ids into one single array outside the loop (even though it is defined there) - which is what I need based on my understanding. Instead the function creates a $parentIds array for every product in the collection.


texts: How to add column in catalog_product_flat table in magento?

texts:
I have tried this code for sales_flat_quote_item table?

<?php
$installer = $this;
$installer->startSetup();
$installer->getConnection()
        ->addColumn(
            $installer->getTable('sales/quote_item'), 'customized_product_solitaire', 'int(1) NOT NULL');
$installer->getConnection()
          ->addColumn(
            $installer->getTable('sales/order_item'), 'customized_product_solitaire', 'int(1) NOT NULL');


texts:
I added two button in order view it's working fine but i want to send email to that change state

My Abstract file

 <?php

class Ar_Orderstatus_Model_Observer
{

    public function addOrderstatusAction($observer)
    {
        $block = $observer->getEvent()->getBlock();
        if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
            $order = $this->_initOrder();
            if (!$order->isCanceled() && $order->canShip()) {
                $message = Mage::helper('sales')->__('Are you sure you want to Change Status?');

                $block->addButton('rto',
                    array( 'label' => Mage::helper('sales')->__('RTO'),
                        'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('orderstatus/adminhtml_index/rto')}')", 'class' => 'go' ));

               $block->addButton('in_shipment',
                array( 'label' => Mage::helper('sales')->__('In Shipement'),
                'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('orderstatus/adminhtml_index/in_shipment')}')", 'class' => 'go' ));
            }
        }
    }

    protected function _initOrder()
    {
        $id = Mage::app()->getRequest()->getParam('order_id');
        $order = Mage::getModel('sales/order')->load($id);
        return $order;
    }
}

Controller file

<?php
class Ar_Orderstatus_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
    protected function _initOrder()
    {
        $id = $this->getRequest()->getParam('order_id');
        $order = Mage::getModel('sales/order')->load($id);

        if (!$order->getId()) {
            $this->_getSession()->addError($this->__('This order no longer exists.'));
            $this->_redirect('*/*/');
            $this->setFlag('', self::FLAG_NO_DISPATCH, true);
            return false;
        }
        Mage::register('sales_order', $order);
        Mage::register('current_order', $order);
        return $order;
    }

    public function rtoAction()
    {
        if ($order = $this->_initOrder()) {
            try {
                $order->setState('rto', true)
                    ->save();
                $order->sendOrderUpdateEmail(true, 'test');
                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );
            }
            catch (Mage_Core_Exception $e) {
                $this->_getSession()->addError($e->getMessage());
            }
            catch (Exception $e) {
                $this->_getSession()->addError($this->__('The order state has not been changed.'));
                Mage::logException($e);
            }
            $this->_redirect('adminhtml/sales_order/view', array('order_id' => $order->getId()));
        }

    }

    public function shipmentAction()
    {
        if ($order = $this->_initOrder()) {
            try {
                $order->setState('shipment', true)
                    ->save();
                $order->sendOrderUpdateEmail(true, 'test');
                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );
            }
            catch (Mage_Core_Exception $e) {
                $this->_getSession()->addError($e->getMessage());
            }
            catch (Exception $e) {
                $this->_getSession()->addError($this->__('The order state has not been changed.'));
                Mage::logException($e);
            }
            $this->_redirect('adminhtml/sales_order/view', array('order_id' => $order->getId()));
        }

    }
}


texts: Receiving error when running the data migration tool: SQLSTATE[28000] [1045] Access denied for user 'USERNAME'@'localhost' (using password: YES)

texts:
Receiving this error when trying to run the data migration tool:

[Zend_Db_Adapter_Exception]
SQLSTATE[28000] [1045] Access denied for user 'USERNAME'@'localhost' (using password: YES)

[PDOException]
SQLSTATE[28000] [1045] Access denied for user 'USERNAME'@'localhost' (using password: YES)

I've tried the IP, and domain name, as well as localhost, which all receive the same error?

Near nothing on the net regarding this, so reached out here.

I know the credentials are correct, and the Magento 2 store is up, and running fine.

Any assistance will be much appreciated.


texts:
I'm getting an error in my Magento 2.3.6 when I run n98-magerun2 sys:cron:run analytics_collect_data and overnight in the cron table.
Run Magento\Analytics\Cron\CollectData::execute
Cron-job "analytics_collect_data" threw exception Magento\Framework\Exception\FileSystemException

In File.php line 226:
Directory "/tmp/analytics/tmp" cannot be created Warning!mkdir(): Permission denied

In my development environment I've set the var folder to permissions 777 and manually created the tmp/analytics/tmp folder all with permissions set to 777 but I still get the error.
Any ideas?


texts: Trouble adding a custom css file via local.xml

texts:
I am attempting to add a custom css file instead of just adding changes to styles.css, I would like a separate file where all of my css changes to my theme are kept.

To do this I have created a custom.css file and placed it in skin/frontend/mytheme/default/css

The file right now contains a Video Wrapper that I am using to make youtube videos on CMS pages responsive.

The video wrapper is called by  on any CMS page with the following

<iframe width="100%" src="https://www.youtube.com/<<video>>" frameborder="0" allowfullscreen>

content of custom.css

/* Video Wrapper */
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

Then in my local.xml file I have modified it to contain the following:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name=“head”>
            <action method="addCss"></action>
        </reference>
        <reference name="footer_links">
                <action method="addLink" translate="label title">FAQ<url>faq</url><title>Frequently Asked Questions</title><prepare/><urlParams/><position>5</position>
                </action>
        </reference>
    </default>
</layout>

The above did not work, so I tried again with the below, and it still did not work.

<?xml version="1.0"?>
<layout version="0.1.0">
    <customd6css>
        <reference name=“head”>
            <action method="addCss"></action>
        </reference>
    </customd6css>
    <default>
        <reference name="footer_links">
                <action method="addLink" translate="label title">FAQ<url>faq</url><title>Frequently Asked Questions</title><prepare/><urlParams/><position>5</position>
                </action>
        </reference>
    </default>
</layout>

Any help or advice on where I am screwing this up would be helpful, when I inspect the page source custom.css is not among the resources.  I could of course just give up and place the css changes directly in styles.css, but would prefer not to.

I know the problem is with my local.xml file, because both of my above attempts caused the local.xml to not be processed properly, because with both my FAQ link disappears.


texts:
Hello I would like to modify the product view page, and inject php into it via my extension. I tried doing it via editing the transport block, but it can only add html files and not php files.
I also tried appending an additional layout externally...to no avail.

if ($block  instanceof Mage_Catalog_Block_Product_View)
{
    $block = $observer->getLayout()->createBlock('demo\productrender.phtml');
    $observer->getLayout()->getBlock('content')->append($block);
}

The code which i need to inject externally:

// Facebook
<a href="javascript:popWin('https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($productUrl); ?>&t=<?php echo urlencode($productName); ?>', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');"
   title="<?php echo $this->__('Share on Facebook') ?>">Facebook

Ajax
<?php echo Mage::app()->getRequest()->getControllerName(); ?>
// return module name
<?php echo $this->getUrl('demo/Ajax/index') ?>


texts: Magento 2: Product attribute is not get any value in observer

texts:
Here am using if condition to redirect if product attribute option value is !5431 but attribute is not echo any value here.
<?php

namespace Softadroit\Prescription\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\App\ObjectManager;
use Psr\Log\LoggerInterface;

class Orderplaceafter implements ObserverInterface
{
    protected $_responseFactory;
    protected $_url;
    protected $_order;

    public function __construct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url,
        \Magento\Sales\Api\Data\OrderInterface $order
    ) {
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
        $this->_order = $order;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $event = $observer->getEvent();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $_checkoutSession = $objectManager->create('\Magento\Checkout\Model\Session');
        $_quoteFactory = $objectManager->create('\Magento\Quote\Model\QuoteFactory');

        $orderid = $observer->getEvent()->getOrderIds();
        $order = $this->_order->load($orderid);

        foreach($order->getItemsCollection() as $_item){
        $product = $_item->getProductId();
        //echo $_item->getName(); die();

        //$is_priscription =  $_item->getProduct()->getMyCustomAttribute('prescription');

        //echo $_item->getProduct()->getMyCustomAttribute('prescription');
        //die();

        $is_priscription = $_item->getProduct()->getAttributeText('prescription');

        //echo "call";
        //echo $_item->getProduct()->getPrescription();
        //exit;

        if($is_priscription == "" && $is_priscription != '5431'){
             $redirectionUrl =  $this->_url->getUrl('order-success');
             $this->_responseFactory->create()->setRedirect($redirectionUrl)->sendResponse();
             //return $this;
              return;
            }
        }

        $order = $_checkoutSession->getLastRealOrder();
        $quote = $_quoteFactory->create()->loadByIdWithoutStore($order->getQuoteId());

        if ($quote->getId()) {
            $quote->setIsActive(1)->setReservedOrderId(null)->save();
            $_checkoutSession->replaceQuote($quote);
            $url = $this->_url->getUrl('prescription/index'); //('[ModuleName]/[ModuleName]/[[Action]');
            $this->_responseFactory->create()->setRedirect($url)->sendResponse();
            die();
        }
    }
}


texts: Magento2 Setup version for module is not specified

texts:
I installed a local copy of Magento 2. I am facing some problem with custom module.

I followed following file/folder structure

app/code/Ps/HelloWorld/etc/module.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Ps_HelloWorld" schema_version="0.0.1" setup_version="0.0.1" />
</config>

Inside this file I have the following: I refreshed the store cache and then I got:

  Setup version for module 'Ps_HelloWorld' is not specified.


texts: Show selected options near to element in admin product edit page -M2

texts:
In Magento-1, I have write script in this bellow file to show selected options of multi select.
app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml

In Magento2, I want to show selected options near by that element in product edit page.
How can do same thing in Magento-2.3?

Thanks in advanced!


texts: admin shipping account - shipping allowed only when status is preparing_shipment

texts:
I need to create an admin account that should be able to do only the following action:

view orders that are in the preparing_shipment status
change the status of the order to shipped
insert the tracking code

I wasn't able just using the magento permissions, is there any method I can use?

Thanks


texts: Prevent custom weight from being overwritten

texts:
In my Magento 2 extension I do calculate the product weight when the user adds an item to the cart.

My problem is that the weight I set gets overwritten at the checkout.
Cause is the setProduct() function of Magento\Quote\Model\Quote\Item.php.

To prevent this I created a plugin:

  Vendor\Module\Plugin\ItemModelPlugin.php

namespace Vendor\Module\Plugin;

use Magento\Quote\Model\Quote\Item as QuoteItem;

class ItemModelPlugin
{

    public function aroundSetProduct(QuoteItem $subject, \Closure $proceed, $product)
    {

        if($product->getData('isCalcWeight') == true)
        {
            $weight = $subject->getWeight();
            $result =  $proceed($product);
            $subject->setWeight($weight);
            $subject->save();

        }else {

            $result =  $proceed($product);

        }

        return $result;

    }
}

But two things don't work here.

$product->getData('isCalcWeight') and $subject->getWeight() always return NULL.

  Note: The attribute "isCalcWeight" is a bool that is set to true/false depending on the fact if a custom weight is used or not.

Can someone help me out here?

UPDATE

Something to add is that I need to calculate my weight beforehand, because it is calculated with an ajax request which takes the chosen product options and returns the calculated price and weight for the product. Calculating this every time the product is set would makes things slow, unnecessarily complicated and possibly prone to bugs.


texts: Sign out not visible on homepage of magento 2.3

texts: I cant see default Sign out link after user sign-in on headers of my magento2.3 website.


texts: Avoid repetation of error message in addError()

texts:
How to avoid repetition of same message at addError()/addSuccess().

Example:

public function a(){
Mage::getSingleton('core/session')->addError("Custom Error");
}

public function b(){
Mage::getSingleton('core/session')->addError("Custom Error");
}

In some cases I call both function a() and function b().
I don't want both error message at a time.


texts: As like customer I want to display admin grid in edit form


texts: Magento 2 Fatal error: Uncaught Error: Call to a member function setSortable() on boolean

texts:
I am getting below error while loading admin grid of my custom module.

Fatal error: Uncaught Error: Call to a member function setSortable() on boolean in D:\xampp\htdocs\magento2\vendor\magento\module-backend\Block\Widget\Grid.php:413 Stack trace: #0
D:\xampp\htdocs\magento2\vendor\magento\module-backend\Block\Widget\Grid.php(467): Magento\Backend\Block\Widget\Grid->_prepareGrid() #1
D:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\AbstractBlock.php(658): Magento\Backend\Block\Widget\Grid->_beforeToHtml() #2
D:\xampp\htdocs\magento2\vendor\magento\framework\View\Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml() #3`
D:\xampp\htdocs\magento2\vendor\magento\framework\View\Layout.php(518): Magento\Framework\View\Layout->_renderBlock('adminhtml_prici...') #4
D:\xampp\htdocs\magento2\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('adminhtml_prici...') #5
D:\xampp\htdocs\magento2\vendor\magento\framework\View\Layout.php(472): Mag in
D:\xampp\htdocs\magento2\vendor\magento\module-backend\Block\Widget\Grid.php on line 413


texts: How to implement 2 checkout in magento2?

texts:
How to implement TCO and write below code in magento2.

$two_checkout_model = Mage::getModel("tco/ins")->load($two_checkout_message_id);


texts: Why are the admin labels showing curly braces?

texts:
I have my development environment that is showing the labels in a very strange way after I've runned composer update.

I see many of the labels with the curly braces around... Something like this:

{{{SKU}}{{SKU}}{{SKU}}{{themeMagento/Backend}}}

here is an image of the catalog page.

I'm new with Magento, thanks for your help.


texts: Magento 2: How to enable html tags in backend attributes?

texts:
I have added payment method in magento2.2. The payment method has an input box typed textarea. I want to add a href link but it's not supporting it. Is there a way to enable HTML tags.

I am getting this in frontend


texts: Live Magento 2 Site redirecting to localhost

texts:
My Magento 2 live site redirects to localhost

Already done:

updated database URLs in web/unsecure/base_url & web/secure/base_url.
flushed cache.

Anymore suggestions?


texts: Magento 2 : How to Change Order Of Billing and Shipping Address in Backend?

texts:
we have requirement to change order of address fields like below at back-end order.

Sort Order should be like below:

Street Address
Country
State/Province
City
Zip/Postal Code
Phone Number

Default/current address fields order is like below attached screen-shot


texts: Make rows in admin grid not clickable with default cursor (not pointer)

texts:
So, this is my grid layout

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<referenceContainer name="root">
    <block class="Magento\Backend\Block\Widget\Grid" name="custom.name">
        <arguments>
            <argument name="dataSource" xsi:type="object">Vendor\Module\Model\ResourceModel\My\Collection\Grid</argument>
            <argument name="id" xsi:type="string">MyGrid</argument>
            <argument name="use_ajax" xsi:type="string">true</argument>
            <argument name="default_sort" xsi:type="string">custom_id</argument>
            <argument name="default_dir" xsi:type="string">DESC</argument>
            <argument name="grid_url" xsi:type="url" path="*/customer/customgrid">
                <param name="_current">1</param>
            </argument>

        </arguments>
        <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="customer.edit.tab.columnSet">
           ....
    </block>
</referenceContainer>

Now the rows are clickable, but I want to make them not clickable with  default cursor. How can I do that?


texts:
Why does magento2 calls following query in category page?

INSERT INTO `search_tmp_58aad5dedee6e0_33744149` SELECT `main_select`.`entity_id`, MAX(score) AS `relevance` FROM (SELECT `search_index`.`entity_id`, (((0)) * 1) AS score FROM `catalogsearch_fulltext_scope1` AS `search_index`
 LEFT JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id
 LEFT JOIN `catalog_category_product_index` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id WHERE (category_ids_index.category_id = 4)) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC
 LIMIT 200000

Even there is no need of any search functionality.
Have anyone got any clarification of this?
I have a category that has lot of products and that category loads in about 15 second for the first time. So I am debugging and found above query is much slow.

Thanks in advance.


texts: Magento 2 Change default store view in admin

texts:
Can Anyone know how to set a default store view in admin?

Please let me know if anyone have any idea about this.


texts:
I am trying to deploy the static content but in frontend and backend require js is not being loaded see error :

Loading failed for the <script> with source “http://example.com/dev/pub/static/version1525976399/frontend/Sm/market/en_GB/requirejs/require.js”.
dev:20
Loading failed for the <script> with source “http://example.com/dev/pub/static/version1525976399/frontend/Sm/market/en_GB/mage/requirejs/mixins.js”.
dev:21
TypeError: require.config is not a function[Learn More]

I have tried following command :

php -d memory_limit=5G bin/magento setup:di:compile
For Deployment:
php -d memory_limit=5G bin/magento setup:static-content:deploy

But it's not helped. How to resolved it ?


texts: Check if product is in an attribute set by its ID

texts:
I want to get Attribute set ID in product page
Can you help me please


texts: Problem when adding products to the cart. Magento 2

texts:
When I am in a product and I add to the shopping cart 4 units of it (the quantity is just an example) it is added with the amount of "1" and if I add 4 more units, "2" is added instead of 8 !!!

Can somebody help me? I'm newbie in Magento!
Thank you very much in advance.


texts:
I am using admin_system_config_changed_section_[SECTION] to observe system config save action.
Is there a way to detect if a field has changed or not?


texts: Magento 2.2.6 - Admin Catalog Products -> Browser freeze

texts:
Problem

The admin catalog product overview does load very very very slow (15minutes+) or not at all.

The product overview in the admin loads pretty fast until the animated loading icon appears. So you see the page with the header and menu but no products yet. No 40x or 500 HTTP requests in Chrome or Firefox. The browser simply freezes. No right button response for example.

The server does not show any load when opening the page. Loads up to 0.1x.

After looking for hours and hours, reading and looking for solutions I am lost. Does someone have any idea?

Background information

Magento V2.2.6
PHP V7.0.27
My store has about 50k products and 2.5k categories.
Running on a decent dedicated server (64GB memory) at a specialized Magento hosting
The frontend and everything else in the admin loads pretty fast. Mostly page load times of 0.x seconds
Flat catalog and categories is ON
Minify JS & CSS is ON
Combining JS & CSS is OFF


texts: Not uploading extension in marketplace and redirecting it to another website: Magento Marketplace

texts:
The Magento Connect, which has now been closed, could be used to redirect the users to the developer's site from where the extension could be purchased.

Now, with the arrival of Magento Marketplace is there any way to do the same? I understand that the marketplace is reviewing each of the extensions which is actually required to ensure quality, but what if I do not want to upload my extension to the marketplace and want to redirect the users to my corresponding website through which they can get the module.

Is that possible to do with the marketplace?
Please, can anyone help?


texts:
I did the following code: inside Model/Api.php.

      public function createLink ($bvitems, $bvselectionRawData, $bvproductId, $storeid ) {

        $selections = array();

        $selections = $bvselectionRawData;

        $productId = $bvproductId;
        $product    = Mage::getModel('catalog/product')->setStoreId($storeid);

        if ($productId) {
            $product->load($productId);
        }
        Mage::register('product', $product);
        Mage::register('current_product', $product);

        $product->setCanSaveConfigurableAttributes(false);
        $product->setCanSaveCustomOptions(true);

        $product->setBundleOptionsData($bvitems);
        $product->setBundleSelectionsData($selections);
        $product->setCanSaveCustomOptions(true);
        $product->setCanSaveBundleSelections(true);

        $product->save();
        return $product->getName();
       }

call it:

$proxy->call($session_id,'bvapi_products.createLink',array($items, $selectionRawData, $product_id, $store_id));

with this array:

    $items[0] = array('title' => 'Bundle Option',
        'option_id' => '',
        'delete' => '',
        'type' => 'radio',
        'required' => 1,
        'position' => 0);

    $selectionRawData[0][0] = array('selection_id' => '',
        'option_id' => '',
        'product_id' => 166,
        'delete' => '',
        'selection_price_value' => 0,
        'selection_price_type' => 0,
        'selection_qty' => 1,
        'is_default' => 1,
        'selection_can_change_qty' => 0,
        'position' => 0);

    $selectionRawData[0][1] = array('selection_id' => '',
        'option_id' => '',
        'product_id' => 167,
        'delete' => '',
        'selection_price_value' => 0,
        'selection_price_type' => 0,
        'selection_qty' => 1,
        'is_default' => 1,
        'selection_can_change_qty' => 0,
        'position' => 0);

    $items[1] = array('title' => 'Bundle Option 2',
        'option_id' => '',
        'delete' => '',
        'type' => 'select',
        'required' => 1,
        'position' => 0);

    $selectionRawData[1][0] = array('selection_id' => '',
        'option_id' => '',
        'product_id' => 151,
        'delete' => '',
        'selection_price_value' => 0,
        'selection_price_type' => 0,
        'selection_qty' => 1,
        'is_default' => 1,
        'selection_can_change_qty' => 0,
        'position' => 0);

    $selectionRawData[1][1] = array('selection_id' => '',
        'option_id' => '',
        'product_id' => 153,
        'delete' => '',
        'selection_price_value' => 0,
        'selection_price_type' => 0,
        'selection_qty' => 1,
        'is_default' => 1,
        'selection_can_change_qty' => 0,
        'position' => 0);

    $selectionRawData[1][2] = array('selection_id' => '',
        'option_id' => '',
        'product_id' => 148,
        'delete' => '',
        'selection_price_value' => 0,
        'selection_price_type' => 0,
        'selection_qty' => 1,
        'is_default' => 1,
        'selection_can_change_qty' => 0,
        'position' => 0);

my problem is product successfully updated but not showing into frontend.

Any help is appreciated.


texts: Magento: 1.9.X - Improvement on Upgrade Sales Orders Grid

texts: It seems that magento function updateGridRecords update all entries from sales_flat_order_grid. All good, but if we have more than 100k orders, that function failed to update/insert all the entries. There is a method in order to remove existing order ids from the select and update only new orders?


texts: I have added custom field in sales_order_grid but cannot retrieve data by getData( )

texts:
I need to get order comment in order grid, but cannot retrieve data by getData( )

Upgrade script

<?php

namespace vender\Ordercomment\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{

    public function __construct(
        \Magento\Sales\Setup\SalesSetupFactory $salesSetupFactory
    ) {
        $this->salesSetupFactory = $salesSetupFactory;
    }

    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), '1.0.2') < 0) {
            $setup->startSetup();

            /** @var \Magento\Sales\Setup\SalesSetup $salesInstaller */
            $salesInstaller = $this->salesSetupFactory->create(['resourceName' => 'sales_setup', 'setup' => $setup]);

            $salesInstaller->addAttribute(
                'order',
                'order_comment',
                ['type' => Table::TYPE_TEXT, 'length' => '64k', 'nullable' => true, 'grid' => true]
            );

            $setup->endSetup();

        }

    }

}

Controller

namespace vender\Customoption\Controller\Index;

use Magento\Framework\App\Action\Context;

class test extends \Magento\Framework\App\Action\Action
{
    public function __construct(Context $context
                               ) {
        parent::__construct($context);
    }

    public function execute()
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $order2 = $objectManager->create('\Magento\Sales\Model\Order')->getCollection();

        foreach ($order2 as $t) {
            echo $t->getOrderComment();
        }

        exit();
    }
}


texts: Magento 2: Call customer login page in other phtml

texts: Can any one tell me how to call customer login page in  magento2 Logo.phtml


texts: M1 How to know what contents corresponding to layout / block / template?

texts:
Currently, I don't know how to find the layout of the manage customer page (Customers > Manage Customer).
Generally, how can I find the block/layout/template/controller of a specific page?

Thank you!

(PS: please tell me why I can't say hello at first line of my post :( )


texts:
I'm working on a website that has Paypal Express Checkout integration.  We've disable the ability to checkout from product pages, or the basket page, so it's essentially just another payment option at checkout.

Currently, when a customer selects Paypal, they are immediately redirected to PayPal.  Whilst this has the ability to have an order review step (after the customer enters their details), we would like to change this so that the checkout order review step (6) displays, and the customer would hit "pay now" and then be directed to PayPal from there instead.  Is this possible?


texts:
I am new to magento and would like to know the best practice of order fulfillment. We receives orders from our ecommerce website to magento and how do I perform the following in magento:

Order picked, packed, shipped, delivered or returned and closed.

Thank you,


texts: get current customer's cart items count in Magento 2

texts:
I want the current customer's cart items count via custom web api in Magento 2.
Please help me out to get that


texts: Free shipping method title showing twice

texts:
I am using magento version 2.2.4.

My free shipping method showing twice on checkout page like below image

All other methods name showing only once. How can i show free shipping title once ?


texts: Magento 2.2.5 Customer Registration Page Reloads After clicking the Create Account Button

texts:
I have a fresh installation of magento 2.2.5 with Magetigue theme and I have migrated the data from magento 1.9.3.7 to magento 2.2.5 using data migration tool. Now when I try to create an account by entering all the fields and click the create button, It reloads the same registration page showing an error message that " "" is a required Field". I have checked the app/design/frontend/THEME_VENDOR/THEME/Magento_Customer/templates/form/register.phtml file and it contains the form key

<?= /* @noEscape */ $block->getBlockHtml('formkey'); ?>

So, its not a form key problem
I have deleted all the cookies too, but still no luck.

I have traced the post request after clicking the create customer button in the network tab and the post request goes to CreatePost.php in /vendor/magento/module-customer/Controller/Account/CreatePost.php and the request status is 302 found.

I have added a log code in CreatePost.php

And found that the problem lies in this code:

try {
            $address = $this->extractAddress();
            $addresses = $address === null ? [] : [$address];

            $customer = $this->customerExtractor->extract('customer_account_create', $this->_request);
            $customer->setAddresses($addresses);

            $password = $this->getRequest()->getParam('password');
            $confirmation = $this->getRequest()->getParam('password_confirmation');
            $redirectUrl = $this->session->getBeforeAuthUrl();

            $this->checkPasswordConfirmation($password, $confirmation);

            $customer = $this->accountManagement
                ->createAccount($customer, $password, $redirectUrl);

Can somebody help resolve this?

Regards,


texts: Magento 2 : How to Get Visitor Data & Store Detaills in Database

texts: I want to get visitor data when visitor visit magento website. In visitor detail, I want to get IP address, browser name , Operating System Name , First Visit Time, & Last Visit time. How is it possible? This Feature must working on all page of magento website.


texts: How to add new column to core module of admin grid in Magento2

texts:
I need to add new  column to sales and customer admin grid in Magento2 and also
as all we know it uses UI Component, then how to extend grid with UI as well as non UI ex newsletters  modules


texts: Magento 2 filter is not recognised in select all

texts:
When I select all in the admin grid it is passing all the items in the collection not recognizing the filter.
I have added a filter using ui_component like this below.
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
        <item name="update_url" xsi:type="url" path="mui/index/render"/>
        <item name="filter_url_params" xsi:type="array">
            <item name="seller_id" xsi:type="boolean">1</item>
        </item>
        <item name="storageConfig" xsi:type="array">
            <item name="indexField" xsi:type="string">id</item>
        </item>
    </item>
</argument>

this filter is working but when I select all it is passing all the collection to mass action controller.

As shown above, only 13 items should be posted to the mass controller but it is posting total collection.
My Controller:
public function execute()
    {
        $collection = $this->filter->getCollection($this->collectionFactory->create());
        $productIds = $collection->getAllIds();
        $collectionSize = $collection->getSize();
        $or_id = array();
        $sel_id = array();
        foreach ($collection as $record) {
           // var_dump($record->getData());
            $or_id[] = $record->getData('order_id');
            $sel_id[] = $record->getData('seller_id');
            //
        }
        var_dump($record->getData('seller_id'));
        exit
    }


texts: Magento 2 - How to use plugin to change product visiblity after saving product from backend?

texts:
I am new in Magento 2 and I want to change product visibility after saving product from backend using plugin.

For this I have created custom module and plugin, but I am not sure that we can achieve this using of plugin or not? Or Should I go with Observer?

I am trying something like : -

  app/code/Custom/HelloWorld/etc/di.xml

<type name="Magento\Catalog\Model\Product">
        <plugin name="Custom-HelloWorld-product-model" type="Custom\HelloWorld\Plugin\ProductPlugin" sortOrder="1" />
    </type>

  app/code/Custom/HelloWorld/Plugin/ProductPlugin.php

namespace Custom\HelloWorld\Plugin;

class ProductPlugin
{
    public function beforeSetVisiblity(\Magento\Catalog\Model\Product $subject, $visiblity)
    {
        ....
    }
}

Please suggest. Thanks!


texts: Multiple Magento Installation with PVT and SHARED Products DB

texts: Is it possible to share a Products DB between multiple Magento stores?


texts: Magento local installation issue with link of item menu

texts:
i have a problem about link of item menu of my site in Magento. I have transferred my site from remote to local.

But when i click on a menu button, the link goes to the online site and no locally. Why this? Where can i go for edit the link for the redirect?

Thanks.


texts: join customer custom attribute to order collection

texts:
I'd created a custom attribute for customer and in order collection I need to show that attribute. How could I do that?

for now I'd got the order collection as

$collection = Mage::getModel('sales/order')->getCollection()
                ->addAttributeToSelect('*')
                ->addFieldToFilter('status', array('eq' => 'complete'))
                ->addAttributeToFilter('customer_group_id', $customer_group)
        ;

The attribute I'd created is coachid which need to displayed in this collection. Anyone could help?


texts: How to get product attributes with values

texts:
How can I get all attributes of product with its values?
I mean attributes like size, color, gender and like that, but not availablity, quantity or sku. I need to use them for filters, how can I get it?


texts: Remove option from adminhtml UI component XML file. Delete Mass Action Option in Magento 2.3

texts:
I want to remove (or hide) the delete option from the product listing mass action in the Admin section. I cannot find the correct way to do this.

This shows how to hack the core files which is not very useful

This shows you how to add to the ui component

The file Catalog/view/adminhtml/ui_component/product_listing.xml is what I would like to override/edit. I have created the custom module and can add to the ui component but I cannot simply remove the option in Module/ModuleName/view/adminhtml/ui_component/product_listing.xml
So what am I missing? I have tried simply removing the option in the custom module after copying all of the XML over but that obviously did nothing. How do I Customize the options?

   <massaction name="listing_massaction"
                component="Magento_Ui/js/grid/tree-massactions"
                class="\Magento\Catalog\Ui\Component\Product\MassAction">
        <action name="delete">
            <settings>
                <confirm>
                    <message translate="true">Delete selected items?</message>
                    <title translate="true">Delete items</title>
                </confirm>
                <url path="catalog/product/massDelete"/>
                <type>delete</type>
                Delete
            </settings>
        </action>
        <action name="status">
            <settings>
                <type>status</type>
                Change status
                <actions>
                    <action name="0">
                        <type>enable</type>
                        Enable
                        <url path="catalog/product/massStatus">
                            <param name="status">1</param>
                        </url>
                    </action>
                    <action name="1">
                        <type>disable</type>
                        Disable
                        <url path="catalog/product/massStatus">
                            <param name="status">2</param>
                        </url>
                    </action>
                </actions>
            </settings>
        </action>
        <action name="attributes">
            <settings>
                <url path="catalog/product_action_attribute/edit"/>
                <type>attributes</type>
                Update attributes
            </settings>
        </action>
    </massaction>


texts:
I have a file in my package myPackage/default/template/testpage/test.phtml with something like:

<?php
echo 'Test'
?>

How can I call it as a block in a cms->page?

I tried to use {{block type="page/template_testpage_test" template="testpage/test.phtml"}} but nothing happens.
How should I call the type=A/B?

Thanks


texts: $stockItem->getIsInStock() stopped working after update to 1.9

texts:
example code:

$stockItem = $product->getStockItem();
$stockItem->getIsInStock()

The product is one item of a collection.
Before the update I could Request the isInStock status in this way.
After the Update this always returns Null.


texts: Execute code after all payment methods are rendered on checkout

texts:
I need to execute a code once all the payment methods are loaded (rendered) on the checkout (using the onepage solution).

I can't find the way to achieve that.

My final goal is  to create a custom "Place Order" button underneath all payment methods that would be enabled only if a payment method is selected (even after a refresh page when the selected option is stored in the local storage).


texts: Paypal Payment Method Missing from Backend Order

texts:
I have Paypal Website Payments Pro Hosted Solution set up on a multi-store Magento installation.

Paypal works fine in the front end, but when I try to do a backend order it says: "No Payment Methods".

Any suggestions?


texts: Going from step to next step during check-out sometimes gets stuck for minutes at a time

texts:
Magento 1.9.1
Porto theme
SSD VPS with 6 GB RAM; Cores: 8

People told me they have experienced this on my website but I haven't actually seen this myself until last week for the first time. Now I've seen it happen at least 4 times within a week. When you are going through the order process and click whatever button to proceed - it just gives you the circle that goes round and round for minutes and it will actually take 5 minutes or so to go to the next step. There seems to be no rhyme or reason to this - it happens intermittently and at different places of the check-out.


texts:
I have Magento 2.1.2. The store have years working but last week when I create a configurable product, in the frontend show select to change options but the price not change:

Change the select but not price. When add the product to cart the price is correct but I don't know why not change the price


texts: Pass boolean or variable from Child Block to Parent Block?

texts:
I'm probably thinking about this the wrong way, but I have two blocks and one is the child of the other. In the parent's template file, I'm calling getChildHtml() and rendering the child block that way.

However, before rendering the child block, I'd like to be able to check first if a certain condition is true for the child block. Is there a way for it to return false/true, and for the parent block to check that?

(Answer would preferably be particular to the above scenario rather than suggesting a completely different approach, though I'm always happy to hear thoughts)


texts: Display the store views depending on I.P address

texts:
we have 2 store views for 2 countries [India & USA ] with store view codes sv1 & sv2

what we want is ,

if customer visit the site from USA, it should open USA store-view

if customer visit the site from India, it should open Indian store-view

by checking IP address, it should work.


texts: Cannot get logged in customer id from Block class?

texts:
I am avoiding using the object manager directly, but I cannot get this injected session to return a customer id?

...
use Magento\Customer\Model\Session;
...

class Summary extends Template
{

    protected $_session;

    public function __construct(
        Session $session,
        Quote $quote,
        Template\Context $context,
        array $data = [])
    {
        $this->_session = $session;
        $this->_quote = $quote;
        parent::__construct($context, $data);
    }
    var_dump($this->_session->getCustomerId());

    // Returns null.


texts: override custom image path for bundled products only

texts:
how can i override custom image path for bundled proudcts
i am using below code in catalog > category > custom design update

<reference name="product.info.media">
      <action method="setTemplate">
            <template>path_to_media.phtml</template>
      </action>
</reference>

now i want to do it via module i made config file

<?xml version="1.0"?>
<config>
  <modules>
    <Module_Customgroup>
      <version>0.1.0</version>
    </Module_Customgroup>
  </modules>
  <frontend>
  </frontend>
</config>

1:where should i write it in config.xml
2: should it be used inside  ?
3: how to limit it so it can be applied on bundled products only


texts: How to change price for configurable products in Product Listing in a modal

texts:
I have simple and configurable products in Product Listing page. When I click on product it is open a modal and show with product related information. In modal, For configurable products I have 3 configuration attributes like : small, medium and large. All of 3 configurations have different prices. I can add products to cart using ajax in modal.

But on changing configurations product price is not getting changed.

Can anyone tell me how can I achieve this?

I have used this script but it is not working in this case

<script>
require([
    'jquery',
    'priceBox'
], function($){
    var dataPriceBoxSelector = '[data-role=priceBox]',
        dataProductIdSelector = '[data-product-id=<?php echo $block->escapeHtml($_product->getId())?>]',
        priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

    priceBoxes = priceBoxes.filter(function(index, elem){
        return !$(elem).find('.price-from').length;
    });

    priceBoxes.priceBox({'priceConfig': <?php /* @escapeNotVerified */ echo $block->getJsonConfig() ?>});
});


texts: Add to cart configurable product programatically magento2

texts:
I tried with add to cart configurable product but getting error when run the custom code using observer but same code when run from controller than it's working fine. you can see below code for bundle product.

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$quote = $objectManager->get('\Magento\Checkout\Model\Cart');
$_product = $objectManager->get('\Magento\Catalog\Model\Product')->load(27);
$params = array (
    'product' => 27, // product id
    'qty' => 1, // product qty
    'related_product' => null,
    'super_attribute' => array(
        6 => 1, // 6 is attribute id and 1 is index_value
        2 => 2
    )
);

$quote->addProduct($_product, $params);
$quote->save();

and when i run the custom above code you can see below error.

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): You need to choose options for your item.


texts: Product attribute join with custom table Magento 2.17 - how to retrieve custom table field

texts:
In my code I have seller_id as the product attribute and the seller information are there in a custom table (lof_marketplace_seller). I want to join the product collection with this custom table. I did the join this way:

$collection = $productCollection->create()
            ->addAttributeToSelect('*')
            ->load();
 $collection->getSelect()->join(

                ['lof_marketplace_seller'],
               'lof_marketplace_seller.seller_id = e.seller_id',
                []

        )->columns(['seller_name'=> 'lof_marketplace_seller.name']);

and then I write this to get the seller name:

foreach ($collection as $value) {
    $sellerName = $value->getData('seller_name');
    ................
}

But I'm not able to get seller name by using the code. When I try to generate the SQL from the $collection, I'm able to get the fields & values exactly. (by $collection->printlogquery(true))

My question is how to retrieve the seller_name from the result set.
OR simply how to retrieve custom table field in a JOIN operation

$productCollection Variable:

class Json extends \Magento\Framework\App\Action\Action {
    private $productCollection;
    public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory,
    \ESPL\Autocomplete\Helper\Data $helper,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollection,
    \Magento\Store\Model\StoreManagerInterface $store,
    \Magento\Catalog\Helper\Image $image,
    \Magento\Catalog\Model\ProductFactory $product
)
{
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
    $this->helper = $helper;
    $this->productCollection = $productCollection;

}

public function execute()
{

   $productCollection = $this->productCollection;
   $collection = $productCollection->create()
   ............................

Thanks,


texts: How Can we use React JS product View page in magento 2?

texts:
I need to do some functionalities in which the page to not load. I prefer to react js but I don't know how to add react js for selected modules of Magento.
I need to react for Magento component view page.


texts: Each store effect performance badly on Multistore magento website?

texts:
Is a store effect performance to other multistore in the same magento install?

e.g.) if A store have 40000 sku products, and B store(which in same magento install with A) have only 100 sku products, is B store become slow due to A's products number like search result?

What other thing is effected to each store?

If there is many products and each store have many language store view, is it recommend to create each separate store with different magento install?


texts: Magento 2 - How to hide categories with no active products?

texts: How to hide all disabled products category, what is the best practice to achieve in Magento 2.3.4?


texts: Magento 2.2 - Notice: Undefined index: Magento\Integration\Model\IntegrationService

texts:
I am trying to install a module I've created on Magento 2.1 to Magento 2.2 but when I compile it, it give the following error:

  Notice: Undefined index: Magento\Integration\Model\IntegrationService
  in vendor/magento/framework/Interception/PluginList/PluginList.php on
  line 250

I really don't know what could cause the issue. The issue is that Magento tries to get the following:

$this->_inherited['Magento\Integration\Model\IntegrationService']['webapiIntegrationService']['instance']

The problem is that _inherited array doesn't have 'Magento\Integration\Model\IntegrationService' key in it.

I believe that this is caused by my module at some stage but I don't see where.

Developer mode and using bin/magento setup:upgrade -vvv doesn't help.

Does anyone know what could cause the issue or eventually could anyone give me direction on where to check?


texts: I have a custom module with a frontend form. How is it possible to show a popup after submitting the form? Please give a solution. Any help would be appreciated.


texts: Newest Product Widget Not Showing Correct Products

texts:
I have a recent problem with the new product widget not actually displaying the newest products. It is set to 'all products-recently added products' but has just been showing the same 5 products for the last 2 months, regardless of the products that have just been added...

Does anyone have any ideas on what could be causing this?


texts: Add a external link to system configuration tab

texts: Is it possiible to add an external link to system config tab? Usually, when you create new section, you can add link to system config only, but in my case, I want to add a link to custom module grid.


texts:
I integrated baler in Magento 2 EE. I followed below steps.
- $ git clone https://github.com/magento/baler.git
- $ npm install
- $ npm audit fix
- $ npm run build

But when I run this command it is running for long time but not completed.
 baler/bin/build


texts: Magento2 : Create custom REST POST api with raw data as application/xml

texts:
I need to create a custom REST POST API which will accept XML as like below XML, and we need to read those XML tags.
<?xml version="1.0"?>
<testparams>TEST</testparams>


texts: Change Magento 1.9 domain name - nothing will solve

texts:
I need to change a magento domain to a temporary IP this way for development:

http://www.domain.com > http://xxx.xxx.xxx.xx/domain

I made several searches, changes to core_config_data and everytime I try the new URL it sends me back to http://www.domain.com. The problem also occurs on /admin.

Anyone has the answer for that ?

THank you !

Gustavo


texts: Magento 2 - Product gallery magnifier not working after overriding Gallery class

texts:
My magnifier is not showing anymore IF THE PRODUCT HAS MULTIPLE IMAGES, after I have overriden the gallery class!
I have enabled the magnifier in THEME\etc\view.xml:
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        ...

    <vars module="Magento_Catalog">

        <!-- Gallery and magnifier theme settings. Start -->
        <var name="gallery">
         ...

        <var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top">26vh</var> <!-- Top position of magnifier -->
            <var name="left">11vw</var> <!-- Left position of magnifier -->
            <var name="width">600</var> <!-- Width of magnifier block -->
            <var name="height">600</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>

        ...
    </vars>
    ...

I opened a product in the frontend and checked if the magnifier is working and it works great.
Then I have overridden the class Magento\Catalog\Block\Product\View\Gallery from my own module
app\code\Company\Base\etc\frontend\di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <preference for="Magento\Catalog\Block\Product\View\Gallery"
                type="Company\Base\Block\Product\View\Gallery" />

</config>

app\code\Company\Base\Block\Product\View\Gallery.php
(we do nothing yet, just creating the constructor)
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Company\Base\Block\Product\View;

use Magento\Catalog\Block\Product\Context;
use Magento\Catalog\Helper\Image;
use Magento\Catalog\Model\Product\Gallery\ImagesConfigFactoryInterface;
use Magento\Catalog\Model\Product\Image\UrlBuilder;
use Magento\Framework\Json\EncoderInterface;
use Magento\Framework\Stdlib\ArrayUtils;

class Gallery extends \Magento\Catalog\Block\Product\View\Gallery
{
    public function __construct(
        Context $context,
        ArrayUtils $arrayUtils,
        EncoderInterface $jsonEncoder,
        array $data = [],
        ImagesConfigFactoryInterface $imagesConfigFactory = null,
        array $galleryImagesConfig = [],
        UrlBuilder $urlBuilder = null
    ) {
        parent::__construct(
            $context,
            $arrayUtils,
            $jsonEncoder,
            $data,
            $imagesConfigFactory,
            $galleryImagesConfig,
            $urlBuilder
        );
    }

    // Do nothing yet, just the constuctor

}

Execute php bin/magento setup:di:compile
Execute php bin/magento cache:flush
But now the magnifier is not working anymore if the product has multiple images in the gallery showing. It still works fine if the product has only one image. The magnifier doesnt show up. What did I do wrong?


texts:
I'm trying to get the shopping cart ID given the customer ID, to expose it by SOAP API.

Calling the web service with an ID 1 returns nothing.

What am I missing here?

Here's the code for the web service

public function getShoppingCartId($customerId)
{
    Mage::log(__METHOD__);

    $customer = Mage::getModel('customer/customer');
    $customer = $customer->load($customerId);

    Mage::log('Getting shopping cart of '. $customer->getName() .' ('. $customer->getEmail() .'), ID: ' . $customer->getId() );

    $quote = Mage::getModel('sales/quote')->loadByCustomer($customer);

    Mage::log("-------------------------------------------");
    return $quote->getId();
}

This is the log output

DEBUG (7): Phoenix_Moneybookers_Model_Core_Api::getShoppingCartId
DEBUG (7): Getting shopping cart of John Doe (john.doe@example.com), ID: 1
DEBUG (7): -------------------------------------------


texts: Send Ajax request from Customer Dashboard Safe?

texts:
Hey guys I'm currently using Magento 1.7

I have a custom module that asks for additional information during customer registration.  One of the things I ask for is for a specific permit number that is OPTIONAL.  Upon loading the customer dashboard (after they register) I want to send an ajax request if they did submit the permit number but not if they didn't include it.

What are some suggestions to how to do this on the dashboard?
I don't want to create another custom module and listen for customer registration please respect this decision.

Let me know if anything in unclear and I'll clarify to the best of my ability thanks for taking the time to read my situation.

TLDR: I want to send an Ajax request when the customer registers or logs in and sees their dashboard. I know how to do this by just checking the hello.phtml and adding it at the top but I was wondering other ways of doing so!


texts: Magento 2.3 : Insert data into table using DeclarativeSchema

texts:
I have created upgrade data for insert the values for particular table

<?php

namespace XXX\YYY\Setup;

use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements UpgradeDataInterface
{
    /**
     * Upgrades DB for a module
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        /**
         * install product link attributes
         */
        $data = [
            [
                'link_type_id' => 'color',
                'product_link_attribute_code' => 'position',
                'data_type' => 'int',
            ]
        ];

        $setup->getConnection()
            ->insertMultiple($setup->getTable('catalog_product_link_attribute'), $data);

        $setup->endSetup();
    }
}

I need to change this script into Magento 2.3 (declarative schema)

how to do that.

Thanks.


texts: How can i only show date and month select box in calender(Magento 2)

texts:
I want my customer edit form calendar to be only date and month and no year and no week days name.
This must include leap year as well if a user birthday is on 29th Feb and according to this current calendar which has the the year 2019, it wont show 29th Feb.

So, I want a calendar widget to only show all month and day (leap + non-leap)


texts: What type of server and hosting for magento?

texts:
I have this offer : https://www.ovh.com/fr/hebergement-web/offres-performance.xml ( Performance 1 ).

But I encounter quite a long time for the homepage of my site. What do you recommend ?

In my theme I have a css minify js extension what cela is it ?

How to optimize magento?


texts:
using languages.phtml code we are displaying different stores result as below :

we are trying to add languages.phtml file result after 3 icons in header here.

but when i placed below code , its not working

    <?php echo $this->getLayout()->createBlock('page/html')->setTemplate('page
/switch/languages.phtml')->tohtml(); ?>

file is present in app/design/frontend/rwd/theme/template/page/switch/languages.phtml

header.phtml

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

<img src="<?php echo $this->getSkinUrl('images/search_16.png');?>" alt="Search">

        <?php echo $this->getLayout()->createBlock('page/html')->setTemplate('page/switch/languages.phtml')->tohtml(); ?>

        <?php // In order for the language switcher to display next to logo on smaller viewports, it will be moved here.
              // See app.js for details ?>

                <?php echo $this->__('Menu'); ?>

                <?php echo $this->__('Search'); ?>

                <a href="<?php echo $this->helper('customer')->getAccountUrl(); ?>" data-target-element="#header-account" class="skip-link skip-account">

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

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

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

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

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


texts: Products in cart reports magnto2 backend

texts: When i go to reports -> products in cart i am getting price 0 and product name blank.


texts: Empty array supplied in AVS fastsimpleimport

texts:
I am getting this Warning in my System.log:

Warning: Invalid argument supplied for foreach()  in C:\htdocs\myrep\app\code\community\AvS\FastSimpleImport\Model\Import\Entity\Product.php on line 485

and for line 508.

So, these lines are foreach loops in the functions setDropdownAttributes() and setMultiselectAttributes(). Through debugging I found out that $this->getDropdownAttributes() (and getMultiselectAttributes()) return empty arrays, therefore supplying the set functions with empty arrays. And it returns an empty array because in here (in class Varien_Object):

public function __call($method, $args)
    {
        switch (substr($method, 0, 3)) {
            case 'get' :
                //Varien_Profiler::start('GETTER: '.get_class($this).'::'.$method);
                $key = $this->_underscore(substr($method,3));
                $data = $this->getData($key, isset($args[0]) ? $args[0] : null);
                //Varien_Profiler::stop('GETTER: '.get_class($this).'::'.$method);
                return $data;

the line $data= $this->getData(...); returns 0.

Although I get this warning, all my attributes, that are dropdown or multiselect, in the products that are being imported, are set with the correct values without any problems.

Another funny thing is that this happens only when I import on parts. This means that, f.e., I have 7 products to import in a single XML file - if I construct the importArray for all of them and import it at once - it's all fine, without warning. But if I try importing on every 3rd product, f.e., I get the warning (therefore 2 warnings). If I try doing it on every 2nd product - 3 warnings. And yet - the values are always being imported and set correctly. I really am confused.


texts: how can I apply and clear a layered navigation filter via javascript in Magento 2.4?

texts:
I would like to create some quick filter buttons for layered navigation, for example to trigger popular filters like featured products, recommended etc.
I would like to programmatically trigger the filter via javascript when the user clicks on the filter and also be able to clear the previous ones when another button is clicked.
Is it possible?


texts: Add a create new order button in Admin in a Varien_Data_Form

texts:
I've to customise a Mage_Adminhtml_Block_Widget_Form class that uses a Varien_Data_Form.
I've to add a insert a 'create new order button'. At the moment, I'm using this code:

$adminorder->addField('some_field', 'submit', array(
    'after_element_html' => '<button type="button" onclick="alert(\'Create order\')">Create new order</button>'
));

But of course it shows a blank submit button too. Is there a better way to achieve it?


texts: 404 on Store Switch with Product Store View Scoped URL Key

texts:
By default URL Key on product page is Global scoped.

EDIT:
As suggested by FlorinelChis the scope can be changes in Manage attributes.
However this breaks the store view switcher behavior.

This is has been tested on 1.7.0.2 with samples data and "Add store code to URL" enabled:

edit a product and set a different url for a particular storeview (french)
Re-index
Open product page on the site on english store view
Switch to french: you will have the page URL containg /French/
Switch back to english -> 404 page error ( the url miss the store code /default/

how to make it work correctly with store view/language switch ?

Details:

URL for english : /default/sony-vaio-vgn-txn27n-b-11-1-notebook-pc.html
URL for french : /french/sony-vaio-vgn-txn27n-b-11-1-notebook-pc-french.html

If I'm on english site on this page -> /default/sony-vaio-vgn-txn27n-b-11-1-notebook-pc.html

Then I switch to french:

I got this URL  (the store code is missed):
MAGEDOMAIN/sony-vaio-vgn-txn27n-b-11-1-notebook-pc-french.html

So magento re-write the url correctly but miss the store code for some reason

Reference:

For sure this is related to /core/model/store.php and /core/model/url/rewrite.php, and in particular to those methods:

Mage_Core_Model_Url_Rewrite::rewrite
Mage_Core_Model_Store::getCurrentUrl

UPDATE

If you are on 1.9.1 @Vinai fix will not work, check the new answer I have added


texts: Magento2 : Set Product limit in Related and Upsell Product

texts:
Hi Everyone i want to set Product Limit in Related and Upsell Product in View page Magento 2.

Any one have idea to set limit.