texts:
Today I saw my Magento database and in a few months, it went from a weight of 300MB to 2GB.
I saw which of the tables was heavier and I saw that there is a 2GB SESSION table.

Why do the sessions are saved in the Database and not in a folder?
Is it possible to clean the table without breaking the website?
Is there any setting I can add to change the save into the DB?

Below an image.


texts: How can I use a custom URL for an Admin Menu Item?

texts:
I made a custom admin menu item in Magento 2 and the menu item is pointing to the Magento2 Pages URL. I want the menu item to point to a custom module URL

Custom module URL is

  http://127.0.0.1/magento/demo/helloworld

Here is the link to all the files and folders of my Custom Module in Magento2

  https://github.com/sneurgaonkar/HelloWorld.git


texts:
I have the code below and I am wondering where to put this code/how to run it then to get a .csv file or .txt file at the end of the day.

$path = Mage::getBaseDir() . DS.'var'.DS ;
$name ='sp1';
$file = $path . DS . $name . '.csv';
$csv = new Varien_File_Csv();
$csvdata = array();

/* set Header  row*/
$headerRow = array(
        'sku',
        'mysku',
);
$csvdata[]=$headerRow;

/* add product data here */

 $productCollection=Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('sku')->addAttributeToFilter('sku', array(
       'like' => 'A%'));

     $productCollection->getSelect();
    $write = Mage::getSingleton("core/resource")->getConnection("core_write");
    $requestPathField = new Zend_Db_Expr($write->quoteIdentifier('sku'));
     $write->getSubstringSql($requestPathField,1);

    echo $productCollection->getSelect()->columns(array('mysku' =>  $write->getSubstringSql($requestPathField,1)));
    foreach($productCollection as $product):
    echo $product->getMysku().'<br/>';
    endforeach;

foreach($productCollection as &$product){
    $csvdata[]=array($product->getSku,$product->getMysku());
}

$csv->saveData($file , $csvdata);

UPDATE

So like this it would write my csv file?
My initial question was still where do I call it (where does this code stand) and where is the output. Will it be in media/export ?


texts:
I updated my website to Magento 2.3.1, and thought everything was working.
However the product detail pages all show a blank page, no errors are shown.

I have enabled error reporting in both bootstrap.php and index.php, magento mode is on developer.

The webpage can be found here:

https://quiltstoffen.nl/quiltstoffen-categorieen/grote-prints/black-multi-cats-purr-fect-together-w-metallic

All other pages work fine, how can I make sure I finally get an error on the page so I can debug it?


texts: How to add another description block outside the tabs in product detail page

texts: I am using Magento 2.2.4. I need to add a block for product detail outside from the main 'Details', 'Review' tabs. I need this block to be separated after the main description of the product. I have started doing this with a custom theme but no idea how to do this. I need to add something like a blog post end of the description of the product with images. How can I do this?


texts:
I know this question has been asked plenty of times before, but from what I've read, no one has ever really got to the bottom of it.

Whilst this excellent post (How best can I structure product configuration for SEO?) finalises when attributes and categories should be used, what I've yet to balance is the implications of using layered navigation from a search engine optimisation perspective.

I've been using an extension from Amasty recently to help out with layered nav, and to be fair, it functions well. However an SEO associate has told me that he's pretty horrified at the number of unique URL's that layered navigation produces. I balanced that off by saying that I can set certain aspects of the layered nav to "No Follow", but he informs me that it makes no difference.

He advised me that really, all layered nav links should include a hash tag, so that search engines will categorically not even look at them. For example -

mysite.com/shoes#shopby/red

There is an extension that I've found that does this, but I'm not convinced. I would assume that if this was the case, everyone would use it, but it's from a pretty unknown developer.

I would be really grateful for any feedback on this.

Thanks


texts: Magento 1.9 How to display subcategory image in top navigation menu

texts: I am new to magento and I need a little help in displaying the image from the subcategory. I have uploaded a image in subcategory from my magento back-end.


texts:
I'm trying to limit the states that show in the dropdown in the store.  I thought that overriding the _initSelect() method in the app/code/core/Mage/Directory/Model/Resource/Region/Collection.php would help do the trick.  Unfortunately, while the change works when applied to the original file, it doesn't work in the override.

Here's the relevant line in my config.xml:

<global>
    <models>
        <directory>
            <rewrite>
                <resource_region_collection>
                    Test_Test_Model_Directory_Resource_Region_Collection
                </resource_region_collection>
            </rewrite>
        </directory>
    </models>
</global>

Here's my version of the file in app/code/local/Test/Test/Model/Directory/Resource/Region/Collection.php:

<?php
class Test_Test_Model_Directory_Resource_Region_Collection extends Mage_Directory_Model_Resource_Region_Collection
{
    protected function _initSelect()
    {
        parent::_initSelect();
        $excludeRegions = array ('AS','AF','AA','AC','AE','AM','AP','FM','GU','MH','MP','PW','VI');
        $this->getSelect()->where('code NOT IN (?)', $excludeRegions);

        return $this;
    }
}

The "Test" module is working for other Magento overrides I have running, but for some reason isn't working for this one in particular.  Any thoughts or suggestions would be awesome, thanks!


texts: How do I add a custom field to the cart in magento 2?

texts:
I am a little new to magento 2 and am looking to add a custom field to the cart to display how many dollars the customer has left to get free shipping. It's basically something like:

<div>

<?php

if ($subtotal >= 50) {
echo "You have free shipping!"
} elseif ($subtotal < 50){
echo "You have " 50 - $subtotal "left until free shipping!"
} else {
echo 'Free Shipping is available on orders $50 or larger!'
}

?>

</div>

I keep getting fatal errors when I try the magento calls for subtotals that I have found and I'm not sure where to put this aside from the minicart.phtml file that I have from my theme, but I feel this may be better as a plugin. Any help would be greatly appreciated!


texts: Using Owebia shipping extension Ceil value up to 10?

texts:
i'm using Owebia shipping extension for calculation shipping method but not work as follow

ceil ($value,10)

it's work when i use ceil()

for example    if i got total shipping charges  60.540 it should be 70  how could i do that ?
currently i'm using

{"pincoders2":{
"label":"StandardShipping",
"conditions":"in_array({shipto.postcode},array(695615,694564))"},
"id_016":{
"label":"ShippingDTDC",
"conditions":"({pincoders2.conditions})",
"fees":"ceil({cart.weight}*(150+150*.15))"}
}

extesion reference : https://www.magentocommerce.com/magento-connect/owebia-shipping-free.html

documentation : https://owebia.com/os2/en/doc


texts: PHP Fatal error - Call to undefined method Magento\\Catalog\\Model\\Product\\Type\\Simple::getConfigurableAttributeCollection()

texts:
When I add a configurable product in Magento CE 2.2.3, I try to add variations. No problems so far. When I return to the product edit screen I see the variations. When I try to save the product I get the following error (changed user and domain).

Got error

PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Magento\\Catalog\\Model\\Product\\Type\\Simple::getConfigurableAttributeCollection() in vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52
Stack trace:
#0 vendor/magento/module-configurable-product/Model/Product/ReadHandler.php(48): Magento\\ConfigurableProduct\\Helper\\Product\\Options\\Loader->load(Object(Magento\\Catalog\\Model\\Product\\Interceptor))
#1 vendor/magento/framework/EntityManager/Operation/Read/ReadExtensions.php(48): Magento\\ConfigurableProduct\\Model\\Product\\ReadHandler->execute(Object(Magento\\Catalog\\Model\\Product\\Interceptor), Array)
#2 vendor/magento/framework/EntityManager/Operation/Read.php(112): Magento\\Framework\\EntityManager\\Operation\\Read\\ReadExtensions->execute(Object(Magento\\Catalog\\Model\\Product\\Interce...',
referer: http://domain.com/admin/catalog/product/edit/id/4670/set/54/type/configurable/store/0/key/3c6931241c19f977a1c6f03ae3207a09140b29c47712291add87d3fcd84df4da/back/edit/

Please help.


texts: How to change logo alone in email templates

texts: Am working in magento1.9.2.3.I just want to change the only the logo in the email transactions. Can it be done through admin panel without touching anything at frontend?


texts: Adding a bunch of skus into a category using sql query

texts:
So I want to run a query that add a bunch of product using SKU number (comma separated) into a specific category ID number 21.

How do i do that? I know how to move them before category using this query. I like to know how to use the comma separated sku in the query, to move them into a category.

INSERT INTO
    catalog_category_product( category_id, product_id, position )
    (
        SELECT 652 , product_id, position
        FROM catalog_category_product
        WHERE category_id IN ( 650 )
    )
ON DUPLICATE KEY UPDATE category_id = 652

Any help would be appreciate it.


texts: How to get modules list inside particular namespace

texts: I am trying to get all the modules names inside the particular Namespace


texts:
So i was making a mass action for orders and i was searching for what this:

<item name="type" xsi:type="string">delete_order</item>

line of xml does and what its used for in the

/view/adminhtml/ui_components/sales_order_grid.xml

The whole file looks like this:

<massaction name="listing_massaction">
    <action name="new_action">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="type" xsi:type="string">delete_order</item>
                <item name="label" xsi:type="string" translate="true">Delete Orders</item>
                <item name="url" xsi:type="url" path="{vendor}_{module}/order/DeleteOrder"/>
            </item>
        </argument>
    </action>
</massaction>

So can someone explain to what it does?


texts: Magento 2 how to listen to event fotorama fullscreenenter

texts:
I am not able to listen to event  fotorama:fullscreenenter what I've tried:

<script type="text/javascript">
    require(['jquery', 'mage/gallery/gallery'], function($, gallery){
        $('[data-gallery-role=gallery-placeholder]').on('gallery:loaded', function () {
            console.log('this works!')
            $(this).on('fotorama:ready', function(){
                console.log('this also works!');
            });
            $(this).on('fotorama:fullscreenenter', function(){
                console.log('THIS DOESN\'T WORK!')
            });
        });
        $('[data-gallery-role="gallery"]').on('fotorama:fullscreenenter', function() {
            console.log('THIS ALSO DOESN\'T WORK!'); //Taken from ../magento2-base/lib/web/mage/gallery/gallery.js lines #184, #191
        });
        $(this).on('gallery:fullscreenenter', function () {
           console.log('ALSO DOESN\T WORK!');
        })
    });
</script>


texts:
can anybody tell me, how to add cusom javascript code to template in magento2 ?

I add to view/frontend/layout/default_head_blocks.xml

<script src_type="url" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" />

and its work.

But when I add

<script>alert('test');</script>

its not work.

All in one:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Vie$
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <css src="mage/calendar.css"/>
        <script src="requirejs/require.js"/>
        <script src_type="url" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" />
        <script>alert('test');</script>
    </head>
    <body>
        <referenceContainer name="after.body.start">
            <block class="Magento\Framework\View\Element\Js\Components" name="head.components" as="components" templ$
        </referenceContainer>
    </body>
</page>

How to do this?


texts: Magento 2: How to set default layout to 1column

texts:
I have no idea where to set the default layout in creating a page in the backend where I want it to set the layout to "1 Column" instead of the default value "Empty".

Anyone have the idea?


texts:
I am using Magento 2.3.3

I try to translate "Created at" text to my own languge but I could not.

I changed the

"Created At","Oluşturulduğu Tarih",module,Magento_Checkout
"Created At","Oluşturulduğu Tarih",module,Magento_AdvancedCheckout
"Created At","Oluşturulduğu Tarih",module,Magento_Sales
"Created At","Oluşturulduğu Tarih",module,Magento_Braintree

but nothing change on checkout page yet


texts: CustomerSession -How is the getNoReferer() method assigned value?

texts:
Class \Magento\Customer\Model\Url - Line 122
I can't find the place that system sets value for getNoReferer() method.
Please show me how the system sets its value.
Thanks.


texts: Magento 2: Need to override loadAttributeOptions()

texts:
I need to override this function loadAttributeOptions() in my custom module.

File - /var/www/html/dg/vendor/magento/module-sales-rule/Model/Rule/Condition/Product/Subselect.php


texts:
I had exported customer from local machine and i am importing on server. When i tried to import on server it gives me an error saying "Sorry, but the data is invalid or the file is not uploaded."

I have not changed anything on in the csv file, both database of live and local are same, only on local i have new customers.


texts: Magento2 - Insert category image inside catalog product list

texts: I want to add category Image inside Catalog Product List. How to add ?


texts: Static block category pages with form causing page load issues

texts:
I'm not even sure how to word this.

I have a category pointing to a static block. Within the static block I have my content which includes a contact form:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

Every-time I load one of these pages the form is acting as an anchor link and I'm brought directly to the form, skipping any content above it.

Any idea what could be causing it?


texts: Magento 1x: What happens if two modules from different vendors customize a single template?

texts:
How magento handles conflicts?
What if I install two separate modules from different vendors where both of them customize a single template, let's say checkout/succes.phtml?
I am expecting answers for magento 1.9.2.4


texts: How update or delete PDF file (link) of downloadable product programmatically

texts:
In Magento 2, how can I update the PDF file of a download product so that old links refers to the new PDF?

I think there are 2 ways to try that:

I can load every links (in this case THE link) of the product and delete them
and set the new one. I think it will not be a problem for purchased links in the past because the link interfaces refer to the product sku by this save function:

$link_repository->save($sku, $link_interface);

The product will not be deleted and will conserve its old sku, so the links will be actualized with a new one (right...?).
I can try to change the base64 encoded content of the Link used to set the Link to the product:

$content_interface->setFileData($b64pdf);

Any idea?


texts: Free shipping shopping cart rule and discount coupon

texts:
We need to be able to offer free shipping via shopping cart price rule to all orders above 100 dollars. We also need to be able to have a discount coupon that gives certain amount of discount on the whole order.

Now, the problem is that Magento gives free shipping even if the discount coupon reduces the order sum below the 100 dollar limit we have set. So now we give a free shipping orders below 100 dollars.

We also have to use the shopping cart price rule, because we have a shipping methods via extensions that integrate to carriers system. So we can't use the Magento's free shipping method. We also need to specify the shipping methods that can have a free shipping.

So is there any way we could get Magento to apply the discount before it calculates if the free shipping limit is reached?


texts: How to make this API: /rest/default/V1/carts/mine/shipping-information to return email field

texts:
My question is simple:

I wish to fetch the shipping email field by calling:
/rest/default/V1/carts/mine/shipping-information

Is it possible by changing some codes?

I searched through the whole StackExchange / Google for any possible clue / source code. Tested mostly I could but all of them renders no response. Is it that hard to just add a single new column / field into the database for use? Can Magento 2 recognize a certain new column & load the data into the model objects if I just simply insert the column with MySQL Softwares like Sequel Pro?

I wrote:

namespace SR\CheckoutAdditionalField\Setup;

use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class InstallSchema implements InstallSchemaInterface
{

    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $connection = $setup->getConnection();

        $column = [
            'type' => Table::TYPE_TEXT,
            'length' => 255,
            'nullable' => false,
            'comment' => 'Shipping Email',
            'default' => '0'
        ];
        $connection->addColumn($setup->getTable('sales_order'), 'shipping_email', $column);
    }
}

But nothing happened. Nothing new has been added into "sales_order" table.


texts: How to get subtotal from order items collection in magento 1.9.2 community edition

texts:
I am trying to show order details on frontend just like backend

Here is my code

$orderData = Mage::getSingleton('sales/order')->loadByIncrementId($incrementId);
$itemCollection = $orderData->getItemsCollection();

foreach($itemsCollection as $_items) {
    echo $_items->getName();
    echo $_items->getStatus();
    echo $_items->getOriginalPrice();
    echo $_items->getPrice();
    echo $_items->getQtyOrdered();
    echo $_items->getSubTotal();
    echo $_items->getTaxAmount();
    echo $_items->getPercent();
    echo $_items->getDiscountAmount();
    echo $_items->getRowTotal();
}

Apart from Subtotal I am getting Everything I tried this too:

echo $_items->getBaseSubtotal();

But I am still getting null value.
Any help will be appreciable


texts: How to update a cart after adding a product to the cart using an observer?

texts: How to update a cart after adding a product to the cart using an observer ?


texts: How to change the URL of the Magento 2 store when Filter is applied. When I apply any Filter the URL looks like https://jpm2.mydemoweblink.com/watches/alpina?jpf_gender=6780 where I want to change the URL to https://jpm2.mydemoweblink.com/watches/alpina/jpf_gender/6780 just want to add " / " in place of " ? " and " = "... How can I sort this issue? Thanks


texts: I am using magento 1.9.2.2 version. I want to add content from custom module before footer (after all page content) without change any core file and theme files ( .phtml ) .


texts: How to send "HelloWorld" Email in magento2 via Controller?

texts: I want to send the email to customer, please help me out with simple helloworld Program!!! Like Forget password Link


texts: What are the footprints a magento module can leave in the magento system?

texts:
I installed a module/extension but it does not work well for our needs.

I want to completely delete the module with all its footprints.

I removed the following:

code pool - deleted the folder related to that module under community folder,
deleted design files at design/frontend and design/adminhtml,
deleted email template files of that module at locale//template/email/,
deleted Namespace_ModuleName.xml at etc/modules folder,
removed configuration variable values of that module at core_config_data table,
deleted module entry at core_resource table,
deleted all tables created by that module by looking sql file of the module

what else I need to remove to uninstall the module completely

  Am I doing correct or is there any other standard way to uninstall
  magento extentsion ?


texts: Comment History in Sales Order Admin view

texts:
When I review the Sales order it show specific steps in the processing of the order.  There are specific comments about the transactions that occurred during the processing of the order.
I like to be able to use them to display the transaction information on the customer Invoice or Sales Order confirmation.

I just not sure where this data is stored and how to retrieve it so it sill show on the Sales Order Invoice Confirmation?

Mar 28, 2017 2:25:46 PM|Processing
Customer  Notification Not Applicable
Captured amount of $15.49 online. Transaction ID: "40038692970-capture". .

Mar 28, 2017 2:25:46 PM|Processing
Customer  Not Notified
Amount of $15.49 approved by payment gateway. Transaction ID: "40038692970". .

Mar 28, 2017 2:25:46 PM|Processing
Customer  Not Notified
This transaction has been approved. .

I have example above.


texts: magento2 category filter in product grid

texts:
I need to add a category filter in the product grid.
My grid is made by the renderer.
Following is the code I have added for price & name
 $this->addColumn(
            'name',
            [
                'header'   => __('Name'),
                'index'    => 'name',
                'type'     => 'text',
                'sortable' => true
            ]
        );

        $this->addColumn(
            'price',
            [
                'header'           => __('Price'),
                'column_css_class' => 'price',
                'type'             => 'currency',
                'currency_code'    => $this->_storeManager->getStore()->getBaseCurrencyCode(),
                'index'            => 'price',
                'renderer'         => Price::class
            ]
        );

Can someone guide me on how to do the same for the category?


texts:
Please take a look at screen shot of table catalog_product_entity_varchar below.

The attribute_id '71' is the ID for attribute name. I have 2 stores.
For both stores the product have same name value i.e. 'SURGICAL STEEL DOUBLE JEWELED NAVEL BANANA'. Please see screen shots below.

Default Store

Store 1(this is the default store)

Store 2

Is this some kind of bug or am I missing something?

EDIT:

I checked it is happening for other products also and this a grouped products for incorrect values are saved.

'BNDJ' is the SKU of the grouped product.


texts: Can't enable Magento Frontend to run in frame

texts:
I'm having problems trying to display a Magento website on an iframe in another domain.
Through the Admin Panel, I've already enabled the 'Allow Magento Frontend to run in frame'.

But when I try to open the webpage with the frame, it just doesn't load, also giving this console error in Chrome's Developer Tools:

Refused to display {{my test domain}}' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

When I open the actual Magento website, I've also noticed that X-Frame-Options is still set to SAMEORIGIN.

I'm not sure where else to look to solve this, I'd appreciate any pointers or ideas!
Thanks!


texts: Get the Price,Value and Quality rating values in Magento

texts:
I want to get the  Price,Value and Quality rating values.For that i use review code but didn't get the specified values.

$reviewcollection = Mage::getModel('review/review')
                ->getResourceCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addFieldToFilter('customer_id','4')
                ->addRateVotes();
print_r($reviewcollection);

I can use product id and customer id for this code.
How can i get the rating like price -> 4,Value->5 etc.Thanks
I am asking about the three fields (Quality,Price and Value) during review submission.


texts: How to make some products shippable only to one city at checkout page

texts:
I need some products like x, y, z shippable to only one city(A) at the checkout page. Based on the selected shipping address how can I disable shipping those products(x, y, z) to all other cities except the specific city(A)?

Thanks in advance.


texts: Not sure if this correct place to ask this question. I am currently building my site on my local pc (Windows 10). My site is currently working on localhost using XAMPP. My issue is folder overwriting. My theme package needs to be updated to the current site. The folders in the updated theme is the same as the folders in the htdocs folder on xampp. When I try and copy and paste the folder (app) to overwrite the existing folder (app) it makes a copy of that folder, making it a subfolder with the same name (app). I cannot figure a way to just overwrite the existing folders. There are many folders and subfolders that need to be replaced. Is there not an option, software, etc that will let me replace these folders. For my sites hosted on my servers I can use Cuteftp and/or Filezilla to upload the folders and they overwrite as needed. Surely there has to be a simple way. In the past for a small folder I just copy and paste the files within each folder and overwrite them that way. However this is a bit many to do. Thanks in advance for any assistance.


texts: Magento 2 bin/magento not working as it should

texts:
I've just installed a fresh copy of Magento 2.1.2 from composer. I've previously installed Magento 2 in a different directory completely fine and the commands all run as they should. This has only happened since I installed a new repo to a different directory that the CLI for Magento started to not work.

I'm running Magento 2 with the following:

PHP 7.0.10
MySQL 5.6
Mac OS
MAMP Pro 4
Apache

I've tried:
Setting the correct permission
setting bin/magento file and folder to chmod executable.
chown to my_username:admmin

I have php setup perfectly fine in system $PATH. I've also noticed n98 does the same no errors/output just goes to a new line in the terminal.

If i run composer loads fine, if I run php -v loads php7 fine

I've been trying to fix this now for hours with no luck.


texts: How to redirect on specific product page in magento2

texts:
I want to redirect on specific product page when i click on detail view link.

For ex. :- In grid , I click on first product detail. After I want to redirect on that specific product view page.

How to do it..?

In this image d1 is product sku . I want to do it when I clicked on view then it will redirect on d1 product view page .


texts: How to increase/decrease space in thumbnail images on Product Page (catalog-product-view) Magento

texts: I am trying to increase/decrease spacing of thumbnail images on (Product Detail Page) but didn't get any proper solution. Please let me know if there is any option available in magento 2.


texts: How to properly create and customize a Magento 2.1 theme?

texts:
I want to create a new theme in magento and customize the html and css as I need.

I successfully created a new theme as per magento dev docs.

Now I need to customize, so that if someone gives me a design I should be able to convert it to a Magento theme.

I tried to start customizing the navigation bar. For navigation, the template file is topmenu.phtml located in root/vendor/magento/module-theme so I created a new folder Magento_Theme in my theme's directory app/design/frontend/<V>/<T>/Magento_Theme and in the templates/html directory I copied and pasted topmenu.phtml.
But to my amusement, I found nothing there, everything is getting from block, even the html:

<?php $columnsLimit = $block->getColumnsLimit() ?: 0; ?>
<?php $_menu = $block->getHtml('level-top', 'submenu', $columnsLimit) ?>

<nav class="navigation" data-action="navigation">
    <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
        <?php /* @escapeNotVerified */ echo $_menu; ?>
        <?php /* @escapeNotVerified */ echo $block->getChildHtml(); ?>
    </ul>
</nav>

I am stuck here - how to customize it?

Can anyone who has experience in developing Magento 2.1 themes guide me how to customize pages? I just started with navigation and got stuck here. I am only able to change the CSS, not the HTML.

I want to change sidebars, catalog products, navigation and all.

Any guidance is appreciated. Please.


texts:
I want to custom a design for some catalog products who have a specific attribute.

i added an attribute to edit tab products in admin, i get a collection by the attribute filter. now i want when the product has the attribute, i apply some design or add some class on it.

My collection:

<?php $collection = Mage::getModel('catalog/product')->getCollection()
                                    ->addAttributeToSelect('name')
                                    ->addAttributeToFilter('status', 1)
                                    ->addAttributeToFilter('promo', 1)
                                    ->setPageSize(10);
?>

<?php foreach($collection as $col): ?>
<?php echo $col->getSku(); ?>
<?php endforeach; ?>

I found a solution as simple width a help of Piyush , i add a myCustomclass in class product if i get the attribute

The default div

//Product

the add class

<div class="row item border-items-list <?php if ($col->getSdPromotionSogge()){echo 'promo-design';}?> ">
//Product


texts: How to instantiate my new class and methods

texts:
I'm looking to trigger anything on a /admin/customer/edit just to know it's working.. an echo or print.. I have this code below.

app/code/community/YourModule/etc/config.xml

<global>
<events>
    <customer_address_save_before>
        <observers>
            <yourmodule>
                <type>singleton</type>
                <class>yourmodule/observer</class>
                <method>customer_address_save_before</method>
            </yourmodule>
        </observers>
    </customer_address_save_before>

    <customer_address_save_after>
        <observers>
            <yourmodule>
                <type>singleton</type>
                <class>yourmodule/observer</class>
                <method>customer_address_save_after</method>
            </yourmodule>
        </observers>
    </customer_address_save_after>

    <catalog_product_save_before>
        <observers>
            <yourmodule>
                <type>singleton</type>
                <class>yourmodule/observer</class>
                <method>catalog_product_save_before</method>
            </yourmodule>
        </observers>
    </catalog_product_save_before>

    <catalog_product_save_after>
        <observers>
            <yourmodule>
                <type>singleton</type>
                <class>yourmodule/observer</class>
                <method>catalog_product_save_after</method>
            </yourmodule>
        </observers>
    </catalog_product_save_after>
</events>

My Observer:

app/code/community/YourModule/

class YourNamespace_YourModule_Model_Observer
{
    public function customer_address_save_before($observer)
    {
        $address = $observer->getCustomerAddress();
        //echo "<pre>"; print_r($address->getData()); exit;
        // do something here
    }

    public function customer_address_save_after($observer)
    {
        $address = $observer->getCustomerAddress();
        //echo "<pre>"; print_r($address->getData()); exit;
        // do something here
    }

    public function catalog_product_save_before($observer)
    {
        $product = $observer->getProduct();
        //echo "<pre>"; print_r($product->getData()); exit;
        // do something here
    }

    public function catalog_product_save_after($observer)
    {
        $product = $observer->getProduct();
        //echo "<pre>"; print_r($product->getData()); exit;
        // do something here
    }
}

Now in admin how would i get it to echo something on /admin/customer/edit or any page for that matter if an address is updated.

I'd assume something like so:

  $t = Mage::getModel('yourmodule/observer');

Mage::getSingleton??


texts: Magento2: Add login form in checkout page

texts:
Please help, I'm still new in learning magento 2 and I want to ask how to add login form on checkout page ?

I opened checkout_index_index.xml and onepage.phtml, it's very confused because it's very different with magento 1 and also I still not understand about knockout.js

Regards


texts: How to avoid repeated static-content-deploy & cache-clean for every UI level change in Magento 2?

texts:
Every time I change a bit of js, html or css, I end up cleaning cache, upgrade & reset permissions. Any solution to avoid all these things ?

PS:
Cache is disabled &
Developer mode is ON


texts:
I need some help moving some edits I made to the core files to my own module. I was able to do this easy enough with my frontend edits but I am unsure how to fully move my core file edits.

I edited files in paypal and shipping including the layout under configuration. I had to add some fields to these forms and how they processed the new fields. I remember all my edits but before I make too many to move them back can someone please help me with the appropriate file structure/location.

I am assuming moving the core edits will be as easy as moving the frontend edits but if I am wrong please be kind. I am still learning the structures for magento. Thanks!


texts: Plugin in the checkout page doesn't works until i refresh the page

texts:
So i'm using Magento 2.3 and i'm creating a Plugin to execute After Save Addres Information, that should execute when this button were clicked:
So, actually it works, but not at all, it redirects to the next page**(Review & Payments)** but the information that i'm updating with the plugin doesn't updates, it just updates when i refresh the page.

di.xml

<type name="Magento\Checkout\Model\ShippingInformationManagement">
      <plugin name="get_shipping_info"
type="Mageplaza\Pontos\Plugin\Checkout\Model\ShippingInformationManagement" sortOrder="1"/>
</type>

Am i using the correct Plugin? should i use an Observer ?


texts: Description attribute in Flat Catalog Table

texts:
I am using flat catalogs.

I see that by default description product attribute is not in catalog_product_flat_* tables.

