texts: Why is getUrlPath($category) not including the product's URL key?

texts:
Calling getUrlPath($category) on a product isn't including the product's url key / suffix?

E.g. it will return /category_name/subcategory_name while I am expecting /category_name/subcategory_name/product_name

From the docs I've read getUrlPath should include everything after the base URL.  If this is not the case, what is the best way to get the full URL for a product while providing the category?

Here is a simple test case code-wise:

$product = Mage::getModel('catalog/product')->load(123);
$category = Mage::getModel('catalog/category')->load(456);

echo $product->getUrlPath($category);

Product ID 123's url key is 'test-product'.
Category ID 456's url key is 'subcat1', and it is a child of 'cat1'.

There are no suffixes on category or product pages.

The expected output would be /cat1/subcat1/test-product.  The actual output is /cat1/subcat1/.

I have seen many examples where getUrlPath includes the product's URL key (test-product) and from my understanding it should.  If this is not the case, how can I get what I am looking for.  I did consider pulling the URL key directly (also tried a slightly hacked together option - basename($product->getProductUrl()), but the url key can be changed between categories by URL rewrites when there are conflicts.


texts: Magento2.3 - How to add the double Quantity when I click add to cart on the product page?

texts:
I want to add the double quantity when I click add to cart button using event in Magento2.3.2

which function I can override for this.

Thanks in advance.


texts: Moving product/categories/sales data to clean install

texts:
I've been experiencing some quirky behaviour in my shop (due to my lack of best practices when first starting and multiple half uninstalled plugins/themes) so would like to copy my product data/sales (from M2E Pro integration) to a clean install. What is the best way to do this?

PS I ran the DB Repair Tool and it said Added missing foreign key..


texts: Check custom options of product is selected or not

texts:
I have a code to get a selected custom option values on cart page.But suppose cart item has custom options which are not required.So in this case if customer add this product to the cart but without selecting any custom options.

So now I want to know that on cart page,whether customer select any custom option or not.

I am getting an selected option using code :

$item->getBuyRequest()->getData('options');

But when customer does not select any option that time I am getting blank array like :

Array
(
  [48] =>
)

Please help me.


texts: Magento 2 My Orders->Order Shipments->Track this shipment results in Invalid method error

texts:
(magento 2.0.10)  My Orders->Order Shipments->Track this shipment->after click.

Invalid method Magento\Framework\View\Element\Template::formatDeliveryDateTime(Array
(
    [0] => 2016-11-22
    [1] => 13:20:00
)
)
0 /usr/local/nginx/html/vendor/magento/module-shipping/view/frontend/templates/tracking/details.phtml(80): Magento\Framework\DataObject->__call('formatDeliveryD...', Array)
1 /usr/local/nginx/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/usr/local/ngin...')
2 /usr/local/nginx/html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Framework\View\Element\Template), '/usr/local/ngin...', Array)
3 /usr/local/nginx/html/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/usr/local/ngin...')
4 /usr/local/nginx/html/vendor/magento/framework/View/Element/AbstractBlock.php(657): Magento\Framework\View\Element\Template->_toHtml()
5 /usr/local/nginx/html/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()

Can you help me?
I am a beginner(Green hand), please give me answer in detail.

Thanks.


texts: Cron job error SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock

texts:
Suddenly and without reason, I get error via the mail concerns a cron job that could not be executed.

Here is the report :

*[Magento\Framework\DB\Adapter\DeadlockException]
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: DELETE FROM `yjuk_cron_schedule` WHERE (status = 'pending') AND (job_code in ('ddg_automation_customer_subscriber_guest_sync', 'ddg_automation_importer', 'ddg_automation_status', 'ddg_automation_abandonedcarts', 'ddg_automation_reviews_and_wishlist', 'ddg_automation_campaign', 'ddg_automation_order_sync', 'ddg_automation_cleaner', 'ddg_automation_catalog_sync', 'ddg_automation_email_templates')) AND (created_at < '2018-08-14 12:03:03')
  [Zend_Db_Statement_Exception]

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: DELETE FROM `yjuk_cron_schedule` WHERE (status = 'pending') AND (job_code in ('ddg_automation_customer_subscriber_guest_sync', 'ddg_automation_importer', 'ddg_automation_status', 'ddg_automation_abandonedcarts', 'ddg_automation_reviews_and_wishlist', 'ddg_automation_campaign', 'ddg_automation_order_sync', 'ddg_automation_cleaner', 'ddg_automation_catalog_sync', 'ddg_automation_email_templates')) AND (created_at < '2018-08-14 12:03:03')
  [PDOException]
  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
cron:run [--group GROUP] [--bootstrap BOOTSTRAP]*

Do you know why? And how can I solve it?


texts: How to solve "Unable to apply data patch" when upgrading?

texts:
I'm upgrading my Magento 2.3.2 to Magento 2.3.5 and I'm receiving this following error during upgrade:

Module ‘Magento_Wishlist’: Unable to apply data patch
Magento\Wishlist\Setup\Patch\Data\CleanUpData for module Magento_Wishlist. Original exception
message: Unable to unserialize value. Error: Syntax error

how could I solve it?


texts: how to migrate products from Magento 1.x to Magento 2

texts:
I would like to know if I can design a process to insert products from Magento 1.x to Magento 2, using Magento ORM.

Thank you.


texts: I have created a custom attribute "test_emails" by as following Store-->Store Attributes-->Add new Attribute, I put attribute code "test_emails" , that appeared in table "eav_attribute" and the field values in "customer_address_entity_text" as shown in Pic, Where 668 is attribute id form table "eav_attribute" for "test_emails", how can I get these values


texts: Custom Admin Template doesn't seem to be working

texts:
I want to be able to use a custom template on the backend of Magento also known as the Admin Panel.  I have Magento 1.7!

In my controller:
app/code/local/Sean/AdminMerchant/controllers/AdminMerchantController.php

<?php
class Sean_AdminMerchant_AdminMerchantController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction(){
        echo $this->getFullActionName();
        $this->loadLayout();
        $this->renderLayout();
    }
}

^When I echo out getFullActionName() I receive adminhtml_adminMerchant_index

Which shows that it's getting to the controller!

app/code/local/Sean/AdminMerchant/etc/config.xml

<config>
    <modules>
        <Sean_AdminMerchant>
            <version>0.1.0</version>
        </Sean_AdminMerchant>
    </modules>
    <global>
        <helpers>
            <sean_adminmerchant>
                <class>Sean_AdminMerchant_Helper</class>
            </sean_adminmerchant>
        </helpers>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Sean_AdminMerchant after="Mage_Adminhtml">Sean_AdminMerchant</Sean_AdminMerchant>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <sean_adminmerchant>
                    <file>adminmerchant.xml</file>
                </sean_adminmerchant>
            </updates>
        </layout>
    </adminhtml>
</config>

app/design/adminhtml/default/default/layout/adminmerchant.xml

<?xml version="1.0"?>
<layout>
    <adminhtml_adminMerchant_index>
        <reference name="content">
            <block type="core/template" name="sean" template="adminmerchant/merchant.phtml" />
        </reference>
    </adminhtml_adminMerchant_index>
</layout>

app/design/adminhtml/default/default/template/adminmerchant/merchant.phtml

Hey guys! I want this to show up!

I have a feeling that there is a capital letter somewhere throwing something off.  Maybe your eyes could show me anything you see wrong!  Keep in mind my module is called AdminMerchant the M is capitalized.


texts:
I am working on a module that requires access to some tabular data provided from an external source. It's only two columns but has roughly 40000 rows.

Currently, my module is just parsing the CSV in entirety when necessary. This works well, but since the file is about 450Kb, this will eat up server resources once deployed to a production site.

I'd like to move this data to a Magento table and am having trouble.

I'm using the RDBMS methods in my setup script, ala:

$installer = $this;
$installer->startSetup();

$table = $installer->getConnection()
    ->newTable($installer->getTable('my_table'))
    ->addColumn('column_a', Varien_Db_Ddl_Table::TYPE_TEXT, 5, array(
        'nullable' => false,
        ), 'Column A')
    ->addColumn('column_b', Varien_Db_Ddl_Table::TYPE_TEXT, 3, array(
        'nullable' => false,
        ), 'Column B');

$installer->getConnection()->createTable($table);

$installer->endSetup();

