texts: Magento 2 Grid Component: Persistent Pagination possible?

texts:
When I browse through any backend grid in Magento 2, for example the product list for Magento_Catalog, the pagination is not persistent.

What I mean:

Go to the product list and make sure more than one page exists (for example 60 products are available and only 20 are shown => 3 pages total)
go to page two for example
open any product
wait for the edit view to open and then go "back" using the provided links

When I do this, I always come back to page 1. This is a real problem for my client, because there are a lot of products he has to go through from time to time.

What I would expect: save the current page somewhere. When you come back to the grid, don't fall back to page 1.

I have two questions:

Is the table ui_bookmark supposed to provide this persistance? There is a column "current", which could possibly be related to the "current" setting of the Grid Component.
If this is not supported right away, any hint where I could start to look into for an implementation? As of yet, I don't fully understand the complete structure of the grid as a whole.

Btw: This problem is also true for custom grids I've created.


texts: In Magento model do we have business logic or a controller?

texts: I have read so many documentation about MVC. But I am still confused regarding the business logic in Magento. Can you please help me to explain business login in Magento with an example ?


texts: Magento 1 - Which file is responsible for displaying products in category page?

texts:
I am trying to find the file which is responsible for displaying products into category page
In magento 1.
But i am not able to find it
Any help appriciated.


texts: Get Shopping cart rule info in invoice PDF

texts: I would like to use shopping cart rule information in the invoice PDF. For certain rules I want to add some information in the PDF. How can I get these values?


texts: Why new products are visible smaller as compared to recently products on homepage. Today it looks fine but how come

texts: I am building an eCommerce website named www.bookslab.in. On my homepage when i added the 2 widgets "New Products" & "Recently Viewed" products then new products section is visible smaller as compared to recently viewed products. I don't know why this is happening. I had cleaned the Index & Magento cache still they are same. I am attaching the screenshot of my website homepage. Can anybody explain me how automatically it looks great now?


texts:
I'm working on an heavy customised magento version. Cancelling an order returned this fatal error:

Mage_Catalog_Model_Product_TYPE not found

on this line code:

if($parent->getTypeId() == Mage_Catalog_Model_Product_TYPE::TYPE_CONFIGURABLE)

I fixed changing it to

if($parent->getTypeId() == 'configurable')

Can you please tell me what's the difference between them and if my solution can lead to other issues?
many thanks


texts: Reset special price on a store via soap api

