texts:
Magento with Desjardins payment gateway.

I have noticed that my sales order email is sending well with other payment method but with Desjardins payment gateway its not.

I worried bit and checked the extension code, there is no problem at all.
then I checked core files. and I noticed code in

Mage_Checkout_Model_Type_Onepage

saveOrder() function where I changed the code

this to

if (!$redirectUrl && $order->getCanSendNewEmailFlag()) {
                try {
                    $order->sendNewOrderEmail();
                } catch (Exception $e) {
                    Mage::logException($e);
                }
            }

this

if ($order->getCanSendNewEmailFlag()) {
                try {
                    $order->sendNewOrderEmail();
                } catch (Exception $e) {
                    Mage::logException($e);
                }
            }

Now its working fine.

I understood that $redirectUrl contains url to redirect customer page to payment gateway page but it seems when we have $redirectUrl magento will not send order email?

Desjardins gateway is redirect to third party web page for payment and other payment methods are not.

as I saw the first if conditions its state the $redirectUrl is set then email order sending code line is not executing.

I did't get this. Can any one tell me what's going on here?


texts:
Checkout page validation not working in magento2

As per the above link i am gettting the validations and when place order getting the following Fatal error with loading screen and order was not placing.

<b>Fatal error</b>:  Uncaught Error: Call to a member function appendChild() on null in /var/www/html/retailfly/vendor/pelago/emogrifier/src/Emogrifier.php:1419


texts: Catalog Price Rule quantity based discount on original price

texts:
Right now I am working on Magento2 Promotion functionality.as per our client requirement we need to apply a discount on the product based on quantity(using the catalog price rule).

For that, I have reviewed the Magento features, But in default Magento, there are no options for setting the discount based on product quantity in catalog price rule.

My Condition:-

the promotional condition is, the product should have the particular attribute also follow the below cases to apply the discount.

Example:

case 1:

if the product quantity has 2+, the discount is 10% (which means the quantity > 2 or <=6 )

case 2:

if the product quantity has 6+, the discount is 20% (which means the quantity > 6 or <=11 )

case 3:

if the product quantity has 11+, the discount is 30%(which means the quantity >11)

Weather do you have any code level idea or third-party module for accomplishing this functionality means to share with us.

Thanks in advance for your idea and support.


texts: Cookie/session problems on login frontend and admin

texts:
I have an issue with login in admin and frontend for accounts. This started in Safari only.

Not being a developer I'm not sure how to look to see what the cookie is trying to do, as I don't ever use Mozilla I tried and got in OK but can't on IE or chrome.

I have set the session in admin and that cured the Safari issue up until a few days ago, now I get the issue with the looping, if you put an incorrect password in it tells you so I know it does work as it should but I just can't login.

I think this is a session issue but not sure what could cause this. If anyone can see what the error is, I'd very much appreciate some feedback.


texts: I need to add the jsPDF library to my Magento 2 Luma theme, so I can use it on the checkout success page.


texts: Ups Prices Low as compare to original ups website

texts:
I am using the default Ups module on my Magento website. Configured complete settings as mentioned in the dev docs
https://docs.magento.com/user-guide/shipping/ups.html
I have one test product with a weight of 1 lb and having dimensions of 1578
if I check the price of Ups for this product on ups website
At Magento, we are getting $14.23 for UPS Ground. Can anybody help me with the same?


texts: Magento 2 - Change Input type of Size attribute cause problem not showing

texts:
I migrated product from 1.7 to 2.1.6 and the product with Size attribute show drop down correctly.

Now I want to change the Size attribute to "Text Swatch" in Admin panel (Product attribute)but then the the size option in front end disappear. Just show "Size:" with no options to choose.

Is it a problem with Magento 2 or do I need to modify something else to make the Text Swatch work?


texts: Update Checkout Shipping Address with beforeSaveAddressInformation Plugin

texts:
I am pretty new to Magento but I am in the process of building out a plugin that will eventually validate a user's shipping address and then update the user's shipping address on the payment screen.
My plugin seems to be firing fine as I can write to the log and see the updated address in the quote_address table but the address is not updated on the payment screen.  Can someone point out what I am missing here?
Old address on Payment Screen:

Plugin Code:

public function beforeSaveAddressInformation(
    \Magento\Checkout\Model\ShippingInformationManagement $subject,
    $cartId,
    \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
)
{
    $addressInformation->getShippingAddress()->setStreet("123 Updated Rd");
    $addressInformation->getBillingAddress()->setStreet("123 Updated Rd");

    $this->_logger->debug(json_encode((array)$addressInformation->getBillingAddress()));
    $return = [$cartId, $addressInformation];

    return $return;
}

Edit:
After digging into this further, I believe this is a front-end cache issue. I've attempted to reload the cache but that doesn't seem to do anything. Any suggestions on where or how to reload the cache on the front-end would be appreciated. In my custom plugin, I've overridden the checkout-data.js file and added a custom function that seems like it should reload the cache from the server but I've not had any luck with it.
getRefreshedData = function () {
            let sections = ['checkout-data'];
            storage.invalidate(sections);
            storage.reload(sections, true);
            var data = storage.get(cacheKey)();
            saveData(data);
            return data;
        };


texts:
Ok, I am once again making a simple module to place something in the admin section.  When I do the following:

config.xml:

<?xml version="1.0"?>
<config>
    <module>
        <VMRReports_AdminHelloWorld>
            <version>1.0</version>
        </VMRReports_AdminHelloWorld>
    </module>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <helloworld before="Mage_Adminhtml">VMRReports_AdminHelloWorld</helloworld>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

controller/IndexController.php:

<?php

class VMRReports_AdminHelloWorld_IndexController extends Mage_Adminhtml_Controller_Action {
    protected $_publicActions = array('index');
    public function IndexAction() {
        echo 'Hello Index!';
    }
}

it replaces mysite.com/admin/index.  What would I change to get it to do stuff in mysite.com/admin/helloworld?  In mysite.com/admin/index, is index the controller?


texts: How to create "Whats this?" style tool tips?

texts:
I'm trying to add a tool tip on the checkout pages next to certain fields which users may question the reason why they are required fields, such as phone number.

I want to create a link next to the input box which would show a pop up when clicked. For consistency I want to show it the same as when people click "What's this?" next to the 'Remember Me' check box on the persistent log in template.

What's this?

I can't seem to find out how this is called or how to create my own custom one, can anyone help?


texts:
I have tried updating the url on a product, but it's not changing.

I have tried disabling plugins, clearing cache, sessions etc but still no avail.

Magento 1.9.2.1 CE

Any suggestions?


texts:
How to change the price in checkout page in magento2.
I'm getting the price from API and i just want to replace the final price from that API in checkout page.
In Catalog and Product detail page, the price has been changed as per the API request. But during checkout, price is coming from database, instead of api price.
I tried using some observer events but its not working fine.
It would be very helpful if anybody give suggestion on this.


texts: Pass current sku number to the custom phtml form before submission ( data-bind, placeholder)

texts:
i'm trying to past the value of $current_sku to the end the $title text field input on the form. How can I achieve it? Correctly, it's showing in the text input hints..

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
?>

      <?php $current_sku = $product->getSku(); ?>

                        <?= $block->escapeHtml(__('Your question:')); ?>

                        <textarea name="title"
                                  id="amfaq-title"
                                  title="<?= $block->escapeHtml(__('Question')); ?>"
                                  class="required-entry input-text"
                                  cols="5"
                                  rows="3"
                                  data-bind="value: title"
                                  placeholder="<?= $block->escapeHtml(__('Type your question here ...')) .'('. $current_sku .')' ;?>"></textarea>


texts:
I have a fields in inventory section qty, like below scree shot, i wants to update the qty fields both at a time using magento1.9 soap apis,

In the above screen shot i wants to update Main and Wholesale quantities at a time using soap api in magento1.9.

The values are saving in below table (cataloginventory_stock_item) like:

Please help me if anyone know.

For single product update I have passed like this:

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

$proxy = new SoapClient('http://127.0.0.1/magento1936/api/soap/?wsdl=1', array('exceptions' => 0));
$sessionId = $proxy->login('test','newapi');
$result = $proxy->catalogProductInfo($sessionId,5928);

$productId = '5928';
$stockItemData = array(
    'qty' => '130',
);

$result = $proxy->call(
    $sessionId,
    'product_stock.update',
    array(
        $productId,
        $stockItemData
    )
);

var_dump($result);

Thanks


texts: How to add a new language - Magento 2.0.1

texts:
I am trying to create a new store view for the Tamil Language, but the language does not get listed while choosing the language from admin.

short description of what I have done

1) I have successfully created Tamil Store View. Please refer the screenshot for your easy reference.

2) Next, I am trying to add Tamil Language Package

2.1 collect phrases

create the folder /var/www/html/magento2/app/i18n/tamil/tn_tn/

after that run the below command and get a success message

php bin/magento i18n:collect-phrases -o "/var/www/html/magento2/app/i18n/tamil/tn_tn/dictionary.csv" -m "/var/www/html/magento2/"

2.2 composer.json

{
    "name": "tamil/tn"
    ,"type": "magento2-language"
    ,"description": "Tamil language"
    ,"authors": [{
    "name": "Bilal Usean",
    "email": "yyyyyy@yyyyy.yyy",
    "role": "Developer"
    }]
    ,"extra": {"map": [["*", "tamil/tn_tn"]]}
}

2.3 language.xml

<?xml version='1.0'?>
<language xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:App/Language/package.xsd'>
    tn_TN
    <vendor>tamil</vendor>
    <package>tn_tn</package>
</language>

2.4 registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
   \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
   'tamil_tn_tn',
   __DIR__
);

2.5 Translate

dictionary.csv contains 8000+ rows of phrases for the sample I have taken one (open in gedit)

"We found other products you might like!","We found other products you might like!",module,Magento_Catalog

tn_TN.csv I have translated above particular line (contains one row)(open in gedit)

"We found other products you might like!","நீங்கள் விரும்பக்கூடிய மற்ற பொருட்கள் காணப்படும் !",module,Magento_Catalog