This works just fine to create my table, but actually getting my data in is wracking my head (I'm still a noob when it comes to database management).

Ideally, I would just parse my CSV file and insert values into the table without having to deal with a bunch of copy/paste.

Are there any built-in methods for handling arbitrary CSV data, or are they all built to handle just what they need to? What would be the best approach to get my data into Magento?


texts: Magento 1.9 : Add form field to Admin Credit Memos

texts:
I need to add custom dropdowns to the Credit Memo create form. I read that you should be able to add a simple field without having to rewrite core code.

The following line fails in the Observer:

  $form->addFieldset();

  Fatal error: Call to a member function addFieldset() on a non-object
  in

I just can't seem to get the block for CreditMemo that contains the form object.

config.xml

<events>
  <adminhtml_block_html_before>
    <observers>
      <company_custom_creditmemo_fields>
        <type>model</type>
        <class>Company_ExtendedCreditMemo_Model_Observer</class>
        <method>addCustomsFieldsToCreditMemo</method>
      </company_custom_creditmemo_fields>
    </observers>
  </adminhtml_block_html_before>
</events>

Observer.php

<?php

class Company_ExtendedCreditMemo_Model_Observer
{
    public function addCustomsFieldsToCreditMemo(Varien_Event_Observer $observer)
    {
        $block = $observer->getBlock();
        if (!isset($block)) {
            return $this;
        }

        if ($block->getType() == 'adminhtml/sales_order_creditmemo_create_form') {
            $form = $block->getForm();
            $fieldset = $form->addFieldset('Reasons', array(
                    'legend' => 'Reason',
                    'class' => 'fieldset-wide',
                )
            );
            $fieldset->addField('select2', 'select', array(
                'label' => Mage::helper('form')->__('Select Type2'),
                'class' => 'required-entry',
                'required' => true,
                'name' => 'title',
                'onclick' => '',
                'onchange' => '',
                'value' => '4',
                'values' => array(
                '-1' => 'Please Select..',
                    '1' => array(
                        'value' => array(
                            array('value' => '2', 'label' => 'Option2'),
                            array('value' => '3', 'label' => 'Option3'), ),
                        'label' => 'Size',
                    ),
                    '2' => array(
                        'value' => array(
                            array('value' => '4', 'label' => 'Option4'),
                            array('value' => '5', 'label' => 'Option5'), ),
                        'label' => 'Color',
                    ),
                ),
                'disabled' => false,
                'readonly' => false,
                'after_element_html' => '<small>Reason</small>',
                'tabindex' => 1,
            ));
        }
    }
}


texts: How can I save all field data using customer_save_before event. I was able to receive all field data but I could not save it

texts:
I want to save all user input field data in uppercase in the database. I was able to receive all field data but I could not save it. Please guide me how to do it.
This is event file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="customer_save_before">
        <observer name="customer_address_save_before_observer" instance="ABCD\XYZ\Observer\CustomerData\CustomerDataPost" />
    </event>
</config>

This is observer file

<?php
namespace ABCD\XYZ\Observer\CustomerData\CustomerDataPost;

use Magento\Framework\Event\ObserverInterface;
use Magento\Customer\Api\CustomerRepositoryInterface;

class CustomerDataPost implements ObserverInterface
{
    protected $request;

    public function __construct(
        \Magento\Framework\App\RequestInterface $request

    )
    {
        $this->request = $request;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customerdata=$this->request->getPost();
        $customerdata['lastname']= strtoupper($customerdata['lastname']);
        $this->request->setPostValue('lastname',$customerdata['lastname']);
    }
}


texts: Magento's 1.9.1 theme email-inline.css ignored

texts:
I've read other threads about this but not resolution.

Here's how I test it:

I'm sending a test user a reset-password email.
The email arrives but without my css (which are simply RTL supporting = dir: rtl; text-align: right; ,etc...)

So far I've checked the following:

Changing email-inline.css from skin/base/frontend works.
The template itself works fine for the website and is compiled from scss.
(again it's mostly RTL support based on the default rwd scss).

/skin/rwd/mytemplate

My design/rwd/mytemplate is as follows:

<theme>
    <parent>rwd/default</parent>
</theme>

(I've tried changing it)

I've also checked the CSS permissions to be as the one on the base template email-inline.css and it didn't help.

Any help would be appreciated!


texts: Magento 2 system config Concatenate data to existing field with plugin beforeSave or aroundSave

texts:
I have a drop down field containing fruits where I would like to concatenate some data e.G:

Using a Plugin save the data like so:

Bananas are high in potassium  Where are high in potassium is the extra text added to it

Anyone any help thanks in advance!


texts: How do I connect a Magento database and a cloned repository on my local machine?

texts:
I am working with a magento 2 build via a repository clone.  I have the dumped sql database from the repository build.  I imported the sql into my localhost DB, how do I connect them so that a local build is on my local?

Also, I can't find any good documentation on working with Magento via git repository fashion. Anyone have good resources they would like to share?


texts: Where can I translate my Magento shop sitemap? I want to change name of pages and also some general text


texts: In Magento 2.3.3 is it possible resize small images

texts:
Is it possible in Magento 2.3.3 to resize small images like Gif, PNG, JPG to enlarge with quality?

As I'm doing in view.xml but it's not working.


texts: Magento 2 Data migration for only customers, categories and coupons

texts:
I want to migrate data(only customers, categories and coupons) from magento 1.9.0.1(CE) to magento 2.1.0(CE)

I am following Steps from -  http://devdocs.magento.com/guides/v2.0/migration/migration-tool-install.html for data migration.

What I understood is in
1. m2project/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.0.1/config.xml I defined source and destination database table and map.xml
And after that I run setting, data and delta migration

I am stuck with step data migration with error :

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '1-Migration_Default' for key
  'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'

If any help to solve this error, will make me proceed migration.

Also, I am unclear about :

What exactly data it transfers other that customers,orders, products.
If I have multiple stores in magento1.9 and here in magento2.1 I want single store in that case what will happen? because product will be having dependency on store.
I want yo know how to migrate only customers, categories and coupons.


texts: Magento 2: How to remove Category using category id by Mysql script

texts:
I want to remove category using MySql Script

So I can delete the category using category ID completely from magento 2 as we did in admin area category section.


texts:
I'm having an issue where, if you add comments to an order in the admin section, the whole comments box will disappear until you refresh the page.

From what I can see of the code in the back end, the ajax call is supposed to respond with nothing if the update works, but I can't see how it's supposed to be pulling the data for the updated commments for the comments box to replace the one deleted when you submit the form

If anyone has any suggestions it'd be appreciated


texts: Create A New Layout Block Magento Basket Page

texts:
So I want to change a code block (discount vouchers) on the cart page. I need to create a new file to style this block.

The existing layout file (XML) has the following code:

<checkout_cart_index>
    <reference name="checkout.cart.coupon">
        <action method="setTemplate">
            <template>rewardpoints/coupons.phtml</template>
        </action>
        <block type="rewardpoints/coupon" name="checkout_cart_coupon_normal" as="coupon_points" template="rewardpoints/reward_coupon.phtml">
            <block type="checkout/cart_coupon" name="checkout_cart_coupon_reward" as="coupon_original" template="checkout/cart/coupon.phtml"/>
        </block>
    </reference>
</checkout_cart_index>

I'm trying to copy that by adding the following below that:

    <reference name="checkout.cart.coupon.short">
        <action method="setTemplate">
            <template>rewardpoints/coupons_short.phtml</template>
        </action>
        <block type="rewardpoints/coupon" name="cart_coupon_points_short" as="coupon_points_short" template="rewardpoints/reward_coupon_short.phtml">
            <block type="checkout/cart_coupon" name="cart_coupon_points_cart" as="coupon_points_cart" template="checkout/cart/coupon_cart.phtml"/>
        </block>
    </reference>

I have created the new phtml files and for now, they contain exactly the same data. There are no ID conflicts.

These are being called with the $this->getChildHtml('coupon_points_short'); code. Needless to say, the page is just empty. White. Nothing.

Could someone please advise me how to proceed.


texts: How to Perform Invoice Capture in Magento2 Programmatically

texts:
How to capture payment for the created invoice. In Magento1.x it is like

$invoice = Mage::getModel('sales/Service_Order', $this->getOrder())->prepareInvoice();
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$invoice->register();

I have the order increment id which has order status pending. Invoice needs to be generated for that order by loading increment id and do invoice capture operation. I am expecting the invoice capture operation will set transaction id(Ex. 2121) and move the order status to completed


texts:
I've been working on getting things setup in my store and so far everything is good. I created categories and spent time loading them up with products. But it seems somewhere along the way I've lost the ability to create and edit categories from the admin.

When I save an existing category nothing changes. Nothing gets written to the database. There's no errors in any of the logs, neither the apache logs or the magento logs.

When creating a new category, I can see a record gets inserted into the catalog_category_entity table, but there's no reference in any other table. So I end up creating categories with no info attached (such as name, content etc..). They actually show up in the category tree as a no named category that I can't edit.

I've tried clearing cache, reindex, setup:upgrade, recompile.. nothing makes a difference.

Has anybody else seen this? I'm not sure what's going on since there's nothing
logged anywhere.

Thanks for any help you can offer.

Magento CE 2.1.5
MySql 5.7.17
PHP 7.0.17
Apache 2.4.6 on CentOS


texts: Magento 1.9 get custom attribute value that is a dropdown input type

texts:
I have created a custom attribute (color_materials) in Magento admin, which input type is set to dropdown. I'm trying to get this attribute value programatically, and I have the following code.

$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$this->getSku($_item));
$productOption = $product->getData('color_materials');

The output i got is a number, which is stored in catalog_product_entity_int. But I want to get it's associated text, not a number. How can I achieve this?


texts: Category tree from specific parent category

texts:
With the code below I try to get the children categories from a specific parent category with ID 7.

<?php
    $rootCatId = Mage::app()->getStore()->getRootCategoryId();

    function getTreeCategories($parentId, $isChild){
        $allCats = Mage::getModel('catalog/category')->getCollection()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('is_active','1')
                    ->addAttributeToFilter('include_in_menu','1')
                    ->addAttributeToFilter('parent_id',array('eq' => $parentId));

        $class = ($isChild) ? "sub-cat-list" : "cat-list";
        $html .= '
';
        $children = Mage::getModel('catalog/category')->getCategories(7);
        foreach ($children as $category) {
        {
            $html .= '
'.$category->getName()."";
            $subcats = $category->getChildren();
            if($subcats != ''){
                $html .= getTreeCategories($category->getId(), true);
            }
            $html .= '
';
        }
        $html .= '
';
        return $html;
    }
    $catlistHtml = getTreeCategories($rootCatId, false);

    echo $catlistHtml;

?>

With this code all categories shown. How I can get this tree only from the specific category with ID 7?


texts:
We are thinking about removing the js.phtml from our template and I can't find a reason why not.

What is Mage.Cookies for and were is it used? Did I oversaw anything?


texts:
I am trying to change the PRICE of all displays (catalog, product, shopping cart) from #66c7f1, a difficult to read blue, to black. Where do I do this?

I have searched the .css, .scss files, changed the init.xml and variations.xml where a search brought this snippet up, but no where else. Nothing changed. I'm new to this from a more traditional bg, which was a lot easier to locate :). It's probably simple once I know but right now I'm chasing my own tail. Cheers.

https://www.zapsales.com.au/staging/index.php/be-k10s.html

Inspect element:

element {
}
.product-view-detail .product-shop .price {
    font: 600 18px/1.35 Poppins, Helvetica, Arial, sans-serif;
}
.price-box span.regular-price span {
    display: inline;
}
.price-box span.price {
    margin-bottom: 0;
    display: inline-block;
}
.price {
    color: #66c7f1;
    font: 600 12px/1.35 Poppins, Helvetica, Arial, sans-serif;


texts: Magento - Can't Connect to connect20.magentocommerce.com

texts:
I have been trying to upgrade Magento from 1.9.0.1 to 1.9.2 for a few days but every time I try I get the error:

  Package community/Mage_All_Latest failed: Cannot connect to host: connect20.magentocommerce.com

Any ideas what could be causing this?


texts: Magento 2 Checkout address Add field with File type

texts:
I want to add a field with File input type in checkout page.

Ex. A field for upload resume from checkout page which can be downloadable from admin side.

Is there any options to add this kind of field?

Any help would be appreciated.
Thanks.


texts:
Please anyone see my code and resolve this issue

  Fatal error: Uncaught TypeError: Argument 1 passed to
  MyClass::__construct() must implement interface
  Magento\Framework\Session\SessionManagerInterface, none given, called
  in
  /home/dukaania/public_html/testing2/vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml
  on line 132 and defined in
  /home/dukaania/public_html/testing2/vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml:109
  Stack trace: #0

    use Magento\Framework\Session\SessionManagerInterface as CoreSession;

    class MyClass
    {

        protected $_coreSession;

        public function __construct(CoreSession $coreSession)
        {
            $this->_coreSession = $coreSession;

        }

      public function setValue($total_cost){
        $this->_coreSession->start();
        $this->_coreSession->setMessage($total_cost);

    }

    public function getValue(){
        $this->_coreSession->start();
        return $this->_coreSession->getMessage();

    }

}

$myclas = new MyClass();

 $myclas.setValue($total_cost);
 echo $myclas.getValue();


texts:
I tried to made the header to sticky and put the cart button to the header when the page slide down. I already done with the sticky header, but i can't add the cart button to the sticky header. How can i add the cart button to the sticky header?

Header not slided down yet :

Sticky header slide down :

Css :

<style type="text/css">
    .sections.sticky {
        margin: 0 auto;
        max-width: 100%;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 99;
        box-shadow: 3px 3px 3px #e4e4e4;
    }

    nav ul li ul.level0.submenu.ui-menu.ui-widget.ui-widget-content.ui-corner-all{
        overflow-y: scroll !important;
        height: 400px;
        max-height: 500px;
    }
</style>

Js :

<script type="text/javascript">
    require([ "jquery" ], function($){
        $(window).scroll(function () {
            if( $(window).scrollTop() > $('.sections').offset().top && !($('.sections').hasClass('sticky'))){
            $('.sections').addClass('sticky');
            } else if ($(window).scrollTop() == 0){
            $('.sections').removeClass('sticky');
            }
        });
    });
</script>


texts: How to get the tier pricing option for an Custom Option?

texts:
How can I get the tier pricing to apply to Custom Options within the products in Magento 1.9?

Currently it is a fixed price or percentage.

Struggling to find any concrete advice or plugins that will allow me to do so.


texts:
I know its simple to modify attributes, menu buttons etc into different languages but how do you change product content - titles and other fields?
Is there a suitable extension?


texts: how to display input with anchor link in admin grid using ui component in magento2?

texts:
I want to display product name with anchor link with specify that products' url in admin grid using ui component.

I am using magento 2.2.5 version.

    <column name="productname">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">text</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
                <item name="label" xsi:type="string" translate="true">Product Name</item>
            </item>
        </argument>
    </column>


texts: should i use ubuntu or centos 7 for magento 2 development

texts:
I have worked on windows and it is very very slow with so many errors , i need a recommendation what linux should i use for development in magento 2 .
Centos 7 , Ubuntu or anything else i want supper fast speed . (local computer)


texts: Magento always requires 'bcmath' but it is already installed

texts:
I've already installed php7.0-bcmath but my Magento application still doesn't recognize it.

Inside my php -i bcmath has this settings

bcmath

BCMath support => enabled

Directive => Local Value => Master Value
bcmath.scale => 0 => 0

Should I set the .scale to 1? If so, how?


texts: Error when creating new theme for magento 2.2

texts:
Hi I am new to magento and designing a new theme, and taking the guidance from the magento 2 theme design.

I have installed the magento 2.2 on php 7.1 and everything works fine. Now I am trying to create a new custom theme, I created a directories I have created are

a) app/frontend/designcafe/helloworld/web/css/source

b) app/frontend/designcafe/helloworld/web/fonts

c) app/frontend/designcafe/helloworld/web/images/logo.svg

d) app/frontend/designcafe/helloworld/web/js