texts:
I am really struggling to remove a special price and setting the flag Use default value on a store level via soap api. I tried both catalog_product.setSpecialPrice and catalog_product.update (see http://devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProduct/catalogProduct.html) but it does not work.

In the meantime I have a workaround with setting the special price with a string of zero length ("") to null. Not very satisfying though but at least it works more than half way I would like to. Any help appreciated.


texts: How to handle this database error when copying for staging environment?

texts:
I wanted to copy my live shop (1.9.0.1) to a staging environment.
The first time i did it it went ok, but i have configured the VAT and tax in admin sales>taxes and that is working ok, but for some reason this gives me an error on copying the database
Here is the error
Error
SQL-query:
--
-- Limitations for table sales_order_tax_item
--
ALTER TABLE sales_order_tax_item ADD CONSTRAINT FK_SALES_ORDER_TAX_ITEM_ITEM_ID_SALES_FLAT_ORDER_ITEM_ITEM_ID FOREIGNKEY ( item_id ) REFERENCES sales_flat_order_item ( item_id ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT FK_SALES_ORDER_TAX_ITEM_TAX_ID_SALES_ORDER_TAX_TAX_ID FOREIGN KEY ( tax_id ) REFERENCES sales_order_tax (tax_id ) ON DELETE CASCADE ON UPDATE CASCADE ;

MySQL: ￼
1452 - Cannot add or update a child row: a foreign key constraint fails (webshop_stn15.#sql-60a_9df5d, CONSTRAINT FK_SALES_ORDER_TAX_ITEM_TAX_ID_SALES_ORDER_TAX_TAX_ID FOREIGN KEY (tax_id) REFERENCES sales_order_tax (tax_id) ON DELETE CASCADE ON UPDAT)
I checked the original database and these tables are exactly the same so why am i having this problem?
X   SELECT item_id FROM sales_flat_order_item;
X   SELECT tax_id FROM sales_order_tax;
these are both empty but so are they in the original database
I have no experience with this kind of stuff so i hope to find someone here that can help me out ;-)
Thanks
EDIT: i created a new subdomain and a new empty database. Than copied all files from live setup to the staging subdomain, changed the lines in local.xml with db password, user etc. and exported the live database which i imported in new database... this gave the error above.
i added this edit because everybody seems to think that i dropped these files in an old setup but that is not true... the first time i created a staging setup i havent had these issues...
EDIT 2 : PROBLEM SOLVED - I only had to check the option on export : check foreign keys


texts: How to add custom mass action with pop up though UI in Magento2

texts:
I need to add custom mass action , but when you click on mass action option i need one pop up instead of redirecting to action url

that is custom js for my custom mass action

can any one help me on that

is there any option like modifier for mass action also ?


texts: Magento 2 getting interface implementation from admin config

texts:
I have an interface which gives me the country in which the customer is located.

interface CustomerLocatorInterface
{
    public function getLocalCountryCode();
}

And I have two possible implementations:

class GetLocationByCookie implements CustomerLocatorInterface
{
    public function getLocalCountryCode()
    {
        //logic
    }
}

class GetLocationByDb implements CustomerLocatorInterface
{
    public function getLocalCountryCode()
    {
        //logic
    }
}

In my di.xml, I can assign either of these implementations to whichever constructor I require, however I want the implementation to be selectable in the admin config by the store owner.

How do I do this if the implementation is hard coded in the di.xml file? Is there any way you can pass a config value into the di.xml file?


texts:
I just upgraded from Magento2.2.5 to 2.3.2 and now when I try to go to the site I get a bunch of errors written to the exceptions log file about modules versions being incorrect. For example

MSP_TwoFactorAuth data: current version - none, required version - 3.1.0

However when I look in the setup_module mysql table there is no row entry for the module MSP_TwoFactorAuth and when I run

php bin/magento setup:upgrade

It doesn't create the needed database row entry.


texts: Magento 2 add "Tel:" in address-renderer

texts:
How can I add "Tel:" before <!-- ko if: (address().telephone) -->  in default.phtml.
When the customer does not provide a phone number, "Tel" will be not visible.


texts: Magento 2 - Install PWA in live server and set domain

texts:
I have and UKFast instance running Magento 2.4.2 with sample data and installed PWA Studio by following directions here:
https://magento.github.io/pwa-studio/venia-pwa-concept/setup/
Everything gets installed following those directions.
But, I cannot find any directions on how to use this on a live server. After following the above instructions all I get is this URL (like below):
https://magento-venia-concept-cksu3.local.pwadev:8488/
And clicking that does not get anything in my browser.
I even tried following:
https://magento.github.io/pwa-studio/tutorials/pwa-studio-fundamentals/project-setup/
But I can't tell if I am supposed to follow those directions instead of the other directions or in addition to those directions. If I follow them in addition to it just installs it in another PWA directory.
I can't find anything that will tell me how to view this live using my domain name. All of the setup to view the site/pwa is not clear at all. Even sites like Nexcess, Webkul and CedCommerce that have PWA articles have been no help and just seem to repeat the same directions.
Can someone offer instructions on how to see this live? There has to be something/someone that has had success and good directions on how to get this implemented and working with a live site.
Thanks in advance.


texts: what is the purpose of eav_entity_attribute table

texts:
in Magento i have seen entity table, eav_attribute table  and attribute table, which has links.
But i don't find any link to eav_entity_attribute. I want to know the purpose of the table


texts:
I am trying to change the cart image based on my cart item configuration. But it seems like Magento\Checkout\Block\Cart\Item\Renderer::getImage receives the original Product model class and not the cart item product.

When adding the item to the cart I have added custom data with $product->addCustomOption('my_option', $data) and in $data is a generated base64 encoded image of the product. Which I would like to display in the cart and minicart.

Any ideas on how to solve this?


texts: Magento: include php files in same directory. Failed to open stream

texts:
I receive the following errors in system.log:

2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Adapter.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Adapter.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Transaction.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Transaction.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Card.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Card.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(Paylike\Client.php): failed to open stream: No such file or directory  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94
2018-01-25T11:53:13+00:00 ERR (3): Warning: include(): Failed opening 'Paylike\Client.php' for inclusion (include_path='/usr/local/www/prostorage5/xx/xx/app/code/local:/usr/local/www/prostorage5/xx/xx/app/code/community:/usr/local/www/prostorage5/xx/xx/app/code/core:/usr/local/www/prostorage5/xx/xx/lib:.:/usr/local/share/pear')  in /usr/local/www/prostorage5/xx/xx/lib/Varien/Autoload.php on line 94

I tested if it's looking the correct directory and it does.

This is first part of the php code of Client.php:

<?php
namespace Paylike;
include_once( 'Adapter.php' );
include_once( 'Transaction.php' );
include_once( 'Card.php' );

Anyone knows why it says failed to open stream: no such file or directory? Adapter.php, Transaction.php and Card.php are in the same directory as Client.php. Also tested replacing ( ' with __DIR__ . '/


texts:
Path File i want Override
app\code\community\OtherCompany\core\Model\Api\Rest\Client.php

Path my file override
app\code\local\MyCompany\MyModule\Model\Api\Rest\Client.php

app\etc\modules\MyCompany_MyModule.xml  After change

<config>
    <modules>
        <MyCompany_MyModule>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <OtherCompany_Payments/>
                <OtherCompany_Core/>
            </depends>
        </MyCompany_MyModule>
    </modules>
</config>

config.xml

<config>
    <global>
        <models>
            <mymodule>
                <class>MyCompany_MyModule_Model</class>
            </mymodule>
            <rewrite>
               <api>
                  <rest>MyCompany_MyModule_Model_Api_Rest_Client</rest>
               </api>
            </rewrite>
        </models>
    </global>
</config>

My File path:
app\code\local\MyCompany\MyModule\Model\Api\Rest\Client.php

class MyCompany_MyModule_Model_Api_Rest_Client extends OtherCompany_Core_Model_Api_Rest_Client  {

protected function _construct()
{
    highlight_string(print_r('_construct',true));
    exit();
} }

are the declared routes correct?
or it may depend on the etc \ module file

where  is specified
I should write
or

and in case the code depends on
is compromised if I write only ?


texts: Remove the Shipping method name using phtml code

texts:
visit this link1

enter "110001" as zip code and click on "check " button.

you can see : "Shipping Charges : Rs. 30.00"

"shipping charges" is Name of Shipping method we gave in backend.

I want to remove this text "shipping charges :"

        <?php
    //  echo Mage::helper('webdevlopers_productpageshipping')->getShiptitle();
        ?>

<?php if ($this->getResult()):?>

            <?php foreach ($this->getResult() as $code => $_rates): ?>

<?php echo $this->getCarrierName($code) ?>

                    <?php foreach ($_rates as $_rate): ?>
                        <li<?php if ($_rate->getErrorMessage()) echo ' class="error-msg"';?>>
                           <?php if ($_rate->getErrorMessage()): ?>
                                <?php echo $_rate->getErrorMessage() ?>
                           <?php else: ?>
                                <?php echo $_rate->getMethodTitle() ?>
                                <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
                                <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
                                <?php echo $_excl; ?>
                                <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
                                    (<?php echo Mage::helper('webdevlopers_productpageshipping')->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
                                <?php endif; ?>
                           <?php endif ?>

                    <?php endforeach; ?>

            <?php endforeach; ?>

        <?php else: ?>
        <?php //echo $this->getMessagesBlock()->toHtml(); ?>
        <?php echo Mage::helper('webdevlopers_productpageshipping')->getResult(); ?>
<?php endif;?>


texts:
In the admin backend on the order/customer grids we used to be able to do an exact search like, "Firstname" in Magento 2.2.5

This seems to no longer work in Magento 2.2.7. Is there a different/new way of doing an exact search now in the admin backend order or customer grids?

Thanks,


texts: What does getLoadedProductCollection()->clear() do?

texts:
I am new to magento, but have some experience in Object Oriented Programming (OOP), so I understand the concept that you are building a query in an object through multiple commands - which can sometimes span multiple methods.

I also understand that you can use load() and other methods to requery, etc.

I am not clear (pun intended) on what clear() does and does not, and when it should be used.  Can someone explain this? What parts of the query does it clear?

(This is version 1.4)


texts:
I just installed a new theme and after clearing hte cache when i tried to login to the admin,it is showing blank page. Further debugging lead to the following:

  exception 'Mage_Core_Exception' with message 'Invalid block type:W3Themes_Themeoptions_Block_Adminhtml_Page_Menu' in /var/www/demo.xyz.com/app/Mage.php:563
  Stack trace:        > #0 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(469): Mage::throwException('Invalid block t...')
   #1 /var/www/demo.xyz.com/app/code/local/Aitoc/Aitsys/Model/Core/Layout.php(10): Mage_Core_Model_Layout->getBlockInstance('adminhtml/page...', Array)
   #2 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(411): Aitoc_Aitsys_Model_Core_Layout->getBlockInstance('adminhtml/page...', Array)
   #3 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(446): Mage_Core_Model_Layout->createBlock('adminhtml/page_...', 'menu')
   #4 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(238): Mage_Core_Model_Layout->addBlock('adminhtml/page_...', 'menu')
   #5 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(204): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
   #6 /var/www/demo.xyz.com/includes/src/Mage_Core_Model_Layout.php(205): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
   #7 /var/www/demo.xyz.com/includes     /src/Mage_Core_Controller_Varien_Action.php(345): Mage_Core_Model_Layout->generateBlocks()
   #8 /var/www/demo.xyz.com/includes     /src/Mage_Core_Controller_Varien_Action.php(270):       Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
   #9 /var/www/demo.xyz.com/includes/src/Mage_Adminhtml_Controller_Action.php(263): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
   #10 /var/www/demo.xyz.com/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(91): Mage_Adminhtml_Controller_Action->loadLayout()
   #11 /var/www/demo.xyz.com/includes/src/Mage_Core_Controller_Varien_Action.php(420):    Mage_Adminhtml_System_ConfigController->editAction()
   #12 /var/www/demo.xyz.com/includes/src/Mage_Core_Controller_Varien_Router_Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
   #13 /var/www/demo.xyz.com/includes/src/Mage_Core_Controller_Varien_Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
   #14 /var/www/demo.xyz.com/app/code/core/Mage/Core/Model/App.php(347): Mage_Core_Controller_Varien_Front->dispatch()
   #15 /var/www/demo.xyz.com/app/Mage.php(640): Mage_Core_Model_App->run(Array)
   #16 /var/www/demo.xyz.com/index.php(98): Mage::run('', 'store')
   #17 {main}


texts: Uncaught SoapFault exception: [103] Requested image not exists in product images' gallery

texts:
I need to remove image using Soap ApiSOAP V2 (WS-I Compliance Mode)
I double checked image.image is exists.but alwas soap given above extension.
here is my code

$removeimg=new stdClass();
$file=$removeimg->file=$mediafiledel;
$id=$removeimg->productId=$mediaproductid;

try{
$result = $proxy->catalogProductAttributeMediaRemove($sessionId,$id,$file);
}
catch (SoapFault $e) {
  echo 'sorry... our service is down';
}


texts: Magento2 - How to customization of the invoice pdf?

texts:
I want to customize invoice pdf add parent category name before product name and after child category name.

How to customization of the invoice pdf?


texts:
How to add product image in magento 1.9
Magento 1.9 there is no upload option?


texts:
In app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml we can find the following code:

<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = Mage::helper('core')->quoteEscape($this->__('Add to Cart')); ?>
<?php if($_product->isSaleable()): ?>

        <?php if(!$_product->isGrouped()): ?>

            <?php echo $this->__('Qty:') ?>
            <input type="text" pattern="\d*(\.\d+)?" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" />

        <?php endif; ?>

            <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>
            <?php echo $this->getChildHtml('', true, true) ?>

<?php endif; ?>

To me, these two (shortend) lines are at the moment of interest:

<input type="text" pattern="\d*(\.\d+)?" name="qty" id="qty" maxlength="12" [...] />
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)">[...]</button>

Can anyone tell me about why the button type is set to button rather than submit which in return will prevent the nicely added HTML5 validation?
The main concern for my question is that I'm actually in need of HTML5 validation (or better, I'd prefer to use it over even more custom validation in my case) for some custom custom options (i.e. custom option of type number where I'd like to use min="", max="", step="", ...).
When I change the button type to submit I haven't seen any issue so far (HTML5 and the validation implemented by Magento both are working). Even though I can understand that from a design point of view it may make sense to suppress HTML5 validation, but is it actually worth it? Has anyone tried to change the button type already and can name experienced issues?


texts:
I am trying to get days difference between 2 dates with mysql query with DATEDIFF function for production_days column:

$collection->getSelect()->joinLeft(array('cvo' => 'cp_vendor_order'), "cvo.parent_order_id = main_table.entity_id AND cvo.vendor_name ='".$configVendorName."'",array('production_days' => new \Zend_Db_Expr('DATEDIFF(ship_by_date,NOW())')))

The issue is NOW() provides different timezone rather than IST(Indian Standard Time) and i want to use IST timezone when we call NOW() , can anyone let me know how to achieve this thing?


texts:
I want to customize the shipping form, but I don't know how to find that form, I tried but I did not find it!

Comment BY USER

I only want how can i edit this page, i want edit the shipping form. Add a field like number phone or delete the company field... I didnt tried nothing


texts:
I'm new to Magento, after installation of Magento 2 community edition.I am not able to access the admin panel. I am getting below error.

This web page has a redirect loop

  Error ERR_TOO_MANY_REDIRECTS

Please help me to resolve the issue. Advance thanks to all.


texts: Opening System>Configuration>Catalog gives white screen

texts:
When opening System>Configuration/Catalog I got an error message:

  a:5:{i:0;s:87:"Invalid config field backend model: catalog/system_config_backend_catalog_category_flat";i:1;s:1660:"#0 /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(328): Mage::throwException('Invalid config ...')

On further investigation the problem appeared to be that the file [magento directory]/app/code.core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php didn't exist in my installation. I unzipped a fresh copy of the 1.9.0.1 installation elsewhere on the system and copied the file from there into my installation. P.S. this is the same version of Magento as I am using.

Now when I open System>Configuration>Catalog I don't get an error, but I can only see a white screen.

Not sure what to do next. Can anyone help?

[Update] Looked in /var/log/httpd/error_log and found this:

  PHP Fatal error:  Class 'Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder' not found in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php on line 590, referer: https://www.somesite.com/index.php/admin/system_config/index/key/8adebffea188c0158e3fb1e303821fa4/


texts: Fetch category ids from particular website when using multiple website

texts:
How to get the category ids from particular website in magento?
Product is assigned to both website
I am fetching product collection by using code:

$_productCollection=$this->getLoadedProductCollection();

and then get product category by:

foreach ($_productCollection as $_product){
    $_categories = $_product->getCategoryIds();
}

but I am getting categories from both websites which is not correct.
I have tried:

$_productCollection=$this->getLoadedProductCollection()->setStoreId($store_id);

but it is not working


texts: Magent2.3.2 Installation process,PHP extension issue in Ubuntu18.04

texts:
In magento2.3.2 installation issue : 'PHP Extensions Check 3 missing PHP extensions'

PHP Extension bcmath.

PHP Extension intl.

PHP Extension soap.

I installed PHP in ubuntu18.04 through this command 'apt install php php-common php-mysql php-gd php-cli'.

And i checked the php version is 7.2 is correctly installed.

I have doubt is PHP-extensions is already installed or not in php7.2 ,

If installed then which php.ini file to configuring like under etc/php/7.2/apache2/php.ini (or) etc/php/7.2/cli/php.ini .
else It' newly need to install the extension?


texts: Is Magento2 really compatible for AngularJS?

texts:
Also, is Magento2 is still in beta version or stablised for handling Angularjs2 apps?

Please quote the cons and pros of using Magento2 in AngularJS2 project if used before.


texts:
I need to get current page request size which could be set by an input field named limit. I can get this when it's newly set using getParam('limit') on current request object. But later it seems its value is stored somewhere in the session so I'll miss it. I read about getPageSize() but I don't think it would be helpful here.

What is the best suitable way to get current page size limit?


texts: Price(float number) in transactional email

texts:
If i put in email template {{var order.shipping_amout}} i will get it like : 12.00000

How i can make it normal (ex. 12.00) ?

Thanks for any hints.


texts: Mini cart not update the data after execute custom action

texts:
I have create a custom module and perform the action using ajax call. I have created the sections.xml and update the below code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="southlincprotection/Index/Index">
        <section name="cart"/>
    </action>
</config>

but it is not working and not updating the minicart item after succesfull ajax execution. can anyone please let me where I am doing mistakes.

Package Name >> Southlinc

Module Name >> Protection

Controller >> Index >> Index.php

I have defined the frontname "southlincprotection" in routes.xml

my Ajax code is below

var param = 'quoteid=<?php echo $quoteId; ?>&ajax=1';
    $.ajax({
        showLoader: true,
        url: '<?php echo $baseUrl; ?>southlincprotection',
        data: param,
        type: "POST",
        dataType: 'json'
    });


texts: Custom module for 'Buy one get one free (BOGO)' functionality

texts:
I am developing custom module for 'Buy one get one free (BOGO)' functionality.
I am done with custom form and grid at admin side for setting mapping of product-X and product-Y for BOGO.
I have written observer for checkout_cart_product_add_after event to check respective product-Y for currently added product and also successfully getting respective mapped product.
But I am stuck at adding product-Y in cart programmatically.
I have tried below code:

$prodY = Mage::getModel('catalog/product')->load(<ID_OF_MAPPED_PROD-Y>);
if($prodY) {
    $cart = Mage::getModel('checkout/cart');
    $cart->init();
    $cart->addProduct($prodY, array('product_id' => $prodY->getId(), 'qty' => 1));
    $cart->save();
}

My web store is crashing here and I am unable to find any error.
What wrong I am doing here? or Which will be most suitable event to handle w.r.t my scenario of adding product progrmmatically in cart?
Can anyone please help me to get out of this situation?
Thanks in advance !!!

Find related code below:
config.xml

<frontend>
    <events>
        <checkout_cart_product_add_after>
            <observers>
                <bogo_item_add>
                    <class> [MyName_MyModule]_Model_Observer</class>
                    <method>addRespectiveBogoItem</method>
                </bogo_item_add>
            </observers>
        </checkout_cart_product_add_after>
    </events>
</frontend>

Observer function part of code

$prodY = Mage::getModel('catalog/product')->load(<ID_OF_MAPPED_PROD-Y>);
        Mage::getSingleton('checkout/session')->addSuccess($prodY->getName() . ' will get added to cart with currently added product');
        if($prodY) {
            Mage::helper('[HELPER]')->addBogoProductToCart($prodY);
        }

Helper function

public function addBogoProductToCart($product) {
    try {
        $cart = Mage::getModel('checkout/cart');
        $cart->init();
        $cart->addProduct($product, array( 'product_id' => $product->getId(), 'qty' => 1));
        $cart->save();
    } catch(Exception $e) {
        Mage::getSingleton('checkout/session')->addError($e->getMessage());
    }
}

Error stack trace


texts: Fatal Error Call to a member function getFormData() on a non-object

texts:
I am getting the following error in my website

  Fatal error: Call to a member function getFormData() on a non-object
  in
  /home/isafetyshop/public_html/app/code/core/Mage/Review/Block/Form.php
  on line 42

please have a look at www.isafetyshop.com/ any product.

I am not able to find the reason for following error. Please help me, my coding knowledge is not good. I need assistance and I am ready to pay for service.

Regards


texts: How is the start page of System Configuration (admin/system_config/index) defined?

texts:
I often notice that the start page of the system configuration (System > Configuration in admin panel) differs from installation to installation. Instead of showing the General > General section, I always see the section of one or another extension.

How does this happen? It's not the sort order, since it also happens in shops where General > General is still the first tab.

And more importantly: How would you prevent this or define your own "home page" for the system configuration?


texts:
I want to change the color code on specific code but it changes the color on all the buttons on site how do i specificly only change one of the buttons?

media="all"
button.button span {
    display: block;
    padding: 17px 60px 17px;
    font: normal 17px/19px Open Sans, Arial, Helvetica, sans-serif;
    text-align: center;
    white-space: nowrap;
    background: #0095DB;
    color: #fff;
    text-transform: uppercase;


texts: Magento 2 Product Title and Description Changes Not Showing In Frontend

texts:
When I update a product Title and Description in Magento 2 Admin, it saves properly, but the changes don't show in the frontend even after flushing caches. Any suggestion?

Thanks!


texts: Custom Package/Theme for Admin module that falls back to default package?

texts:
How Do i ask magento to use a custom layout package/theme for my custom admin module?

What's the Structure and content that i have to include inside local.xml file if i have to use it for defining a custom design package?

Please tell if there are also other ways of doing this..


texts:
I wish to edit /var/www/html/xxx/vendor/magento/module-checkout/view/frontend/web/template/payment-methods/list.html

Exactly in below line, Because which is the responsible file to render the template for each payment method. I wish to change the look of the payment method in Magento 2

  each args="data: getRegion($group().displayArea), as: 'method'"
  render=""


texts: quote not get saved after changing grand total and decrease store credit from grand total

texts:
P.S  I want to display grand total after store credit is applied because as of current it shows without store credit in it, for example customer applied 200 credit out of 500 purchase so his grand total should be 300$ but instead grand total shows 500$, the correct display is to show 300$ in grand total
I created an observer to change grand total and remove store credit from grand total, my observer is working fine and calculating customer balance and has the quote, however I cannot save the quote, I also tried $quote->collectTotals() but it gives me 502 Nginx error I am not sure how to make the quote understand to change the grand total, although I am setting the grand total I do not see it working on the page:
here is the events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="sales_quote_address_collect_totals_before">
    <observer name="customer_get_balance" instance="ImplantDirect\Storecredit\Observer\GetCustomerBalance"/>
</event>
</config>

and here is part of observer execute function:
public function execute(EventObserver $observer)
    {
        /* @var $customer \Magento\Customer\Api\Data\CustomerInterface */
        $quote = $observer->getEvent()->getQuote();
        $customerId = $quote->getCustomer()->getId();
        $websiteId =$this->_storeManager->getStore()->getWebsiteId();
        $balanceModel = $this->_balanceFactory->create()->setCustomerId($customerId)->setWebsiteId($websiteId)->loadByCustomer();
        $amount = $balanceModel->getAmount();
        $grandTotal = $quote->getGrandTotal();
        if($amount>=$grandTotal)
        {
            $quote->setGrandTotal(0);
        }
        else{
            $quote->setGrandTotal($grandTotal-$amount);
        }

please explain what can I do to make Quote understand to use the new updated grand total
thank you


texts: Error after successfull patch SUPEE-5994: Class 'Mage_Install_Controller_Router_Install' not found

texts:
I successfully installed the SUPEE-5994 patch :

[root@x]# sh PATCH_SUPEE-5994_EE_1.14.1.0_v1-2015-05-14-05-05-02.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.

But now, all my webpages are blank.

The httpd error log :

  [error] [client x] PHP Fatal error:  Class 'Mage_Install_Controller_Router_Install' not found in /var/www/x/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php on line 138

I've tried to :

Clear the /var/cache
Reset the chmod / chown
Restart the httpd service

But nothing seems to work.

Anyone have the same issue ?

EDIT: The Front.php file :

 Varien_Profiler::start('mage::app::init_front_controller::collect_routers');
    foreach ($routersInfo as $routerCode => $routerInfo) {
        if (isset($routerInfo['disabled']) && $routerInfo['disabled']) {
            continue;
        }
        if (isset($routerInfo['class'])) {
   // LINE 138 HERE
            $router = new $routerInfo['class'];
            if (isset($routerInfo['area'])) {
                $router->collectRoutes($routerInfo['area'], $routerCode);
            }
            $this->addRouter($routerCode, $router);
        }
    }
    Varien_Profiler::stop('mage::app::init_front_controller::collect_routers');


texts: Magento 2: How to get product name by sql query using product ID

texts: I want to access the product names by query database using product ID. How can I achieve it?


texts: Shipping Order Transactional Email Variables

texts:
We are trying to include in Shipping Order Transactional Email these: Tracking Number, Courier Company Name and Shipping Cost using the following.
Shipping Cost:
{{var order.formatPrice($order.getShippingAmount())|raw}}

Courier Company Name:
{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/shipment/tracklabel.phtml' shipment=$shipment order=$order}}

Tracking Number:
{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}}

What are we doing wrong ?
How to do best way?


texts: Magento 2.3: How to display price for out of stock bundles

texts:
We have an issue where if a bundle product has options that are out of stock, it shows that the price for those products are $0.00.

How would you display the full configured bundle price regardless of stock status?


texts:
I'm new to Magento 2.1 and want to develop some marketplace. I want to send e-mails for order confirmation, new user emails etc.

How can I set up email for this?


texts:
After migrating am facing some error like as shown below, How to solve those error?

Here the error on admin page

Fatal error: Uncaught Error: Function name must be a string in /home/pataak/public_html/app/code/core/Mage/Core/Model/Layout.php:555
Stack trace:
#0 /home/pataak/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#1 /home/pataak/public_html/app/code/core/Mage/Adminhtml/controllers/IndexController.php(82): Mage_Core_Controller_Varien_Action->renderLayout()
#2 /home/pataak/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_IndexController->loginAction()
#3 /home/pataak/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('login')
#4 /home/pataak/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /home/pataak/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/pataak/public_html/app/Mage.php(6 in /home/pataak/public_html/app/code/core/Mage/Core/Model/Layout.php on line 555

and Here the Front page error:

  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
  allocate 4096 bytes) in /home/pataak/public_html/lib/Less/Parser.php
  on line 2270


texts:
I installed magento 1.7.0.2 for multi sites. My previous site is running on drupal6 which I am transferring on this new magento stores. Previously my site is running multi stores with single domain but with sub-directories for different stores. (mydomain.com, mydomain.com/se, mydomain.com/fi).

Now on magento i setup multi sites and got separate domains for each. I have setup new domains with relative stores successfully following this link. But I also want to redirect my previous domains urls to new domains. For example mydomain.com/se to mydomain.se
 I tried different ways to manage urls rewrite in .htaccess, also in inidex.php but nothing was helpful.

This I tried in .htaccess file

    RewriteCond %{REQUEST_URI} ^/se/$
    RewriteRule .* - [E=MAGE_RUN_CODE:myweb_se]
    RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+)
    RewriteRule .* - [E=MAGE_RUN_CODE:%1]

also tried this way

   RewriteCond %{HTTP_HOST} ^mydomain.com/se/[nc]
   RewriteRule .* - [E=MAGE_RUN_CODE:myweb_se]
   RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+)
   RewriteRule .* - [E=MAGE_RUN_CODE:%1]

and tried in index.php as well

if ($_SERVER['HTTP_HOST'] == "mydomain.com/se"){
    $_SERVER["MAGE_RUN_CODE"] = "myweb_se";
    $_SERVER["MAGE_RUN_TYPE"] = "website";
}

any help regarding this would be highly appreciated. Thanks!


texts: How to upload file to server when creating downloadable product

texts:
I am creating downloadable product type in magento 1.7, product is created successfully but files are not uploaded to server check the below images where sample > file and file > file showing nothing.

I have try below code

try {
        $api = new Mage_Catalog_Model_Product_Api();

        $attribute_api = new Mage_Catalog_Model_Product_Attribute_Set_Api();
        $attribute_sets = $attribute_api->items();

        $sku = date('YmdHis');

        $productData = array();
        $productData['website_ids'] = array(1);
        $productData['categories'] = array(23);

        $productData['status'] = 1;

        $productData['name'] = utf8_encode('product'.date('ymdis'));
        $productData['description'] = utf8_encode('limit desc');
        $productData['short_description'] = utf8_encode('limit short');
        $productData['price'] = 12.34;
        $productData['weight'] = 0;
        $productData['tax_class_id'] = 0;
        $productData['page_layout'] ='two_columns_left';

        $new_product_id = $api->create('downloadable',$attribute_sets[0]['set_id'],$sku,$productData);

        $stockItem = Mage::getModel('cataloginventory/stock_item');
        $stockItem->loadByProduct( $new_product_id );

        $stockItem->setData('use_config_manage_stock', 1);
        $stockItem->setData('qty', 100);
        $stockItem->setData('min_qty', 1);
        $stockItem->setData('use_config_min_qty', 1);
        $stockItem->setData('min_sale_qty', 0);
        $stockItem->setData('use_config_max_sale_qty', 1);
        $stockItem->setData('max_sale_qty', 0);
        $stockItem->setData('use_config_max_sale_qty', 1);
        $stockItem->setData('is_qty_decimal', 0);
        $stockItem->setData('backorders', 0);
        $stockItem->setData('notify_stock_qty', 0);
        $stockItem->setData('is_in_stock', 1);
        $stockItem->setData('tax_class_id', 0);

        $stockItem->save();

        foreach($links as $key => $link) {

            Mage::getModel('downloadable/link')->setData(array(
                    'product_id' => $new_product_id,
                    'sort_order' => 0,
                    'number_of_downloads' => 0, // Unlimited downloads
                    'is_shareable' => 0, // Not shareable
                    'link_url' => '',
                    'link_type' => 'file',
                    'link_file' => array('file' => array('http://localhost/magento/media/highres/Hydrangeas.jpg')),
                    'sample_url' => '',
                    'sample_file' => array( 'file' => array('http://localhost/magento/media/highres/Tulips.jpg')),
                    'sample_type' => 'file',
                    'use_default_title' => false,
                    'title' => $link['title'],
                    'store_id' => $key,
                    'website_id' => $productData['website_ids'],
            ))->save();
        }

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

        $product->setMediaGallery (array('images'=>array (), 'values'=>array ()));
        $product->addImageToMediaGallery ('C://xampp/htdocs/magento/media/highres/Hydrangeas.jpg', array ('image','small_image','thumbnail'), false, false);

        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

        $product->save();
} catch (Exception $e) {
        echo "Exception : ".$e->getMessage();
    }


texts:
Magerun has tons of great features. It would be super easy to test and verify production setup using magerun as well as accomplish many other tasks like reindexing, database backup and so on.

Is there any reason we should not install or use it on production?

Does it open any security risk for production?

Are there any specific functionalities of Magerun that we should avoid using on production?


texts:
In the home page of my site there is a big white space after the footer.

You can check here


texts: Magento 2: How to authorize REST API call of customer after login?

texts:
I am using rest API to login in customer account usig the below URL and details:

URL: https://magento.host/index.php/rest/V1/integration/customer/token
Header: "Content-Type:application/json"
Data: "{"username":"customer1@example.com", "password":"customer1pw"}

and successful request returns a response body with the token:

asdf3hjklp5iuytre

As we are now logged in and all the call after login that we need to make using Rest API should use the below format:

URL: http://magento.ll/index.php/rest/V1/customers/me
Header: Authorization: Bearer asdf3hjklp5iuytre

Now My Question is:

How we will verify that token is valid for other subsequent API call ?
How can we get customer details using Token Provided in Header ?

Please explain the flow.

Updated:

When we try to access this below API url with valid Headers, It call getById function of CustomerRepository. But in getById function there is one argument called $customerId. I am not sure how it is coming  but In cumstomer module webapi.xml for this function, I found there is way to pass customerId as param and It will not send from requester but Magento set it Internally.

http://magento.ll/index.php/rest/V1/customers/me

vendor/magento/module-customer/etc/webapi.xml

<route url="/V1/customers/me" method="GET">
<service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getById"/>
<resources>
    <resource ref="self"/>
</resources>
<data>
    <parameter name="customerId" force="true">%customer_id%</parameter>
</data>

So I did the same thing, In my function and It is working fine. Here my doubt: Do we don't need to check if token is valid or not ? Is this all managed by Magento Internally ?


texts:
we want to connect an external fulfillment partner to Magento and want to log their API requests.

Is there any free and open source API logger available?


texts: site redirecting to install page and some errors

texts:
I am facing this issue after doing some chnages in core_config_data and some files.

http://sitena.com/

Warning: simplexml_load_file(): Entity: line 51: parser error : Opening and ending tag mismatch: dbname line 49 and initStatements in /var/www/html/sitename/app/Mage.php on line 767

Warning: simplexml_load_file(): <initStatements><![CDATA[SET NAMES utf8]]></initStatements> in /var/www/html/sitename/app/Mage.php on line 767

Warning: simplexml_load_file(): ^ in /var/www/html/sitename/app/Mage.php on line 767

Notice: Trying to get property of non-object in /var/www/html/sitename/app/Mage.php on line 769

Notice: Trying to get property of non-object in /var/www/html/sitename/app/Mage.php on line 769

Notice: Trying to get property of non-object in /var/www/html/sitename/app/Mage.php on line 769

Fatal error: Call to a member function getDefaultStoreId() on a non-object in /var/www/html/sitename/app/code/community/Cminds/Core/Model/Core.php on line 155


texts: Coupons applying outside of date range and active state

texts:
I have some shopping cart price rules set up and want to limit the date range.

I have set up my rule to apply a 15% discount on a given SKU, this is working.
I have a date range setup from a week out from the given day, this is NOT working.

The rule is being applied outside of the Start and End Date.

Setting the rule to 'Inactive' does not deactivate the shopping cart price rule.
Changing the groups which can use the coupon DOES have effect on the coupon.

I'd really appreciate any feedback so I don't have to schedule myself to activate these rules by choosing which groups are allowed to use them on the day that the promotion goes live.

I am using Magento CE 1.9


texts: After upgrade to Magento 2.3 - js error in arrays.js in cart and checkout

texts:
I am updating an e-commerce with Magento, from version 2.1.18 to version 2.3.4 (I have verified that it also happens by updating to version 2.2.11).

Everything went well, but when I add a product to the cart I get the javascript error

Uncaught TypeError: Cannot read property 'after' of null
    at Object.insert (arrays.js:122)
    at collection.js:94
    at Array.map (<anonymous>)
    at UiClass.insertChild (collection.js:91)
    at layout.js:433
    at Registry._resolveRequest (registry.js:418)
    at Array.forEach (<anonymous>)
    at Registry._updateRequests (registry.js:400)
    at later (underscore.js:821)

Same mistake if I go to checkout.

I am verifying that the subtotals of the order are not loaded, I do not know if it is the consequence of the error or the cause of the error.

I have disabled and deleted all the installed modules;
I have disabled all unnecessary modules of Magento 2.3.4;
I have deleted my theme and I am using the Luma theme;
I deleted cache, indexes and static files and created everything again,

but the problem is always there.


texts: Adding more than one product tabs - Magento2

texts:
I have created a custom product tab by this tutorial.

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

I have placed the above code in app/code/Cloudways/Mymodule/view/frontend/layout/catalog_product_view.xml and created a template in app/code/Cloudways/Mymodule/view/frontend/templates which works fine and create one table on product details page.

What if I have to add more than one tab. How should I write the XML?

I have tried these variations but didn't work:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="test.tab" template="Cloudways_Mymodule::custom_tab.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\View" name="test_second.tab" template="Cloudways_Mymodule::custom_tab_second.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="test.tab" template="Cloudways_Mymodule::custom_tab.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
                </arguments>
            </block>
        </referenceBlock>
        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="test_second.tab" template="Cloudways_Mymodule::custom_tab_second.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>


texts: Magento not loading XML config from costum module

texts:
I have a module Some_Costum with path app/code/local/Some :

The config is : https://gist.github.com/teosz/741a27242b547c277845

And in app/code/etc/modules/Some_Custom.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Adve_Custom>
            <active>true</active>
            <codePool>local</codePool>
        </Adve_Custom>
    </modules>
</config>

But is not loading for checkout context,
Any help ?


texts: How to add an extension attribute into "Customer Address"

texts:
I want to manage the "extension attribute" named "example" into "Customer Address" entity.

I've created a new custom module, and I've added the extension attribute into etc/extension_attribute.xml configuration file:

<extension_attributes for="Magento\Customer\Api\Data\AddressInterface">
    <attribute code="example" type="boolean" />
</extension_attributes>

Then, I've deleted the cache and run the magento setup:di:compile command in order to recreate the Dependency Injection cache files.
I could see them in the var/generation folder:

  ./var/generation/Magento/Customer/Api/Data/AddressExtension.php:
  public function getExample()
  ./var/generation/Magento/Customer/Api/Data/AddressExtension.php:
  * @param boolean $example   ./var/generation/Magento/Customer/Api/Data/AddressExtension.php:
  public function setExample($example)
  ./var/generation/Magento/Customer/Api/Data/AddressExtension.php:
  $this->setData('example', $example);
  ./var/generation/Magento/Customer/Api/Data/AddressExtensionInterface.php:
  public function getExample();
  ./var/generation/Magento/Customer/Api/Data/AddressExtensionInterface.php:
  * @param boolean $example ./var/generation/Magento/Customer/Api/Data/AddressExtensionInterface.php:
  public function setExample($example);

Now... I want to intercept \Magento\Customer\Api\AddressRepositoryInterface::getById() (after) action.
I've added a new plugin into etc/di.xml configuration file:

<type name="Magento\Customer\Model\ResourceModel\AddressRepository">
    <plugin name="your_plugin_name"
            type="your_name\module_name\Plugin\CustomerAddressRepository"
            sortOrder="1000" />
</type>

and I've created the related plugin:

class CustomerAddressRepository
{
    public function afterGetById(
        $subject,
        \Magento\Customer\Model\Data\Address $result
    ) {
        // my code...
    }
}

but when I try to get the new extension attribute example, the $result->getExtensionAttributes() function always returns a null value.

I've already implemented extension attributes into the Magento_Checkout module with success.
I've already read similar question like this.
but I haven't found any solution to my problem.

Have I forgotten an implementation step?


texts: Magento randomly enters maintenance mode 3 times in one week. HELP

texts: My store randomly goes into maintenance mode. How can I stop it from doing this? It's happened 3 times in one week.


texts:
What i'm trying to do is as follows, we have different external content pages that have one or more of our products and need a simple "add to cart" button.

To accomplish this i want to use a ajax call that talks to the magento api with json following the dev site of magento:

https://devdocs.magento.com/guides/v2.1/get-started/order-tutorial/order-add-items.html

Before i can add a product i need to create a cart (Quote id). So first i need to create a guest-cart and then add the products to cart, i have been able to do this in Postman but when i try this in a simple html page i'm getting errors...

I'm getting the following error:

  Failed to load https:///rest/V1/guest-carts: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404.

My code is as follows:

<script>
    $(document).ready(function(){
        var settings = {
            "async": true,
            "crossDomain": true,
            "url": "https://<domain>/rest/V1/guest-carts",
            "method": "POST",
            "contentType": "application/json",
            "headers": {
                // "Content-Type": "application/json",
                "Accept": "application/json",
                "Cache-Control": "no-cache"
            }
        }

        $("button").click(function(){
            $.ajax(settings).done(function (result) {
                console.log(result);
                alert("Awesome, it worked!");
            })
            .fail(function( status, errorThrown ) {
                alert( "Sorry, there was a problem!" );
                console.log( "Error: " + errorThrown );
                console.log( "Status: " + status );
            })
        });
    });
</script>

I found that CORS was giving issues with chrome and the server because it sends first a method OPTIONS to check if the server allows the method POST. So i added the code from this site: https://gist.github.com/michiel/1064640 to the nginx config to allow OPTIONS, GET and POST. When i check in chrome at the Network tab i see that OPTIONS gives status code 204 back but the POST gets a 404 status code.

This is the part where i'm running out of options since i don't know what to do next. Hopefully you guys can point me in the right direction.


texts: Recoverable Error while creating Custom query in collecition.php under resource model in magento 2

texts:
I have created a custom query in Model/ResourceModel/Notification/Collection.php file but now it shows an error in admin:

  Recoverable Error: Argument 5 passed to Namespace\Module\Model\ResourceModel\Notification\Collection::__construct() must be an instance of Magento\Framework\Stdlib\DateTime\DateTime, instance of Magento\Store\Model\StoreManager given, called in app/code/Namespace/Module/Model/ResourceModel/Notification/Grid/Collection.php on line 54 and defined in app/code/Namespace/Module/Model/ResourceModel/Notification/Collection.php on line 61


texts: Magento 2: Remove Store Code in URL only for default store

texts:
We run a magento 2 multistore in 2 langauges where default store view is german. Online shop is also available in french. Store code is added to URLs like the following:

www.domain.at
www.domain.at/de
www.domain.at/fr

When it comes to SEO we have the problem of duplicate content because the default store is available with AND without store code in URL. The following urls show the same content:

www.domain.at/de
www.domain.at/

In fact we need same behavior like here for magento 1: Magento remove "default" store code from urls

Does anyone know how to fix this issue?


texts:
I'm using magento 1.9.0.1

When I make a catalog price rule  to run a specific set of dates it doesn't work properly.  If it is the only rule it will work.  However, if there is another rule that is active and is currently running it will activate the first rules discount.


texts:
I'm using Magento 2.2.5 and tried to implement a new cart price rule. I followed two very helpfull tutorials for that:
https://magently.com/blog/magento-2-custom-sales-rule-condition/
https://www.youtube.com/watch?v=yMw3W6XwUl4
both are working fine with some changes, but I'm now trying to get access to the cart or more specific to the items in the cart in the validation function and this does not work as expected. Do somebody have an idea how i could access the items in the active cart within the custom rule?

<?php
namespace ...;

/**
* Class Customer
*/
class Customer extends \Magento\Rule\Model\Condition\AbstractCondition
{
   /**
    * @var \Magento\Config\Model\Config\Source\Yesno
    */
   protected $sourceYesno;

   /**
    * @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactory
    */
   protected $orderFactory;

   /**
    * @var \Magento\Checkout\Model\Cart
    */
   protected $cart;

   /**
    * Constructor
    * @param \Magento\Rule\Model\Condition\Context $context
    * @param \Magento\Config\Model\Config\Source\Yesno $sourceYesno
    * @param \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderFactory
    * @param array $data
    */
   public function __construct(
       \Magento\Rule\Model\Condition\Context $context,
       \Magento\Config\Model\Config\Source\Yesno $sourceYesno,
       \Magento\Checkout\Model\Cart $cart,
       \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderFactory,
       array $data = []
   ) {
       parent::__construct($context, $data);
       $this->sourceYesno = $sourceYesno;
       $this->orderFactory = $orderFactory;
       $this->cart = $cart;
   }

   /**
    * Load attribute options
    * @return $this
    */
   public function loadAttributeOptions()
   {
       $this->setAttributeOption([
           'customer_first_order' => __('Customer first order')
       ]);
       return $this;
   }

   /**
    * Get input type
    * @return string
    */
   public function getInputType()
   {
       return 'select';
   }

   /**
    * Get value element type
    * @return string
    */
   public function getValueElementType()
   {
       return 'select';
   }

   /**
    * Get value select options
    * @return array|mixed
    */
   public function getValueSelectOptions()
   {
       if (!$this->hasData('value_select_options')) {
           $this->setData(
               'value_select_options',
               $this->sourceYesno->toOptionArray()
           );
       }
       return $this->getData('value_select_options');
   }

   /**
    * Validate Customer First Order Rule Condition
    * @param \Magento\Framework\Model\AbstractModel $model
    * @return bool
    */
   public function validate(\Magento\Framework\Model\AbstractModel $model)
   {
        $price = 0;
        $items = $cart->getQuote()->getAllItems();

        foreach($items as $item) {

            if($item->getSku != "10624"){
                $price = $price + $item->getPrice();
            }
        }

        if($price > 50){
            return true;
        }else{
            return false;
        }
   }
}


texts: Turn off url rewrite indexing for disabled products

texts: How can I turn off Catalog URL Rewrites indexing for disabled products in magento 1.9?


texts:
I just downloaded and installed the Full Release of Magento Community - ver 1.9.2.4, but I can't login in backend and frontend.

The error message is:

    Invalid Form Key. Please refresh the page.

I tried to clean the cache and sessions files of magento and of my browser, but doesn't work.

Other things:

The file dont exist:
app/code/local/Mage/Core/Model/Session.php
The correct permissions was setup
The form have keys for form_key
On the frontend after login, i'm redirected for some page to ENABLE cookies.
Table core_config_data dont have values for web/secure, web/unsecure, cookie_path and others, i create myself:

Can someone help me?


texts: Magento 2 Error 'WordPress doesn't appear to be installed.'

texts:
I am getting the Frontend error 'WordPress doesn't appear to be installed.'. The backend runs great. 'FishPig_WordPress' Plugin is available on the site.

Can you please tell me how to solve this issue.

Thanks in Advance


texts: Custom backend url still has "admin" in it

texts:
I have a store which has a custom backend configured in app\etc\local.xml where the frontname node is changed like so<frontName><![CDATA[custom]]></frontName>.

Normally this would generate URLs like this:

domain.com/index.php/backend/catalog_product/index

But on this shop the URLs look like this:

domain.com/index.php/admin/backend/catalog_product/index/

I an not familiar with the full history of this shop. So I don't know how this part is exactly configured like this. The problem is I can't use services which connect to a specific backend url.

I allready searched in the database and files for "admin" but this gives too much results obviously. I am still looking through the database results because it is possible to check those at least. I also did a check on core file changes. There are no changes to the core.

How is this configured? And how can I change it to the default way? I still want to use a custom backend url offcourse.


texts: Magento 2 Why Credit memo reund tax from shipping cost?

texts:
When create a Credit memo, I don't want to credit the Shipping cost, So in the field Refund Shipping, I just write 0. but system still refund the tax part of the shipping cost.

For example, if the shipping cost is 7 USD, and in the credit memo i write 0 in Refund shipping, the system will still refund 20% of the tax which is 1.4 USD.

Any ideas why this is happening?


texts: Require Js Error: Mismatched anonymous define() module: function Magento 2

texts:
I am facing Error: Mismatched anonymous define() module: function ($) {
    'use strict'; require.js on line 166 error in my custom extension when i am trying to load external js.

Below is my code. Let me know if i am doing anything wrong.
app/code/Demo/Barcodeinv/view/adminhtml/layout/barcodeinv_barcode_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Demo_Barcodeinv::js/barcode_inv.js"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Demo\Barcodeinv\Block\Adminhtml\Barcode" name="barcode" template="Demo_Barcodeinv::barcode.phtml"/>
        </referenceContainer>
    </body>
</page>

Here is the code for app/code/Demo/Barcodeinv/view/adminhtml/templates/barcode.phtml

<script type="text/x-magento-init">
require(['jquery','inventory_code'],function(inventory_code){
        inventory_code.init('url');
});
</script>

I have put the js file at app/code/Demo/Barcodeinv/view/adminhtml/web/js/barcode_inv.js

define([
    "jquery",
    "jquery/ui",
    "domReady!"
], function ($) {
    'use strict';

    $.Barcodeinv = function()
    {
       //some data
    };
    $.Barcodeinv.prototype = {
        init: function (url)
        {
            //somedata
        }
    }
    return new $.Barcodeinv();
});// JavaScript Document

and path for requirejsconfig is app/code/Demo/Barcodeinv/view/adminhtml/requirejs-config.js

var config = {
    map: {
        '*': {
            inventory_code: 'Demo_Barcodeinv/js/barcode_inv'
        }
    }
};

Thanks in advance for yur help.


texts: Magento 2.3 - Change the Contact page success message

texts:
I want to change the Success Message in the Contact Page. After someone press the submit button the Success page is like this:

How I can to change the Success Page to display a static block for example or to be something like this:


texts:
I created a custom attribute dispname and I would like to add it under the name on the product page.
I tried to change the xml file catalog_product_view.xml but it doesn't work.
I can add it in the tab "More Information" but not under the name of the product.

Can you help me please?

Thanks.


texts:
I'm trying to show Magento 2 inside an iframe. Site loading fine but add to cart and login not working when add to cart getting below error
[2020-09-08 08:34:45] main.DEBUG: Request validation failed for action "Magento\Checkout\Controller\Cart\Add\Interceptor" [] []
Can any one tell me how to solve this


texts:
. I try :

    <template>
        <email>
            <simpleaffiliate_general_emailtemplate translate="label" module="simpleaffiliate">
                Test Send Email
                <file>test_sendemail.html</file>
                <type>html</type>
            </simpleaffiliate_general_emailtemplate>

            <simpleaffiliate_general_emailtemplate translate="label" module="simpleaffiliate">
                Test Send Email2
                <file>test_sendemail2.html</file>
                <type>html</type>
            </simpleaffiliate_general_emailtemplate>
        </email>
    </template>

and in system.xml

                    <emailtemplate translate="label">
                        Email Template sent to new registered
                        <frontend_type>select</frontend_type>
                        <sort_order>6</sort_order>
                        <source_model>adminhtml/system_config_source_email_template</source_model>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                        <comment></comment>
                    </emailtemplate>

but I get only a option  :  Test Sent Email 2 (Default from Locale) , I want add other options . Can you help me :D


texts: How to hide the out of stock products from a widget on home page

texts:
I am trying to hide the out of stock products from my homepage. I want them to display everywhere else but not in this widget. Hiding from admin configuration is not the solution. How can i achieve this?

I am using typologancee theme. Widget i am using is "Home 02 - Collection Product", which has random, latest products.
I am not very sure where to make changes and what changes.

Any help is appreciated, thanks.


texts: Magento 2 : \Magento\Customer\Model\SessionFactory $customerSession is not working with FPC

texts: If we need to get current customer sessions in a block, cacheable must be set to false in the layout XML. I am using \Magento\Customer\Model\SessionFactory $customerSession in my block but it is not working without cacheable false. Can someone tell me a recommended way to solve this problem?


texts:
I want to display the whole data present in database in front end. I could not get how to display it in front end. However I can display a single row with the help of id. The given below is what I did

<?php
    $test_id = 3;
    $model = Mage::getModel('test/test')->load($test_id);
    echo '
';
    echo ''.$model->gettest_id().'	';
    echo ''.$model->gettitle().'	';
    echo ''.$model->getfilename().'	';
    echo ''.$model->getcontent().'	';
    echo ''.$model->getstatus().'	';
    echo ''.$model->getcreated_time().'	';
    echo ''.$model->getupdate_time().'	';
    echo '
';
 ?>

Can anyone suggest me how to display the whole data from database.
Thanx..


texts:
I try to import custom options and translate the titles and row titles during the import. I am not able to translate the row title though. Here is my code:

<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');

require_once 'app/Mage.php';

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$data = array(
    array(
        'sku' => '123456',
        '_type' => 'simple',
        '_attribute_set' => 'Default',
        '_product_websites' => 'base',
        'name' => 'Test Product',
        'price' => 10,
        'description' => 'description',
        'short_description' => 'short_description',
        'status' => 1,
        'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
        'tax_class_id' => 1,
        'is_in_stock' => 1
    ),
    array(
        '_custom_option_sku'         => 'MY_SKU',
        '_custom_option_sort_order'  => 10,
        '_custom_option_title'       => 'My EN title',
        '_custom_option_type'        => Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX,
        '_custom_option_is_required' => false,
        '_custom_option_row_title'   => 'My EN row title',
        '_custom_option_row_price'   => 0,
        '_custom_option_row_sku'     => 'MY_SKU',
        '_custom_option_row_sort'    => 10
    ),
    array(
        '_custom_option_store'       => 'de',
        '_custom_option_title'       => 'My DE title',
        '_custom_option_row_title'   => 'My DE row title'
    )
);

$import = Mage::getModel('fastsimpleimport/import');
try {
    $import->processProductImport($data);
} catch (Exception $e) {
    print_r($import->getErrorMessages());
}

This works fine for the default view:

But it only translate the title in the DE store:

It does not translate the row title. How can I translate the row title during the import? If this is not possible (that is what I think), how can the import be extended, so that translations of _custom_option_row_titles can be imported?


texts: M2 Session Cookie “Secure” when only serving https

texts:
A security researcher pointed out to us that the session cookie PHPSESSID does not have the secure attribute.
Looking around in magento admin panel I could not find the option to change that and looking around on google I found there are ways to set that.
However my question is: does it even matter if you only serve the website over https and redirect all http traffic to https?


texts:
I installed Magento Enterprise 2.2.0 version but cannot install B2B extension following the link

I am getting the below error:

[InvalidArgumentException]
  Could not find a matching version of package magento/extension-b2b. Check the package spelling, your version constr
  aint and that the package is available in a stability which matches your minimum-stability (stable).

Is B2B really suported? And if yes how and where can I find information to install and use it.

Thank you.


texts: Magento 2 How to sort admin column in desc order?

texts:
I have a custom grid, I am trying to sort it in desc order
What I did

Try 1:- In my Grid Collection:

protected function _renderFiltersBefore()
{
        $orderUpdate = $this->getTable('xyztable');
        $this->getSelect()->order('main_table.order_id', 'desc');
        parent::_renderFiltersBefore();
}

Try 2:- In uicomponent file:

<column name="order_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sorting" xsi:type="string">desc</item>
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">Order ID</item>
                </item>
            </argument>
        </column>

  Output: It sort like: 1, 10, 12, 2, 3, 4, 41, 42, 5

  Expected Result: 42, 41, 12, 10, 5, 4, 3, 2, 1

I had spend couple of hours in this but didn't find any solution. Please help me to solve this issue.


texts: Fatal errors in Catalog Observer in EE 1.14

texts:
Just upgraded my dev site to EE 1.14 and am seeing two fatal errors in the Mage_Catalog_Model_Observer - is there a place to submit a patch / inform Magento? I found this bug reporter:

http://www.magentocommerce.com/bug-tracking/report/

but there's nothing for EE.

Specifically, line 215 should be checking for the existence of $block ($block was empty, triggering the fatal), and line 241, checking for the existence of $menuBlock (same).


texts: Magento Edit Order Invoice PDF - Options on Single Line

texts:
I want to edit the code inside app/code/core/Mage/Sales/Model/Order/Pdf/items/Invoice/Default.php

so each product option has the format
Label - Value, instead of taking up multiple lines; as this creates a 2 page pdf when the contained information can be displayed on a single page.

Any advice someone can offer would be greatly appreciated, as it's one of the last issues I have to complete before I'm finished.


texts:
My Header images are 404ing only in the OnePage checkout when you view cart or purchase your selected items. As shown in Here

The images are working site-wide except for that page.

The correct path is http://*****.com.au/skin/frontend/rwd/default/images/paypal.png

The OnePage Checkout is pointing to http://*****.com.au/checkout/onepage/index/skin/frontend/rwd/default/images/paypal.png

/www/checkout does not exist in my folder structure?

Is there a file I can edit to point to the right images

EDIT: This is actually not working in alot of my site. If items are viewed from the homepage it is fine, as soon as I view it from my Categories list, the images are again 404ing.


texts: How to add an extra custom block to dashboard in magento 2?

texts:
I want to show some new custom block in magento admin dashboard as well as want to remove some existing unwanted blocks?

How can i do this?


texts: How to use URL Re-write to direct one category to another?

texts: How do I use URL Re-write to direct one category to another? I have found a tutorial on how to do a custom URL re-write one how to direct a category to a CMS page. Is there an easy way to direct category to category?


texts: Steps to troubleshoot orders with no tax

texts:
Problem:

I've had several orders that haven't charged the customer any taxes. I cannot duplicate the issue.

What I've troubleshooted already:

Purchasing the same product
Selecting / Entering the same details as customer (province + postal code)
Selected same payment method

Notes:

Has happened with different browsers and different operating systems (Windows, Android)
All the products are assigned as  "Taxable Goods"
Has happened to different provinces and different postal codes
Orders before and after these orders without tax have charged the tax correctly.
There are no errors in the logs corresponding to the date and time the orders were received.

What additional steps should / can be taken in order to troubleshoot orders that have not been charged taxes?

Is there a method to look at the purchase itself to see what the problem is?


texts:
Hello everyone can anyone able to help me,
my Magento store don't sending invoice email

Invoice #100056169 | Paid | Apr 24, 2019 10:40:01 PM (the invoice email is not sent)


texts: How to get all the products from category in magento 2

texts:
I want to get all the products from Category, and its child categories in magento 2
How can i get that?
I have some products assign to main category whereas some assign to child categories. i want to get all product collection.


texts: Magento customer_save_after observer not firing

texts:
I have this code, after trying for hours I still cant figure this out.. Custom API works fine but the observer never fires..

I want to fire this observer after an admin edits/saves a customer through admin panel.

local/ghs/ghsapi/etc/api.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <ghs_ghsApi>
            <version>0.1.0</version>
        </ghs_ghsApi>
    </modules>

    <global>
        <models>
            <ghs_ghsapi>
            <class>ghs_ghsApi_Model</class>
            </ghs_ghsapi>
        </models>

        <events>
            <adminhtml_customer_save_after>
                <observers>
                    <fire_delete>
                        <class>ghs_ghsapi/observer</class>
                        <method>observeOrders</method>
                    </fire_delete>
                </observers>
            </adminhtml_customer_save_after>
        </events>
</global>

    <api>
        <resources>
            <ghs translate="title" module="customer">
                <model>ghs_ghsApi_Model_Api</model>
                <title>Customer Resource</title>
                <acl>ghs</acl>
                <methods>
                    <orderlist translate="title" module="customer">
                        <title>Retrieve customer data</title>
                        <acl>ghs/orderlist</acl>
                        <method>orderlist</method>
                    </orderlist>

                    <ordertotal translate="title" module="customer">
                        <title>Retrieve customer data</title>
                        <acl>ghs/ordertotal</acl>
                        <method>ordertotal</method>
                    </ordertotal>

                </methods>
                <faults module="xyz">
                </faults>
            </ghs>
        </resources>
    </api>

</config>

local/ghs/ghsApi/Model/Observer.php:

<?php
class ghs_ghsApi_Model_Observer
{

    public function observeOrders($observer)
    {
       Mage::log('Observer works!');

    }
}


texts: Product custom attribute import with CSV Magento 2.2

texts:
I am trying to import product with CSV  in Magento2. In first case all attributes are default attributes so import works fine.

Now In second case I have added some custom attribute in my Magento 2.2 and added them to attribute set, and with that attribute set I have created product manually from backend. Now I have exported that product to view the format of CSV file.

In that I found one thing, My all custom attributes were in one column called "additional_attributes".

So my question is while importing products Do I have to add my all custom attributes under "additional_attributes" ?

Or How May I import my custom attributes values?


texts: How do I change the code in a Magento 2 extension without editing it's files directly?

texts:
I want to make changes to a 3rd party extension (it happens to be the FishPig WordPress extension) but I don't want to edit the files in the extension directly so that I can add updates to the extension easily in the future.

I have a feeling that I should be able to drop files into my custom theme using the same file structure that the template uses but I can't figure out how to get it to work.

e.g. I want to change the file:

  app/code/FishPig/WordPress/view/frontend/templates/post/list/renderer/default.phtml

Can I just create the following file to change it (I'm guessing not as it doesn't seem to work):

  app/design/vendor/mytheme/view/frontend/templates/post/list/renderer/default.phtml

I'm sure that there is a simple solutions but I can't figure it out.


texts: Magento 1 retrieve customer email who ordered from specific category

texts: I need to get a list with the e-mail addresses of the customers who ordered products from a certain category, no matter if the customer is registered or not. Any help appreciated.


texts:
I have added a custom attribute for the product called is_master. The aim is to create a master record for the product. And sub products based on the master record (We have multiple sellers). While searching for a product i want show only the master records details... details such as description image etc... But while clicking the 'Add to cart' button i want to add specific product_id.

I have extended the class Mage_Catalog_Block_Product_List overridden the function _getProductCollection to show only records where is_master is 1. Now i want to get the product with lowest group price or selling price.

The code i was using to get the master record is

$this->_productCollection->addAttributeToFilter('is_master_record',1);

Since $this->_productCollection already have the product with lowest price i tried to save the value to a variable before applying the filter as follows.

$all_pdts=$this->_productCollection->addAttributeToFilter;
$collection =$this->_productCollection->addAttributeToFilter('is_master_record',1);

But the problem is that after applying the filter the $all_pdts and $collection have same results. I would like save the results of $this->_productCollection in a variable then do some processing later. I tried creating a new class and extending Mage_Catalog_Block_Product_List and save the result from $this->_productCollection in that class. But still when i apply the filter in the main class its also get applied to variable in second class.

Could some one help me to resolve the issue. My aim is to find the lowest group price or selling price and also show the master record.

EDIT

The code i'm currently using is :

MyModule/CustomCatalog/Block/Product/List.php

class MyModule_CustomCatalog_Block_Product_List extends Mage_Catalog_Block_Product_List{

public $matched_records = array();

protected function _getProductCollection($showMasterProduct=true){

    if (is_null($this->_productCollection)) {
        $layer = $this->getLayer();
        /* @var $layer Mage_Catalog_Model_Layer */
        if ($this->getShowRootCategory()) {
            $this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
        }

        // if this is a product view page
        if (Mage::registry('product')) {
            // get collection of categories this product is associated with
            $categories = Mage::registry('product')->getCategoryCollection()
                ->setPage(1, 1)
                ->load();
            // if the product is associated with any category
            if ($categories->count()) {
                // show products from this category
                $this->setCategoryId(current($categories->getIterator()));
            }
        }

        $origCategory = null;
        if ($this->getCategoryId()) {
            $category = Mage::getModel('catalog/category')->load($this->getCategoryId());
            if ($category->getId()) {
                $origCategory = $layer->getCurrentCategory();
                $layer->setCurrentCategory($category);
                $this->addModelTags($category);
            }
        }
        $this->_productCollection = $layer->getProductCollection();
        $this->matched_records = $layer->getProductCollection();

        $this->prepareSortableFieldsByCategory($layer->getCurrentCategory());

        if ($origCategory) {
            $layer->setCurrentCategory($origCategory);
        }
    }
    $allPdts = Mage::getResourceModel('mymodule_customcatalog/catalog_product_collection');
    $allPdts->cloneFromCollection($this->_productCollection);
    $this->matched_records = $allPdts->cloneFromCollection;

    return $this->_productCollection->addAttributeToFilter('is_master_record',1);
}


texts: How catalog search or quick search is working

texts:
In my store, I have a product attribute UPC.
Suppose a configurable product A(sku - parentA, upc attribute blank) is having two child products A1(sku - childA1, upc - 101) and A2(sku - childA2, upc - 102).
Parent products visibility is Catalog, Search and childs are not visible individually.

Now when I am search upc 101 or 102 in frontend, Magento search is showing me correct result with the configurable product A.

My first question is how magento is picking here the correct parent product?
Second question is how I can achieve same functionality for the sku attribute, because on searching with sku childA1 or childA2, I am not getting the parent product.


texts:
I'm working with the Aheadworks Mobile theme and experience a strange issue. If I add a product to cart and open the cart (without page refresh) I just see an empty cart. Only after I refresh the page I see the just added product but it never updates the product via Ajax. However, I tracked down the issue to line #55 in AW/Mobile2/controllers/CartController.php

$cartBlock = $layout->getBlock('checkout.cart');

This is empty! But I'm stuck here and don't know how to debug this further. Any ideas?

Please find complete function below:

require_once 'Mage/Checkout/controllers/CartController.php';
class AW_Mobile2_CartController extends Mage_Checkout_CartController
{
    protected function _ajaxResponse($result = array())
    {
    $this->getResponse()->setBody(Zend_Json::encode($result));
    return;
}

public function addAction()
{
    Mage::register('_no_redirect_flag', true, true);
    parent::addAction();
    $response = array(
        'top_cart_qty' => (int)Mage::getSingleton('checkout/cart')->getSummaryQty(),
        'message_box'  => '',
        'cart'         => ''
    );
    $layout = $this->getLayout();
    $messageBlock = $layout->createBlock('core/messages');
    $messageBlock->addMessages(Mage::getSingleton('checkout/session')->getMessages(true));
    $response['message_box'] = $messageBlock->getGroupedHtml();
    try {
        $update = $layout->getUpdate();
        $update->load('default');
        $layout->generateXml();
        $layout->generateBlocks();
        $cartBlock = $layout->getBlock('checkout.cart');
        if ($cartBlock) {
            $response['cart'] = $cartBlock->toHtml();
        }
    } catch (Exception $e) {
        Mage::logException($e);
    }
    Mage::log(print_r($response,true),true,"addtocart.log");
    $this->_ajaxResponse($response);
}
...

The log file says

2015-12-18T12:28:27+00:00 ALERT (1): Array
(
    [top_cart_qty] => 1
    [message_box] =>

Red Taiko Shirt was added to your shopping cart.

    [cart] =>
)

Any help is much appreciated. Thanks.


texts: Change default layout when create new product

texts:
When I create a new product, it always selects the layout 1 column.

Is there any option, I can change the default value of layout when I create new product? Any help will be appreciated!


texts: product custom attribute multiselect not able to save the values

texts:
I have created product custom attribute called package which is multiselect.

$this->addAttribute(
    'catalog_product',
    'packages',
    array(
        'group'             => 'Package',
        'backend'           => '',
        'frontend'          => '',
        'class'             => '',
        'default'           => '',
        'label'             => 'Packages',
        'input'             => 'multiselect',
        'type'              => 'text',
        'source'            => 'npm_recurrex/package_source',
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'is_visible'        => 1,
        'required'          => 0,
        'searchable'        => 0,
        'filterable'        => 0,
        'unique'            => 0,
        'comparable'        => 0,
        'visible_on_front'  => 1,
        'user_defined'      => 1,
    )
);

And the options for this fields get from the custom module called package where I create/edit the package entity.

Everything is fine, but only problem is
When I am saving a product with custom attribute I am selecting multiple options, I mean I am selection package1 and package2 and save the product.
Product saved successfully, but this is not saving my custom attribute selected values, custom attribute [multi select] not storing in database.

Can anybody suggest what is the wrong with this, Where I am not good in this process?

Thank you for valuable answers


texts: Display all categories for a product on product details page

texts:
In my Magento 2.1 store, I need to display the categories that a product belongs to, in the attributes area of the page (Manufacturer, SKU, etc).

In my magento 1 store, I did this:
https://stackoverflow.com/questions/9531702/magento-display-all-categories-on-product-view-page-with-parent-categories/9533005

So if a product is in two categories, they might be displayed as follows:

Root Cat > Sub Cat > Sub Sub Cat 1
Root Cat > Sub Cat > Sub Sub Cat 2

With each category level being clickable to go to that category.

How do I do the same thing in Magento 2.1?


texts:
I have a problem with my email templates. Whenever I fill out the form and it will take me to the success page. This will be the message in the email from my inbox.

By the way. It is a custom form with an array of data.

Thanks, Just correct me if I'm wrong with my post.


texts: Magento 1.9 Get a custom field from order table programmatically

texts:
In my Magento 1.9, I have an extension fooman surcharge installed. and the extension added some extra fields into sales_flat_order

How can I programmatically retrieve the data from these fields?

for example in the screenshot, I want to get the data from the field fooman_surcharge_amount.


texts:
Hi I have created custom options to allow a customer to choose an option when selecting a product, in this case its a choice of drinks when ordering a Meal Deal.  Is it possible to add a + - box option during the category listing of products next to the "Add to Cart" button. This is to allow the customer to increase or decrease the qty of the product without having to click the "Add to Cart" button.  Currently i am using 1.9 and the rwd default theme.  If this is an option it would make selecting multiple same items quicker, rather than the page reload on adding to cart.

Cheers in advance


texts: Magento filter showing mode,order,limit in url

texts:
I have used Magento 1.9  I have to get problem in Magento filtered navigation.  When I click filtered navigation then getting the wrong URL

Correct url:

http: // localhost/ Magento/bathroom/bathroom-sink-and-faucet/ceramic-sink.html?cat=205

Wrong url:

http: //localhost/ Magento/bathroom/bathroom-sink-and-faucet/ceramic-sink.html?p=1&dir=asc&limit=21& mode=grid& order=bestseller &cat=205

I don't know why it's showing many filters in URL.previously it's showing one but now it's showing many. Please give suggestions.


texts: Magento 2 How to Update Product Saleable qty using programmatically with Magento standard code

texts:
How to Update Product Saleable qty using programmatically with Magento standard code ?
i am able to update product quantity using below code -
protected $_stockRegistry;
public function __construct(
    \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
)
{
    $this->_stockRegistry = $stockRegistry;
    parent::__construct();
}

public function customMethod() {
    $sku = 'xyz';
    $qty = 10;
    $stockItem = $this->_stockRegistry->getStockItemBySku($sku);
    $stockItem->setQty($qty);
    $this->_stockRegistry->updateStockItemBySku($sku, $stockItem);
}

using this code I am able to update product quantity but I need to update saleable quantity instead of product quantity


texts: Not rendering specific payment method in template

texts:
I'm looking to stop a specific payment method (check / money order) from displaying on the checkout page. I can't disable the payment method, as I still need it to be used by the API on another checkout.

Doing some digging I can see this part loops through all the payment methods  -

/vendor/magento/module-checkout/view/frontend/web/template/payment-methods/list.html

    <each args="data: getRegion($group().displayArea), as: 'method'" render=""/>

I've tried to add in some logic of "if paymentMethod code = 'checkmo' don't display" =  But I can't seem to do it this way, it gets rid of displaying any payment methods.

Would this be the best approach to do what I need, or is there another way?


texts:
I have cloned my 1.9.1 install to a subdomain successfully.  However an odd behavior is occurring.  When I attempt to login to the admin, the page reloads, the login fields are blank, and I noticed that the url has redirected me to the original domains url.

magedev.example.com/index.php/admin (enter credentials, click login)

the page reloads as:

www.example.com/index.php/admin/index/index/key/9654a53e6793hu57dys624b51a6673e362/

I've changed secure and unsecure URL's in the DB.  I deleted all entries in core_url_rewrite.  Is this an .htaccess issue?  I swapped out the sub-domain where I thought I should below.I haven't changed anything else here and probably should, but am unsure exactly what is needed.  There's much more to the file but this seemed to be the only part that could be involved?

RewriteCond %{HTTP_HOST} ^website.com$
RewriteCond %{HTTP_HOST} ^www\.website\.com$
RewriteCond %{HTTP_HOST} ^website.com$
RewriteRule ^/?$ "http\:\/\/www\.website\.com\/" [R=301,L]

SetEnvIf Host www\.website\.com MAGE_RUN_CODE=default
SetEnvIf Host www\.website\.com MAGE_RUN_TYPE=store
SetEnvIf Host ^website\.com MAGE_RUN_CODE=default
SetEnvIf Host ^website\.com MAGE_RUN_TYPE=store

became

RewriteCond %{HTTP_HOST} ^magedev.website.com$
RewriteCond %{HTTP_HOST} ^magedev\.website\.com$
RewriteCond %{HTTP_HOST} ^magedev.website.com$
RewriteRule ^/?$ "http\:\/\/magedev\.website\.com\/" [R=301,L]

SetEnvIf Host magedev\.website\.com MAGE_RUN_CODE=default
SetEnvIf Host magedev\.website\.com MAGE_RUN_TYPE=store
SetEnvIf Host ^website\.com MAGE_RUN_CODE=default
SetEnvIf Host ^website\.com MAGE_RUN_TYPE=store

The first section redirected me to the old site immediately.  The edit behaved as mentioned above.  It takes my credentials, reloads the page from the old url and wants me to log in again.  Clearly I am missing something.  I put in the stock fresh install .htaccess, and its still redirecting.  I've searched the DB for any instance of the old domain name, and it only appears in an extension that isn't relevant to the admin loading.


texts:
I am trying to send emails using SMTP but emails are not sending using SMTP i can see in the logs i get this error

  exception 'Zend_Mail_Protocol_Exception' with message 'Recipient syntax error in /lib/Zend/Mail/Protocol/Abstract.php:431

I cant see what the issue is but emails are sent using Magento Default email service but not SMTP

Here are some example Stack trace:

lib/Zend/Mail/Protocol/Smtp.php(289):Zend_Mail_Protocol_Abstract->_expect(Array, 300)

lib/Zend/Mail/Transport/Smtp.php(211): Zend_Mail_Protocol_Smtp->rcpt('')

lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()


texts:
I am having problems adding a block to my sidebar in one of my category pages.
I am using the Custom Layout Update function to add my bestsellers to one specific category page.
The XML file for my bestsellers is created and the code inside is that one

    <reference name="left">
        <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
    </reference>

and then in the Category I have added this

 <reference name="left">
    <block type="bestsellers/view" name="bestsellers.sidebar" before="-" template="bestsellers/view.phtml"/>
    <remove name="catalog.leftnav"/>
 </reference>

but still it´s nothing showing up there. I am confused why this won´t work. I also thought of adding the block to a static cms block but this won´t work either.

Any suggestions?


texts:
I imported a complete magento database. Every product and category is shown as it should in the backend. But, when trying to open a category in the storefront the end-user gets the "there are no products matching the selection" error, and no product is displayed.

I also tried re-indexing, and clearing the cache without solving the problem. And I did what other questioners did (There are no products matching the selection)

In my case the solution is to to go to the product-page in the backend. Make a little change, and to save the product. By doing this the product will be shown in the category.

The problem is that I have thousands of products.

What's the most fast way to re-save all products?


texts:
I am using this extension for shipping rate "https://webshopapps.com/row/matrixrate-shipping-extension.html".

When i am adding one 1 product with 3kg weight, then on checkout page shipping method coming as per the csv imported for 3kg weight.

Now i am adding another product with same 3kg weight. So now total is 6kg weight. But when i am adding more then 1 product in cart than my define csv shipping methods are not coming on checkout page.

What i am doing wrong, can anyone please help me out with this?

https://prnt.sc/qdgpvz

Thanks in advance


texts: Unsupported declare 'strict_types' in Magento 2.3.0

texts:
Error : Unsupported declare strict_types in
../vendor/magento/inventory-composer-installer while install the extension using composer in Magento 2.3.0.