texts:
I’ve installed magento edition version 1.9.2.0 and using rwd theme.I am combine the login form and create account form into one page
customer.xml is given

<customer_account_login translate="label">
        Customer Account Login Form

        <remove name="right"/>
        <remove name="left"/>

        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
            <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
                <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                    Form Fields Before
                </block>
            </block>
        </reference>
    </customer_account_login>

Then Enabled the captcha feature under System>Configuration>Customer>Customer Configuration>CAPTCHA for Register form. captcha is working.but if we enter incorrect captcha it is not showing any error message like "Incorrect Captcha". I have copied captcha.xml to rwd theme and edit for displaying only for register form. the captcha.xml is also given

<customer_account_login>

          <reference name="customer_form_register">
            <block type="core/text_list" name="form.additional.info">
                <block type="captcha/captcha" name="captcha">
                    <reference name="head">
                        <action method="addJs"><file>mage/captcha.js</file></action>
                    </reference>
                    <action method="setFormId"><formId>user_create</formId></action>
                    <action method="setImgWidth"><width>230</width></action>
                    <action method="setImgHeight"><width>50</width></action>
                </block>
            </block>
        </reference>
    </customer_account_login>

i don't know is this correct. but the captcha only shows for register form(that is my requirement) .plz help for correct working of captcha


texts: Magento 2 - Error trying Redirect to login page for controller if not logged in

texts:
I know this question has been asked before a couple of times here:

Magento 2 : Redirect From Homepage to Login if not Logged

Magento 2 - Redirect user to a specific page if not logged in

However i cant seem to get it to work and am a bit confused about how this works with my specific controller. So far I have created an event.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
 <event name="controller_action_predispatch">
        <observer name="check_login_persistent" instance="Vendor\Module\Observer\CheckLoginPersistentObserver" />
 </event>
 </config>

This then references the observer:

<?php
namespace Vendor\Module\Observer;

class CheckLoginPersistentObserver implements \Magento\Framework\Event\ObserverInterface
{
/**
 * @var \Magento\Framework\App\Response\RedirectInterface
 */
protected $redirect;

/**
 * Customer session
 *
 * @var \Magento\Customer\Model\Session
 */
protected $_customerSession;

public function __construct(
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Framework\App\Response\RedirectInterface $redirect

) {

    $this->_customerSession = $customerSession;
    $this->redirect = $redirect;

}

public function execute(\Magento\Framework\Event\Observer $observer)
{
    echo "This is an event";
    $actionName = $observer->getEvent()->getRequest()->getFullActionName();
    $controller = $observer->getControllerAction();

    $openActions = array(
        'create',
        'createpost',
        'login',
        'loginpost',
        'logoutsuccess',
        'forgotpassword',
        'forgotpasswordpost',
        'resetpassword',
        'resetpasswordpost',
        'confirm',
        'confirmation'
    );
    if ($controller == 'account' && in_array($actionName, $openActions)) {
        return $this; //if in allowed actions do nothing.
    }
    if(!$this->_customerSession->isLoggedIn()) {
        $this->redirect->redirect($controller->getResponse(), 'customer/account/login');
    }

}
}

Then im not sure how to make this work in my specific case for my controller. I have looked a bit at events and added the below code to my controller so the event is fired:

$this->_eventManager->dispatch('controller_action_predispatch');

However this has ended up showing an error:

  PHP Fatal error:  Uncaught Error: Call to a member function getRequest() on null in /var/www/magento2/public_html/vendor/magento/module-customer/Model/Visitor.php


texts: What am I missing with OAuth token exchange process?

texts:
Magento has two important documents that outline how OAuth 1.0a authentication/authorization works (here and here).  There also appears to be a Magento sponsored example of OAuth.

There are two important steps:

Server to server POST for initial OAuth key exchange to the Callback URL.  oauth_consumer_key, oauth_consumer_secret, oauth_verifier, and store_base_url are sent.
User is redirected with a GET to the Identity Link URL.  consumer_id and success_call_back are sent.

How in the world are #1 and #2 connected?

I don't see any common data and the example from Magento just uses a common session, which I can only assume is a horrible idea.  Even more confusing is why consumer_id is sent with the user.


texts:
Anytime I run this to install any extension:
php bin/magento setup:upgrade.
I get the error -

  connection "developer"  is not defined.

I have tried to change the mode to developer and when I run it, the same issue comes out. this has reduced my ability to install new apps.

How do I resolve this?


texts: Product collection - Filter out child products where parent is disabled

texts:
My current code:

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->setOrder('id', 'ASC');
$collection->addAttributeToSelect('*');
$collection->addAttributeToFilter('status', '1');
$collection->addAttributeToFilter('type_id', array('neq' => 'bundle'));
$collection->addAttributeToFilter('type_id', array('neq' => 'configurable'));
$collection->addAttributeToFilter('type_id', array('neq' => 'grouped'));

The problem is that I still get the child products of configurable products where the parent is disabled or not assigned to any category. So I get the child product but it is not available in the webshop.
How can I filter the attributes of the parent products?


texts: related products not getting in a quote items

texts:
When I add a product to cart then its related products will be added automatically with it and it's working. But, I want to make the price zero on the cart page for related products only, as they will be free. I have added event as below :

<events>
<sales_quote_add_item>
        <observers>
            <priceupdate_observer>
                <type>singleton</type>
                <class>Inchoo_CustomLinkedProducts_Model_Observer</class>
                <method>modifyPrice</method>
            </priceupdate_observer>
        </observers>
        </sales_quote_add_item>
        </events>

Method in the observer is as below:

public function modifyPrice(Varien_Event_Observer $obs)
    {
        $free_product = $obs->getQuoteItem()->getProduct();
        // Get all custom products
        $custom_products = $free_product->getCustomProductCollection();
        // get all custom product id and save in array
        $custom_product_ids = array();
        foreach($custom_products as $product){
          $custom_product_ids[] = $product->getId(); // double check to make sure this product_id
        }
        //$collection = Mage::getModel('sales/quote_item')->getCollection();

        // $items = Mage::getModel(‘checkout/cart’)->getQuote()->getAllItems();

       $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
         foreach($items as $item )
         {
             if(in_array($item->getProductId(), $custom_product_ids))
              {
                $price = $this->_getPriceByItem($item);
                $item->setCustomPrice($price);
                $item->setOriginalCustomPrice($price);
              }
         }

       }

it is not working and i don't get related/custom product ids in the session , only 1 id gets printed.


texts: Overriding advanced search form to only search a certain category?

texts:
Magento 2.3.3
I overrode the advanced search form (/vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml). Now I want to only search a certain category (by id) when the search button is clicked. How can I achieve that?
Thanks!


texts: Bundle Items not including VAT in Checkout

texts:
A bundled item with 2 options (colour), is including VAT in the total, but not in the individual bundled items.

Using FireCheckout. I should clarify VAT is included in the bundled items catalog/product page, but it's just not showing in checkout.


texts: Magento2.3.3 Custom js widget gets loaded but then stops working

texts:
Hello i know this ma be hard to anwser but it tought i can all way's try.
I have a custom js widget that gets loaded on the frontend, This Javascript starts running but and i does what it needs to do but at the end it looks like Magento overrides it. It a widgets that check is there is a color availble end if so it pre selects it. So that happends and a price get shown but then the price get set to zero en the price is color is being uncheck.


texts: Magento2 - Which Phtml file controls img alt?

texts:
which file in magento 2 controls the img alt description for the front-end?

i already looked at the vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml file, but there is no alt in it ...


texts: How to add fixed cost to Mage_Shipping_Model_Rate_Request in Magento2?

texts: I want to add some fixed cost like 50$ for all any shipping methods has selected when specific product in cart.


texts: Magento 2 get Products with name starts with 'a'

texts:
I want all products with name starts with character 'a'(case insensitive) .
I am using the following code but it is not working

$i = 'a';
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$productcollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
                   ->addAttributeToSelect(['name', 'price', 'image'])
                   ->addAttributeToFilter('name', array('like'=>$i.'%'));
   echo count($productcollection );


texts: How to use setTemplate() in Custom modules _construct() magento2

texts:
How to achieve the setTemplate() in the custom modules constructor?

protected function _construct()
{
    $this->setTemplate('Myfolder/filter.phtml');
}

protected function _toHtml() {
    return parent::_toHtml();
}

Are we achieving the same in the layout file or how?


texts: Magento 2 ui component form add extra input in the same admin field control

texts:
How to add more input like checkboxes in the same area like the use default?

like so:

More precisely I thinks is a field service see shoot:


texts: Magento 2 : How to Get Selected Bundle Option Product Details in Cart Page

texts:
I need to get details of selected product of a bundled product. I tried following code in cart page. But it's not working.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// get cart items
$items = $cart->getItems();

// get custom options value of cart items
foreach ($items as $item) {
    $options = $item->getProduct()->getTypeInstance(true)->getOptions($item->getProduct());
    $customOptions = $options['options'];
}


texts:
How can we use cookie in magento 2 to store data..

i'm trying to store data in cookie, on
vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js
to store selected estimated shipping method,


texts: Get Current customer billing information

texts: How to display login customer billing information on home page without load model Mage::getModel'(customer/address')->load($addressId)?


texts: Magento - change the width that RWD theme turns mobile

texts:
Hello i have modified a RWD theme for my store but have found that on ipads in portrait mode have turned mobile.

I want to change the width that RWD changes to a mobile view with dropdown menus to be slightly less than the ipad portrait width?