2.6 Language pack

run the below command for creating the language pack and get a success message Successfully saved tn_TN language package.

php bin/magento i18n:pack -d app/i18n/tamil/tn_tn/tn_TN.csv tn_tn tn_TN

It will create directory (tn_tn pack)

<magento-root>/tn_tn/vendor/magento/module-catalog/i18n/tn_TN.csv

someone noted it, collect phrases and lang pack commands are different from the official doc, please refer this link for why am I using like this way.

Overall structure of my language package

After that clear cache, run setup:upgrade, indexer:reindex but I can't found my Tamil language pack in newly created Tamil store view locale options.

I would like to mention one more, I have researched about existing lang pack /var/www/html/magento2/vendor/magento/language-de_de (composer.json, language.xml, registration.php) but unable to find the exact name of the locale like listed in admin(German (Germany)). So I confused any step I missed to create locale.

why Tamil language package does not get installed?


texts: Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to Resource

texts:
It's a fresh 1.9 installation. I'm new, so I was following some guides which turned out to be outdated, and so I used Mysql4 classes instead of Resource.

I changed the extensions from Mage_Core_Model_Mysql4_Abstract to Mage_Core_Model_Resource_Db_Abstract, and they worked perfectly.

I then tried to change the name of the model/resource folder from Mysql4 to Resource.

I changed its name in the config.xml from <class>Foo_Foobar_Model_Mysql4</class> to <class>Foo_Foobar_Model_Resource</class>, and the class names of the resources from

class Foo_Foobar_Model_Mysql4_Example
To
class Foo_Foobar_Model_Resource_Example.

But for some reason, the last two steps broke the module, and I started getting:

Warning: include(/var/www/html/magento/includes/src/Foo_Foobar_Model_Resource_Example.php): failed to open stream: No such file or directory  in /var/www/html/magento/includes/src/Varien_Autoload.php on line 94

Even though the class is right there.. I tried checking the permissions and owners of the files on the server, and they're exactly the same in both cases.. What is the cause for this weird error.. Everything is the same except the folder name..


texts: Magento 1.9 - PayPal Express mixes Magento's country with PayPal's address

texts:
I am in the process of updating a Magento 1.8 to 1.9.2.4.  I am doing it on a local development environment.  I have a custom theme and a fair number of plugins.

My theme: http://themeforest.net/item/athlete-fluid-responsive-magento-theme/7190141

Plugins (the ones I figure are potentially problematic):

Ebizmarts_AbandonedCart
Idev_OneStepCheckout
Innoext Zone Manager
MageCoders_PaypalMulticurrency
MageWorx_OrdersEdit

Expected results:

When I checkout with PayPal Express, my PayPal address should be used in the review page.  If the country chosen in PayPal is not available, there should be a warning on the review page, or a method to edit the country.

Actual results:

When I checkout with PayPal Express and choose a country in PayPal that is not available to my site, Magento defaults to United States, California, 90034.  I end up with the street address from PayPal, and the default country OR the country + state/province + zip/post code that I chose in the Estimate shipping and tax block on the Cart page.

If I proceed to checkout on Magento and fill out my address there, PayPal forces that address and I cannot modify it in PayPal, nor in the review page.  So PayPal standard works fine, just not the Express button found in the /checkout/cart/ page.

This wasn't a problem before the update because the review page allowed the customer to change his address.  Has anyone else experienced this issue?  Is there patch?

I've done some debugging and found the returnFromPaypal() function in /app/code/core/Mage/Paypal/Model/Express/Checkout.php where PayPal's address and Magento's address are merged.

but I don't want to modify duplicate this file into /app/code/local/ if someone else has already found a solution.

Thank you!


texts: Add to cart is not clickable under My account

texts:
we are displaying Product name & Add to cart button in Custom tab under My Account . we wanted to add the product to cart once we click on "Add to cart", but button is not clickable, once if we click on button , its not adding product to cart.

<?php $collections = $this->getCollection(); ?>

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

<?php foreach ($collections as $key => $product) {

    echo $product->getName().'
';
?>

<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

}
?>


texts: Slow product page because of product images

texts:
My productpages are quite slow when loading for the first time (15+ sec), because the product image cache is not available for that product. (checked it with the Profiler)

When the product image cache is available page loads within 1,5 sec.

How can I easily improve this? For example crawl pages or create automatically product image cache.

I am running Magento 1.9.3.2


texts: Change the attribute label in a Product Configuration for Configurable products - Magento 2

texts:
I need to change Product Configurations Attribute label in product level for configurable product
Steps as below
Admin => edit Configurable product => Configurations tab => Edit Configurations => Step 2: Attribute Values
Please check below screenshot for more information.

Please help me on this customization.
Thank in advance.


texts:
On my category filtered pages, this page being an example. There are some filters at the top of the page.

Sort by: 18 and sort by position.

These serve no real purpose and hence I'd like to remove them.

How can I remove these please ?


texts: Magento 2:- How to call a js file on homepage?

texts:
I want to call a js file on homepage only how to to do that. Right now i am calling

<head><link src="js/myfile.js"/></head>

But it is calling for all page and give error js error on other pages. I am creating a custom theme.


texts: Removing attributes from New Cart Price Rule - Actions tab

texts: At New Cart Price Rule -> Action Tab. There is a green plus mark, where I can choose Conditions. The problem is, that I see there all added attributes to Magento but I need only few. Is there a way to remove not necessary attributes from that list?


texts: How to obtain Title of Configurable Option from Mage_Sales_Model_Quote_Item_Option

texts:
Inside an observer I've got instances of Mage_Sales_Model_Quote_Item_Option that are from a Mage_Sales_Model_Quote_Item via ::getOptions():

/** @var $item Mage_Sales_Model_Quote_Item */
$options = $item->getOptions();
foreach ($options as $index => $option) {
    $id    = $option->getId();
    $value = $option->getValue();
    $title = $option-> ??? ;
}

How can I retrieve the title of such an option represented by such Mage_Sales_Model_Quote_Item_Option?


texts: Attrbributes Sets & Attributes: Non-Technical Overview/Logic

texts:
I work on the 'business' side of Magento (i.e. I'm not a developer).  I'm looking to get a better understanding of the theory behind Attributes & Attribute Sets.

My goal: Come up with a few rules to have in mind while creating Attributes Sets and Attributes.

For example, is best to go as wide as possible with attributes?  Or, should attributes get more specific?  Should sets be category based?  Or, something else.

Thanks!


texts: Source model not found for attribute "specialist"

texts:
I was created "specialist" as custom customer attribute,while my development time it was working fine, now i move the files to server and doing the optimization(catch enable, compilation and etc..).

Now the front end is showing error "Source model "Federallawyer_Customer_Model_Entity_specialist" not found for attribute "specialist" ",

May i know what is the solution to rectify the problem, thanks in advance for your idea and help.

Code for add new attribure

$this->addAttribute('customer', 'specialist', array(
    'type'      => 'int',
    'label'     => 'Practice Area',
    'input'     => 'multiselect',
    'global' => true,
    'visible' => true,
    'required' => false,
    'user_defined' => false,
    'source' => 'Federallawyer_Customer_Model_Entity_specialist',
));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'specialist');
$attribute->setData('used_in_forms', array(
    'adminhtml_customer',
    'customer_account_edit',
));
$attribute->setData('is_user_defined',1);
$attribute->save();


texts:
I'm wondering what people have found to be the best method for managing magento's code base in a HA cloud / auto scaling environment.  I'm currently planning to share the media directory over NFS, using AWS's CDN to cache both the CMS and product images.

Whilst NFS would make managing the code base simple, i figure the amount of extra network traffic would slow things down (even though varnish will be caching what content it can).  We deploy code from github, so i figure webhooks could be an option, but managing these with servers automatically coming on and off line could be tricky.

Any experience, thoughts, must avoids would be very greatly received.

*After thought:  Would like to experiment with the performance difference when using mage compiler too, which could make managing a 'synced' code base more challenging / need some more clever scripting.


texts: Magento 2 visual swatch not showing in frontend

texts:
I created different attributes with visual swatches, and assigned each one to differnt attribute sets.

I have differnt products with different attribute sets, but for some reason visual swatches are not showing in frontend.

I have done this:

1- Update attributes on products

2- re-index, clear cache, upgrade modules

3- set to yes the option Use in Product List and Storefront Catalog Page

I don't know if I'm doing something wrong.
Do I need to add code in layout.xml or something related?

I followed this tutorial https://www.mageplaza.com/kb/how-to-configure-swatches-in-magento-2.html

Greetings!


texts: How to add custom link in header in magento 2

texts: How to add custom link (on custom module, not at theme) at header in magento 2


texts: Attributes order in comparison window is wrong!

texts:
Set up your attributes order in "Attributes set" as you wish to be listed in frontend (product page and compare window). In product page attributes are listed in correct order (Additional information section). Now add this product to compare list. Compare it.

Attributes order should be the same like you set it up in "Attribute set" and same like in Additional information. In compare window attributes are in a different order. This need a fix since is a bug. Maybe a global position that can be changed for an attribute could solve elegant this issue. There is a position field but for Layering Navigation only.


texts: Magento2 - How to fetch the admin product form data in ajax

texts:
We are trying to show some information before saving the product via an ajax call.
In this ajax, we need to pass all the product form data.
The initial thought was to serialize the product form. But cannot see the form tag in the product add/edit area.
How can we get this product form data in javascript to pass via ajax?


texts: Custom tab with session protection in magento 2

texts:
I have created a new tab in my account page. customer_account.xml page as below,
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-custom">
                <arguments>
                    <argument name="path" xsi:type="string">ucssms/verification/index</argument>
                    <argument name="label" xsi:type="string">Verify Mobile</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

However, the link is not checking if there is an active customer session. So, I added a manual check as below,
<?php

namespace Ucs\Reson8\Controller\Verification;

class Index extends \Magento\Framework\App\Action\Action
{
    /** @var  \Magento\Framework\View\Result\Page */
    protected $_customerSession;
    protected $_resultRedirectFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,