Although short_description is.

Why?

If I set description to 'Used in Product Listing' i.e. deliberately put it in flat tables would it affect my site performance or its functioning in any way?

I don't think so but I just want a confirmation from experts.


texts: How to add custom option "input-box" for particular attribute set in Magento1.9?

texts: Am having one category called Cakes in my website. I have added custom option for each one product separately, but I want add that custom option for all commonly for all cake products in simple and configurable. Is it possible?


texts: Can you guys suggest me any good FREE product review system? The functionality should include commenting on the reviews by customers, Something like 'Disqus'.


texts:
I am trying to get discount amount, but no success

How to get discount amount from $block->getShipment()

<?php
 /** @var $_item \Magento\Sales\Model\Order\Item */

 $_item = $block->getItem();

 $_item->getDiscountAmount() // this gives me nothing , null

 ?>

How to get the discount amount. and there is a discount on that order.


texts: How to add a full-width block above the content

texts:
How can you add dynamic content above the CMS content?

I am currently trying to implement a full width banner slider above the content. The slider must be different on different pages so I need to be able to pass a variable, preferably through the xml because it needs to differ from each page and I cant use a template file eg: 3colums.phtml because it will use the same slider on multiple different pages.

I have attached an image below of what I want to achieve.

This is the code:

XML

<reference name="content">
    <block type="bannerslider/bannerslider" name="bannerslider" template="bannerslider/bannerslider.phtml">
        <action method="setCategoryId"><category_id>2</category_id></action>
    </block>
</reference>

PHP

echo $this->getLayout()->createBlock('bannerslider/bannerslider')
    ->setCategoryId('1')
    ->setTemplate('bannerslider/bannerslider.phtml')
    ->toHtml()


texts:
does anyone have any experience with blue/green deployment strategies using magento?

My basic idea is to have 2 installs (blue & green) with separate databases, and in addition an extra database to store users, orders, sessions etc... anything that needs to stay up to date regardless of whether blue or green is live. Then I can flip between blue and green without my customers or orders regressing.

I found some basic information here: how to connect another database from magento about connecting a model in magento to a different database, I guess my questions are:

1) Is this setup feasible at all? and if it is then....

2) What models would I need to point at the shared database?

edit: this was put on hold for being opinion based.... however, I'm asking 2 specific questions.  Will this setup work, ie: is there any technical reason (ie: database joins) that it won't work and, to make it work which models would I have to point at the shared database ie: what models does the customer model rely on, what models do I need to move over so that the orders model has everything it needs and so on.


texts: What are the "source" Items in UI Component Files

texts:
In Magento 2's UI Form Component configuration files, you'll often see a item attribute with the same of source -- <item name="source" xsi:type="string">block</item> below.

#File: vendor/magento/module-cms/view/adminhtml/ui_component/cms_block_form.xml
<field name="title">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Block Title</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">block</item>
            <item name="sortOrder" xsi:type="number">20</item>
            <item name="dataScope" xsi:type="string">title</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

What are these fields for?  I ask because it seems like they're not necessary.  For example, the module in this GitHub repository configures a working UI Component form, but doesn't use these name="source" items.

Does anyone know what these name="source" items are for?  I'm aware of the UI Component mechanic that takes the XML and cofigures it as x-magento-init JSON

"block_id": {
    "type": "form.input",
    "name": "block_id",
    "dataScope": "block_id",
    "config": {
        "component": "Magento_Ui\/js\/form\/element\/abstract",
        "template": "ui\/form\/field",
        "visible": false,
        "dataType": "text",
        "formElement": "input",
        "source": "block"
    }
},

Which is fed into a uiElement based Knockout view model object.  However, it's not clear how the nested tree of uiElement based Knockout view model objects use these field level source fields.

If I look at the uiElement's initModules method

    initModules: function () {
        _.each(this.modules, function (name, property) {
            if (name) {
                this[property] = this.requestModule(name);
            }
        }, this);

        if (!_.isFunction(this.source)) {
            this.source = registry.get(this.provider);
        }

        return this;
    },

I see the object references a source property, and if its not set, will reach into the registry for an object using the provider property as a string/key identifier.  It seems like the value of these source items isn't used.  However, its possible that they're used by the PHP code, or some other javascript code.  Hence, my question.


texts: How do I get the prices from grouped products' s children?

texts:
this is my code, but I don't know how to continue this :

$id = Mage::registry('current_product')->getId(); //grouped product id

$product = Mage::getModel('catalog/product')->load($id);


texts: Shopping Cart Price Rules & Discount Coupons Not Working On 1.9.2.2

texts:
We are facing a strange issue.

We have set up a sitewide discount rule for one week. The shopping cart pricing rule does not require any coupon code & is available for guests & logged-in users.

The rule is not getting applied on the cart and discount row does not show up.

Coupon: No Coupon
uses per customer: 99
From date: 5/24/2018
To date: 5/31/2018
Priority: 0
Condition: If all of these conditions are TRUE (default)
Percent of product price
Discount: 10
Max Qty: 99
Free Shipping: No
Stop further rules: No

Even if use coupon & apply that coupon as below - it says coupon applied, but discount row does not show up.

Coupon: May2018
uses per customer: 99
From date: 5/24/2018
To date: 5/31/2018
Priority: 0
Condition: If all of these conditions are TRUE (default)
Percent of product price
Discount: 10
Max Qty: 99
Free Shipping: No
Stop further rules: No

This means sitewide discount or coupons are not getting attached when they should be valid. Invalid coupons continue to give Invalid coupon error

Nothing was updated on the site.
Any pointers would be a great help. Thank you


texts:
I'm using Magento 2.1 I've created my own theme called 'MP/basic', which is based on Luma.
I created the theme.xml, registration.php, the web folder with everything I need inside it.
I can choose that new theme in Admin panel and it appears correctly with my logo on the frontend.

I'm trying to remove the catalog.compare.link block in top.links and other stuff.

The layout for this block seems to be defined in

/vendor/magento/module-catalog/view/frontend/layout/default.xml

I tried to add

<referenceBlock name="catalog.compare.link" remove="true" />

And it works as expected, but I'm not supposed to change vendor files. So I'm looking for the correct folder in which to create my own default.xml file to place the new code:
For now I have default.xml, and I modified catalog_product_view.xml in wich I wrote :

<page layout="1column" 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.sku" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="product.info.mailto" remove="true" />
</body>
</page>

I've looked everywhere in the documentation and online but cannot find the correct information on this subject. I've read all other question on magento.stackexchange without success.

. I've tried several locations, including the one where my theme is defined :

/app/design/frontend/MP/basics/Magento_Catalog/layout/default.xml
OR
/app/design/frontend/MP/basics/Magento_Catalog/page_layout/override/default.xml
OR
/app/design/frontend/MP/basics/Magento_Catalog/layout/override/default.xml
OR
/app/design/frontend/MP/basics/Magento_Catalog/layout/override/base/default.xml

and several other locations.

After each attempt, I cleaned/flushed the cache,deleted pub/static/, and var/view_processed/  redeployed static content, and did a  php bin/magento setup:upgrade, without luck. The new default.xml or catalog_product_view.xml is not displayed, as it is when I modify directly luma's files.

I'm in developper mode, but it's not working in production.
I'm using redis for the cache and I see in the console everything is flushed correctly.

Please can someone tell me what i'm doing wrong, or the good way to go (it is driving me crazy)

Thanks a lot,
WM


texts: Which is better Magento or a php custom build?

texts:
Am planing to run a business and i have two option to choose between Magento or Php custom build (both of them will have the same functionality) so am considering about STABILITY and about SECURITY.
impatiently waiting for your advice.


texts: How to Create a excel file in custom module?

texts:
I want to create an excel format file for download in Magento 2

<item name="buttons" xsi:type="array">
        <item name="add" xsi:type="array">
            <item name="name" xsi:type="string">add</item>
            <item name="label" xsi:type="string" translate="true">Add a new Guest</item>
            <item name="class" xsi:type="string">primary</item>
            <item name="url" xsi:type="string">*/*/newAction</item>
        </item>

        <item name="xml" xsi:type="array">
            <item name="name" xsi:type="string">xml</item>
            <item name="label" xsi:type="string" translate="true">Excel Download</item>

            <item name="url" xsi:type="string">*/export/gridToXls</item>
        </item>
    </item>

I have the skeleton for my GridToXls action here:

class GridToXls extends Action
 {

  public function execute(){
    //do
   }
 }

  How do I create and prepare the excel file for download in a Magento 2
  custom module?


texts:
In Magento 2.2.3, I am using the following for loop to get the product image. When I print that image url, it takes the previous product's URL actually it doesnt have the URL.

 $products = $this->getCollection ();
    foreach ( $products as $product ) {

        $preImageUrl = $product->getImage ();
}


texts: How do I determine why Sitemap isn't being generated?

texts:
I have a mostly vanilla instance of Magento 2.1 (previously Magento 2.0.x - where the problem also existed).

I have setup the Sitemap file to generate - and it is not doing so.

So far, for debugging purposes, I've modified Observer.php in the vendor directory to var_dump some variables while running to ensure that the cronjob is running, that it's picking up the email to send errors to, and to dump the errors so they'll show up in the log.

I have verified that it is running, however even with a custom entry into the errors array, the error email is not being sent.  No other exceptions are being logged.

The deploy mode is set to production, no sitemap.xml file is being generated - what else should I do to determine the cause of the lack of a sitemap file?


texts: Possible to change backend_type of multiselect from varchar to text?

texts: We have a very large multiselect with over 1200 options.  If more than a certain number are selected (around 70, give or take the id numbers length), no more additional attribute options can be selected.  The quick answer to this would be to change the backend_type for multiselect to text from varchar.  Is this possible?