texts: Adding radio field to choose between business or personal terms on Magento checkout

texts:
I am trying to figure out the best / safest way to add an option to Magento's checkout so users can define if they are agreeing the the business T&C's or the consumer/personal ones.

Ideally this would simply be in the form of a dropdown to choose which terms.

Then I wanted this to report to the order details in the back-end.

I have be looking around and I've found a few posts about adding custom field etc to Magento checkout however many are outdated and miss the back-end part.

Any help is greatly appreciated or a push in the right direction.


texts: Magento Marketplace extention does not install properly

texts:
We have download the custom extension and install via shop back Magento Connect Manager. And upload the extension via Direct package file upload.
But throw below mention error:

CONNECT ERROR: Package file is invalid
Invalid package name, allowed: [a-zA-Z0-9_-] chars

So we have find the extension package.xml file
<name>packagename+Package_Name</name>

How to solve this Issue!!.


texts: Magento 2 : Error when i click the admin->configuration

texts:
I am getting this error when I click on stores->configuration

  Notice: Undefined index: id in D:\xampp\htdocs\tork\vendor\magento\module-config\Model\Config\Structure\Element\Iterator.php on line 63

I tried to disable custom modules which has config section.Still get the same error.

Is there any way to check from which module I am getting this issue?


texts: I want to add functionality for applying insurance on cart page like when customer check the "Insurance" checkbox then some defined Insurance amount will apply to cart and will show in right hand summary section and vice versa if customer unchecked it then Insurance amount will remove from the section.Can anybody help me on it.


texts: Magento2 Unit Test - Mock setExtensionAttributes()

texts:
I cannot mock ProductOptionInterface::setExtensionAttributes, I get this error:

PHPUnit_Framework_MockObject_RuntimeException : Cannot mock Magento\Catalog\Api\Data\ProductOptionInterface::setExtensionAttributes() because a class or interface used in the signature is not loaded

Does anyone know how to resolve it?


texts: $block->getNameInLayout returns block's name but for configurable product returns alias

texts:
I'm trying to add a custom template just after ADD To Cart Button in product's page. In catalog_product_view.xml its defined as bellow:
<block class="Magento\Catalog\Block\Product\View"
    name="product.info.addtocart.additional" as="product.info.addtocart"
template="Magento_Catalog::product/view/addtocart.phtml"/>

Then in my module I do:
<referenceBlock name="product.info.addtocart">
    <block name="myBlock"/>
</referenceBlock>

In Reference block when name is: product.info.addtocart (alias) my block is rendered only for Simple products, when it is product.info.addtocart.additional(name) renders only for configurable product.
Debugging Magento_Catalog::product/view/addtocart.phtml, when I evaluate expression $block->getNameInLayout() confirm this behavior, if I'm loading simple product shows alias, if configurable name.
Can someone explain why its happening? Is that a Magento bug or am I doing something wrong? I'm using version 2.4.2


texts: Install plugin problem with Magento connect

texts:
I need to install some plugin. I would like to install with magento connect.

In 3 web site (with file hosts modified) when i try to install the message is:

community/Vhaldecode_CookieLaw: SSL connect error

or

community/MailUp: SSL connect error

can you help me?


texts: CMS Home Page appears below custom Default Home on one store view

texts:
I want to set a different home page to route to a cms page for one of the stores only.

I set up my default Home landing page in System > Configuration > Web > Default Pages and setting CMS Home Page to another page, while excluding the home page in CMS > Pages for this store view, but the home page is appearing below my custom landing page.

How can I fix this?


texts: How to show categories in the left column in magento?

texts:
Like u see in above picture i want it to show my categories and subcategories also i want this column  to work on products to not just in the home page

Thanks

Resolved using "Sebwite" extension.


texts:
I have this issue with the wishlist observable, I try to use the .subscribe function on it to check when the observable is changed but I keep getting wishlistObs is undefined what am I doing wrong ? this is my latest code, I also tried with this.wishlistObs but is still not working

    define([
    'ko',
    'jquery',
    'uiComponent',
    'Magento_Customer/js/customer-data' ], function (ko, $, Component, customerData) {
    'use strict';
return Component.extend({
            initialize: function (config, node) {
                this._super();

                var wishlistObs = customerData.get('wishlist'),
                    wishlist = wishlistObs(),
                    items = wishlist.items,
                    toWishlist = $('.to-wishlist'),
                    nodeRef = node.getAttribute('data-wishlist-ref'),
                    elmClass = 'wishlist-full';

                wishlistObs.subscribe(function (items) {
                    if (items) {
                        for (var i = 0; i < items.length; i++) {
                            var product = items[i];

                            var existing = $('.to-wishlist[data-wishlist-ref="'+product.product+'"]');

                            if(existing) {
                                if (!existing.hasClass(elmClass)) {
                                    existing.addClass(elmClass);
                                }
                            }

                            if (nodeRef === product.product && node.classList.contains(elmClass) != 'false') {
                                node.className += " " + elmClass;
                            }
                        }
                    }
                })
            }
        });
});


texts: Add a discount row on order total in backend order view

texts:
I want to add a new row which will contain a label of Discount and a value of that label.

Please see the screenshot

Any idea or any link about how to do it??


texts: Magento Error after I deleted Cache and session files

texts:
I am giving up finding a solution to my problem and hence I came here to get help from you experts.

I had my website smoothly running on Magento 2.0.0 until four days ago when I just wanted to speed up the site and in the process, I deleted some files like Cache, sessions, and files from a couple of other folders I exactly don't remember.
And the biggest foolish work I did was I did not take a backup as I thought the server will have a backup by default which they did not have to add to my frustration.

The problem now is - I am getting all sorts of error on the site.

1) Themes and JS have stopped working from frontend and backend.
2) Errors on all the inner pages in the frontend which I do not recognize.

I don't know how to solve it.
Please help.
Error is listed below which comes on every page in frontend:

  Warning: Invalid argument supplied for foreach() in /home/herbalre/public_html/vendor/magento/module-catalog/Block/Product/View/Gallery.php on line 112


texts: Pop out window not working in Internet Explorer

texts:
I have a link on my website which creates a pop out window in a CMS page. This work perfectly in Chrome, Oprea and safari but on firefox and IE it creates the pop out window with the correct page. but the main page also redirect to a blank age with [object] on it. This is the code im using to creat the pop out window.

    NEED HELP?

I have added an image below of what happens to the main screen on IE and firefox.

So my question is how can i create a pop out window without it re-directing the main page?


texts: how i can use graphql in magento 2.3 and i can setup to magento 2.3?

texts:
i want to know how i can use

  Graphql in magento 2.3

  is there any good resource's to understand that.

  how i can set up to my magento 2.3 project

  another question is Vue storefront is PWA ?


texts: Get product names for a large number of SKUs

texts:
I have been given a list of about 150 SKUs in a CSV and I need to get their product names.

I currently have the following code:

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

 $csv = file('Product - Sheet1.csv');
 $data= array();
 foreach($csv as $line){
     $data[] = str_getcsv($line);
 }

 $products= array();
 foreach($data as $k => $entry){
     if ($k < 1) continue; // First row contains the CSV headers
     $products[$k]['sku'] = $entry[0];
     $model == Mage::getSingleton('catalog/product')->loadByAttribute('sku',$entry[0]);
     $products[$k]['title']= $model->getName();
 }

If I do

 print_r($products)

I get a blank page, presumably because I'm loading the catalog/product model in the foreach loop.

How do I achieve the same solution but without overloading the system? I know loading models in a foreach is bad practice but I thought I could get by because its not on a production environment.


texts: Magento 2: Add custom Attribute in mini cart

texts: I added custom discount on shopping cart page. Now I want to add custom discount and grand total on minicart magento 2.How can i do this.


texts:
I want to remove product from wishlist from a custom button on detail. I did a plugin for the Magento\Wishlist\Controller\Index\Remove.php with an aroundExecute but for some reason I can't load/create products as magento does in the default Remove controller. I posted my file

 use Magento\Customer\Model\Session;
    use Magento\Framework\Controller\Result\JsonFactory;
    use Magento\Framework\Exception\NotFoundException;
    use Magento\Wishlist\Controller\WishlistProviderInterface;
    use Magento\Wishlist\Model\Item;
    use Magento\Wishlist\Model\Product\AttributeValueProvider;
    use Magento\Wishlist\Model\WishlistFactory;

/**
 * Class Remove
 * @package Codesicle\WishlistAjax\Plugin\Wishlist\Controller\Index
 */
class Remove
{
    /**
     * @var WishlistProviderInterface
     */
    protected $wishlistProvider;

    /**
     * @var AttributeValueProvider
     */
    private $attributeValueProvider;

    /**
     * @var Session
     */
    protected $customerSession;

    /**
     * @var JsonFactory
     */
    protected $jsonFactory;

    /**
     * @var WishlistFactory
     */
    protected $wishlistFactory;

    public function __construct(
        WishlistProviderInterface $wishlistProvider,
        AttributeValueProvider $attributeValueProvider = null,
        JsonFactory $jsonFactory,
        Session $customerSession,
        WishlistFactory $wishlistFactory
    )
    {
        $this->wishlistProvider = $wishlistProvider;
        $this->attributeValueProvider = $attributeValueProvider
            ?: \Magento\Framework\App\ObjectManager::getInstance()->get(AttributeValueProvider::class);
        $this->jsonFactory = $jsonFactory;
        $this->customerSession = $customerSession;
        $this->wishlistFactory = $wishlistFactory;
    }