        \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
        \Magento\Customer\Model\Session $customerSession
    )
    {

        $this->_resultRedirectFactory = $resultRedirectFactory;
        $this->_customerSession = $customerSession;
        parent::__construct($context);
    }
    /**
     * Blog Index, shows a list of recent blog posts.
     *
     * @return \Magento\Framework\View\Result\PageFactory
     */
    public function execute()
    {
        if (!$this->_customerSession->isLoggedIn()) {
            $resultRedirect = $this->_resultRedirectFactory->create();
            $resultRedirect->setPath('customer/account/login');
            return $resultRedirect;

        }

        $this->_view->loadLayout();
        $this->_view->renderLayout();
    }
}

It works fine. But if logged out due to session timeout, after login, it is not automatically redirecting to ucssms/verification/index handler?
Is there a native method in magento 2 to handle?


texts:
In Magento order status ship button while clicking it automatically change complete. So i want to change some custom order status like shipment

How to change it?


texts: How to set and get customer session data in magento 2

texts:
I am struggling with magento 2 session. I have created below controller file as a sample code.

<?php
namespace vendor_name\module_name\Controller\SetGetSession;

use Magento\Framework\App\Action\Action;

class SetGetSession extends Action
{
    protected $customerSession;

    public function _construct(
        \Magento\Customer\Model\Session $customerSession
    ) {
        $this->customerSession = $customerSession;
    }

    public function execute()
    {

    }
}

Can anyone please help me with how to assign data and retrieve it from session variable?

Thank you.


texts: Best practice to add export type by calling $this->addExportType() on order gird?

texts:
I want to call addExportType() to add my custom export type to sales order grid. I can do it two ways:

Either rewrite the admin sales order grid
:Mage_Adminhtml_Block_Sales_Order_Grid  and add the method call
    from there OR
Hook into the event - adminhtml_block_html_before and in my observer method check if the block instance I am getting is for the
    order grid and call addExportType() on it if it is indeed an
    instance of the class I am interested in.

The advantage of point 2 is that it makes the extension less vulnerable to conflicts with other over-writes of the sales order admin grid but the disadvantage is that it will be called for every admin template child block for which this event is triggered.

What would you choose and why?


texts: Magento 2 how to connect magento 2.3.6 to a MS SQL server?

texts:
I have been searching how to connect Magento 2 with MS SQL, I can't use another db because the customer already has it's architecture.
I found this answer but it's for 1.9 and it did not work.
Add connection to MS SQL database
Could someone give me ideas? Thanks!


texts: ajax based multiple select layered Navigation with infinite product Scroll

texts:
I am looking for an extension with these Features

Ajax Based Layered Navigation with Multiple select
Infinite product Scroll

please recommend any free or paid extension or group of an extension but they must have to be compatible together


texts: Magereport not recognizing installed 8788 patch

texts:
Following online instructions I've installed the 8788 patch v2 for my 1.9.2.4 version of Magento CE.
Command Line returned "Patch was applied/reverted successfully."
Looked in applied.patches.list and see the patch listed.
Cleared Cache
But when I re-scanned via Magereport, it is still showing as Not Patched
What would cause this?


texts: Remove Specific “Store View” settings for Categories

texts:
Similar to my previous question - what SQL or PHP script can I use to remove changes to categories that were made a store view level, so that they will default back to using the "global" value?

The following code worked for removing the per-store-view settings in products, maybe it can be changed to work with categories instead?

<?php

include 'app/Mage.php'; Mage::app();

/** store id for which you would like to KEEP values */
$defaultStoreId = Mage_Catalog_Model_Product::DEFAULT_STORE_ID;

/** @var Mage_Catalog_Model_Product $model */
$model        = Mage::getModel('catalog/product');
$resource     = $model->getResource();
$entityType   = $resource->getEntityType();
$entityTypeId = $entityType->getEntityTypeId();
$adapter      = $resource->getWriteConnection();

/** gather the names of all tables that contain the attribute values to be removed */
$tables = array();

/** get all attribute value tables, making sure to leave out catalog_product_entity */
$attributes = $entityType->getAttributeCollection();
$attributes->addFieldToFilter('backend_type', array('neq' => 'static'));
foreach($attributes as $attribute) {
    /** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */
    $tables[] = $attribute->getBackendTable();
}
$tables = array_unique($tables);

/** get product ids of all products whose SKU begins with 16- */
$collection = $model->getCollection();
$collection->addFieldToFilter('sku', array('like' => '16-%'));
$productIds = $collection->getAllIds();

$valuesDeletedCount = 0;
foreach($tables as $table) {
    $condition = array(
        'entity_type_id = ?' => $entityTypeId, // here we ensure that we are only dealing with values belonging to PRODUCTS
        'entity_id IN(?)'    => $productIds, // here we make sure that we are only dealing with SKUs beginning with 16-
        'store_id != ?'      => $defaultStoreId, // here we make sure we are deleting from ALL stores except for DEFAULT
    );
    $valuesDeletedCount += $adapter->delete($table, $condition);
}
echo $valuesDeletedCount . ' non-default attribute values deleted.';

?>


texts: How to use reCaptcha for newsletter subscription form?

texts:
I added in subscribe.phtml

and added in local.xml

<block type="core/text" name="google.recaptcha">
    <action method="setText">
         <text><![CDATA[]]></text>
    </action>
</block>

But it is not working. I can still subscribe to newsletter without captcha answer.

What could be wrong?


texts:
Is there a way how to set multiple recipients on Magento 2 Contacts, right now it only allows to set single email.

http://prntscr.com/l3f158

Thanks,
JM


texts:
I get the fallowing error when saving changes under system > configuration > general > design or under system > configuration > sales > payment methods.
I am guessing that whenever Mage_Core_Model_Config_Data is called the error happens. Is my database broken and can I fix it? Magento version is 1.9.1.1
No third party components are used.

There has been an error processing your request
Item (Mage_Core_Model_Config_Data) with the same id "0" already exist

Trace:
#0 C:\xampp\htdocs\mysite\lib\Varien\Data\Collection\Db.php(576): Varien_Data_Collection->addItem(Object(Mage_Core_Model_Config_Data))
#1 C:\xampp\htdocs\mysite\lib\Varien\Data\Collection.php(741): Varien_Data_Collection_Db->load()
#2 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config\Data.php(309): Varien_Data_Collection->getIterator()
#3 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config\Data.php(292): Mage_Adminhtml_Model_Config_Data->_getPathConfig('design', false)
#4 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config\Data.php(221): Mage_Adminhtml_Model_Config_Data->_getConfig(false)
#5 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config\Data.php(334): Mage_Adminhtml_Model_Config_Data->load()
#6 C:\xampp\htdocs\mysite\app\code\core\Mage\Paypal\Helper\Data.php(101): Mage_Adminhtml_Model_Config_Data->getConfigDataValue('paypal/general/...')
#7 C:\xampp\htdocs\mysite\app\code\core\Mage\Paypal\Model\Observer.php(130): Mage_Paypal_Helper_Data->getConfigurationCountryCode()
#8 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Model\App.php(1338): Mage_Paypal_Model_Observer->loadCountryDependentSolutionsConfig(Object(Varien_Event_Observer))
#9 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Paypal_Model_Observer), 'loadCountryDepe...', Object(Varien_Event_Observer))
#10 C:\xampp\htdocs\mysite\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('adminhtml_init_...', Array)
#11 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config.php(93): Mage::dispatchEvent('adminhtml_init_...', Array)
#12 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\Model\Config.php(63): Mage_Adminhtml_Model_Config->_initSectionsAndTabs()
#13 C:\xampp\htdocs\mysite\app\code\core\Mage\Adminhtml\controllers\System\ConfigController.php(88): Mage_Adminhtml_Model_Config->getSections('design')
#14 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Adminhtml_System_ConfigController->editAction()
#15 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#16 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 C:\xampp\htdocs\mysite\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 C:\xampp\htdocs\mysite\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#19 C:\xampp\htdocs\mysite\index.php(87): Mage::run('', 'store')
#20 {main}


texts: Magento 2: When to create custom attribute programmatically and when via admin?

texts:
In Magento 2, we can add a custom attribute for a product whether programmatically or via admin (Stores->Attributes->Product)

In my case, I need to just create a custom text field to hold some custom text for products.

Should I make this field programmatically - A custom module that includes UpgradeData.php and ui_component, or should I create this custom field in Admin -> Stores -> Attributes -> product?

What's the best practice?


texts: Configurable product changes the custom attribute when we change the colour In Magento2

texts: I have created the configurable product, changes the custom attribute value when we change the color variation.


texts: Get HTTP Referer and request parameters in a module block class

texts:
I'm trying add a simple template to CMS page using a block type from a local module. This template will rely on http_referer and request params.

In the Design > Layout Update XML part of the CMS page, I added

<reference name="content">
    <block type="gbicm/modal" name="gbicmmodal" template="gbicm/modal.phtml" />
</reference>

To start, the template calls $this->method() which simply returns $_SERVER["HTTP_REFERER"] for testing, but it is returning null in all cases. I've created a link to this page from another cms page, and when I click the link it returns null. I haven't tried using a controller class to get it, because I can't find any examples that do this from a block class.

Am I going about this incorrectly? Does $_SERVER["HTTP_REFERER"] not function in a block class? Can I access a controller/router class/singleton to get request information?

Update: Mage::helper('core/http')->getHttpReferer() gives me empty string when I land on the cms page from a link in another page.


texts: Manually entered products not showing in upsells etc?

texts:
New Magento install, and we are entering products manually at this point.
All products are simple products and they are showing fine on the site when you go shopping.

However, when I am in the back end and trying to configure the products to have upsells, related products and cross-sells, there are no products appearing in those boxes.

Why would this be???


texts: Didn't Magento release SUPEE 7405 Patch for Magento 2.0 and What about the Enterprise edition?


texts:
I have created magento website on localhost. I am using Version magento 1.9.2.
I am having problem in exporting database.
Steps I did are from THIS tutorial.

Now when I click go it downloads This

What am I doing wrong
This is my server description