texts: Show the second image of the product in the description area

texts:
I have this code to display the product image in the description area of a product

<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>

    <?php
        $_img = 'helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
        echo $_helper->productAttribute($_product, $_img, 'image');
    ?>

What i want to do is to create an if statement that show the second image of the product as the first option, and if there is no second image in that product it should show the first default image, anyone might know how i can do that?


texts:
I have this customer who sells large Antique items, they are tough to ship especially for international orders, he wants to calculate shipping only at the point when someone orders as it is almost custom price based on item and destination.

We are using Community edition 1.7 is the version.

Can we delay the order, say in some state and email him a shipping estimate, if the customer is ok with it, we confirm the order and ship, customer should be allowed to pay at this point.

Any pointers are greatly appreciated

Note: This is on hold, any ideas on what other detail can help add clarity would help me add the same, please write some comments


texts: How to redirect to custom/website maintenance page when hit an error?

texts: How to make the redirection to custom page or other website's Maintenance Page when my Magento reports an error? Instead of showing the debug page no matter in which mode my website is.


texts: page speed insight Pre-load key request for fontawesome

texts:
On my magento 2 store, Google pagespeed insight showing below fonts in preload key request.
How to get rid of this issue.

CSS for font awesome is.
src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');


texts: I am trying to override sign in and register link in magento 2. can any one please help me on this.


texts: I am using posting new sliders on my home page through Responisive banner slider. but they are not showing up there. I did the process of posting as always,but today dont know what is wrong with it. Any ideas.


texts: Why does magento register at checkout not working sometimes? How to Auto login already registered customers?

texts:
In my magento website, "Guest Checkout" is disabled. People need to register while they checkout. This works fine, as it is a default behaviour. But sometimes, people who register are not really registered, but considered as Guest.
This happens randomly. I don't have any idea what is going wrong. Can anyone help please?
note:

The website uses the default onepage checkout with minor modifications only in templates (jQuery additions for some attractive UI).

the output of running SELECT * FROM customer_group is:

running SELECT * FROM core_config_data WHERE path = 'customer/create_account/default_group'
returned empty set.


texts:
here I am again seeking for help. I've been stuck for 2 days working about this. when I'm working on localhost my website is working.

Well, after migration from localhost to my web server it gives me this kind of look:

All my work and products are gone.

What I just see is this mess can anyone help me to solve this problem please.

Thanks a lot in advance.


texts:
I can not make my magento reindexing it gives me this error:

X-Powered-By: PHP/4.4.9
Content-type: text/html

Parse error:  syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/Darlin/www/shell/indexer.php on line 43

I connect in SSH via the terminal utility (mac)


texts: How to create custom dropdown attribute for customer in magento

texts:
I want to create a custom dropdown attribute for magento customer account.

For this I have used $installer script but it is not working for me. My script as below :

<?php
$installer = $this;
$installer->startSetup();

$installer->addAttribute("customer", "track_device",  array(
    "label"    => "Customer Device",
    'input' => 'select',
    'type'  => 'int',
    'required' => 0,
    'user_defined' => 0,
    'source' => 'eav/entity_attribute_source_table',
    'option' => array('values' => array('Web', 'App'))

));

$attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "track_device");

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100)
        ;
$attribute->save();

$installer->endSetup();
?>

Is anything missing or wrong in this script?

Is any another method to create custom dropdown attribute in customer account in magento?


texts: Sanitizing with mysqli::real_escape_string in Magento

texts:
I need to perform direct database operations(insert/update). In order to sanitize the insert values with mysqli::real_escape_string I need a current charset of the connection.

For database updates I am going to use Mage::getSingleton('core/resource'); object.

Is it possible to acces sanitization function on this object or in any other way?

If not is it at least possible to get charset of the connection so that I can set it on mysql_real_escape_string function?

Thanks.


texts: How to add a product image programatically in Magento 2.1

texts:
I had a problem adding a product image programatically. Here's the code I used:

$product->setImage('/test.jpg')
    ->setSmallImage('/test.jpg')
    ->setThumbnail('/test.jpg')
    ->addImageToMediaGallery('/test.jpg', array('image','thumbnail','small_image'), false, false);

$product = $productRepository->save($product);

When run, it throws this error:

Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'There is no MediaGalleryEntryConverter for given type' in vendor/magento/module-catalog/Model/Product/Attribute/Backend/Media/EntryConverterPool.php:48

when I save product and try to update like this link: $product->save();

Throws this error:

Fatal error:Uncaught InvalidArgumentException: Required parameter 'theme_dir' was not passed in .../vendor/magento/framework/View/Design/Fallback/Rule/Simple.php:61

Any ideas ?


texts: Catalog price rules (discounts) disables automatically

texts:
I have an issue with the Catalog price rules.

When I enable them, it works fine, but after few day's they desactivate automatically.

I tryed this solution:
http://creatingawebstore.com/how-to-setup-magento-cron-jobs-demonstrated-on-cpanel.html

But it didn't help...

Anyone has a clue why this is happening?

The configuration of the price rule is set to be active for a Year.

Thanks guys,


texts: HTML HEAD " Default title" is not updating in magento

texts:
please visit this link: http://schoolboards4.newtrendzonline.com/

on "browser tab" or in header text you can see text "Galarainbow- magento theme homapage"

but in SYSTEM > CONFIGURATION > DESIGN > HTML HEAD, I changed Default title to "Display products"

but it's not displaying.

please help me to find solution.

thanks in advance.


texts: Join table to get the detail of customer, customer ordered item, and the item product

texts:
i'm following this tutorial to create the grid for custom report, and to get the collection there's a function which accept the from date and to date like this:

public function setDateRange($from, $to) {
       $this->_reset();
       $this->getSelect()
            ->joinInner(array(
                'i' => $this->getTable('sales/order_item')),
                'i.order_id = main_table.entity_id'
                )
            ->where('i.parent_item_id is null')
            ->where("i.created_at BETWEEN '".$from."' AND '".$to."'")
            ->where('main_table.state = \'complete\'')
            ->columns(array('ordered_qty' => 'count(distinct `main_table`.`entity_id`)'));
      //  uncomment next line to get the query log:
      //  Mage::log('SQL: '.$this->getSelect()->__toString(),null,'query.log');
       return $this;
   }

the problem is i need to create a custom collection, to load the customer data, including the product item data which customer already ordered like this:


texts: Magento change product details in packing slip printing

texts:
I need to change the product details of magento packing slip currently they are showing as follows

but I need to display as below to reduce the space taken for one product

Which file should I look for doing this I have looked at

app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php

and

app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php