    public function aroundExecute($subject, $proceed)
    {

        $id = (int)$this->getRequest()->getParam('item');

        $item = $subject->_objectManager->create(Item::class)->load($id);

        if (!$item->getId()) {
            throw new NotFoundException(__('Page not found.'));
        }
        $wishlist = $this->wishlistProvider->getWishlist($item->getWishlistId());
        if (!$wishlist) {
            throw new NotFoundException(__('Page not found.'));
        }
        try {
            $item->delete();
            $wishlist->save();
            $productName = $this->attributeValueProvider
                ->getRawAttributeValue($item->getProductId(), 'name');

            $response = [
                'errors' => false,
                'message' => __('%1 has been removed from your Wish List.', $productName)
            ];
        } catch (\Magento\Framework\Exception\LocalizedException $exception) {
            $response = [
                'errors' => true,
                'message' => __('We can\'t delete the item from Wish List right now because of an error: %1.', $exception->getMessage())
            ];
        } catch (\Exception $exception) {
            $response = [
                'errors' => true,
                'message' => __('We can\'t delete the item from the Wish List right now.')
            ];
        }
        $this->_objectManager->get(\Magento\Wishlist\Helper\Data::class)->calculate();

        $resultJson = $this->jsonFactory->create();
        return $resultJson->setData($response);
    }

What am I missing or what did I do wrong?

LE:

Looks like the getItem method from WishlistFactory is returning NULL and I can't get to find out why


texts: Located in Frontend/Base file - how do i locate in local.xml?

texts:
I have reached desired behavior on frontend by blocking code in a base file:

app/design/frontend/base/default/template/customer/account/navigation.phtml

        <?php echo $this->__('My Account'); ?>

            </*?php $_links = $this->getLinks(); ?>
            </*?php $_index = 1; ?>
            </*?php $_count = count($_links); ?>
            <?php foreach ($_links as $_link): ?>
                <?php $_last = ($_index++ >= $_count); ?>
                <?php if ($this->isActive($_link)): ?>
                    <li class="current<?php echo ($_last ? ' last' : '') ?>"><?php echo $_link->getLabel() ?>

                <?php else: ?>
                    <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

                <?php endif; ?>
            <?php endforeach; ?>

How do i locate in local.xml to make adjustments to reach desired behavior on frontend? I realize I do not want to keep blocked code in base files.


texts: How to show "how many" items are in stock currently on product page? [Magento2]

texts:
Currently it only shows "in stock" or "not in stock".

Can I somehow show how many items are in stock if there are any products in stock?

Thanks alot!


texts: How can we insert new records in magento2 db using sql queries

texts: Let us know the exact way to import bulk data to DB using queries.


texts: Is there any way to change order status when order success page is displayed?

texts:
I'm facing an issue on triggering SMS(Using a 3rd party extenstion) when an order is placed successfully.
SMS is triggering before the payment(Instamojo Payment gateway) is getting completed.

$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);

Can I set something like above in success.phtml file?

Payment Gateway Code

if($payment_status === "Credit"){
Mage::log("Payment was successfull for $insta_id", Zend_Log::DEBUG, $this->LOG_FILE_NAME);
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
Mage::log("Pending payment is set to False", Zend_Log::DEBUG, $this->LOG_FILE_NAME);
$order->sendNewOrderEmail();
$order->setEmailSent(true);
$order->save();

$payment = $order->getPayment();
$transaction = $payment->getTransaction($transactionId);
$data = $transaction->getAdditionalInformation();
$url = $data['raw_details_info']['Url'];
$transaction->setAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS,
                    array('InstmojoId'=> $insta_id,
                          'Context'=>'Token payment',
                          'Amount'=>$amount,
                          'Status'=>1,
                          'Url'=>$url))->save();
$transaction->setParentTxnId($insta_id)->save();
$payment->setIsTransactionClosed(1);

$this->_redirect('checkout/onepage/success', array('_secure'=>true));}


texts: How to change/update payment method block html on email templates?

texts:
I want to modify html for credit card payment method.
This is what i found in shipment.php file:

$paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
                ->setIsSecureMode(true);
$paymentBlock->getMethod()->setStore($storeId);
$paymentBlockHtml = $paymentBlock->toHtml();

This is the source for payment block in the email i received:

            Credit Card Type:
            Visa

            Credit Card Number:
            xxxx-1111

            Processed Amount:
            $22.00

I want to update html for this block. Can you please advise on the file which i need to check?


texts: Custom controller enable Gzip compression?

texts:
We have a custom controller returning some json, this doesn't appear to be gzipped.

The response has: Content-Type: application/json, I've modified the root .htaccess to enable gzip but it doesn't seem to make any difference for the controller.

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE "application/atom+xml" \
                                "application/javascript" \
                                "application/json" \
                                "application/ld+json" \
                                "application/manifest+json" \
                                "application/rdf+xml" \
                                "application/rss+xml" \
                                "application/schema+json" \
                                "application/vnd.geo+json" \
                                "application/vnd.ms-fontobject" \
                                "application/x-font-ttf" \
                                "application/x-javascript" \
                                "application/x-web-app-manifest+json" \
                                "application/xhtml+xml" \
                                "application/xml" \
                                "font/eot" \
                                "font/opentype" \
                                "image/bmp" \
                                "image/svg+xml" \
                                "image/vnd.microsoft.icon" \
                                "image/x-icon" \
                                "text/cache-manifest" \
                                "text/css" \
                                "text/html" \
                                "text/javascript" \
                                "text/plain" \
                                "text/vcard" \
                                "text/vnd.rim.location.xloc" \
                                "text/vtt" \
                                "text/x-component" \
                                "text/x-cross-domain-policy" \
                                "text/xml"
  Header append Vary User-Agent env=!dont-vary

</IfModule>

It does make css/js gzipped so the mod_deflate seems to be enabled and working.

I would prefer to not need to modify the controller itself because on our dev/live site we have varnish + cdn and those already take care of gzipping it.

The controller is made in a pretty "core way" so I don't get why it's not working. Anyone have any ideas?

The first class is the controller that is been called from an ajax request in frontend using GET.

class Vendor_Elasticsearch_CatalogController extends Vendor_React_Controller_AbstractController {
    // ...
    protected function _sendResponse($response, $httpCode)
    {
        if (is_array($response)) {
            $response = $result = json_encode($response, JSON_FORCE_OBJECT);
        }
        $this->getResponse()
            ->setHeader('Content-type', 'application/json')
            ->setHeader('HTTP/1.0', $httpCode, true);
        $this->getResponse()->setBody($response);
    }
}

abstract class Vendor_React_Controller_AbstractController extends Mage_Core_Controller_Front_Action


texts: Magento 2: custom action di compile issue

texts:
I have created below code for the reindexing programmatically from a custom  url, bit i got the below error while running below code, please help me to solve out this issue.

<?php

namespace Codextblog\Customemail\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{

   protected $processor;

   public function __construct(
        \Magento\Indexer\Model\Processor $processor
    ) {
        $this->processor = $processor;
    }

    public function execute()
    {
        /* Regenerate indexes for all indexers */
        $this->processor->reindexAll();

        /* Regenerate indexes for all invalid indexers */
        $this->processor->reindexAllInvalid();
    }
}

And I got the below error while running the above code in my controller.


texts: Magento 2 : Override template file /info/default.phtml

texts:
How to override below file in module ?
Magento2/vendor/magento/module-payment/view/frontend/templates/info/default.phtml


texts: How to edit source of the index page in Magento

texts:
I am a professional PHP developer, it's been like 2-3 days since I am trying to work with magento. My task is to optimize the index page. Thing is, I can not edit the "actual" source of index page. The edit access in admin panel is very (very) limited.

For reference, I did check the admin panel > CMS > Pages > Homepage > Edit source. But! it only allows me to edit a specific part of actual index page. It only allows me to edit HTML, and that too, only about 50 lines, while I want to optimize all 1000+ lines of actual page.

And if anyone is wondering, I want to optimize page rendering, javascript code, external references, and also remove the redundant code.


texts: Magento 2.4 : Missing required argument $engines of Magento\Search\Model\EngineResolver

texts:
I've a fresh install of Magento 2.4.0 on ubuntu 20.04 installed from CLI, downloaded with Composer.
I get this error while trying to reindex the catalog_search index :

Catalog Search index process unknown error:
Missing required argument $engines of Magento\Search\Model\EngineResolver.

Also, my catalog/catalog tab in admin panel is empty for the scope default config so I can't set the elasticsearch engine from the UI. In the core_config_data, there was no catalog/search/engine, so I tried to set a new one with elasticsearch7 or mysql but neither worked.
I precise that I've a working elasticsearch 7.x on this new server, with no credentials.
It seems that the elasticsearch related config are not set properly, and I can't figure out why no option are visible in the default scope admin panel for the catalog/catalog tab...
An idea ?


texts: Magento | How to make shopping cart rule depend on Total price of order not subtotal

texts: Hot to make shopping cart rule depend on the total price of the order not subtotal of every item as this is the default of magento!


texts: Magento Theme Issue - Custom theme default.xml and default_head_blocks.xml load on all pages except one (signin page )