Database server

    Database Description
    Server: 127.0.0.1 via TCP/IP
    Server type: MariaDB
    Server version: 10.1.13-MariaDB - mariadb.org binary distribution
    Protocol version: 10
    User: root@localhost
    Server charset: UTF-8 Unicode (utf8)

Web server

Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.21
Database client version: libmysql - mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
PHP extension: mysqli Documentation
PHP version: 5.6.21


texts: Magento2 Custom shipping method display only for specific group

texts:
We use custom shipping method:
https://www.mageplaza.com/devdocs/magento-2-create-shipping-method/

Any solution how to display this shipping method only for specific (selected) customer group?


texts: Magento 2 - How to use 'if...elseif...else' condition in knockout html?

texts:
I want to add a condition if...elseif...else in a knockout HTML file.

I tried to add the condition like this,

<!-- ko if: condition 1 -->
    [...]
<!-- /ko -->
<!-- ko elseif: condition 2 -->
    [...]
<!-- /ko -->
<!-- ko else -->
    [...]
<!-- /ko -->

I know how to add if...elseif and if...notif. But I do not have the idea about this if...elseif...else condition.

Does anyone have the idea about this?


texts:
How to restore a Magento database that is corrupted few days earlier
Having an SQL file with data format of utf code


texts: Magento 1 - How to override phtml file in module?

texts:
I am using magento 1
I am trying to override the below phtml file in module
app/design/adminhtml/default/default/template/sales/order/create/items/grid.phtml

Any thoughts ?
Thanks


texts: Uncaught TypeError: Cannot read property 'HoverAlls' of null

texts:
I can't figure out why I'm getting this error. I have read all documentation provided by the developer.

I placed this code in the Layout Update XML window:

<default>
<reference name="head">
    <block type="core/text" name="your.block.name">
       <action method="setText">
          <text><![CDATA[<script type="text/javascript">
    $(window).load(function(){
        $('.HoverAlls_Caption').HoverAlls({
            "coords":"0,100||0,75||0,100",
            "text_coords":"0,50||0,5||0,50",
            "speed" : "220,220",
            "text_speed" : "400,200",
            "opacity" : "0,1",
            "link_control" : "false,_blank",
            "bg_class" : "captionBackground",
            "text_class" : "captionText"
        });
    });
</script>]]></text>
       </action>
    </block>
    </reference>
</default>

Here is the site I'm trying to work on: http://staged.tailwatersflyfishing.com

Username: admin
Password: admin

Thank you in advance! :)


texts:
In checkout what's the difference between these css classes on fields:
required / _required ?

Because I see that some fields have _required css class, but the address field block has only required (without line character).
And if I send the empty form, the address field block doesn't receives _error class (and not receiving the same error design).

Here's a screenshot:

Thanks in advance

Edit:

This is what the OP is referring to, some classes use required and others use _required. So what is the difference?


texts: Magento 2 js not loading after installing a new theme

texts:
This is my current magento 2 website
http://jamesviana.online/

Above is the error
 I have installed a new paid theme which have been installed the backend is working while in the frontend the js not been taken.

I have tried to deploy the magento 2 cli commands in php bin/magento static:content:deploy but no use.

While indexing it shows this error

Warning: SessionHandler::read(): open(/var/www/magento2/var/session/sess_69186e4b7bf9a9b00a807cc1452a452d, O_RDWR) failed: No such file or directory (2) in /var/sites/j/jamesviana.online/public_html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Fatal error: Uncaught exception 'Exception' with message 'Warning: SessionHandler::write(): open(/var/www/magento2/var/session/sess_69186e4b7bf9a9b00a807cc1452a452d, O_RDWR) failed: No such file or directory (2) in /var/sites/j/jamesviana.online/public_html/vendor/magento/framework/Session/SaveHandler.php on line 105' in /var/sites/j/jamesviana.online/public_html/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/var/sites/j/ja...', 105, Array)
#1 /var/sites/j/jamesviana.online/public_html/vendor/magento/framework/Session/SaveHandler.php(105): SessionHandler->write('69186e4b7bf9a9b...', 'adminhtml|a:0:{...')
#2 [internal function]: Magento\Framework\Session\SaveHandler->write('69186e4b7bf9a9b...', 'adminhtml|a:0:{...')
#3 {main}
  thrown in /var/sites/j/jamesviana.online/public_html/vendor/magento/framework/App/ErrorHandler.php on line 61

I have given 777 permission for all folders I have tried with this cli command also

php -dmemory_limit=80G bin/magento setup:static-content:deploy

Issue remains. In my local system with the same version and with the paid theme which is working good. only in my live server it have been showing this issue can anyone give a better solution to solve this it will be very helpful.


texts:
I had been looking around for solution for the pass 2 weeks and nothing seems to help. Recently, i had a few indexes that are always in "processing" status and whenever I try to reindex these indexes are always skipped.

After doing some search, i came across a solution to run indexer:reset and run indexer:reindex again. However, this make things worst. now the design_config_grid table missing and i was unable to create new table using sql script as suggested in another post.

Situation at this moment:-
When I execute reindex, I get the following:-
Design Config Grid indexer process unknown error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table '.design_config_grid_flat' doesn't exist, query was: CREATE TABLE IF NOT EXISTS design_config_grid_flat (
  entity_id int UNSIGNED NOT NULL COMMENT 'Entity ID' ,
  store_website_id int NULL COMMENT 'Store_website_id' ,
  store_group_id int NULL COMMENT 'Store_group_id' ,
  store_id int NULL COMMENT 'Store_id' ,
  theme_theme_id varchar(255) NULL COMMENT 'Theme_theme_id' ,
  PRIMARY KEY (entity_id),
  INDEX DESIGN_CONFIG_GRID_FLAT_STORE_WEBSITE_ID (store_website_id),
  INDEX DESIGN_CONFIG_GRID_FLAT_STORE_GROUP_ID (store_group_id),
  INDEX DESIGN_CONFIG_GRID_FLAT_STORE_ID (store_id),
  FULLTEXT DESIGN_CONFIG_GRID_FLAT_THEME_THEME_ID (theme_theme_id)
) COMMENT='design_config_grid_flat' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci
Customer Grid index has been rebuilt successfully in 00:00:02
Category Products index has been rebuilt successfully in 00:00:01
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index is locked by another reindex process. Skipping.
Product EAV index is locked by another reindex process. Skipping.
Stock index is locked by another reindex process. Skipping.
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:04

The following is the index status:-
Design Config Grid:                                Reindex required
Customer Grid:                                     Ready
Category Products:                                 Ready
Product Categories:                                Ready
Product Price:                                     Processing
Product EAV:                                       Processing
Stock:                                             Processing
Catalog Rule Product:                              Ready
Catalog Product Rule:                              Ready
Catalog Search:                                    Ready

Please help, this is a new project assigned to me and i am in serious trouble here if i cannot solve it.

Thanks in advance.


texts:
3 indexes are marked in red and have the status every time Processed

does anyone know why I'm being processed and how to solve it?

When I try run in SSH php bin/magento indexer:reindex then:

Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index is locked by another reindex process. Skipping.
Product Categories index is locked by another reindex process. Skipping.
Product Price index is locked by another reindex process. Skipping.
Product EAV index has been rebuilt successfully in 00:00:35
Stock index has been rebuilt successfully in 00:00:04
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00

@update

I have reset and try again reindex but ger error deadlock:

and now 2 index still proccess:


texts: Template debug areas on transaction emails

texts:
We are sending out order confirmation emails programatically using the following code in Magento 2:

# Now send out the emails:
$emailSender = $objectManager->create('\Magento\Sales\Model\Order\Email\Sender\OrderSender');
$emailSender->send($order);

All of the information is pulling through correctly on the email (and the order is being placed in Magento backend), but when the mail is delivered, it appears as though the template has debug hints on it, despite all template debug options being disabled in the Store config:

What is the reason for this, and how can we disable the red areas on the email template?


texts: SQL Error: Integrity constraint violation: 1062 Duplicate entry

texts:
Every time I update my products in /admin I get this sql error

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '2-0-0-1-1-375-0' for key 'EAA51B56FF092A0DCB795D1CEF812B7B', query
  was: INSERT INTO catalogrule_product
  (rule_id,from_time,to_time,website_id,customer_group_id,product_id,action_operator,action_amount,action_stop,sort_order,sub_simple_action,sub_discount_amount)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

It doesn't seem to actually affect anything but it kind of worries me.


texts: After upgrade to Magento 2.2.8 my transactional email is not working anymore

texts:
I just updated to Magento 2.2.8 and now my email is not working anymore, the message I get is:

  The message should be an instance of \Zend_Mail

I tried the Mageside and Mageplaza module, also without the modules this message occurs....


texts: I want to add product images from external url.. I have created CSV file for image uploading..When I click run profile popup button it displays "image not exist" error..http://intow.co/admin/backEnd/uploads/4717602016_05_12_03_28_35pm.png(image url)


texts: How to save Contact Us form data in to existing Customer table of magento database?

texts:
I want to save contact us form data in to existing customer table and this means that data are save in those table where after creation of customer account data are saved.

And after saving data in to database there need to display column of non-register customer for those customer who have register through contact us form.

Anybody knows answer please share.


texts: Rearrange category page in order: cat image, title, description and then products

texts:
I'm using Magetique template for Magento and I'm changing the 'listing-layout-1.xml' file.

I need it to look like this

Although, right now it's looking like this:

And the title isn't even displaying.

Here's my code:

   <?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>
        <move element="page.main.title" destination="columns.top" before="category.image" />
        <move element="category.image" destination="columns.top" after="page.main.title" before="category.products.list" />
        <referenceBlock name="category.products.list">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/list_layout_1.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="search_result_list">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/list_layout_1.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>


texts:
I want to add a custom block to the category pages and not care if the the category is anchor or not or if it has children or not.
I want to add that block at the bottom of the page after the product list or static block.
So I added this in the layout file

<catalog_category_view>
    <reference name="content">
        <block type="some/block" tempalate="some/template.phtml" after="-" /><!-- notice the "after" attribute -->
     </reference>
</catalog_category_view>