e) app/frontend/designcafe/helloworld/registration.php

registration.php code is

<?php \Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::THEME,'frontend/designcafe/helloworld', __DIR__);

f) app/frontend/designcafe/helloworld/theme.xml

theme.xml code is

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"xsi:noNamespaceSchemaLocation="urn:magento:framework: Config/etc/theme.xsd"> <title>Hello World theme</title> <parent>Magento/blank</parent> <!-- <media>

media/preview.jpg -->

f) app/frontend/designcafe/helloworld/Magento_Theme/web/images/logo.png

g) app/frontend/designcafe/helloworld/Magento_Theme/layout/default.xml

default.xml code is

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_c
onfigu ration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_file"
xsi:type="string">Magento_Theme/images/logo.png</argument>
<argument name="logo_img_width" xsi:type="number">200</argument>
<argument name="logo_img_height" xsi:type="number">150</argument>
</arguments>
</referenceBlock>
</body>
</page>

When I load the admin http://localhost/domain/admin, I get an error

  1 exception(s): Exception #0 (Exception): Warning:
  DOMDocument::loadXML(): attributes construct error in Entity, line: 1
  in C:\xampp\htdocs\dsgn\vendor\magento\framework\Config\Theme.php on
  line 75

Please help me solve this


texts: Magento 2: Calling Restful Web service GET and POST

texts:
Any one knows how to call restful web service from Magento 2?

Please guide me with a format how it can be done.

Any links to guide me with examples of POST or GET etc.

I want to Call below URL in Magento, Please suggest me structure of module

  http://api.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo

This URL results with following Data:

{
status: {
message: "the daily limit of 30000 credits for demo has been exceeded. Please use an application specific account. Do not use the demo account for your application.",
value: 18,
    }
}

Do I have to create a module? if not where I need to Call this URL?

Thanks in Advance!


texts:
Client is trying to setup promotions via the admin but when saving and applying the promotion the server logs the following error (admin return blank screen):

  PHP Fatal error: Call to a member function getBackend() on a
  non-object in /app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php
  on line 855

Unable to find any info regarding this type of error, what may be causing it, or how to correct it.

Thanks for your help!


texts: Issues with Magento 2.1 Multi Domain Setup (1 website, multiple store views)

texts:
I have a new Magento 2.1 CE setup. I want to offer localised versions (currency) of our website. US would only allow us dollar currency, UK would only allow british pounds currency etc. So have set up:

[Website]        [Store]       [Store View]

Main Website     Main Store    Global
Main Website     Main Store    UK
Main Website     Main Store    US
Main Website     Main Store    CA

In index.php:

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'global';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);

In .htaccess file:

RewriteCond %{HTTP_HOST} ^(.*)shop\.com
RewriteRule .* – [E=MAGE_RUN_CODE:global]
RewriteCond %{HTTP_HOST} ^(.*)shop\.com
RewriteRule .* – [E=MAGE_RUN_TYPE:store]

RewriteCond %{HTTP_HOST} ^(.*)shop\.us
RewriteRule .* – [E=MAGE_RUN_CODE:us]
RewriteCond %{HTTP_HOST} ^(.*)shop\.us
RewriteRule .* – [E=MAGE_RUN_TYPE:store]

RewriteCond %{HTTP_HOST} ^(.*)shop\.ca
RewriteRule .* – [E=MAGE_RUN_CODE:ca]
RewriteCond %{HTTP_HOST} ^(.*)shop\.ca
RewriteRule .* – [E=MAGE_RUN_TYPE:store]

RewriteCond %{HTTP_HOST} ^(.*)shop\.co.uk
RewriteRule .* – [E=MAGE_RUN_CODE:uk]
RewriteCond %{HTTP_HOST} ^(.*)shop\.co.uk
RewriteRule .* – [E=MAGE_RUN_TYPE:store]

However, on its own this does not seem to do anything. As soon as I change base url for a store view, I get error pages or a 404 on homepage and am unable to enter the admin panel.

Please can someone help as to how this is done properly?

Documentation Followed:

http://devdocs.magento.com/guides/v2.1/config-guide/multi-site/ms_over.html
http://devdocs.magento.com/guides/v2.1/config-guide/multi-site/ms_apache.html


texts: How can i protect original product images?

texts:
I enabled watermark funtion of Magento, but original files still accessable from url without watermark.

Example:

Cached image url with watermark

/pub/media/catalog/product/cache/df484df48ez74849c15sd4f7780/f/f/dsf-8f48d4f.jpg

Original image url without watermark:

/pub/media/catalog/product/f/f/dsf-8f48d4f.jpg

So, if someone remove /cache/df484df48ez74849c15sd4f7780/ from url can access to original photo without watermark to steal images.

How can i protect my original images?


texts:
We face a issue with our Magento 2.3.4, we got a blank page error when we visit the frontend.

Already enabled ini_set('display_errors', 1); but still no error is displayed.

We got a debug.log file with the following errors:

[2020-03-17 10:33:01] main.INFO: Broken reference: the '' element cannot be added as child to '', because the latter doesn't exist [] []

I already tried to remove all cache etc, but I can not find and solve this issue.

Any idea how to solve this?


texts:
Is there a built-in Magento helper to escape outputted template data to prevent XSS?

Or should I just use the PHP htmlspecialchars or htmlentities functions?


texts: How to update custom column value in quote_item table magento 2

texts:
Actually i created custom column in quote_item and trying to update the value once
  product added to the cart programmatically magento2  custom module
  using Model.

  If Anyone have idea please guide me. Thanks in Advance.


texts: change magento decimal field format to use " . " instead of ","

texts:
I need to change decimal field format which uses '.' instead of ',' to separate decimal (and currency) numbers.

I use Dominican Republic pesos and our standard format is 1,000,000.00 system is showing like it was euro format.

Thanks a lot!


texts: How to resize webp image programmatically in Magento 2?

texts:
I can safely resize an image with jpg or png format like this :