but no luck :(


texts:
I justed wanted to know if anyone has tried out the new package manager Yarn which claims to be faster and most secure than NPM, in their Magento2 projects.

If so is, there any known issues I should be aware of? (Compatibility vice)


texts: Import products with store-view attribute scope

texts:
Is it possible to use the standard Import functionality (not Dataflow Profiles) to update product information on the store-view level without having to include all other store-views in the import?

For example, if I import the following CSV:

sku,_store,description
12345,storeA,Test description

It will overwrite the description field for both the default and storeA store views. In this case I only want to update the storeA store view attributes.


texts: magento 2 namespace ending with reserved keyword

texts:
How to overcome this ? This is my class path: app/code/vendor/module/Block/Catalog/Product/List/Toolbar.php

namespace vendor\module\Block\Catalog\Product\List;

class Toolbar
{...}

How to overcome this ? This is my class path: app/code/vendor/module/Block/Catalog/Product/List/Toolbar.php

in my Toolbar.php

namespace vendor\module\Block\Catalog\Product\List;

class Toolbar
{...}
Since the namespace cannot end with a reserved keyword "List", im unabel to use it that way. It throws : syntax error, unexpected 'List' (T_LIST), expecting identifier (T_STRING)

How to use that the same in Magento 2


texts:
I built a module that has a custom Model and database table it includes an admin backend model manager which allows me to export the data to a CSV/Excel file.

What is the best way to go ahead and add the feature of importing data from a CSV file.


texts: Сould not record the request result in the file ( using curl )

texts:
I am trying to get the file from a 3-d party server using \Magento\Framework\HTTP\Adapter\Curl in my model. My aim is to record this file in the file on my server inside magento. The thing is the request passes successfully, I am getting the reply, but the file is created blank (zero byte file) and nothing is recorded in it. Here is the example of my code:

/**
 * @var \Magento\Framework\Filesystem\Directory\Write
 * @var \Magento\Framework\HTTP\Adapter\Curl
 * @var string $destination
 * @var string $source
*/
$newFile = $this->_directory->getDriver()->fileOpen($destination, "wb");
$this->_curl->addOption(CURLOPT_FILE, $newFile);
$this->_curl->write(\Zend_Http_Client::GET, $source);
$result = $this->_curl->read();

As a result i have the full reply in $result , the blank file in $destination .There are enough permissions i.e. even setting 777 on the directory and a current file, the result is not changing.

drwxrwxrwx 3 501 www-data 102 Apr  5 08:56 .
drwxrwxrwx 3 501 www-data 102 Apr  5 08:10 ..
-rw-rw-rw- 1 501 www-data   0 Apr  5 08:59 file_temp.gz


texts: How to Remove "What is PayPal?" from PayPal option on checkout

texts:
I have set-up PayPal as an option on my store. And by default on the payment option selection page next to the PayPal logo there is text stating "What is PayPal?" that links to the PayPal website.

I was wondering how I would remove the text and link.


texts: cron:run Cannot instantiate interface Magento\Framework\ShellInterface

texts:
I have Magento 2.2.1 installed.

I get this issue (got that issue also in 2.2) when running php bin/magento cron:run:

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\ShellInterface in <magento-root-dir>/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 <magento-root-dir>/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#1 <magento-root-dir>/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...')
#2 <magento-root-dir>/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#3 <magento-root-dir>/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Fa in <magento-root-dir>/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

This error is not appearing when in developer mode.

In production mode, I cleared all caches, recompiled etc.

Php version => 7.1.

Any help is much appreciated?

Thanks.


texts: How to Configure Elasticsearch with hostgator Hosting in Magento 2.4.1

texts:
I have installed magento 2.4.1 in my hostgator shared/Reseller hosting.All things are working fine but I am getting error Of Catalog/search Indexing required. But when I reindex from admin panel or from CLI i get the following error

Catalog Search index exception: Could not ping search engine: No alive nodes found in your cluster

when i did research I found that hostgator does not support elasticsearch.
Any body know how to configure Elasticsearch in Hostgator and if not possible then how to solve this issue
Thanks!


texts: Upgrade script when you don't know which version they have

texts:
I know how to do upgrade scripts within Magento but the current way relies on me knowing the version the user is running.

If I have some users running v0.2 and some 0.3 but I want to make a change for anyone who moves onto 0.5 how I would I go about that?

I currently have:

mysql4-install-0.2.0.php

My new version will be 0.5.0 but some users are running 0.4.6 and some are running 0.4.9.

Do I have to create an upgrade script for each of the versions users might be using? i.e

mysql4-upgrade-0.4.6-0.5.0.php
mysql4-upgrade-0.4.9-0.5.0.php


texts: How to unselect modules in CLI installation

texts:
When installing through the web UI wizard, you're given the option to not install certain modules (Customize your store -> Advanced Modules Configurations). Can the same be done with the CLI installer?

NOTE:
I am aware of module:disable.


texts: CatalogRule not appearing in cron_schedule table

texts:
I am on Magento CE 1.9.0.1

I sat a Catalog Price Rule, saved and applied it, and it works correctly.
Anyway, after a day it disappear.
I understood the cron logic, and went to check the cron_schedule table.
I have these rows

captcha_delete_expired_images
captcha_delete_expired_images
newsletter_send_all
newsletter_send_all
newsletter_send_all
newsletter_send_all
xmlconnect_notification_send_all
xmlconnect_notification_send_all
xmlconnect_notification_send_all
xmlconnect_notification_send_all

If i truncate the table and run the cron.sh script from mu ssh shell, the table gets populated again with the same rows. No CatalogRule row..

I also checked the various catalog rule tables and the rules are there..

What's (not) happening here?

Thank you!


texts: Magento 2.1.x Multistore Multi domains, getting 404 error on Product Display Page for non Default Store View

texts:
I have a Magento CE 2.1.4 website, with 2 store views with 2 different domains.

The “Add Store Code to Urls” in Stores > Configuration > General > Web > URL options is set to DISABLED since
I'm using different domain names for the 2 stores.

I have a product that is shared between the 2 stores but has slight details differences that are set the store view scope.
On Default Store, the Product Display Page (PDP) works properly from the category link, and from the direct product URL without
the category path.
On the secondary store, the PDP works fine with the category path, but I get a 404 error when accessing the page without the
category paths.

NOTE:
* The problem also exists in 2.1.9 (dev site)
* Setting the product to use a unique URL key at the secondary store view scope also didn't solve the problem.

Has anyone else run into this issue, and have a resolution?  Thanks in advance for your help?

Test results done on Magento 2.1.9:
Default Store:
OK >>> https://m2dev.specialized.net/12v-erv-unit-solarpulse-erv-12v-solar-charger-maintainer-6-watt.html

Even after setting URL to be unique at the secondary Store Scope:
404 ERROR >>> https://m2dev.pulsetech.net/12v-erv-unit-solarpulse-erv-12v-solar-charger-maintainer-6-watt-test.html


texts: Magento 2.3 Install failed .... Invalid Index using addColumn method

texts:
Installing Magento 2.3, I get error Invalid Index,   the error points to the attached code in the setup   file and error states the index is

  'tinyint(1) NOT   NULL default 0'

.  Dropped back to 2.2.7, it works  fine.

if(!$installer->getConnection()->tableColumnExists($installer->getTable('catalog_product_option'),  'customoptions_status')) {
$installer->getConnection()->addColumn( $installer->getTable('catalog_product_option'),
                'customoptions_status',
                'tinyint(1) NOT NULL default 0'
);
}


texts: Magento $this->_redirect() does not work on an ajax response

texts:
I would like to know how to cut an ajax response specifically on the one page checkout saveBilling process (ajax) and redirect to the login page.

I am currently using this code

  $this->_redirect('customer/account/login');

but it only produces a ajax GET response.

public function checkGuestIfRegistered($email){

    $customer = Mage::getModel('customer/customer')->getCollection()
                ->addAttributeToSelect(array('id', 'email'))
                ->addFieldToFilter("email", array("eq" => $email));
    if($customer->count() >= 1){

        $result['error'] = $this->__('Please log in');
        $result['redirect'] = Mage::getUrl('customer/account/login');
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

    }
}

saveBilling

public function saveBillingAction(){
    if ($this->_expireAjax()) {
        return;
    }
    //print_r($this->getRequest()->getPost('billing')['email']);
    $this->checkGuestIfRegistered($this->getRequest()->getPost('billing')['email']);

    if ($this->getRequest()->isPost()) {
        $data = $this->getRequest()->getPost('billing', array());
        $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);

        if (isset($data['email'])) {
            $data['email'] = trim($data['email']);
        }
        $result = $this->getOnepage()->saveBilling($data, $customerAddressId);

        if (!isset($result['error'])) {
            if ($this->getOnepage()->getQuote()->isVirtual()) {
                $result['goto_section'] = 'payment';
                $result['update_section'] = array(
                    'name' => 'payment-method',
                    'html' => $this->_getPaymentMethodsHtml()
                );
            } elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
                $result['goto_section'] = 'shipping_method';
                $result['update_section'] = array(
                    'name' => 'shipping-method',
                    'html' => $this->_getShippingMethodsHtml()
                );

                $result['allow_sections'] = array('shipping');
                $result['duplicateBillingInfo'] = 'true';
            } else {
                $result['goto_section'] = 'shipping';
            }
        }

        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
    }
}


texts: Magento 2 show price range for configurable product on category page

texts:
I have configurable products with different prices for each product. For example I have a configurable product with three package sizes:

Small = 50$
Medium = 60$
Large = 70$

On the category page, the price of this product will show as "50$".

I want to show either:

The price range: "50$ - 70$"
A "from" text: "From 50$"

Is it possible to show the price range of all the configurable products?


texts: Magento cloud hosted M2 EE site compromised and got malware attack

texts:
Today i noticed in my client's magento 2 cloud hosted enterprise edition site is compromised. In footer hacker added some link along with following url:

  <script src="http://write-cdn.com/mysiteurl/"></script>

As i am maintaining their environment when i saw that link i was curious what is that. When i opened that link it first attempt it showed some JS related encrypted code so i got some doubt about it.

Did perform scan in tools like sucuri and foregenix to verify site is malware infected. Both scanner showed result clean but when i ran http://write-cdn.com/ in sucuri it gave me red alert that domain is blacklisted for malware activities.

I removed that code from mysite and performed Db scan by checking blocks, pages, core_config_data and few other tables. did check code using grep linux command to find out but didn't find any clue.

I want to know how that code injected in site.  I did check admin logs, magento logs, nginx logs. Also created magento support ticket but those guys just useless and giving zero information how someone entered that code. admin access is shared with 2 person and all have secure and 20 character special character password.

Is there any way i can track from where that malware code came?
Is there any tool or way i can quickly scan and monitor for magento?

Is there any way i check who changed into db directly like logging or something?

Any help would be appreciated.


texts: Please wait while the indexes are being refreshed” in Magento

texts:
We have 2200 products in our Magento 1.9 store. I am trying to add more products from CSV. After uploading CSV and running CSV file in the popup the following keep showing with loader,

  Please wait while the indexes are being refreshed.

Can anyone tell that why refreshing the indexes takes too much time? and How can I resolve this issue?


texts: why magento latest sample data too large

texts: i see  sample data of latest version of magento is about 430 mb why so large i gets stucked while downloading can i use older versions sample data


texts: Why styles are not getting applies when edited in magento2

texts:
In magento2.0.2(downloaded from magentocommerce.com), after installation I created a new theme under app/design/frontend/mypackage with theme.xml , registration.php , composer.json as per the documentation.And then I inherited the blank theme by copying the theme files from vendor/magento/theme-frontend-blank into mytheme folder. Everything was fine. Now, when I add some style in theme.less in web/css/source and compile it using grunt , the styles are getting applied. But when I edit some of the existing styles or when I created a new less file with some styles, the styles are not getting applied.

Someone kindly explain me the reason behind this.

After doing any changes when i run php magento setup:static-content:deploy at front it is showing error like


texts: Catch exception in own extension controller

texts:
I created my own extension and within my own controller. Now I want to catch exceptions occuring in one of my actions and write it to my own log file. But try() catch does not seem to work. It just outputs the stack to the browser.

public function testAction() {
    try {
      error();
    } catch(Exception $exception) {
        logMessage();
    }
}


texts: Magento 2 : Created Custom Product Attribute but Not showing in Configuration Section

texts:
I Have Created custom attribute for configurable  products. It is Showing in Add configurable Product section.

But I Can't get those attributes in below section.

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'paper_size',
        [
            'group' => 'Pricing Calculator',
            'type' => 'varchar',
            'backend' => '',
            'frontend' => '',
            'sort_order' => 10,
            'label' => 'Card Size',
            'input' => 'select',
            'class' => '',
            'source' => 'Lts\MultipleDropdown\Model\Config\Source\Optionssize',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => true,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to'=>'configurable'
        ]
    );


