texts:
i get this error since i upgraded to 1.8.1.0 when i click on a customer to edit.

  Fatal error: Call to a member function loadByCustomer() on a
  non-object in app/code/core/Mage/Newsletter/Model/Subscriber.php on
  line 267

It's this line: $this->getResource()->loadByCustomer($customer);

When i var_dump $this->getResource(), i get the following exception:
Mage registry key "_resource_singleton/newsletter/subscriber" already exists

I understand the problem but how to fix this?? Thanks.


texts: How can i Update My Product Export time consuming period for Bulk export products

texts:
In my store nearest 16,000 products are there, when i try to export both ways import/export or dataflow both are error. But when i export minimum of data i can able to export my products, which means i can't able to export all my products at a single file.

system - import/export - export error :

system - import/export - dataflow profiles - export all products error :


texts: Magento 2.3.2 fresh installation problem

texts:
I have setup fresh magento 2.3.2.
When i access frontend, the content does not appear properly See https://prnt.sc/sfwlaf
I had run all the commands also, still it does not gets affected.
How to solve this? This is fresh magento installtion,no changes have been made.


texts: Custom Product Attribute with select option

texts:
I have a non-Eav table. And I want to create a custom product attribute with select options whose values will be coming from the above non-eav table column. What will be the code for the sql script.
Assume the column name is brand.

<?php

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_product', 'brand', array(
    'group' => 'General Information',
    'input' => 'select',
    'type' => 'varchar',
    'label' => 'Brand',
    'visible' => 1,
    'required' => 0,
    'user_defined' => 1,
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE ,
));


texts: Magento 2.4 installation issue on windows machine

texts: I have downloaded magento 2.4 and trying to install on windows machine but while hitting "localhost/magento-24/" it is not showing install button. I don't know the reason can some help me in this. Please find the screenshot below.


texts: Warning : Session object MUST NOT be requested in constructor

texts:
75  | WARNING | Session object MUST NOT be requested in constructor.
      |         | It can only be passed as a method argument.
  79  | WARNING | Session object MUST NOT be requested in constructor.
      |         | It can only be passed as a method argument.
  87  | WARNING | Request\Http object MUST NOT be requested in
      |         | constructor. It can only be passed as a method
      |         | argument.

And i have try this link  but not solve my issue so please check it

Correct way to obtain a session object?

/**
 * Checkout session object
 *
 * @var \Magento\Checkout\Model\Session
 */
protected $checkoutSession;

/**
 * Constructor
 *
 * @param  \Magento\Checkout\Model\Session $checkoutSession
 * @return void
 */
public function __construct(\Magento\Checkout\Model\Session $checkoutSession)
{
    $this->checkoutSession = $checkoutSession;
}

Advance thanks for help.


texts: I wish to add an extra price column in the product ordered report

texts: I want to add price column after sku in this report is there any solution please ?


texts:
Is there a way that I can hide URL parameters identifiers?

from: domain.com/frontname/param1/x/param2/y/param3/z

to:  domain.com/frontname/x/y/z


texts:
I am new to Magento and learing it. I am working on a Magento store and I have been successful in creating store with required features. But now i was asked to create an REST API for mobile application for accessing product and all required data. I have had experience creating API in CodeIgniter, but don't know how to do it in Magento. SO what would be the steps or is there any good tutorial for it.

Thanks in advance.


texts:
An new interesting has been seen in magento all xml file are  starting with below code-

<?xml version="1.0"?>

My question , why magento used  xml version 1.0?

why it does not used other  version?


texts: Replace “Add to Cart” button with an “Buy Now” button linking to the “Checkout” page

texts:
In my Magento site product view page, I need to replace the button "Add to Cart" to "Buy Now" button in I want like to the "Checkout" page.

Example :
if the customer clicks the "buy now" button the link will going to the checkout page.


texts: Magento default search is very poor. How to improve it?

texts:
I have used default magento search on couple of stores. Can anyone suggest the best extension for this. Also as there are lot of extensions available, how to chose one?

Thanks


texts: How to retrieve values from custom CUSTOMER attribute in grid

texts:
I've successfully added a customer attribute that records the branche in which the customer is active. I need this value to be shown in the customer grid so the client is able to instantly obtain this piece of information. What I've done so far:

Updated my custom module config.xml file with an Observer:

<adminhtml>
<events>
    <core_block_abstract_prepare_layout_before>
        <observers>
            <customgrid_column_append>
                <type>model</type>
                <class>MyCompany_ModuleName_Model_Observer</class>
                <method>appendCustomColumn</method>
            </customgrid_column_append>
        </observers>
    </core_block_abstract_prepare_layout_before>
</events>
</adminhtml>

Added the actual observer

<?php
class MyCompany_MyModule_Model_Observer extends                      Varien_Event_Observer
{

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

if ($block->getType() == 'adminhtml/customer_grid') {
    /* @var $block Mage_Adminhtml_Block_Customer_Grid */
    $block->addColumnAfter('branche_customer', array(
        'header'    => 'Branche',
        'type'      => 'text',
        'index'     => 'branche_customer',
    ), 'name');
 }
 }
 }

So far so good. When I run the customer grid in the backend the column is added after the "name" column. However no results are returned in the Branche column. The attribute Id is correct. The attribute itself is a dropdown field.

What am I missing here?


texts:
I am working on Worldpay payment module to enable Worldpay payment method in my magento 2 website but i got following error while click on place order.

i am using Worldpay module from https://github.com/Worldpay/worldpay-magento2

public function setupWorldpay() {
    $service_key = $this->config->getServiceKey();
    $worldpay = new \Worldpay\Worldpay($service_key); //(line no 221)

    $worldpay->setPluginData('Magento2', '2.0.25');
    \Worldpay\Utils::setThreeDSShopperObject([
        'shopperIpAddress' => \Worldpay\Utils::getClientIp(),
        'shopperSessionId' => $this->customerSession->getSessionId(),
        'shopperUserAgent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
        'shopperAcceptHeader' => '*/*'
    ]);
    return $worldpay;
}

Fatal error: Class 'Worldpay\Worldpay' not found in /public_html/app/code/Worldpay/Payments/Model/Methods/WorldpayPayments.php on line 221


texts: Magento 2: How to insert a recort into the database via a controller

texts: I want to write a controller to insert data into the database using MySQL. What are the steps I need to follow to create it?


texts: Magento 2 - Add a Custom Button to header.phtml

texts:
My name is Costin and I am a beginner Magento 2 developer.
I have a question regarding on

How to add a button to header.phtml and to be displayed on the frontend?

What I have done until now:

I create a basic module in

  /app/code/Vendor_Name_Module_Name

Copied the file

  vendor/magento/module/theme/view/frontend/templates/html/header.phtml
  into
  /app/code/Vendor_Name_Module_Name/theme/view/frontend/templates/html/header.phtml.

what I want to achieve is :

Any help is much appreciated.


texts: Extension submission failing in Technical review

texts:
While submitting an extension, it failed the Technical review, and the test reports show this error:

Command: Varnish PageCache Test

Output: Cannot update product price.

Response:

{\"messages\":{\"error\":[{\"code\":500,\"message\":\"Server internal error. See details in report api\\/1143348353039\"}]}}

From the above message, if am not wrong, am supposed to check in var/report/1273345462353 file but it's their store, their server.  Not sure how to get more details about the bug.

Any inputs on how to debug/solve this will be appreciated, thanks in advance!


texts: Magento 1.9 - Multiple websites viewing locally

texts: This is definitely a noob question, but after creating multiple websites in a single Magento 1.9 instance, how do I view each store?  When I visit http://127.0.0.1:8888/, only the default website is visible.  Here is a screenshot of my store setup.  I would like to view store "test" or "test2", but only the "Main Website" store/products are visible.  Thanks for any direction you can give.


texts: Magento2 How can I call a .phtml file in Observer?

texts:
How can I call a .phtml file in an Observer?

I want to show a popup window when event Observer fires after customer login so I can call a .phtml file that contains HTML popup?

So after a customer has logged-in a popup appears on the screen that contains the string text.


texts: Custom tab for admin Customer/Edit in 1.9

texts:
Followed tons of code tutorial still no luck.. please advise..

let me paste the code below:

app/etc/modules/Loyalty_Customertab.xml:

<config>
    <modules>
        <Loyalty_Customertab>
            <active>true</active>
            <codepPool>local</codePool>
        </Loyalty_Customertab>
    </modules>
</config>

app/code/local/Loyalty/Customertab/etc/config.xml

<config>
   <modules>
       <Loyalty_Customertab>
           <version>0.1.0</version>
       </Loyalty_Customertab>
   </modules>
 <adminhtml>
    <layout>
           <updates>
               <customertab>
                  <file>customertab.xml</file>
               </customertab>
           </updates>
       </layout>
   </adminhtml>
   <global>
       <blocks>
           <customertab>
               <class>Loyalty_Customertab_Block</class>
           </customertab>
       </blocks>
 </global>
</config>

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

<?xml version="1.0"?>
<layout>
    <adminhtml_customer_edit>
        <reference name="customer_edit_tabs">
            <action method="addTab">
                <name>my_custom_tab</name>
                <block>customertab/adminhtml_customer_tab</block>
            </action>
        </reference>
    </adminhtml_customer_edit>
</layout>

app/code/local/Loyalty/Customertab/Block/Adminhtml/Customer/Tab.php

<?php
class Loyalty_Customertab_Block_Adminhtml_Customer_Tab
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface {
   /**
     * Set the template for the block
     *
     */
    public function _construct()
    {
        parent::_construct();
       $this->setTemplate('customertab/tab.phtml');
    }
   /**
     * Retrieve the label used for the tab relating to this block
     *
     * @return string
     */
    public function getTabLabel()
    {
        return $this->__('My Custom Tab');
    }
   /**
     * Retrieve the title used by this tab
     *
     * @return string
     */
    public function getTabTitle()
    {
        return $this->__('Click here to view your custom tab content');
    }
   /**
     * Determines whether to display the tab
     * Add logic here to decide whether you want the tab to display
     *
     * @return bool
     */
    public function canShowTab()
    {
        return true;
    }
    /**
     * Stops the tab being hidden
     *
     * @return bool
     */
    public function isHidden()
    {
        return false;
    }
}


texts:
After running magento setup:upgrade i got this following error in command line:

[Exception]
  Missing write permissions to the following paths:
  C:/xampp/htdocs/magento2/pub/static\frontend\Magento\luma\en_US

and after i run magento setup:static-content:deploy and delete my browser cache, my backend is fine but my frontend page wont load any css or js, when i look at the console there are a lot of error saying:

Failed to load resource: the server responded with a status of 403 (Forbidden)


texts: Add new Order Statuses to Magento 2.3 using declarative scheme approach

texts:
I need to add several order statuses.
Could not found info how to implement it via Data Patches


texts: Why is theme not applying to custom email?

texts:
A custom email I am sending is sending with the Luma theme, despite my website having a custom theme applied (which works for checkout emails, yet not for my custom mails).

Why is this happening and how can it be fixed?

    $transport = $this->_transportBuilder
        ->setTemplateIdentifier($template)
        ->setTemplateModel('Magento\Email\Model\Template')
        ->setTemplateOptions([
            'area' =>  \Magento\Framework\App\Area::AREA_FRONTEND,
            'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
        ])
        ->setTemplateVars(['data' => $data])
        ->setFrom($sender)
        ->addTo($to)
        ->getTransport();

    $transport->sendMessage();


texts: How to remove paypal express checkout link from mini cart in right column

texts:
I have just set myself up with PayPal payments pro and got it installed and tested etc. But there's one thing i don't like which is the PayPal express checkout link appearing in my mini cart in the right column of my website.

How do i remove this link?

I still want the link to be there on checkout so turning it off in the config menu isn't an option because it turns off both links.

Any ideas?

Thanks


texts: magento 2.3.4 cannot call methods on tabs prior to initialization; attempted to call method 'activate'

texts:
In Magento 2.3.4 product page when click review text or reviews and not going to review form or Customer review

Before it's working fine in Magento 2.2.4

and it's an error coming from the below core file in this function

  /vendor/magento/module-review/view/frontend/web/js/process-reviews.js

$(function () {
    $('.product-info-main .reviews-actions a').click(function (event) {
        var anchor, addReviewBlock;

        event.preventDefault();
        anchor = $(this).attr('href').replace(/^.*?(#|$)/, '');
        addReviewBlock = $('#' + anchor);

        if (addReviewBlock.length) {
            $('.product.data.items [data-role="content"]').each(function (index) { //eslint-disable-line
                if (this.id == 'reviews') { //eslint-disable-line eqeqeq
                    $('.product.data.items').tabs('activate', index);
                }
            });
            $('html, body').animate({
                scrollTop: addReviewBlock.offset().top - 50
            }, 300);
        }

    });
});

I checked but I can't find proper solution
Does anyone know about this issue?

Any help would be appreciated.

Thanks.


texts: Magento 2 Admin - Product Cannot Add or Edit

texts:
I just upgrade Magento 2.3.0 to Magento 2.3.5, But after installation In Admin > Catalog  > Products I cannot edit or Add new products, When I am trying to add or edit Product Page then getting below error.
Notice: Undefined index: quantity in /vendor/magento/framework/View/Element/UiComponentFactory.php on line 412
Please help me regrading about this issue. I am badly stuck in this issue.

Thanks


texts: Control customer who bought can write review

texts: I want to accept customer who purchases can fill on review form. If a customer doesn't buy it, it'll show a notification that you must buy it before writing review. Can you help me how to work? Thanks.


texts: Magento 2: Add custom column to filter option in order grid?

texts: I have created custom column in sales_order table in Magento 2. At the time placing order values is saved in that column. Now I want to this column to be available for filter option.


texts: Magento 2 Error: Base table or view not found: 1146 Table 'dbname.table_name' doesn't exist, while database import

texts:
I have a fresh setup of Magento ce 2.3.2, while importing the database with sample data in fresh database and I faced this error:

  Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento232sd.admin_passwords' doesn't exist in /var/www/html/magento232sd/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91

I am using below command for database import.

mysql -u root -p magento232sd < magento232sampledata.sql

------- Update -------

I removed the database and the done setup of Magento 2 source with sampledata and with fresh database. Then I run bin/magento setup:install
 command and get this error:

Starting Magento installation:
File permissions check...
[Progress: 1 / 941]
Required extensions check...
[Progress: 2 / 941]
Enabling Maintenance Mode...
[Progress: 3 / 941]
Installing deployment configuration...
[Progress: 4 / 941]
Installing database schema:
Schema creation/updates:
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Framework\Setup\Declaration\Schema\Db\SchemaBuilder::processReferenceKeys() must be of the type array, null given, called in /var/www/html/magento232sd/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 127 and defined in /var/www/html/magento232sd/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php:137
Stack trace:
#0 /var/www/html/magento232sd/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php(127): Magento\Framework\Setup\Declaration\Schema\Db\SchemaBuilder->processReferenceKeys(NULL, Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#1 /var/www/html/magento232sd/vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(66): Magento\Framework\Setup\Declaration\Schema\Db\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 /var/www/html/magento232sd/setup/src/Magento/Setup/Model/DeclarationInstaller.php(58): Magento\Framework\Setup\Declar in /var/www/html/magento232sd/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 137

I think there is something got wrong with MySQL. I dont know about that.


texts: How to create product quantity duplicate tab on product detail page in backend in Magento 2?

texts: I just wanted to display custom tab named with "custom quantity" in admin panel product detail page. please help me how to display using new module in detail.


texts: Magento2 set all product infos to "use default value"

texts:
I have a problem with imported products in Magento 2 shop. Import worked well, but all products have own product name, product description, short description and so on for Store View AND Default Store View. This is not good, because we only have 1 language and my client has to change content twice.

How can I set to all info of products that default value of "Store View" should be used? Is there a database command I can run or export/import products via CSV ...?


texts:
I'm getting following errors as soon as I connected with the marketplace it's asking me to install 56 extensions and I'm trying to install them and getting the error in the first image.

2nd Image the module manager has FATAL ERROR don't know how to resolve them.

Thanks in advance guys :)

Also getting this error in Module Manger


texts: Magento 2.4.1 products not shown in category

texts:
I have just migrated by my site form local to server and in the category the products are not visible, i have tried reindexing but not work also when i try to create any new product from backend am getting this is taking too long and error code is 504 while saving it
Also i have checked the logs and got this:-

[2021-01-06 10:32:37] report.CRITICAL:
{"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"all
shards
failed","phase":"query","grouped":true,"failed_shards":[]},"status":503}
{"exception":"[object]
(Elasticsearch\Common\Exceptions\ServerErrorResponseException(code:
503):
{"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"all
shards
failed","phase":"query","grouped":true,"failed_shards":[]},"status":503}
at
/var/www/html/healthcare/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:665)"}
[]

elastic search version = 7.9.2 and also when i test it form the backend it is succesfull.
any fix for this. Thanks in advance
update:- also while searching for products am getting this error
1 exception(s):
Exception #0 (Elasticsearch\Common\Exceptions\ServerErrorResponseException): {"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[]},"status":503}


texts: How to display cart details along with sub totals discount coupon in magento checkout page?

texts:
How to display cart details along with sub totals discount coupon code
  etc inside shipping methods section in magento checkout page


texts: Wrong URL after migration of categories and products

texts:
I have just installed a fresh Magento (1.9.0.1) in a sub directory of existing installation. They do not share DB. While i am setting up this new webshop i suddenly notice that "default" is added in the URL.

I can access the new site fine without "default" in the URL, but after visiting category or product page, this is added in URL :(

Existing site:

www.mysite.com

New site:

www.mysite.com/new

Actual URL of new installation after visiting category or product page

www.mysite.com/new/default

Old installation and new installation do not share anything but i have transferred products to new site using cart2cart service.

I have checked unsecure and secure URL in DB and this is set correct to www.mysite.com/new

What am i missing here and why is "default" added in the URL?


texts: Magento 2.0 Default Product Search Results To A List View

texts: How do I display product search results in a single column? Essentially I want to default it to a list view all the time. Would I need to make a controller to append the query variable to the URL?


texts: Magento 1.9 custom collection pagination not working in admin grid?

texts:
I have created a custom grid to show a monthly wise report, But the pagination is not working with the Varien_Data_Collection . Please find the code snipet below from Grid.php

      $rows  = $connection->fetchAll($sql);//this row will return an array

        $collection = new Varien_Data_Collection();

        foreach($rows as $row){
            $rowObj = new Varien_Object();
            $rowObj->setData($row);
            $collection->addItem($rowObj);
        }

        $this->setCollection($collection);
        parent::_prepareCollection();
        return $this;


texts: How can I delete customers that never logged in Magento 1?

texts:
How can I delete customers who never logged in? I can't find any solution.
I think I have over 40000 customers who never logged in, so I can't delete them by hand.


texts:
During the install module we get issue:

Compilation was started.
Proxies code generation... 0/7 [>---------------------------]   0% < 1 sec 34.0                                                                                Proxies code generation... 1/7 [====>-----------------------]  14% < 1 sec 36.0                                                                                Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec                                                                                36.0 MiBPHP Fatal error:  Class Dotpay\Payment\Helper\Data\Notification contains                                                                                1 abstract method and must therefore be declared abstract or implement the rema                                                                                ining methods (Dotpay\Provider\NotificationProviderInterface::getCreditCard) in                                                                                /home/czasowe/domains/gerris.pl/public_html/vendor/dotpay/magento2-payment/Helpe                                                                                r/Data/Notification.php on line 27

  Fatal error: Class Dotpay\Payment\Helper\Data\Notification contains 1 abstract m                                                                                ethod and must therefore be declared abstract or implement the remaining methods                                                                                (Dotpay\Provider\NotificationProviderInterface::getCreditCard) in /home/czasowe                                                                                /domains/gerris.pl/public_html/vendor/dotpay/magento2-payment/Helper/Data/Notifi                                                                                cation.php on line 27

Does anyone know how to solve it?


texts: Required parameter 'theme_dir' was not passed when adding redis configuration to env.php

texts:
I try to add the 'cache' values (for enabling redis) to env.php using exactly the same configuration as is on my staging server and working fine and I get the error 'Required parameter 'theme_dir' was not passed'

I checked the array syntax and it is fine. No trailing or missing ) closures. diff'ing the files between the staging and live and they show only a difference in the intent of a single line.


texts:
    <?php if($_product->isSaleable()): ?>

<?php echo $this->__('In stock') ?>

    <?php else: ?>

<?php echo $this->__('Out of stock') ?>

    <?php endif; ?>

I have this piece of code right here currently displaying in stock or out of stock on my store. I want to add a 3rd else to display a custom stock status. How can i do that? Can anyone show me?

This would be my third option:

<?php $_product->getAttributeText('custom_status');?>

or at least hide the stock status when a custom status  exists.


texts: Insert, Update values in existing custom table and Select values from that table. Magento2

texts: How can i Insert, Update values in existing custom table and Select values with Magento methods not sql requests ?


texts: How can I add the product sku to the PDP page?

texts:
I would like to add the sku to the pdp page right above "Color". I have narrowed down my html template search to the file vendor/magento/module-catalog/view/frontend/templates/product/view/options/wrapper.phtml

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
$required = '';
if ($block->hasRequiredOptions()) {
    $required = ' data-hasrequired="' . __('* Required Fields') . '"';
}
?>
<div class="product-options-wrapper" id="product-options-wrapper"<?php /* @escapeNotVerified */ echo $required; ?>>

        <?php echo $block->getChildHtml('', true);?>

I can not figure out though where $block-getChildHtml('', true); is grabbing the html from for me to edit that page?

UPDATE

The layout that this template is using is at magento/module-catalog/view/frontend/layout/catalog_product_view.xml. If I remove all of the child blocks (options.phtml, text.phtml, file.phtml etc.), nothing changes. However if I remove the parent block (product.info.options.wrapper) the content does go away. So it seems the content is coming from the parent and not the children somehow.

<block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml">
    <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
        <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
        <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
        <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
        <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
        <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
    </block>
    <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
</block>


texts: Fatal error: Uncaught Error: Cannot instantiate interface - LowestPriceOptionsProviderInterface

texts:
I moved fully working Magento 2 to a different host (same server settings) and now I'm getting following error:

Fatal error: Uncaught Error: Cannot instantiate interface Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProviderInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73
Stack trace: #0 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Configu...')
 #1 /var/www/html/vendor/magento/module-configurable-product/Pricing/Render/FinalPriceBox.php(46): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Configu...')
 #2 /var/www/html/var/generation/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/Interceptor.php(14): Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox->__construct(Object(Magento\Framework\View\Element\Template\Context), Object(Magento\Catalog\Model\Product\Interceptor), Object(Magento\ConfigurableProduct\Pricing\Price\FinalPrice), Object(Magento\Framework\Pricing\Render\RendererPool), Object(Magento\ConfigurableProduct\Pricing\Price\Confi in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I have no additional modules installed, nothing has been changed in any files.
Searched all over the internet, but all the previous cases are related to Magento 2 installation so no luck.

Any advice how to debug this would be much appreciated!


texts:
I have a module that has a phtml file. I want to add an image from pub/media in that phtml file, but my attempts have been unsuccessful.

  pub / media / catalog / category / shutterstock_259609874 jpg

I tried this, but it is is not working:

https://magento.stackexchange.com/a/133017


texts: Get custom Product Atributes from each products at root

texts:
I need to get values from some custom attributes from products. I'm using separate php file outside Magento folder and I'm using mostly $shippingRates to get the information I need.

I need to first load the product from SKU. I got SKU from Order.as follows,

$orderObj = $objectManager->create('Magento\Sales\Model\Order')->load($orderID);
$items =$orderObj->getAllVisibleItems();
foreach($items as $item):
$itemSku = $item->getSku();
endforeach;

I need to filter the product by SKU to get only needed products.
But the way I did wasn't a success.

So I tried loading products separately.

I loaded product using ProductRepository and Product Model,

$productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');

and

$getProduct = $objectManager->get('\Magento\Catalog\Model\Product');

I tried to filter product loading by sku as follows,

$productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');
$skuLoopProd = $item->getSku();
$getProduct = $productRepository->get($skuLoopProd);

And I tried as follows to get custom attribute value,

$axs = $getProduct->getResource()->getAttribute('product_weight_class')->getOptions();
foreach ($axs as $keyAttr) {
echo $keyAttr->getLabel();
}

but in this, I got all available options for the attribute, not the attribute value applied to the product.

What was wrong with what I tried so far?

Can please someone help me to get text value from a custom attribute of a product that I can filter with SKU?


texts: In which table Order's comments history information will store?

texts:
I'm using paypal express checkout.and In order comments history tab the following type of information is stored.

Payflow PNREF: #B1PP7A1A6D7C. Authorized amount of $94.99. Transaction ID: "28N891255K2125216".
I want to know above information in which table field contain?

Thanks in advance


texts: How to add custom js form validation with custom error message in magento2?

texts:
I am trying to do a custom js validation for a form field, I added this in my phtml file :
var theForm = new VarienForm('form-validate', true);
Validation.add('validate-testx','You failed to enter baz!',function(v){
if(v == 'baz')
{
return true;
}
return false;
});

and added
validate-testx
to the filed's css class but it did not work. I am using magento 2, please help.


texts:
I'm experiencing an issue with installing any module in magento connect. I get the following error:

community/Sparx_Fblikebox: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure


texts: Cannot send headers; headers already sent error

texts:
In My Magento store front end when I'm trying to create a product return request then following error comes.

a:5:{i:0;s:153:"Cannot send headers; headers already sent in /app/code/community/Jayje/Rma/controllers/IndexController.php, line 47";i:1;s:1684:"#0 lib/Zend/Controller/Response/Abstract.php(148): Zend_Controller_Response_Abstract->canSendHeaders(true)


texts: Magento 2 How to print SQL Query when user search from admin product grid

texts:
Magento 2.3.4 version using.
Can we print SQL query when product search from admin product grid?
i can print sql query in our custom or product collection in frontend using $collection->getSelect()->__toString();
but I want to print the SQL query in the admin product grid.


texts: Can additional payment information be displayed when reviewing the order in the admin panel?

texts: I have an API REST to make the orders and everything works fine, at the moment of making the order I have sent an extra information in the object additional_data and my problem is that when checking the Magento Admin, in the page of checking the orders, this information does not appear anywhere and I really need to show this information.


texts: How to create an install-able extension package on local

texts:
I am developing a magento extension and testing it, i want to work it something like i upload a zip file from magento connect and it will place my extension files to community folder and global config file to app/etc/module folder and will create db table i have set my DB installer in sql folder but not able to organize the things.

Note : I am developing in localhost

Please help with this,Thanks


texts: Magento 2 : Change default REST API response

texts:
I have an order collection get out via API

How can I change some value in API response via custom module


texts: Add product to quote skips product randomly

texts:
I need to create an order with more than 60 products programmatically but it seems like Magento skips some(around 3 or 4) products randomly. I think it's a problem with itemsCollection of _quote but I have no idea what's wrong with my code. On repeated requests it skips different products. I disabled/deleted cache, reindexed everything.
Here's a snippet of my code:

$this->_quote   = Mage::getModel( 'sales/quote' );
//assign customer, address code here
foreach($products as $product){
    //add custom options
    $buyRequest = array(
        'product_id' => $product->getId(),
        'qty' => $req['Quantity']
    );
    $product_request = $this->_getProductRequest( $buy_request );
    $quote_item = $this->_quote->addProduct( $product, $product_request );
    if( is_string( $quote_item ) ) {
        //code never enters this if
        throw new Exception( $quote_item );
    }
}

$itemsCount = count($this->_quote->getItemsCollection());
//for more than 60? items it seems like skips some products randomly
//continue with order create process

No error or exception message is generated, order gets created with success. Another strange thing is that when I use PHPStorm's debugger and place a breakpoint inside foreach, all products get added to quote without any problem. Is there some sort of asynchronousness or collection caching in quote addProduct proccess?

LE: I'm using magento 1.9


texts: Unable to install any extension on Magento 2.1.0 website

texts:
I have a site running on Magento 2.1.0.

The site was up and running for a few weeks with no issues, we were able to install a few extensions with no problems.

Suddenly, we are unable to install any extensions. When I run the command to enable any module, I get the following error:

[Zend_Json_Exception]
Decoding failed: Syntax error

My full trace is below:

Exception trace:
 () at /home/*/public_html/vendor/magento/zendframework1/library/Zend/Json.php:97

 Zend_Json::decode() at /home/*/public_html/vendor/magento/framework/Module/PackageInfo.php:85

 Magento\Framework\Module\PackageInfo->load() at /home/*/public_html/vendor/magento/framework/Module/PackageInfo.php:208

 Magento\Framework\Module\PackageInfo->getRequire() at /home/*/public_html/vendor/magento/framework/Module/DependencyChecker.php:132

Magento\Framework\Module\DependencyChecker->createGraph() at /home/*/public_html/vendor/magento/framework/Module/DependencyChecker.php:95

 Magento\Framework\Module\DependencyChecker->checkDependencyGraph() at /home/*/public_html/vendor/magento/framework/Module/DependencyChecker.php:82

 Magento\Framework\Module\DependencyChecker->checkDependenciesWhenEnableModules() at /home/*/public_html/vendor/magento/framework/Module/Status.php:98

 Magento\Framework\Module\Status->checkConstraints() at /home/*/public_html/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php:92

 Magento\Setup\Console\Command\AbstractModuleManageCommand->execute() at /home/*/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257

 Symfony\Component\Console\Command\Command->run() at /home/*/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:874

 Symfony\Component\Console\Application->doRunCommand() at /home/*/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:195

 Symfony\Component\Console\Application->doRun() at /home/*/public_html/vendor/magento/framework/Console/Cli.php:96

 Magento\Framework\Console\Cli->doRun() at /home/*/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:126

 Symfony\Component\Console\Application->run() at /home/*/public_html/bin/magento:24

module:enable [-f|--force] [--all] [-c|--clear-static-content] [--magento-init-params="..."] [module1] ... [moduleN]

any help is much appreciated!


texts: Send BCC of order confirmation email for a particular SKU

texts:
I am new to Magento and not able to figure out how to do this.

I need to add a BCC email to the order confirmation emails that are being sent when the user buys a particular product. For e.g.,

The user buys product A, the user will get an order confirmation email. This email needs to be Bcc'd for this particular product to another email id.

Could someone help me understand how to handle this. Thanks!


texts: How to set login session in magento by logging in via code?

texts:
I am working with the Magento REST API.

I have developed a service for users to sign in, and that works fine.
But when I call the service and try to load the Magento front end, I can't see the logged in user information. User session is not retaining.

I want to use the same user session of the user logged in via REST.

Can any one help me to fix this?

$session = Mage::getSingleton('customer/session', array("name"=>"frontend"));
$session->login($email, $password);

if ($session->isLoggedIn()) {
    $session->setCustomerAsLoggedIn( $session->getCustomer() );
    $customer = Mage::getModel("customer/customer")
                        ->setWebsiteId(Mage::app()->getWebsite()->getId())
                        ->loadByEmail($email);

    if ($customer->getId()) {
        $customerData = $this->_getCustomerDetails($customer);
        Mage::getSingleton('customer/session')->unsCustomerLoginCnt();
    } else {
        $this->getResponse()->setHeader('HTTP/1.0', Yamaha_Api2_Model_Server::HTTP_NOT_FOUND, true);
        $message = 'Customer Information Currenlty Unavailable';
    }
}


texts: How to override css for overrided template

texts:
I override the module_catalog from template and put it in following directory

app/design/frontend/gog/gogparent/Magento_Catalog/template

(gogparent is my custom theme)that inherit to blank theme. It works fine,
the question is how can I override css for Module_catalog from blank theme to my gog theme and have some changes..

Thanks!


texts: adding custom filter on Magento\Catalog\Block\Product\ListProduct getLoadedProductCollection not working

texts:
I am overriding below product collection function with sku filter but its giving all results in category page including that sku product.

    /**
     * Retrieve loaded category collection
     *
     * @return AbstractCollection
     */
    public function getLoadedProductCollection()
    {
          $collection = $this->_getProductCollection();
          $collection->addAttributeToFilter('sku', 'test');
          return $collection;
    }


texts:
I just finish my size optimizatoin.

http://gtmetrix.com/reports/modernmarkt.com/jpqes948

Since my site is still very slow i think my problem is with the low server because i have over 20.000product and 100.000images.
Now i use Siteground's Magento Cloud Hosting with
2 x 3.0 GHz CPU Cores, CentOS, 2GB RAM, 50GB SSD.
Its cost me about 70euro.
For the same amount i could choose Mochahost's Barista-3 cloud server with 6gb ram, 4x9GHz cpu and 200gb space which is much better but not Magento hosting.
Should i change to Mochahost or Spend more on Siteground.

Thanks for any help.


texts: Add customer attribute to catalog price rules in Magento 2

texts:
I need to extend the functionality of Magento Catalog price rules.

I want to be possible to have a rule or a field to have the possibility to select the country where the rule should apply.

So basically, I select Italy, the rule should only apply on frontend to customers logged with an address located in Italy.

I assume it's linked to catalogrule_product_price table where I should probably add columns (As how the customer_group is managed) but I don't know how to properly modify the code in the indexer to have :

 1. The correct prices indexed
 2. The correct prices displayed on frontend

I'm also interested in a solution for any customer attributes :)

How can I achieve that ?


texts: How to override search autocomplete model for Restricting only pick 5 item from collection

texts:
I need to restrict search autocomplete results.
I want to Restrict that only 5 item pic for query.

I did this Search/suggest.php controller.

But this is not a good way , i want to modify collection result.
How can i do this.

I just override the controller.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Search\Controller\Ajax\Suggest" type="Embitel\Search\Controller\Ajax\Suggest"/>
</config>

Controller

<?php
/**
* Ajax Search Controller
*/
namespace Embitel\Search\Controller\Ajax;

use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\Result\Json;
use Magento\Search\Model\AutocompleteInterface;

class Suggest extends \Magento\Search\Controller\Ajax\Suggest {

    /**
     * Maximum results to display
     * Result is from (0 to 4) = 5
     * @var int
     */
    const MAX_RESULT_DISPLAY = 4;

    /**
     * Autocomplete
     *
     * @var  AutocompleteInterface
     */
    private $autocomplete;

    /**
     * Initialize dependencies
     *
     * @param Context $context
     * @param AutocompleteInterface $autocomplete
     * @return void
     */
    public function __construct(
        Context $context,
        AutocompleteInterface $autocomplete
    ) {
        $this->autocomplete = $autocomplete;
        parent::__construct($context, $autocomplete);
    }

    /**
     * Render results
     *
     * @return Json
     */
    public function execute() {
        $this->_view->loadLayout();
        if (!$this->getRequest()->getParam('q', false)) {
            $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setUrl($this->_url->getBaseUrl());
            return $resultRedirect;
        }

        $autocompleteItems = $this->autocomplete->getItems();
        $responseData = [];
        foreach ($autocompleteItems as $key=>$resultItem) {
            unset($resultItem['num_results']);
            $responseData[] = $resultItem->toArray();
            if($key == self::MAX_RESULT_DISPLAY){
                break;
            }
        }
        $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
        $resultJson->setData($responseData);
        return $resultJson;
    }

}

This is working.

But collection is coming in huge amount, that's why i want to restrict collection in model.


texts: Magento 2 : Currency change frontend event

texts:
I want to update the quote item price on switching the currency from the frontend.

Is there any event to track currency switch option and give me the previous currency and requested currency?


texts: If else in Magento always return else value

texts:
hi I have this If else statement in magento. It always landed on the else statement even though the value of the variable is 10.

Please I need all the help I can.

{{if var customer_group_id }} == 10
         Print CGD
{{else}}
         Print ICT  <------always landed here
 {{/if}}


texts: Create Mage_Sales_Model_Quote from order

texts:
I want to create a quote from an existing order and remove some qtys and re apply the discounts. We need to work out the value of an order where we may cancel some of the items but not all.

I thought we could

Get the order
Convert to quote with modified Sku quantities
Apply collect totals
Get the new values
Apply to the existing order in the system

I have converted the order but I get the following error on the method call addItem() to the Quote object -> please assume I have loaded the $order object by Id previous to this code snipped

Fatal error: Call to a member function getStoreId() on a non-object in /var/www/build-54/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php on line 65

    /** @var $converter \Mage_Sales_Model_Convert_Order */
    $converter = Mage::getModel('sales/convert_order');
    /** @var $quote \Mage_Sales_Model_Quote */
    $quote = $converter->toQuote($order);

    $items = $order->getAllVisibleItems();

    foreach($items as $item) {
        /** @var $item \Mage_Sales_Model_Order_Item */
        /** @var $quoteItem \Mage_Sales_Model_Quote_Item */
        $quoteItem = $converter->itemToQuoteItem($item);
        //var_dump($quoteItem);
        $quote->addItem($quoteItem);

    }

    $quote->collectTotals();


texts: Custom admin UI grid not showing success or error messages

texts:
I have created a custom grid in the admin panel using UI components. Everything is working fine except that there is no success/error message shown on the grid page.

If I redirect the controller after saving action to the edit record page, it shows the success/error message.

I have also tried to redirect to some other grid after saving the data, and the message is being shown correctly there.

I have matched almost everything of my grid with another working grid, but could not find any clue yet.

Can anyone help me out to find the problem?

Please let me know if you need to see the code.

Update: Added code below.

Grid Controller (Which has problem):

<?php
namespace Stack\RuleBasedDiscount\Controller\Adminhtml\Rules;

class Index extends \Magento\Backend\App\Action
{
    const ADMIN_RESOURCE = 'Stack_RuleBasedDiscount::rules';
    protected $resultPageFactory;

    public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        $this->_view->loadLayout();
        $this->_setActiveMenu('Stream_RuleBasedDiscount::rules');
        $this->_addBreadcrumb(__('Rule Based Discount'), __('Rule Based Discount'));
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->prepend(__('Rule Based Discount'));
        return $resultPage;
    }
}

Save Controller:

<?php

namespace Stack\RuleBasedDiscount\Controller\Adminhtml\Rules;

class Saveedit extends \Magento\Backend\App\Action {

    protected $_ruleModel;
    protected $_storeManager;

    public function __construct(
    \Magento\Backend\App\Action\Context $context, \Stack\RuleBasedDiscount\Model\Rule $ruleModel, \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->_ruleModel = $ruleModel;
        $this->_storeManager = $storeManager;
        parent::__construct($context);
    }

    public function execute() {
        try {
            $data = $this->getRequest()->getParams();
            $this->_ruleModel->setData($data);
            $this->_ruleModel->save();
            $message = __('Rule information has been saved successfully.');
            $this->messageManager->addSuccess($message);
            $this->_redirect('rulebaseddiscount/rules/index');
            return;
        } catch (\Exception $e) {
            $message = __('There was some problem in saving rule information. Please try again later.');
            $this->messageManager->addError($message);
            $this->_redirect($this->_redirect->getRefererUrl());
            return;
        }
    }
}


texts:
I have stuck creating credit memo in magento.

Assumption : I want to refund $10 to Customer ( Refund Offline = $10).

1) Actually I have Placed an Order with One Item 1005 (Price 1000 + 5 Tax & Handling).

2) Created Invoice for this Order.

3) I was fallow the below steps to Creating Credit Memo

I) I have put the 0 to Qty to Refund and hit the Update Qty's button.

II) And entered $990 on Adjustment Fee