the block appears in every category page but at the top of the page.
If I change the layout handle to catalog_category_default or catalog_category_layered everything works OK and I see my block at the bottom of the page.
Any idea why "after" is ignored for catalog_category_view handle?
Note: Using the default magento theme


texts: Magento2 - How to add magnifier zoom effect on fotorama fullscreen?

texts:
I need to add magnifier zoom effect in fotoroma fullscreen.

Attached the screen shot here.


texts: Recently we installed an extension that was not fully installed due to underprivileged write permissions. When we try to uninstall it through package manager, the extension is not appearing, and instead there is a small area under one of the Channel's that's empty. How would I go about deleting this extension if it was written to any directory or the database? Would I have to reinstall and uninstall? As well, could an incomplete install cause any issues to the server?


texts: Unable to upload image from a custom form - getting ERROR - [The file was not uploaded]

texts:
I am trying to upload a file, but getting error every time - The file was not uploaded
Steps that I am following -
Html -

            <?= $block->escapeHtml(__('Attach NPWP – Company')) ?>

            <input name="company[npwp_attachment]" id="npwp_attachment" title="<?php  $block->escapeHtmlAttr(__('Attach NPWP – Company')) ?>" class="input-file" type="file" >

In Model -
use Magento\Framework\App\Filesystem\DirectoryList;
protected $uploaderFactory;
protected $adapterFactory;
protected $filesystem;

public function __construct(
    \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory,
    \Magento\Framework\Image\AdapterFactory $adapterFactory,
    \Magento\Framework\Filesystem $filesystem
){
    $this->uploaderFactory = $uploaderFactory;
    $this->adapterFactory = $adapterFactory;
    $this->filesystem = $filesystem;
}
        $uploaderFactory = $this->uploaderFactory->create(['fileId' => 'npwp_attachment']);
        $uploaderFactory->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
        $imageAdapter = $this->adapterFactory->create();
        /* start of validated image */
        $uploaderFactory->addValidateCallback('custom_image_upload',
            $imageAdapter,'validateUploadFile');
        $uploaderFactory->setAllowRenameFiles(true);
        $uploaderFactory->setFilesDispersion(true);
        $mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
        $destinationPath = $mediaDirectory->getAbsolutePath('custom_image');
        echo $destinationPath;exit;
        $result = $uploaderFactory->save($destinationPath);
        if (!$result) {
            throw new LocalizedException(
                __('File cannot be saved to path: $1', $destinationPath)
            );
        }

In model, I have also printed $_FILES and this is the response -
Array
(
[company] => Array
    (
        [name] => Array
            (
                [npwp_attachment] => Untitled Diagram.jpg
            )

        [type] => Array
            (
                [npwp_attachment] => image/jpeg
            )

        [tmp_name] => Array
            (
                [npwp_attachment] => /tmp/phpOtC07v
            )

        [error] => Array
            (
                [npwp_attachment] => 0
            )

        [size] => Array
            (
                [npwp_attachment] => 153369
            )

    )

)
Findings till now -
I have figured out that their is some issue with tmp_name, this error is coming form -
vendor/magento/framework/File/Uploader.php

if (!file_exists($this->_file['tmp_name'])) {
        $code = empty($this->_file['tmp_name']) ? self::TMP_NAME_EMPTY : 0;
        throw new \DomainException('The file was not uploaded.', $code);
    }

I have also printed $this->_file['tmp_name'], and this is empty.
I am getting error in this line -
$uploaderFactory = $this->uploaderFactory->create(['fileId' => 'npwp_attachment']);

Any idea what is the issue and how this can be fixed ??
Thanks.


texts: How to change magento theme in 1.9.3.2 and remove the old theme?

texts:
I uploaded Hallow theme for the first time in Magento ver. 1.9.3.2 but unfortunately I had lot of errors like images are not shown in browser etc.

Now I want to remove the previous theme and upload the new theme through Magento connect but at last step it doesn't clear the cache.

Please help me to resolve this problem.


texts: Category Flat Data indexer process unknown error Magento 2

texts:
We are getting Integrity constraint violation: 1062 error when we are going to reindex in magento 2. Kindly see the error below and let me know if any update

Category Flat Data indexer process unknown error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '889' for key 'PRIMARY', query was: INSERT INTO `catalog_category_flat_store_1_tmp` (`row_id`,`entity_id`,`created_in`,`updated_in`,`attribute_set_id`,`parent_id`,`created_at`,`updated_at`,`path`,`position`,`level`,`children_count`,`store_id`,`all_children`,`automatic_sorting`,`available_sort_by`,`children`,`custom_apply_to_products`,`custom_design`,`custom_design_from`,`custom_design_to`,`custom_layout_update`,`custom_use_parent_settings`,`default_sort_by`,`description`,`disabled_children`,`display_mode`,`filter_price_range`,`image`,`include_in_menu`,`is_active`,`is_anchor`,`label_value`,`landing_page`,`level_column_count`,`meta_description`,`meta_keywords`,`meta_title`,`mp_meta_robots`,`name`,`page_layout`,`path_in_store`,`static_block_bottom_value`,`static_block_left_value`,`static_block_right_value`,`static_block_top_value`,`url_key`,`url_path`,`use_label`,`use_static_block`,`use_static_block_bottom`,`use_static_block_left`,`use_static_block_right`,`use_static_block_top`,`use_thumbail`) VALUES


texts: Some class are not available while those class file exit in code

texts:
We have a vagrant setup for our magento 2 project. We have some custom modules in our setup. So on one linux machine there is no issue at all as we have same code (using git).
But on mac machine same vagrant setup we are getting issue class do not exist while it does.

  Exception #0 (InvalidArgumentException): Plugin class Magefan\LoginAsCustomer\Model\PageCache\ConfigPlugin doesn't exist

So you can see above exception for example while we have ConfigPlugin class file on right location. There is no issue when I am running setup:upgrade and setup:di:compile command mean there is no issue to generate file in pub folder.

And I have one more extension where magento redirecting on 404 page while on same url there is no issue on other linux machine. So after debugging the code I found magento is not able to found controller class file. Magento is able to read router.xml file but when it check controller class in following condition it return null.

  is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] : null;

So when I did var_dump on this full path $this->actions[$fullPath] then I can see the full path of controller file but if I check following condition in var_dump then it print false.

  var_dump(class_exists($this->actions[$fullPath], true) );

So this mean magento is not able to find controller class file while it exist.

Please let me know if anyone faced same issue.


texts: Magento Cart page update qty, check if product qty available

texts:
My requirement is if the user updates any product qty in cart page then it should check the currently available qty of Product if it's less then the update qty then it should display the message that product qty is not available.

I'm using checkout_cart_update_items_before event.

But here I'm not getting the associated product but getting parent product.

Can anyone suggest me what should I do so?

My code seems not currently working properly so doesn't make any sense to share it here.

EDIT:

Following is my code, Which now showing the message if Product available qty is 1 and user try to add Product Qty more then 1.

public function checkQty(Varien_Event_Observer $observer)
    {
        $cart = $observer->getEvent()->getCart();
        $info = $observer->getEvent()->getInfo();

        foreach ($cart->getProductIds() as $key => $value) {
            $product = $this->_getProduct($value);
            if($product->getStockItem()->getStockQty() != ""){
                if($this->suggestItemsQty($info) > $product->getStockItem()->getStockQty() ){
                    $quote = Mage::getSingleton('checkout/session')->getQuote();
                    $cartItems = $quote->getAllVisibleItems();
                    foreach ($cartItems as $item) {
                        if($product->getId()==$item->getId())
                            $item->setQty($product->getStockItem()->getStockQty());
                    }
                    Mage::throwException(Mage::helper('checkout')->__('The requested quantity is not available'));
                    Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
                    exit;
                }
            }
        }

        return $this;
    }
    protected function _getProduct($productInfo)
    {
        $product = null;
        if ($productInfo instanceof Mage_Catalog_Model_Product) {
            $product = $productInfo;
        } elseif (is_int($productInfo) || is_string($productInfo)) {
            $product = Mage::getModel('catalog/product')
                ->setStoreId(Mage::app()->getStore()->getId())
                ->load($productInfo);
        }
        $currentWebsiteId = Mage::app()->getStore()->getWebsiteId();
        if (!$product
            || !$product->getId()
            || !is_array($product->getWebsiteIds())
            || !in_array($currentWebsiteId, $product->getWebsiteIds())
        ) {
            Mage::throwException(Mage::helper('checkout')->__('The product could not be found.'));
        }
        return $product;
    }
    public function suggestItemsQty($data)
    {
        foreach ($data as $itemId => $itemInfo) {
            return $data[$itemId]['before_suggest_qty'];
        }
    }
    public function getCheckoutSession()
    {
        return Mage::getSingleton('checkout/session');
    }


texts:
I have two packages installed in magento.
First,Package1_Test1
second,Package2_Test2.
I have created one observer in Package1_Test1

path: community/Package1/Test1/etc/config.xml

<sales_convert_quote_item_to_order_item>
                <observers>
                    <package1_test1_identifier>
                        <type>model</type>
                        <class>package1_test1/observer</class>
                        <method>salesConvertQuoteItemToOrderItem</method>
                    </package1_test1_identifier>
                </observers>
</sales_convert_quote_item_to_order_item>

In Package2_Test2,I have created one observer

path: community/Package2/Test2/etc/config.xml

<sales_convert_quote_item_to_order_item>
                <observers>
                    <package2_test2_identifier>
                        <type>model</type>
                        <class>package2_test2/observer</class>
                        <method>salesConvertQuoteItemToOrderItem</method>
                    </package2_test2_identifier>
                </observers>
</sales_convert_quote_item_to_order_item>

It means that I have created same sales_convert_quote_item_to_order_item observer in both packages so my question is I want to run only second Package2_Test2 package observer rather then Package1_Test1.

Any dependency will work between two packages ?

Please help me,What I have to do ?


texts: Widget showing products on Homepage, can't find phtml file of it (Magento 2)

texts:
I have a widget added in CMS to show product items of a category on my homepage. I need to make changes in the code around the items. Unfortunately path hints doesn't show me which phtml file it is.