texts:
I am having a problem with store switcher. I created two stores:

English store and
Arabic store

When I switch the store English into Arabic, it redirects me to default English store. Here is my URL http://www.hit-counts.com/vinca/default/brands.html.

It's working properly throughout the website except for shop pages/catalog pages.

I am using Magento Version 2.2


texts: In Magento 1 Sales menu add custom created sub-menu

texts:
In Magento 1 Sales menu list add one new sub-menu same as order or invoice.

Any one can create this type of extension?


texts: Json does not exist for my custom module

texts:
Vendor name: SimplifiedMagento
Module name: MilkyMan

Class SimplifiedMagento\\MilkyMan\\Serialize\\Serializer\\Json does not exist"

This thing is coming when i am loading my home page.


texts:
Magento 2
Centos 7
Mariadb 10
When I try to add a product from the admin panel, I get the spinning wheel of death.
import-handler.js:44 Uncaught TypeError: component.getPreview is not a function
    at UiClass.<anonymous> (import-handler.js:44)
    at Registry._resolveRequest (registry.js:418)
    at Registry._addRequest (registry.js:385)
    at Registry.get (registry.js:229)
    at UiClass.<anonymous> (import-handler.js:43)
    at underscore.js:73
    at Function._.each._.forEach (underscore.js:145)
    at UiClass.setHandlers (import-handler.js:40)
    at UiClass.initialize (import-handler.js:27)
    at UiClass.initialize (wrapper.js:109)

It seems like I am missing one or more JS files.  I have cleared cache, redeployed, done everything I think of to try to get back whatever file is lost.
Permissions have been set over and over and over.
Any idea how to find out what JS file or files is/are missing. If this is even the case.


texts:
I have added and configured the Isotope jQuery in Magento 2.3.3. But, its working and showing error as below:

Uncaught TypeError: $(...).isotope is not a function

I have tried all the solutions but none of them are worked.

Have anyone an idea how to configure Isotope js in Magento2?


texts:
I'm using Magento 2 CE Version 2.1.1

Paypal Express checkout Previously Works Fine.

Now it gives below error while using Sandbox Account.

  Paypal: I'm sorry - but we were not able to process your payment.
  Please try another payment method or contact us so we can assist you.


texts: Get config value in html using knockoutjs

texts:
I am trying to get config value to html file.
My aim is to check if the config value is enabled of it is show a button and if it’s continue normally with out button the button.
I am not sure how to get the value to knockout js
Can I pass it somehow in class or do I have to do anything else


texts: Magento 1.9 USPS First-Class Package Service - Retail not working

texts:
I am not getting USPS First class shipping method at checkout page.

I had tried that link but no luck can anyone help to solve this issue


texts: How do I change "Display Product Options In” to default to “Product Info Column""

texts:
When I create a simple product, I go to the Design tab and check "Product Info Column" in the "Display Product Options In" dropdown for each product I add. How can I make it that Magento defaults to "Product Info Column" instead of the other option?

I've already went to the database and changed the "options_container" row to the default value of "container1" in the "eav_attribute" table. The odd part is that it was already set to "container1" and it still doesn't work.


texts: How and when does Magento load the base configuration, the module configuration, and the database configuration?

texts:
I am get confused a little bit about the correct answer for this question, may be it is small.

One  /app/code/core/Mage/Core/Model/App.php

 public function run($params)
{
    $this->baseInit($options);
    $this->_initModules();
    $this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);

        if ($this->_config->isLocalConfigLoaded()) {
            $scopeCode = isset($params['scope_code']) ? $params['scope_code'] : '';
            $scopeType = isset($params['scope_type']) ? $params['scope_type'] : 'store';
            $this->_initCurrentStore($scopeCode, $scopeType);
            $this->_initRequest();
            Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
        }

        $this->getFrontController()->dispatch();
    }
    return $this;
}

Base configuration as well as Module configuration is loading by below code when request something.

$this->_config->loadBase();
$this->_config->loadModules();
$this->_config->loadDb();

Two app/code/core/Mage/Core/Model/App.php

public function init($code, $type = null, $options = array())
{

    $this->_initEnvironment();
    $this->_config = Mage::getConfig();
    $this->_config->setOptions($options);
    $this->_initBaseConfig();
    $this->_initCache();
    $this->_config->init($options);

    if (Mage::isInstalled($options)) {
        $this->_initCurrentStore($code, $type);
        $this->_initRequest();
    }
    return $this;
}

It is calling when we call Stactic Method  Mage::app(); initializing configuration and loading

Based on One and Two Config loading which is the correct answer for tagged (How and when does Magento load .... ) question ?

Any answer appreciate.


texts:
In one Magento 2.2.6 instance something very odd occurs: the meta page title shows

<title>Customer Login</title>

and the page title in the content also shows Customer Login - even though the route has nothing to to with the customer login!