III) Again put the 1 to Qty to Refund and hit the Update Qty's button,

IV) Now Grand Total is $10

4) Finally I hit the Refund Offline button.

Here the Refund Amount is $10 right?

But it is refunding $1000.

Is it my procedure is right or I went wrong?

if it is wrong How can I do this through Offline?

Thanks.


texts: Add Configurable products via Admin Panel

texts: I want to add Simple products in the configurable product. I can't find the option for adding products in the configuration section of the configurable product. It only showing create configuration option.


texts: Calling another controller and getting a response

texts:
This is a question about a solution provided on previous post...

How to call a controller action outside magento?

my question is how to get the response from the function being called on the controller. Also how to post to the controller function.

// grab request and response object to manipulate as needed
// (i.e. controller action expects post variables, etc.)

$request = $controller->getRequest();
$response = $controller->getResponse();


texts: Limit of Product description and short description character in magento 2

texts: Is there any limit to number of characters for product description and short description in magento 2?


texts: Order resets to Processing after Partial Refund

texts:
We have a custom Order Status that has been created for the Warehouse to indicate that an order is currently being prepared:

Status: Picking
State code and Title: processing[Picking]

However, we've noticed that if the Sales team generate a Partial Credit Memo (e.g. one line removed or adjusted down) that the Order resets back to Processing (instead of staying on Picking). If missed, this can result in an order being picked twice.