I made changes in the following files without success:

Magento_Catalog > templates > product > widgets > (tried all files)

Magento_Catalog_Widget > templates > product > widget > content > grid.phtml

But no change to the output.


texts: catalog price rules disappear after mid night

texts:
we have a problem with catalog price rules in 1.9.0

we have some 1000 products in a site.

we applied catalog price rules to give discount for 500 products.

i did't gave any date limit for catalog price rules

those special prices are displaying only until mid night.

next day, after mid- night special prices are not displaying in site.

cron is working fine.

please help me to find some solution.


texts:
Am struggling with a strange error in magento 2.

Have a setup where i have removed some stores, so now only single store.

Am trying to set the  home page in admin (CMS Home Page)

No matter what I do, it says 404 on home page, all other pages work.

Have looked in database, setting for is: web/default/cms_home_page is there and set ok and for scope_id = 0.

not sure which pages it is looking for, is there a way to debug that?

any other suggestions for how to fix this?


texts:
I am going through an older module created in PHP 5.x.x and we have just moved the website to the php 7.2.x so we suddenly got the error in a helper class
Uncaught Error: Using $this when not in object context in

There is a dispatch event in helper that is using the following code there:
Mage::dispatchEvent('magento_string_filter_before', array('content' => $contentObj, 'object' => $params['object'], 'params' => $params, 'helper' => $this));

and i believe that is not compatible with the PHP 7 so how i can convert this and what replacement we have?
Thanks!


texts: What is the best way of creating a new table in Magento?

texts:
I have seen two different ways of creating a new table in Magento. I want to figure out which one is the best? And why there are two ways? What are the differences between them?

  First way

(Reference : http://inchoo.net/ecommerce/magento/magento-install-install-upgrade-data-and-data-upgrade-scripts/comment-page-1/#comment-379299)

$installer = $this;
$installer->startSetup();
$table = $installer->getConnection()
    ->newTable($installer->getTable('inchoo_dbscript/ticket'))
    ->addColumn('ticket_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Id')
    ->addColumn('title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable'  => false,
        ), 'Title')
    ->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ), 'Description');
$installer->getConnection()->createTable($table);
$table = $installer->getConnection()
    ->newTable($installer->getTable('inchoo_dbscript/comment'))
    ->addColumn('comment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Id')
    ->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable'  => false,
        ), 'Comment');
$installer->getConnection()->createTable($table);
$installer->endSetup();

  Second way

(Reference : http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table)

<?php

$installer = $this;

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('<module>')};
CREATE TABLE {$this->getTable('<module>')} (
  `<module>_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `content` text NOT NULL default '',
  `status` smallint(6) NOT NULL default '0',
  `created_time` datetime NULL,
  `update_time` datetime NULL,
  PRIMARY KEY (`<module>_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    ");

$installer->endSetup();


texts: How to use multidimensional array values in magento email template

texts: I am using Magento 1.9.3.7 version. I am triggering a mail from the observer with multidimensional array values. How I can get and use it in the mail template.


texts: Magento 2 adminhtml custom column sorting ascending and descending

texts:
I made a custom column in sales_order_invoice_grid to display some additional data. This works fine but when clicking on the given column it does not react on any sorting mechanism like descending and ascending

Here is what I got

sales_order_invoice_grid

 <column name="order_state" class="Foobar\InvoiceOrderStatus\Ui\Component\Listing\Column\Status">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">Order Status</item>
                </item>
            </argument>
        </column>

The corresponding class

class Status extends Column
{

    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

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

                $orderId = $item["order_id"];
                if (empty($orderId)) {
                    $item[$this->getData('name')] = "unkown";
                    continue;
                }

                /** @var \Magento\Sales\Model\OrderRepository $orderRepo */
                $orderRepo = $objectManager->get('Magento\Sales\Model\OrderRepository');
                /** @var \Magento\Sales\Model\Order $order */
                $order = $orderRepo->get($orderId);
                $item[$this->getData('name')] = $order->getStatus();
            }
        }

        return $dataSource;
    }

}

How can I apply descending / ascending sorting to my custom column?


texts: Magento2 - Show delivery calendar by specific dates and timing on checkout page

texts:
I would like to show calendar with only specific dates and available timings.
I have API data which includes specific dates with hours. I would like to show those dates in calendar and once select any dates, those timing only will be display based on dates.

How to disable specific dates from calendar.
Hours will be change based on selected dates.


texts: Magento 2.3.5 - Autofocus emailfield on checkout

texts:
How can we make the customer-email input field on the checkout page autofocus on load?
Now there is no focus on the checkout page in Magento 2.3.5-p1, when it is loaded.


texts: How do I get all the attributes in all attribute sets in Magento2?

texts:
I'm trying to get all attributes that belong to each product set back, either using the \Magento\Catalog\Model\Product\Attribute\ManagementFactory or \Magento\Catalog\Api\ProductAttributeManagementInterface.
It's works fine when there is one attribute set and returns the results expected; however if I want to get multiple attribute sets - the subsequent request is not as expected.
Digging into the code I've traced it down into \Magento\Eav\Model\AttributeManagement::getAttributes and echo'ing the select that the method generates shows the second query appends the attribute set filter as opposed to resetting it.
To recreate it you can use the following code; attribute set 4 is the 'default' one and 9 is the one that I have manually added.
Once the code below is ran it generates the following selects

$obj->create()->getAttributes(4);
SELECT `main_table`.*, `entity_attribute`.* FROM `eav_attribute` AS `main_table` INNER JOIN `eav_entity_attribute` AS `entity_attribute` ON entity_attribute.attribute_id = main_table.attribute_id WHERE (`entity_attribute`.`attribute_set_id` = '4') ORDER BY entity_attribute.sort_order ASC

$obj->create()->getAttributes(9); (note the 2 where clauses)
SELECT `main_table`.*, `entity_attribute`.* FROM `eav_attribute` AS `main_table` INNER JOIN `eav_entity_attribute` AS `entity_attribute` ON entity_attribute.attribute_id = main_table.attribute_id WHERE (`entity_attribute`.`attribute_set_id` = '4') AND (`entity_attribute`.`attribute_set_id` = '9') ORDER BY entity_attribute.sort_order ASC

<?php
require __DIR__ . '/app/bootstrap.php';

class TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
    public function launch()
    {
        $this->_state->setAreaCode('adminhtml');

        $obj = $this->_objectManager->create('\Magento\Catalog\Model\Product\Attribute\ManagementFactory');
        $attr1 = $obj->create()->getAttributes(4);
        $attr2 = $obj->create()->getAttributes(9);

        die();
    }

    public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception)
    {
        return false;
    }
}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$app = $bootstrap->createApplication('TestApp');
$bootstrap->run($app);


texts: Magento 2: Products images are not showing on category page

texts:
I have a huge catalog and imported images for them by csv file. Unfortunately images are not showing on category page but they are showing on view page.
I executed all the commands such as:

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex

But could not get images on category page. I also tried to execute:

php bin/magento catalog:images:resize

I took almost 24 hours but this command did not finish successfully.
I observed that when i open that product from admin and just hit save without editing then image of that product shows on category page. Then i thought i should programmatically load each product and save but that idea did not work too.
Need help on it. Could any one provide a code of loading and saving a product just like admin do it or any other alternate?


texts: Can't access admin or magento connect get 403 permission forbidden error when I tried to update extensions

texts: When I'm trying to update extensions from 1.9.2.1 to 1.9.3.6, it gives me 403 permission forbidden error. What should I do?


texts: Hide order export button for all admin users except admin role

texts:
I want to hide or remove Export button from custom admin grid for all admin user except admin role.

I have added below code to add export button on the grid in my ui component file.

<exportButton name="export_button"/>

Can anyone suggest how can i achieve that?

Thanks in advance...!!!


texts: Magento 2 checkout payment page doesn't works because European server (ec.europa.eu) is down?

texts:
I'm getting this error in the checkout page, when I click for the payment step:

  "Fatal Error: 'SOAP-ERROR: Parsing WSDL: Couldn't load from
  'http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl'
  : failed to load external entity
  \"http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl\"\n'
  in '/path/to/project/vendor/magento/module-customer/Model/Vat.php' on
  line 221"

The error is returned by an ajax call that tries to post shipping-information, as you can see in the following images.

Javascript console:

Network tab:

I think the error is due because the service that validates the VAT number (checkVatService?wsdl) is down in this moment.

Is there a way to avoid this and skip the vat number validation?


texts: Add multiple products id from attribute value

texts:
Following is the code to get product ID from attribute value in Magento 2.2.

for ($i = 0; $i < sizeof($post['prod_attr']); $i++) {
     $attribute = $this->eavConfig->getAttribute('catalog_product', 'attribute1');
            $options = $attribute->getSource()->getAllOptions();

            $attributeAttr = $this->eavConfig->getAttribute('catalog_product', 'attribute2');
            $optionsAttr = $attributeAttr->getSource()->getAllOptions();

            $productModel = $this->productFactory->create();

            foreach ($options as $option) {
                if ($option['label'] == $post['prod_attr'][$i][0]) {
                    $this->productCollection->addAttributeToFilter(
                            array(
                        array('attribute' => 'attribute1', 'eq' => $option['value']),
                            ), '', 'left'
                    );
                }
            }

            foreach ($optionsAttr as $optionAttr) {
                if ($optionAttr['label'] == $post['prod_attr'][$i][1]) {
                    $this->productCollection->addAttributeToFilter(
                            array(
                        array('attribute' => 'attribute2', 'eq' => $optionAttr['value']),
                            ), '', 'left'
                    );
                }
            }

            $this->productCollection->addAttributeToFilter(
                    'status', ['in' => $this->productStatus->getVisibleStatusIds()]
            );
            $this->productCollection->setVisibility($this->productVisibility->getVisibleInSiteIds());

            foreach ($this->productCollection as $product) {
                $productId = $product->getId();

                $product = $productModel->load($productId);

                $productType = $product->getTypeID();
                if ($productType == self::PRODUCT_TYPE_SIMPLE) {
                    $params = array('qty' => $qty);

                    try {
                        $this->cart->addProduct($product, $params);
                        $this->cart->save();
                        $this->messageManager->addSuccess(__("You added " . $product->getName() . " to your shopping cart."));
                    } catch (LocalizedException $e) {
                        $this->messageManager->addError($e->getMessage());
                    }
                }
            }
}

