texts: Magento2 - How to create a new Page Layout

texts:
I'm attempting to create a new page layout for Categories, here's what I have so far:

app/code/Karl/Subcategories/registration.php

<?php
use \Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Karl_Subcategories', __DIR__);

app/code/Karl/Subcategories/etc/module.xml

<config>
    <module name="Karl_Subcategories" setup_version="1.0.0"/>
</config>

app/code/Karl/Subcategories/view/frontend/layouts.xml

<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="subcategories">
        <label translate="true">Subcategories</label>
    </layout>
</page_layouts>

So far this is working, I now have a new option within the dropdown for "Custom Design > Page Layout".

But I'm having difficulty trying to define the actual page template which should be used and I'm unable to find much documentation on this.

app/code/Karl/Subcategories/view/frontend/page_layouts/subcategories.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">
    <referenceBlock name="root">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Karl_Subcategories::subcategories.phtml</argument>
        </action>
    </referenceBlock>
</layout>

app/code/Karl/Subcategories/view/frontend/templates/subcategories.phtml

<?php
echo 'hi';

Any help is greatly appreciated.


texts: I'm missing the Queue Newsletter option in the action dropdown on the Newsletter queue page. I can't find any explanation on the net?


texts: how to add 2 static blocks to a category page

texts:
i have a staic block called "sub categories" and i have this set to all my parent categories so when you click on them it shows the sub categories. However i also want to add another static block to the parent category to show the products that are on sale. I already have the On_sale static block created and correctly coded i just dont know how to add it to the parent category as there is only 1 drop down box for the static blocks.

Question: how to add a second static block on a category page?

Thanks for any help.


texts: “core exception: there was an error processing your order" PayPal

texts:
I am facing this error when I try to place order in magento via using paypal payment method.

Error message is: core exception: there was an error processing your order, Please contact us or try again later.

Log error is..

2015-01-21T06:58:39+00:00 ERR (3):
exception 'Exception' with message 'PayPal response hasn't required fields.' in /var/www/magento/app/code/core/Mage/Paypal/Model/Api/Nvp.php:972
Stack trace:
#0 /var/www/magento/app/code/core/Mage/Paypal/Model/Api/Nvp.php(649): Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
#1 /var/www/magento/app/code/core/Mage/Paypal/Model/Direct.php(343): Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
#2 /var/www/magento/app/code/core/Mage/Paypal/Model/Direct.php(202): Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), '128.41')
#3 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(408): Mage_Paypal_Model_Direct->capture(Object(Mage_Sales_Model_Order_Payment), '128.41')
#4 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Invoice.php(378): Mage_Sales_Model_Order_Payment->capture(Object(Mage_Sales_Model_Order_Invoice))
#5 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(569): Mage_Sales_Model_Order_Invoice->capture()
#6 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(375): Mage_Sales_Model_Order_Payment->_invoice()
#7 /var/www/magento/app/code/core/Mage/Sales/Model/Order/Payment.php(317): Mage_Sales_Model_Order_Payment->capture(NULL)
#8 /var/www/magento/app/code/core/Mage/Sales/Model/Order.php(856): Mage_Sales_Model_Order_Payment->place()
#9 /var/www/magento/app/code/core/Mage/Sales/Model/Order.php(1074): Mage_Sales_Model_Order->_placePayment()
#10 [internal function]: Mage_Sales_Model_Order->place()
#11 /var/www/magento/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#12 /var/www/magento/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#13 /var/www/magento/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#14 /var/www/magento/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#15 /var/www/magento/app/code/core/Mage/Checkout/Model/Type/Onepage.php(767): Mage_Sales_Model_Service_Quote->submitAll()
#16 /var/www/magento/app/code/local/FME/QuickCheckout/controllers/OnestepController.php(644): Mage_Checkout_Model_Type_Onepage->saveOrder()
#17 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(420): FME_QuickCheckout_OnestepController->saveOrderAction()
#18 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#19 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#20 /var/www/magento/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#21 /var/www/magento/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#22 /var/www/magento/index.php(86): Mage::run('', 'store')
#23 {main}

I am using magento 1.6.2.0 version. Please guide me what could the issue.


texts: How to store cache in centralised ID folder in magento?

texts:
Heres my problem:

I have multiple stores setup on my site.

www.xyz.com/us

www.xyz.com/uk  and so on...

Now each of these stores generates image cache that gets stored under media/catalogue as

media/catalog/product/cache/1

media/catalog/product/cache/2

media/catalog/product/cache/3

The ID at the end are the store numbers.

Now whats happening is that the cache is the more or less the same across all the stores, and after a while it takes up too much space and I exceed my allotted disk space resulting with a 503 page.

What I need:

Would it be possible to have one centralised cache folder example : media/catalog/product/cache/1 where all the stores can create and refer cache to and from, that way the same image cache isn't created across different store caches.

Example -

www.xyz.com/us/123.jpg (store ID 1)

www.xyz.com/uk/123.jpg (store ID 2)

will create image caches in

media/catalog/product/cache/1

media/catalog/product/cache/2

For the same image.

Instead can it create image cache once in media/catalog/product/cache/1 where both stores can access the cached file.


texts: Set minimum order value and enable checkout

texts:
I'm setting up a site that sells variable products, priced by area. I need to set a minimum order value to cover production costs.
I can set a minimum order value that does not allow the order to proceed and makes the customer buy more product but that isn't what I need. I can set a base price for the product with the area calculation added on to that, but that also isn't quite right.
I need the minimum basket value to be set at £50 until the product value exceeds this and can go on to reflect the size / cost of the product accordingly.
eg. product calculates at £5, basket = £50

product calculates at £30, basket = £50

product calculates at £56, basket = £56

product calculates at £120, basket = £120

I'm new to Magento and any help is very much appreciated, please be kind!


texts:
So, I created adapter:

$adapter = $this->_getWriteAdapter();

After that I added some attributes for select:

$select = $adapter->select();
$select->from(array('o' => $this->getT...
$select->joinLeft(array('address' => $this->getTable('...
$select->joinLeft(array('oh' => ...

And now select is object:
How I can submit this query and get response from DB?

Thanks in advance!

I tried:

$data = $adapter->query($select);
$data = $adapter->commit();

But it doesn't work


texts: Getting Custom Image Attribute in Frontend

texts:
I've followed a tutorial found here: https://webkul.com/blog/add-custom-image-attribute-category-magento-2/

With a slight modification which can be found in the InstallData, where I specified 'visible_on_front' :

<?php
namespace Vendor\Module\Setup;

use \Magento\Framework\Setup\ModuleContextInterface;
use \Magento\Framework\Setup\ModuleDataSetupInterface;
use \Magento\Framework\Setup\InstallDataInterface;
use \Magento\Eav\Setup\EavSetup;
use \Magento\Eav\Setup\EavSetupFactory;
use \Magento\Catalog\Setup\CategorySetupFactory;

class InstallData implements InstallDataInterface
{
    protected $_eavSetupFactory;
    protected $_categorySetupFactory;

    public function __construct(
        EavSetupFactory $eavSetupFactory,
        CategorySetupFactory $categorySetupFactory
    ) {
        $this->_eavSetupFactory = $eavSetupFactory;
        $this->_categorySetupFactory = $categorySetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);
        $setup = $this->_categorySetupFactory->create(['setup' => $setup]);
        $setup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY, 'grid_image', [
                'type' => 'varchar',
                'label' => 'Grid Image',
                'input' => 'image',
                'visible_on_front' => true,
                'backend' => 'Magento\Catalog\Model\Category\Attribute\Backend\Image',
                'required' => false,
                'sort_order' => 9,
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'group' => 'Content',
            ]
        );
    }
}

However, I am unable to access the actual attribute in the frontend.  I'm grabbing the current category via the Registry, and find that the attribute simply isn't attached (tried checking using $category->debug()).  Any ideas for how I can get access to it on the frontend?


texts: Why are bundle product tier prices a percent value?

texts:
My question is not a coding but architectural one.

So for simple products, downloadable, grouped and configurable products the tier pricing uses a monetary value for for each price e.g. 20.59 in what ever currency you are using.

When you start to work with bundle products you see that the tier price is using a percentage discount on the product's base price.

Does anyone know the reasoning behind this?


texts: Magento 2.3.5: How to set custom validation message * Required Fields

texts:
Magento 2.3.5: How to set custom validation message product details page bottom

Required Fields

Product Custom option Message Filed is Required then product details page only show message * Required Fields


texts: Transactional emails: centering an image

texts:
I am trying to center an image within my transactional e-mail in Magento 1.7.

To do so, I am using the editor under System -> Transactional Emails -> MyTemplate and inserting the style for the html with the tag style. I tried different ways but none of them is centering my image. Here's the piece of code:

How should I do for my image to be centered? Any help is much appreciated.


texts:
I have created a block and called it in my phtml file then I call that block in my cms page like this {{block class="Abc\Custom\Block\Product" template="Abc_Custom::product.phtml"}}

and some HTML code in phtml file but I don't have controllers so now how do I add CSS and js file using layout XML


texts:
Unique constraint violation found on "catalog_product_entity_tier_price".

Magento version 2.2.6:

I have migrated data Magento1 to Magento2, i but some how catalog_product_entity_tier_price for this table constraint violation issue found.

query was: INSERT INTO `catalog_product_entity_tier_price` (`entity_id`, `all_groups`, `customer_group_id`, `qty`, `value`, `percentage_value`, `website_id`) VALUES (?, ?, ?, ?, ?, ?, ?) at /var/www/html/magento2/gsp/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:580, Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '65-0-7-1.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087', query was: INSERT INTO `catalog_product_entity_tier_price` (`entity_id`, `all_groups`, `customer_group_id`, `qty`, `value`, `percentage_value`, `website_id`) VALUES (?, ?, ?, ?, ?, ?, ?) at /var/www/html/magento2/gsp/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '65-0-7-1.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087' at /var/www/html/magento2/gsp/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

CASE 1: I have set Tire price in Magento2 for all different customer Group, When I insert this entry it will violate my entry

CASE 2: For delete process not work properly

File : vendor/magento/framework/EntityManager/Operation/Update.php

This exception will comes with this file


texts: Magento2: List translation strings from a module

texts:
In order to build this CSV app/code/Vendor/Module/i18n/en_US.csv, I want to get an array from my module with all the translation-ready strings from all files types (.php, .phtml, .js, .xml).

.php & .phtml

__('string')

.js

$.mage.__('string')

.xml

<group id="general" translate="label" type="text" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1">

and

<field id="showmethod" translate="label" type="select" sortOrder="280" showInDefault="1" showInWebsite="1" showInStore="0">

and

<argument name="header" xsi:type="string" translate="true">Report Date</argument>

and

<item name="label" xsi:type="string" translate="true">CSV</item>

...

How can I get a list (array) of all the translation-ready strings from a module for creating a CSV file?


texts: How to add a foreign key with onUpdate Cascade in an M2 installer script?

texts:
I want to add a table with a foreign key in an installer script.
The foreign key should have

ONDELETE CASCADE and ONUPDATE CASCADE set, - but the ->addForeignKey method supports only the ONDELETE one.

How can I set the ONUPDATE CASCADE setting?

My code:

$table = $installer->getConnection()
            ->newTable($installer->getTable('my_new_table'))
            ->addColumn(
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                11,
                ['identity' => true, 'unsigned' => false, 'nullable' => false, 'primary' => true],
                'Entity ID'
            )
            ->addColumn(
                'store_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
                5,
                ['nullable' => false, 'unsigned' => true, 'primary' => true],
                'Store ID'
            )
->addForeignKey(
                'fk_entity_store_id',
                'entity_id',
                'my_new_table',
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
            );


texts: How to change or remove the copyright text in Magento

texts: How to modify the copyright text on Magento website?


texts:
Magento 2.3.0

It's more like an open question than a problem.

By default reindex by schedule is fired every minute. Why is that so often?

By your experience, can default cronjob be set less often and what are its consequences?


texts: Magento 2.3 filter product enable but showing disable also

texts:
Filter with simple product and status enable but showing disable also
please look at the screenshot.


texts: How to create dummy module of add to cart?

texts: I am trying to create dummy module of add to cart. but i am not getting all file path. those who know complete add to cart button module with shopping cart file path please specify complete module...


texts:
I want to sell in Magento 2 products that depend from production. I will explain this base on coffee.

Let say I have 1 Kg of seeds arabika as a simple product. This translate to 900 g of ground arabika.

I also have 1 Kg of seeds robusta as a simple product. This translate to 900g of ground robusta.

That I can achieve with bundle product. But now I have a mix of this two as mix.
900g ground arabika and 900g robusta translate to 1 mix of coffee.

Can I cherate that kinda chain?
I mention that I can have in stock 10 Kg arabika and robusta, 900 g ground arabika and robusta and 2 mix as a final boxed product.


texts: how is catalog_product_index_price / customer_group price beeing generated?

texts:
Does anybody know where magento get's the data for the price field in the table catalog_product_index_price ?

If I have 4 customer groups with ids 0 / 1 / 2 / 3 in the mentioned table I have 4 entries for price per product. That's usually the standard price.

If I define extended pricing for a customer_group then that appears in the field "tier_price".

Reason for my question is if I can use that table for individual customer_group pricing without using tier_price. But where in the database is the price for a certain customer_group stored which then is used from magento for generating the catalog_product_index_price ???

Thanks for feedback in advance,
Marc


texts:
i have a custom module (magento 1.9.2 were i want to save a frontend form in the controller I have

    $contact = Mage::getModel('logo/logo');
    $contact->setData('entity_id', $custid);
    $contact->setData('cust_img', '/media/users/pic_'.$custid.'/'.$fname);
    $contact->save();

when i manually create a DB row  for with an entity_id matching that $custid i can change it with the form (I see the change reflected in DB) , so i know everything is setup properly, but I cant get the controller to create a new row with that $custid if one does not yet exsist (the entity_id is the primary key and does not auto increment for my table it has no other columns besides these two)

<?php
$this->startSetup();
$table = new Varien_Db_Ddl_Table();
$table->setName($this->getTable('logo/logo'));
$table->addColumn(
    'entity_id',
    Varien_Db_Ddl_Table::TYPE_INTEGER,
    10,
    array(
        'primary' => true,
        'nullable'=> false,
    )
);
$table->addColumn(
    'cust_img',
    Varien_Db_Ddl_Table::TYPE_VARCHAR,
    255,
    array(
        'input'     => 'file',
        'nullable'=> false,
    )
);
$table->setOption('type', 'InnoDB');
$table->setOption('charset', 'utf8');
$this->getConnection()->createTable($table);
$this->endSetup();


texts: customer login link should be change to logout/sign out but still it is showing login

texts:
After customer login link should be change to logout / sign out but still it is showing login.

For that I have add cacheable=false from layout file when calling custom block. Also flush cache pragmatically during get customer session.

Please advice how to flush cache without command.


texts:
Magmi has Stopped Working in Magento 2. till Magento 1.9.2 it was working fine, as there is no local.xml file in magento 2. we tried by creating that file but when magmi run give this error

  Blockquote : error 1:SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.core_store' doesn't exist -

Any suggests to import bulk product in magento? as Magmi was great tool to import Bulk data.


texts: IWD Checkout extension not working in proto theme

texts: I have installed IWD Checkout M2 extension version 3.2.0 in proto theme, its giving few of errors in console please refer below screenshot and any help will be appreciated.


texts: how to remove top links from some .phtml pages

texts:
visit the link : http://2.kidsdial.com/

on top right you can see :

"My account, My wishlist...etc"

I want to hide these links from some .phtml pages.

for example from this page : http://2.kidsdial.com/marketplace/


texts:
I want to add multiple categories ids but its not working (With 1 category its working) in this widget
https://i.stack.imgur.com/dePEX.png
And also I can't view the information anymore in the front end because I have this error: We're sorry, an error has occurred while generating this content.
These are my log files...
exception.log & debug.log

[2021-02-09 08:59:44] main.CRITICAL: Notice: Undefined offset: 1 in app/design/frontend/Mimosa/mimosa5/Plazathemes_Categorytab/templates/categorytab/grid.phtml on line 160 {"exception":"[object] (Exception(code: 0): Notice: Undefined offset: 1 in app/design/frontend/Mimosa/mimosa5/Plazathemes_Categorytab/templates/categorytab/grid.phtml on line 160 at vendor/magento/framework/App/ErrorHandler.php:61)"} []

And this is the code of the file grid.phtml:
<?php
    $catIds = $_item->getCategoryIds();
    $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $object_manager = $_objectManager->create('Magento\Catalog\Model\Category')->load($catIds[1]);
?>
<a href="<?php echo $object_manager->getUrl(); ?>" class="cate"><?php echo $object_manager->getName(); ?>

<?php if ($templateType): ?>
<?php echo $block->getReviewsSummaryHtml($_item, $templateType,true); ?>
<?php endif; ?>

    <a title="<?php echo $block->escapeHtml($_item->getName()) ?>"
        href="<?php echo $block->getProductUrl($_item) ?>"
        class="product-item-link">

        <?php echo $block->escapeHtml($_item->getName()) ?>

    <?php
        echo $block->getProductPrice($_item);
    ?>


texts: Magento 2 checkout "New Address" Button remove for some customers?

texts:
Magento 2 on the checkout Page "New Address" button. How can I add a conditional to this button for some users?

I need to hide this button for some customers if my condition is true


texts: Show default code if admin attribute field is blank

texts:
I have old code that displays a pdf from the media folder. It shows if there is a file named for it. But now for the customer to enter a NEW pdf I created an attribute called pdf_download where they can paste in the file path in the admin and it appears on the page. Currently both pdfs show when a new one is entered.  I wrote a small snippet at the bottom creating $specsheet.  Ultimately I would like for the script to hide the old code if the admin field is populated. When I impliment the small part at the bottom it kills my attribute from rendering. What am I missing?

<?php
        $_helper = Mage::helper('productattachments');
        $attachments = $_helper->getAttachmentsForProduct($this->getParentBlock()->getProduct()->getId());
    ?>

    <?php if (!empty($attachments)): ?>

        <?php  $header_attachment = Mage::getStoreConfig('attachments_module_configuration/settings_group/show_attachment_label'); ?>
        <?php if ($header_attachment != ''): ?>

<?php echo $header_attachment; ?>

        <?php endif; ?>

            <?php foreach($attachments as $attachment): ?>

                    <?php if ($_helper->isIconEnabled($attachment->getFilename()) && $_helper->getFileTypeIcon($attachment->getFilename()) !== NULL): ?>
                        <img src="<?php echo $_helper->getFileTypeIcon($attachment->getFilename()); ?>" />
                    <?php endif; ?>
                    <a href="<?php echo Mage::getUrl('productattachments/index/downloadfile', array('name' => $attachment->getFilename(), 'att_id' => $attachment->getProductattachments_id())); ?>">
                        <?php echo $attachment->getTitle(); ?>

                        <?php if ($_helper->isShowSizeEnabled()): ?>
                            <?php $file_size = $_helper->getFileSize($attachment->getFilename()); ?>
                            <?php if ($file_size != ''): ?>
                                (<?php echo $file_size; ?>)
                            <?php endif;   ?>
                        <?php endif; ?>

            <?php endforeach; ?>

    <?php endif; ?>

    <?php $specsheet = trim($_product->getPdfDownload());
      if (empty($specsheet)) {
        echo $attachment
    }
    ?>


texts: Direct Query delete with error: SQLSTATE[21000]: Cardinality violation

texts:
I'm trying to delete some data from database with direct sql query, but I get a Cardinality violation.

$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "DELETE * FROM catalog_product_super_link WHERE parent_id =" .
$_product->getId() . "AND product_id = ". $child_id . ";";
$conn->query($sql);

And the full error is:

SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s), query was: SELECT `catalog_product_entity`.* FROM `catalog_product_entity` WHERE (entity_id ='1', '3', '4', '5', '1431', '1432', '1433', '1434', '1435', '1436', '1437', '1438', '1439', '1440', '1441', '1442')

I'm not very good with sql queries... so I need a bit of help here

edit: catalog_product_super_link table

link_id  -  product_id  -  parent_id
1           1              2
2           3              2
3           4              2
4           5              2
5           6              7
6           8              7
7           9              7
8           10             7
9           11             7
10          12             7
11          13             7
15599       13             7182
12          14             7
15600       14             7182
13          15             7
14          16             7
15          17             7
16          18             7
17          19             7
18          20             7
19          21             7
20          22             7
21          23             24
22          25             24
23          26             24
24          27             24
25          28             24
26          29             24
27          30             24
...         ...            ...


texts: What's the best way to deal with soft 404 errors from Google? I have hundreds of soft 404s which are empty search result pages. I don't really want to have to manually create url rewrites for all of them.


texts: Magento 2: Get all the option label (per store scope) from attribute code

texts:
Currently my code is
use Magento\Eav\Model\Attribute;
use Magento\Eav\Model\AttributeRepository;
use Magento\Framework\Api\SearchCriteriaBuilder;

 $searchCriteria = $this->searchCriteriaBuilder->create();

 /** @var Attribute[] $attributesList */
 $attributesList = $this->attributeRepository
                  ->getList('catalog_product', $searchCriteria)
                  ->getItems();

  foreach ($attributesList as $attribute) {
      // For example; attribute code: sample (see below image)
      print_r($attribute->getStoreLabels()) //(array) Working: getting all the labels available per store scope
      foreach($attribute->getOptions() as $option){
           print_r($option->getLabel()) //(string) Working but getting the admin store scope
           print_r($option->getStoreLabels()) // NOT WORKING: gives only empty value;
      }
  }

I want to get all the labels from all store view as it can be different. Many thanks for the help!
Example of one product attribute is below:


texts: How to add subject in custom email template?

texts:
I have created custom email template in magento2. Mail function is working fine, but subject is not sent in that email. How can I add the subject in my custom email template.

$transport = $this->transportBuilder
       ->setTemplateIdentifier('my_custom_email_template')
       ->setTemplateOptions(
            [
                'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
                'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
        )
       ->setTemplateVars($vars)
       ->setFrom($sender)
       ->addTo($toEmail)
       ->getTransport();
    $transport->sendMessage();
    $this->inlineTranslation->resume();


texts: How to create custom less file? magento 2

texts:
I'm having a problem creating my own less file in my Magento 2? there's a tutorial by Alan Storm through the way he creates a custom less file is by using a module, is there a way to do it without using a module? I'm creating a breakpoint less file.

Thanks!


texts:
I'm using Magento 2.2.6 fresh install.  I have a product file that is 80MB and when I import it I get the dreaded Please Wait...  I can never get past this.

I know the import works as I have tried it with one line.
I have increased my execution time to 3600 and it still hangs.
I have tried Safari and Chrome.
I have switched to developer mode but no error messages are displayed.
I know the file uploads fine, as I can see it in the /var/importexport directory.
I have used the F12 function in Chrome to monitor the network traffic.
I have looked in the log files in the var/log - nothing.

Im running out of ideas here...  I refuse to split it up - Magento2 is meant to be able to handle this... surely??!?

Any help greatly appreciated.

Mike


texts: Order Item get price of selected custom option

texts:
I've in my order a simple product with a custom option of type radio for choose

Product price 100
() no installation service
(*) yes install it + 50 €

Now I'm exporting my order to an ERP product and in my order_item I have the total price (100+ 50) but I need to know if one of the option is selected and the option price.

My problem is How I can get the price of a product's custom option starting from an order_item object ?

I've tried the info_buyRequest and I get the option but no option price

Array (
    [info_buyRequest] => Array         (
        [uenc] => a....0lEPVU,
         [product] => 29517
         [options] => Array  (
                 [66668] => 134343 )
         [qty] => 0
         [return_url] =>
         [related_product] =>          )
   [options] => Array         (
         [0] => Array                 (
                 [label] => Servizi aggiuntivi
                 [value] => Installazione (Include trasporto al piano) e ritiro usato
                 [print_value] => Installazione (Include trasporto al piano) e ritiro usato
                 [option_id] => 66668
                 [option_type] => radio
                 [option_value] => 134343
                 [custom_view] =>                  )
      )
  )

Then after some google I'm able to load the product options using:

$product = Mage::getModel('catalog/product')->load($item->getProductId());
$options = Mage::getModel('catalog/product_option')->getProductOptionCollection($product);
                foreach ($options as $option) {

The above get me all product's custom option and respective value but, how I can match the product's custom options and the one selected in the order_item?

the option_id 66668 and the value of 13434 is only present on the table sales_flat_quote_item_option (with no price) and in the catalog_product_option_xx there is no option with id 66668...


texts: How to call KO js functions outside the template

texts:
Is it possible to access  variable addressConverter from custom js file.

Filename: Magento_Checkout/js/action/create-shipping-address.js

/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
/*global define*/
define(
    [
        'Magento_Customer/js/model/address-list',
        'Magento_Checkout/js/model/address-converter'
    ],
    function(addressList, addressConverter) {
        "use strict";
        return function(addressData) {
            var address = addressConverter.formAddressDataToQuoteAddress(addressData);
            var isAddressUpdated = addressList().some(function(currentAddress, index, addresses) {
                if (currentAddress.getKey() == address.getKey()) {
                    addresses[index] = address;
                    return true;
                }
                return false;
            });
            if (!isAddressUpdated) {
                addressList.push(address);
            } else {
                addressList.valueHasMutated();
            }
            return address;
        };
    }
);

I am trying to add custom temporary shipping address, If customer selects temporary shipping address then store pickup shipping method will display.

If customer selects any other shipping address then other shipping methods will display except store pickup method.

Can any one help how to do this.


texts: Magento 2 - Create a translatable custom model

texts:
I've created a custom model named "Post". It has some fields: a title and a content. How to make these fields translatable?

More detailed question:

The Magento 2 way to translate ? products / categories is the following : from the back-office, in a product / category edit page, you have to switch from your default language store view to a localized store view (for example: French Store View to English Store View), then edit the fields you want to translate, then save your product.

How to reproduce this behavior on my custom model?


texts: Magento order confirmation is sent to all customers

texts:
I see a strange behaviour in one of our shops: when an order is placed, the confirmation email is sent in CC to all registered customers that have an order in state "processing". It happens independent of the payment method (bank transfer and credit card are available) and the shipping method (only magento flat standard available).

The shop-setup is pretty basic with one website/store/store view. Installed extensions include nothing order- or checkout-related except the extension of the credit card's payment provider.


texts: CE 1.9 - Automatic Restock of Product by predetermined date

texts:
When we sell out of a product in magento its marked "out of stock". We then order the new stock and wait for it to arrive before manually setting the product back to "in stock". The trouble with this approach is it can often take weeks for the new stock to arrive and managing a large catalog of 10k+ products we often forget to put these products back "in stock".

We usually have a set date when we know when we will be receiving a restock delivery so if we could just put this date in to magento and have it restock on that date all our troubles would be over.

Is there a way to have magento automatically restock products on a predetermined date?


texts: What actions are necessary for PayPal's announced certificate changes?

texts:
I'm receiving warning emails from PayPal that they are making root certificate changes for SSL connections for Instant Payment Notifications (IPN).

They are making a number of changes including changing from Verisign G2 (1024-bit) to G5 (2048-bit) certificates and changing from an SHA-1 to SHA-256 hashes.

I'm not sure what actions are necessary by me to remain compatible with PayPal integration.

do I need to contact my hosting provider to explore what changes might be needed in my environment, including possible PHP versions and trusted certificate stores?
since it appears that PayPal integration for Magento is 'built-in' (not an extension) will there be necessary patches to remain compatible with PayPal?

Thanks!


texts:
I'm working on fixing a core bug so that I can do a pull request... for this I'm adding new exception type...

<?php
/**
 * AfterCommitException Exception
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Framework\Exception;

/**
 * @api
 */
class AfterCommitException extends \Exception
{
}

following the style of the other exceptions there is an @api in the doctype..

What is this promising?
What do I need to do to fulfil that promise?


texts:
I am trying to replace images for 1500 products. So, I replace the images files in Media FTP server and Images not changed in the website !
Why?

Also after I clear the Flush Catalog Images Cache and nothing changed!

Anyone can help?


texts: Magento 2 - Override default product page template file

texts:
I want to add some static data in magento 2 product page in details.phtml

So please tell me how can i override this file without create any new module :

/opt/lampp/htdocs/magento2/vendor/magento/module-catalog/view/frontend/templates/product/view/details.phtml


texts:
Guys I have a module for sending e-mail, which when sending the e-mail is arriving with the html tags, example: br span, that is, it is not being interpreted. I think the code is read by php as a string and sent as text, but I don't know how to fix it. I've never developed an email trigger module before and I don't know what to do. I've tried using php htmlentities to convert to html but it didn't work. I need help to resolve please.
my controller
$SenderText = $post['text'];

 $text = "";

        foreach ($senderItens as $itens) {
            $text .= $itens . "
";
        }

        $text .= "";

$sender = [
 'itens' => $text
]

->setTemplateVars([

 'itens' => $text
])

what do i get


texts: Magento gets stuck when generating Google Sitemap

texts:
When I try to generate my Google Sitemaps Magento loops and does not stop.
Here is sitemap url : http://www.soloshop.it/sitemap.xml

What could the problem be? Any ideas? Thanks

UPDATE 20/11/2014

I moved the entire site in localhost and google sitemap generation went fine!
On dedicated server I still have problems.
Everytime i generate the sitemap, it writes 11853 bytes and then hangs.
Ideas on how to debug the problem?
Errors that I previously reported were not related to sitemap generation, so i removed them.


texts: Magento can't see files located in local/NameSpace/ModuleName/

texts:
I've created simple module with couple controllers.
Tested on local machine - everything works fine. But when i am trying move my module to live server - my module doen't works.(I get 404 everytime i am trying to get frontednMapping/controller/action).
Module structure is

/app/code/local/Amo/module/etc/config.xml

    <?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Amo_module>
            <version>0.1.0</version>
        </Amo_module>
    </modules>
    <!-- This node contains parameters, available on frontend -->
    <frontend>
        <!-- Module aliases are located in this block -->
        <routers>
            <!-- This node's name should be the same as our alias -->
            <module>
                <!-- use parameter specifies which of basic routers needs to be used.
                This can be "standard" for frontend or "admin" for backend -->
                <use>standard</use>
                <!-- router arguments block -->
                <args>
                    <!-- This parameter specifies the full name of out module -->
                    <module>Amo_module</module>
                    <!-- This parameter sets module alias -->
                    <frontName>adtfnc</frontName>
                </args>
            </module>
        </routers>
        <layout>
            <updates>
                <helloworld>
                    <file>amomodule.xml</file>
                </helloworld>
            </updates>
        </layout>
    </frontend>
</config>

/app/code/local/Amo/module/controllers/IndexController.php

<?php
class Amo_module_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {
        echo "test data is OK";
    }

   }

/app/etc/modules/Amo_module.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Amo_module>
            <active>true</active>
            <codePool>local</codePool>
        </Amo_module>
    </modules>
</config>

On dev machine i get such info for my module:

var_dump(Mage::getConfig()->getModuleConfig('Amo_module'));
echo Mage::getUrl('module/index/index');

object(Mage_Core_Model_Config_Element)[551]
  public 'active' => string 'true' (length=4)
  public 'codePool' => string 'local' (length=5)
  public 'version' => string '0.1.0' (length=5)
http://magento.local/adtfnc/index/index/

same info on live

object(Mage_Core_Model_Config_Element)#853 (2) {
["active"]=> string(4) "true"
["codePool"]=> string(5) "local" }
http://live.server/module/index/index/

As we can there is no module version and magento(as i understand) can see frontend mapping for my module. Error.log is empty. Apache config same for dev and live machine.


texts: Magento 2.3 stock (salable quantity) is not updated quickly once order has placed

texts:
I'm working on Magento 2.3 EE.

Currently, I have displayed the salable quantity in frontend. ( It's showing the correct value that was available in the admin product grid.)

If I have placed any order means, automatically the salable quantity to be decreased. Because I have set the value of Decrease Stock When Order is Placed is set to Yes.

But the problem was if I have placed an order, the salable quantity to be reduced only the cache has been flushed. Not get reduced the quantity once the order has been placed with cache flush.

Is there any solution to avoid the quantity update without a deal with cache flush and permission.

Please give some suggestion to solve the problem.

Thanks in advance.


texts: Update checkout summary on selecting shipping method

texts:
I have moved the summary one step up in the Magento 2 checkout. I would like to update the summary once i select a shipping method.

Does anyone has suggestions how to pull this off?


texts: Magento Bundle Products Problem with the option to add new

texts:
Please help. I have a problem with the option to add new Bundle Items. He acts as if there is a limited add new option. When you add more than two options, going on the problem as the video:
http://screencast-o-matic.com/watch/c2f2j9ntaD

Magento ver. 1.8.1.0


texts: Magento 2: Upload PDF gives Unsupported image format. Error

texts:
I'm able to upload from Backend TinyMCE Editor.

But when it upload it gives "Unsupported image format." Error.

I need to overwrite that function but it's private.

Below is code what I have tried

magento\app\code\Custom\Cms\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">
    <preference for="Magento\Framework\Image\Adapter\Gd2" type="Custom\Cms\Gd2" />
    <type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
        <arguments>
            <argument name="resizeParameters" xsi:type="array">
                <item name="height" xsi:type="number">75</item>
                <item name="width" xsi:type="number">100</item>
            </argument>
            <argument name="extensions" xsi:type="array">
                <item name="allowed" xsi:type="array">
                    <item name="jpg" xsi:type="number">1</item>
                    <item name="jpeg" xsi:type="number">1</item>
                    <item name="png" xsi:type="number">1</item>
                    <item name="gif" xsi:type="number">1</item>
                    <item name="pdf" xsi:type="number">1</item>
                </item>
                <item name="image_allowed" xsi:type="array">
                    <item name="jpg" xsi:type="number">1</item>
                    <item name="jpeg" xsi:type="number">1</item>
                    <item name="png" xsi:type="number">1</item>
                    <item name="gif" xsi:type="number">1</item>
                    <item name="pdf" xsi:type="number">1</item>
                </item>
                <item name="media_allowed" xsi:type="array">
                    <item name="flv" xsi:type="number">1</item>
                    <item name="swf" xsi:type="number">1</item>
                    <item name="avi" xsi:type="number">1</item>
                    <item name="mov" xsi:type="number">1</item>
                    <item name="rm" xsi:type="number">1</item>
                    <item name="wmv" xsi:type="number">1</item>
                </item>
            </argument>
            <argument name="dirs" xsi:type="array">
                <item name="exclude" xsi:type="string"/>
                <item name="include" xsi:type="string"/>
            </argument>
        </arguments>
    </type>
</config>

magento\app\code\Custom\Cms\Gd2.php

namespace Custom\Cms;

class Gd2 extends \Magento\Framework\Image\Adapter\Gd2
{
    private function _getCallback($callbackType, $fileType = null, $unsupportedText = 'Unsupported image format.')
    {
    }
}


texts: How to read data from a csv file in magento

texts:
I have created a admin template page in magento. ON this page I created a form to browse a csv file and on click submit button I want to send this via ajax to a controller action and there I want to get csv data and insert into custom table.

Below is my code :

<input type="file" name="file" id="file" />
<button name="submit" id="import_button" value="" type="submit" onclick="importData()" >Submit</button>

and ajax is here :

function importData()
{
    var file = jQuery('input[type=file]').prop("files")[0];
        ajaxBlockUrl = '<?php echo $this->getUrl('*\/*\/import') ?>';
        new Ajax.Request(ajaxBlockUrl, {
            method: 'POST',
            parameters: {isAjax: 'true', form_key: FORM_KEY, file : file},
            onSuccess: function (response)
            {
                // success
            }
        });

}

and my controller action :

// how to I get file here
$_FILES['file']['name'];
$file = $this->getRequest()->getParam('file');

My ajax calls successfully controller action but How do I get file here and read data from it?


texts: How to load model without $objectManager and without inject dependencies?

texts:
I am reading that I should never use $objectManager directly to load model

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$subscriber = $objectManager->get('Magento\Newsletter\Model\Subscriber')->loadByEmail($email);

But I should inject an instance of model in class constructor.

public function __construct(
    ...
    \Magento\Newsletter\Model\Subscriber $subscriber
) {
    ...
    $this->_subscriber= $subscriber;
}

But now let's take one simple example of observer class:

public function execute(\Magento\Framework\Event\Observer $observer)
{
  if($this->_customerSession->isLoggedIn()){
    //check if subscribed
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $subscriber = $objectManager->get('Magento\Newsletter\Model\Subscriber')->loadByEmail($email);
    if($subscriber->getId()){
      //do some things
    }
  } elseif() {

  } elseif() {

  }
  ...
}

Only if customer is logged in we need to call subscriber model, this is only in 10%. By injecting model in constructor, we call this model in 90% of cases when we don't need it. This is just simple example, real scenario is with 4 extra models used in observer. Also checking if logged in is just example.

I don't see any sense to load 4 extra models in 90% of cases just because it looks nice. Is there any other proper method to load models or is it fine to simply use objectmanager directly?

Another example would be helper class of 10 functions that is used in different controllers and actions but only some functions require extra models. I guess it wouldn't make sense to create 10 extra helper classes for each function.

So if using objectmanager directly is not recommended what would be proper way to not load models when they are not actually needed?


texts:
How to resize product image to a perfect rectangle without white spaces at right and left.

At present we are using 1200*1200 size image, and resizing to 450*300

in result we are getting 450*300 image but white space exits

please help us to fix this issue in magento2

We are using this code presently

<?php

$_imagehelper->init($_product, $image)->resize(450, 300);

?>

Thanks in advance


texts: How to edit custom css and java script In Magento 2

texts:
How to change the less, css and java script In Magento 2?
in check the style located in pub folder?.
where i edit the styles?


texts: Dataflow import - products not showing after import

texts:
I have a file with new products. I am trying to import the products. every thing is working as it should be it is running in popup and no error what so ever.

but the products are not showing up on my admin panel neither on front end.

for your reference I have been using this method from day one but suddenly it stop working this item. regarding any new extension. yes I have installed new extension for sage pay. but I don't think this relate with import system. I have checked all the heading and matched with new exported file and match the data every thing seems ok.

I have made another change. I have deleted var/package files which some one told me not important, can this be a problem?

I need help guys. I don't have much of technical know how but can change things by reading instruction, so your quick help will be very handy.

thank you for your time.


texts: Loading an attribute on a catalog/product object

texts:
I've started working through some practice material for the Magento Certified Developer exam, and one of the questions that I ran into, and that I am still not sure about (I'm struggling to find material about this specific subject) is this:

For an attribute to be loaded on a catalog/product object, which two of the following conditions
must be satisfied? (Choose two)

A. The eav_attribute table must contain a row defining the attribute's properties and its entity type.
B. The attribute must have a backend model configured in the XML config.
C. The attribute must be part of the attribute set pertaining to the object being loaded.
D. There must be a record of the attribute on the catalog_product_super_atti:ibute table.
E. There must be a column added to the catalog_product_entity table.

My answers are A and C, is this right? If not, what is right, and why?


texts:
I am new to Magento, but building my first site in Magento 2. I have created a block in the CMS, and added it to my override/base/default.xml file like so;

<referenceContainer name="footer-container">
            <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
                <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
                <block class="Magento\Framework\View\Element\Html\Links" name="footer_links">
                    <arguments>
                        <argument name="css_class" xsi:type="string">footer links</argument>
                    </arguments>
                </block>
                <block class="Magento\Cms\Block\Block" name="footer_left">
                    <arguments>
                        <argument name="css_class" xsi:type="string">footer_left</argument>
                    </arguments>
                </block>
            </container>
        </referenceContainer>

I have added my new block inside the footer-container under the footer_links block. Its Footer_left block

Its not showing up on the front end, any ideas why please?

Thanks in advance


texts:
I have a magento site 1.7. I installed the 1.9 version and i connected new installation with the database from 1.7.

Now what should I do to move all extensions and check if they work?

I wanted to do this one by one (not all together) to check their compatibility with new version.

I did a test with a extension and it worked. But that extension had only files on app/code/community (not in another folder)

How do I know for some extension the folders and files of this extension and to move that files in new installation?


texts: Trigger checkout validation only on change event

texts:
So I have these code to validate a generated field in the shipping address: VAT number

  The requireJs: app/code/VendorName/Checkout/view/frontend/requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_Ui/js/lib/validation/validator': {
                'VendorName_Checkout/js/validation/validator-mixin': true
            }
        }
    }
};

  Validation logic: app/code/VendorName/Checkout/view/frontend/web/js/validation/validator-mixin.js

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

    return function (validator) {

        validator.addRule(
            'validate-vat-number',
            function (value) {
                //Validation Logic
            },
            $.mage.__("Invalid Vat Number")
        );

        return validator;
    };
});

  And adding the rule to the field: app/code/VendorName/Checkout/Plugin/Block/Checkout/LayoutProcessorPlugin.php

<?php
namespace VendorName\Checkout\Plugin\Block\Checkout;

use Magento\Checkout\Block\Checkout\LayoutProcessor;

/**
 * Class LayoutProcessorPlugin
 * @package VendorName\Checkout\Plugin\Block\Checkout
 */
class LayoutProcessorPlugin
{
    /**
     * @param LayoutProcessor $subject
     * @param $result
     * @return mixed
     */
    public function afterProcess(
        LayoutProcessor $subject,
        $result
    ) {
        $vatAdditionalRules = ['validate-vat-number' => true];

        $result['components']['checkout']['children']['steps']['children']['shipping-step']
        ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
        ['vat_id']['validation'] = $vatAdditionalRules;

        return $result;
    }
}

The code works well, the validation show error text right when I input any character into the field. This is all good and fun until I add AJAX to my validation logic. Due to AJAX and calling API to the third party and shit, the validation is pretty slow and it doesn't go well with the on-key-up style of Magento validation: If you're typing the VAT number instead of copying it, it will freeze at the 2nd character for a few secs, then freeze at 3rd character for a few sec, and so on.

So now I want to disable that on-key-up validation on my VAT number field and only trigger the validation on the event "change". Is there a clean Magento-way to achieve it?


texts: Migrating from Magento 1.9.4 to Magento 2.4.1 - use the The Magento Migration Tool OR do it manually?

texts:
Magento 1.9.4 to Magento 2.4.1

We need to migrate from the older version of Magento to the newest. My plan was going to be to:

Install Magento 2.4.1
Export Customers, Products and Orders via CSV files from the old Magento, correct the column headings and import into new Magento.
Configure themes

Now I came across this 'Magento Migration Tool' and I wonder if it's better to go this route? Would I need to set up the websites/stores/storefronts/categories or anything or does the Migration tool does all?
I am currently getting some Error messages in the process of trying to install the Migration tool but my hosting is looking into that. After that is resolved and I'm ready to use the tool, is it just a matter of typing the command into SSH (Putty) and waiting for the process to complete? How long are we talking? Obviously, that would depend on the size of the database but what is the average for a small store? Also, will there be other bits and pieces I would still need to do manually afterwards?


texts: Add affiliate tracking pixels in different pages in Multistore Magento

texts:
Have to add different Affiliate tracking pixels on Homepage, Product Pages & Cart.
Its a multi store Magento with different country domains - .AU, .DE, .UK

How can I add it to multiple stores ? What's the best approach for this?

A sample script for DE -
Homepage Only -

<script type="text/javascript">
var belboonTag = {};
</script>
<script type="text/javascript" src="http://containertags.belboon.de/belboonTag.js.php?pId=xxxxx&page=start&type=dynamic"></script>


texts: Magento Custom Extension - Use Product Data

texts:
I want to build a Magento extension in 1.9 which will allow me to list all of the products similar to the 'Catalog -> Manage Products' Grid but I need to add an extra input field for quanitity which is then used to generate a CSV file.

I have created a basic extension thats adds a new option to the navigation menu in the admin panel but I am currently having trouble trying to figure out how to use the product collection as a data source for the adminhtml grid. I have found a tutorial that shows you how to do this for a custom database but nothing for existing data in the Magento tables.

Can anyone give me any advice on the best way of doing this?


texts:
Do you guys know any easy way to set up Magento 2 to use external SMTP server?

We currently use MailGun.

Thanks


texts:
I am trying to achieve a price calculation with tax like follows.

Product price in magento admin (without tax): 74.78
Tax: 19%
Price + tax: 88.9882.
I need rounding of product price 2 digits. Display on website: 88.99, when calculating total price use 88.99 * number_of_products

The problem is when I add 10 products in shopping cart, total price for product is 889.91. From where there is that 1cent? It should display 889.90.

Tax calculation settings:

Update 1

I placed an order of 1000 items, opened Paypal window to pay and there was: Item price: €7.478,10. How could it be with 10 cent more if price in magento is 74.78?


texts:
I'm trying to add some extra columns into Magento's customer grid.
I've got an order count working successfully (Total amount of orders a customer has placed)

I'm trying to get the Last Order date in, but I'm unable to get it working.
Has anyone done this before or can someone point me in the right direction as to how to do this?

This is my current code, but it errors and just displays a SQL query.

    $orderTableName = Mage::getSingleton('core/resource')
        ->getTableName('sales/order');
    $collection->getSelect()
        ->joinLeft(
            array('orders' => $orderTableName),
            'orders.customer_id=e.entity_id',
            array(
                'order_count' => 'COUNT(customer_id)',
                'last_order' => 'MAX(created_at)'
            )
        );
    $collection->groupByAttribute('entity_id');


texts: Magento 2.3.1 upgrade issue : Fatal error: Uncaught TypeError: Argument 1 passed to Zend_Mail_Transport_Abstract::send()

texts:
As I have upgraded the magento system version-2.2.3 to version 2.3.1. I am facing the following error during the customer registration registration from front-end.

I am using Neklo SMTP mailer extension.

I have upgraded magneto version to 2.3.1. This niklo extension is working fine with magento version 2.2.3 version.

Help please to fix this issue.
Any help would be appriciated !

Updated the question :


texts: Magento 1.9 - how to display Magento query as a SQL string?

texts:
It works beautifully if I'm trying to get collection but it won't for single product by SKU.
for example:

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $_sku);
    echo $test =  $product->getSelect()->__toString();

How can I get sql for a single product can I?
or I must get collection with filter by sku then getSelect()....

... after a quick research ...

        $products = Mage::getModel('catalog/product')
                    ->getCollection()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED))
                    ->addAttributeToFilter('sku',$_sku);

it does the job.


texts: How can I get all quote which is active with customer ID

texts:
Is there anyway I could print out in a table in phtml the following:
Entity_id , is_active and store
Is it possible to get all active quote within a customer_id?

I want to show this in a table
I was taking a look at quote DB and I can see all the details there but not sure how to show this in a phtml


texts: Is it possible to return a set of attributes of product using rest APIs.?

texts: Is it possible to return only a set of attributes corresponding to the product by calling api/rest/products. In first stage I might not want the description to be loaded, I just needed the name, price and image url. But when I call the rest api it returns every attributes. Is it possible to restrict the attributes returned without disabling those attributes in the Roles.


texts: PHP 5.6 PCRE causes segfault on Magento 1.9.2.1 Community Edition

texts:
I'm experiencing a segfault during the cart update with a Magento 1.9.2.1 installation running on Apache 2.4 with PHP 5.6.29 (nginx 1.9 is front'ed as reverse proxy).

The problem happens when the user adds a second product in his/her cart and either it is a "configurable product" or it is a "simple product" but a configurable is already in the cart.

The problem is caused by PCRE going in a recursion|backtracking spree (not clear which one yet) and it is described in this article Segmentation fult during rollback. The main difference is that I'm on Magento 1.9 and I'm not running via cli.

I already tried what has been suggested elsewhere and put these in php.ini (even if the Magento devdoc article raccomends not to):

[PCRE]
pcre.recursion_limit = 1000
pcre.backtrack_limit = 1000

The server has neither APC nor OPcache or Xcache.

memory_limit is already at 256 MB (another suggestion found).

I've yet to change ulimit (also a suggestion found) for the Apache users because it would require a reboot and this is a production server.

Tomorrow we'll try to disable additional modules one by one, but I'd also love some additional hint from the SE community.


texts:
I have an issue in backend header logo upload image, image is not uloading. in magento2
Please find the scrrenshot below:
http://prntscr.com/fscxw6

Thanks


texts: how to define your own two different .phtml frontend pages in custom layout file in Magento?

texts: I have created a module in which i have created a custom template file which i have successfully called now. And I want to create another template file in same folder but how do I define it in layout xml file ?


texts: Magento 2 Data migration error with catalog_eav_attribute

texts:
this is my first Magneto migration, so i need a little help. Migration stops and gives

  Record structure does not contain field layered_navigation_canonical

I check in database in m1 this field exist but in m2 not exist.To continuation migration I add code to ignore this field in map.xml and map_eav.xml.dist files

<ignore>
<field>catalog_eav_attribute.layered_navigation_canonical</field>
</ignore>

But still the same error. Hope someone to help.
Thank you.


texts: What could cause random products to be removed from their categories?

texts:
I realize this is a very open ended question, but I'm hoping that someone might be able to shed some light on an issue I'm experiencing. There are over 4000 products in my Magento store. For the most part they were all categorized (possibly 1 or 2 not in a category). We are now noticing that about 2000 of our products are now  uncategorized, when literally 2 days ago everything was fine.

Has anyone ever experienced anything list this? No one who has been working on the site can think of anything they might have done to cause this and we didn't add any new extensions that weren't already on there.

Im not even sure where to begin here...

The extensions we're currently using are

Re - Authorize + Order Editor + Grid manager + Invoice Editor
Checkout Discount Code Magento Extension
MANAdev Shop by Special
Magento Store Pickup Shipping Module
PDF print-out
Enhanced Admin Grids


texts:
How can I use substr to truncate the SKU of Magento's invoices? The relevant code is:

    // draw SKU
    $lines[0][] = array(
        'text' => Mage::helper('core/string')->str_split($this->getSku($item), 19),
        'feed' => $pdf->margin['left'] + 25,
        'font_size' => $fontSize
    );


texts:
I try to change on the admin the mail address on where a copy of the mail order confirmation is send, but I can't find where and I can't update it..

Someone can help me ?


texts: Transfer magento 2 to new domain, links redirect to old one

texts:
We have a dedicated server managed with whm and cpanel for the domains.

I have created a dev version for my magento 2 website https://domain.com.

I have uploaded files and database, changed
in core_config_data table for web/unsecure/base_url and web/secure/base_url to have the new domain dev.domain.com.

Now the issue is the new domain has links who redirects to the old domain, in the top navigation, menu, account creation link, ...

The original website is multistore website with 3 stores with mode developper activated

When viewing the new domain firstime i got session error, i fixed it adding
'save_path' => '/tmp'

'session' => [
 'save' => 'files',
 'save_path' => '/tmp',
],

In app/etc/env.php

In the original website, there’s no problem related to session, is adding this config causes a problem?
I cleared cache folder var/cache

rm -rf var/cache/*
rm -rf /var/tmp/magento/*

, also with this command

php bin/magento cache:flush

also removed static files

rm -rf pub/static/adminhtml pub/static/frontend

Reindex links

bin/magento indexer:reindex

But always menu and top navigation links are from the old domain
I tried this question all links redirecting to old domain after moving to new domain and this Moved magento to new domain, admin URL redirect to old admin URL but without a solution.

Edit in I added this code to get base url in module-theme Topmenu.php file

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
var_dump($storeManager->getStore()->getBaseUrl());exit;

It returns the old website


texts: Order status randomly changes upon invoicing and shipping

texts:
Every order on my Magento store seems to be going through multiple order statuses unnecessarily before reaching it's correct status. Attached below is an example (I have numbered them for easier communication):

Let me explain what's happening here:

Customer clicks "Place order" button.
Magento saves the order and redirects to the payment gateway.

At this point, the order says "Pending" and I know that the customer has no yet completed the payment yet. At this point, the Order State is "New".

Payment gateway returns a successful payment. Status changes to "Payment Done" which I have set as a default status for order state "Processing".
Internal use, this is where we extract the order using CSV and change it to "In Production"

5 to 8. This is where things get absurd. At this point I am initiating a bulk "Create Invoice" action. Notice how it goes through all those status within 38 seconds and comes back to "Preparing Order". Note: The order state is still "Processing".

9 & 10. I again run the bulk "Ship Orders" action and this thing ends up correctly at "Shipped" with order state as "Complete" but why is it doing that twice?

Did I set up the whole state / status thing wrong? Is it the bulk action that's screwing up? What is the right way of doing this?

Attaching the screenshot of my Order Status screen as well:

Appreciate your help.

Thanks,

Jugal


texts: Get product position on category listing page

texts:
We have an online tyre store with tyres as products and car models as categories.  Since tyres can fit multiple cars, each tyre is mapped to all the car models where there is a fit.

However, each car model has certain original equipment tyres (those that come fitted from the factory on brand new cars).  We would like to highlight such tyres on the listing page for the car model with a ribbon-style icon.  The important point is that although a tyre can fit many car models, it may not be original fit for all of them (in practice it will be an original fit for only a few of them).

The strategy we have thought is to display all original fit tyres at the beginning on the listing pages by assigning them display positions less than 100.  All other tyres, which also fit the car model but are not original fit are assigned display positions greater than 100.  Therefore, simply being able to get the product position configured in the admin on the listing page would be sufficient to display an icon by checking if the position is less than 100.

I haven't been able to figure out how to get the product position on the listing page.  The important part is that I should be able to read the position even if the user sorts by something other than the position, such as, name, price, etc.


texts: Error: Class "Yandex\Allure\Adapter\AllureAdapter" does not exist

texts:
Preconditions (*)

Magento 2.3.1 upgraded from Magento 2.3.0
Php 7.2.15
OS : Ubuntu 18.04 Bionic
Phpstorm 2019.1.1
Evnironemnt : Magento development

Steps to reproduce (*)

Issue appears after upgrading magento from 2.3.0 to 2.3.1.
Removing magento/magento2-functional-testing-framework
installing latest magento/magento2-functional-testing-framework:~2.3.13
Running below commands.

  bin/magento dev:tests:run unit

OR

  vendor/phpunit/phpunit/phpunit -c dev/tests/unit/phpunit.xml.dist

These commands should run unit test on entire magento project not just on one mdoule.

NOPTE: Above commands will work if version 2.3.0 is installed directly and also for 2.3.1 if installed directly.


texts: Can view orders/invoices after update to CE 1.9.2.0

texts:
I just updated my site to latest Magento 1.9.2.0 and i am getting this while trying to view an order

PHP Fatal error:  Call to undefined method Mage_Customer_Helper_Data::getFullCustomerName() in /app/code/core/Mage/Sales/Model/Order.php on line 2060

If i comment out this line... the field is blank and everything else works fine


texts: Text in Shopping Cart page is not uppercase?

texts: I want to change shopping cart to Shopping Cart, unit price to Unit Price, remove to Remove,... How can I do that?


texts: Magento 2 + Migration from 1.7.0.2 Product view & category page giving 404 error

texts:
I have Migrate magento 1.7.0.2 to Magento 2.
( I have migrate site in local using CMD)

I have face Product detail page & Category page is giving 404 page. search is working fine.

When i console i get this Error

"NetworkError: 404 Not Found - http://localhost/projectname/category"

Below are list of system exception getting in log file.

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'paypal.partner.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'bml.right.logo' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []

[2016-04-21 11:03:04] main.CRITICAL: Broken reference: the 'store.settings.currency' tries to reorder itself towards 'store_language', but their parents are different: 'store.settings' and 'header.panel' respectively. [] []

Is there any way to solve this issue ?

Thanks


texts: Bundle Price shows different on list page vs. product page.

texts:
I have a dynamically priced Bundle Product.

It's composed of two products, product A ($10) and product B ($5).

They're part of the Bundle via a required checkbox where they're both selected by default.

On my product page, the output price for the Bundle Product is $15.

On my listing pages, the output price for the Bundle Product is $5.

Why is it displaying differently depending on the page?  I want for my listing page to also show $15.  Although I've tried changing /template/bundle/catalog/product/price.phtml, I'm wondering if I'm looking at the wrong file (the price on the product page seems to be changed via Javascript somehow, not sure).


texts: Magento2 The shipping information was unable to be saved: verify the input data and try again

texts:
While doing checkout I am seeing this issue?

I dint added any plugin for shipping. In log i am getting issue like StorePickupId does not have accessory method getStorePickupId in class Magento Checkout.

Please let me know the exact issue.


texts:
In my project, I added 2column-left layout to the home page through CMS as discussed here.

As shown in the above image, I am trying to remove the red lined section from the green lined section which has class name as col-main.

I know how to remove blocks through updation layouts but this is some kind of different. there is no template file which holds the red lined block.

Here is the excerpt code from 2columns-left.phtml :

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

If I remove the content block from the above code then nothing is changing and if I remove global_messages complete green lined section is being removed which I absolutely don't want.

I even tried to search for the template files holding by the above blocks in page.xml. but they don't hold any template file.. (weird).

Here is the page.xml excerpt code:

<block type="core/messages" name="global_messages" as="global_messages"/>
<block type="core/messages" name="messages" as="messages"/>

<block type="core/text_list" name="content" as="content" translate="label">
    Main Content Area
</block>

Not sure what is happening here..

Any help?

EDIT: I have seen just now that the content is in CMS. but will modifying CMS content will effect future magento upgrades?

Any other better way?


texts: Magento 2 in minicart popup need qty incrementer and decrementer

texts:
I want to display qty incrementer and decrementer button in minicart popup.

I refer this link. Place below code in minicart.js but it is not working

decreaseQty: function() {
            var newQty = this.qty() - 1;
            if (newQty < 1) {
                newQty = 1;
            }
            this.qty(newQty);
        },

        increaseQty: function() {
            var newQty = this.qty() + 1;
            this.qty(newQty);
        }

Also I have added below code in app/design/frontend/Vendor/Theme/Magento_Checkout/template/minicart/item/default.html

<button data-bind="click: decreaseQty">-</button>

it shows error in console unable to proceed binding

can anyone help me how to make it work. Thanks!


texts: How to edit CSS in Luma theme in Magento 2.1?

texts:
I am trying to change css of Magento 2.1 Luma theme but its not working.

What will be the better way to modify css in Magento 2.1 Luma theme ?


texts: How can I get product image from REST API as HTTPS

texts:
I use V1/getproductimage/<sku> and get product's image url from API. It returns
[
    {
        "product_image_url": "http://<host>/pub/media/catalog/product/cache/36e9cda53c678653975daba9a022fb1d/<media file>"
    }
]

I'm developing LINE chatbot, It need HTTPS URL to be action in LINE FLEX. So, I want to know how can I get product image from REST API as HTTPS. Thank you in advance.


texts: How to prevent lock wait timeout from blocking orders?

texts:
Got a lock wait timeout originating in Mage_Sales_Model_Order::_afterSave():
https://github.com/LokeyCoding/magento-mirror/blob/magento-1.8/app/code/core/Mage/Sales/Model/Order.php#L2152

Looks like it's due to a reporting query that was running for a very long time and keeping the lock for a long time:

INSERT INTO `sales_order_aggregated_updated` (`period`, `store_id`, `order_status`, `orders_count`, `total_qty_ordered`, `total_qty_invoiced`, `total_income_amount`, `total_revenue_amount`, `total_profit_amount`, `total_invoiced_amount`, `total_canceled_amount`, `total_paid_amount`, `total_refunded_amount`, `total_tax_amount`, `total_tax_amount_actual`, `total_shipping_amount`, `total_shipping_amount_actual`, `total_discount_amount`, `total_discount_amount_actual`, `exchanges`, `gifts`)
...

Haven't dug into it much yet, was thinking I should post up a question before diving in.  My inclination is to just disable the report aggregation crons entirely and rely on simple order queries (a la Aheadworks Advanced Reports) for reporting.


texts:
I am passing data from below sample .phtml file to controller:

<form name="sendsms" action="<?php $params = [];
echo $block->getUrl("admin_sms/Sendsms/SendSMS", $params); ?>" method="POST">
    Mobile Number: <input class="input-text admin__control__text" type="text" name="mobile_number">

    Message Body :<textarea class="input-text admin__control__text" name="message_body"></textarea>

    <input type="submit" name="send_sms" class="ui-button-text" value="send SMS">

</form>

Below is a controller:

<?php

namespace Vendor\module_name\Controller\Adminhtml\Sendsms;

use Magento\Backend\App\Action;

class SendSMS extends Action
{
    protected $_resultForwardFactory;

    /**
     * @param \Magento\Backend\App\Action\Context $context
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context
    )
    {
        parent::__construct($context);
    }

    /**
     * Forward to edit
     *
     * @return \Magento\Backend\Model\View\Result\Forward
     */
    public function execute()
    {
        echo "execute";
        die();
    }
}

Block file contains below getUrl function:

public function getUrl($route = '', $params = [])
{
    return $this->_urlBuilder->getUrl($route, $params);
}

When I am trying to submit form, it keep getting redirected to dashboard in admin panel.


texts: Is it possible to delete price per item in bundle product?

texts:
I have some question. We have some gourmet gift boxes which include a few products. The price is a bit higher then when you pick up all the products, so is there an option to remove/hide the price per item? And just to show total price?

Thanks in advance!


texts: How to update reference in block, using value from configuration?

texts:
That's problem: I have some block, which can change his position, regarding on some value from configuration.

 <default>
    <reference name="right">
        <block type="st1/sq1" name="right.topS22" template="st1/sq1.phtml" />
    </reference>
</default>

I have (for example, in block class the value "left" or "right" from configuration). I would to update name="" of reference, using this value.

May be, it's wrong approach and I'm digging not in right place.


texts:
I have added CMS page link to the top menu by following the below tutorial:

http://www.amitbera.com/magento2-add-a-cms-page-link-to-menu/

Since one of the custom menu items would be Home, so it should be the first item in the menu.

I want to know that how can I make some custom menu item as the first item in the top menu using the code in the tutorial.

Update: Suppose, I have 2 custom menu items, say Home and Contact. I want to make Home as the first menu item and Contact as the last menu item. Is it possible with a single plugin class? or I have to write 2 different plugins to achieve this goal?

Please help.


texts: Schedule Import Product not found in admin

texts:
Magento User guide https://docs.magento.com/m2/ee/user_guide/system/data-scheduled-import-export.html said that

  Scheduled Import/Export is implemented by default, and does not require additional configuration.

But i cannot found this admin section

  System > Data Transfer > Scheduled Imports/Exports


texts: How to display custom customer attributes in Magento admin customer view

texts:
I have created customer custom attributes using install data, and I want to display this attributes in the Magento admin customer view/personnel information section, next to customer group,

In this picture I have edited my core files and shows the customer group again , similarly I need to show the custom customer attributes, Is there any method of doing it with out editing core files.

My install data file shows below and i also required this fields in the API

$eavSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'customer_amnt',
            [
                'type'                  => 'varchar',
                'label'                 => 'Customer Amount',
                'input'                 => 'text',
                'required'              => false,
                'visible'               => true,
                'user_defined'          => true,
                'position'              => 999,
                'system'                => 0,
                'visible_on_front'      => true,
                'is_used_in_grid'       => true,
                'is_visible_in_grid'    => true,
                'is_filterable_in_grid' => true,
            ]
        );

        $eavSetup->addAttributeToSet(
            CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
            CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
            null,
            'customer_amnt');

        $customerCLV = $this->eavConfig->getAttribute(Customer::ENTITY, 'customer_amnt');
        $customerCLV->setData(
            'used_in_forms',
            ['adminhtml_checkout',
                'adminhtml_customer',
                'adminhtml_customer_address',
                'customer_account_edit',
                'customer_address_edit',
                'customer_register_address']
        );
        $customerCLV->save();


texts: How to add new facebook tracking pixel to magento site?

texts:
I wanted a facebook dynamic ads for my online store. I have searched on google but many answers i got was that i should install the facebook pixel plugin for chrome to know if the facebook pixel has installed and paste the code in success.phtml which i have done but still when i check the chrome plugin it says no facebook pixel is installed for this website. here is the facebook code

Facebook Pixel Code

Standard Events
Add standard events to your code to track specific types of actions on your website. Copy the code for the type of event you want to measure, and paste it below the pixel code on the relevant page within a


texts: Why is using {{base_url}} in a production server not recommended?

texts:
This is for intelectual purposes only, as I am curious.

Searching through google, I cannot find a definite answer to this, so as the subject says, why is it not recommended? What can go wrong?

The only ref I get is about a security warning posted here : http://www.magentocommerce.com/blog/comments/security-update-for-magento-base-url-configuration-value/
which is from a very early version of magento.

  It has come to our attention that under very specific conditions there is a security issue in Magento 1.0 through 1.0.19870 that may cause invalid links to be entered into your block cache.

Can someone maybe clarify what / how this worked, and is it still an issue.

TIA


texts: How to fix max quantity for group of customer

texts:
I just want to reverse the functionality which are given in the image or in magento.
how is it possible


texts: Is it possible to create a catalog price rule based on the range of a date?

texts:
Given an attribute of type Date, I know it's possible to create a catalog price rule based on math (=, >, <) for a given date. What I'm seeing if anyone knows about, is if it's possible to create one based on compound math.

Example
Attribute: Custom Date

Catalog Price rule:
Custom Date <= 30 days < Custom Date

so given today is 2014-12-15 , the rule would apply all products with a Custom Date of 2014-11-15 or earlier


texts:
I want to upload small, thumbnail and swatch image to many products by CSV. Images will be the same.

When I import csv, the process is showing success and I can see those images are uploaded at the backend but not showing on frontend.

I already copy images on : /pub/media/import/

Please check the image of my csv.


texts:
I have this shop:
http://tienda.mabaonline.com/en/
And I want to know how I can translate some strings in the spanish page:
http://tienda.mabaonline.com/es like "My menu" -> "Mi menu"  "Shopping bag"->"Carrito de compra"
I'll try writing in a translate.csv file but it doesn't work.

any idea?


texts: Not able to filter few columns in magento admin grid

texts:
I am not able filter few columns like sku in my custom module.Other columns are working.

<column name="sku">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">SKU</item>
                    <item name="sortOrder" xsi:type="number">10</item>
                </item>
            </argument>
        </column>

for this column filter is not working.Can any one suggest how to resolve this.


texts: Magento2 problem with redirect. Page work without www but with www i've got "The page isn’t redirecting properly"

texts: As in title when I enter to page http://example.com everything fine but when I type http://www.example.com I've got a message "The page isn’t redirecting properly". I try to change base_url and nothing happened. I try set .htaccess to .htaccess.sample and nothing changed. I try DNS records edit and nothing happened... Maybe can someone help me because I don't know how can I fix this :( I was writing with the support of my server and nobody helped me, unfortunately I hope someone can help me.


texts: Magento 2 Knockout Component after initialize hook or method

texts:
In the knockout component I have

initialize: function () {

    this._super();

    var self = this;

    ....some code....
}

I want to move the ....some code.... part into afterInitilize() method, but I can't find such a thing. Is there some hook, that runs right after initialize is done ? How can I accomplish that, if not ?


texts: How do I remove the discount code from the cart ? There are loads of examples of how to remove it from the checkout but I also need to remove it from the cart.


texts: Magento Backorders not working in the Backend

texts:
I have "Allow Backorders" enabled in System/Configuration/Inventory.
If the product has stock qty = 1 (for example), it can be ordered in any quantity via checkout, but when I try to add more than 1 of this item to order in admin, I have an error:
The requested quantity for "XXX XXX XXX" is not available.

Magento: 1.9.3.2


texts:
what are the basis on which I should define resources tag in webapi.xml.
for example if I build an api to return product information who can access it.
I've searched for that but all I found is what is acl.xml file is used for


texts: How to add configurable external JS with data- attributes in Magento 2?

texts:
I want to add external JavaScript library in my module.
It looks something like below script code
<script
src="<?php echo $block->escapeUrl($block->getJsLibUrl());?>"
data-min="<?php echo (int)$block->getMinLimit(); ?>"
data-max="<?php echo (int)$block->getMaxLimit(); ?>" async>
</script>

Here, the script URL is dynamic and data min/max values too.
I am not sure how I can add this external js library with data attributes in Magento 2 standard way. Is it fine if I will add this script in .phtml file? or is there any alternate way to add using requireJS?
Thanks for your attention and help in advance. Feel free to ask if more details are needed.


texts: Admin routing compatibility mode for extensions in not available in Magento 1.9.2.2

texts:
I have upgraded magento to 1.9.2.2, i wanted to confirm will it also install all patches including SUPEE-6788 by default..?
or we have to install SUPEE-6788 seperately in magento 1.9.2.2  ?


texts:
some strings on the site are not translated. are present in the translation dictionary and apparently correctly compiled. what could be your problem?
I forced some of these strings using online translation (admin tool) but when I make deploy the translated strings comes back in English. I have to use online translation again - change one string only and save - and at this point they all return in italian

most of these strings are in the checkout pages

how can I do a complete debugging of untranslated strings?


texts: Change shipping method names in email templates in magento

texts:
I am using matrixrates for shipping methods for my store. For some methods I have the same name but different prices, like "Standard" for above $350 and "Standard" for below $350. So programmatically I have distinct these two by putting ":2" with the below rate. so it becomes "Standard:2" I have successfully modified the front and backend to display "Standard" for both rates but in email send to customer "Standard:2" is sending. So I goes to the code deeply. New order email template is in locale/template/emai/sales/new_order.html, and for shipping details this function is used.

{{var order.getShippingDescription()}}

I found this function in Core/Mage/Checkout/Block/Onepage/Progress.php. But by changing the return value, does not effect the shipping description in email. I am wondering where this function getShippingDescription() is so I can modify it.


texts: Magento 2: My shipping method I have created function like convert weight to Grams

texts:
I have my own website in Magento2 and also use my shipping method I have created below function in Model\Service\AbstractService.php

/**
     * Convert weight to kilogram
     *
     * @param $weight
     * @param $weightUnit
     * @param int $roundPrecision
     * @return float
     */
    public function convertWeightToKg($weight, $weightUnit, $roundPrecision = 3)
    {
        return round(
            $this->_carrierHelper->convertMeasureWeight(
                $weight,
                $weightUnit,
                \Zend_Measure_Weight::KILOGRAM
            ),
            $roundPrecision
        );
    }

Now I have created new function like Convert weight to grams

so what to do for this function.
give me solution for this.


texts: New Template: Call to a member function getSource() on a non-object in /var/www/app/code/core/Mage/Catalog/Model/Product.php on line 1390

texts:
I recently installed a new template: MT Bejewelry, and this error comes out in the product page. These are the lines on the php file.

   /**
 * Get attribute text by its code
 *
 * @param $attributeCode Code of the attribute
 * @return string
 */
public function getAttributeText($attributeCode)
{
    return $this->getResource()
        ->getAttribute($attributeCode)
            ->getSource()
                ->getOptionText($this->getData($attributeCode));

Because of this error I can't see the Product Description.

How can I solve this?

Thank You.


texts: Cannot save custom product attribute via custom console command

texts:
I am trying to update a custom product attribute via a custom console command. The command runs, and the product seemingly saves; it never throws an exception or any form of error, yet the attribute is not being saved in the database.

Code from command class

foreach ($products as $k => $product) {
            if ($product->getData('price_per_unit')) {
                continue;
            }

            $priceExtVat = $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount();
            $unitsPerPack = $product->getData('units_per_pack') ?? 1;
            $pricePerUnit = $priceExtVat / (float) $unitsPerPack;

            try {
                $product->setData('price_per_unit', $pricePerUnit);
                $this->productRepository->save($product);
                $output->writeln("<info>Product PPU Updated! {$key}/{$total}</info>");
            } catch (CouldNotSaveException | InputException | StateException $e) {
                $output->writeln($e->getMessage());
            }
        }


texts:
I have developed one magento website.

In this, Menu is not coming properly in resonsive. If we click on the menu icon, that is coming simply at the top of homepage banner.

When i click on menu icon, i am getting menu like,

But, I want like,


texts: Magento 2 Minicart content not displaying

texts:
I'm working on developing my own theme by extending the Magento Blank theme.

I'm trying to add the minicart to my header.phtml file.

I'm loading the minicart in my header like so:

<?php echo $this->getLayout()
      ->createBlock('Magento\Checkout\Block\Cart\Sidebar')
      ->setTemplate('Magento_Checkout::cart/minicart.phtml')
      ->toHtml(); ?>

The minicart shows on the frontend, but does not load the content, see link:
https://prnt.sc/mrrgli

Is there anything I'm missing?


texts:
I am trying to create an Observer to automatically create and email shipment to the customer whenever a new invoice is created.

I am having trouble created the shipment as the I keep getting an exception when I try to create an invoice.

I am Observer the sales_order_invoice_register register event.

Here's my code:

public function salesOrderInvoiceShipmentCreate($observer)
{

    $orderIncrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId();

    $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
    Mage::log($order,Zend_Log::INFO,'order.log',true);

    if (!$order->getId()) {
        Mage::throwException("Order does not exist, for the Shipment process to complete");
    }

    if ($order->canShip()) {
        try {
            $shipment = Mage::getModel('sales/service_order', $order)
                ->prepareShipment($this->_getItemQtys($order));

            $shipmentCarrierCode = '';
            $shipmentCarrierTitle = '';

            $arrTracking = array(
                'carrier_code' => isset($shipmentCarrierCode) ? $shipmentCarrierCode : $order->getShippingCarrier()->getCarrierCode(),
                'title' => isset($shipmentCarrierTitle) ? $shipmentCarrierTitle : $order->getShippingCarrier()->getConfigData('title'),
            );

            $track = Mage::getModel('sales/order_shipment_track')->addData($arrTracking);
            $shipment->addTrack($track);

            // Register Shipment
            $shipment->register();

            // Save the Shipment
            $this->_saveShipment($shipment, $order, $customerEmailComments);

            // Finally, Save the Order
            $this->_saveOrder($order);
        } catch (Exception $e) {
            throw $e;
        }
    }
}

protected function _getItemQtys(Mage_Sales_Model_Order $order)
{
    $qty = array();

    foreach ($order->getAllItems() as $_eachItem) {
        if ($_eachItem->getParentItemId()) {
            $qty[$_eachItem->getParentItemId()] = $_eachItem->getQtyOrdered();
        } else {
            $qty[$_eachItem->getId()] = $_eachItem->getQtyOrdered();
        }
    }

    return $qty;
}

The exception is being thrown on but I can't figure out why??

Any help would be appreciated please...


texts: Extend layout data using controller/block/model

texts:
I want to create a module that changes the title and content of review tab in product page. So far I succeeded to do it using the layout in /app/design/frontend/base/default/layout/me/reviewcontainer.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0.0">
    <!-- Product view -->
    <catalog_product_view>
        <reference name="product.reviews">
            <action method="setTemplate">
                <template>my/reviewcontainer/tabs.phtml</template>
            </action>
        </reference>
        <reference name="product.info">
            <action method="unsetChild">
                <name>product.reviews</name>
            </action>
            <block type="reviewcontainer/tabs" name="product.reviews" as="reviews"
                   template="my/reviewcontainer/tabs.phtml" after="additional">
                <action method="addToParentGroup">
                    <group>detailed_info</group>
                </action>
                <action method="setTitle" translate="value">
                    <value>Reviews (xxx)</value>
                </action>
            </block>
        </reference>
    </catalog_product_view>
</layout>

My etc/config.xml looks like this:

<?xml version="1.0"?>
<config>
    <modules>
        <my_ReviewContainer>
            <version>1.0.0</version>
        </my_ReviewContainer>
    </modules>
    <!-- we are making changes to the frontend -->
    <frontend>
        <!-- we are making changes to the layout -->
        <layout>
            <!-- we are adding a new update file -->
            <updates>
                <!--
                    this child node name must be
                    unique throughout Magento
                -->
                <my_ReviewContainer>
                    <!-- the name of the layout file we are adding -->
                    <file>my/reviewcontainer.xml</file>
                </my_ReviewContainer>
            </updates>
        </layout>
    </frontend>
</config>

The template is in /app/design/frontend/base/default/template/my/reviewcontainer/tabs.phtml and has basic HTML.

Is it possible to change the Reviews (xxx) to be dynamically generated by a controller/model/block? If so, what files should I create and where should i put them (being newbie in Magento).

Second, is it possible for me to call some functions in this new controller from withing the tab template? (instead of writing HTML there).


texts: What is the best live chat extension for magento 2?

texts:
I'm looking for the live chat extension for magento 2. After my reserach I noticed that most of them have their own panel and not integrated with magento 2 in the way I would like. So if agent has to do something with order/cart

is  there an extension which offer features like:

agent has access to quote/order of customer and can add/remove items
agent can see which product is being viewed by the customer

I generally need the extension which has the best integration with magento 2


texts: The picture does not appear after the save

texts:
why
after I save, the picture does not appear?


texts: Magento 1.9.2.3 : Google Chrome Security Update make payment redirect page error

texts:
I am using Magento 1.9.2.3, after successful payment page redirect to https://domain.in/checkout/cart/  Screenshot: https://snipboard.io/G5L4ej.jpg
Error :
After successful payment return Shopping Cart is Empty message instead of the success page.
Note: Is it recommended to set Google cookie SameSite to temporarily solve this issue?
How to solve this issue? Get & Post method error.


texts: Magento2 Billing address issue for paypal

texts:
When I registered new customer and place order via paypal for virtual and downloadable product It will not ask me for billing and shipping address.

But will display billing address in {{var telephone}} style in customer account and in admin, and blank in email.