I was hoping someone might have a solution to this such as a setting that I've missed or some code I can override.


texts: configurable products attributes not showing in layered navigation

texts:
From this page http://boxchilli.co/s2as/kiteboard/kitesurfing/harnesses.html you should be able to see under the Filter By There should be Size however this doesn't show from the configurable products on the page

There is a part on the website were this does work http://boxchilli.co/s2as/gopro.html you can see the configurable product and the correct filters.

Whole site has been reindexed, Categories have been set to Anchor.


texts: how to make url from action data parameter in magento2?

texts:
I have

  data-post="{"action":"http://local.test.com/ar_eb/stores/store/redirect/","data":{"___store":"en_eb","___from_store":"ar_eb","uenc":"aHR0cDovL2xvY2FsLmV5ZWJvdS5jb20vZW5fZWIvY2F0YWxvZy9wcm9kdWN0L3ZpZXcvaWQvMTIwNTAvLmh0bWw,"}}"

how can I make it redirectUrl like below:

  http://local.eyebou.com/en_eb/stores/store/redirect/___store/ar_eb/___from_store/en_eb/uenc/aHR0cDovL2xvY2FsLmV5ZWJvdS5jb20vYXJfZWIvY2F0YWxvZy9wcm9kdWN0L3ZpZXcvaWQvMTIwNTAvLmh0bWw%2C/.html">
                              عربي

