texts: How can I get the product details (like SKU) on JS when "Add to Cart" button is clicked?

texts:
I know how to extend the catalogAddToCart function and already successfully fired my codes when I go into product detail page and press Add To Cart button. But I still has a problem: how can I get the product details on the product to be added into cart, like SKU? Currently I use global variable to get it like this:

On app/code/Vendor/ModuleName/view/template/frontend/templates/cart/addtocart.phtml

<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "MyAddToCart": ""
        }
    }
</script>
<script>
    var product_sku = '<?php echo $block->getProduct()->getSku(); ?>';
</script>

Then on app/code/Vendor/ModuleName/view/frontend/requirejs-config.js

var config = {
    map: {
        '*': {
            'MyAddToCart': 'Vendor_ModuleName/js/MyAddToCart'
        }
    }
};

Finally on app/code/Vendor/ModuleName/view/frontend/web/js/MyAddToCart.js

define([
    'jquery',
    'jquery/ui',
    'Magento_Catalog/js/catalog-add-to-cart'
], function($){
    "use strict";
    $.widget('Vendor.MyAddToCart', $.mage.catalogAddToCart, {
        submitForm: function(form) {
            var productSku = product_sku;
            //Rest of codes
        }
    });
    return $.Vendor.MyAddToCart;
});

I can get the correct SKU, but how about other product attributes? Seems using global variable method is not so good in this case. Is there any internal methods to get the product attributes inside MyAddToCart without using global variable?


texts: Whenever I edit app/design/frontend/Dzinehub/Theme/web/css/styles-l.css , it doesn't get reflected in the front end when I load the site .After every change , I have to clear the cache and run static content-deploy for the changes to appear.Is there any other way ?


texts: Charge no VAT for Canary Islands (Categorised as Spain)

texts:
I've been trying to find an answer to how I disable VAT for anybody who orders from the Canary Islands. A customer made an order from the Tenerife over the weekend and is a little unhappy he's paying VAT. The trouble is that customers who order from the Canaries use Spain as their country, which is correct. Spain however, is charged at normal VAT Rates... The Canaries are not

What's the best way to fix this issue? I don't have any knowledge in Magento programming and would rather not tamper with things I know little about...

Thanks for the help!


texts:
i need to create a custom form for the registration customer.

i have used the file

/app/design/frontend/default/{theme}/template/customer/formregister.phtml

I entered:

<input  type="text" class="input-text " name="company" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>"  />

and

<input type="text" class="input-text " id="billing:vat_id" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text " />

but the value is not recorded.

Why?


texts: How to add new field in product attribute options in Magento 2

texts:
I want to add custom field for attribute options in Magento 2

how can I do?


texts: Magento2: change output template of field in system.xml

texts:
I have a file upload field in my system.xml file, declared in this way:

<field id="custom_file_upload" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="6" showInDefault="1" showInWebsite="1" >
    <label>Upload custom file</label>
    <backend_model> Magento\Config\Model\Config\Backend\File </backend_model>
    <upload_dir config="system" scope_info="1">home</upload_dir>
</field>

How do I change its HTML output?


texts: Magento 2.2.2 upgrade 2.3.2 PHP 7.2 MCRYPT_BLOWFISH pecl

texts:
Centos 6
  Apache 2.4

  PHP 7.2

I am trying to complete the upgrade of the Magento 2.2.2 store to Magento 2.3 following this tutorial

  https://digitalstartup.co.uk/t/how-to-upgrade-from-magento-2-2-8-to-2-3-1/528

However, I am getting the following error in CLI and Frontend and Admin at step 4.5 running

bin/magento setup:upgrade

  [Exception]   Warning: Use of undefined constant MCRYPT_BLOWFISH -
  assumed 'MCRYPT_BLOWFISH' (this will throw an Error i   n a future
  version of PHP) in
  /home/redjohnco/public_html/vendor/magento/framework/Encryption/Encryptor.ph
  p on line 397

I am checking a lot of post since last 2 days online and see that in PHP7 7.2 mcrypt has been removed -

However, it seems Magento 2.3 or (my upgrade seems to need it)

I have a lot of posts on this and they mention it can be installed on PHP 7.2 However the instructions don't seem to work on my Linux Centos 6

all the packages mentioned in the posts whenever I run give output

  No package libc-dev available.

  No package pkg-config available.

  No package mcrypt-1.0.1 available.

It seems it can't find the package or whatever it needs to install mcrypt for PHP 7.2

Please note I am using multiple versions of PHP on my server but when I'm checking in CLI SSH php-v I can see the version 7.2 is being used -

I switch using MultiPHP Manager

Also, I am using WHM CPANEL on the server

I have tried using this too

  https://lukasmestan.com/install-mcrypt-extension-in-php7-2/

and similar other tutorials

The problem I get is when I try and run this command

sudo pecl install mcrypt-1.0.1

I keep getting

  -bash: pecl: command not found

Please can anyone advise how I can fix this on centos 6


texts: Let customers add their desired name in each product

texts:
I need to create a custom form on product pages so customers can add their desired names for each product. I want them to be able to search with those names they choose and also edit or delete them in a custom tab on their account dashboard.

I am new in PHP and in Magento and I am trying it for 3 days now without any luck. I tried to copy mage_tag module so I can get its functionality of forms in the product page and in account dashboard but I found out that you cannot search by tags in Magento. I tried to install Search by tags Extension by dharmpal singh but I found out that it doesn’t work.

I am now trying to get it work with Magento core Search Terms (Synonyms) which is near if I can filter them by customer but  then I found out that I can’t add 2 times the same search text for 2 customers.
I think the simplest way is to create a custom product attribute and find a way to change its value for each customer.
Please let me know your thought and a future proof way to build it so I can add in it search/autocomplete/suggestions and API functionality  so I can sync it with an ERP.


texts: How to get all virtual products sku in configurable product particularly in view.phtml

texts:
I am using Magento2.2. I want to display all enabled child products SKUs in product page(view.phtml) of parent configurable product like

$SKU = $this->getProduct()->getSku();

Please give some tips to do it.

My View.phtml code

<?php
error_reporting(1);
    $_config = $this->helper('Sm\Theme\Helper\Data');
    $detailStyle = $_config->getProductDetail('detail_style');
    $thumsStyle = $_config->getProductDetail('thumbs_style');

    if($detailStyle == 'detail-1'){
        include (dirname(__FILE__).'/detail-style/detail-1.phtml');
    } else {
        include (dirname(__FILE__).'/detail-style/detail-sidebar.phtml');
    }
    $SKU = $this->getProduct()->getSku();

$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
$productTypeInstance = $product->getTypeInstance();
$usedProducts = $productTypeInstance->getUsedProducts($product);

//echo $product->getId(); //Main configurable product ID
//echo $product->getName(); //Main Configurable Name

foreach ($usedProducts  as $child) {
    echo $child->getSku()."</br>"; //Child Product Sku
}

?>


texts: getAllVisibleItems() giving simple products not visible

texts:
I am trying to get order item id by going over all items present in the order with getAllItems(). The problem is I am getting only the simple product even though the product has a parent item (double checked with $item->getParentItemId()). Even when I try getAllVisibleItems() I only get the simple product.
I can see that only the configurable product is visible, so I am obviously selecting the configurable product when placing order.

Also, is it possible to have a simple product which is visible individually and also associated with a grouped/configurable product? This is unrelated to the rest of the post but I will appreciate any help here as well.

This is the code:

foreach ($order->getAllVisibleItems() as $item)
    {
        $k++;
        $productId = $item->getProductId();
        $product     = Mage::getModel('catalog/product')->load($productId);

        Mage::log($k.")".$product->getTypeId()." and id is ".$item->getId(), null, "MODB.log");
        if( $product->getTypeId() == 'simple' ){

            if ($item->getData('row_total_incl_tax') != null){
            $price = $item->getData('row_total_incl_tax');
            }

        if (!$item->getParentItemId){ //get simple prods data;}
        else{//get parent prods data;}.......


texts: Does Possible To Import 1.4 GB SQL File Using WAMP SERVER

texts:
I need to Import 1.4 GB SQL file to Wamp, when I try to import I get error [zip_extension.lib.php]

How can I import large size of SQL file to Wamp Server.


texts: Printing Magento Page prints blank in the content area

texts:
For one of our clients their customers need to be able to print out certain pages on the website. Whenever we try and print it will print out a page as it normally would putting the title tag / url at the top and time / number of pages at the bottom. However, the content area is blank.

Any ideas?

I've tried across all browsers and we have the same issue


texts: How to reinitialize cart/quote after a checkout?

texts:
When a user checks out, the quote is becoming null, and the ID becomes 0.

This is causing a problem because the next time I'm calling

cart = Mage::getSingleton('checkout/cart');

and using the cart object to add a product to the cart, it's not saving after I call
cart->save(). What's weird is, the second time that I call the url to add the cart, it actually saves correctly. How can I properly initialize the cart if the quote is null so that it saves properly from the first time I try to add a product?


texts:
Good morning guys,

Something odd I've noticed. When I'm purchasing a configurable product, within the order 3 dashes get added to the SKU.

For example:

A configurable product has the SKU of pickmewine, and the simple product has an SKU of PD101. In the order, the SKU of the actual item ordered becomes PD101---.

Is this normal? If so - how do I reliably remove the dashes? I'm linking into an internal business system and using a str_replace isn't an option as there may be legitimate dashes in an SKU.

Related to this, in the order, I get 2 items for each config products bought. Is using $order->getAllVisibleItems() the best way around that?

Thanks all


texts: Merge Detail and More Information tabs into in Magento 2

texts:
Merge 'Detail' and 'More Information' tabs into And want to display data of 'More Information' above the details page data.

Solution in Magento 1.x is here: http://magento.narrativecard.com/merge-product-description-addition-information-tabs-magento/. It can help community.


texts: Magento 2 : Receive half payment from customer

texts:
Can we receive payment in two parts like receive 50% amount once order placed and another 50% once order completed? Also, we need a partial invoice as well.

Is anyone have any idea we can do it.

Thanks in Advance


texts: Virtual Product change name something else

texts:
I want to Echo virtual products as 'Something Else'
Where can i go ahead and do it.

Does it required to be changed in database or inside the code?


texts: How to rename breadcrumb text in Magento 2?

texts:
How to rename breadcrumb text from Home to Store Name?

Please see the text highlighted in yellow circle.
I am using Ultimo theme.


texts: Shipping Method is hide if Estimate Shipping and Tax values are empty

texts:
Problem : Shipping methods are display already in cart page. But I did not want that.

What I want : I want that when cart page is load, any shipping method must not be load.  after the page load i select Estimate Shipping and Tax then after shipping methods will be loaded according to State and Zip/Postal Code.

Any one know first how to hide all shiping methods and second how to display appropriate or suitable shipping method on cart page after select Estimate Shipping and Tax ?

Any help will be appreciated. Thanks in advance.


texts: Is there a way to set a product price to Price On Application / POA?

texts:
I am selling a product that is entirely customisable, based on the customer's particular requirements. It's not something that can be set up as a configurable product - the price would need to be calculated outside of Magento.

So, is there a way of setting up a Simple Product with "POA / Price On Application" as the price?


texts: Theme inheritance not working _extend.less shouldn't be merged?

texts:
I have a custom theme, extends the luma theme, everything works properly.
My custom less modifications were added in web/css/source/_extend.less

Now I would like to create a subtheme from this custom theme I created previously, but if I add a content to /web/css/source/_extend.less the css modifications added in the parent theme are not taken in consideration.

Shouldn't they be merged or how can i add elegantly new modifications to this new subtheme without copying over again the ones from the previous one. (I understand that _theme.less is not merged but from what I read _extend.less should be merged)

Can anyone help me?

Thanks


texts: Error while re indexing product flat data

texts:
exception 'PDOException' with message

'SQLSTATE[HY000]: General error: 1005 Can't create table 'magento.#sql-16f6_225' (errno: 121)' in /var/www/html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#5 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#6 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(423): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(2833): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca...')
#8 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(815): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_CAT_PRD_FLAT...', 'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /var/www/html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1389): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(2)
#10 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#11 /var/www/html/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(350): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#12 /var/www/html/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#13 /var/www/html/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#14 /var/www/html/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#15 /var/www/html/shell/indexer.php(216): Mage_Shell_Compiler->run()
#16 {main}


texts: Can anyone tell me how to rectify this error in aws server. How to increase php verson in aws server


texts:
I am using Magento 1.9.2.2. When a customer place order then confirmation mail is not sending.

My Sales Emails section is as like below

I installed this (https://www.magentocommerce.com/magento-connect/aoe-scheduler.html) Extension for Cron. Below is the screenshot of this extension

Below is the screenshot of System Cron tab.

Below is the screenshot of core_email_queue table of database

Below is the screenshot of Cron setup of my server

Cron is running. I am getting notification when cron runs.
Can anyone help me in this regard ??

Update

I found below codes in .htaccess file.

###########################################
## Deny access to cron.php
    <Files cron.php>

############################################
## uncomment next lines to enable cron access with base HTTP authorization
## http://httpd.apache.org/docs/2.2/howto/auth.html
##
## Warning: .htpasswd file should be placed somewhere not accessible from the web.
## This is so that folks cannot download the password file.
## For example, if your documents are served out of /usr/local/apache/htdocs
## you might want to put the password file(s) in /usr/local/apache/.

        #AuthName "Cron auth"
        #AuthUserFile ../.htpasswd
        #AuthType basic
        #Require valid-user

############################################

        Order allow,deny
        Deny from all

    </Files>


texts: can anyone tell me how to install magento version 2.4.0? what to do next from here

texts:
I am trying to install Magento version 2.4.0 in my localhost by running URL in the browser directly.
Can anyone tell me how can i install it?
What to do next from here.
Please help me to solve this issue.
I tried my best but it did not install so far.


texts: Backend not open and frontend is working fine in magento1.9.0.0

texts:
admin panel not loading and front end is working fine in magento1.9

Please check screenshot


texts: Rename the Middle Name/Initial to Father's Name

texts:
I need to rename the field of Middle Name/Initial in my registration form: https://www.khouryhome.com/customer/account/create/ to Father's name and want to make it mandatory and not optional like it is now in the system-->customer configuration.
Thanks in advance for the help.

        <label for="<?php echo $this->getFieldId('middlename')?>" class="required"><?php echo $this->getStoreLabel('middlename'); ?> FATHER NAME *

            <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> />

this is for the first name:

        <label for="<?php echo $this->getFieldId('firstname')?>" class="required">*<?php echo $this->getStoreLabel('firstname') ?>

            <input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>" title="<?php echo $this->getStoreLabel('firstname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('firstname') ?>" <?php echo $this->getFieldParams() ?> />


texts: I have magento 1.9.4 and running 3 stores and want to add a jv script from duda in the head

texts:
It says to add this to the head section but I don't know where it is. This is the script. DM_redirect("m.stuffwholesale.com"); I looked at the phtml which I found in the forum but I just am unsure can someone let me know what to do?  I also have to do the same for my other store (m.providencesilverco.com). I apologize for putting this in the wrong spot earlier.
Thanks Ron


texts:
During installation, using both FF and Chrome, trying new db's, clearing cache, all checks pass, but it stops at the same point each time. thank you for any help in the matter. First time using Magento, have semi-decent coding skills.
php version 5.6.27

Module 'Field_Productlist':
Installing data...
[ERROR] exception 'Magento\Framework\Exception\LocalizedException' with message >'Wrong entity ID' in /home/www/shop.****.co.uk/vendor/magento/module->eav/Setup/EavSetup.php:265

Stack trace:

0 /home/www/shop.****.co.uk/vendor/magento/module-eav/Setup/EavSetup.php(800): >Magento\Eav\Setup\EavSetup->getEntityTypeId('catalog_product')
1 /home/www/shop.jlmk.co.uk/app/code/Field/Productlist/Setup/InstallData.php(77>): Magento\Eav\Setup\EavSetup->addAttribute('catalog_product', 'featured', >Array)

long stack trace can be added


texts: I want to change a category name/text link to a picture in the main navigation bar

texts:
My magento store is version 1.9.1
I'm using a modified version of the rwd default theme.
By default, in the main top navigation bar your category names appear as text which links to their corresponding pages. I want to change one of my category names from this text to a small image/ .png because I want one of my categories to be a brand and I'd like to show off that logo there. I don't want to change all the category names, just that specific one. What can I do?


texts: magento custom shipping unable to use Log function

texts:
I would like to know if logging is prohibited in this location?

public function getAllowedMethods()
{
    Mage::log("getAllowedMethods", null, "sam.txt");
    return array(
        'standard' => "Standard",
        'custom' => "Custom",
    );
}


texts: Magento 2 - Second level category has no head

texts:
I tried making a 3 layer category system as pictured below.
For the category "Liquid Spice Blends" everything works well, the layout gets loaded and everything.

But for the test element as shown below, the head doesn't get loaded, I haven't made an override layout for the catalog so that is not the problem.

This is the HTML it generated for the test page :

It uses the same template as the working liquid spice blends, any ideas?


texts: How to get list of all subcategories which are set “Include in Navigation Menu” as no

texts:
I have tried to get all sub categories which are not include in navigation menu but those are being active, of current category in list page.

$children = Mage::getModel('catalog/category')->getCategories(10); //10 current category id

Even this category collection also return only subcategories which are include in navigation menu.

How to get category which isn't include in navigation menu?


texts: How to deploy public PHP files in Magento 2 extension?

texts:
I need to deploy a publicly accessible PHP file as part of a Magento 2 extension. Obviously this is not intended, as usually all requests should be routed through index.php, but in this case it's needed for performance optimization.

Is it possible to do this without requiring manual installation steps (i.e. copy files to /pub)?

I thought about making it a static asset, but the PHP engine is disabled by default in pub/static for good reasons.

Can I use the Magento composer installer in some way?


texts: Backend customer's orders shipment not display tracking number info

texts: The tracking number of the customer has been added to the backend of my magento 2.2.1 website, but now the tracking number of the customer is not displayed in "shippments", and it is impossible to send emails with the tracking number to the customer. It was normal before, but how to solve this situation recently?


texts: Magento 2 – How to add WYSIWYG editor in admin configuration options?

texts: How to add WYSIWYG editor with textarea in the admin system configuration options?


texts: Source Model not set when adding customer attribute - Magento 2.2.1

texts:
I have looked over a few tutorials on how to add a customer attribute to the customer edit page within admin.

http://www.extensions.sashas.org/blog/magento-2-make-customer-attribute.html
Magento 2: How to create a customer custom attribute?
How to add dropdown attribute to custom module in magento 2.0

This however does not seem to be working completely for me. I added the below to my InstallData.php file:

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {

    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    $customerSetup->addAttribute(Customer::ENTITY, 'cp_permissions', [
        'type' => 'text',
        'label' => 'Account Type',
        'input' => 'select',
        'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
        'required' => false,
        'visible' => true,
        'user_defined' => true,
        'sort_order' => 101,
        'position' => 101,
        'system' => 0,
        'option' =>
            array (
                'values' =>
                    array (
                        0 => 'Master',
                        1 => 'Branch'
                    ),
            ),
    ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'cp_permissions')
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['adminhtml_customer'],
        ]);

    $attribute->save();

    }
}

And run setup:upgrade to install the plugin.

I compared my attribute to the gender attribute. Main issues seems to be that, the source model wasn't being set and need to work out how to make sure this is set. When i set the source manually it shows up fine however.


texts: Magento2 backend keeps logging me out after ~10 minutes of inactivity

texts:
Literally the title.

I've set Cookie TTL to 7200 seconds, which are 2 hours.

Hoever, Magento2 keeps logging me out from the backend after a few minutes of idleing.

How can I prevent premature logging out? Am using 2.1.5!


texts: How to create custom header Link any one suggest me thanks in advance.I used many  tutorial but does not work for me.


texts: How can i cancel an order of a customer and reorder in Magento2 using REST API

texts:
I would like to add the options to the customer to cancel their orders and Re-order option for the desired products at customer dashboard.

By using REST API, How can i cancel and reorder items?

Please check the following attachment for the reference.


texts: Why does html code appear in frontend content of static block?

texts:
I have a problem with the static block content. The WYSIWYG Editor is enabled by default. The text in the static block content displays properly in the admin but when this page is loaded in the frontend the html code appears in the content of the static block.

How can I troubleshoot this?

http://www.screencast.com/t/jZZxNyRQ6

http://www.screencast.com/t/Ni9vUa9B


texts:
For example for this page there is a /questions/ask

I know how to do a simple URL with a Store direct URL line below not sure how to make one with 2 slashes.

simple
a href="{{store direct_url='test'}}">Test


texts: Magento 2 Custom Grid data unable to save?

texts:
i have created a module Demo_Bootstrapimages grid using silk software in Magento 2 when saving the record from admin panel it wasn't able to save properly.

I have created the table.

whether anyone face this kind of issue? please help me.


texts:
I am trying to localize an extension i bought from Magento store.

http://www.sitename.com/extname/ to http://www.sitename.com/myext

I have changed the config.xml file to do this change.

<routers>
        <extname>
            <use>standard</use>
            <args>
                <module>Magestore_extname</module>
                <frontName>myext</frontName>
            </args>
        </extname>
</routers>

But the url doesn't change. Any thoughts? I am new to Magento.


texts: Problem with reindexing process SQLSTATE[23000]?

texts:
I've a problem with re-indexing data in magento. When I click reindex data , It returns this error :

There was a problem with reindexing process. SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db_shop`.`catalog_category_product_index`, CONSTRAINT `catalog_category_product_index_ibfk_3` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASC)

So I've searched around for a solution for hours and days ...
But I couldn't find a way to fix it.
I think there's a value in database in product_id which is not in entity_id , That's the cause.
So I went into phpmyadmin and ran these queries :

# Determine incorrect product associations
SELECT * FROM `catalog_category_product` WHERE
product_id not in (select entity_id from catalog_product_entity);

# Determine incorrect categories
SELECT * FROM `catalog_category_product` WHERE
category_id not in (select entity_id from catalog_category_entity);

To find and delete records which is not in both tables, But these queries returns 0 results !
So how can I fix this problem ?


texts: Magento Product Images upload not working in my code

texts:
I have below code which should update product images in Magento using product sku from csv file.
In my csv file, there are two columns, First column in Product SKU and second with Image Name.

<?php
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    set_time_limit(0);

    require_once 'app/Mage.php';
    Mage::app();
    //Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);

    $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
    define('CSV_PATH','csvfiles/');

    $csv_fileoutput = CSV_PATH . "output_imagesupload.csv";
    $csvfileoutput = fopen($csv_fileoutput, 'a');

    $importDir = Mage::getBaseDir('media') . DS . 'catalog/product/incoming/';
    $file_handle = fopen("csvfiles/images_insert.csv", "r");
    while (!feof($file_handle) ) {
        $line_of_text = fgetcsv($file_handle, 1024);
        $productSKU = $line_of_text[0];
        $productid = Mage::getModel('catalog/product')->getIdBySku($productSKU);
        if ($productid)
        {
            $Products = Mage::getModel('catalog/product')->loadByAttribute('sku',$productSKU);
            $fileName = $line_of_text[1];
            $filePath = $importDir.$fileName;

            if(file_exists($filePath)) {

                $Products->addImageToMediaGallery($filePath, array('image', 'small_image', 'thumbnail'), true, false);
                $Products->save();

            /*  $Products->addImageToMediaGallery($filePath,'image',true,false);
                $Products->save();
*/
    /*
                $setbaseimage=Mage::getModel('catalog/product')->load($objProduct);
                $setbaseimage->addImageToMediaGallery($filePath,array('image','small_image','thumbnail'),true,false);
                Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
                $setbaseimage->save();
    */
            } else{
                echo $productSKU . " Not done \n";

            }
                $my_product = Mage::getModel('catalog/product')->load($productid);
                $url = $my_product->getProductUrl();

                fputcsv($csvfileoutput, array($productSKU,$url));
        }
        else {echo $productSKU." - Product is not available\n"; }

    }
    fclose($file_handle);

    ?>

Below is my csv file data -

WPL8573228  8573239-WPL-N-8.jpg
WPL8573229  8573240-WPL-N-8.jpg
WPL8573230  8573241-WPL-N-8.jpg
WPL8573239  8573242-WPL-N-8.jpg

Please let me know what is wrong with my code.


texts: Via block get custom type image or display default

texts:
I want to display my new product image type in my phtml.

I use :

  echo $block->getImage($product, "custom_type_image")->toHtml()

That work, but all my product didn't have an image with this type, so I would like, if no image was found, that display default image like :

  echo $block->getImage($product, "product_base_image")->toHtml()

How to check ?

I can't check

if $block->getImage($product, "custom_type_image")->toHtml()

is null because, if it doesn't succeed to find my picture, it create one as custom_type_image.jpg (which doesn't exist, so the picture is broken)


texts: Currency not changing in magento cms page

texts: I am using a custom theme for my Magento Store. On home page, I am using 2 carousal( For Products ) one from CMS block and one from Static block. I have 2 currencies one is INR and second one is USD. If i am changing currency then its reflect in static blcok carousal but its not reflecting in CMS block carousal. Can anyone guide me how can i solve it?


texts: How to specific value from ajax response?

texts:
ajax code:

    function dropdown(){

       $.ajax({
            type: 'POST',
            url: '<?php echo Mage::getUrl('rma/index/view')?>',
            data:   $('#order').serialize()  ,
            success: function(response){
            alert(response);

            }
        });  return false;

        }

response is like this

 Array
 (
  [0] => test
  [1] => 1.0000
  [2] => test
 )

now i want array[0] value how to get specific value?


texts:
I got a category for matresses and some articles in it.
They got 2 drop down attributes (type and size) and the price of each is different.

Then I've created a configurable article where you can select type and size. I had to enter a price, so I've chosen 1$.

When I order a mattress in the frontend, the price is always 1$. But it should show the price of the mattress which got the selected properties.

How can I configurate it?


texts: How to get list of all routes in Magento 2?

texts:
Is it possible to get the list of all routes in a Magento 2 environment? I am looking some command-line tool, if there is any?

Note: I had a bin/rails routes command to list all the routes in rails framework, and I am looking something similar to this.


texts: Moving Magento 1.9.* to new host with same domain name

texts:
I made a backup of the Magento website including the  mysql. Now when I try to access the page I get a message saying
"a:4:{i:0;s:95:"SQLSTATE[HY000] [1045] Access denied for user " 'minxny_dbadmi'@'localhost' (using password: YES)";i:1;s:2950:"#0 /home/minxny/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()"

However I edited the local.xml file with the updated servers mysql info which has the database mysql username as minxny_dnadmi

and still for some reason its looking for the incorrect username. IDK where its getting the mysql username minxny_dbadmi when I have something totally different in the local.xml


texts: Fatal error: Uncaught Error: Call to a member function getSectionNames() after upgrading to 2.3.4

texts:
We've faced this issue when we've upgraded Magento Commerce 2.3.2 to 2.3.4.

Error was like:

  Fatal error: Uncaught Error: Call to a member function
  getSectionNames() on
  /vendor/magento/module-customer/view/frontend/templates/js/section-config.phtml:20


texts: Magento Order sold/invoiced but cannot ship

texts:
I can’t seem to ship any of my orders, even though they are invoiced. I manually hit the ship button in the back end, and it does nothing but take me to the shipping page, and that’s all. It doesn’t change the order status or anything to completed.

I checked with my credit card processor and everything is paid and balanced, but I would like it that Magento processes the order to a shipped/completed status...it currently says PROCESSING


texts: I have some code error due to upgrade in Magento 2 but my goal is to minify js. Till now I know that we can not minify js without correcting error of the code in magento but I want to know some trick some realy awesome trick to minify js even I have some issue in the code.


texts: total_weight column in sales_flat_shipment is always null in enterprise 1.13.0.2

texts:
As the title says: total_weight column in sales_flat_shipment is always null.

Can this be a bug?


texts: Magento 2 : get best seller product on daily basis

texts:
There are some tables related to bestseller in Magento 2 and it is using following tables to get best product collection.

sales_bestsellers_aggregated_daily
sales_bestsellers_aggregated_monthly
sales_bestsellers_aggregated_yearly

I think, magento2 use sales_bestsellers_aggregated_yearly table for best seller products. I am using \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory and it is working fine.

I am getting the bestseller collection yearly basis. How can i achieve bestseller collection by monthly basis or daily basis.

Thanks in advance.


texts: generated folder should be read-only file system? - Magento 2.2.2

texts:
I upgraded from Magento 2.1.11 to Magento 2.2.2. I have one critical issue that is most our extensions complain about generated folder is a read-only file system. Magento team strongly recommend generated folder should be read-only in Magento 2.2.2.

where would be third-party extensions generation contents are placed in Magento 2.2.2?

Thanks.


texts: How can add link in Header link Before the Welcome Message in magento 2

texts: How can add a custom page link in the header Before the Welcome Message


texts: Add TAX pecentage (%) in PDF invoice summary

texts:
Does anyone know how to add a Tax % to the PDF invoice summary?

I've managed to add this info in to Items table, but can't manage to do the same in Summary.

Can anybody help me.

Thanks,


texts: Display multiple payment methods using one payment module.

texts: I have to implement an easy payment scheme for my site. In the checkout frontend i need to display 3 payment options such as 6 months , 12 months and  24 months. Also in the payment gateway you can set only one redirect url for all 3. So without creating 3 separate payment modules i was thinking of handling it using one module as only one parameter differs (installment) from the rest of the code. Is it possible in magento? And if possible how can i achieve it?


texts: Using getUrlPath in Magento 2.2.7 - URL Redirect

texts:
I have this script working on Magento 1.9 but can't figure out how to use it for Magento 2.2.7.

<?php
require_once 'app/Mage.php';
$sku = $_GET['sku'];
$store = Mage::app()->getStore();
$path = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku)->getUrlPath();
$url = $store->getBaseUrl($store::URL_TYPE_WEB);
header("HTTP/1.1 301 Moved Permanently");
$headerURL = "Location: " . $url . $path;
header($headerURL);
exit();
?>


texts: Static files aren't deploying in developer mode

texts:
I am using Magento 2 (developer mode) and I just created a new theme, added a local-l.css to my /var/www/vendor/app/design/frontend/vendor/theme/web/css/source/local-l.css and when I refresh the homepage it says

  404 GET
  http://www.vendor.dev/pub/static/version1486248173/frontend/vendor/theme/en_US/css/local-l.css

app/design/frontend/vendor/theme/Magento_Theme/layout/default_head_blocks.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
<head>
    <css src="css/local-l.css" />
</head>
</page>

And doesn't load my styles.. I tried clearing cache, view_preprocessed, pub/static/*, everything and I tried redeploying using static:mode:deploy... nothing is working for me.

Any ideas?


texts: How to filter customer by custom attribute using SQL query?

texts:
The zd_user_id is our customer custom attribute.
$customerCollection = $this->customerFactory->create();
$customers = $customerCollection->addAttributeToFilter(
    [
        ['attribute' => 'zd_user_id', 'null' => true],
        ['attribute' => 'zd_user_id', 'eq' => ''],
        ['attribute' => 'zd_user_id', 'eq' => 'NO FIELD']
    ],
    '',
    'left'
)

How could I get all customers with the attribute zd_user_id equal true via SQL?


texts: install Magento-Cloud cli at local question

texts:
I am trying to install Magento-Cloud cli to my local, however I am not familiar with the server setup, I did read thru the documentation from Magento. but I don't get it work. Please help, I am not a good server guy
edit:
I just find out, I can change to root and access magento-cloud
sudo su

How can I do it for current user account? such as : paul
Thanks, I think should be changing something by below, but I don't know how.
export PATH=$PATH:$HOME/.magento-cloud/bin
$PATH & $HOME should be what


texts: Magento installation fails due to redis socket open error

texts:
I'm new to Magento and trying to install for the first time. However during the installation I get this weird error:

Module 'Magento_WishlistSampleData':

DDL cache cleared successfully

Installing user configuration...
[ERROR] exception 'Exception' with message 'Warning: SessionHandler::read(): open(unix:///data/sockets/databases/redis/redis.sock?persistent=1&weight=1&database=0&prefix=PHPREDIS_SESSION-abcd-/sess_42tt4f3ppg1ql8i7kppad25225, O_RDWR) failed: No such file or directory (2) in /data/web/abcd/html/verlag_2.19/vendor/magento/framework/Session/SaveHandler/Native.php on line 22' in /data/web/abcd/html/verlag_2.19/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/data/web/abc...', 22, Array)
#1 /data/web/abcd/html/verlag_2.19/vendor/magento/framework/Session/SaveHandler/Native.php(22): SessionHandler->read('4muc5gl98q850vt...')
#2 /data/web/abcd/html/verlag_2.19/vendor/magento/framework/Session/SaveHandler.php(93): Magento\Framework\Session\SaveHandler\Native->read('4muc5gl98q850vt...')
#3 [internal function]: Magento\Framework\Session\SaveHandler->read('4muc5gl98q850vt...')
#4 /data/web/abcd/html/verlag_2.19/vendor/magento/framework/Session/SessionManager.php(189): session_start()
#5 /data/web/abcd/html/verlag_2.19/var/generation/Magento/Backend/Model/Auth/Session/Interceptor.php(167): Magento\Framework\Session\SessionManager->start()
#6 /data/web/abcd/html/verlag_2.19/vendor/magento/framework/Session/SessionManager.php(130): Magento\Backend\Model\Auth\Session\Interceptor->start()
#7 /data/web/abcd/html/verlag_2.19/vendor/magento/module-backend/Model/Auth/Session.php(98): Magento\Framework\Session\SessionManager->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
#8 /data/web/abcd/html/verlag_2.19/var/generation/Magento/Backend/Model/Auth/Session/Interceptor.php(14): Magento\Backend\Model\Auth\Session->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State), Object(Magento\Framework\Acl\Builder\Proxy), Object(Magento\Backend\Model\Url), Object(Magento\Backend\App\Config))

In the configuration options I have tried both Session and Db, but the outcome is the same...


texts: How do I conduct an upgrade from Magento v1.4.1.1 to 1.7.0.2?

texts:
How do I conduct an upgrade from Magento v1.4.1.1 to 1.7.0.2 ?

Hello !

I'm thinking of upgrading Magento v1.4.1.1 to v1.7.0.2
I have never conducted this kind of operation.
I have read there are two ways of doing it. Using SSH or Magento Back-Office.
I know I can't upgrade directly from v1.4.1.1 to v1.7.0.2.
I might need to pass by v1.4.2.0, v1.5.1.0 and v1.6.2.0
I have read loads of forums articles. None of them explains the
process the same way.

What way is the best to conduct this operation (SSH or by Back-Office) ?
How to conduct this operation via SSH ?
How to conduct this operation via Back-Office ?
How do I specify the name of the new version I want to install, from magento Back-Office (and from SSH) ?
How do customers and admin data bases get updated after core and skin files ?

Thank you very much for your help !


texts: How to build Magento 2 rest API for product info using SKU

texts:
i am learning Magento 2 but i don't know how to create API for product info and am getting error while trying

This page contains the following errors:

  Error on line 2 at column 1: Extra content at the end of the document
  Below is a rendering of the page up to the first error.


texts: how to get a product compare url in magento 2?

texts:
I am trying to get compare url of a product.

For this i am using:

<?php echo $_compareUrl=$this->helper('Magento\Catalog\Helper\Product\Compare')->getAddUrl($_product); ?>

Its output is http://localhost/my_magento_folder/catalog/product_compare/add/.

I am not getting the compare url with product id. It should be like http://localhost/my_magento_folder/catalog/product_compare/add/product/3723/uenc/aHR0cDovL2xvY2FsaG9zdC90d3Avd2lyZS1tZXNoLW1hdGVyaWFsL2JyYXNz/.

Please help me. Thanks


texts: How to edit/create a custom header for Magento 2.3?

texts:
I am trying to edit the header on my theme but there is not a header.phtml or something, just the default.xml

How can I overwrite or modify my header content?

BTW the header is displaying inside <body> tag


texts: Fedex shipping carrier weight more than 150lbs

texts:
I am using magento Community 1.8.1 I am using fedex shipping carrier, I want to set up fedex such like that it take individual product in cart for shipping and calculate rate instead of taking all the product in cart in one box because it does not allow more than 150 lbs in one box , I want to ship more than that.

please consider scenario, my product weight is 15lbs and I want to ship more than 10 product at a time but fedex doesn't show any shipping method for more than 10 products , how could I do it? either I have to do setup in fedex account or I have to change my coding.

please give right Suggestion.


texts:
How Magento2 is hiding tab if there is no data in it, on frontend product page?
For example : product description is appearing in first tab, but if there is no data in description, then description tab is not appearing on frontend.
How Magento is doing this and which code is responsible for this?
I want to achieve same but on some other custom condition.


texts: Magento 2 Multiple image selector with preview in widget.xml

texts:
For a module, I would like to have an image uploader where you can upload one or more images to set into my widget.
Is there a way to create an imageuploader for the widget.xml without the use of ui components? Sort of like the imageuploader in the product form


texts: How to save custom form field value from payment form in magento 2

texts:
I am trying to save custom form filed value from payment form during place order.
I have added custom field in payment form with id method_payment_profile_id

 <div id="selectstore" style="width: 180px;">
        <select name="payment[method]" class="select input-text required-entry"
                            data-bind="
                                attr: {id: getCode()+'_payment_profile_id'},
                                event:{ change: getSelectedValuecc()},
                                options: getCardList(),
                                optionsValue: 'value',
                                optionsText: 'type',
                                optionsCaption: $t('--Select Store--'),
                                ">
         </select>
     </div>

add bellow code in js file

 getData: function() {
                return {
                    'method': this.item.method,
                    'additional_data': {
                        'bankowner': $('#paytm_payment_profile_id').val()
                    }
                };
            },
            /**
             * Get value of instruction field.
             * @returns {String}
             */
            getInstructions: function () {
                return window.checkoutConfig.payment.instructions[this.item.method];
            }

By event trying to get value of custom form field

observer code

public function execute(EventObserver $observer) {
        $inputParams = $this->_inputParamsResolver->resolve();
        if($this->_state->getAreaCode() != \Magento\Framework\App\Area::AREA_ADMINHTML){
        foreach ($inputParams as $inputParam) {
            if ($inputParam instanceof \Magento\Quote\Model\Quote\Payment) {
                $paymentData = $inputParam->getData('additional_data');
}
}
}
}

i am getting error on this line $inputParams = $this->_inputParamsResolver->resolve();


texts: add time delivery options and charge extra for it

texts:
I need to add an option for time deliveries which would be before 10 in the morning, before noon and before 4 p.m. and I need to put this somewhere in the order process... I would prefer to put this on shipping methods page where I also have a calendar but if this is not possible I would put it on the product description page where I have different colors and sizes so it would be an additional atribute. I'm wondering the following:

Is it possible to easily add THIS option in the checkout step where the customer selects the shipping options and how would I set that up?
If option number one is not possible - can I add this atribute to all of my 1000 products at the same time? We're talking about the product description page where customers select colors, sizes and so on

Magento 1.9.1.


texts: How can a Knockout snippet display in a data-badge?

texts:
Attempting to display the current total of products in the mini-cart in a data-badge.  The Knockout text displays in this version:

My Cart

But when trying to display it in the data-badge attribute like this:

My Cart

Instead of rendering a number for the items in the cart it outputs the KO text as a literal string.


texts: Magento Native Captcha for contact form not working in server

texts:
I have created a module to display the Magento native captcha in the contact form and it is working fine on my localhost. But when I upload it on the server it is showing the following error

Fatal error: Call to a member function getBlockName() on a non-object in /public_html/app/code/core/Mage/Captcha/Block/Captcha.php on line 43

I have tried some methods like clearing the cache and session files.

What can I do to resolve this?


texts: Hide "Stored Payment Method" in M2 My Account

texts:
How to hide this in the "My Account" Admin menu?

Thankyou!


texts: Is it necessary to learn Magento 1 for starting with Magento 2?

texts:
I am new to magento.

I want learn magento.

What should be my first step.

Should I start with magento 2.

Where I can find material for it.

Or is it necessary to learn magento 1, before starting with Magento 2?


texts: Get rid of tracking email being sent when we don't offer tracking as a option

texts: When our customers get sent a confirmation email it states a "we will send an email with a link to track your order". We do not offer this and would like to remove this.


texts: Show/hide shipping methods on checkout page depending on current store

texts:
Is there any way to decide shipping methods on the checkout page depending on current store?

For example:
 If storeview A then show only Freeshipping. If storeview B then show only Flatrate.

I am using IWD onepage checkout extension.

In System > configuration > shipping methods :

I have set No to Enabled for My 2nd Website but, That method is still displying on Checkout page.

Current settings are as follow:

Default Config : Flatrate > Enabled : No
Website One : Flatrate > Enabled : Yes [Default checkbox is not selected]
Website Two : Flatrate > Enabled : NO [Default checkbox is selected]


texts: Magento 2.2.8 session_start slow in profiler

texts:
We have multiple Magento 2.2.8 websites on one domain (domain.com = Website A, domain.com/store = Website B - separate customer accounts, but often people are registered on both).

We're having numerous reports from users than when trying to log into either website they are presented with a white screen. We've debugged this and found that it does load eventually, but in the profiler, the session_start times are 50-300+ seconds; so the website looks broken to users.

It continues to happen, so all subsequent page views are equally slow. It does not happen to every user, however, we've noticed that deleting all rows relating to a users email address in DB.sales_quote allows this to work properly.

Sessions are currently saved as files, for now, we'd prefer to not move to redis/memcached.

I'm keen to find a solution - has anyone experienced this or is there a good way to debug this?


texts: Which Url is used for API connection in magento

texts:
i am trying to connect magento api connection using soap client and  am confusing about what url use for api connection.Is magento used Either used Secure Url Or Unsecure url.

My Web Url setting like this:

unsecured is http(http://www.examaple.com/)
and Secured url is HTTPS(https://www.examaple.com/)

Then tell what  protocol is used for api connection?

Also i want to know  which one is  proper url for Soap APi Connection

http://www.example.com/index.php/api/soap/index/?wsdl=1
http://www.example.com/api/soap/index/?wsdl=1
http://www.example.com/api/soap/index/?wsdl


texts: How can i remove duplicate image for same product. Actually product contains 4 images, and also default image (image coming soon). how to remove that.


texts: How to integrate promotional email template into my magento website without using any extensions? Do we have any alternative method to customize my transitional email to promotional email?


texts: Sign in link removed after moving search inside navigation container

texts:
I am moving search inside the navigation container using this code:

<move element="top.search" destination="catalog.topnav" before="-"/>

a
in the default.xml file,
but when I moving search inside navigation sign the in the link has been removed, anybody they have the solution for this.


texts: How Can I Schedule custom cron in every 5 minutes.?

texts:
cron_groups.xml

<?xml version="1.0"?>
<group id="custom_crongroup">
    <schedule_generate_every>5</schedule_generate_every>
    <schedule_ahead_for>10</schedule_ahead_for>
    <schedule_lifetime>15</schedule_lifetime>
    <history_cleanup_every>10</history_cleanup_every>
    <history_success_lifetime>60</history_success_lifetime>
    <history_failure_lifetime>600</history_failure_lifetime>
    <use_separate_process>1</use_separate_process>
</group>

  crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="custom_crongroup">
        <job name="monthly_commission" instance="Rewamp\Promotion\Cron\Run" method="execute">
            <schedule>*/5 * * * *</schedule>
        </job>
    </group>

This cusotm cron is working correctly when i run the cron,

  php bin/magento cron:run

from terminal. But i need to run the cron automatically in every 5 minutes. how can i implement this?.


texts: Bundle options could not be deleted from admin - js issue

texts:
I have bundle options more than one page. While deleting one of the options on the first page, the bundle options from the second page are getting deleted. This seems to be a Js issue in Magento_Bundle/js/components/bundle-dynamic-rows.js

Version Used - Magento 2.2.2

Could anyone help in sorting this issue!


texts: Magento 2 - Category page `addAttributeToSort` not working on custom product attribute

texts:
I used the following code for sorting on category page.

if($this->getCurrentOrder() =="latest_products")
    {
       $collection->addAttributeToSort('significance', 'DESC')->getSelect()->order("e.entity_id desc");
    }

In order to debug, I use following on my local instance but surprisingly there is no ORDER BY significance DESC in query as well

$collection->getSelect(); die;

This is my configuration settings


texts: How to call minicart in custom block in magento 2

texts:
I want to call mini cart in my custom popup after clicking minicart icon in mobile view.
When clicking on the cart icon it should slide like below and show the minicart content in the slide block.
Please help me with this.


texts: How to migrate only Customers from magento 1.x to magento 2.x?

texts: Actually i want to migrate Customers from magento 1.9 to magento 2.3 if anyone have any idea please guide me.


texts: Edit role error 'Wrong tab configuration'

texts:
I'm not very familiar with magento code,
Recently when I try to add/edit the user role I got following error, can anybody help me how to solve this issue.

Wrong tab configuration.

#0 /var/www/html/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php(42): Mage_Adminhtml_Block_Widget_Tabs->addTab('account', false)
#1 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Permissions_Editroles->_prepareLayout()
#2 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#3 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/permi...', 'adminhtml.permi...')
#4 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/permi...', 'adminhtml.permi...')
#5 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#6 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#7 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#8 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#9 /var/www/html/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#10 /var/www/html/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php(44): Mage_Adminhtml_Controller_Action->loadLayout()
#11 /var/www/html/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php(105): Mage_Adminhtml_Permissions_RoleController->_initAction()
#12 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Permissions_RoleController->editRoleAction()
#13 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('editrole')
#14 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /var/www/html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /var/www/html/index.php(83): Mage::run('', 'store')
#18 {main}


texts:
I've been trying to remove this single line(Tax: ) from the invoice pdf. It didn't know it's going to be so hard and going cost me 5 hours and I am still stuck.

Its the print button in sales invoice.. in Admin

Please help!
Note: These are the vertical rows on the bottom of the pdf I can remove the tax from the horizontal row above this

My last try was

placing  in if($totalInfo['source_field'] == 'tax_amount') {continue;} foreach below()

In _getTotalsList($Source) in Mage_Sales_Model_Order_Pdf_Abstract (Which I am gonna override later)

    protected function _getTotalsList($source)
{
    $totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray();
    usort($totals, array($this, '_sortTotalsList'));
    $totalModels = array();
    foreach ($totals as $index => $totalInfo) {

if($totalInfo['source_field'] == 'tax_amount') {continue;}

        if (!empty($totalInfo['model'])) {
            $totalModel = Mage::getModel($totalInfo['model']);
            if ($totalModel instanceof Mage_Sales_Model_Order_Pdf_Total_Default) {
                $totalInfo['model'] = $totalModel;
            } else {
                Mage::throwException(
                    Mage::helper('sales')->__('PDF total model should extend Mage_Sales_Model_Order_Pdf_Total_Default')
                );
            }
        } else {
            $totalModel = Mage::getModel($this->_defaultTotalModel);
        }
        $totalModel->setData($totalInfo);
        $totalModels[] = $totalModel;
    }

    return $totalModels;
}

but it didn't work.


texts:
I want to crate login and registration form for seller (separate form from user registration and login forms) if user click on seller link it will be redirect to seller page where seller can register and login.After  successful login it should redirect to seller's profile or seller's dashboard.

I added on block in that I called persistent/customer/form/register.phtml for registration and /customer/form/login.phtml  for login and call that block into my page.Login page is work perfectly but registration form is not displaying.I am trying this in custom.phtml. How can I solve this .


texts: How to remove specific JS and CSS in Magento2 using page_layout/empty.xml

texts:
I have created New page_layout empty.xml. I need to remove some JS and CSS from this layout.
I already try <remove src="print.css"/> But it gives an error Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'remove', attribute 'src': The attribute 'src' is not allowed.
app/design/frontend/Sm/market/Magento_Theme/page_layout/empty.xml
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>

    <referenceContainer name="head" remove="true"/>
    <referenceContainer name="header" remove="true"/>
    <referenceContainer name="menu" remove="true"/>
    <referenceContainer name="notifications" remove="true"/>
    <referenceContainer name="footer" remove="true"/>
    <referenceContainer name="body" remove="true"/>
    <remove src="print.css"/>
</layout>


texts: Overwrite one file from module in theme?

texts:
I'm trying to implement a module that auto adds the streetname and city to the address in checkout.

Now I almost got it working but I need to change one function from that module. Is it possible to overwrite one of the files from the module in the theme? It's a .js file. or somehow extend it?

The problem I have is with this file:

  /**
     * Method to render address content on notice block
     */
    renderAddressContent: function () {
        var addressContent = '';
        addressContent = '
' + settings.translations.yourAddress + '
';

        if (!this.source) {
            return;
        }

        var self = this;

        var address = this.source.get(this.customScope);

        $.each(address.street, function (index, street) {
            addressContent += street + ' ';
        });

        addressContent += "
";
        addressContent += address.postcode;
        addressContent += "
";
        addressContent += address.city;
        addressContent += "
";
        addressContent += address.region;
        addressContent += "";

        self.debug('Postcode: render address information');

        this.notice(addressContent);
    }

Since I have the region unset the address.region returns undefined which will be shown in the checkout and is really ugly. Or can I maybe somehow set region to an empty string or anything? I basically just want the word 'undefined' to be gone.

I read something about plugin's but not sure how i would use that and i am unsure if that really is what i'm looking for.

Thank you!


texts: Magento 2 : Translate string in function in knockout template

texts:
In a Magento Knockout template I find a function like so:

<element data-bind="something: function() {
    return 'some string';
}" />

How can I translate this string? I tried following, but it does not work:

<element data-bind="something: function() {
    return $t('some string');
}" />

The translation exists and works in other places, so that is not the problem.


texts: Magento 2: What is the proper format for a javascript widget's _bind() method?

texts:
Using 2.1.3, I've been trying to bind page elements to internal javascript widget methods, and have been unsuccessful - the docs (http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-jquery-widgets.html) use the following format:

_bind: function() {
    this._on({
        'click [data-role="menu-item"]:has([data-role="link"])': this._selectItem
    });
}

but within vendor/magento/module-customer/view/adminhtml/web/edit/tab/js/addresses.js, there is another format:

_bind: function () {
    this._on(this.element.find(this.options.addAddressButtonSelector), {
        'click': '_addNewAddress'
    });
}

Is there a preferred format? Neither has been working for me yet.

Update:

This format is working for me (from vendor/magento/theme-adminhtml-backend/web/js/theme.js):

Declare target DOM elements in _create():

_create: function () {
        var selectors = this.options.selectors;

        this.menu = this.element;
        this.menuLinks = $(selectors.topLevelHref, selectors.topLevelItem);
        this.closeActions = $(selectors.closeSubmenuBtn);

        this._initOverlay()
            ._bind();
    },

Then bind widget functions to those elements in _bind():

_bind: function () {
        var focus = this._focus.bind(this),
            open = this._open.bind(this),
            blur = this._blur.bind(this),
            keyboard = this._keyboard.bind(this);

        this.menuLinks
            .on('focus', focus)
            .on('click', open);

        this.menuLinks.last().on('blur', blur);

        this.closeActions.on('keydown', keyboard);
    },

I'd still love to know the preferred/best practice format...


texts: How can I make the login window pop up in magento

texts:
I'm in the checkout page and there are two options there: one radio button so that the user can choose a receipt when he/she submits the order and one button so the user can choose an invoice instead. When the user chooses the invoice button, I would like it to check if the user is logged in, and if he's not, the login pop up window should come up that makes the user log in. So my sample code is the following (billing.phtml file):

jQuery(document).ready(function() {

jQuery("#plirwmi_off").on('change', function (e) {

  jQuery('.visitor-disable').show("slow");

   jQuery('#shipping-area .visitor-disable').hide();

<?php

    if(!Mage::helper('customer')->isLoggedIn()):
      ?>

      alert('Not Logged in');

      //make the pop up window appear

      <?php elseif (Mage::helper('customer')->isLoggedIn()): ?>

      alert('Logged in');

       <?php endif; ?>

});

});

I've found the login pop up window already and I guess I have to call it somehow?   Any hint ?


texts: How to move "associated products" from a grouped product to a new tab?

texts: I would like to know how to move the Associated Products that are inside my grouped product to a brand new tab, which would be "Select your products":


texts: Getting error on re indexing in Magento 2.4 after change batch size

texts:
I have change the Batch size for Magento 2.4
var/www/html/Mag/app/code/Reg/Indexer/etc/adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
    <arguments>
        <argument name="batchRowsCount" xsi:type="array">
            <item name="configurable" xsi:type="number">500</item>
            <item name="default" xsi:type="number">500</item>
        </argument>
    </arguments>
</type>
</config>

On running the indexer process it gives an error

Category Products index PHP Fatal error:  Uncaught Error: Unsupported operand types in /var/www/html/Mag/vendor/magento/framework/Indexer/BatchSizeManagement.php:49
Stack trace:
#0 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(269): Magento\Framework\Indexer\BatchSizeManagement->ensureBatchSize(Object(Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor), Array)
#1 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(227): Magento\Catalog\Model\Indexer\Category\Product\Action\Full->reindexCategoriesBySelect(Object(Magento\Framework\DB\Select), 'cp.entity_id IN...', Object(Magento\Store\Model\Store\Interceptor))
#2 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(192): Magento\Catalog\Model\Indexer\Category\Product\Action\Full->reindexRootCategory(Object(Magento\Store\Model\Store\Interceptor))
#3 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Actio in /var/www/html/Mag/vendor/magento/framework/Indexer/BatchSizeManagement.php on line 49

Any help is appreciated.


texts: Magento 1.9 How to add custom button to sales_invoice/view in admin?

texts: I want to add a custom button on the invoice view page in admin. anyone has any idea please share here.


texts: Why getParentsIdsByChild($productId); is returning empty for Child product?

texts:
I'm trying to get parent products id for child products but i'm getting empty result.

<?php

namespace CustomColumn\Addproductcolumn\Ui\Component\Listing\Column;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Ui\Component\Listing\Columns\Column;

class ParentProductId extends Column
{
    protected $configurable;
    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable $configurable,
        array $components = [],
        array $data = []
    ) {
        parent::__construct($context, $uiComponentFactory, $components, $data);
        $this->_configurable = $configurable;
    }

    public function prepareDataSource(array $dataSource)
    {

        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as &$items) {

            if($items['type_id'] == 'simple'){

                $productId = $items['entity_id'];
                $getParent = $this->_configurable->getParentIdsByChild($productId);

                if($getParent){
                    $items['parentid_col'] = $getParent[0];
                }else{
                    $items['parentid_col'] = "nothing found";
                }
            }
        }
    }
        return $dataSource;
    }
}
?>


texts:
We have implemented https on our Magento store a few months back and
  everything seems fine exceptive noted that the server response for 301
  redirects don't seem to be honoring the https://

  The server response is similar to this.

  Location:
      http://www.example.com

  Redirecting to: http://www.example.com

  This is then leading critters to HTTP versions of the page then a 301
  to the https version, creating a loop.

  Is this correct or is something wrong causing the server to output
  http and not https?


texts: Magento2 Tax exemption for client/product combination

texts:
I need to setup exemptions only on certain products assigned to certain customers.

For example customer A and customer B are both in the same class as a general rule however customer A is tax exempt on product 1 but pays taxes on product 2 (which are also both in the same product class) while customer B pays taxes on both products.

How do I assign 0% tax on product 1 for customer A?

Thanks.


texts:
I want to get the names(and the other info ofc.) of all the stores where I have the Magento2 Installation. I do the following:

use Magento\Store\Model\StoreFactory;
...
$this->_storeFactory = $storeFactory->create();
....
$this->_storeFactory->getCollection()->toArray();

And I get the collection into the array. However, the problem is that in the ['name'] column of each item I don't have the name of the Store, but I get the name of the Store View. I've created 3 different stores with 4 Store views - one Store hase 2 Store views, the other 2 stores have only one store view, which makes total of 4, which is the number of the items in the collection. Why is this happening, aren't store and store view to completely different things? This is kind of confusing. How can I get information for a Store like

["store_id"]=> string(1) "The id of the store, not the id of the store view"
["code"]=> string(2) "The code of the store, not the Store view"
["website_id"]=> string(1) "The website Id that the store belongs to"
["group_id"]=> string(1) "1"
["name"]=> string(7) "The actual name of the store, not the name of the view"


texts:
I don't know what happened, maybe you'll be able to help me.

I've copied Reviews folder from the Base to my custom theme and sudenly the review disapeared from tabs...

Tryed to undo it and still the review section is not visible. It shows's the tab and title of the tab, but the content is missing.

Any ideas?

Thank you,


texts: Terms and Conditions checkbox validation on checkout

texts:
On Magento 2.2.3 and I have an issue regarding the terms and conditions validation on checkout.
If you have two different payment method, you select one you click place order you will have the error message asking the user to check the T&C checkbox. Then you select the other payment method click on the place order button and Magento won't display the error message even if you don't check the T&C checkbox.

Here's the files I tried to update :

checkout-agreements.html

            <input type="checkbox" class="required-entry"
                   data-bind="attr: {
                                'id': $parent.getCheckboxId($parentContext, agreementId),
                                'name': 'agreement[' + agreementId + ']',
                                'value': agreementId
                                }"/>

                <button type="button"
                        class="action action-show"
                        data-bind="click: function(data, event) { return $parent.showContent(data, event) }"
                        >

                </button>

            <button type="button" class="action action-show"
                    data-bind="click: function(data, event) { return $parent.showContent(data, event) }">

            </button>

agreement-validator.js

define([
'jquery',
'mage/validation'
], function ($) {
'use strict';

var checkoutConfig = window.checkoutConfig,
    agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {},
    agreementsInputPath = '.payment-method._active div.checkout-agreements input';

return {
    /**
     * Validate checkout agreements
     *
     * @returns {Boolean}
     */
    validate: function () {
        var isValid = true;

        if (!agreementsConfig.isEnabled || $(agreementsInputPath).length === 0) {
            return true;
        }

        $(agreementsInputPath).each(function (index, element) {
            if (!$.validator.validateSingleElement(element, {
                errorElement: 'div'
            })) {
                isValid = false;
            }
        });

        return isValid;
    }
};

});

Thanks !


texts: How to GET all orders from magento 2 through Rest API. what is the endpoint url to retrieve all order irrespective of customers.


texts: how to create a attribute programmatically in magento2

texts:
I need to delete the existing attribute called Manufacturer if this attribute exists.

And then Create a new attribute called Manufacturer with the same properties as that of the existing one.its created programatically while installing the module.

And how to give the option value for this attribute from custom table .

How to do this in magento2.

Thanks.

Update:

<?php
namespace XXX\Manufacturer\Model\Config\Source;

class Options extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    public $manufacturer;
    public function __construct(
        \XXX\Manufacturer\Model\ResourceModel\Manufacturer\Collection $manufacturer
    ) {
        $this->manufacturer = $manufacturer;
    }

    public function getAllOptions()
    {

        // $this->_options = [ ['label' => __('Test'), 'value'=>'0'] ];
        if (null === $this->_options) {
            foreach($this->manufacturer as $manufacturer) {
                $this->_options[] = [
                    'label' => $manufacturer->getName(),
                    'value' =>  $manufacturer->getId()
                ];
            }
        }
        return $this->_options;
    }
}


texts: Magento 2 import adds info but the import process doesn't end

texts: it's basically what the title says, and I'm only facing this issue when adding prices to products via csv import. I've already checked memory_limit, post_max_size values and they are good, because I made an import (creation of those products with their category and all the info but the price) of 9000+ products and I got the success message, but with this CSV of prices I don't get any success message, it gets stuck on "please wait" and it never ends, but the information it's added. Can someone give me any idea on how to face this issue? thanks


texts: Search criteria builder does not filter an "out_of_stock" products

texts:
I am using Magento 2.3,
Am filtering the product collection using the search criteria builder with a custom attribute as the filter.

$filter1 = $this->_filterBuilder->setField('custom_item_number')
                ->setValue($itemNumber)
                ->setConditionType('eq')
                ->create();
            $this->_searchCriteriaBuilder->addFilters([$filter1]);
            $searchCriteria = $this->_searchCriteriaBuilder->create();
            $productCollection = $this->_productRepository->getList($searchCriteria)->getItems();

This does not filter the product if it is in out of stock status. If I make the product stock status as "in_stock", it works. Why? And How can I filter the product collection?

Thanks in advance.


texts: How to write function if variable ends with...?

texts:
I have this function:
if ($ order-> getData ('customer_email') == 'fvzqmufneovrezmv@marketplace.amazon.it')
I do not want to put a specific email but emails ending in '@marketplace.amazon.it'
How to proceed ?
I tried
if ($ order-> getData ('customer_email') == '@marketplace.amazon.it')
Thanks for your help


texts: How to disable or remove foreign key before importing database to phpmyadmin?

texts: We can import any heavy database into phpmyadmin from command prompt. But many tables have foreign key and it is not allowed to insert a table having foreign key. So how to remove or disable foreign key in order to import database in phpmyadmin?


texts:
My client wants to have a different set of tabs for products belonging to category B.  I added code below to Custom Layout settings.

<reference name="product.info">
    <action method="setTemplate"> <template>catalog/product/view-wfc.phtml</template></action>
</reference>

It works so I can change the position of the tabs and put them above the add to cart blocks.  But no matter what I do to local.xml the tabs stay the same for all products.

Here is what I have tried:
in local.xml I added this -

<catalog_product_view>
    <reference name="product.info.additional">
        <block type="catalog/product_view_tabs" name="product.info.btabs" as="b_tabs">
            <action method="setTemplate">
                <template>catalog/product/view/tabs.phtml</template>
            </action>
            <action method="addTab" translate="title" module="catalog">
                <alias>description_tabbed</alias>
                <title>Details</title>
                <block>catalog/product_view_description</block>
                <template>catalog/product/view/description.phtml</template>
            </action>
            <action method="addTab" translate="title" module="catalog">
                <alias>additional_tabbed</alias>
                <title>Description</title>
                <block>catalog/product_view_attributes</block>
                <template>catalog/product/view/attributes.phtml</template>
            </action>
        </block>
    </reference>
    <reference name="product.info.additional">
        <action method="unsetChild">
            <name>product_tag_list</name>
        </action>
        <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
            <action method="setTemplate">
                <template>catalog/product/view/tabs.phtml</template>
            </action>
            <action method="addTab" translate="title" module="catalog">
                <alias>description_tabbed</alias>
                <title>Description</title>
                <block>catalog/product_view_description</block>
                <template>catalog/product/view/description.phtml</template>
            </action>
            <action method="addTab" translate="title" module="catalog">
                <alias>additional_tabbed</alias>
                <title>Additional</title>
                <block>catalog/product_view_attributes</block>
                <template>catalog/product/view/attributes.phtml</template>
            </action>
        </block>
    </reference>
</catalog_product_view>

in view-wfc.html I added this -

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

Basically I want products in Category B to have tabs labeled "Details" and "Description" and to be in that order.  In products belong to any category besides category B I want their tabs labeled "Description" and "Additional" and to be in that order.

Can anyone point me in the right direction?


texts: how to get filterable attributes and options in magento programmatically

texts:
I wanted Category's Filterable Attributes and their options so i had used following code

$layer = Mage::getModel("catalog/layer");
$category = Mage::getModel("catalog/category")->load($category_id);
$layer->setCurrentCategory($category);
$attributes = $layer->getFilterableAttributes();
foreach($attributes as $attribute){
    if($attribute->getAttributeCode() == 'price'){
        $filterBlockName = 'catalog/layer_filter_price';
    }elseif($attribute->getBackendType() == 'decimal'){
        $filterBlockName = 'catalog/layer_filter_decimal';
    }else{
        $filterBlockName = 'catalog/layer_filter_attribute';
    }

    $result = Mage::app()->getLayout()->createBlock($filterBlockName)->setLayer($layer)->setAttributeModel($attribute)->init();
    $count = count($result->getItems());
    if($count > 0){
        $attribute->getFrontendLabel();
        $attribute->getAttributeCode();
    }
    if($count > 0){
        foreach($result->getItems() as $option) {
            $option->getLabel();
            $option->getValue();
        }
    }
}

now i am getting proper output. for example i am getting following output

brand - HP,Dell
processer - i3,i5,i7

now issue is when i apply filter called processor i7 i have only one product called dell so one dell product is displayed properly but i need filterable attributes as follows

brand - Dell
processer - i3,i5,i7

what i am getting is both HP and Dell.This is programmatically i am doing.I need the way layered navigation works in magento category listing page.


texts: Magento2: Showing price "from" on configurable products

texts: Not sure if this is a simple setting or something I am missing but it is really bugging me. Say I have a configurable product that has different prices for each variation of £10, £20 and £30. When looking in the category view it just shows £10 next to the product. Rather than "from £10". Is there a way of adding that for products that have more than one price? Thanks.


texts: Product List Page Sort by Most View in magento 2.1

texts:
We need to bring most viewed, most subscribed and latest options in the sort menu in product listing page of our magento 2.1 application (magento 2.1.7). I already refered the this link Product List Page Sort by Most View ( can we sort this by page views/hits). As this is for magento 1, most of the classes like Mage is not available in my magento 2.1 app.

Kindly share your suggestions to implement this in magento 2.1 application using code.


texts: Add to Cart is not working - Magento 2.2 - with Browser: Chrome v61.0

texts:
I am having a problem with, Add To Cart on both Listing page and Product page.

When I am adding a product to the cart from listing page, it's showing the cart page with no products. (see the below screen grab).

While adding the product to the cart from the Product page, it's showing same page in Ajax response!

Working only in Firefox

This issue I found on the local server and using localhost instance in the browser


texts: "Shop by Brand" extesion of "mazeplaza" not showing frontend pages

texts: I am using "shop by brand" extension of "Mazeplaza". But it is not working and slow down my website from frontend and backend. None of the pages regarding brands loading in frontend. I have more than 30,000 products in website.


texts: Magento 2: How to display product attribute in new window?

texts:
In the sizing section of the product pages, I want to include a link which display the item's measurements in a new window.

You can check this page from netaporter to see what I mean. When you click the "View item's measurements" link (in the "Size & Fit information" section) a new window opens. On this new window the user can check the item's measurements in a table.

The URL for that link is unique for every product (the only difference is the product ID at the end):

https://www.net-a-porter.com/am/pssizechart.nap?productID=714102

https://www.net-a-porter.com/am/pssizechart.nap?productID=715547

How can I do the same in Magento 2?


texts: Plugin class ...\DirectoryDataProcessorPlugin doesn't exist

texts:
I'm trying to create a plugin for DirectoryDataProcessor.php but I can't seem to get the di.xml to work. The LayoutProcessor in di.xml works.

I get the following error:

Plugin class BB\Checkout\Plugin\Block\DirectoryDataProcessorPlugin doesn't exist.

  etc/di.xml

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
    <plugin name="bb_checkout" type="BB\Checkout\Plugin\Block\LayoutProcessor" sortOrder="1"/>
 </type>

<type name="Magento\Checkout\Block\Checkout\DirectoryDataProcessor">
    <plugin name='bb_checkout_req'
 type='BB\Checkout\Plugin\Block\DirectoryDataProcessorPlugin'
 sortOrder='99'/>
</type>

  /BB/Checkout/Plugin/Block/DirectoryDataProcessorPlugin.php

<?php

 namespace BB\Checkout\Plugin\Block\Checkout;

 class DirectoryDataProcessorPlugin
 {
/**
 * @param \Magento\Checkout\Block\Checkout\DirectoryDataProcessor $subject
 * @param array $jsLayout
 * @return array
 */
public function afterProcess(
    \Magento\Checkout\Block\Checkout\DirectoryDataProcessor $subject,
    array  $jsLayout
) {

    return $jsLayout;
}
}

I tried changing the name and folder structure many times and have no clue on how to fix this. I just started working with Magento 2.

I also tried putting DirectoryDataProcessorPlugin in plugin/block instead of plugin/block/checkout.


texts: magento 1.9 admin is disabled . How to enable backend again?

texts:
today is magento 1.9.3 admin showing a blank page. I suppose that it is because magento 1 is not supported anylonger. However for some personal reasons, I can't go to magento 2 ! How can I enable magento 1 admin ? Thanks

I uploaded saved site and database from 3 days ago as admin were working ok ... But admin is still not working !


texts:
I have my products repository externally and only use Magento 2 to actually order these items. Similar to this question here but unfortunaly that does not have an answer or specifics about implementation. Magento should not have access to the entire repository so I do not want to create a provider for that.

Currently I have my controller implemented to add a generic product to the cart and then differenciate them using an "sku" option.

The generic "order" object Magento is getting is as follows:

[
    {
        "sku": "EV4-HI-TML90180",
        "options": [...],
        "price": 213.00
    },
    {
        "sku": "ETM-SGR-2010",
        "options": [...],
        "price": 321.00
    },
]

I am adding this to the cart as follows:

private function addItemToCart(CartItem $item)
{
    $product = $this->getProductBySku("simpleproduct");

    // Set the name and the price of the product.
    // TODO: Fix name being "Simple product" in the cart.
    $product->setName($item->getSku());
    $product->setPrice($item->getPrice());

    // Fetch the SKU option for the generic product
    $option = $this->getOptionBySku($product, 'eg-sku');
    $product->addCustomOption('option_ids', $option->getData('option_id'));
    $product->addCustomOption('option_'.$option->getData('option_id'),
        $item->getSku()); // Set the SKU option value.

    $cartItem = $this->itemFactory->create();
    $cartItem->setName($item->getSku());
    $cartItem->setCustomPrice($item->getPrice());
    $cartItem->setOriginalCustomPrice($item->getPrice());
    $cartItem->setProduct($product);

    $this->cart->getQuote()->addItem($cartItem);
}

But it is complaining about dividing by 0 (WTF?)

Warning: Division by zero in /var/www/html/vendor/magento/module-tax/Model/Calculation/AbstractAggregateCalculator.php on line 158


texts: How to get filter options using rest api in magento 2?

texts: I want to know how to get filter options using rest api in magento 2 in product list category


texts: Checkout Page Custom Field data is not saved in Magento 2

texts:
I prefer below link ant try to create custom field to checkout page in magento2 and field was created successfully but the data is not saved.

Link:-How to Add Custom fields to Checkout page in Magento2


texts: How to use with Country Name instead of Country Code?

texts:
Here is my code about shipping Estimation cost script,

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

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

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

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

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

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

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

    return $shippingRates;

}

$results = getShippingEstimate('14419','1',"IN","642001"); // Predefined Value

$count = -1;

foreach ($results as $result):
$count++;
?>
 <option value="<?php echo $result["Price"]; ?>"> <?php echo $result["Title"]." - Rs ".$result["Price"];?>
 </option>

 <?php
endforeach;

?>

How to get shipping cost based on country name instead of country code?

  FYI -  $results = getShippingEstimate('14419','1',"IN","642001");   //IN should be INDIA.


texts: What are the provisions to use Observer in free version of an extension in Magento 2 standards?

texts: I want to built an extension for magento 2 community version which allows me to get product data. Can I able to use Observer? I heard that magento commerce (magento connect - marketplace) will not allow extension which uses observer?


texts: how to show wishlist products in homepage

texts: How to show wishlist products in magento's home page. Is there any way to bring it with custom block using static blocks.


texts: color swatches not displaying in details page

texts: I have created configurable swatches for color attribute in my custom theme.The color swatch is displayed in product list page. But it is not displaying in product details page.Kindly anyone guide me to solve my issue.


texts: How do we prevent someone from adding to their cart or updating quantity a quantity greater than what's available. I'm noticing that on our Magento we can add to cart and update quantity greater than what's available. Not sure how to turn that off. The other post I found seems to update qty to max, but we're looking to just prevent it from reaching max.


texts:
We have a Magento 1.9.0 and a recent data upload messed up a lot of our product data.
We have a backup database from earlier this morning.
We don't want to restore the entire database as we have had plenty of orders since.
What tables should we grab from the backup database in order to restore JUST the catalog?


texts: Disabling payment method for frontend, but not API

texts:
I'm trying to only allow the "checkmo" payment method to be used when an order is placed through the API, but not available for a customer on the frontend to choose.

Ive tried creating a plugin that essentially does the following -

$area_code  = $this->app_state->getAreaCode();
    if($area_code != \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE){
        if($subject->getCode() == 'checkmo') {
            return false;
        }

This blocks the payment method from the frontend fine, but won't allow it to be used when the API looks at available payment methods. I'm guessing this is because the API is considered frontend.

Is there any way around this, or can another payment method be created where only API orders can access?


texts:
I'm using mandrill to send all transactional email's from my magento site but it only sends the emails that are allowed from the extension can I some how send any new created email I have tried with this code but didn't work for me any help please

<?php
    try {
        $mandrill = new Mandrill('YOUR_API_KEY');
        $message = array(
            'html' => '
Example HTML content
',
            'text' => 'Example text content',
            'subject' => 'example subject',
            'from_email' => 'message.from_email@example.com',
            'from_name' => 'Example Name',
            'to' => array(
                array(
                    'email' => 'recipient.email@example.com',
                    'name' => 'Recipient Name'
                )
            ),
            'headers' => array('Reply-To' => 'message.reply@example.com'),
            'important' => false,
            'track_opens' => null,
            'track_clicks' => null,
            'auto_text' => null,
            'auto_html' => null,
            'inline_css' => null,
            'url_strip_qs' => null,
            'preserve_recipients' => null,
            'view_content_link' => null,
            'bcc_address' => 'message.bcc_address@example.com',
            'tracking_domain' => null,
            'signing_domain' => null,
            'return_path_domain' => null,
            'merge' => true,
            'global_merge_vars' => array(
                array(
                    'name' => 'merge1',
                    'content' => 'merge1 content'
                )
            ),
            'merge_vars' => array(
                array(
                    'rcpt' => 'recipient.email@example.com',
                    'vars' => array(
                        array(
                            'name' => 'merge2',
                            'content' => 'merge2 content'
                        )
                    )
                )
            ),
            'tags' => array('password-resets'),
            'subaccount' => 'customer-123',
            'google_analytics_domains' => array('example.com'),
            'google_analytics_campaign' => 'message.from_email@example.com',
            'metadata' => array('website' => 'www.example.com'),
            'recipient_metadata' => array(
                array(
                    'rcpt' => 'recipient.email@example.com',
                    'values' => array('user_id' => 123456)
                )
            ),
            'attachments' => array(
                array(
                    'type' => 'text/plain',
                    'name' => 'myfile.txt',
                    'content' => 'ZXhhbXBsZSBmaWxl'
                )
            ),
            'images' => array(
                array(
                    'type' => 'image/png',
                    'name' => 'IMAGECID',
                    'content' => 'ZXhhbXBsZSBmaWxl'
                )
            )
        );
        $async = false;
        $ip_pool = 'Main Pool';
        $send_at = 'example send_at';
        $result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
        print_r($result);

    } catch(Mandrill_Error $e) {
        echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();

        throw $e;
    }

    ?>


texts:
I didn't know hat happen to my magento site but it seems that the order view is not working. What could be the possible reason for this?
Please help me.