texts:
I customize the 3rd party theme(solwin free go) of magento2 where I add something in /app/design/frontend/Solwin/freego/Magento_Theme/layout/default.xml to change the position of navbar and
/app/design/frontend/Solwin/freego/Magento_Theme/layout/default_head_blocks.xml for add custom css and javascript these all changes are perfectly going on all pages of my magento2 sites except one which i go after clicking on sign in link "domain_name/customer/account/login/"
I attach the screenshot for the home page where my changes are perfectly applied
here only on this page my changes not effect


texts: Checkout Page - JavaScript can't target inputs

texts:
On my checkout page I'd like to do some JavaScript on Inputs and other elements.

It seems like I can't access certain part of my page. To verify i tried $("form").html("these forms I could find");

I use extension by IWD Agency, but I believe this has nothing to do with their module.

When editing JS inside module you can see that only Search bar and Payment Selection could be change, other forms remain unchanged.

When editing JS from my custom module I can change only Search Bar.

I guess this is caused by AJAX that forms are not loaded when the script runs. Any ideas how could this be changed?

Thank you!


texts: Different package for different user agent

texts:
I have 2 custom themes in magento. One is in default package and second is in SEPARATE package.Just like Below

default

iphone
default

magma

default

Now using design exception i want to use the default of magma.Can anyone help me how can i achieve that?


texts: How To Index Management in Magento 2 on Local Server?

texts:
I need to reindex but can't get it to work. I'm in the root directory and when running:

magento indexer:reindex

It states that magento isn't a valid command, so after further research I try and run the php command:

php bin/magento indexer:reindex

But I get the same error saying php isn't recognised as an internal or external command.

I haven't got WAMP or XAMP installed as I believe it is running on PHP's built in web server? It is running on a mapped network drive at Y:.

I know this is vague but it's all the information I've got to go on. Any ideas?


texts: Wrong E-Mail sender on order confirmation - Magento 2.2.5

texts:
when I receive order confirmations from my shop theres always the wrong sender e-mail adress. It's sending from the main webspace e-mail

I thought I set the settings correctly but it doesn't seem to work.
The registration-mails work great.

Thanks
Thomas


texts: Unable to place order in Magento2.2.6 using REST API

texts:
When we are working on Magento2.2.4 on the same, i got the proper response order_id was created.

But, coming to Magento2.2.6, i am getting the response like this

We have checked the log files from var/log/exception.log

I got the following :

[2018-10-24 09:34:49] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
[2018-10-24 09:35:05] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
[2018-10-24 09:37:09] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () {"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES () at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'depoto.mg_sequence_order_1' doesn't exist at /home/depoto/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

We have the table sequence_order_1.

But the log file is showing the error with depoto_mg_sequence_order_1

Why this is happening like this?


texts:
I want to import a image to product.

I have:

$url = 'www.example.com/imagen01.jpg';
$product->addImageToMediaGallery($url, array('image','thumbnail','small'),false,false);

But it doesn't work. How can I do that? Do I need to download the image to /media??


texts: How to override phtml / add a static image to .phtml file from the extension?

texts:
I'm try to add a banner image to the list.phtml, but it's not displaying.
This is what i did:
step 1: copied /public_html/vendor/mirasvit/module-rewards/src/RewardsCustomerAccount/view/frontend/templates/account/list.phtml
into
/public_html/app/design/frontend/Infortis/ultimo/Mirasvit_RewardsCustomerAccount/templates/account/list.phtml
step2: upload the image to /public_html/app/design/frontend/Infortis/ultimo/web/images/membership-banner.jpg
step 3: modify the list.phtml as below
<?php
/** @var \Mirasvit\RewardsCustomerAccount\Block\Account\Listing $block */
$collection = $block->getTransactionCollection();
$earnRules = $block->getDisplayEarnRules();
$spendRules = $block->getDisplaySpendRules();
?>

        <?= $block->getChildHtml('rewards.page.main.title'); ?>
        <?= __('Points Summary') ?>

<?= __('You have %1 in your account.', $this->helper('Mirasvit\Rewards\Helper\Data')->formatPoints($block->getBalancePoints())); ?>

<?= $block->getChildHtml('rewards.notification') ?>

<?= __('test.'); ?>

        <img src='<?php echo $this->getViewFileUrl('Infortis_Ultimo::images/membership-banner.jpg'); ?>' alt="membership-banner" width="1150" height="325">

step 4: run php bin/magento s:s:d; php bin/magento c:f but nothing changes on the frontend.


texts: PHP: How to move an array element with an unknown key to end?

texts:
I have an array which contains list of color values. Consider below array:
Array
    (
      [value] => 4
      [label] => red
    )
Array
    (
        [value] => 5
        [label] => pink
    )
Array
    (
        [value] => 6
        [label] => blue
    )
Array
    (
        [value] => 7
        [label] => yellow
    )
Array
    (
        [value] => 8
        [label] => white
    )
Array
    (
        [value] => 9
        [label] => black
    )

I want to shift/move color with value Blue at the end of the array.
Array
(
    [value] => 6
    [label] => blue
)

Should it be on last index of array?
Note:  The array key is unknown.


texts: Checking "Use Default Value" box programmatically

texts:
I need to check "Use Default Value" box for product status programmatically.
I found this answer.
So to untick the box I could use this code:
$product = Mage::getModel('catalog/product')->load($productId);
                    $product->setData($args['row']);
                    $product->setStoreId($storeid);
                    $product->setData('status', true);
                    $product->save();

The problem I encountered was, that if I untick the box like this, the status would always change to "Enabled" and that is obviously because of $product->setData('status', true);
I want the status to remain as it was (like it would when manually unticking the box), so I made a change to the code:
    $actualstatusvalue = Mage::getModel('catalog/product')->setStoreId($storeid)->load($productId)->getData('status');
    $product = Mage::getModel('catalog/product')->load($productId);
                          $product->setData($args['row']);
                          $product->setStoreId($storeid);
                          $product->setData('status', true);
                          $product->setData('status', $actualstatusvalue);
                          $product->save();

So I set the status back to what it was before unticking the box.
This does what I need, but since I don't understand exactly how this works (specifically $product->setData($args['row']);), I am worried that this is a silly/stupid way of doing it.


texts: Problem with admin settings for a custom Payment method

texts:
I'm developing a Custom Payment Method And this Module have 3 payment methods, each have a particular setting, but I also have setting common for all methods (general).
I'm trying to have working payment settings menu like that:

to have this visual I'm using in etc/adminhtml/system.xml a structure like that:
<system>
    <section id="payment">...
       <group id="general"...
            [FIELDS HERE]
       <group id="boleto"... (sub group)
       <group id="creditcard"... (sub group)
       <group id="tef"... (sub group)
    </section...

Then, to have default value config,
etc/frontend/config.xml like that:
<config...
       <payment
          <general...
             <address_street>1</address_street>
             <address_number>2</address_number>
             <address_complement>3</address_complement>
             <address_neighborhood>4</address_neighborhood>
             <boleto_pagseguro> boleto_pagseguro's Fields...(sub group setting)
             <creditcard>... creditcard's fields... (sub group setting)
             <tef>... tef's fields... (sub group setting)
         </general
    <default......

If I save everything flush cache I have in backend a result like the image. The default settings is being loaded from config.xml, I can also access it in my DataHelper class with no problem, but in frontend I got the error: Payment model name is not provided in config...
well, I want the general config in Payment session but general is not an Payment method to I set a model to it. If I add the tag: ExistentModelClass (in my case BoletoFacade ) It works... I got no errors
But it doesn't seems right (a hack way) to fix the problem, Is there a way to have this menu (General) showing in payment and linking with default config value without adding this unnecessary model tag?


texts:
I am trying to test a module which contains a context object as follows:

public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    \Magento\Catalog\Model\Product\ImageFactory $productImageFactory,
    \Magento\Framework\View\Asset\Repository $assetRepo,
    \Magento\Framework\View\ConfigInterface $viewConfig,
    ProductRepository $productRepo
)
    {
    parent::__construct($context, $productImageFactory, $assetRepo, $viewConfig);
    $this->productRepo = $productRepo;
}

When I run my Unit Test it gives me this error message:

PHPUnit_Framework_Error : Argument 1 passed to Magento\Catalog\Model\Product::__construct() must be an instance of Magento\Framework\Model\Context, none given, called in ...

How can I make a mock of this object or make this error fixed?


texts: Localized frontend value for getCustomAttribute() (select or multiselect attributes)

texts:
Given a Magento\Catalog\Api\Data\ProductInterface $product and string $attributeCode of an arbitrary attribute, I can access the attribute value, using:

$product->getCustomAttribute($attributeCode)->getValue();

This is the Service Contract variant of $product->getData($attributeCode)

Now I'm looking for an equivalent to $product->getAttributeText($attributeCode) because the attribute might be a "select" or "multiselect" type.

Is it possible, using only Service Contracts? If I load the attribute, using Magento\Catalog\Api\ProductAttributeRepositoryInterface, I could use $attribute->getFrontend()->getValue(), but this is again using implementation details that are not part of the Service Contract API.


texts: How to override Magento_CatalogWidget::product/widget/content/grid.phtml widget template in custom Module?

texts:
I want to override grid.phtml in custome module without using preference.I have tried this link but it does not work for me.

widget.xml

<?xml version="1.0" encoding="UTF-8"?>
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget_file.xsd">
    <widget id="products_list">
        <parameters>
            <parameter name="template" xsi:type="select">
                <options>
                    <option name="grid" value="Vendor_Module::product/widget/content/grid.phtml">
                        <label translate="true">Products Grid Template</label>
                    </option>
                </options>
            </parameter>
        </parameters>
        <containers>
            <container name="content">
                <template name="grid" value="grid" />
            </container>
            <container name="content.top">
                <template name="grid" value="grid" />
            </container>
            <container name="content.bottom">
                <template name="grid" value="grid" />
            </container>
        </containers>
    </widget>