in Magento2


texts: How can I change the NOT LOGGED IN default tax rate depending on the store being viewed?

texts:
My previous question on this matter has received 0 responses, so I'm trying a different question.

My customer has two stores, selling the same products, but one is located in California and the other in Nevada. The requirement is to allow guest checkout, HOWEVER, the California store should only charge tax to CA residents and the Nevada store should only charge tax to NV residents.

How can I dynamically change the tax class that is assigned to the NOT LOGGED IN customer group, depending on the store being viewed?

I created a customer group specific to each store that is assigned at registration. Each has a tax class and tax rule for the respective state. So the taxation works for registered, logged in users.

I would like to set these tax classes to the NOT LOGGED IN user based on the store ID, URL or some other identifying criteria. Is this possible or do I need to require registration for taxation to work?


texts:
Given an order that has been invoiced (by cash on delivery for testing) and is in state "processing", how can I create a credit memo for a given sku and quantity (in code that is outside of Magento routing; e.g. /test.php)?

Say my order has an item of sku "100-0055-BRO-S" and quantity 2, and I want to refund 1 of these. My current code looks like this:

require 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
setlocale(LC_MONETARY, 'en_US');

$order = Mage::getModel('sales/order')->loadByIncrementId(1117575);
$convertor = Mage::getModel('sales/convert_order');

$refundSku = '100-0055-BRO-S';
$refundQty = 1;
$refundOi = null;
//$refundInvoice = null;

foreach($order->getAllItems() as $oi) {
    if($oi->getSku() == $refundSku) {
        $refundOi = Mage::getModel('sales/order_item')->load($oi->getId());
        break;
    }
}

$mcm = $convertor->toCreditmemo($order);
$mcmi = $convertor->itemToCreditmemoItem($refundOi);
$mcmi->setQty($refundQty);

$mcmi->setDiscountAmount($refundOi->getDiscountAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));
$mcmi->setBaseDiscountAmount($refundOi->getBaseDiscountAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));
$mcmi->setTaxAmount($refundOi->getTaxAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));
$mcmi->setBaseTaxAmount($refundOi->getBaseTaxAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));
$mcmi->setHiddenTaxAmount($refundOi->getHiddenTaxAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));
$mcmi->setBaseHiddenTaxAmount($refundOi->getBaseHiddenTaxAmount() * ($mcmi->getQty() / $mcmi->getOrderItem()->getQtyOrdered()));

$mcm->addItem($mcmi);
$mcm->register();

Mage::getModel('core/resource_transaction')
    ->addObject($mcm)
    ->addObject($mcm->getOrder())
    ->save();

This results in a credit memo being created on the order and showing up in the admin panel. However, the item looks like this:

Price    Qty  Subtotal   Tax Amount   Discount Amount    Row Total
$38.00    1    $0.00       $1.62           $19.00         -$17.39

I don't understand why the subtotal is 0. Maybe it has something to do with not utilizing the invoice? But I'm not sure how to go even about that. It seems like it is taking the discount amount and subtracting it from the subtotal + tax amount. Also all of the credit memo totals (subtotal, adjustment refund, adjustment fee, tax, grand total) are $0.00.

The math I'm doing to manually set the values for $mcmi (Mage Credit Memo Item) seems sketchy. I would think that Magento would set these for me given the qty I set it to, but it seems like it does not so I have to do it myself. If there is a better way to set these values, I would appreciate the help there too.


texts: Magento 2: how to add attribute in product pages of specific attribute set only?

texts:
I have two attribute sets in my store: 'default' and 'clothing'. The only difference is that clothing set has an extra attribute called "Fit".

I added a custom section in product pages to display the "Fit" attribute:

$fitLabel = $_product->getResource()->getAttribute('fit')->getFrontendLabel();
$fitValue = $_product->getResource()->getAttribute('fit')->getFrontend()->getValue($_product);

However, "Fit" attribute appears in ALL product pages, not only clothing.

How can I add a condition to display the Fit attribute only in clothing products (products with 'clothing' attribute set)?


texts: How to make new column through foreach loop in html table

texts:
I want to make one column with three rows after that second and third column should be made. With this code, only one column is being created.

$i = 1;
foreach($array as $a => $v) {

    if(empty($a)){
        continue;
    }
    $table .= "$a	$v	";
    //^           ^ double quotes for the variables
    if(($i+0) % 1 == 0)
        $table .= "

";
    $i++;

}


texts: How to set mail type to "pdf attachment" in sendmail controller?

texts:
I want to send a pdf attachment by email. But the email content only show text "Object". My TCPDF Plugin is working, but why my script can't send email with an attachment?

Here's my script :

$mail = new Zend_Mail('utf-8');
$mail->setType(Zend_Mime::MULTIPART_RELATED);
$mail->setBodyHtml($html);
$mail->setFrom('penawaran@mail.id', 'Nekindo');
$mail->addTo('mail@mail.com', 'Syahidah Humairoh');
$mail->setSubject('subject');
    try {
        $mail->send();
        Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
        $this->_redirect('offer');
    }
    catch (Exception $e) {
        Mage::getSingleton('core/session')->addError('Unable to send.');
        $this->_redirect('offer');
    }


texts: file resettting to 000 permission without doing any changes

texts:
in 1.9 , we are facing 500 error in checkout page frequently.

its because of one of core checkout related file is set to 000 permission.

once we reset to 644 , it will be fine. but its happening frequently.

we need some permanent solution. without doing any changes why its resetting to 000

edit

2016-06-06T19:38:30+00:00 ERR (3): Warning: include(/home/apd16/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php): failed to open stream: Permission denied  in /home/apd16/public_html/lib/Varien/Autoload.php on line 94
2016-06-06T19:38:30+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Checkout/Model/Type/Onepage.php' for inclusion (include_path='/home/apd16/public_html/app/code/local:/home/apd16/public_html/app/code/community:/home/apd16/public_html/app/code/core:/home/apd16/public_html/lib:.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php')  in /home/apd16/public_html/lib/Varien/Autoload.php on line 94

magic file :

app/code/core/Mage/Checkout/Model/Type/Onepage.php


texts:
I'm trying to change the payment method label on my checkout page. I want to display an image for the particular method. My original code was:

<label for="p_method_<?php echo $_code ?>" style="text-transform:none">
<?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?>
<?php echo $this->getMethodLabelAfterHtml($_method) ?>

Here is what I am trying to do: The name of the method I want to change is "Laybuy"

<label for="p_method_<?php echo $_code ?>" style="text-transform:none">
<?php if($this->getMethodTitle($_method) = "Laybuy "): ?>
goes here
<?php else: ?>
<?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?>
<?php echo $this->getMethodLabelAfterHtml($_method) ?>
<?php endif; ?>

But it is not working at all. I am a complete php noob. How can I get this to work.


texts: Refresh specific cache only if invalidated

texts:
Magento ver. 1.9.0.0

I keep getting the BLOCK_HTML cache becoming invalid and this is stopping some external blocks of code from displaying until I refresh the cache.  I see that I can flush the cache in my code as follows:

Mage::app()->getCacheInstance()->cleanType('block_html');

I would like to call this only if the cache is invalid, is it possible to check if the cache in invalidated?

Many thanks


texts: Magento 2 infinite scroll on custom page instead of pagination

texts:
I am using an extension for deals page. The page has pagination and pagination is called with this code $block->getToolbarHtml() . How can I change this to infinite ajax scroll? Also I only want to do this customization for this page only, not category pages.
I tried with this link https://www.dckap.com/blog/infinite-scroll-ajax-pagination-in-magento-2/ But the ajax returning is getting the whole 2nd page with meta title and html head etc. So that makes it messed up.