public function __construct(
    \Magento\Framework\Filesystem $filesystem,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\Image\AdapterFactory $imageFactory,
) {
    $this->_filesystem = $filesystem;
    $this->_imageFactory = $imageFactory;
    $this->_storeManager = $storeManager;
}

public function resizeImage($image, $width = null, $height = null)
{
    $absolutePath = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::ROOT)->getAbsolutePath('pub/media/').$image;

    $imageResized = $this->_filesystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath('resized/'.$width.'/').$image;
    //create image factory...
    $imageResize = $this->_imageFactory->create();
    $imageResize->open($absolutePath);
    $imageResize->constrainOnly(TRUE);
    $imageResize->keepTransparency(TRUE);
    $imageResize->keepFrame(FALSE);
    $imageResize->keepAspectRatio(TRUE);
    $imageResize->resize($width,$height);
    //destination folder
    $destination = $imageResized;
    //save image
    $imageResize->save($destination);

    $resizedURL = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).'resized/'.$width.'/'.$image;

    return $resizedURL;
}

but when if i try to convert webp image, i always got an error like this:

Exception #0 (InvalidArgumentException): Unsupported image format. File: /var/www/Mage2/pub/media/banner/main.webp


texts: How to keep .phtml files lean and clean?

texts:
As its file extension suggests a .phtml file allows PHP code to be mixed with HTML. However, the fact that you can should not be seen as a license to go wild.

Why do we still see so many .phtml files riddled with lots of PHP?
And what is a good approach to reduce the amount of PHP in a .phtml file?


texts: Can't create user or log in to Magento Front End ce 1.9 with Chrome

texts:
This is a strange problem that has occurred after installing SSL on my hosting package (not sure if linked).

I am unable to create a new user or log in with an existing user at front-end (backend is fine) when using Chrome. When submitting the form the page just reloads and all fields become blank. However when viewing customers in backend the new users can be seen.

https://www.projector-screen-material.co.uk/customer/account/login/

This problem exists on my computer and computers on completly different networks that have never accessed my page before (all in the UK). However the problem does not exist when using a VPN.

After reading other answers to similar questions I have tried all of the following with no results:

Delete all cache, cookies and DNS on local computer and reset browsers.
Deleted all cache Magento, deleted var/cache and var/session
Asked friends to try on different computers on different networks
Inserted <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" /> on all login.phtml files as decribed in this post.
Removed CloudFlare and purged all of its cache.

The problem has existed for around 4 days now and it is becoming a very frustrating issue. Any insight into what the problem might be would be greatly appreciated.

I can only get log in to work with firefox


texts: How to add custom tab in product details page in magento 2.4.0

texts:
how to add a new custom tab in the product detail page in magento2

Magento_Catalog/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View\Attributes"
               name="product.custom-info.tab"
               as="custom-info.tab" template="Magento_Catalog::product/view/custom.phtml" group="detailed_info">
            <arguments>
                <argument translate="true" name="title" xsi:type="string">CUSTOM TAB</argument>
                <argument name="sort_order" xsi:type="string">20</argument>
            </arguments>
        </block>
    </referenceBlock>
  </body>
</page>

Magento_Catalog/templates/product/view/custom.phtml

<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('custom-info')
->toHtml();
?>


texts: Proper way to URL redirect from old product to new url considering SEO

texts:
I have product that have been disabled with url xyz.html.
I have new product with url abc.html
Now  i want to redirect user from xyz.html to abc.html, so am trying to created url rewrite as follows

Request Path :xyz.html
Target Path  : abc.html
Redirect : Permanant 301

It throws me errors saying Request Path already exist.Its valid as the xyz.html is already created for old product.

What would be the best way to deal with such cases also considering SEO in mind


texts: Magento 2.1.16 - Search only returning 1 page of results

texts:
Since updating to 2.1.16 our search results now only return one page of 30 results.

There is no option to view other results or other pages of search results.

Where can I investigate further?

Thanks.


texts: Save admin name to order_status change using an Observer

texts:
I am trying to figure out which event to observe in order to save the name of a logged in admin that changes an order state making it visible in the order comments.

I have been able to observe other events in order to append the admin name to order notes, credit memo and invoice creation but I can't seem to find the correct event to use.

I've tried the sales_order_save_before and sales_order_save_after but it won't same the admin name to the comments history.

Can anyone help me out please?

Here's my observer based module code:

config.xml

            <controller_action_predispatch_adminhtml_sales_order_save_before>
                <observers>
                    <module_ordercomment>
                        <class>Thaneuk_OrderComment_Model_Observer</class>
                        <method>controllerActionPredispatchAdminhtmlSalesOrderSaveBefore</method>
                    </module_ordercomment>
                </observers>
            </controller_action_predispatch_adminhtml_sales_order_save_before>
        </events>

And Observer.php

<?php

class Company_OrderComment_Model_Observer {

function controllerActionPredispatchAdminhtmlSalesOrderSaveBefore($observer)
{
    $post = Mage::app()->getRequest()->getPost('comment');
    if ($post && isset($post['comment'])) {
        $post['comment'] .= $this->_getAppend();
        Mage::app()->getRequest()->setPost('comment', $post);
    }
}

protected function _getAppend()
{
    $user     = Mage::getSingleton('admin/session');
    $username = $user->getUser()->getUsername();
    return " : " . $username;
}

}

A heads up would be appreciated!


texts: Running several thousand sites with multisite

texts:
I am a wholesaler and I sell thousands of products to over 4,500 retailers through a Magento website (1.7). The retailers in turn sell the products directly to the public. Our retailers would like us to provide them with a website that they can use as their own. In an ideal world, we would like it to work like this…

We create the 4,500 mini sites on our website and they all link to the same catalog. That way, we only need to update a product once. The retailer can go to their site, upload their own logo and select what products from the catalog they want to show on their site. Then they can add a markup to the price or turn pricing off so it is just a catalog.

Firstly, is this even possible? Is running 4,500 multi sites off one database and catalog possible? Will it cause performance, security, or any other issues? Is there a way the retailers can do all I mentioned above themselves?

Any assistance would be greatly appreciated.

Many thanks

Thanks for all the help guys, much appreciated.

Any advice on maybe doing it another way? What if i created a new sote (or one multi site) and then each company got their own page. In WordPress, on any page you can add a line of code like below to show a specific category.

  "[product_category category="mens_shirts" per_page="12" columns="3"
  orderby="price" order="asc"]"

Then we create a specific category for each retailer with their own sub categories and sub navigation on their pages.

Would this work? I know It would probably be ok on WordPress but I am very inexperienced with Magento so not sure... can a website handle 5000 plus pages each displaying catalog info?

Thanks again for all the help,
Mark


texts: Magento 2 error message when customer login failed (f.e. wrong password)

texts:
How can I output an error message on login page if customer input wrong password? I use default login-template but no error message is shown ...

Thanks!
Martin


texts: magento based on discount application tax calculation?

texts:
I have added one product to cart that price is 495 we are displaying product price including tax.but we are displaying subtotal exclude tax.

Product (V)             495.00
Sub-total               471.43
VAT @ 5%                23.57
Total                   495.00

The above tax calculating the sub total.That is default it is fine...

the tax for 471.43 vat is 23.57

But My aim is after applied discount i want calculate tax is not an subtotal i want to calculate total..

Product (V)           495.00
Sub-total             495.00
Discount              49.50 (minus)
VAT @ 5%              21.21
Total                 445.50

After discount apply i need to calculate vat i mean second one tax is 21.21.
tax is calculating 445.50

How can I customize this in Magento


texts: Magento 1.9.2.3 Product SHORT description is not displaying in the product page

texts:
I am using a custom template on 1.9.2.3 , and I have provided a short description while adding the product in Admin Panel.

I am expecting to see the SHORT description somewhere below the product Name or Above Product Price.

However, the short description is not displaying.

My question: Am I missing any configuration in the Admin panel?

Or Am I required to make some changes in the some files in order to display the short description? If yes, which file has to be modified.


texts: Migrate custom category attribute to PageBuilder value

texts:
I'm in the process of migration Magento 1.9 CE to 2.3.5 Commerce and have a custom category attribute that contains HTML code.
As I'd like to use the PageBuilder for this attribute in Magento2, I would like to transform the values while migrating (into PageBuilder syntax with 1 HTML-element).
The current status is that I can migrate this attribute, and I also have the ui components set up to show the PageBuilder in the backend.
However, the initial value from Magento1 in catalog_category_entity_text looks (naturally) a bit different from the values that get saved when editing the category. This means that either the frontend looks different for some categories, or that I have to save each category manually to achieve a unified design.
I looked over the handlers of the data migration tool, and didn't find one that suits my purpose.
Do I have to implement this myself (insights where to start appreciated), or do I miss anything?


texts: Receiving this error class XSLTProcessor does not exists

texts:
I am receiving this error. I tried with the followings:

Changing the file permission in generated folder
Tried removing cache and page_cache in var folder
Then tried removing generated folder as well

Then once I run the php -dmemory_limit=10G bin/magento setup:di:compile I am receiving this error code. How can I fix this please?


texts: Child Theme, who can point me in the right direction?

texts: I am working on a website in Magento. I've created a custom design package with a child- and a parenttheme. However, I can't get the child/perenttheme setting to work, despite all the articles (for example the article by Alan Storm) I've found on the internet. It seems that Magento doesn't fall back to the parent theme but to the base/default instead. Can this be caused by the fact that I've installed Magento website on a subdomain instead of the maindomain/directory?


texts:
When I try visiting the New Order RSS feed, it returns a 301 redirect (url i'm trying is http://{SITE_NAME}.dev/rss/order/new/ - the redirect sends me straight back the root URL of the store http://{SITE_NAME}.dev/nz/

I've got the same thing happening with MageMonkey too (this uses a /monkey/ URL).

The .htaccess i'm using:

RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]


texts: Find MIN & MAX value of product attribute in a large category

texts:
How do I find the max weight and min weight of a category with 3000 products.

I'm trying use:

public function getProductCollectionFilter($_productCollection)
{
    $_productCollection = $this->_currentCategory->getProductCollection();
    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($_productCollection);
    $weights = array();
    foreach ($_productCollection as $product) {
        $_product = Mage::getModel('catalog/product')->load($product->getId());
        $weight = $_product->getAttributeText('karma_weight');
        if (strpos($weight, 'kg') !== false) {
            $weight = str_replace('kg', '', $weight);
            $weight = (int) $weight;
            $weight = $weight * 1000;
        }
        $weight = str_replace('g', '', $weight);
        $weight = (int) $weight;
        $weights[] = $weight;
    }
    return $weights;
}

and:

public function getMaxRangeWeight()
{
    $maxWeight = 0;
    $_productCollection = $this->_currentCategory->getProductCollection();
    $weights = $this->getProductCollectionFilter($_productCollection);
    foreach ($weights as $weight){
        if ($weight > $maxWeight) $maxWeight = $weight;
    }
    return $maxWeight;
}

That work. But with a category have 500 -> 3000 product the page can't load.


texts: What is/means/does Magento\Framework\EntityManager\MetadataPool and Magento\Framework\EntityManager\Operation\ExtensionPool

texts:
There are new things we can see at Magento 2.3 in di.xml for service contracts.

let's give an example:Magento_Cms module

Like

Magento\Framework\EntityManager\MetadataPool
Magento\Framework\EntityManager\HydratorPool
Magento\Framework\EntityManager\Operation\ExtensionPool

I've seen in those classes, data interface or  Repository interface as added arguments.

Suppose:

For Magento\Framework\EntityManager\MetadataPool's metadata, Magento add
Magento\Cms\Api\Data\PageInterface as a parameter and also added entity table name and table primary key.

    <type name="Magento\Framework\EntityManager\MetadataPool">
        <arguments>
            <argument name="metadata" xsi:type="array">
                <item name="Magento\Cms\Api\Data\PageInterface" xsi:type="array">
                    <item name="entityTableName" xsi:type="string">cms_page</item>
                    <item name="identifierField" xsi:type="string">page_id</item>
                </item>
                <item name="Magento\Cms\Api\Data\BlockInterface" xsi:type="array">
                    <item name="entityTableName" xsi:type="string">cms_block</item>
                    <item name="identifierField" xsi:type="string">block_id</item>
                </item>
            </argument>
        </arguments>
    </type>

Now, My question is what is Magento\Framework\EntityManager\MetadataPool and why it's needed.
Why add Data interface, database table name and it pk field as this class parameters.
If We build a custom module(Has Database table) which has server Contract, then we need to follow this process like Cms page

Same Questions, I have for Magento\Framework\EntityManager\HydratorPool

  <type name="Magento\Framework\EntityManager\HydratorPool">
        <arguments>
            <argument name="hydrators" xsi:type="array">
                <item name="Magento\Cms\Api\Data\PageInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
                <item name="Magento\Cms\Api\Data\BlockInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
            </argument>
        </arguments>
    </type>


texts: Controller redirect to wrong location in Magento 2

texts:
I have a controller where I created a redirect to checkout/#payment like this

$resultRedirect = $this->resultRedirectFactory->create();
    $resultRedirect->setPath('checkout/#payment');

    return $resultRedirect;

When I access the controller, it redirect me at the right path, but when the page it's almost done, it change the link into checkout/noroute/ and i recive 404.

Does anyone know why this happen?


texts:
I've just upgraded to Magento 2.1.8 and my layered navigation doesn't seem to be working okay. The number of items under a particular option are incorrect and some of the options are missing. I've double checked the products in the admin section and the data is definitely present.

Did 2.1.8 break layered navigation on the category pages or has something else changed somewhere?


texts: MAGMI - Does it import attribute sets & attributes?

texts: Does MAGMI come with an Attribute Set importer? Does it come with an Attribute Importer? I am confused with the MAGMI docs. It does not look like MAGMI handles attributes and attribute sets.


texts: Magento 2: Restrict customer to use 1 coupon code

texts: I have multiple coupon codes in my store. The customer should not be able to use a coupon if he/she has already used a coupon before? Is that possible? Thanks.


texts: Admin forgot password does not work with X-Content-Type-Options nosniff header

texts:
When using nginx with X-Content-Type-Options nosniff, e.g:

add_header X-Content-Type-Options nosniff;

With location specific rewrite in server block:

location = /js/index.php/x.js {
        rewrite ^(.*\.php)/ $1 last;
}

Chrome console reveals the following:

Refused to execute script from 'http://www.{YOURDOMAIN}.com/js/index.php/x.js?f=prototype/prototype.js,prototy…s,mage/adminhtml/events.js,mage/adminhtml/form.js,scriptaculous/effects.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
captcha.js:25 Uncaught ReferenceError: Class is not defined(anonymous function) @ captcha.js:25
(index):42 Uncaught ReferenceError: varienForm is not defined


texts: Magento 2.2 : Execute customer grid reindex after customer gets locked

texts:
My question is basically on the title, I've been trying to find some event being dispatched when an user gets locked for password attempts but so far I haven't find anything, maybe I'm coming at this the wrong way but,

What I really need is to execute the customer grid indexer reindex when an user gets locked?

I tried looking at the app/code/Magento/Customer/Controller/Adminhtml/Locks/Unlock.php class but I haven't found a clue.

I would really appreciate your help in this issue.


texts: giving error "Too many arguments, expected arguments "command"." while installing magento 2.4

texts: gatting error "Too many arguments, expected arguments "command"." while installing magento2.4 through command line.


texts: Correct way to add attachment to email in magento 2.3.3+

texts:
From the release of new version of magento 2 come with some changes in code base
I can't add attachment to email anymore. My case used new TransportBuilder class extend from origin

  Magento\Framework\Mail\Template\TransportBuilder

for send email
I have searched some tutorials or guide in google but seem all of them outdates now
Is there any best way to add attachment without impact other function ? No override approach allowed here


texts:
After clearing Static Content, CPU Usage hits 100% for a while. How do I lessen that?

Basically, I clear Static Content so I can see my LESS changes, but every time I do, my CPU is just going crazy. I'm using xampp for windows, with Magento 2 installed to it, if that helps.


texts: Remove thumbnail images from category page

texts: I am trying to remove the images from the category page. I am trying to do it within the admin pannel as I only want to remove the images for one specific sub category. Can anyone help out with this?


texts: Removed parent category path - New URL's not showing up in Google search results

texts:
Last month we removed parent category path from the sub category URL's. After that we changed the sitemap file with new URL's and submit it to the webmaster tools for indexing.

For Ex: www.example.com/sub1/sub2 has been changed to www.example.com/sub2

The problem is still the new URL's are not getting indexed by Google. I have done everything like removing breadcrumbs and used "Fetch as Google" option for re-crawling, but nothing worked.

Can anyone please tell me a solution for this issue.


texts: Is it possible to do a partial payment (with 2 invoices) in magento 2 with Braintree payment method ?


texts: Other Method for call a custom customer attribute

texts:
I am doing an internship in a company, and my internship supervisor wants me to display customer data.
More precisely, on the back office in the customer information there is a custom attribute that I must retrieve.
I'm still a beginner on Magento 1, so I created a tempate in :
app / design / vendor_name / default / template / cms / template.phtml
and I'm doing this:
$_customer = Mage::getSingleton('customer/session')->getCustomer();
$customerCustomAttributeId = $_customer->getData('custom_attribute_code');
echo "
";
echo $customerCustomAttributeId ;
echo "
";

and then I display it like this :
{{block type="core/template" template="cms/cbr.phtml"}}
and it works. But my internship supervisor tells me that this is not the best method.
How could I do it otherwise? I am not asking for a solution but a clue because I am a little lost.
Hope I explained well,I'm still a beginner so there may be something that I didn't understand.
Thank you very much have a nice day.


texts: Import new categories via CSV and assign categories to existing products by SKU

texts:
I need to be able to import new categories via a CSV file and then in another column have SKUs separated with commas to not only create the new category but also assign it to those products. For example, with the following columns:

category name e.g. category1
path e.g. root/parent_category
skus e.g. sku1,sku2,sku3

The category name is the name of the category to add to Magento. The path being the location where to store the category and finally put all product SKUs in a column separated with commas to associate the newly created category with the products specified in the SKUs column.

Is this doable? Is there an extension that already does this? I have searched only but couldn't find anything. I've looked on here on Stack Exchange for answers but couldn't find anything either.

Any help would be grateful. Many thanks in advance.


texts: User registration/login not working in checkout after patch 8788

texts: After installing patch 8788 i received mails from customers that the user registration/login is not working anymore in the checkout. The user login outside the checkout page is still working.


texts:
I have a module in Magento that I am creating a package extension. I am able to create a package extension successfully which is stored in [magento]/var/connect folder. I have the package.xml,extension.xml and extension-0.0.0.0.1.tgz files created.

However, when I untar the extension-0.0.0.0.1.tgz, it is empty. Also when I try to upload the extension through Magento connect I get the error as

  CONNECT ERROR: Package file is invalid. Empty package contents section

How can I create a package of my extension properly. Can anyone please help.
I have already gone through mane links but I am not able to fix it.


texts:
my problem is that viewed products are not working for guest users.
After some hours of research I found out that the VisitorId is not generated.
Then I found out that Mage_Log is responsible for this.
Especially I'm talking about some Mage_Log observer that is not triggered:

app/code/core/Mage/Log/Model/Visitor.php

/**
 * Initialization visitor information by request
 *
 * Used in event "controller_action_predispatch"
 *
 * @param   Varien_Event_Observer $observer
 * @return  Mage_Log_Model_Visitor
 */
public function initByRequest($observer)
{
    if ($this->_skipRequestLogging || $this->isModuleIgnored($observer)) {
        return $this;
    }

    $this->setData($this->_session->getVisitorData());

    $visitorId = $this->getId();
    if (!$visitorId) {
        $this->initServerData();
        $this->setFirstVisitAt(now());
        $this->setIsNewVisitor(true);
        $this->save();
    }
    if (!$visitorId || $this->_isVisitorSessionNew()) {
        Mage::dispatchEvent('visitor_init', array('visitor' => $this));
    }
    return $this;
}