</widgets>


texts: Magento 1.9 review_save_after event not working

texts:
config.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <d_Reviews>
            <version>0.1.0</version>    <!-- Version number of your module -->
        </d_Reviews>
    </modules>
    <frontend>
        <routers>
            <reviews>
                <use>standard</use>
                <args>
                    <module>d_Reviews</module>
                    <frontName>reviews</frontName>
                </args>
            </reviews>
        </routers>
    </frontend>
    <global>
        <model>
            <d_Reviews>
                <class>d_Reviews_Model</class>
            </d_Reviews>
        </model>
        <blocks>
            <d_Reviews>
                <class>d_Reviews_Block</class>
            </d_Reviews>
        </blocks>
        <helpers>
            <reviews>
                <class>d_Reviews_Helper</class>
            </reviews>
        </helpers>
        <events>
            <review_save_after>
                <observers>
                    <d_Reviews_Model_Observer>
                        <class>reviews/observer</class>
                        <method>sendReview</method>
                    </d_Reviews_Model_Observer>
                </observers>
            </review_save_after>
        </events>
    </global>
    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <reviewsettings>
                                            <title>Settings</title>
                                        </reviewsettings>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>

observer class

    class D_Reviews_Model_Observer
{
    public function sendReview(Varien_Event_Observer $observer)
    {
        Mage::log("here it is");
        $object = $observer->getEvent()->getObject();
        echo "<pre>";print_r($object);die;
    }
}


texts: M2: Long delay before a new order appears in admin panel

texts:
Im wondering if anybody else has experienced a long delay (like 5-20 minutes) between the time an order is placed, and the time the order appears in the admin panel (also, the emails only get delivered once it appears). It seems like the orders are queuing up, but I'm not aware of an order queue mechanism.

Could this also be a delayed indexing problem?


texts: Show blocks only in index page by only using layout

texts:
I have two blocks

<block type="core/template" name="homepage" as="homepage" template="page/html/homepage.phtml" />

<block type="raymanproductstab/productstab" name="productstab" as="productstab" template="productstab/productstab.phtml" />

How can I show these two block only in index page only by modifying layout (but not using backend cms)?


texts:
There is a link in header portion called quick order, I need to add css class for that link but there is no phtml file for that link so I need to add it via xml. Below is the xml file from vendor.
<referenceContainer name="header.panel">
            <block class="Magento\Framework\View\Element\Html\Links" name="b2blinks" before="top.links">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
                <block class="Magento\QuickOrder\Block\Link" name="quick_order_link" ifconfig="btob/website_configuration/quickorder_active" after="-"/>
            </block>
        </referenceContainer>

How can give css class for quick order link?


texts: How I add my Header and footer in my magento 2 theme

texts:
I am new fresher and start Magento 2 development I have created a Magento 2 theme and I have created a custom header and footer how I add my custom header footer in Magento 2 theme

this is my theme view
this is my simple theme folder

and this is my custom header and footer
how I add this header and footer in this theme


texts:
I'm new to Magento, so was playing with the API Magento 1.9.3, the sorting does seem not to work whether ASC or DESC, I was trying to sort it by position.

$ruleId = 4;
$catalog_category = Mage::getModel('catalog/category')
                            ->load($ruleId)
                            ->getProductCollection()
                            ->addAttributeToSelect('*')
                            ->setOrder('position', 'ASC');

I have added the position number in the category's product. Any idea what went wrong?


texts: How check qty before add to cart in magento 2?

texts: I need intercept the product qty before add in cart. I see the events list but don't find any observer to make this action. Any idea? Thanks.


texts: I have added a new block in admin sales order page. The strange thing is it doesn't appear when i open order create page. But when i reload it appears. Can anyone tell what i am missing.


texts: Managing M2 projects with GIT (workflow)

texts:
I'm developing Magento projects for different merchants and I don't know if I'm working right, also have some doubts, any advice is welcome. I'll share my workflow.

Initialize the project

I install a fresh magento project using composer on local and create the git repository. I just use the default gitignore. I install the magento instance with CLI, the template and some modules that are required for the project. I use submodules for install the modules that are reutilized for other merchants. I think it's a good practice, I prefer it than use composer.

Deploying project on production server

When my local project is stable I deploy it on production server following these steps:

backup my ddbb from local
git clone on server
run composer install
install magento from CLI (I know, I will restore the ddbb after that, but I don't know why I have to install magento first, if I don't do it, something is broken.
restore ddbb

At this point I have 2 instances of Magento exactly equals, on local and on production server.

Deploying categories, products, attributes, images, etc on production server

I use some software that transfers all products stuff on magento via API. I have to do that on production server, I need a public url. When finished that, I need to backup the ddbb and restore it on local for mantain the 2 instances equals.
But now I have the first problem, I don't have the product images, because of gitignore. Don't know if it's good to keep working like that, without images, or just add all that stuff on git too.

Customizing the website

Now is when all troubles goes up. The project is stable but need to modify some things, (sometimes an entire functionality, you know that world :D) I try to keep working always in local, commit and push, but sometimes I need an interaction from merchant that will configure on production server, or just have to try things on production server, editing some configurations... And it's a headache have to think always what instance of magento is newer, backing up and restoring from one or another instance, etc.

Conclusions

Don't know if I'm doing the best practices, just wanted to share my workflow, and receive some advices to improve. The doubt I wanted to clear is what to do with images, I don't understand why the default gitignore tracks some folders on /pub/media (I've noticed playing with wysiwyg, when you upload images it tracks on git) but the product images are ignored (not sure now where are saved) I think I'll be better having all images on local, but don't know if will enlarge so much the project.


texts:
I am trying to create a pretty simple promotion rule where if a customer buys 3 of a specific item they will get 1 free, The screen shots below show the setup of my promotion:

As you can see it all looks in order but when I add 4 of the same item to a basket and check it doesn't apply the discount, can someone please help as i am not sure if i have missed a configuration option. Also is there a way to add an item to the bask if they have ordered something?

Thanks


texts: Declarative schema: Incorrect Foreign Key Diff

texts:
We created a new table using M2's declarative scheme like this:

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">

        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment=""/>
        <column xsi:type="int" name="quote_item_id" padding="10" unsigned="true" nullable="false" comment=""/>
        <column xsi:type="varchar" name="original_sku" nullable="true" length="255" comment=""/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="FK_QUOTE_ITEM_ID" table="company_quote_item_original_sku"
            column="quote_item_id" referenceTable="quote_item" referenceColumn="item_id"
            onDelete="CASCADE"/>

</schema>

This worked great. Then we tried to add another table by updating the schema, like so:

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">

        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment=""/>
        <column xsi:type="int" name="quote_item_id" padding="10" unsigned="true" nullable="false" comment=""/>
        <column xsi:type="varchar" name="original_sku" nullable="true" length="255" comment=""/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="FK_QUOTE_ITEM_ID" table="company_quote_item_original_sku"
            column="quote_item_id" referenceTable="quote_item" referenceColumn="item_id"
            onDelete="CASCADE"/>

        <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment=""/>
        <column xsi:type="int" name="order_item_id" padding="10" unsigned="true" nullable="false" comment=""/>
        <column xsi:type="varchar" name="original_sku" nullable="true" length="255" comment=""/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
        <constraint xsi:type="foreign" referenceId="FK_ORDER_ITEM_ID" table="company_order_item_original_sku"
            column="order_item_id" referenceTable="sales_order_item" referenceColumn="item_id"
            onDelete="CASCADE"/>

</schema>

This triggered the following error:

General error: 1826 Duplicate FOREIGN KEY constraint name 'magento2/COMPANY_QUOTE_ITEM_ORIGINAL_SKU_QUOTE_ITEM_ID_QUOTE_ITEM_ITEM_ID'