texts: Safe for model method to rely on loaded model state?

texts:
Is it safe for a model method to rely on the model being in a loaded state i.e. accessing a data value?

An simplified example:

public function testMethod()
{
   return 100 x $this->getData('test_attribute');
}

This method only makes sense if the model had loaded correctly.

Is this bad practice? Or any alternative?


texts:
I am trying to get a hero carousel on my homepage that I also want at the bottom of some other pages, like my search results page. The content is the same, but the div it is wrapped in needs different Foundation grid classes for each page.

So, I made a core/template phtml file for each of the locations and I want to call it in to, and they are working. Each of those has a div with the grid classes I need and inside it has <?php echo $this->getChildHtml('heroCarousel') ?> from a third core/template phtml file.

I know I need to identify this last phtml template with as="", and I have done this kind of thing once before, for example, for the search results page using this code:

<catalogsearch_result_index>
     <block type="cms/block" name="full_width" as="full_width">
         <action method="setBlockId"><block_id>full_width_static_block</block_id></action>
     </block>
</catalogsearch_result_index>

How can I do the same for the homepage? I have to identify the .phtml template with as="" before I can call it in with <?php echo $this->getChildHtml('heroCarousel') ?>, right? If that is so, what is the handle for doing this on the homepage?

Thanks.


texts: Magento 2: How to move Details tab to product info column?

texts:
In Magento 2, the Blank theme displays the Details tabs below product images.

How to move this block to the product info column (right side of the page, under Add to cart button)?


texts:
I have a popup model with following fields

name
email
comment box
submit button with input type=”button”

I displayed this form in a popup model.

Now I need to validate these fields. Is there any solution to validate these input fields in magento 2?

    <form>

Feedback form

    Name:<input type="text" name="name" id="name">
    Email:<input type="email" name="email" id="email">
    Suggestion:
    <select name="selectname" id="suggestion">
        <option value="">--Select--</option>
        <option value="on product">On product</option>
        <option value="on delivery">On delivery</option>
        <option value="on usability">On usability</option>
        <option value="criticism">Criticism</option>
        <option value="others">Others</option>
    </select>
    Comments:<textarea rows="4" cols="50" id="comments"></textarea>
    <input type="button" value="submit" id="feedbackBtn">
    </form>


texts: Magento 2 : How to add OTP functionality attach with Cash On Delivery Payment option?

texts: I need to validate mobile number in case of Cash On Delivery option. How do we override this payment option to get this done Or we can call any event for this functionality in Magento 2 ?


texts: getting the base sku (Without a suffix) of a product with custom options

texts:
I am facing a problem in which i need to retrieve the base sku of a product on the modified sku of that product which has the custom option sku suffixed.

for example> base product "shirt", sku = 1234,
                             "red shirt"= 1234-12
how can i get the sku of the base "shirt" (1234) from the "red shirt"(1234-12)
please take note that this isnt a case of "configurable products". and there doesnt exist in parent child relationship between the original and sub products(and parents are returned as "null"


texts:
How can I figure out the version of LESS used by Magento 2?

I need it for a bug report.


texts: programmatically added option in DB but not visible // setHasOptions() no effect

texts:
[-- Edited below --]

I'm adding custom options programmatically when the product_prepare_save event is called. If it is the second custom option, everything works as expected, if it is the first, it will not appear.
However, it will appear when I add another custom option afterwards. I'm suspecting that I'm not saving the product correctly, but I can't find out why / how.

Here's the (shortened) function registered with the event observer:

    $event = $observer->getEvent();
    $request = $event->getRequest();
    $post = $request->getPost();

    $optionstoadd = array();
    if($post['newoptions']) {
        $optionstoadd = $post['newoptions'];
    }

    $currentProduct = $observer->getProduct();
    $currentProduct->setHasOptions(true);

    foreach ($optionstoadd as $optionId) {
        if($optionId == "") {
            continue;
        }
        $product = Mage::getModel('catalog/product')->load(Mage::getModel('catalog/product_option')->load($optionId)->getProductId());
        $option = $product->getOptionById($optionId);

        $data = array(...);

        $currentProduct->getOptionInstance()->addOption($data);
    }

EDIT: I have found out that setHasOptions(true); has no effect. I just cannot figure out why though. Also, the option itself is showing up in the database.


texts: Cannot Import products - No date part in '' found. error

texts:
all of a sudden we cannot import products and are getting this message

No date part in '' found.

after checking the error logs this is getting thrown up multiple times

2014-08-26T19:31:33+00:00 ERR (3): User Error: DDL statements are not allowed in transactions  in /home/our-site/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 408

any idea why this is happening or how to fix it?  We haven't installed anything new recently.  We are using magento 1.9  thanks for the help


texts: How can I add HTML formatting to the comments box in the order admin area in Magento 1.9?

texts: Is there a way I can add html formatting to the order comments within the admin area? Just writing the comments using html doesn't work...


texts: How to stop Magento 2 Escaping HTML in Contact form

texts:
I'm hoping someone can help me figure out how to prevent Magento 2 from escaping special chars in the contact form!

At the moment, when a message is sent via the standard contact form in Magento 2, any special characters are escaped to & etc.

<textarea name="comment" id="comment" title="<?php /* @escapeNotVerified */ echo __('Message Content') ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea>

I'm feeling that it has to do with this line of code. I've tried removing the escapeHtml bit, but that just breaks the page..


texts: Magento 2: Change Customer Group Once Order is Completed for Product

texts:
I have to change Customer Group.

Once Customer has purchased X Product & Order Status is Completed.
In Order apart from X Product if there are any other products then no issue.

Don't wanna use Cron Job. Can manage through Observer?

On Admin Side Once we Click on "Ship", it changes Status to "Completed". So need to execute the event on click of that?

Which Event needs to Call?

Followed below links

Change customer group upon buying a specific product

https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html


texts: Shop By Brand call landing page category on right sidebar

texts:
I am trying it countless hours.But no luck .
I Am using Shop by brand extension. i want to show current brands category at right sidebar there is called a view.phtml and its showing category  by this file..
app/design/frontend/default/mytheme/layout/shopbybrand.xml .

 <shopbybrand_index_view>
        <reference name="content">
            <block type="shopbybrand/view" name="shopbybrand_view" before="-" template="shopbybrand/view.phtml" />
        </reference>
          </shopbybrand_index_view>

Now i am calling this file by different file name. Here Code

<shopbybrand_index_view>
            <reference name="right">
             <block type="shopbybrand/view" name="shopbybrand_view" before="-" template="shopbybrand/listingcategory.phtml" />
        </reference>
          </shopbybrand_index_view>

Pleas help me how can I do it thanks in advance ?


texts: Product list page configurable product price in negative value in magento 1?

texts:
Product list page configurable product price in negative value in Magento 1?

How to correct it?

Single product page the price is correctly showing


texts: Magento 2 | Hreflang return wrong category link for store

texts:
In my Magento2 website i have installed an extension for generate links for hreflang.
This is the class that generates links for hreflang:
use Magento\Framework\View\Element\Template;
use Magento\Store\Api\Data\StoreInterface;
use Magento\Store\Model\Group;
use Magento\Store\Model\Store;
use Magento\Store\Model\Website;

class HrefLang extends Template
{
    /**
     * @var \BrunoCanada\HrefLang\Service\HrefLang\AlternativeUrlService
     */
    private $alternativeUrlService;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \BrunoCanada\HrefLang\Service\HrefLang\AlternativeUrlService $alternativeUrlService,
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->alternativeUrlService = $alternativeUrlService;
    }

    /**
     * @return array in format [en_us => $url] or [en => $url]
     */
    public function getAlternatives()
    {
        $data = [];
        foreach ($this->getStores() as $store) {
            $url = $this->getStoreUrl($store);
            if ($url) {
                $data[$this->getLocaleCode($store)] = $url;
            }
        }
        return $data;
    }

    /**
     * @param Store $store
     * @return string
     */
    private function getStoreUrl($store)
    {
        return $this->alternativeUrlService->getAlternativeUrl($store);
    }

    /**
     * @param StoreInterface $store
     * @return bool
     */
    private function isCurrentStore($store)
    {
        return $store->getId() == $this->_storeManager->getStore()->getId();
    }

    /**
     * @param StoreInterface $store
     * @return string
     */
    private function getLocaleCode($store)
    {

        $localeCode = $this->_scopeConfig->getValue('general/locale/code', 'stores', $store->getId());
        return str_replace('_', '-', strtolower($localeCode));
    }

    /**
     * @return Store[]
     */
    private function getStores()
    {
        /*if ($this->_scopeConfig->isSetFlag('seo/hreflang/same_website_only')) {
            return $this->getSameWebsiteStores();
        }*/
        return $this->_storeManager->getStores();
    }

    /**
     * @return Store[]
     */
    private function getSameWebsiteStores()
    {
        $stores = [];
        /** @var Website $website */
        $website = $this->_storeManager->getWebsite();
        foreach ($website->getGroups() as $group) {
            /** @var Group $group */
            foreach ($group->getStores() as $store) {
                $stores[] = $store;
            }
        }
        return $stores;
    }
}

And this is the file phtml:
<?php
$alternatives = $block->getAlternatives();
?>
<?php if ($alternatives): ?>
    <?php foreach ($alternatives as $hrefLang => $url): ?>

<link rel="alternate" hreflang="<?php echo $hrefLang ?>" href="<?php echo $url ?>" />

    <?php endforeach; ?>

<?php endif ?>

The module works but all links generated are all referring to the default store.
This issue happen only on category page and not for product page:
Current result:
www.mysite.com/categoria1 ---> store 1
www.mysite.com/categoria1 ---> store 2
www.mysite.com/categoria1 ---> store 3

Expected result:
www.mysite.com/categoria1 ---> store 1
www.mysite.com/category1 ---> store 2
www.mysite.com/Kategorie ---> store 3

I checked all my backend links in url rewrites section and they are all correct!
How can I do to fix this error?


texts: display the number of product with static block in categories?