Which is defined here:
app/code/core/Mage/Log/etc/config.xml

<frontend>
    <events>
        <controller_action_predispatch>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>initByRequest</method>
                </log>
            </observers>
        </controller_action_predispatch>

But since this is some Magento default stuff, I have no idea how to debug this.
All I got so far is that controller_action_predispatch is triggered and <log> is not overwritten / used by some code/community/ or code/local/ module.

Any help?


texts:
I am using mage api to genertae order but when i generate order using shoppingCartOrder function it gives error "Credit card number mismatch with credit card type."

$proxy->shoppingCartPaymentMethod($sessionId, $quoteId, array(
                    'po_number'    => 'null',
                    'method'       => 'paypal_direct',
                    'cc_cid'       => '123',
                    'cc_owner'     => 'test',
                    'cc_number'    => '4111111111111111',
                    'cc_type'      => 'VI',
                    'cc_exp_year'  => '2022',
                    'cc_exp_month' => '12'
                    ));

    $cart_order_result=$proxy->shoppingCartOrder($sessionId, $quoteId);


texts:
I've updated from 2.1 to 2.2

Getting no response from magento CLI under PHP 7.0.27

/opt/cpanel/ea-php70/root/usr/bin/php bin/magento deploy:mode:show -vvvv
(returns nothing, appears to do nothing)

If I try using PHP5 then it at least gives an error:

/opt/cpanel/ea-php56/root/usr/bin/php bin/magento deploy:mode:show -vvvv
Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html

(Have cleared var: rm -rf var/cache/; rm -rf var/di/; rm -rf var/generation/; rm -rf var/page_cache/; )

Any ideas why magento has gone silent?


texts: How to check whether the reindex working or not in Magento?

texts:
I have seen the Index Management of our site via admin panel System->Index Management. While checking, some of the indexes haven't updated. In this case, I'm not sure whether the index is working or not.

Please see the screenshot for better understanding.

Could anyone please guide me on how to check the reindex status?


texts: Show category names in breadcrumb in product page magento 2.3.2

texts:
How can i show full category names in breadcrumb on product details page.
Currently it is coming like https://www.screencast.com/t/5o9uZEu8xnV
I want like this https://www.screencast.com/t/1pfZkoVSWLov


texts: Mobile Accordian Menu Not Working in 1.9.2.3

texts:
For some reason my Mobile Menu is no longer working. The Main Link "Collection" does expand and open, however, all other sub links don't expand.

Not sure where to look to fix. Website is http://www.jennyyoo.com


texts: Magento 2.1 get custom options for related products

texts: At product details page we have product name, price, sku etc... for related products but how can we get custom options?


texts: Rewrite catalogsearch_result_index from config.xml

texts:
I want to rewrite /catalogsearch/result/index/?q=querystring to a custom url /search/querystring.

For this I have created a custom module and in config.xml added below code :

<global>
        <rewrite>
            <custom_module>
                <from><![CDATA[/search\/(.*)/]]></from>
                <to><![CDATA[catalogsearch/result/index/$1]]></to>
                <complete>1</complete>
            </custom_module>
        </rewrite>
 ...
</global>

This rewrite code is working and rewrite to /search/?q=querystring.
But I want to rewrite to /search/querystring. For this I am trying below code :

<global>
        <rewrite>
            <custom_module>
                <from><![CDATA[/search\/(.*)/]]></from>
                <to><![CDATA[catalogsearch/result/index/?q=$1]]></to>
                <complete>1</complete>
            </custom_module>
        </rewrite>
 ...
</global>

But this code redirect url /search/querystring to home page.

How to rewrite catalogsearch/result/index/?q= to custom url?


texts: Recent orders are not appearing in the backend but exist in the database and are displayed in the dashboard

texts:
I'm using Magento 1.9.1.0.

There are three recent orders that do not appear in the Sales > Orders panel. Here is a screenshot of the most recent orders, please see the order numbers:

However, the 3 missing orders are present in the database:

The strange thing to me is that the orders also appear in the "last 5 orders" widget on the dashboard, and I can open them by clicking on them there. So Magento seems to be loading the data correctly, just not loading it into the orders grid.

Any help or suggestions is much appreciated.


texts: Magento 1: Truncate catalog_product_super_link

texts:
I am not a very experienced (Magento) Developer, and I'm running into a problem with an

  Integrity constraint violation: 1062 Duplicate entry '244344-244359'
  for key 'UNQ_CATALOG_PRODUCT_SUPER_LINK_PRODUCT_ID_PARENT_ID'

I've found that the table catalog_product_super_link is used for this and just truncated it.

I am not sure if this is 'safe' to do and what could go wrong? After truncating this everything started working again.


texts:
I need to override

  Mage->Adminhtml->Model->System->Config->Source->Notification->Frequency.php

I followed the instructions outlined in Inchoo override magento model

I tested the changes i need by editing the original mage file... which worked. I then copied that edited file to my module

  Myname->Modulename->Model->System->Config->Source->Notification->Frequency.php

Then placed the original file back in the mage folder.

I then edited the class of frequency.php:

class Myname_Modulename_Model_System_Config_Source_Notification_Frequency
{
    public function toOptionArray()
    {
        return array(
            0   => Mage::helper('adminhtml')->__('0 Minute'),
            1   => Mage::helper('adminhtml')->__('1 Hour'),
            2   => Mage::helper('adminhtml')->__('2 Hours'),
            6   => Mage::helper('adminhtml')->__('6 Hours'),
            12  => Mage::helper('adminhtml')->__('12 Hours'),
            24  => Mage::helper('adminhtml')->__('24 Hours')
        );
    }
}

I then added this to the config.xml file:

<config>
    <global>
        <models>
            <modulename>
                <rewrite>
                <item>Openstream_Notifications_Model_System_Config_Source_Notification_Frequency</item>
                </rewrite>
            </modulename>
        </models>
    </global>
</config>

But i am unable to see the override changes in the systems area, please help by telling me what i'm doing wrong. its my first time overriding a model.


texts: Elasticsearch "illegal_argument_exception" when trying to search by string type

texts:
I've setup Elasticsearch on magento and when trying to search by any string I'm getting an error

illegal_argument_exception: Invalid format: "search string"

I found out that when I removed all datetime attribute I've got another error

number_format_exception: For input string: "search string"

And I understand that now something wrong with int type attributes

When I'm searching by int everything is ok, result is there.

My suggestion - Elasticsearch created incorrect mapping (I didn't created it by hand it was done automatically after reindex products) but I wonder how to check this to be sure. Or have I ability to setup my own mapping.


texts: How Can I use dependent variables in Magento Email Templates

texts:
I would like to achieve the following in the New Order Email Template (Magento):

If (order amount > 300 EUR)
echo "some example text"
else
echo nothing

Any ideas on how I can achieve this the most simple way?

I noticed that Magento uses {{depend}} in the template, but I can't really figure out on how to solve my case.

Thanks in advance!


texts: Configurable product creating programatically not working in magento 2

texts:
I create a configurable product programmatically and after creating it shows enable field of price and stock.But when i hit save button in admin, the price and quantity become non editable.Which table its saving this change.

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
        $product_configurable = $objectManager->create('\Magento\Catalog\Model\Product');
        $product_configurable->setData('name', rand(30, 230));
        $product_configurable->setData('sku', rand(5, 340));
        $product_configurable->setAttributeSetId($set);
        $product_configurable->setTypeId('configurable');
        $product_configurable->setStatus(1);
        $product_configurable->setVisibility(4);
        $product_configurable->setPrice($wholedata['product']['price']);
        $product_configurable->setWeight($wholedata['product']['weight']);
        $product_configurable->setShortDescription($wholedata['product']['shortdes']);
        $product_configurable->setDescription($wholedata['product']['descrip']);
        $product_configurable->setWebsiteIds(array(1));
        $product_configurable->setCategoryIds(array($cat_id));
        $qty = $wholedata['product']['stock'];
        $product_configurable->setStockData(array(
                'use_config_manage_stock' => 0,
                'manage_stock' => 1,
                'min_sale_qty' => 1,
                'max_sale_qty' => 1002,
                'is_in_stock' => 0,
                'qty' => 0
            )
        );
        $product_configurable->save();
$productId = 501; // Configurable Product Id
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId); // Load Configurable Product
            $attributeModel = $objectManager->create('Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute');
            $position = 0;
            $attributes = array(90); // Super Attribute Ids Used To Create Configurable Product
            $associatedProductIds = array(456); //Product Ids Of Associated Products

            foreach ($attributes as $attributeId) {
                $data = array('attribute_id' => $attributeId, 'product_id' => $productId, 'position' => $position);
                $position++;
                $attributeModel->setData($data)->save();
            }
            $product->setTypeId("configurable"); // Setting Product Type As Configurable
            $product->setAffectConfigurableProductAttributes(4);
            $objectManager->create('Magento\ConfigurableProduct\Model\Product\Type\Configurable')->setUsedProductAttributeIds($attributes, $product);
            $product->setNewVariationsAttributeSetId(4); // Setting Attribute Set Id
            $product->setAssociatedProductIds($associatedProductIds);// Setting Associated Products
            $product->setCanSaveConfigurableAttributes(true);
            $product->save();


texts: Magento2: How to remove footer and header for the second store created?

texts:
I have created two stores in Magento2.
One is main website and the second one is retailer site.
I need to remove the footer section and the navigation bar for my retailer site.
I also need to remove the favorites section from the header only for my retailer site.

Please anyone guide me on this.

Any help would be appreciated.


texts: After enable https, magento store works as expected but magento admin dashboard gives this error.


texts:
My client wants to have specific prices for products according to a country ,moreover prices must be in user's local currency

whats should be the solution of this problem as currently the store is ready with 10000 products.

i thought that first we check incoming user ip to detect country and according to that we set users base currency ,but how could i show him specific prices according to selected country ?

for example a product which is priced 100 INR in India should be 150 INR for USA and that 150 INR should be shown in Dollars's  ,So price should be 3$ in USA


texts: Magento 2 Catalog Rule Exclude Category Condition

texts:
I need to create a catalog rule that applies a 10% discount on all products of certain brands and seasons that are not in a specific category.