Issue I am facing here is every time I get same product id when I execute this code in for loop.

Please let me know what I am missing here.


texts: Magento 2 Luma Checkout Problem with logged in Users

texts:
We made a Magento 2 Parent-Theme based on Luma and we changed some css styles, it still working but we have Problems with the Checkout.

My Testside: http://staging.meat4you.ch

1) If some registered User is Logged-In, go to some Items, put these Items to the Shipping Card and click to Checkout - After that, the Checkout Page is not complete loaded (look the printscreen).

Its only show a white page with the Card, but the Addresses and Buttons for next Steps are missing.

2) If you are a Guest User, it works perfect!
3) If you go to Checkout and only Logged-In in the Checkout Page, its works perfect!

Somebody can help me to solve this Problem with registered Users and Logged-In before Checkout?
Thank you very much.

PS: Sorry, for the Picture Puzzle, stagexchange allow only 2 Links.


texts: When I switch the mode default to developer of magento2.2.3 then got this error Element 'count': This element is not expected

texts:
Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'count': This element is not expected. Expected is ( argument
  ). Line: 1077


texts: Magento not displaying paths correctly for files

texts:
My server has just been updated and now on my site the file paths for css, js and everything is wrong: the path weirdly includes the document root, so the path looks like:

  https://www.example.co.uk/var/www/html/www.example.co.uk/skin/frontend/mytheme/default/css/styles.css

First thing I checked was the core table and can confirm the core table looks correct:

The secure url and unsecure url are correctly set as:

https://www.example.co.uk/
http://www.example.co.uk/

I am lost as to why this is happening. I am thinking it could be a Selinux issue:

  ls -Z: Shows, for example unconfined_u:object_r:httpd_sys_content_t:s0 var system_u:object_r:httpd_sys_content_t:s0 favicon.ico

UPDATE:
This is a SElinux issue with permissions. I have managed to overcome this for now by setting the SElinux to permissive mode.

I guess I could run:

chcon -R -t httpd_sys_rw_content_t /var/www/html/magentofoldername/*

But, not this is the best thing. I was wondering if someone had a more educated idea of how to best approach this? like how would I correctly set the labels.


texts:
<main id="maincontent" class="page-main">
.....
</main>

I need to replace class and id here
also can we change a whole tag like main to section or something else.
please let me know.


texts: How to add GTIN No for configurable products in magento

texts: How to add GTIN no for configurable products in magento. In Simple products I am having gtin number but, how to add that in configurable products.


texts: Magento update order product on observer

texts:
I'm trying to update additional_data field on sales_flat_order_item table in Magento.

For this I create a custom module

This is my Observer.php under app/code/local/Distelsa/Wedding/Models :

class Distelsa_Wedding_Model_Observer{

    public function AddWeddingIdToProduct(Varien_Event_Observer $observer)
    {
        $event = $observer->getEvent();

        $item = $event->getQuoteItem();
        $quote = $item->getQuote();
        $product = $observer->getEvent()->getProduct();

        $controllerAction = $event->getControllerAction();
        $params = $controllerAction->getRequest()->getParams();
        $boda = Mage::app()->getRequest()->getParam('boda');

        $write = Mage::getSingleton('core/resource')->getConnection('core_write');
        $query = "UPDATE `sales_flat_quote_item` SET additional_data = '".$params['boda']."' where item_id = ".$item->getId();
        $write->query($query);

    }
}

[Edited] This is my entire config.xml:

<?xml version="1.0"?><config>
<modules>
    <Distelsa_Wedding>
        <version>0.1.0</version>
    </Distelsa_Wedding>
</modules>
<global>
    <models>
        <wedding>
            <class>Distelsa_Wedding_Model</class>
        </wedding>
    </models>
    <events>
        <sales_order_save_before>
            <observers>
                <update_wedding_order>
                    <type>singleton</type>
                    <class>wedding/observer</class>
                    <method>AddWeddingIdToProduct</method>
                </update_wedding_order>
            </observers>
        </sales_order_save_before>
    </events>
</global>
<frontend>
    <routers>
        <wedding>
            <use>standard</use>
            <args>
                <module>Distelsa_Wedding</module>
                <frontName>wedding</frontName>
            </args>
        </wedding>
    </routers>
</frontend></config>

Any clue on how can I make this works?


texts: Address region - inconsistent value of isRequired property causes "Call to a member function getRegion() on null" error

texts:
When creating a new account(user registration) I'm getting the following error. I have noticed it after update to 2.3.6
Fatal error: Uncaught Error: Call to a member function getRegion() on null in /vendor/magento/module-customer/Model/Address.php:149
Stack trace:
#0 /generated/code/Magento/Customer/Model/Address/Interceptor.php(24): Magento\Customer\Model\Address->updateData(Object(Magento\Customer\Model\Data\Address))
#1 /vendor/magento/module-customer/Model/ResourceModel/AddressRepository.php(124): Magento\Customer\Model\Address\Interceptor->updateData(Object(Magento\Customer\Model\Data\Address))
#2 /vendor/magento/module-customer/Model/ResourceModel/CustomerRepository.php(272): Magento\Customer\Model\ResourceModel\AddressRepository->save(Object(Magento\Customer\Model\Data\Address))
#3 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Customer\Model\ResourceModel\CustomerRepository->save(Object(Magento\Customer\Model\Data\Customer), '(...)')
#4 /vendor/magento/framework/Interception/Interceptor in /vendor/magento/module-customer/Model/Address.php on line 149

After clearing cache the error disappears, then reappears after registering several test users.
The region for a country I'm using is disabled:

in "Stores>Configuration>General>General>State Options" the country is not selected;
"Allow to Choose State if It is Optional for Country" is set to "No".

A foreach loop constructing used address methods in \vendor\magento\framework\Reflection\DataObjectProcessor.php: DataObjectProcessor->buildOutputDataArray(), should skip a method if its returned value is null and it is not required:
if ($value === null && !$isMethodReturnValueRequired) { continue; }
Inside foreach loop I placed $logger->info(json_encode($methods['getRegion']));.
After clearing cache, when error does not occur, this outputs:
{"type":"\\Magento\\Customer\\Api\\Data\\RegionInterface","isRequired":false,"description":null,"parameterCount":0}
and
{"type":"string","isRequired":true,"description":null,"parameterCount":0}
When the error occurs, it outputs:
{"type":"\\Magento\\Customer\\Api\\Data\\RegionInterface","isRequired":true,"description":null,"parameterCount":0}
isRequired key is taken from \vendor\magento\framework\Reflection\MethodsMap.php: MethodsMap->getMethodsMap() which seems to retrieve it from cache. Hence when the cache is cleared the error disappears.
My attempt to quick-fix it is to change the fragment that trows exception in \vendor\magento\module-customer\Model\Address.php: Address->updateData() from:
if (AddressInterface::REGION === $attributeCode) {
   $this->setRegion($address->getRegion()->getRegion());

to:
if (AddressInterface::REGION === $attributeCode && $address->getRegion()) {
   $this->setRegion($address->getRegion()->getRegion());

Do anybody else have such problem - I would like to know if it's a core bug?
If it's not a core bug can there be a better way to solve this, what else can possibly cause it?


texts: Magento 2 + docker setup getting error of Redis

texts:
I have tried to set up one source in the local environment with docker image but getting an issue like below

  Fatal error: Uncaught CredisException: Connection to Redis failed
  after 2 failures.Last Error : (0) php_network_getaddresses:
  getaddrinfo failed: Name or service not known in
  /var/www/html/xyz/vendor/colinmollenhour/credis/Client.php on line 448

  CredisException: Connection to Redis failed after 2 failures.Last
  Error : (0) php_network_getaddresses: getaddrinfo failed: Name or
  service not known in
  /var/www/html/xyz/vendor/colinmollenhour/credis/Client.php
  on line 448

I have attached an image for more reference.


texts: Magento 2 How to add Magnifier to product list page?

texts:
I have enabled Magnifier to product detail page from theme etc/view.xml

<var name="magnifier">
    <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
    <var name="top"></var> <!-- Top position of magnifier -->
    <var name="left"></var> <!-- Left position of magnifier -->
    <var name="width"></var> <!-- Width of magnifier block -->
    <var name="height"></var> <!-- Height of magnifier block -->
    <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
    <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
</var>

I have updated enabled false to true and its working on product detail page.

But how can we add or enable Magnifier to product list page?


texts: Add CustomAttribute to catalog/product collection

texts:
In Catalog/product/list i have some collection like this :

$_productCollection = $this->getLoadedProductCollection();

and foreach ($_productCollection as $_product)
I want to do some condition in products with some attribute that i have added in admin
in $_product->getData(); i dont find my attribute

if i do my collection i find it:

<?php $collection = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('name')
    ->addAttributeToFilter('status', 1)
    ->addAttributeToFilter('promo', 1)
    ->setPageSize(10);
?>
<?php foreach($collection as $col): ?>
    <?php echo $col->getSku(); ?><br/> // 123
    <?php echo $col->getPromo(); ?> //1
<?php endforeach; ?>


texts: Magento 2 What is Alternative of Zend\Form\Annotation\Object in php 7.2

texts:
i was using PHP 7.0 i used to use Zend\Form\Annotation\Object Now i have upgraded my system to 7.2 and Now i am getting an error that

  PHP Fatal error: Cannot use Zend\Form\Annotation\Object as Object
  because 'Object' is a special class name

please suggest me Alternative for this class


texts: getPriceHtml function's returned something including undefined

texts:
I am trying to create a store using Magento ver. 1.8.1.0. My programming capabilities are not great. I am an electronics engineer and I know embedded C properly, only. So, please treat me well.

I have installed the theme Shoes Store from here. The theme works fine for now, but I have ran into the problem that near the price, there is a text "undefined", as it can be seen in the below screenshot clip.

I have used my browser to check the code of this block and it is like this:

      1
      9,99&nbsp;TL.
      undefined

   Details

And this HTML code is generated by new_products.phtml page which is a part of the theme and which uses following to print the above HTML code:

<?php echo $this->getPriceHtml($_product, true) ?>

As far as I understand, the "undefined" comes from the decimal part of the price. I have checked app/design/frontend/base/default/template/catalog/product/price.phtml but couldn't understand anything.

How can I get rid of the "undefined" text?


texts: Magento 2 : attribute not appearing in product

texts:
"tax_class_id" is the attribute i am looking for in product, but i cannot find it.
I can confirm the attribute is added in "Default" attribute set
& product has also same set assigned.
Still not able to find tax class attribute
I am using "Magento ver. 2.4.1" & checking on a Gift card product


texts: How to Special price based on attribute?

texts:
Is it possible to set special price automatically based on a attribute?
I have an attribute called offerprice in which I enter the percentage of discount.
So if the product price is $100 and I enter 10 in the offerprice field, the special price would automatically be calculated to $90


texts: Weird non system rows being added to core_url_rewrite

texts:
Our core_url_rewrite table seems to be growing excessively (21M rows currently) - I know there have been other questions about this, but none of them seem to mention this particular oddity: a lot of the new rows being added have is_system = 0, and the id_path is something like "97704000_1422557940". The number after the underscore looks to be the timestamp that the row was added, but I'm not sure what the first number is.

The advice for core_url_rewrite problems always seems to be to truncate the table and re-index, and it may come to that, but we have a lot of custom rewrites in the table so having to constantly re-add them is going to be a real pain, and I'd much rather get to the root of the issue.

We've just upgraded to 1.9.1.0, but there are rows in table going back nearly two years (!).

Any ideas?


texts: How to implement MSI (multi-source inventory) in Magento2.2.3 project?

texts:
Problem: I need to implement Global inventory management in magento 2.2.3. so that inventory can be synchronize from various sales channel like source(ecommerce marketplace example: amazon,flipkart.. others) and ERP (enterprise software for accounting , tax ).

What I tried:

catalogInventoryStockRegistryV1

PUT /V1/products/{productSku}/stockItems/{itemId}

http://magentodomain.com/rest/V1/products/sku-100/stockItems/1

catalogProductRepositoryV1

PUT /V1/products/{sku}

  Inventory can be update simultaneously from various sales channel and ERP through API.??

Reference:

https://github.com/magento-engcom/msi

https://www.slideshare.net/maghamed/multi-source-inventory-msi-in-magento-2

Anyone implement it successfully??

Solution:  Finding? still need to be write.


texts: Magento 2 Admin : How to increase number of products shown under related products in admin section?

texts: I want to sort the product by grag and drop , but both product are in different page , So want to remove pagination or show 100 products instead of 20 , Any Suggestion would be appreciated !


texts: links doesn't work in admin dashboard and icons also doesn't display

texts:
I've installed latest Magento on window but the links doesn't work in admin dashboard and icons also doesn't shown?

I already tried this one:

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

and replace to

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Thanks in advance


texts: Magento website redirect to "https://ribinski.us/redirect_base/redirect.js"

texts:
I am using Magento 1.9.2.1. It is redirecting me to another website https://ribinski.us/redirect_base/redirect.js. When I checked the code then someone added the following code in the Admin header section.

<script src="https://ribinski.us/redirect_base/redirect.js" id="1371499155545"></script><script type='text/javascript'>
(function (d, t) {
  var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
  bh.type = 'text/javascript';
  bh.src = '//www.bugherd.com/sidebarv2.js?apikey=onjdmwrwrjc7swchqcrxra';
  s.parentNode.insertBefore(bh, s);
  })(document, 'script');
</script>

I remove the code but I am not sure how hacker inserted it in the database. I have installed all the security patches recommended in mage report. Please help me to identify the loop hole of magento.

Thanks!


texts: Event dispatched on filter applied in Product Listing/Category View page

texts:
I have a module where I want to send data to an API whenever any filter is applied on the product listing/category view page (list or grid). The data being sent should contain only the latest filter applied, not all the filters.

I can write the rest of the logic in an observer but I can't seem to find any event which is dispatched whenever a filter is applied.


texts: Magento 2 How to get currency code on basis of GeoIP Country

texts:
Programatically how to get currency code on basis of GeoIP Country?

Example: Singapore - SGD


texts: Magento2 $ is not a function when using flexslider

texts:
I just migrated from Magento 1.x to Magento 2.

I setup Magento successfully, understood and used RequireJS as well.

I was adding flexslider on my home page and got the error:

$ is not a function

which means either jQuery is not loaded or there is a conflict. When I checked the network, I see jQuery is loaded successfully and jquery.flexslider-min.js is loaded after jQuery.

So, I'm not able to find the problem.

Here is my requirejs-config.js under my theme directory:

var config = {
map: {
    '*': {
        flexslider: 'Mymodule_Test/js/jquery.flexslider-min',
        header: 'Mymodule_Test/js/store/header'
    }
}
};

and there is part of my template:

<script type="text/javascript">

require(['jquery', 'flexslider'],function($, flexslider){
    (function() {
        $(window).load(function () {
            $('.flexslider').flexslider();
        });
    })(jQuery);
});
</script>

Please help me!


texts:
Is it possible to sort the product collection in two levels, first sort the collection by position and if products have similar positions then sort by name.

|#|Product Name| position|
|2| bde        | 0       |
|1| bcd        | 1       |
|3| cde        | 3       |
|4| abc        | 3       |

The above is how the products appear on sorting by position but i want it to show as below:

|#|Product Name| position|
|2| bde        | 0       |
|1| bcd        | 1       |
|4| abc        | 3       |
|3| cde        | 3       |


texts:
I am new to Magento.

I have setup the Magento 2.3.4.

I am seeing below homepage:

To change the message CMS homepage content goes here., I have made changes in cms_page table like below:

Restarted Apache and MySQL from XAMPP.

But still not able to see new message on the page.

What am I missing here.


texts: Manual or Auto installation for Magento in cPanel?

texts:
I am looking for the best option for magento (ce and enterprise) installation on cpanel.

Which one is better, and why?

Automatic installation through softaculous or whatever?
or
Manual installation?


texts:
In Magento CE 1.9.2.4 I use an extension who creates coupons for birthdays in a "Shopping Cart Price Rule". These coupon are generated with an expiration date.
The coupon works except that Magento does not check the expiration date.

Is it normal or do I have something not correctly configured ?

Today the only solution I have is to delete manually the expired coupons...


texts: How to stop login from customerLogin observer

texts:
I would like to deny login for a customer group. Following an example I got a working observer but I am not able to stop the login process:

public function customerLogin($observer)
{
    $customer = $observer->getEvent()->getCustomer();
    $session = Mage::getSingleton('customer/session');

    if ($customer->getData('group_id') == 4)
    {
         $session->setCustomer(Mage::getModel('customer/customer'))->setId(null);
         Mage::throwException(__('This account is not activated.'));
    }
}


texts: Add JS function to one page checkout before payment.save()

texts:
In the one page checkout I have a javascript function that I need to run before payment.save(); is called when you click on the continue button. My function (which is included in the page code) uses a 3rd party library to generate a token that is injected into the form which is then submitted with payment.save().

Is there a way to add a javascript function before payment.save() fires after clicking on the continue button?


texts: Is it possible to somehow install sample data after the install?

texts: I overwrote the media and skin folders on the magento installation with the sample data's skin and media  folders. I also ran the query against the database. Now I have a problem because "There has been an error processing your request", and I can't access Magento site any more. What can I do to pull through the sample data, and have my Magento working again?


texts: Magento module:uninstall orphans any dependencies (required modules)

texts:
I have some modules that are dependent on a core module. When I use the command

composer require stti/module-catalogbook

Magento installs 2 modules.. Stti_Catalogbook and Stti_Catalogcore.  If i then run

magento module:uninstall Stti_Catalogbook

Magento uninstalls the Catalogbook module, executing the routines to update the attributes and stuff i wrote, and removes the code from the vendor/stti directory. It also removes the Catalogbook entry from magentoroot/composer.json. Something odd it does however, is remove the entry from magentoroot/composer.json for the Catalogcore module.

I then run

magento module:status

It shows that Stti_Catalogcore is still in the list, and enabled.

At this point, Catalogcore cannot be uninstalled. I get a message in red declaring Stti_Catalogcore is not an installed composer package when i run

magento module:uninstall Stti_Catalogcore

FYI, i'm using satis to work with my local repo.  I don't think this is causing the problem however.

Here is the code from Catalogbook/composer.json

{
  "name": "stti/module-catalogbook",
  "description": "Configures magento for CRM catalog book product type",
  "type": "magento2-module",
  "version": "100.0.0",
  "authors": [
    {
      "name": "My Real Name",
      "email": "myemail@gmail.com"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Stti\\Catalogbook\\": ""
    }
  },
  "require": {
    "php": "~5.6.0|~7.0.0",
    "stti/module-catalogcore": "100.0.0.*"
  }
}

Here is the code from Catalogcore/composer.json

{
  "name": "stti/module-catalogcore",
  "description": "Core module for catalog CRM catalog integration",
  "type": "magento2-module",
  "version": "100.0.0",
  "authors": [
    {
      "name": "My Real Name",
      "email": "myemail@gmail.com"
    }
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Stti\\Catalogcore\\": ""
    }
  },
  "require": {
    "php": "~5.6.0|~7.0.0"
  }
}


texts:
My controller Save in

app/code/local/Management/Task/controllers/Adminhtml/TaskController.php
action name:save

in phtml code:

  url: '<?php echo Mage::helper("adminhtml")->getUrl('management/adminhtml/orderattachments/save')?>'

this my magento url:
                   127.0.0.1/magento19/index.php/admin/sales_order/view/order_id/1/key/7e4f7e7863c2844b08e421c6e866a718/

in network XHR 404 error accours.
what is wrong in url?