texts:
I am using magento 1.7. I create a category "A" and in it i create others categories.
I created a static block and affect to the category "A". I wish to display the categories name and his count in all categories using static block. Can i do that with static block or with other solution ?


texts: Magento 2.2.4 Order Confirmation Mail Not Receive

texts:
Magento 2.2.4 Order Confirmation Email Not Receive by Customer
and Newsletter Emails Received by Subscriber Successfully


texts: Correct upgrade procedure for extensions and themes

texts:
When a newer version of an extension (or theme) you are using is released, what is the standard way to update/upgrade a site with it? (assuming that the extension/theme uses Magento Connect)

Can I just install the newer version overwriting previous files?

Or should I first uninstall the previous version, then install the new one?

Does it make a difference if the installation is via Extension Key or Package File?

I've found a lot of information about upgrading Magento itself, but virtually nothing about extensions/themes!


texts: How to save product position in category programatically in Magento?

texts:
I want to save the product position based on the category. I have checked and no help available related to this.

So, please help me in saving product position based on category programmatically in Magento.


texts: Magento 2.1.0 : How to get custom table data in phtml file

texts:
I have created a custom module : Ved_Mymodule
File structure of the module is as follows:

Ved
└───Mymodule
    │   registration.php
    │
    ├───etc
    │       module.xml
    │
    ├───Model
    │   │   News.php
    │   │
    │   └───Resource
    │       │   News.php
    │       │
    │       └───News
    │               Collection.php
    │
    ├───Setup
    │       InstallSchema.php
    │       UpdateSchema.php
    │
    └───view
        └───frontend
            │   requirejs-config.js
            │
            ├───layout
            │       deafult.xml
            │
            └───web
                ├───css
                └───js
                        customCatalogAddToCart.js
                        InstallSchema.php

Using this module, one table with name ved_mymodule is created. 'id' is the primary key in that column.

Here are the files :

Ved\Mymodule\Model\News.php :

<?php

namespace Ved\Mymodule\Model;

use Magento\Framework\Model\AbstractModel;

class News extends AbstractModel
{
    /**
         * Define resource model
         */
        protected function _construct()
        {
            $this->_init('Ved\Mymodule\Model\Resource\News');
        }
    }

Ved\Mymodule\Model\Resource\News.php:

<?php

namespace Ved\Mymodule\Model\Resource;

use Magento\Framework\Model\Resource\Db\AbstractDb;

class News extends AbstractDb
{
    /**
         * Define main table
         */
        protected function _construct()
        {
            $this->_init('ved_mymodule', 'id');
        }
    }

Ved\Mymodule\Model\Resource\News\Collection.php:

<?php

namespace Ved\Mymodule\Model\Resource\News;

use Magento\Framework\Model\Resource\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{
/**
     * Define model & resource model
     */
    protected function _construct()
    {
        $this->_init(
            'Ved\Mymodule\Model\News',
            'Ved\Mymodule\Model\Resource\News'
        );
    }
}


texts:
I'm a bit embarrassed at posting this because I think I must be doing something really stupid, but seeing as I'm completely stuck, no choice.

My simple use case is:

Grab orders through the SOAP API. The results include [billing_address_id] and [shipping_address_id], so far so good, no problems
Then, I try to retrieve the address details using the [billing_address_id], as below

$custAddress = $this->soapClient->customerAddressInfo($this->session, $orderObj->billing_address_id);

However, the response I get is that the address doesn't exist? WTF?

Magento has just given me the address_id and then tells me it doesn't exist.

Any help VERY gratefully received, either on why this seemingly simple operation doesn't work and/or how to do it correctly.

Thanks


texts: Magento 2 : How to load quote by quote id

texts: How can I load quote in magento 2 by quote id ?


texts: Not able to send email from custom module

texts:
How to debug following code.

$transport = $this->transportBuilder
                ->setTemplateIdentifier($emailTemplate)
                ->setTemplateOptions(
                    [
                        'area' => 'adminhtml',
                        'store' => $this->storeManager->getStore()->getId()
                    ]
                )
                ->setTemplateVars($variables)
                ->setFrom($emailSender)
                ->addTo($emailRecipient)
                ->setReplyTo($replyTo, $replyToName)
                ->getTransport();

It is getting failed without any error or exception message.


texts: Magento 2 Installation Error In Docker - File Cannot Be Renamed

texts:
I'm using docker-compose to build a Magento 2.3.1 development environment (Docker for Windows with Linux containers enabled).

The stack is based on PHP:7.2-apache with all Magento required extensions and MySQL 5.7.

The readiness test is successful, the database connection is okay, however, I get a fatal error when the installation starts :

  Fatal error: Uncaught RuntimeException: The path
  "/var/www/html/generated/code/Magento/Framework/App/Config/InitialConfigSource/Proxy.php.20"
  cannot be renamed into
  "/var/www/html/generated/code/Magento/Framework/App/Config/InitialConfigSource/Proxy.php"
  Warning!rename(/var/www/html/generated/code/Magento/Framework/App/Config/InitialConfigSource/Proxy.php.20,/var/www/html/generated/code/Magento/Framework/App/Config/InitialConfigSource/Proxy.php):
  No such file or directory Class
  Magento\Framework\App\Config\InitialConfigSource\Proxy generation
  error: The requested class did not generate properly, because the
  'generated' directory permission is read-only. If --- after running
  the 'bin/magento setup:di:compile' CLI command when the 'generated'
  directory permission is set to write --- the requested class did not
  generate properly, then you must add the generated class object to the
  signature of the related construct method, only. in
  /var/www/html/vendor/magento/framework/Code/Generator.php:135 Stack
  trace: #0 /var/www/html/ve in
  /var/www/html/vendor/magento/framework/Code/Generator.php on line 135

It's obvious that it's a file permission issue, but I'm not sure how and where I can fix this, so any help will be highly appreciated !

My webserver in docker-compose :

version: "3"

services:
  webserver:
    build:
      context: ./bin/webserver
    container_name: '7.2.x-webserver'
    volumes:
      - ${DOCUMENT_ROOT-./www}:/var/www/html
      - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini
      - ${VHOSTS_DIR-./config/vhosts}:/etc/apache2/sites-enabled
      - ${LOG_DIR-./logs/apache2}:/var/log/apache2
...

My webserver Dockerfile :

FROM php:7.2-apache

RUN apt-get -y update --fix-missing
RUN apt-get upgrade -y

# Install tools & libraries
RUN apt-get -y install apt-utils nano wget dialog \
    build-essential git curl libcurl3 libcurl3-dev zip

# Install important libraries
RUN apt-get -y install --fix-missing apt-utils build-essential git curl libcurl3 libcurl3-dev zip \
    libmcrypt-dev libsqlite3-dev libsqlite3-0 mysql-client zlib1g-dev \
    libicu-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
    libxslt-dev

# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# PHP Extensions
RUN pecl install xdebug \
    && docker-php-ext-enable xdebug \
    && pecl install mcrypt-1.0.2 \
    && docker-php-ext-enable mcrypt \
    && docker-php-ext-install pdo_mysql \
    && docker-php-ext-install pdo_sqlite \
    && docker-php-ext-install mysqli \
    && docker-php-ext-install curl \
    && docker-php-ext-install tokenizer \
    && docker-php-ext-install json \
    && docker-php-ext-install zip \
    && docker-php-ext-install -j$(nproc) intl \
    && docker-php-ext-install mbstring \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    && pecl install redis \
    && docker-php-ext-enable redis \
    && docker-php-ext-install bcmath \
    && docker-php-ext-install xsl \
    && docker-php-ext-install soap

# Enable apache modules
RUN a2enmod rewrite headers

# Fix Files Permissions
RUN chown -R www-data:www-data /var/www/
RUN chmod -R 775 /var/www/

ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]


texts: Shopping cart price rules conditions no longer satisfied event

texts:
I have a few special shopping cart rules which customer can apply through an activation URL. This is working fine, but I need to be able to display a message if the customer removes a product or changes the quantity in a way that the shopping cart rule is no longer valid. What's the best way of achieving this? Is there an event to listen to?

Steps should be as follows

Customer gets an activation link, which will add the products with quantity needed to the cart and apply the shopping cart price rule.
If the customer changes the quantity or remove a product, a message needs to show letting the customer know the Promotion Code is no longer valid or something similar because the X product is removed etc.


texts: Magento 2 how to remove customer previously added product from cart

texts:
Steps :

When I add any product to cart and go to the checkout page.
On the checkout page when I login with customer who added product previously then the product will be added to the cart.

I want to stop or remove this functionality so what steps should I follow.


texts: Magento 2 : Move "catalog.product.related" block in product view

texts:
I'm modifying the layout of the product view.

I'm trying to move and edit the product related block "catalog.product.related".

In my catalog_product_view.xml I have :

 <referenceContainer name="content.aside">
            <block class="Taschert\Example\Block\Product\Test" after="-" name="taschert.list.test" template="Taschert_Example::product/test.phtml">
                <arguments>
                    <argument name="section" xsi:type="string">productpage</argument>
                    <argument name="position" xsi:type="number">1</argument>
                </arguments>
            </block>
            <referenceBlock name="catalog.product.related" after="taschert.list.test"
                            template="Taschert_Example::product/list/items.phtml">
                <arguments>
                    <argument name="type" xsi:type="string">related</argument>
                    <argument name="section" xsi:type="string">productpage</argument>
                    <argument name="position" xsi:type="number">1</argument>
                </arguments>
            </referenceBlock>
        </referenceContainer>

The block product related use my custom template but show before my first block. Did I miss something ?

I have tried just to move the block with no result.

<move element="catalog.product.related" destination="content.aside" after="taschert.list.test"/>

I've clear my cache.


texts: Magento 2 Extension manager (PHP Settings Check*)

texts:
I'm using ubuntu 18.04 with PHP 7.3.14. I just purchased a module that I'm trying to install. This is the error I'm receving. How am I supposed to know whats wrong? It tells me that I'm missing PHP extension. I have checked the magento 2 documentation and installed the neccesary PHP extensions. I have cleared the cache and restarted the apache2 server. I have checked the php.ini file to make sure that I have enough memory.