I have 3 products:

price=100; brand=X; season=Y; categoryIds=3,4,5
price=100; brand=X; season=Y; categoryIds=3,4,6
price=100; brand=X; season=Y; categoryIds=3,4,7

How I created the rule:

-Info

Name=test
Status=Enabled
Websites=All selected
Customer Groups=All selected
From Date=Today date
Priority=0

-Conditions

If [ALL] of these conditions are [TRUE]:
    Brand [IS] X (selected from dropdown list)
    Season [IS] Y (selected from dropdown list)
    Category [IS NOT/NOT CONTAINS/IS NOT ONE OF] 5 (I tried
with this 3 options)

-Actions

Apply=first option selected
discount=10

Expected Result:

new price=100;
new price=90;
new price=90;

Actual Result:

new price=90;
new price=90;
new price=90;

I tried with a lot of combination but there is no way to exclude a product of a specific category.

Hope for help,
thanks in advance.


texts: Magento 2 : Currency Switcher Show Wrong Price For Configure Product

texts: I have multi currency in website but when I change currency over configured product. It is showing wrong price after change currency.


texts: Blocks HTML Cache & Sub Category Display

texts:
So I've moved my store up to 1.9.2.1 Everything is looking good except for the Blocks HTML Cache.

I'll try to explain this as best I can.

I have the common setup of using a static block calling a script to display sub-categories within a parent category.  Something similar to this tutorial

It's always worked without any hitches...Until I upgraded. The issue I'm seeing is that any category pages using this static block script to display sub-categories are failing, resulting in all of these categories displaying the same cached sub-categories page. It's like it's not re-caching and just serving up the same content to all of these pages. It means customers can't navigate through to the correct layers of the site because any Category using the sub-category script will see the same cached layout with incorrect sub categories.

I've run a Mage cleanup script to reset any strange permission issues but with no avail. As a temporary fix so my customers can actually browse the site, I've disabled the Blocks HTML Cache which fixes the issue straight away. So clearly the issue is with the Cache not serving up the content correctly or in fact, realising that a re-cache is required. How do I go about fixing this? Is there a more efficient way of serving sub-categories within parent categories that do no list individual products?

Here is the code I am using to display sub categories in a nice grid
(Pastbin):

<?php
if($_collectionSize):
    $i=0;
    $layer = Mage::getSingleton('catalog/layer');
    ?>

    <?php
    foreach ($_categories as $_category):

        $layer->setCurrentCategory($_category);
        $_category = Mage::getModel('catalog/category')->load($_category->getId());

        $products = Mage::getModel('catalog/product')->getCollection()
                                                ->addCategoryFilter($_category)
                                                ->addAttributeToSort('price', 'asc')
                                                ->setPageSize(1)
                                                ->load();

        $prod = $products->getFirstItem();
        $lowestProductPrice = $taxHelper->getPrice($prod, $prod->getPrice(), true, null, null, null, null, false);
        $formattedPrice = Mage::helper('core')->currency($lowestProductPrice, true, false);

            //$originalCategory->getThumbnail();
             $_img = ($_category->getThumbnail()) ? "/media/catalog/category/".$_category->getThumbnail() : "/media/placeholders/small.jpg";
             $_img = Mage::getBaseUrl() . $_img;
        ?>
                    <li class="item <?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
                        <a href="<?php echo $_category->getUrl(); ?>" title="<?php echo $_category->getName(); ?>" class="product-image">
                            <?php if($_img):?>
                                <img src="<?php echo $_img; ?>" alt="<?php echo $_category->getName();?>" />
                            <?php else:?>
                                <?php echo $_category->getName();?>
                            <?php endif;?>

<a href="<?php echo $helper->getCategoryUrl($_category); ?>" title="<?php echo $this->stripTags($_category->getName(), null, true) ?>"><?php echo $_category->getName(); ?>

    <?php endforeach; ?>

<?php else: ?>

<?php echo $this->__('No categories found.'); ?>

<?php endif ?>


texts: Magento 2 less compilation error while setup:static-content:deploy

texts:
After updating to Magento 2.1.16 on my staging server with nginx server and php7.0 I am facing issue in compiling less and css files.
The files styles-l.css and styles-m.css are missing - not generated.
During static contend deploy I get errors:

Compilation from source: /srv/www/rmstaging/public_html/vendor/magento/theme-frontend-blank/web/css/styles-l.less
Compilation from source:
frontend/Smartwave/porto_rtl/en_US/css/styles-l.less
variable @modal-popup-breakpoint-screen__m is undefined in file /srv/www/rmstaging/public_html/var/view_preprocessed/css/frontend/Smartwave/porto_rtl/en_US/Magento_Checkout/css/source/module/checkout/_tooltip.less in _tooltip.less on line 11, column 41

I tried many solution including on given in https://stackoverflow.com/questions/50764127/magento-2-less-compilation-error-while-setupstatic-contentdeploy-and-frontend  given by @Ashsih Raj. But did not work either.
I had the same issue on localhost but that was fixed mysteriously. I think the only change is that on my localhost I compiles using PHP7.1
Please advise.


texts: Admin wysiwig thumbnails flooding server

texts:
I've noticed that when you open the wysiwig image uploader it generates a whole bunch of PHP requests to generate thumbnails for those images. In my case it immediately kicks off about 100 requests. This makes my server grind to a halt as PHP tries to process all those requests.

Any way I can limit or prevent this?


texts: Hide an attribute in Layering Navigation for a specified category

texts:
Is it a way to hide an attribute in Layering Navigation for a specified category? I have a category which join products with different attribute sets. In this case layering navigation becomes very long as content. I would like to hide some attributes especially in that category, not in others.

Is there an extension or code to allow me using custom layout xml for that category to exclude some attributes?


texts: Magento 2.3.2-p2 Payment Methods not showing in frontend

texts:
Im editing the magento 2 shop of a friend and after playing with the configuration of the shop to add FPT the payment methods are not shown anymore to the frontend user.
But I really did not change anything in the payment method section of the admin area.
I was also playing with the themes, but its defenitly not anything todo with the files. Because restoring the old theme files does not make a difference.
Restoring the old database via SQL on the other hand makes it work again. But I really dont want to work with the old DB because in the meantime I added like 250 products with images and attributes and we got some orders so it would cause confusion with the order numbers and so on...
Where in the DB or Admin Area outside of "Payment Options" could be some configurations that cause that error?
Inspecting the HTML created by knockout.js i found that the only difference is in the section:
`

    `

In the iframe is the only thing missing since the error occurs.


texts: Magento2 factory object inject parameters

texts:
I have created a Model with a Resource model to it and a collection.

In MyModel I have defined the property

public $myProperty;

However, when I try to do

$myModel = $this->MyModuleFactory->create(['myProperty'=>5]);
var_dump($myModel->myProperty);

The value of myProperty is always NULL. How can I set the $myProperty value to 5 ?


texts: Products in Backend not loading in Magento 2 after Data Migrate from Magento 1.9.4.3

texts:
I migrate first settings then data with magento data migration tool. Everything looks good, but in Backend I try to edit some product but unsuccessful. Ajax loader stay and not closing.
I try to make reindex, deploy and compile but issue is not resolved.
In console I get this error. Please for help. Thanks


texts:
In my custom module I have overwrote the file

  app/code/Magento/module-checkout/view/frontend/layout/checkout_cart_item_renderers.xml

For overriding cart page

with the following code:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="checkout_item_price_renderers"/>
    <body>
        <referenceBlock name="checkout.cart.item.renderers">
            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="Magento_Checkout::cart/item/default.phtml">
                <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.default.actions" as="actions">
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.default.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.default.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
                </block>
            </block>
            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="Magento_Checkout::cart/item/default.phtml">
                <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.simple.actions" as="actions">
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.simple.actions.edit" template="Xxx_Checkout::cart/item/renderer/actions/edit.phtml"/>
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.simple.actions.remove" template="Xxx_Checkout::cart/item/renderer/actions/remove.phtml"/>
                </block>
            </block>
        </referenceBlock>
    </body>
</page>

My template changes applied to  simple product only. I can't see any changes in configurable product.

If anyone knows please explain to me.


texts: How to overwrite adminhtml sales order renderer?

texts:
I am a beginner in magento. I needed to add notice to admin for some special product. But I have added my modifications to core files.
I added my code to,

app / design / adminhtml / default / default / template / sales / order / view / items / renderer / default.phtml

Cause I was able to access some product attributes there and it was the best place I found.
Now I just would like to use a copy of this in,

app / design / adminhtml / default / my_newtheme /templates/..../default.phtml

and use it in my xml,

app / design / adminhtml / default / my_newtheme /layout/..../sales.phtml

But it does not work....

It is a small change for me , not some huge one that i need special block and some observer or so...or do I?


texts: How to reindex Magento 1.x by using command line

texts:
How can I reindex magento using by command line.
Kindly provide steps for the same.


texts: Is there any way I can easily test performance/load for my Magento app other than Mage-Perftest?


texts: Magento 2 optimization - loading time is high

texts:
High configuration server with Redis configuration.

Gtmatrix - https://gtmetrix.com/reports/mastersdirect.masters-sp.com/UQcit4p9

Waiting time is 2.68 s.

Created a normal controller and exit in the index file of the module but this is taking 3s to load and total page load time is higher than 20sec.

Website controller url  - http://mastersdirect.masters-sp.com/shop/stockmanagement

Total loading time is 30 s - http://mastersdirect.masters-sp.com/shop/customer/account/login/


texts: Configurable products - Attribute options are available although they are not applicable

texts:
I have a configurable product in magento P which has 3 associated attributes - thickness,size, color.
I created associated associated products like:

P1-> Thickness 1mm, - size S, - Color green
P2-> Thickness 1mm, - size S, - Color red
P3-> Thickness 1mm, - size S, - Color blue

P4-> Thickness 1mm, - size M, - Color green
P5-> Thickness 1mm, - size M, - Color red

P6-> Thickness 2mm, - size S, - Color green
P7-> Thickness 2mm, - size S, - Color blue
P8-> Thickness 2mm, - size S, - Color red
P9-> Thickness 2mm, - size S, - Color purple