The module in question is omikron/magento2-factfinder and the route in question is factfinder/result/index. Currently the extension does not set its own page title (I've already created a PR for that), but even when you add

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Search Results</title>
        …
    </head>
    <body>
        …
    </body>
</page>

the page still shows <title>Customer Login</title> in the meta tags - however the page title in the <body> will indeed show Search Results.

In a second Magento 2.2.6 instance this problem does not occur.

How can this be? What could be the reason why the page title is overridden in such a manner for a particular route?


texts: PayPal Express (from PayFlow) - Can't create order with ampersand in product name and discount

texts:
I've found issue that prevent using PayPal Express (from PayPal PayFlow).

Magento version: 1.9.2.1

Steps to reproduce:

Configure PayPal Payflow WITH Express checkout.
Go to frontend and add some product, that contains "&" or "=" symbol, to shopping cart
Apply any coupon that add discount
Click "Check out with PayPal" button (express checkout) on checkout page

Expected Result:

Customer should be redirected to PayPal and have ability to place order.

Actual Result:

Customer gets error message on shopping cart page:

  PayPal gateway rejected the request. Field format error: 10413-The
  totals of the cart item amounts do not match order amounts.

If you try to create order with "PayPal Payflow" (credit card) - it works good, but express checkout isn't work correct with discounts.

Issue was reported to Magento:
http://www.magentocommerce.com/bug-tracking/issue/index/id/1161


texts: Is it possible to put in the welcome message the company name instead of customer name?


texts: how to display name of catalog price rule in product view page in magento1?

texts: I have created catalog price rule in admin, but catalog price rule name not displaying in product view page.Can you please help me?


texts:
I have a modal created when user clicks on Add to Cart button and there are couple of products that are shown in that modal and their corresponding Add to Cart buttons. Now I want to close the Modal when user adds the product from that modal. How can I achieve this?
I have _hide() function in that modal.

//modal-form.js

 define(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function($) {
        "use strict";
        //creating jquery widget
        $.widget('mage.modalForm', {
            options: {
                modalForm: '#modal-lens-form',
                modalButton: '.open-modal-form'
            },
            _create: function() {
                this.options.modalOption = this._getModalOptions();
                this._bind();
                this._hide();
            },
            _getModalOptions: function() {
                /**
                 * Modal options
                 */
                var options = {
                    type: 'popup',
                    responsive: true,
                    title: 'Select Product'
                    // ,
                    // buttons: [{
                    //     text: $.mage.__('Continue'),
                    //     class: '',
                    //     click: function () {
                    //         this.closeModal();
                    //     }
                    // }]
                };

                return options;
            },
            _bind: function(){
                var modalOption = this.options.modalOption;
                var modalForm = this.options.modalForm;

                $(document).on('click', this.options.modalButton,  function(){

                    if ($('#product_addtocart_form').valid()) { //Open modal only if validation passes on base product form
                        //Initialize modal
                        $(modalForm).modal(modalOption);
                        //open modal
                        $(modalForm).trigger('openModal');
                    }
                });
            },
            _hide: function(){
                $(this.options.modalForm).hide();
            }
        }

        );

        return $.mage.modalForm;
    }
);

When the product is successfully added to the cart, I want to add code in my custom catalog-add-to-cart.js file to automatically close that modal. How to call above hide function, or closeModal() from different js file?


texts: PhpStorm debugging Magento 2 Devbox gives "Protocol mismatch" error

texts:
I was able to create the dev box and start the listener script successfully, but when I start a debugging session I receive this error on any page:

SSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
Protocol mismatch.

The main site is running at http://127.0.0.1:32772/ and the init script is listening on port 32773.  I receive the error when visiting http://127.0.0.1:32773/?XDEBUG_SESSION_START=14487


texts:
is it possible to make a customer attribute unique, preferably on a website basis bit if not then globally?

I cant see how to do this.

Similar to the email address


texts:
Below error it will be showed on
"Sorry, but something went wrong. Please contact the seller."
https://nimbus.everhelper.me/client/notes/share/1002744/hzvm02m0rtkfvncdgv0c


texts:
I have this piece of code inside

  app\design\frontend\Company_name\porto_base_child\Magento_Checkout\web\template\shipping.html

address

I am trying to display this div inside this file at the bottom which is working fine on English page but not getting translated to french.

  app\design\frontend\Company_name\porto_base_child\Magento_Checkout\web\js\view\shipping-address\list-dropdown.js

$.mage.__(document.getElementById('poboxmessage').style.display='block');

I have put the translation of english to french inside

  app\design\frontend\Company_name\porto_base_child\i18n\fr_CA.csv

"address","adresse"

Also the translation in

  app\code\Company_name\Catalog\view\frontend\web\js\fr_ca.js

$.mage.__("address");

I am able to display text only in English on both english and french pages the issue is just my text is not getting translated some how. I am still trying to figure out if I have missed any steps. Any advice or suggestion would help me thanks


texts: HTML Landing Page Override for Magento Store

texts:
is there a way to override a Magento store (a store within a magento install, that isnt the primary one)?

I have a html landing page I want to put in place of the store while Im developing it.

Is this possible? What is the best way?


texts: Magento 2 - Set simple product Color when creating product programmatically

texts:
Can any one help me? When I create simple product in GUI I can set color value by dropdown menu.

My question is:
How to assign color value programmatically, when I create simple product? I have spend whole day searching a way do to it.


texts:
Their is a lot of fuss going about Magento 2, concept like Namespaces etc has been incorporated into it. I am just curious to know how REQUEST flow has been handled in Magento 2, can somebody give me a brief .

Interesting point from Anthol Krit Presentation

  Magneto2 has got 8000 classes compare to 2700 in Magento 1


texts: Troubleshooting a Watermark Issue - Need Guidance

texts: I'm a Magento newbie. Just upgraded a site from 1.6.2 to 1.8.1, and now watermarks which were working in 1.6.2 are not appearing correctly on product images. (Should be in the lower right corner, and they are there, but the entire watermark is not being displayed - just the upper half of the watermark. However the entire product image is being displayed, so the issue is definitely with the watermark and not a cropping problem with the product image.) The product images are either .jpg or .png, and the watermark is a transparent .png. Where would you suggest I start to troubleshoot a problem like this? Thanks for any help you can provide.


texts: Is there any way to restrict multi-address shipping to certain customer groups?

texts:
Long-time reader first-time poster here!

We have multi-address shipping enabled on our Magento store, but we want to limit its use to only certain customer groups; or, more specifically, we would like to exclude certain groups from using multi-address shipping.

Is this possible either with or without an extension? I have found some great shipping restriction extensions, but nothing dealing with multi-address shipping.

Thanks in advance!
Andre


texts:
Currently in magento 2.4.2, cart rule applies to giftcard products also.
I need to prevent discount applied to giftcard product in cart.
I have two approach,

Bulk update cart rules, i have 1200 cart rules
i can set condition "sku does not contain"

But i am not sure how i bulk update cart rules from program (i.e script) or from db query. I need your thoughts on this.

Another fix would be hard code from where we can prevent discount apply to gift card product.

Any thoughts what needs to be followed here to get this feature done?


texts: Magento 1.9.2.4 Product Atributes are not showing on cart page

texts:
I am getting the product arbitrates on cart page as follows but it is not showing the values event it is not printing the product ID there:

<?php $_item = $this->getItem()?>
<?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
<?php echo $_product->getResource()->getAttribute('simpledescription')->getFrontend()->getValue($_product); ?>

Also tried as follows still not working:

 <?php echo $_product= Mage::getModel('catalog/product')->load($_item->getId()); ?>
 <?php echo $_product->getResource()->getAttribute('simpledescription')->getFrontend()->getValue($_product).'test'; ?>


texts: How to add more product data in catalog_category_view.xml?

texts:
We get more product related information in the $_product->getData() in the product detail page, but not in category page.
Currently the only data available in the category page are,

Array
    (
        [entity_id] => 2442
        [attribute_set_id] => 19
        [type_id] => simple
        [sku] => wheat-tortilla-spinach
        [has_options] => 0
        [required_options] => 0
        [created_at] => 2019-09-19 04:55:54
        [updated_at] => 2019-09-19 04:55:54
        [price] => 140.0000
        [tax_class_id] => 2
        [final_price] => 140.0000
        [minimal_price] => 140.0000
        [min_price] => 140.0000
        [max_price] => 140.0000
        [tier_price] => Array
            (
            )

        [cat_index_position] => 10000
        [event_id] =>
        [logged_at] =>
        [event_type_id] =>
        [object_id] =>
        [subject_id] =>
        [subtype] =>
        [store_id] =>
        [num_view_counts] =>
        [num_reviews_count] =>
        [num_rating_summary] =>
        [is_salable] => 1
        [name] => Wheat Tortillas with Spinach
        [image] => /w/h/wheat_tortilla_spinach_2.jpg
        [small_image] => /w/h/wheat_tortilla_spinach_2.jpg
        [thumbnail] => /w/h/wheat_tortilla_spinach_2.jpg
        [msrp_display_actual_price_type] => 0
        [url_key] => wheat-tortillas-with-spinach
        [swatch_image] => /w/h/wheat_tortilla_spinach_2.jpg
        [status] => 1
        [request_path] => wheat-tortillas-with-spinach.html
        [rating_summary] => Magento\Framework\DataObject Object
            (
                [_data:protected] => Array
                    (
                        [store_id] => 24
                    )

            )

        [tier_price_changed] => 0
    )

Here I would like to add few more product attribute values such as `weight`,`custom_attribute`, and so they can be viewed in the `catalog_category_view.xml` ?

What I do now to fetch the additional data is like this,

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $_product = $objectManager->create('Magento\Catalog\Model\Product')->load( $block->getProduct()->getId() );
    $weight = $_product->getData('weight');
    $custom_attribute = $_product->getData('custom_attribute');
But wouldn't this add more load to the products listing page?
Someone please let me know if there is a better way.


texts: How do I call a stored procedure from Magento code?

texts:
I have a stored procedure, called "myprocedure". How can I call it from Magento?

I tried:

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = 'CALL myprocedure()';
$results = $readConnection->fetchAll($query);
var_dump($results);

This gives me a PDO error, whats wrong?

Thanks!


texts: How to disable/enable a product for admin store programatically in Magento2?

texts:
I want to disable product for admin store means product should be disable for all store/website.
I am trying to do something like this but product disable for default store only:

$productRepository = $objectManager->get('\Magento\Catalog\Api\ProductRepositoryInterface');
$productObj = $productRepository->get('sku');
$productObj->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
$productRepository->save($productObj);

I have also tried to pass global store id i.e. 0 like this but it is also disable only default store.

$productRepository = $objectManager->get('\Magento\Catalog\Api\ProductRepositoryInterface');
$productObj = $productRepository->get('sku',true,0,true);
$productObj->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
$productRepository->save($productObj);

Can anyone help? Thanks in advance :)


texts: How to include module's CSS in CMS pages with module block

texts:
I have prepared one module in which I have prepared two .phtml files and included css and js through module layout file. Now, I want to include those .phtml file in different blocks and pages.

I have tried to include .phtml in CMS page with below code:

{{block class="CompanyName\ModuleName\Block\BlockName" template="CompanyName_ModuleName::file.phtml"}}

But it only includes .phtml file not CSS.

Here is my module layout file:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="1column">
<head>
    <css src="CompanyName_ModuleName::css/abc.css"/>
    <css src="CompanyName_ModuleName::css/instapic-slider.css"/>
</head>
<body>
    <referenceContainer name="content">
        <block class="CompanyName\ModuleName\Block\BlockName" name="ModuleName_bytag" template="picsbytag.phtml" />
        <block class="CompanyName\ModuleName\Block\BlockName" name="ModuleName_byname" template="picsbyname.phtml" />
    </referenceContainer>
</body>
</page>

How I can achieve this to include css with .phtml file.

Any help will be appreciated.


texts: "Checkout Method" step is not displaying under onepage checkout

texts:
Before "1.Checkout Method" step was displaying under onepage checkout.

than we did lot of customizations, now its "1.Checkout Method" step is not displaying.

we reverted most of the customizations related to checkout, but still its not displaying.

System > configuration > Sales > checkout

Is there any way to find what is the reason behind this ?


texts:
Need to open custom tab on product view, from link. Magento 1.9.2.4
Custom theme.
My tab, which is added just in one category by Custom Design

<reference name="product.info.tabs">
        <action method="addTab" translate="title" module="catalog" ><alias>contact</alias><title>Product Contact</title><block>productcontact/productcontact</block><template>productcontact/contact_form.phtml</template></action>
    </reference>

This is my button-link in view.phtml

> <?php if(($_product->getAttributeText('rent')) == "Yes"){?>
<button
> type="button" title="<?php echo $this->__('Ask about rent') ?>" class="btn
> btn-default" onclick="location.href='#product_tabs_contact'"
> ><?php echo $this->__('Ask about rent') ?></button>
<?php

and my tabs.phtml

<?php
$this->_product = Mage::registry('product');
?>

        <?php $i=0;
        foreach ($this->getTabs() as $_index => $_tab):
            if($this->getChildHtml($_tab['alias'])):
                $i++;
        ?>
                <li role="presentation" class="<?php echo $i == 1?' active first':''?>"><a href="#product_tabs_<?php echo $_tab['alias'] ?>" aria-controls="product_tabs_<?php echo $_tab['alias'] ?>" role="tab" data-toggle="tab"><?php echo $_tab['title']?>

            <?php endif; ?>
        <?php endforeach; ?>
        <?php $productTabs = $this->_product->getProductTabs();
        foreach ($productTabs AS $tab) { ?>

<a href="#product_tabs_<?php echo $tab->getId(); ?>" aria-controls="product_tabs_<?php echo $tab->getId(); ?>" role="tab" data-toggle="tab"><?php echo $tab->getTitle(); ?>

        <?php } ?>

        <?php $i=0;
        foreach ($this->getTabs() as $_index => $_tab):
            if($this->getChildHtml($_tab['alias'])):
                $i++;
        ?>
                <div class="tab-pane fade<?php echo $i == 1?' active first in':''?>" id="product_tabs_<?php echo $_tab['alias'] ?>" role="tabpanel"><?php echo $this->getChildHtml($_tab['alias']) ?>

            <?php endif; ?>
        <?php endforeach; ?>
        <?php $productTabs = $this->_product->getProductTabs();
        foreach ($productTabs AS $tab) { ?>
            <div class="tab-pane fade" id="product_tabs_<?php echo $tab->getId(); ?>" role="tabpanel"><?php echo $tab->getContent(); ?>

        <?php } ?>

Can somebody have idea what I have to do?

TIA
Zydol