ALTER TABLE `company_quote_item_original_sku` MODIFY COLUMN `entity_id` int(10) UNSIGNED NOT NULL  AUTO_IN
CREMENT COMMENT "", MODIFY COLUMN `quote_item_id` int(10) UNSIGNED NOT NULL   COMMENT "", MODIFY COLUMN `original_sku` varchar(255) NULL  COMMENT "", ADD CONSTRAINT `COMPANY_QUOTE_ITEM_ORIGINAL_SKU_QUOTE_ITEM_ID_QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`quote_item_id`) REFER
ENCES `quote_item` (`item_id`)  ON DELETE CASCADE, COMMENT=''

It looks like Magento is incorrectly diffing my existing table and the new schema-generated table. It should do a REMOVE before it does the ADD on the constraint, but it doesn't.

Has anyone seen this before?


texts:
In pub/index.php, the following code is used to set change URLs for media and static assets to omit "/pub":

$params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [
    DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
    DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
    DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
    DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
];
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

Unfortunately in CLI scripts (bin/magento) there is nothing like this.

I found the class Magento\Setup\Mvc\Bootstrap\InitParamListener with the following code:

$initParams = $application->getServiceManager()->get(self::BOOTSTRAP_PARAM);
$directoryList = $this->createDirectoryList($initParams);

But I don't understand where this Zend Service Manager retrieves the data and how it might be possible to influence it.

My concrete problem is that an indexer has to generate full URLs and currently does it like http://magento.local/pub/media/..., where I need it to be http://magento.local/media/...

How can I tell the CLI that my virtual host points to pub and "pub" should not be part of URLs?

Ideally this should work without having to rely on additional CLI parameters or environment variables.


texts: Stuck on "Update pending" when install an extension via web setup wizard, Magento 2.3.2

texts:
I was stuck while installing an extension pack, here is my screen:
I used: windows 10, PHP 7.2.0 ( xampp ), Magento 2.3.2

If you need any additional information I will provide.
Any help would be greatly appreciated.


texts:
No matter if System Variable or from the STORES > CONFIGURATION > Store Information fields, I can not output variables in cms pages. It feels like I'm missing something so basic, that I can not even google a similar problem.

I've tried to use the INSERT VARIABLE button in wysiwyg mode and in plain text, also custom variables, but I get no output.

It is also not a problem of Store View Mode, deleted cache, reindexed everything, tried production mode and developer mode, all logs are empty (or at least show now errors related to it)

It is also strange, that it works If I put the code below into a Block and then include this block into my cms page.

Is it a security thing, which I do not understand?

Magento 2.3.2

My Plain HTML Code of my cms page, which only outputs "1 2":

1
{{config path="system/config/path"}}
{{config path="general/store_information/city"}}
{{customVar code=testvar}}
2


texts: Import Product Images with external Image URL

texts: I have URLs of all product images. I want to import it into the new store. I have already added URL(www.demo.com/a.png) in the CSV for every product images. Now I want to know that what to enter in Image File Directory field?


texts: Can we block Search Engine crawlers from indexing system URLs

texts:
Can we block access for Search Engine Crawlers to all system URLs.

I know we can do this by adding rules to robots.txt.
But can we also achieve this on the server level (Nginx)

Thnx, and Kind Regards


texts: How to know that customer goes to checkout but doesn't complete checkout process?

texts:
I want to put virtual pageview javascript in one step checkout but this javascript will only be fired if the customer does not complete the order.

So that i can see customers address info, shipping and payment method selection for failed payments.


texts: Type Error occurred when creating object, attempting to use custom model from custom module

texts:
Yes I know, another "Type Error occurred when creating object" post...
In addition, I'm probably going about this in a way that will make the seasoned M2 dev need a moment before reading through this post so if I should just forget the error and reimplement what I'm doing in a better way, let me know.
The full error is as follows:
1 exception(s):
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: VendorName\CustomModel\Model\Item

Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: VendorName\CustomModel\Model\Item
#1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#2 Magento\Framework\ObjectManager\ObjectManager->create() called at [pub/misc/test.php:13]
#3 TestItems->launch() called at [generated/code/TestItems/Interceptor.php:24]
#4 TestItems\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#5 Magento\Framework\App\Bootstrap->run() called at [pub/misc/test.php:20]

I've attempted all the usual fixes:
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean

rm -rf /generated/*

But nothing I could find in previous times this has been asked solves my issue.
I'm attempting to create an admin script that can be run by visiting a PHP file such as /misc/test.php, and am using the code at How can I bootstrap Magento 2 in a test.php script? to do this in the best way I can.
Below are my files:
/pub/misc/test.php
require __DIR__ . '/../../../../app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */

class TestItems
    extends \Magento\Framework\App\Http
    implements \Magento\Framework\AppInterface {
    public function launch()
    {
        //dirty code goes here.
        //the example below just prints a class name
        echo get_class($this->_objectManager->create('\VendorName\CustomModule\Model\Item'));
        //the method must end with this line
        return $this->_response;
    }
}

$app = $bootstrap->createApplication('TestItems');
$bootstrap->run($app);

/app/code/VendorName/CustomModule/Item.php
namespace VendorName\CustomModule\Model;

class Item extends \Magento\Framework\Model\AbstractModel
{
    protected $sourceItemsBySku;

    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\InventoryApi\Api\GetSourceItemsBySkuInterface $sourceItemsBySku
    )
    {
        $this->sourceItemsBySku = $sourceItemsBySku;
        parent::__construct($context);
    }

    public function getSourceItemBySku($sku)
    {
       return $this->sourceItemsBySku->execute($sku);
    }
}


texts: Can not find products after uploading test .csv

texts:
i have successfully uploaded a test csv but the product i am using to test does not exist in the admin panel anywhere?

Any known problems like this. I am still learning so sorry if the answer is obvious.

Any help is much appreciated!

Regards
Zako


texts:
I am programmatically creating customers and adding billing and shipping addresses to their accounts.

I have put in $customer->loadByEmail($email) so when this script runs a second time it updates a customer instead of saving them again.

At the moment I can not work out how to check if a customer has a specific billing or shipping address (or other additional address) when I want to add an address, so I am re-adding the same addresses when the script runs again.

How do I check if a customer has a specific address?

e.g.

$address_details = array(
    'firstname'  => $firstname,
    'lastname'   => $lastname,
    'street'     => array(
        '0'      => $line1,
        '1'      => $line2,
    )
    'city'       => $city,
    'postcode'   => $postcode,
    'country_id' => 'GB',
    'telephone'  => $tel,
    'parent_id'  => $customer->getId(),
);

if(!$customer->hasAddress($address_details)) {
    //add address
}

I would prefer to steer away from a massive foreach such as:

$customer = Mage::getSingleton('customer/session')->getCustomer();
$hasAddress=false;
foreach ($customer->getAddresses() as $address) {
    if($address->getCity() !== $city) {
        $hasAddress = true;
    }
    //...
}


texts:
I am trying to install Magento 2.2.4 in GoDaddy hosting.

Actually, I have a website on Magento-1.9. So, I have created Beta folder and copied all Magento-2.2.4 files into Beta.

When i tried to install Magento by domain.com/Beta, It redirecting to my domain.com.

But, If we create sample index.php file with welcome to new world text, Its opening.


texts: MySql file per table idb file 65 rows 88GB in size?

texts:
I was hoping someone else may have come across this situation.

I have a table called index_event which is part of Magento 1.9.3 and contains around 65 rows.

Every so often the physical space taken up by the table bloats to around 88GB but no more than 10 rows are added to the table.

Optimizing the table resolves the issue and takes it back down to around 2MB. I am completely stumped and am contemplating exporting the database, purging MySQL, re-installing and re-importing but thought I would see if anyone has come across anything like this before?

Mysql version is 5.5

Thanks in advance, Dave


texts: is it better to retrieve a model once using aliases or doing that several times separately?

texts:
Is it better to use this :-

    $subcat= $_brands = $category = Mage::getModel('catalog/category');

or this :-

        $category = Mage::getModel('catalog/category');
        $subcat = Mage::getModel('catalog/category');
        $_brands = Mage::getModel('catalog/category');


texts: Remove breadcrumbs from categories in content mode

texts:
I want to remove breadcrumbs from category pages but only if the category was in content mode, means its 'Display Mode' was set to 'Static Block Only'.

How do I do that?

[UPDATE]
@Marius solution will get the job done but it will affect other themes as well (which is not my issue. I'll use his approach anyway). But is it possible to add a condition inside an action in catalog.xml file? I tried this with no luck:

<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="root">
        <action method="unsetChild"><name>breadcrumbs</name><call>isContentMode</call><if>1</if></action>
    </reference>
</catalog_category_default>

I copied the code in anchor categories as well. But breadcrumbs disappears in all category pages. I think I don't know exactly how I should use a condition inside <action> tag. Is it possible at all?


texts:
I have a custom admin url, still I saw someone trying to login into admin.

I even changed it, and shortly after the next login was tried.

How could this happen, I thought its secure?


texts: WebP Conversion Tools optional for webp optimized image extension?

texts:
1.Are WebP Conversion Tools like GD, CWEBP OR Imagick needed if I buy the Web Optimized Images Extension, or these tools are optional?

2.In what format I need to continue upload the new images if I purchase an extension: JPG/PNG?

Thank you!


texts: How to create custom order PDF in Magento 2.2

texts: Can anyone help to create custom order PDF template for our drop shipper?


texts: Indexing for large database is taking so much time

texts:
I have imported more than 1M of products for two stores. I am trying to indexing those products but it is taking long time through Admin and SSH. "Catalog URL Rewrites, Product Flat Data, Catalog Search Index" this are taking so much time to complete. Is there is any way that i can perform indexing on those products ?

Thanks in Advance.


texts: Admin: Order View not showing product's ordered attribute

texts:
I want to display more attribute like size|gender|color in Magento Sales-->Order section Below is the code I used to get these details

File Path- /app/design/adminhtml/default/mytheme/template/sales/items/column/name.phtml

Code-

  <?php if ($_item = $this->getItem()):?>

<span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?>

<?php echo $this->helper('sales')->__('SKU') ?>: <?php echo implode('
', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?>

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

        <?php foreach ($this->getOrderOptions() as $_option):
             //print_r($_option);
         ?>

<?php echo $_option['label'] ?>

            <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
                <?php echo $this->getCustomizedOptionValue($_option); ?>
            <?php else: ?>
                <?php $_option = $this->getFormattedOption($_option['value']); ?>
                <?php echo $_option['value']; ?><?php if (isset($_option['remainder']) && $_option['remainder']): ?><span id="<?php echo $_dots = 'dots' . uniqid()?>"> ...<span id="<?php echo $_id = 'id' . uniqid()?>"><?php //echo $_option['remainder'] ?>

                <?php endif; ?>
            <?php endif; ?>

        <?php endforeach; ?>

    <?php endif; ?>
    <?php //echo $this->htmlEscape($_item->getDescription()) ?>
<?php endif; ?>

Here I can get SKU but $this->getOrderOptions() is returns empty array so code below if($this->getOrderOptions()):)  not works. Please help me on this. I have attached image below for more information


texts: Registering new language to solve JS translation

texts:
I have tried to solve translation problem in magento 2.1 how it was shown in thread: Magento2 translating Javascript (KO) template text

Now any page created in magento contains:

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'latviski_lv_lv',
    __DIR__
);<!doctype html>
<html lang="lv-LV">
    <head >
        <script>
    var require = {
        "baseUrl":

Of course also functionality in admin panel is not working anymore. I believe there is some mistake in registration.php shown in that sample.

Is there any possibility to unregister my translation or remoove that faulty code?
Thanks in advance!


texts: How to speed up Magento 2 Website? - What are the effective checklist for it?


texts: Magento2 - Remove item shopping cart with observer

texts:
I have an issue with remove item shopping cart in Magento 2.3.1 with observer.
When I remove item with conditional quality of product == 1 can not Delete, else quality product > 1 or have 2 product I can Delete.
I don't use name events exactly , help me !


texts: After upgrading to Magento 1.9.3+ I get a 404 error when creating configurable product

texts:
When I create a new configurable product this sometimes results in a 404 error after selecting the attributes to use for configuring the product and clicking Next. It doesn't always happen but only with certain attributes and / or attribute sets.

Note: Today I ran into this issue with a customer's installation of Magento 1.9.3.1 and after tracking it down I found out it's due to a change in Magento 1.9.3.0. I will answer this question myself to document the fix for future reference for others.


texts: How to upgrade database field in magento?

texts:
I have try to add new column in magento database. but its not working using mysql4-upgrade-0.1.0-0.1.1 : C:\xampp\htdocs\Surabhi\app\code\local\Surabhi\Employee\sql\employee_setup\mysql4-install-0.1.0-0.1.1.php

<?php
$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn(
    $this->getTable('employee/employee'),//table name

    'address',      //column name
    'varchar(255) NOT NULL'  //datatype definition
    );

$installer->endSetup();

config.xml : C:\xampp\htdocs\Surabhi\app\code\local\Surabhi\Employee\etc\config.xml

   <?xml version="1.0"?>
<config>
  <modules>
    <Surabhi_Employee>
      <version>0.1.2</version>
    </Surabhi_Employee>
  </modules>
  <global>
    <helpers>
      <employee>
        <class>Surabhi_Employee_Helper</class>
      </employee>
    </helpers>
 <blocks>
   <employee>
  <class>Surabhi_Employee_Block</class>
   </employee>
 </blocks>
 <models>
   <employee>
  <class>Surabhi_Employee_Model</class>
  <resourceModel>employee_mysql4</resourceModel>
   </employee>
   <employee_mysql4>
  <class>Surabhi_Employee_Model_Mysql4</class>
  <entities>
     <employeedetail>

employee

     </employeedetail>
        </entities>
   </employee_mysql4>
 </models>
 <resources>
   <employee_setup>
  <setup>
    <module>Surabhi_Employee</module>
  </setup>
  <connection>
    <use>core_setup</use>
  </connection>
   </employee_setup>
   <employee_write>
  <connection>
    <use>core_write</use>
  </connection>
   </employee_write>
   <employee_read>
  <connection>
    <use>core_read</use>
  </connection>
   </employee_read>
 </resources>
  </global>
  <admin>
 <routers>
   <employee>
     <use>admin</use>
  <args>
    <module>Surabhi_Employee</module>
    <frontName>admin_employee</frontName>
  </args>
   </employee>
 </routers>
  </admin>
  <adminhtml>
 <menu>
   <employee module="employee">
  <title>Employee</title>
  <sort_order>100</sort_order>
  <children>
    <employeedetail module="employee">
      <title>Manage Employeedetail</title>
   <sort_order>0</sort_order>
   <action>admin_employee/adminhtml_employeedetail</action>
    </employeedetail>
  </children>
   </employee>
 </menu>
 <acl>
   <resources>
  <all>
    <title>Allow Everything</title>
  </all>
  <admin>
    <children>
   <employee translate="title" module="employee">
     <title>Employee</title>
     <sort_order>1000</sort_order>
     <children>
    <employeedetail translate="title">
   <title>Manage Employeedetail</title>
   <sort_order>0</sort_order>
    </employeedetail>
     </children>
   </employee>
    </children>
  </admin>
   </resources>
 </acl>
 <layout>
   <updates>
  <employee>
    <file>employee.xml</file>
  </employee>
   </updates>
 </layout>
  </adminhtml>
</config>

I have used above code but not working.


texts: magento 2 rating collection by review id?

texts: Magento 2 how to get the data from 'rating_option_vote' by review_id using objectmanager?


texts: How to display MSRP price in product listing page in magento2 through programmatically?

texts: Please help me this task I don't know how to implement this task.The below screenshot is my requirement.


texts:
I have been trying to create a new order attribute in Magento 2, but not successful yet.

I have created a new module and this is already showing.

I added the different codes available in my setup InstallData.php but nothing worked so far.

Anybody who have successfully created an order attribute?

This is one of the code I have tried in InstallSchema.php

<?php
namespace Namespace\Module\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 */
   public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
   {
    $installer = $setup;
    $installer->startSetup();

    $installer->getConnection()->addColumn(
        $installer->getTable('quote'),
        'delivery_eta',
        [
            'type' => 'varchar',
            'nullable' => false,
            'comment' => 'Delivery ETA',
        ]
    );

    $installer->getConnection()->addColumn(
        $installer->getTable('sales_order'),
        'delivery_eta',
        [
            'type' => 'datetime',
            'nullable' => false,
            'comment' => 'Delivery ETA',
        ]
    );

    $setup->endSetup();
   }
}


texts:
I've been having problems with my magento site. It suddenly crashed, and locked me out from even entering admin. I contacted our host to roll back our DB and nothing has changed. I even deleted the tables with the errors as suggested and cleared my local cache and /var/cache/ and still nothing. I have hundreds of products in the DB and don't want to flush them out, how can I fix this?

Error in file: "/home/sppower6/public_html/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'admin_assert' already exists, query was: CREATE TABLE admin_assert ( assert_id int UNSIGNED NOT NULL auto_increment COMMENT 'Assert ID' , assert_type varchar(20) NULL default NULL COMMENT 'Assert Type' , assert_data text NULL COMMENT 'Assert Data' , PRIMARY KEY (assert_id) ) COMMENT='Admin Assert Table' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

Trace: 0 /home/sppower6/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')

1 /home/sppower6/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.1.1')

2 /home/sppower6/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.1.1')

3 /home/sppower6/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()

4 /home/sppower6/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()

5 /home/sppower6/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()

6 /home/sppower6/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)

7 /home/sppower6/public_html/index.php(87): Mage::run('', 'store')

8 {main}


texts: How to get data from my custom (entity) table?

texts:
<?php

$installer = $this;
echo 'Running This Installation: '.get_class($this)."\n
 \n";
$installer->startSetup();

$table = $installer->getConnection()
->newTable($installer->getTable('amber_maintenance_mode'))

->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'identity'  => true,
    'unsigned'  => true,
    'nullable'  => false,
    'primary'   => true,
    ), 'Id')

->addColumn('state', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'State'
    )

->addColumn('created_by', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
    'nullable'  => false,
    ), 'Created by'
    )

->addColumn('start_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => null,
    'comment' => 'Start date'
    ), 'Start Date'
    )

->addColumn('end_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => null,
    'comment' => 'End date'
    ), 'End Date'
    )

->addColumn('down_reason', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
    'nullable'  => false,
    ), 'Down reason'
    );

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

$installer->endSetup();

Now trying to get data from table ....

$date = Mage::getModel('amber/maintenance_mode')->getCollection();
$date = Mage::getModel('amber_maintenance_mode')->getCollection();
$date = Mage::getModel('amber_maintenance/amber_maintenance_mode')->getCollection();

Nothing works ...... what I'm doing wrong ?
Which form is correct if any ?

Here is my config "required section" ;)

        <models>
        <amber_maintenance>
            <class>Amber_Maintenance_Model</class>
            <resourceModel>maintenance_mysql4</resourceModel>
        </amber_maintenance>

        <amber_maintenance_resource>
            <class>Amber_Maintenance_Model_Resource</class>
                <entities>
                    <mode>

amber_maintenance_mode

                    </mode>
                </entities>

        </amber_maintenance_resource>
    </models>

    <resources>
        <maintenance_setup>
            <setup>
                <module>Amber_Maintenance</module>
                <class>Mage_Core_Model_Resource_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </maintenance_setup>
        <maintenance_write>
            <connection>
                <use>core_write</use>
            </connection>
        </maintenance_write>
        <maintenance_read>
            <connection>
                <use>core_read</use>
            </connection>
        </maintenance_read>
    </resources>


texts: magento 1.7 - API - determine if detail is simple, bundle, or component of bundle (Part II)

texts:
follow up to
magento order API determine if product belongs to a bundle

I am extracting new orders in Magento using API. I would like to know how I can tell if this is a simple product, bundle or component of a bundle.

To get details I use soapObject method for 'sales_order.info'

$details = $this->soapObject->call($this->sessionId, 'sales_order.info', $orderId);

Previous answer suggested that I use soapObject method for 'catalog_product' to determine if simple product or bundle... This is good start!

However how can I tell if I am looking at a simple product as a detail or a simple product as a component of a bundled product.  Without a hint such as line number or sequence number I am not sure how to make distinction....

when I dump details, it looks like this:

array(15) {
  ["product_id"]=>
  string(3) "232"
  ["weight"]=>
  string(6) "1.0000"
  ["sku"]=>
  string(12) "BD22"
  ["name"]=>
  string(28) "BUNDLED_PRODUCT22"
  ["qty_ordered"]=>
  string(6) "2.0000"
  ["price"]=>
  string(6) "0.0000"
  ["discount_percent"]=>
  string(6) "0.0000"
  ["discount_amount"]=>
  string(6) "0.0000"
  ["base_discount_amount"]=>
  string(6) "0.0000"
  ["discount_invoiced"]=>
  string(6) "0.0000"
  ["base_discount_invoiced"]=>
  string(6) "0.0000"
  ["tax_percent"]=>
  string(6) "0.0000"
  ["tax_amount"]=>
  string(6) "0.0000"
  ["row_weight"]=>
  string(6) "0.0000"
  ["price_incl_tax"]=>
  string(6) "0.0000"
}


texts: an attribute 'Comparable on Front-end' and 'Used for Sorting in Product Listing' doesn't appear in view

texts:
<?php
   foreach ($_item->getAttributes() as $_attribute):
   if ($_attribute->getIsComparable() == 1 || $_attribute->getUsedForSortBy() == 1):
      //attribute which is enabled both doesn't appears here.
      //Only either of them enabled appears
   endif;
endforeach;

In my code above the problem is, enabling either of them only appears to be true, enabling both doesn't appear into my if condition.


texts: Validation customer address attribute in Backend and Frontend server side

texts:
I should create a server side validation for a customer_address attribute in both the backend and the frontend.

I do not use overwrite the model and the validadateData() method associated to the attribute because being a validation that must also take into account other fields in that method are not passed (correct me if I'm wrong, maybe it's usual in this case to work with the Request)

For the Frontend validation I use the event: customer_address_validation_after

For backend validation, since that event is not triggered but only passes from the single validation of the attributes, I use the predispact event of the validateAction controller used in the backend.

Is it correct as a solution to the requirement? is there a more recommended way?
thanks a lot


texts: Fedex: want to use shipment creation without using in frontend

texts:
In our ecommerce system we want to charge for shipping for order total < INR 1000.00 and other are free. We do not want to have weight/distance based shipping charges.

Also we want to use Fedex shipment creation in the backend. As we shall be using Fedex as carrier.

Can you please suggest who to achieve this?


texts:
Is there a way to export all categories into a csv?

Im moving data from a non-magento store into a fresh build.


texts:
I don't really understand what the flat catalog is?.

Will it change the appearance of my category pages?

My problem is that the product blocks are all squeezed together looking. Once clicked on, they're ok but really ugly on the category page.


texts: Magento 2.2.0 : Add to cart product error unable to unserialize value

texts:
I have create gift card product types and add custom options like this

Choose Amount:Card value
select a design:
compose your email :

   To :

     Recipient Name
     Recipient Email

   Form :

     Sender Name
     Sender Email

Headline:
Message:
Date to send:
Time Zone

I added product into add to cart But, product is not update mini cart and checkout/cart page display error like this :

  Exception #0 (InvalidArgumentException): Unable to unserialize value.
       #0 vendor/magento/module-catalog/Helper/Product/Configuration.php(118): Magento\Framework \Serialize\Serializer\Json->unserialize.

How to solve this type issue?

I tried the answers from "Magento 2.2 error: Unable to unserialize value" but this is not working.


texts: Product View Page Header and Footer part is not Showing In Magento 2

texts: On the website, home page header and footer showing but product page not showing header and footer part. How to fix it?


texts: Magento 2 custom templating/module in combination with composer

texts:
In Magento 2 you can install themes and extensions through composer and they end up in the vendor folder.

What if I want to make customisation to that template/extension?

Do I copy the code over to app/code or app/design or do I create a complete composer package for the custom extension/template based on the original one and push this to a private repo?

But what if we do it on the composer way, how would we go about when the original extension/module receives updates that we install through composer? Any way of maintaining your own extension/template then?


texts: How to sell Mp3/mp4 in Magento without damning the server

texts:
I want  to sell mp3 and Mp4 in Magento but I think it would make make server is quickly full

Any suggestion for this ?

Thanks


texts:
How to get time field on product form I have attached screenshot what i want to do.

any help would be much appreciated.


texts: Search Spell-Correction index is locked by another reindex process. Skipping

texts:
When installing sphinx advanced search i had no problems, everything works. Accept for the reindex part of the installation. It won't reindex because of another reindex process?

When i try: php -f bin/magento indexer:reindex mst_misspell multiple times i sometimes get another message:

php -f bin/magento indexer:reindex terminated by signal SIGSEGV (Address boundary error)'

What is this problem and how can i solve this?


texts: Modifying session.gc_maxlifetime results in front & back-end login loop

texts:
After reading that you should modify the session.gc_maxlifetime value to match1 the settings in:

System → Config → Web → Session Cookie Management → Cookie Lifetime, and
System → Config → Persistent Shopping Cart → Persistence Lifetime (seconds)

I matched all the values to 31536000 seconds (365 days) and had our hosts change the GC value to match this. After the change was made, both front & backend login pages would simply redirect you to the login page after a successful login.

The only way I could resovle this was to revert the GC value back to it's original value (1440).

As soon as it was reverted, the problem was resolved.I could find nothing in the error logs regarding this.

Any ideas?


texts:
how to display list of valid coupon code on cart page in magento 2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $objectManager->create('Magento\Catalog\Model\Session');
        $objectManager->create('Magento\Catalog\Model\Session');
        $CatalogSession = $objectManager->get('\Magento\Catalog\Model\Session');
        $blockObj= $block->getLayout()->createBlock('Vendor\Contact\Block\CustomSession');
        $SalesRule = $objectManager->create('Magento\SalesRule\Model\Rule');
        $getRules = $SalesRule->getCollection();
        $item = $objectManager->create('Magento\Catalog\Model\Product');

        $products = $blockObj->getProducts(); // this will also work using custom session block
foreach ($products as $product) {
        foreach ($getRules as $rule) {
$rules = $SalesRule->load($rule->getId());
$item->setProduct($product);
$validate = $rules->getActions()->validate($product);
            if ($validate == true) {

                echo "coupon -".$rule->getCode()."'>".$rule->getCode()." - ".$rule->getDescription()." coupon";
                 echo "<br>";
                # code...
            }else{
                continue;
            }
        }
     }

Above code is not working.


texts:
I have a module Ggk/Madhav in app/code/local
In that controllers/IndexController.php

<?php
class Ggk_Madhav_IndexController extends Mage_Core_Controller_Front_Action
{
   public function indexAction()
   {
       echo "Hii";
        $this->loadLayout();
        $this->renderLayout();
   }
   public function mamethodeAction()
   {
     echo 'test mamethode';
    }
}

**In etc/config.xml**
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Ggk_Madhav>
            <version>0.1.0</version>
        </Ggk_Madhav>
    </modules>
    <frontend>
        <routers>
            <madhav>
                <use>standard</use>
                <args>
                    <module>Ggk_Madhav</module>
                    <frontName>madhav</frontName>
                </args>
            </madhav>
        </routers>
        <layout>
            <updates>
                <madhav>
                    <file>madhav.xml</file>
                </madhav>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <ggk_madhav>
                <class>Ggk_Madhav_Block</class>
            </ggk_madhav>
        </blocks>
    </global>
</config>

**In Block/home.php**

<?php

class Ggk_Madhav_Block_Home extends Mage_Core_Block_Template
{
     public function methodblock()
     {
         return "informations de mon block !!" ;
     }
}

**In app/design/frontend/ggk/default/layout/madhav.xml**

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <madhav_index_index>
        <reference name="content">
            <block type="madhav/home"  name="madhav" template="ggk_madhav/home.phtml" />
        </reference>
    </madhav_index_index>
</layout>

**In app/design/frontend/ggk/default/template/ggk_madhav/home.phtml**

<?php
echo $this->methodblock();
?>

I am nota ble to render the layout madhav.xml
So please suggest me the solution for not rendering the layout.


texts: Magento2 Restrict particular category product from adding to cart when other is present

texts:
Magento2 I have to add 2 conditions on add to cart
For e.g. There are 3 categories A,B & C

Restrict Category B products to add to cart when category A product is already added & vice verse

If Category B product is added to cart along with Category C product then if Category B product gets deleted or removed from cart then throw error & don't allow category C product to place order. In short C needs to be purchased with B only.

Any advice will be appricated.


texts:
A customer of ours has reported a "bug" that their live site works differently from the staging environment. What they see is that when a user selects "all" products on a category page, then changes categories, the selection reverts to the default number of items per page items on live but stays at "all" products on staging.

What we found was that the live site had Full Page Cache (FPC) enabled and the staging site had it disabled. Once FPC was enabled on staging server, we were able to replicate the issue in that environment. Checking further, this happens on all of our EE sites and I guess I had never tested/noticed it before.

I understand that FPC is storing a version of the page as generated with the default parameters, but, is there any way to generate the non-cached behavior without using a new URL that includes the show parameter?

Thanks