Size, color and thickness are all drop downs- thickness comes first, then size and then color.

When the user chooses Thickness as 2 mm, the size M should not be available for the user to select. But with my current configuration it is.
What am I doing wrong?


texts:
<block type="page/html_head" name="head" as="head">

<action method="addItem"><type>skin_js</type><name>js/jquery.flexslider.js</name></action>
                <action method="addItem"><type>skin_js</type><name>js/jquery.flexslider-min.js</name></action>

 <action method="addCss"><stylesheet>css/flexslider.css</stylesheet></action>

</block>

I include this code at page.xml..
but ccs & js is not included to follow this code . please help me..


texts: Original Price is not sets in programmatically order

texts:
I try to place order programmatically but i have many problems during add items but now i have only one problem.

$produt is my product , $qoute is my qoute.

$item = $quote->addProduct($product, 1);
$item->setPrice(5);
$item->setBasePrice(5);
$item->setCustomPrice(5);
$item->setTaxPercent(0);
$item->setTaxAmount(0);
$item->setBaseTaxAmount(0);
$item->setOriginalCustomPrice(5);
$item->setRowTotal(5);
$item->setBaseRowTotal(5);
$item->setPriceInclTax(5);
$item->setBasePriceInclTax(5);
$item->setRowTotalInclTax(5);
$item->setBaseRowTotalInclTax(5);
$item->save();

After set this all thing in quote item i miss one field in order_item table that is original_price .I have no idea what field in quote assign to it.

Thanks.


texts: Secure payment by CyberSource and Merchant Reference Code

texts:
Lately, as of just a couple days ago our Merchant Reference Code in our EE 1.14 have been really wonky.

Notice the 32 digit alpha-numeric code that is being generated.

Here's what it should look like:

Correct: 100204738

INCorrect: fc01c106bbf410bffda5ba80a9a982b9

We are currently using the magedelight cybersource plugin. Nothing has really changed in the past couple days. No code pushes to production or anything like that.

The only major change I've made is installing a CDN to server /skin /media /js.

It appeared to happen the same day as the CDN installation. Although, I've now reverted the CDB installation back to the standard magento configuration and it's still causing issues.

Has anybody experienced this before? Any help would be greatly appreciated. Thank you.

If I changed the array using array_splice would that eventually send the updated Merchant Reference Code or is it just being echo'ed or printed on adminthtml/default/default/template/md/cybersource/cc.phtml


texts: How to add a column to _prepareColumns() that is not present in the database

texts:
How do I create a value then add it to the _prepareColumns() function?

I would like to work out a value then add it to a row that is coming form the database.


texts: category->getName() repeatedly returning same result

texts:
lets take a look at some code real quick and see if we can collectively diagnose the error residing within this code.

    <?php
    $_category = array_unique($_category);
    foreach ($_category as $cat) {
            var_dump($cat);
            $category = $collection->load($cat);
            var_dump($category->getName());
            if($category->getName()) {
                echo 'getUrl() . '">More Of the ' . $category->getName() . '';
                echo 'test'
            }
            unset($category);
        }
    ?>
    &nbsp;

The above code is used to display category URLs along within their respective names to the user.  Easy enough, right?  However -- many of our products are shared between sites and as a result some category getNames do not resolve in one of our much smaller stores.  This isn't an issue anywhere else, as far as I can tell, but here.  When a the if($category->getName) boolean is found to be true for a category, but the next one is found to be false it will repeatedly output the previously echo'd statement.

So it will look something like this:

input:

$_category={123,124,125,126} // only 124 is resolving to a name.

output:

string(3)"123"NULLstring(3)"124"string(4)"same"

More of the same

teststring(3)"125"string(4)"same"

More of the same

teststring(3)"126"string(4)"same"

More of the same

test

After further testing it seems that the $category variable isn't changing after each iteration of the for look.  I've even tried to unset($category) after every iteration with no success.


texts: How can i call to my custom module in other module?

texts:
I have the next problem:

I do a simple custom module, the typical Hello World, i can access with

http://localhost/hello/index/index

and i can see my module.

The problem is the next, How can i call my module from another module?

In magento 1.x i had in this file:

app/design/frontend/default/default/template/page/3columns.phtml` and i call my module with: `
 <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('holamundo/holamundo.phtml')->toHtml(); ?>

In magento 2 this folder don't exist, how can i call like in magento 1.x?


texts: Magento 2 Minification of css is breaking email css

texts:
Some of the css in email is broken after I enabled minification of css. I assume the reason being this :

email.css and email-inline.css are called from email header i.e header.html

But when I enable minification and deploy content, I dont see email.css and email-inline.css files instead I see their minified version as email.min.css and email-inline.min.css respectively.

So I tried to resolve the issue by renaming the calling in header.html.
It dint help.

Then I copied the minifiled files and renamed them to .css files
That also dint help.

What do u think might be the issue ?

UPDATE:

I have used inline css overall the email template. The css is broken for the Order Details in Order Confirmation email, return email etc.
The Order Details comes from an xml internally calling a phtml file.

{{layout handle="sales_email_order_items" order=$order area="frontend"}}

Internally it calls items.phtml. I can not add inline css to this phtml file as this file is being used in frontend as well on order view page where the item details are rendered.
How Can I take care of these sections in emails so that the css is not broken?

Email without minified css:

Email with minified css(broken css)

UPDATE:

I have now added css in the header.html in style tag and removed call to email-inline.css and email.css. When I view the email in outlook or gmail the css is still broken. However If I open the mail in browser(View in browser) the section looks fine.


texts: I am a Beginner so i want to create simple form module Can any one suggest me some magento form tutorial for both Frontend and Backend I check many tutorial it create confusion so can you please refer simple form tutorial


texts: Magento 2: Why do Some Tasks Not Show Up in Task List?

texts:
If I install the npm project and grunt config that ships with Magento 2 -- I'm able to run commands like

grunt clean
grunt clean:var
etc.

However, if I run grunt --help

Grunt: The JavaScript Task Runner (v0.4.5)

/* ... */
Available tasks
 black-list-generator  Custom task.
     clean-black-list  Custom task.
               deploy  Custom task.
          mage-minify  Minify files with a various compressor engines *
               static  Custom task.
              default  Custom task.
                 prod  Custom task.
              refresh  Custom task.
        documentation  Alias for "replace:documentation", "less:documentation",
                       "styledocco:documentation",
                       "usebanner:documentationCss",
                       "usebanner:documentationLess",
                       "usebanner:documentationHtml", "clean:var", "clean:pub"
                       tasks.
         legacy-build  Alias for "mage-minify:legacy" task.
                 spec  Custom task.

/* ... */

The clean task does not show in the list of avaiable tasks.

Why is this?  Is clean not a task?  If not, what is it?  If so, is there a way to get a full task list?

A shorter version of this question: What's the deal with grunt?


texts: How to get product collection by categoryId?

texts:
I am getting product collection by categoryId follow this guide
Get product collection by category id on phtml file magento2

I have problem with number of product collection. When I echo the sql query and run the query in database it have 35 rows result. But print the collection in the block template it have only one result.

My block function as below:

class Index extends \Magento\Framework\View\Element\Template
{
    protected $_categoryFactory;

    protected $_productCollectionFactory;
    protected $_productFactory;

    public function __construct(
        Template\Context $context,
        \Magento\Catalog\Model\CategoryFactory $categoryFactory,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Catalog\Model\ProductFactory $productFactory
    )
    {
        $this->_categoryFactory = $categoryFactory;
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->_productFactory = $productFactory;
        parent::__construct($context);
    }

    public function getProudctcollection($categoryId)
    {
        $category = $this->_categoryFactory->create()->load($categoryId);

        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
        $collection->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $collection->addCategoryFilter($category);

        return $collection;
    }
}

The code in the template as below:

/** @var $block \FSO\Categories\Block\Index\Index;*/
$categoryId = 4;
$productCollection =  $block->getPromotionProductCollection($categoryId);
foreach ($productCollection as $product){
    $product->getId();
    $product->getSku();
    echo "<h1>".$product->getName()."</h1>";
}

Please help me,
Why the collection print only one row in the template?

Thank you so much,
BienHV


texts: CSS and JS Not working properly after adding Extension

texts:
Hello guys i am new to Magento so please help with this ,

i added a MarketPlace extension by Cybage, extension works fine, but the Problem is that Theme that i was using (RWD Theme) has got affected i tried to make some changes in css but it Doesn't work , later i uninstalled the extension and found that CSS and javaScirpt works fine now , So every time i install this extension the CSS and JavaScript of the magento website get affected ,  this extension add few things of its own to the page and doesn't allow to edit the CSS or JS ,

what should i do so that extension doesn't have any effect on my default CSS and JS  ?


texts: Recover table rates without admin export (1.8)

texts:
I have an old (broken) Magento shop in 1.8.

I need to see the table rates that I have imported years ago.
But the export to csv is not working.
(Fatal error: Undefined class constant 'CONFIG_ESCAPING_FLAG')

There must be an other way to see the table rates, anyone can help me???


texts: Payment Method Column in Admin Orders Table Grid

texts:
I have weird problem, I am trying to show the payment methods in a separate column in admin order grid, the problem is below code is working perfectly in localhost, however in the live server it is not showing. the only thing is filter showing in the top header. here is my code:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection->join(array('payment'=>'sales/order_payment'),'main_table.entity_id=parent_id','method');
    $this->setCollection($collection);
    return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
}

......

    $payments = Mage::getSingleton('payment/config')->getActiveMethods();
    $methods = array();
    foreach ($payments as $paymentCode=>$paymentModel){
        $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
        $methods[$paymentCode] = $paymentTitle;
    }

    $this->addColumn('method', array(
        'header' => Mage::helper('sales')->__('Payment Method'),
        'index' => 'method',
        'filter_index' => 'payment.method',
        'type'  => 'options',
        'width' => '70px',
        'options' => $methods,
    ));


texts: Send custom email for cash on delivery orders

texts:
I want to send a custom email for each order that is selected cash on delivery payment method. I want to send the same email just with an additional text which is static custom text. Any help for this ?

Thanks in advance