https://devdocs.magento.com/guides/v2.3/install-gde/prereq/php-settings.html
https://stackoverflow.com/questions/42393376/magento-2-installation-error-php-settings-check

My php.ini file doesn't show all the modules I have installed which witch makes me a bit confused. Am I missing something?


texts: Customer Attributes & Customer Address Attributes Export/Import

texts:
I am trying to export and import via MySQL the customer attributes & customer address attributes. There are 9 instances of Magento that I manage and I've set up the validation rules on 1 instance. I would like to copy this across.

I do not want to copy across customer data, just the attributes and its data like validation.
What tables should I export and import to achieve this?


texts: How do I add a Mass Action for exporting to CSV with a custom admin grid?

texts:
I followed this tutorial to create a custom module:
http://inchoo.net/magento/how-to-create-a-custom-grid-from-scratch/

Now I want to add the ability to check mark specific rows and export just those to CSV. What is the best approach?

Here is what I have in the Grid.php:

 protected function _prepareMassaction() {

    $this->setMassactionIdField('increment_id');
    $this->getMassactionBlock()->setFormFieldName('picklist_order_grid');  //html name of checkbox
    $this->getMassactionBlock()->addItem('export', array(
        'label'=> __('Export Selected'),
        'url'  => $this->getUrl('*/*/exportSelectedPicklistCsv'),   //an action defined in the controller
        'selected' => 'selected',
        'confirm' => __('Are you sure?')
    ));

return $this;

}

Which calls this function in the controller:

public function exportSelectedPicklistCsvAction()
{
    $fileName = 'picklist.csv';
    $grid = $this->getLayout()->createBlock('kevando_picklist/adminhtml_sales_order_grid');
    $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
}

This exportSelectedPicklistCsvAction() function works fine when I have export all the visible items, but not the ones which are check marked.

Any type of help or other SO links are appreciated.

Thanks


texts: Display correct saleable qty when product is changed to "no backorder" / "out of stock"

texts:
When an item is offered as "Allow backorder" and you sell more than stock qty, the Saleable Qty changes to -1 etc. This way you can see which items needed to restock. However, if an item with SQ -1 is changed to "No backorder" the item changes to "Out of stock" and the SQ displays 0 (even if you still need to restock the item).
Is there a way to let SQ display correct negative value even if the item is changed to "No backorder"/"Out of stock" ?
Thank you


texts: Incorrect register.phtml template rendering

texts:
For some reason, in our deployed environments, instead of the regular Magento_Customer register.phtml file, the Magento_CustomerCustomAttributes register.phtml file is rendering.

How can I resolve this? I'd either like to force the Custom Attributes version of register.phtml to render locally, or get the normal Customer version to render in my deployed environments.

Please help! This is driving me crazy.


texts:
I have newbie at Magento and installed 1.8.1 version properly.
But some how I cannot see the category edit page properly. Other pages can be seen . What the proplem could be?

Cache Management page.


texts: Magento 2: How we can add construct into overridden class

texts:
If There are no parent::__construct from parent class then

  How we can add construct into overridden class?


texts: Magento 2: Custom ajax search "product name" too slow to compare default magento 2 search

texts:
I have created custom controller and custom page for quick order functionality.When I type in textbox product name it trigger ajax in custom controller to find a product name.In website around 90,000 products are there. So problem is when I search and trigger in custom controller it takes too much time to find product and when I use magento default search to find product it returns quick result of product list.So below is my ajax code and custom search code in controller.

$('#quick-search').keyup(function(){
            var search_text = jQuery("#quick-search").val();
            try {
                    jQuery.ajax({
                        url : '<?php echo $block->getUrl('quickorder/search/product') ?>',
                        dataType : 'json',
                        data: { 'search_text' :  search_text  },
                        type : 'post',
                        success : function(data) {
                            jQuery('.main-search-results').html(data.products);
                        }
                    });
                } catch (e) {
                }
        });

Controller/Search/Product.php

public function execute()
{

        $search_text = $this->getRequest()->getPost('search_text');

        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect(array('name'))->addAttributeToFilter('name',
        array('like' => $search_text.' %'),
        array('like' => '% '.$search_text.' %'),
        array('like' => '% '.$search_text)
        ));

        echo "<pre>";
        print_r($collection->getData());
       die();
}


texts: Trouble updating Super Attribute pricing

texts:
I'd like to programatically modify this pricing:

I thought I had something, this updates the attribute price because I can retrieve the new value with getPrice():

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'SOME_SKU');
$attributes = $product->getAttributes();
foreach ( $attributes as $attribute ) {
    $attribute->setPrice(20.00);
    $attribute->save();
    echo $attribute->getPrice(); // 20.00
}

However, even after clearing caches and indexes, this value is not reflected in the frontend product configurator, or the admin panel as per the screenshot above.

Is there another method I need to use?


texts: How to add a simple product with more than 1 option to Cart?

texts:
I am trying to add a product from a custom page to the cart. I have the Configurable and also simple and I have the values of the options and also the IDs of the options.

I tried to use:

/path/to/magento/checkout/cart/add?product=$pid&qty=$qty&options[$id]=$value

in the way

/path/to/magento/checkout/cart/add?product=$pid&qty=$qty&options[$id]=$value&options[$id]=$value

Did not work out .

Then I tried this :

/path/to/magento/checkout/cart/add?product=$pid&qty=$qty&options[$id1,$id2]=$value1,$value2

This also did not work out. What Am I missing?

Any help will be appretiated.

Cheers


texts: Magento 2: How can I remove all products URL rewrites?

texts:
I've used a script to TRUNCATE all tables related to products, so removing all products in my store. Now I want to remove the more than 4k URL rewrites related to those products removed, though, maintaining the categories' URL rewrites.

How can I do that?


texts: Magento2: How to disable auto login on registration from admin

texts:
How to disable auto-login on registration from magento2 admin?

Thanks


texts: Magento Patch 8788 on Magento 1.8.1.0 problem

texts:
I am trying to install the security patch 8788 but I get some errors.

patching file js/mage/adminhtml/product.js
patching file js/mage/adminhtml/uploader/instance.js
can't find file to patch at input line 5810
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Parser.php lib/Unserialize/Parser.php
|index 423902a..2c01684 100644
|--- lib/Unserialize/Parser.php
|+++ lib/Unserialize/Parser.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 5822
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Reader/Arr.php lib/Unserialize/Reader/Arr.php
|index caa979e..cd37804 100644
|--- lib/Unserialize/Reader/Arr.php
|+++ lib/Unserialize/Reader/Arr.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 5838
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git lib/Unserialize/Reader/ArrValue.php lib/Unserialize/Reader/ArrValue.php
|index d2a4937..c6c0221 100644
|--- lib/Unserialize/Reader/ArrValue.php
|+++ lib/Unserialize/Reader/ArrValue.php
--------------------------
File to patch:

The whole lib/Unserialize folder does not exists. The shop of my client is running Magento 1.8.1.0 I have another client with the exact same thing, I also downloaded the correct file. And tried earlier patches too to see if some of them maybe created those folders but I could not really find anything. I would appreciate if somebody can point me in the right direction or has solved this problem before.


texts: Magento 2 SSO: Frontend Authentication using Rest API issued Token (or similar)

texts:
I need to integrate a third party application with Magento, so that

people can login into the third party app with their Magento 2 Credentials
and stay logged into the Magento frontend when they land on the e-commerce from the third party app.

In other words I need to implement some kind of SSO with Magento as an identity provider.
The full use case would be something like this:

The user lands on the third party app;
User logs in using the application login form;
The user is authenticated against Magento 2 REST API;
At some moment, user clicks on a link that redirects him to the Magento2 frontend;
The user lands on the Magento 2 frontend and Magento recognizes him as the previously authenticated user.

The first solution that came to my mind was to use JWT in step 4, to transfer the authentication information from the application to the Magento frontend, but I can't find a plugin that supports this.

If a full custom solution is needed, where should I look first (obserer, plugin, ...other)?
Are there other solutions to achieve this?

Other limitations and preferences:

We can't use OAuth or SAML or other protocols since they need the user to be redirected for the login. The login must be done in the third party application and recognized on both applications.
A plugin solution for Magento would be best, instead of developing a full custom solution.

This question is also be related, the only difference is that I don't need the token to be the exact REST API token.
This question looks related also, but I really can't get the answer there.


texts: Rich snippets for responsive layout in product page

texts:
Assuming below structure in product view page, should I add the rich snippet tag itemprop="name" for both views, as  Google does not crawl css with diaply:none.

        .
        .
        .

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

        .
        .
        .

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

        .
        .
        .


texts: Switching back to MySQL sessions after using Redis sessions

texts:
I'm having an issue with my site.  We were using Redis sessions, but after some issues with latency we've decided to switch back to MySQL sessions.
The app/etc/local.xml file used to look something like
<config>
    <global>
    [...]
        <session_save>db</session_save>
        <redis_session>
            <host>127.0.0.1</host>
            <port>6379</port>
            <password></password>
            <timeout>2.5</timeout>
            <persistent>sess-db2</persistent>
            <db>2</db>
            <compression_threshold>2048</compression_threshold>
            <compression_lib>gzip</compression_lib>
            <log_level>7</log_level>
            <max_concurrency>6</max_concurrency>
            <break_after_frontend>5</break_after_frontend>
            <break_after_adminhtml>30</break_after_adminhtml>
            <bot_lifetime>7200</bot_lifetime>
        </redis_session>
    </global>
    [...]
</config>

However, now with the Redis configuration removed it's
<config>
    <global>
    [...]
        <session_save>db</session_save>
    </global>
    [...]
</config>

The problem is that it looks like Redis sessions are still being used.  For every connection a new exception is being logged.

Connection to Redis failed after 1 failures.
Unable to connect to Redis; falling back to MySQL handler

So it looks like even though the Redis configuration has been removed, it's still not told that it shouldn't be using Redis anymore, either.
Is there a way to force it back to using MySQL sessions?


texts: I have a multi-vendor platform, some of which only sell products to specific countries. I do not want to show products to clients that is not available in their countries. How can I achieve this?