texts: ACL problem on new mass action in product grid 1.9

texts:
In Magento 1.9 I have added a custom mass action in the product grid.
I did it with an observer which adds to the Mage_Adminhtml_Block_Catalog_Product_Grid instance the item for the mass action and including in my custom module this:

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule_catalog before="Mage_Adminhtml">Mymodule_Catalog</mymodule_catalog>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

Then in custom product controller file (ProductController.php) I added the handling of mass action

class Mymodule_Catalog_Catalog_ProductController extends Mage_Adminhtml_Controller_Action {

public function massTypologyAction(){
   ... // here is the logic of mass action
}

Everything works fine for the admin users (users who have all the privilges in the backend). But when I try to execute to the new mass action with another type of users with limited privileges (the users have the privilege to manage products), the system forbid me to execute that action.
How can I tell Magento to allow this operation to users who have the rights to manage products?


texts: Dynamically calculated prices save after add to cart

texts:
We tried to update the product price after addto cart. I done the following code but cant get the item product price.

In app/etc/modules

 <?xml version="1.0"?>
<config>
  <modules>
    <test_Productoptions>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
       <depends>
            <Mage_Checkout />
       </depends>
    </test_Productoptions>
  </modules>
</config>

In app/code/local/test/productoptions/etc

            0.0.1

                Test_Productoptions_Model

        <checkout_cart_product_add_after>
            <observers>
                <priceupdate_observer>
                    <type>singleton</type>
                    <class>test_productoptions/observer</class>
                    <method>updatePrice</method>
                </priceupdate_observer>
            </observers>
        </checkout_cart_product_add_after>
    </events>
</frontend>

I Write the observer in app/code/local/test/productoptions/model

<?php
class Test_Productoptions_Model_Observer
{

    public function _construct()
      {
      }

    public function getNewPrice()
      {
        //Your new functionality here
        //
        $newprice = "";

        return $newprice;
      }

     public function updatePrice( Varien_Event_Observer $observer )
     {

        $quote_item  = $observer->getQuoteItem();
        $product     = $quote_item->getProduct();
        $quantity    = $product->getQty();

       echo $quote_item->getPrice();
      die();

     }
}

In this $quote_item->getPrice() is return null value. How to get the currently added product price from quote.


texts: Check if order line/item was backordered

texts:
I'm checking each order line.

If the line was ordered, I have to do to something. If it was backordered, I will have to do something different. Like this:

private function myFunction($order){
    $orderItems = $order->getAllVisibleItems();

    foreach($orderItems as $item) {
        $product = Mage::getModel('catalog/product')->load($item->getProductId());

        if( $item was ordered )
            foo();
        elseif( $item was backordered )
            bar();

    }

}

I've already tried this post but it doesn't work.

How can I check both scenarios?


texts: Original CSS not loading after adding custom CSS

texts:
My website is not loading CSS of colors and fonts. I'm using a customizable theme but after the day I've added custom CSS like ".brand{ overflow: hidden;} etc".

Does doing this disconnected any original CSS file?


texts:
I am still looking to see if this is possible or if anyone can do the work/extension available?

I have magento 1.9 2.1 If you are logged in as a guest and add an item to your shopping cart the shipping charge does not show up. where if you are logged in it appears.

my shipping is basic as i do not offer multiple shipping options, just spend under a certain amount and pay £* shipping or spend over a certain amount and get FREE shipping.

I was wondering if there is a way that allows any customer to see the shipping charge in there shopping cart before going through the checkout process

Many Thanks


texts: How to get Cookies already set on the browser

texts:
I have cookies already set on the browser, name as cookie_name. And how can I use magento 2 cookies manager. to retrieve the cookie already set on the browser.

<?php

 namespace YourCompany\Module\Plugin;

 use Magento\Framework\Exception\LocalizedException;

class CartPlugin
{

/**
 * @var \Magento\Quote\Model\Quote
 */
protected $quote;

protected $request;
/**
* @var \Magento\Framework\Stdlib\CookieManagerInterface
*/
protected $_cookieManager;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
*/
 static protected $_key = null;
/**
 * Plugin constructor.
 *
 * @param \Magento\Checkout\Model\Session $checkoutSession
 */
public function __construct(
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
) {
    $this->_cookieManager = $cookieManager;
    $this->quote = $checkoutSession->getQuote();
    $this->request = $request;
}

/**
 * beforeAddProduct
 *
 * @param      $subject
 * @param      $productInfo
 * @param null $requestInfo
 *
 * @return array
 * @throws LocalizedException
 */

 public function beforeAddProduct($subject, $productInfo, $requestInfo = null)
{
    $cookieValue = $this->_cookieManager->getCookie('cookie_name');
    var_dump($cookieValue);
    die();
    return [$productInfo, $requestInfo];
}

The  result on browser is given me NULL


texts: Need help in uploading bulk products in magento 1.9.4

texts:
I am running magento 1.9.4.5.

This is the process i run to import my products

I exported the csv which got generated from the products already uploaded
- I modified the same csv and saved it as different name (saved in utf-8 format)

Uploaded the csv to var/import
Uploaded the images to media/catalog/product folder
Here is my csv file https://docs.google.com/spreadsheets/d/1Gy1WijbkVpoIk69XcJLw4mgpB6jmabdxtps0cE2-KwE/edit?usp=sharing
Error is
Image does not exist.

Skip import row, is not valid value "" for field "type"

Skip import row, is not valid value "" for field "type"

Skip import row, is not valid value "" for field "type"

Skip import row, is not valid value "" for field "type"

Please help me to fix the same.


texts: How can I use the Magento UI library to display a link as a button?

texts:
I'm migrating an old module to Magento 2.4 and I would like to use the native classes from the Magento UI library to replace my Bootstrap classes.
What classes should I use to make my links look like buttons? I've read the Magento UI doc (lib/web/css/docs) but I can't figure out which class names I should be using. The original bootstrap style link is here:
Text

I've just found: https://github.com/magento/magento2/blob/2.4/lib/web/css/source/lib/_buttons.less but so far, no luck.


texts:
I'm trying to set up different languages in my shop. I've created a new folder into '/app/design/frontend/MYTHEME/locale/ called it_IT, then I've created a new file called translate.csv and I've placed it in that folder.
So I've created a new store view called "italian" and i set 'it' as code.
Now, when I set 'italian' as language in my store, it not changes. The strange thing is that it seems to change only some strings.
I've already flush the chache.


texts: Pass extra class for stock in Swatch Magento2

texts:
I want to pass an extra class to swatch class which is formed via swatch renderer js based on the stock. The reason is the swatches are not being hidden if they are out of stock. This is what I am trying to do -

$.each($widget.options.jsonConfig.product_information, function () {
                    var item = this;
                    inStock = item.is_in_stock;
                    if(inStock != true){
                        stockClass = 'hideStock';
                    } else{
                        stockClass = 'showStock';
                    }
                });

                attr =+
                    ' id="' + controlId + '-item-' + id + '"' +
                    ' aria-checked="false"' +
                    ' aria-describedby="' + controlId + '"' +
                    ' tabindex="0"' +
                    ' option-type="' + type + '"' +
                    ' option-id="' + id + '"' +
                    ' option-label="' + label + '"' +
                    ' aria-label="' + label + '"' +
                    ' option-tooltip-thumb="' + thumb + '"' +
                    ' option-tooltip-value="' + value + '"' +
                    ' title="' + stockClass + '"' +
                    ' class="' + stockClass + '"' +
                    ' role="option"';

The title is coming in the div, but not class. But the title is not coming correctly too. Its somehow looping twice. or Giving incorrect result.


texts: % OFF WITH FIXED AMOUNT DISCOUNT (FLAT 10% Upto Rs 1000 only)

texts:
I want to make a rule where I offer my customers a discount of:

10% on a specific category, but the max discount amount is fixed to Rs 1000

Can I make this in Magento 1.9 or 2, using one or a couple of rules?


texts:
How to edit the packing slip to not show prices?

The invoice print-out shows the prices so I am not sure why the packing slip needs to.

If you want to enclose one that is a gift for someone, it should not show the price.


texts: How to Add Products to Multiple Categories Programmatically in Magento?

texts: I am using Magento 1.4.0.1. I have over 21000 simple products, each entered into a single category. There are hundreds of categories on my site. Some products belong in multiple categories. Is there some way for me to programmatically add products into multiple categories?


texts:
I try to add a custom js to magento 2 head, but after the jquery.js.
Or is there a way to add the custom js file to the footer?

I have tried in the default.xml but it's over the jquery.js

This is my code in default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <script src="js/myjsfile.js"/>
  </body></page>


texts: Magento 2 Change custom option name with mySql

texts:
I have this line which I can use to update the price of a custom product option.
 UPDATE `catalog_product_option_type_title` a JOIN `catalog_product_option_type_price` b ON a.option_type_id = b.option_type_id SET b.price = 3.99 WHERE a.title = 'Soft Style Unisex T-shirt'

I am trying to change it so that I can change the name of the option now.


texts: How to change block shipping Address to select box ? Magento2

texts:
I want to change format of Shipping Addresses in Checkout page to dropdown.
Anybody here can help me for this case?

https://prnt.sc/kcqtnl


texts:
I'm trying to understand how compilation works in Magento 2 with regards to default mode, developer mode, and production mode.

The docs state that auto compilation is enabled in developer mode, which I assume negates the need to run setup:di:compile? In default mode, I'm not sure how compilation is handled. For production mode, I assume you need to re-run setup:di:compile if changes are made for those to materialize?


texts: Product saleable qty not showing and update in magento 2.3

texts:
where i can update the saleable quantity in magento 2.3 ..the above tab is showing blank.

And how to update saleable quantity programmatic


texts:
In Mage_SalesRule_Model_Validator::process() the code...

if (!$rule->getActions()->validate($item)) {
    continue;
}

...as far as I can tell should be...

if (!$rule->getConditions()->validate($quote)) {
    continue;
}

I have come to this conclusion since I am working on a ShoppingCart Rule addition and the salesrule_validator_process dispatchEvent is not being called when the condition alone is fulfilled, only when both the condition and actions are both fulfilled does the dispatchEvent occur.

Do you feel I am correct about the above? I have a feeling I have made an oversight.

Thanks!


texts: How to manage stock in multi store website in Magento 2?

texts:
I am using Magento 2.1.4

I have created 11 website each with 2 or 3 store view in Magento under same admin.

Now I want to enable "Manage Stock" options only for two websites. but it seems that this option in only visible in "Default Config" not in particular website or store views. Please refer below screenshot

Particular store view:

Particular Website:

Default Config:

When I enabled this option in Default config then it affected all websites and store views but I don't want that. So how can I enable this option only for two websites?


texts: Magento 2 Custom Validation on Address Book (street[1])

texts:
For the checkout screen (custom OneStepCheckout plugin) I managed to succesfully add a custom validation rule on the second street input. Now I'd like to do the same for the default Address Book pages, but I can't seem to figure out where.

The custom rule "housenumber" has been added to the \Magento_Ui\web\js\lib\validation\rules.js files within my custom Theme. Preferably I'd like to use this same rule for validation within the edit page (relative path: /customer/address/edit/id/[XXX]/).

Unfortunately most information seems to be about the checkout page, not for the additional forms where addresses can be edited.


texts:
I would like to rewrite checkout router and have my own controller.

like this mysite.com/checkout/mycontroller/myaction

How can this be possible in magento.

<frontend>
    <routers>
        <checkout>
            <args>
                <modules>
                    <My_Checkout before="Mage_Checkout">My_Checkout_Checkout</My_Checkout>
                </modules>
            </args>
        </checkout>
    </routers>
</frontend>

Which does not work.

What is configuration for this.


texts:
We have noticed that our Magento 2 install combines orders from customers.

This is something we don't want, is this a setting or is this something we can change very easily


texts: Count Number of Associated Products Assigned to a Configurable Product

texts:
Is it possible to get a count of the total number of associated products assigned to a configurable product?

I have tried using the following functions:

getConfigurableAttributesAsArray()
getProductCount()
count()

However, I've only seen this working when applied to categories, not configurable products. While I do want to output the count in list.phtml, I want to output it per product, not for the entire category.


texts:
Magento 2.3.3
I am trying to finish the checkout an my site, I click the next button, the checkout step on top shows Review & Payments, but the content is still the content from step 1 Shipping.
I checked the logs and could not find anything suspicious, any idea how to debug this or what the problem might be?
Thanks!


texts: Disable delivery method for particular products

texts: Is there any option for disable delivery method for selected Products?


texts: Add cross-sell block to product page (complication)

texts:
I found Rajeev K Tomy's answer to this  stackexchange question (Add Cross sell block on product page) very helpful to add a cross-sell block to my product page.

After implementing the solution, however, the cross-sell products on my product page do not load their thumbnail image, title, or price correctly.  Instead, the magento placeholder thumbnail loads, the title is absent, and the price displays $0.00.

Interestingly, clicking on the thumbnail redirects to the proper cross-sell product page and the add-to-cart button also preserves functionality.  Furthermore, if I add the original product to the cart, my shopping cart's cross-sell block displays with the proper images,titles, and prices.

Tracking the problem down to crossell.phtml:

  app/design/frontend/my_package/default/template/checkout/cart/crossell.phtml

Why does some of the php (such as the following from crossell.phtml) not work when it is applied to the product page?

<img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(210); ?>"

<a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?>

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

Any ideas how to resolve this problem?


texts: Bots search for random links in search box

texts:
Recently found that a few times/day links to odd websites that includes Chinese symbols show up in the searched term field in the admin panel

Basically bots automatically insert the link to weird website in the search box and these link show in Admin panel.

links look something like this: XXXXXXXXX17363131312.com
X= random asian symbol.

These links are not executable when searched on site. Any idea what could this be?


texts: 3party jQuery Library is loaded before jQuery

texts:
I have a custom module that does only one thing and that is lazy loading images.
For the lazy loading part, I'm using jQuery Lazy (http://jquery.eisbehr.de/lazy/)

My Problem:
Sometimes the jQuery Lazy loading library is loaded BEFORE jQuery which results in console errors.

Hereunder my code:

requirejs-config.js:

var config = {
   map: {
    '*': {
        jqlazy: 'Fks_Custom/js/jquery.lazy.min',
        }
   },
   shim: {
      jqlazy: {
          deps: ['jquery']
      }
   }
};

Template; lazyload.phtml:

 <script>

 require([
    "jquery",
    'jqlazy'
    ], function($) {

    $(".lazy").Lazy({
        enableThrottle: true,
        throttle: 250
    });

});

</script>

Is there something wrong?


texts:
I'm currently building a Magento Platform where I need to echo out the total sales from individual stores on a page (Like it does on the Dashboard home screen):

I've found some code in:

/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php

class Mage_Adminhtml_Block_Dashboard_Totals extends Mage_Adminhtml_Block_Dashboard_Bar
{
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('dashboard/totalbar.phtml');
    }

    protected function _prepareLayout()
    {
        if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) {
            return $this;
        }
        $isFilter = $this->getRequest()->getParam('store') || $this->getRequest()->getParam('website') || $this->getRequest()->getParam('group');
        $period = $this->getRequest()->getParam('period', '24h');

        /* @var $collection Mage_Reports_Model_Mysql4_Order_Collection */
        $collection = Mage::getResourceModel('reports/order_collection')
            ->addCreateAtPeriodFilter($period)
            ->calculateTotals($isFilter);

        if ($this->getRequest()->getParam('store')) {
            $collection->addFieldToFilter('store_id', $this->getRequest()->getParam('store'));
        } else if ($this->getRequest()->getParam('website')){
            $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
            $collection->addFieldToFilter('store_id', array('in' => $storeIds));
        } else if ($this->getRequest()->getParam('group')){
            $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
            $collection->addFieldToFilter('store_id', array('in' => $storeIds));
        } elseif (!$collection->isLive()) {
            $collection->addFieldToFilter('store_id',
                array('eq' => Mage::app()->getStore(Mage_Core_Model_Store::ADMIN_CODE)->getId())
            );
        }

        $collection->load();

        $totals = $collection->getFirstItem();

        $this->addTotal($this->__('Revenue'), $totals->getRevenue());
        $this->addTotal($this->__('Tax'), $totals->getTax());
        $this->addTotal($this->__('Shipping'), $totals->getShipping());
        $this->addTotal($this->__('Quantity'), $totals->getQuantity()*1, true);
    }
}

To where I think it 'gets' the value but I'm not sure on how I could echo this out somewhere else?

I've also looked over the net to try and find functions close to this, obviously I found a few on how to get the store ID, but nothing on how to get that stores total sales.

Any ideas appreciated greatly.


texts: CE1.9.1.1 - Custom logic injection in login event

texts:
I need to implement a custom requirement on a site I'm updating. This site has multi-store setup with 4 store views and each Store View has a designated Customer Group, therefore when registering in that Store View, customers are automatically added to that Group. I'm now required to ensure that customers can only login to the store view they originally registered in. I already have Account Sharing Options set to Per Website.

URLs represented as an example as follows:

www.mysite.com/agency-abc/customer/account/login/

www.mysite.com/agency-xyz/customer/account/login/

So my idea is to tap into the controller_action_predispatch_customer_account_loginPost event and check for the customer's GroupId against the settings for the store. I wired up the observer (which I know is being triggered) as a test as follows:

config.xml

<frontend>
    <events>
        <controller_action_predispatch_customer_account_loginPost>
            <observers>
                <logincheck>
                    <class>logincheck/observer</class>
                    <method>loginCheck</method>
                </logincheck>
            </observers>
        </controller_action_predispatch_customer_account_loginPost>
    </events>
</frontend>

Model/Observer.php (disclaimer: code borrowed from another post here on stackexchange)

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

        // **** hard-coding groupid as a test
        if ($customer->getGroupId() == 8)
        {
            $session->setId(null)
                ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)
                ->getCookie()->delete('customer');

            Mage::throwException('You are not allowed to login to this store.');
            return;
        }

        //die("observed");
    }
}

Unfortunately, I get the following error:

  Fatal error: Call to a member function getGroupId() on a non-object in ...Model/Observer.php on line 16

I'm unsure whether this is the correct event to use and/or whether I am attempting to access the customer data incorrectly.

Would sincerely appreciate any help!

*EDIT BASED ON QAISAR'S ANSWER BELOW

Model/Observer.php

class Kalldis_LoginCheck_Model_Observer
{
    public function loginCheck(Varien_Event_Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $session = Mage::getSingleton('customer/session');
        $storeId = Mage::app()->getStore()->getId();

        if ($customer->getStoreId() !== $storeId)
        {
            $session->setId(null)
                ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)
                ->getCookie()->delete('customer');

            Mage::throwException('You are not allowed to login to this store.');
            return;
        }
    }
}


texts: Magento 2 How to get custom category attribute on frontend

texts:
I have created a new category attribute using a setup script and now it is showing on the backend and assigned values (it is just a boolean attribute). the attribute name on EAV entity table is is_home_category .And now I'm trying to get its values on frontend

$categories = $this->getStoreCategories(true, true, true);

foreach ($categories as $category):
   echo $category->getIsHomeCategory()
endforeach;

But it returns nothing , could someone help me


texts: M2.3 - How to set Catalog -> Categories -> Content -> Description cms block based on shop by attributes selection programmatically?

texts: I want to set the category description cms block based on the shop by attributes selection on product listing page,


texts:
I am using file uploading for image upload in magento.

If customer giving order and upload image for engrave product where can i get image which uploaded by customer. or how can i able to print or download it ?


texts: Get best selling or hot selling products list

texts:
I am new to PHP. I am trying to get best selling products list using the code which I found in Mage_Adminhtml_Block_Dashboard_Tab_Products_Ordered class from _prepareCollection method.

if ($this->getParam('website')) {
        $storeIds = Mage::app()->getWebsite($this->getParam('website'))->getStoreIds();
        $storeId = array_pop($storeIds);
    } else if ($this->getParam('group')) {
        $storeIds = Mage::app()->getGroup($this->getParam('group'))->getStoreIds();
        $storeId = array_pop($storeIds);
    } else {
        $storeId = (int)$this->getParam('store');
    }

    $_productCollection = Mage::getResourceModel('sales/report_bestsellers_collection')
        ->setModel('catalog/product')
    ;
?>

But I can't get the best selling products list. I am getting something else(very big dump text) when I checked using

<?php echo Zend_Debug::dump($_productCollection); ?>

PS: $_productCollection is a variable which I suppose to store a array of products so that I can use it in foreach loop later.


texts: Getting issue to override block function getCarriers() in magento 2

texts:
I am overriding block Magento\Shipping\Block\Adminhtml\Order\Tracking function name getCarriers().
I want to show custom carrier trackers in dropdown when generate shipment or view shipment.
If I am adding my code inside vendor file then it is working fine for both but if I am overriding the file using preference then only it is working for shipment create page. It is not showing on view shipment page.
Here is my code:
di.xml
OM/Carrier/etc/di.xml
 <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Magento\Shipping\Block\Adminhtml\Order\Tracking" type="OM\Carrier\Block\Adminhtml\Order\Tracking" />
    </config>

Tracking.php
OM/Carrier/Block/Adminhtml/Order/Tracking.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace OM\Carrier\Block\Adminhtml\Order;

/**
 * Shipment tracking control form
 *
 * @api
 * @since 100.0.2
 */
class Tracking extends \Magento\Shipping\Block\Adminhtml\Order\Tracking
{
   /**
     * Retrieve carriers
     *
     * @return array
     */
    public function getCarriers()
    {
        $carriers = [];
        $carrierInstances = $this->_getCarriersInstances();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $collection = $objectManager->create('OM\Carrier\Model\Customcarrier')->getCollection()->addFieldToFilter('status', ['eq' => "1"]);
        $carriers['custom'] = __('Custom Value');
        foreach ($collection as $value) {
            $carriers[$value->getCarrierCode()] = $value->getTitle();
        }
        foreach ($carrierInstances as $code => $carrier) {
            if ($carrier->isTrackingAvailable()) {
                $carriers[$code] = $carrier->getConfigData('title');
            }
        }
        return $carriers;
    }
 }


texts: How to add parent_item_id to Magento Soap API response?

texts:
I need to pull the parent_item_id for order items when calling salesOrderInfo() in soap.

I made below changes to wsdl.xml and wsi.xml under salesOrderItemEntity in Mage/Sales/etc/.

Wsdl.xml

  <element name="parent_item_id" type="xsd:string" minOccurs="0" />

Wsi.xml

  <xsd:element name="parent_item_id" type="xsd:string" minOccurs="0" />

Also I have cleared the magento cache and wsdl cache in /tmp

Any help would be appreciated.


texts:
I am new to magento 2 and i have tried to get the store id.
Here is my code simplifyed:

class Mage{
   private static $_objectManger;
   public  function __construct(
      \Magento\Framework\ObjectManagerInterface $objectmanager
   )
   {
      self::$_objectManager = $objectmanager;
   }
   public static function  getStore(){
      return self::$_objectManger->get("\Magento\Store\Model\StoreManagerInterface");
   }
}

And in my .phtml file i try to call it like this:

$store_id= Mage::getStore()->getStoreId();
echo $store_id;

and i get this error message exactly at this line:

return self::$_objectManger->get("\Magento\Store\Model\StoreManagerInterface");

So why does this doesnt work?


texts: Magento does not create custom redirects for old urls

texts: We experience a problem with creating custom redirects for old urls. If we update the URL key of a product the old URL stops working (404), although the checkbox "Create Custom Redirect for old URL" is checked (right below URL key). Its Magento ver. 1.13.0.2. Any clue what could cause the issue? I'm running out of ideas unfortunately. Thanks for any tip!


texts: Magento 2 : How to check if we are on a category page or product page?

texts:
Is there a way I can check that If a user on a category page,or an individual product page in Magento 2?

Any help would be greatly appreciated!


texts:
So I am constructing an import array with details and using AvS_FastSimpleImport to do the importing work. Here is the relevant code:

$fileName = Mage::getBaseDir()."/".Mage::getStoreConfig(C4B_XmlImport_Model_Catalog_Importer::XML_PATH_IMAGE_IMPORT_DIRECTORY).$imageName;
            if (file_exists($fileName)) {
                $addImage = $defaultImportEntry;
                $addImage['sku'] = '';
                $addImage['_media_image'] = $imageName;
                $addImage['_media_attribute_id'] = Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId();
                $addImage['_media_is_disabled'] = 0;
                $addImage['_media_position'] = $imgCounter;
                $addImage['_media_lable'] = $imageName;
                if(!$isAssociatedProduct && $currentNumber == 1) {
                    $addImage['image'] = $fileName;
                    $addImage['small_image'] = $fileName;
                    $addImage['thumbnail'] = $fileName;
                    }
            }

The second if statement is entered only for specific images (as you can see). On these images I want the radio buttons of Base Image, Small Image, and Thumbnail to be set, but apparently it doesn't work.

Here's a tutorial document I was reading: http://www.integer-net.de/download/ImportExport_EN.pdf


texts: what is the Maximum number of concurrent users can browse in Magento 2 during

texts: In a flash sale, what is the Maximum number of concurrent users that can browse in a Magento 2 instance


texts: Fatal error: Class 'Zend_Log' not found in Checkout

texts:
My checkout page is giving me this error:

Fatal error: Class 'Zend_Log' not found in /home/internat/public_html/app/code/core/Mage/Checkout/Block/Onepage.php on line 98

What could be the problem? The error line is just the last line.

public function getAddressesHtmlSelect($address, $type)
{
    if ($this->isCustomerLoggedIn()) {
        $options = array();
        foreach ($this->getCustomer()->getAddresses() as $a) {
            $options[] = array(
                'value'=>$a->getId(),
                'label'=>$a->getStreet(-1).', '.$a->getCity().', '.$a->getRegion().' '.$a->getPostcode(),
            );
        }

        $addressId = $address->getId();
        if (empty($addressId)) {
            if ($type=='billing') {
                $address = $this->getCustomer()->getPrimaryBillingAddress();
            } else {
                $address = $this->getCustomer()->getPrimaryShippingAddress();
            }
            if ($address) {
                $addressId = $address->getId();
            }
        }

        $select = $this->getLayout()->createBlock('core/html_select')
            ->setName($type.'_address_id')
            ->setId($type.'-address-select')
            ->setExtraParams('onchange="'.$type.'.newAddress(!this.value)"')
            ->setValue($addressId)
            ->setOptions($options);

        $select->addOption('', 'New Address');

        return $select->getHtml();
    }
    return '';
}


texts: Magento2 how to create a dependent product

texts:
Magneto2 How can I create dependent simple products?
First, parent simple product is added to cart & then the second simple product is added to cart.
If first is removed then display an error message.
How can I achieve this functionality?


texts: Magetno 2 : How to create ui_component admin form?

texts:
How to create ui_component admin form ??

I've checked this but as usual its not working so far.


texts: how to set payment method based on country in magento?

texts: i am creating a webservice . so i want to set payment method for magento v1.9 based on country details and cash on delivery(cod) for particular products and particular country in magento . how to set programmatically?


texts: How to write a unit test for an admin controller?

texts:
How can I test the content of my controller via a unit test?

The controller has an execute-function. If my content phtml file contains "Hello World" or a page title "My Title" is configured in the xml file, my understanding is that I could write a unit test which checks that by a simple string comparison:

    public function execute()
    {
        return  $resultPage = $this->resultPageFactory->create();
    }

Now ... I do not know how to figure out how to get the html content or title out of the $resultPage element, and I also do not know how I can write a test function for this. Any ideas?


texts:
I want to change the product image Zoom on mouse hover on product page.
<var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width"></var> <!-- Width of magnifier block -->
            <var name="height"></var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>

I am using above code but it's not working.


texts: Magento 2 admin catalog save button not working

texts:
yesterday I have imported some products in my store, today when I was trying to do some changes in product edit functionality is not working.
Even the Save button is not clickable

I checked logs no exception, nothing in logs.

It's working for all the other products except the imported products


texts: Magento 1.9.3.9 throwing error when trying to change customer password from backend administrator

texts:
Only when trying to change a customer's password from admin, I get this error...

Fatal error: Uncaught Error: Call to a member function getBackend() on boolean in /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php:1553 Stack trace:

#0 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Customer/Model/Resource/Customer.php(240): Mage_Eav_Model_Entity_Abstract->saveAttribute(Object(Magestore_Onestepcheckout_Model_Customer_Customer), 'password_create...')

#1 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Customer/Model/Customer.php(239): Mage_Customer_Model_Resource_Customer->changePassword(Object(Magestore_Onestepcheckout_Model_Customer_Customer), '@3_VZHAf')

#2 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(367): Mage_Customer_Model_Customer->changePassword('@3_VZHAf')

#3 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_CustomerController->saveAction()

#4 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Core/Controll in /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1553

I have no custom attributes so not sure why its trying to save attributes when I'm just trying to update the customer's password... if I update anything else it works fine.

The front end is doing the same thing...
Error from forgot your password on the front end...

Fatal error: Uncaught Error: Call to a member function getBackend() on boolean in /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php:1553 Stack trace: #0 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Customer/Model/Resource/Customer.php(353): Mage_Eav_Model_Entity_Abstract->saveAttribute(Object(Magestore_Onestepcheckout_Model_Customer_Customer), 'rp_customer_id') #1 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Customer/Model/Customer.php(1412): Mage_Customer_Model_Resource_Customer->changeResetPasswordLinkCustomerId(Object(Magestore_Onestepcheckout_Model_Customer_Customer), 'ad706d238638a20...') #2 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Customer/controllers/AccountController.php(765): Mage_Customer_Model_Customer->changeResetPasswordLinkCustomerId('ad706d238638a20...') #3 /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Customer_AccountController->forgotPasswordPostAction() #4 /var/ww in /var/www/vhosts/impulsecbd.com/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1553


texts: After upgrade static content is set with out pub/

texts:
<html lang="en">
    <head >
        <script>
    var BASE_URL = 'http://mage.test/';
    var require = {
        "baseUrl": "http://mage.test/static/version1561748846/frontend/Brent/default/en_US"
    };

My base URL on the prod site looks like this

/pub/static/version1561138892/frontend/Brent/default/en_US

I am not sure where the Base URL is stuck?

My doc root is set here

/Users/brent/sites/mage

I can reference a file to /Users/brent/sites/mage/info.php


texts: Is it possible to add a block at the middle of the products listing , in magento 2?

texts: I'm using Magento 2 , and I would like to add a block at the middle of the products listing , on the category page , I've tryed to add the block in the Main Content Container , but it puts the block at the bottom of the listing..


texts: 1.9.0.1 to 1.9.1 upgrade using generated patchfile

texts:
I'm trying to upgrade existing Magento store from 1.9.0.1 to 1.9.1 using git patchfile, generated by git format-patch HEAD^, executed in my "Magento history" repo, where the only commits are Magento releases. So, I've created a patchfile which looks like follows:

From --- blah blah blah ---
From: --- blah blah blah ---
Date: Thu, 12 Feb 2015 14:37:28 +0100
Subject: [PATCH] 1.9.1.0

---
 .htaccess.sample                                   |   178 +
 app/Mage.php                                       |     4 +-
 .../community/Phoenix/Moneybookers/Model/Event.php |    10 +-
 app/code/core/Mage/Admin/Helper/Data.php           |     8 +-
...
...
...
diff --git a/app/code/core/Mage/Admin/Helper/Data.php b/app/code/core/Mage/Admin/Helper/Data.php
index b7d7673..a118336 100644
--- a/app/code/core/Mage/Admin/Helper/Data.php
+++ b/app/code/core/Mage/Admin/Helper/Data.php
@@ -10,18 +10,18 @@
  * http://opensource.org/licenses/osl-3.0.php
  * If you did not receive a copy of the license and are unable to
  * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
+ * to license@magento.com so we can send you a copy immediately.
  *
  * DISCLAIMER
  *
  * Do not edit or add to this file if you wish to upgrade Magento to newer
  * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
+ * needs please refer to http://www.magento.com for more information.
  *
  * @category    Mage
  * @package     Mage_Admin
- * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ * @copyright  Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
+ * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */

 /**

Nothing special here at all: when applying the patch, e-mail address and URL in the file comment should be changed. Well, it's not. git apply is unable to patch this and any other file, because... "patch failed".
When I execute git apply --reject the explanation I get is:

error: while searching for:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Adminhtml
 * @copyright  Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

Well, it's a bunch of nonsense, because that's exactly what's in this file.

Does anyone have any idea, what might be the problem here and why does Git complain here?


texts: How to add custom customer attribute in custom tab in customer edit page of admin in magento2

texts:
I have created custom customer attribute successfully. Which are showing under account information tab of customer edit in admin.

I want to show them in my custom tab.


texts: Permanent solution for the common indexing issue

texts:
We have developed some magento project with large inventory record and always face the indexing issue we have tried every thing found on the internet for solving day-to-day indexing issue like truncating the flat tables and re-index using CLI, setting the cron for indexing but this is our day-to-day headache facing with indexing issue.

We are looking for Permanent solution for this problem while we work on projects there are different scenarios like updating the products on daily basis or importing the products from some other feed daily.

Anyone having some best practices with this or some workaround please share them that will be much appreciated.


texts: I've to limit the blog section from showing the whole description on homepage, how can i add a read more section in blog, i've used magefan blog extension, also please suggest in which file do i've to make changes.


texts: Magento 2 : Catalog Price Rule Based On Time Period

texts:
I have come across a requirement where my client wants to provide a discount on specific products which is based on time period. Below is the condition.

Discount Start - Every day after 22:00 Hrs
Discount Ends - Next day    on 06:00 Hrs

How I can achieve this in magento2?

Please help. Thanks in advance.


texts:
If I add in checkout inside the component's template something like this:

with a console.log('myFunction executed') in component's function 'myFunction',
than it will log the message on page refresh.

I'm trying this on Magento 2.2.6.

This should not happen. Anyone knows why it does ?

I don't have other code that will trigger click event.
I got this in onother component too. It seems like every click binding is executed on initialize or something.

Change bindings are not called on page refresh, just 'click'.


texts: Google Experiments breaking Account Signup

texts:
We have an A/B test with Google Experiments on our homepage - http://www.theirishstore.com/

However, if you try going to the account page, and then try to create a new account by clicking on the link, the Experiment code redirects you to: https://www.theirishstore.com/customer/account/create/?utm_expid=37348836-3.Pt5YYdmpRwGED_uioyf7Ew.0&utm_referrer=https%3A%2F%2Fwww.theirishstore.com%2Fcustomer%2Faccount%2Flogin%2F

Does anyone have a solution for stopping Google Experiment code from interfering on pages that are NOT the homepage?


texts: Mail gun is required for sending transaction emails in magento?

texts:
My client asked to integrate mailgun in magento.But I'm confident that magento is enough to send all mails with out any issue?

Is there any extra advantage is there with mailgun over magento default transcation emails?


texts:
We are developing a Mobile App with Magento 2.3.4 back-end. We have installed Mirasvit elastic search. Here is the category and product structure of our website.

We have 2 root categories in Magento as shown in above image
Website-1 is mapped to Default Root Category
Products are assigned with category as shown in the image
For all products, under “Product in websites”, selected Website-1
Want to restrict search to “Dafault Root Category”. i.e., Product-5 to Product-8 should not be listed.

Here are some details why we want to restrict search - We want to get all attribute filters for products under "Custom Root Category". We found that without setting "Visibility" to "Catalog, Search", we cannot get the filters. But, with above visibility settings, Product-5 to Product-8 are visible in website search, which we do not want. Any suggestion, which settings / API should be modified to limit the search to "Default Root Category" ?


texts: How to understand magento 2 profiler output?

texts: I've just enabled profiler on my M2 site (csvfile output). But I can't understand its content. Is there any software that could make the output data more understandable?


texts: Controller used to handle tracking numbers on order shipments

texts:
I can't seem to find the controller responsible for the handling of tracking numbers on order shipments (in the admin). I have an issue where entering a tracking number, then hit Save (supposedly creating a shipment) ends with a 404.

So I wanted to trace where the problem could happen. What I've tried is to die; in the saveAction() of app\code\core\Mage\Adminhtml\controllers\Sales\Order\ShipmentController.php. Unfortunately, it looks like the action is never called because I still get my 404, and no shipment is created.

Does someone have the knowledge of what is wrong with that or where exactly the tracking number handling is supposed to happen?


texts: Assign product to parent and subcategories programatically issue

texts:
This is how category tree look likes:
rootCat
   -> brand (id = 2)
        ->type1 (id = 3)
            ->1990 (id = 4)
            ->1991 (id = 5)
        ->type2 (id = 6)
            ->1990 (id = 7)
            ->2010 (id = 8)
        ->type3 (id = 9)
            ->1995 (id = 10)
            ->2011 (id = 11)
            ->2012 (id = 12)
.....

and this is my code:
for ($i = 0; $i < count($skus); $i++) {
    $myproduct = $this->productRepository->get($sku[$i]);

    $subcategory = {the years} // example 4,5,7,8,10,11,12

    $finalCats = array_unique(array_merge($myProduct->getCategoryIds(), $this->getCategoriesId($subCategory)));

    $this->assignProduct($skus[$i], $finalCats);
}

public function getCategoriesId($subCategory)
{
    $categoryIds = [];
    foreach ($subCategory->getParentCategories() as $parentCategory) {
        if ((string) $parentCategory->getName() !== 'rootCat') { //ignore root category
            array_push($categoryIds, $parentCategory->getId());
        }
    }
    return $categoryIds;
}

public function assignProduct(string $sku, array $categoryIds)
{
     /** @var Magento\Catalog\Api\CategoryLinkManagementInterface */
    $this->catLinkManagement->assignProductToCategories($sku, $categoryIds);
}

What i want to achieve is to assign a product to all categories, except the root one (rootCat). Also a product can belong to multiple 'years'. Example SKU 1 can belong to both brand->type1->1990 and brand->type1->1991.
The script is working, but sometimes i am running into this error message:
The category doesn't contain the specified product.

then I rerun the code and it works , until i get for another product that error message. Any idea why ? or what am i doing wrong ? Thnx!


texts: Magento 2.2.6 - grouped product's associated product assign issue while having custom options in admin

texts:
I have a problem in assigning the associated products of it's group product in admin area of magento 2.2.6. while having the custom options.

when i add the simple products but not display in the grid , please let me know if any perfect solution you have.

Thanks in advanced


texts: I want to create admin grid using ui component . if you have any article or blog then please share

texts:
Issue:

I am trying to create admin grid in Magento 2 but I stuck. If you have created admin grid using UI Component Then Please Share With me.

Thank you


texts:
How to create shipment programmatically in magento 2 via script
I have order id & i want to generate shipment
can someone provide direct script to run from root folder


texts: Where to locate requirejs-config.js on the home page of my Magento 2 site which uses a custom third party theme?

texts: I wonder why Network tab in Browser Developers Tool Panel doesn't show requirejs-config.js at the top along with mixins.js, require.js. I am using a custom third party theme. When using Magento Luma theme, I can see all these where I expect them to be. Please share your thoughts on this.


texts:
I used exec() function to run the magento commands.
As exec() is not recommended used the below code .
class Test{
 protected $_shell;
 public function __construct(
    \Magento\Framework\ShellInterface $shell
){
    $this->_shell = $shell;
}
public function execute() {
    $this->_shell->execute("php bin/magento cache:disable");
}

The above code not working as expected, can someone help me with the above requirement.
I am looking for running the cli commands without using SSH.
Thanks!!


texts:
I want to manipulate localstorage and add or remove items from cart, the problem is with backend everything works from the frontend but when i go to the checkout page i see all the items that i removed from localstorage.
Do you guys have any idea?
thanks in advance


texts: Why does Magento 2 does not support store based price?

texts:
I need the price of product store wise, but by default Magento 2 not support that.

Can anyone suggest me without extension solution, rather code based solution?


texts: Magento 2.3.3 Error Failed address validation: %1

texts:
Using Paypal , after placing an order customer is directed to paypal , inputs the email  CC information and etc and is directed back to magento where they choose shipping and then click on place order.
I am getting this error:
Failed address validation %1
In the system log : Failed address validation, Email has a wrong format
However Email is valid with Paypal email address.
Any help would be appreciated.
The full error is:

main.CRITICAL: Exception message: Failed address validation: Email has
a wrong format
Trace:
1 Magento\Quote\Model\QuoteManagement->submitQuote()
called at [vendor/magento/module-quote/Model/QuoteManagement.php:447]
2 Magento\Quote\Model\QuoteManagement->submit() called at [vendor/magento/module-paypal/Model/Express/Checkout.php:807]

Any help would be appreciated
Thanks


texts:
I have seen previous questions relating to this but none have helped so far. My store currently displays 3 products per row and a sidebar and I want to change that to four without the sidebar.

I changed the page layout to 1 column within admin, which removed the sidebar but I can't get the grid to display 4 products.

I've tried modifying catalog.xml by adding the  <action method="setColumnCount"><count>4</count></action> within both product_list nodes and then clearing cache but nothing changed.

The HTML is outputting:

How can I change this to four? If changing the catalog.xml doesn't work what may that suggest? We were given this store by other developers, so I'm not sure if something is being overriden.


texts: How to use session data in view (phtml) magento 2

texts:
i can access session data in my controller using \Magento\Framework\Session\SessionManagerInterface

 public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        \Magento\Framework\Session\SessionManagerInterface $session
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        $this->session = $session;
        parent::__construct($context);
    }

// assign session
    then assess $this->session->setMessage("message") ;

In controller it is working . i need to retrieve session in view . how to i get that. $this->session->getMessage() is not working in view
I need to check session values in phtml.
How to get session variable in magento.


texts: Magento 2.3.X - custom module UI components not loading

texts:
The UI XML file:

app/code/NewShop/NewModule/view/frontend/layout/checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <referenceContainer name="checkout.cart.container">
      <block class="NewShop\NewModule\Block\Cart\Ui" name="newshop-newmodule-cart-ui" template="NewShop_NewModule::cart/ui.phtml" after="checkout.cart.form">
        <arguments>
          <argument name="jsLayout" xsi:type="array">
            <item name="components" xsi:type="array">
              <item name="ui" xsi:type="array">
                <item name="component" xsi:type="string">NewShop_NewModule/js/cart</item>
                <item name="config" xsi:type="array">
                  <item name="template" xsi:type="string">NewShop_NewModule/checkout/cart</item>
                </item>
              </item>
            </item>
          </argument>
        </arguments>
      </block>
    </referenceContainer>
  </body>
</page>

These are the files I'm attempting to load:

app/code/NewShop/NewModule/view/frontend/web/js/cart.js
app/code/NewShop/NewModule/view/frontend/web/template/checkout/cart.html

But I get this error in browser console:
[ERROR] Failed to load the "NewShop_NewModule/js/cart" component.
console-output-handler.js:34

My Questions are:

Is there anything wrong in the XML code?
Is Magento 2.3 different from Magento 2.1 on how it loads the UI components?


texts: Magento 2.1 - Built-in Cache vs. Varnish Cache for Full Page Cache

texts:
What is the difference between the Built-in Cache and Varnish Cache for Full Page Cache?

What options do I have to choose? Why does Magento recommend Varnish?


texts: Update select attribute in custom_attributes via catalogProductRepositoryV1 API PUT request

texts:
I'm trying to update a product with the catalogProductRepositoryV1.
I want to change a custom select attribute for the given product. When sending the following request:

{
  "product": {
        "custom_attributes": [
            {
                "attribute_code": "color_armrest",
                "value": "Akoya"
            }
        ]
    }
}

I get the following error:

{
  "message": "Error occurred during \"custom_attributes\" processing. Attribute \"color_armrest\" has invalid value. The \"Akoya\" value's type is invalid. The \"int\" type was expected. Verify and try again.",
  "trace": null
}

I understand I'm supposed to insert the attributes option_id here and not the label, but how do I get it? Do I really need to use the catalogProductAttributeOptionManagementV1 to fetch all attribute options and filter the id and then pass it to the product put request?

Regards


texts: Why Customer Session is not working on full page cache?

texts:
This is my code below

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager-create('Magento\Customer\Model\Session');

   if ($customerSession->isLoggedIn())

   {

       $customerSession->getCustomerId();  // get Customer Id
        $customerSession->getCustomerGroupId();
        $customerSession->getCustomer();
        $customerSession->getCustomerData();

   }

I'm facing a problem when full page cache is enable on disable it's working fine.


texts:
I have upgraded my Magento 2.3.3, after the upgrade I do not receive a newsletter email where I can see the code of email how I can debug to find the root cause of email not sending.

Other emails are working fine just when a person put their email in newsletter text box email not coming.


texts: why Thousands of sessions are creating in one hour

texts:
we want to know how many session files are creating in session folder.

we are running this command from root directory of magento

ls -l | wc -l

when we run this command, we can see

thousands of sessions files are creating.

this is live site with less number of users visiting the site.

we also have mobile app for our site.

we want to know why this much sessions are creating.

almost 40,000 sessions are created until now lastin one hour.


texts: Magento 2 : How to Set Maximum Purchase Order Amount

texts:
My client want to set Maximum purchase order amount in magento2? and they need options like Minimum purchase order amount in admin.

can anyone please help..


texts: Expand / Collapse Product description tabs

texts:
I want to implement dynamism i-e expand/collapse in product description tabs at mobile view as shown in the figure.

I want if somebody click on the details tab it should expand and collapse at mobile view


texts: Set input value with billing address prefix in html file

texts:
In html file, i could show the billing address prefix with text: currentBillingAddress().prefix. But when i tried to give data-bind to input, it become <input type="hidden" id="test2" data-bind="text: currentBillingAddress().prefix"/>Prefix</input>.

How can i set the value of input to billing address prefix? I already tried <input type="hidden" id="test2" input="text: currentBillingAddress().prefix"/> but it's not work.


texts: Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read Magento System Requirements

texts:
I'm getting this error after uploading to webserver.

I have PHP 5.5.33 which it clearly says should work on the requirements page it links to... and I just spent the last 8 hours waiting for the whole package to upload.

Any idea what's going on? I'm using the community version.


texts: Magento 2 :Get Customer Zip from Checkout Shipping Step

texts:
I have a custom module with a custom section in Checkout Payment Step.

I want to display the xip code of the customer in the custom section ( both customer logged in and logged out case).

I have used the below code

if ($this->customerSession->isLoggedIn()) {
    if ($customer) {
        $billingAddress = $customer->getDefaultBillingAddress();
        if ($billingAddress) {
            return $billingAddress->getPostcode();
        }
    }
} else {
    $postCode = $this->checkoutsession->getQuote()->getShippingAddress()->getPostcode();
    return $postCode;
}

But in the logged out case, not getting the zip code in the payment step. When I refresh the page, it displays.

Please help.


texts: How to modify data to be outputted in manifest.json from yarn build in pwa studio?

texts:
I am new to PWA studio and Magento, so please bear with my question because I am a bit confused.
I already generated a custom PWA project in the PWA studio. However, when I performed the yarn build, the outputted manifest.json in artifacts (dist folder) contains Venia information like name, icons and etc. I want to modify the output instead of Venia info.
Is there a way of modifying it aside from manually overriding it? How?


texts: Cannot use object of type stdClass as array Soap API

texts:
This is my first time trying to pull information with the Magento soap API. I have used SOAP previously on the Orange M2M connect server.

Ive hit a stump and im not sure where to go from here. I have managed to pull salesOrderList from Magento and var_dump them, and all the data is there. But when i try to access say the increment_id using the method below i get this error:

  Cannot use object of type stdClass as array in C:\xampp\htdocs\magento_soap_client\fulfilment\soap\class.orders.php

Code used to try and get the increment id:

$this->m_orders = $this->client->salesOrderList($this->sessionID);

foreach($this->m_orders as $o){
            var_dump($o['increment_id']);
        }

Why am i getting this error?

I haven't parsed the data through an XML Parser yet, do i need to before accessing the information? The reason i ask is because this is what i had to do when working with the orange m2m connect soap server.

Thanks


texts:
Magento 2 PWA
I am new to Magento 2 PWA. I have a site that needs to developed & design as per provided screens of all pages.
While I was going through the Magento 2 PWA. I got 3 options.
There are three options of Magento PWA integration

Install Magento 2 PWA Extensions
PWA Using Magento 2 PWA Studio
Convert Site To PWA Using Magento 2 PWA Theme

Can anyone guide me or suggest me which option I should go with?
JUST FYI: The client has provided me with mobile design screens as well.
Any suggestions will be appreciated.


texts:
Magento / Magento 2 by default has Keyword based search - which bring in search results from all the attributes marked as searchable, and Advance Search, where in we can search in multiple attributes using exact values.

I need a help to create a different module in Magento 2. I want to search multiple keywords in single attribute.

For Eg : I enter comma separated values in Search Box, which brings back search results searching the values from Product Name. Eg : rice, wheat, bread, milk and i get the results of above all 4 keywords matching it with product name or any particular searchable keyword.

I was able to do the same using calling the product collection and customizing a new module. But doing in this manner, while we enable Elastic Search or Solr on the store the results still come from Mysql. Hence i want to call the actual Search Model so that i get the results from Elastic Search or Solr.

Any idea on how to create this module ?


texts:
Im looking at adding a simple label to show up on products when group pricing is connected to a product (user is logged in). Something as simple as this (https://www.ubertheme.com/docs/add-product-labels/) but i want it to automatically show up.

Any help would be great.
Thanks


texts: Magento 2: Customer Import CSV "The file was not uploaded."

texts:
I'm getting an unusual error on my server. It's working fine in Local & on a server able to Import Product CSV.

For Customer only I'm getting this error. I have tried with my local WAMP Customer CSV, still same error.


texts: addAttributeToFilter with dropdown not filtering result

texts:
I have attribute named addAttributeToFilter with two drop-down values:  "yes", "no"

public function getDefaultRecommendation() {
    $collection = Mage::getResourceModel('catalog/product_collection');
    $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
    $collection->addStoreFilter()->addAttributeToFilter('default_recommendation', 1);
    Mage::getModel('catalog/layer')->prepareProductCollection($collection);
    return $collection;
}

It displays all the products instead of just product with 'yes' dropdown value.


texts: Adminhtml custom field - how to create one?

texts:
How to create a custom field in adminhtml form?
I can customize fields in grid but I need to add my own field (table) in form to be sortable.


texts: If I upload a special price with a local API programm, the price in the product view is ok, but in the category view its still the old price, I allready flushed all caches in the Magento backend, but no change. If I go in the backend into the product and save it again, its updating the price in the category view also.


texts: store logo not showing in transnational order email in magento 2

texts: the store logo is not showing in order email which was showing and uploaded in the configuration -> design ->transnational email section


texts: How can I find out the dates when Magento releases new versions?

texts:
I've been looking at the main Magento DevDocs site here:
http://devdocs.magento.com/guides/v2.1/release-notes/ReleaseNotes2.1.4CE.html

But I can't find the dates when each of the point releases came out.
Is there somewhere else I need to look to find out this information?


texts: Magento 2: How to truncate customers, products, reviews and orders table

texts: Does anyone have list of tables I need to truncate to delete all test customers, products, reviews and orders in Magento 2 ? I'm looking for something similar to Clearing Magento after testing .


texts: Overwrite the layout of a form from a custom theme

texts:
I am working on a Magento 2.1.7 shop and  I have created a child-theme of Magento Blank.

I have a app/design/frontend/Company_Name/Theme_Name/Magento_Customer/layout directory with numerous XML files (like, for instance, customer_account_create.xml) from wich a overwrite default pages/sections layous.

I don't have the XML file responsible for the layout of the Reset your password page.

What is its name and where can I find it?


texts: How would you set up a URL rewrite rule to handle 404s in Magento 2

texts: I want to write a rewrite rule that is only activated if the url is a 404. Does anyone know how I would go about doing that?


texts: Magento 2 - Using observer how to Set CMS block to category description block programmatically

texts:
Using observer how to set catalog categories content Add CMS Block (category.description) programmatically
My observer:
<?php
namespace Zero\DescBlock\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

/**
 * Class CollectionObserver
 * @package Vendor\Module\Observer
 */
class CollectionObserver implements ObserverInterface
{
    /**
     * @var \Magento\Catalog\Model\Layer\Resolver
     */
    protected $layerResolver;

    /**
     * CollectionObserver constructor.
     * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
     */
    public function __construct(

        \Magento\Catalog\Model\Layer\Resolver $layerResolver
    ) {
        $this->layerResolver = $layerResolver;
    }

    /**
     * @param Observer $observer
     */
    public function execute(Observer $observer)
    {
        $layer = $this->layerResolver->get();
        $activeFilters = $layer->getState()->getFilters();
        foreach ($activeFilters as $filter)
        {
           $filterLabel = $filter->getLabel();
           $filterValue = $filter->getValue();
        }
    }
}

Condition : Here my filterLabel is, apple and orange if filterLabel is apple i need to set cms block identifier my_apple if orange cms block identifier my_orange.
I am added cms block to Product listing page category description section,.
path :
app\design\frontend\Zero\mytheme\Magento_Catalog\layout\catalog_category_view.xml
<referenceContainer name="content">
    <block class="Magento\Cms\Block\Block" name="category.description">
        <arguments>
            <argument name="block_id" xsi:type="string">cms_block_identifier</argument>
        </arguments>
    </block>
</referenceContainer>

How to merge into my observer?


texts:
I am trying to add a Style sheet in my Magento 2 store. My default_head_blocks.xml is like below<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"  src_type="url" rel="stylesheet" type="text/css"  />
        <css rel="stylesheet" type="text/css" src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" src_type="url" />
        <css src="css/fixed_css.css"/>
        <css src="css/custom.css"/>
    </head>
</page>fixed_css.css code is like below.search-hearder-main.row {
    justify-content: center !important;
}
/* Facebook */
.fa-facebook {
background: #3B5998;
color: white;
}
/* Twitter */
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa {
padding: 20px;
font-size: 30px;
width: 30px;
text-align: center;
text-decoration: none;
border-radius: 50%;
}I ran php bin/magento setup:upgrade command.But I am getting only below code when I am inspecting using ctrl + u ..search-hearder-main.row {
justify-content: center !important;
}
I tried in several ways. I ran below commands.
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento cache:flush
I flushed all the caches here.

Now I placed below CSS in fixed_css.css file.
body {
    background-color: red;
}

But nothing is working.


texts: checkout_index_index.xml Breaking when overwriting

texts:
I'm trying to overwrite checkout_index_index.xml under module-checkout

It is currently using the file I have created in my theme but the shipping selection is breaking and now showing prices or reloading on zip code change.

I have copied the whole file from the default theme so it's not my code but maybe something isn't including like I found the discount item wasn't working.

So I had to add that manually but can't seem to find whats breaking the shipping any ideas thanks.

Path is

/theme_name/theme/Magento_Checkout/layout/checkout_index_index.xml


texts:
I can't seem to find out why my category page #2 has a "NOINDEX,FOLLOW"

Is there a setting for that so I can edit it all my category pages to "INDEX,FOLLOW" ?


texts:
give some ideas for giving sku values in magento site

we are devoloping magento sites.

so we are in confusion about on what basis, we have to decide sku values.

we planning for products name or bar code or in product-name-brand-manufacturer.

how you are giving skus for your site.


texts: How to send the old password of a user who forgot it?

texts: I need a solution to send the OLD password of a customer who click and enter his email address in Forgot your password page. The default email template send just a link inviting the customer to reset his password at the site's page.


texts: Minus qty in stock level even though no backorders is set to No

texts:
As per the subject, in the Configuration Inventory options, I have set the option for Backorders to "No Backorders".  However, I'm still seeing minus figures appearing for some products.  Can't work out what is causing this?

Looking at example products, the option in Inventory is also set to No Backorders.  The products are correctly set to out of stock (the option is set to be out of stock if quantity is 0) but they just seem to have minus figures.

Any ideas?

Manoj


texts:
I have setup live site in my local server, all functionalities are working good except UPS shipping method.

I have update UPS settings as it is at live site like this https://github.com/magento/magento2/issues/6875

I have check debog.log  file and showing this error:

    <Package>
      <PackagingType>00</PackagingType>
      <PackageWeight>
         <UnitOfMeasurement>LBS</UnitOfMeasurement>
        <Weight>1</Weight>
      </PackageWeight>
    </Package><RateInformation><NegotiatedRatesIndicator/></RateInformation>  </Shipment>
</RatingServiceSelectionRequest>',
  'result' =>
  array (
    'error' => 'Could not resolve host: onlinetools.ups.com',
  ),
) {"is_exception":false} []

Can anyone help me, What i need to do to make working UPS shipping method?

Any help will be appreciated.


texts:
A user added items to her cart last night. Somehow her session was lost and this morning when she tried to check out, they were gone. She had spent several hours shopping and is quite frustrated. We have to find her cart items or lose the sale.

There is an "abandoned carts" area of the admin, but it seems to only reflect logged in users, so it is useless for me.

I am looking at the database table report_event. Looking at entries from last night, and limiting by event_type_id = 4 (which is event_name = "checkout_cart_add_product" in table report_event_types), I see two groups of entries from around the time she was shopping. Each group has the same subject_id, which I'm thinking might connect to a user session. The object ids are all different but I don't know what they are. Are they product_ids?


texts: Remove Cache or turn off cache for a Individual block in Magento for full page cache Hole Punch

texts:
in some case few block need to be dynamic if you use full page at that time we need to turn off cache only for that Individual  block
for that we call Hole Punch

to do that follow below steps                                                  1. create cache.xml  file in AW/Zblocks/etc/cache.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <placeholders>
        <deptlhpromo>
            <block>core/template</block>
            <template>zblocks/deptlhpromo.phtml</template>
            <name>deptlhpromo</name><!-- THIS MUST MATCH THE ALIAS IN THE LAYOUT XML EXACTLY -->
            <placeholder>DEPTLHPROMO</placeholder>
            <container>AW_Zblocks_Model_Container_Deptlhpromo</container>
            <cache_lifetime>86400</cache_lifetime>
        </deptlhpromo>
    </placeholders>
</config>

2. Create Container model that is AW/Zblocks/Model/Container/Deptlhpromo.php

class AW_Zblocks_Model_Container_Deptlhpromo extends Enterprise_PageCache_Model_Container_Abstract
{
    protected function _getCacheId()
    {
    return 'DEPTLHPROMO_' . md5($_COOKIE["frontend"]);
    }

    public function applyInApp(&$content)
    {
        $block = $this->_placeholder->getAttribute('block');
        $template = 'zblocks/deptlhpromo.phtml';

        $block = new $block;
        $block->setTemplate($template);
        $block->setLayout(Mage::app()->getLayout());

        $blockContent = $block->toHtml();

        $this->_applyToContent($content, $blockContent);

        return true;
    }

    protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
    {
        return false;
    }

}

Create phtml which will called once page is cache else it will call default xml (in our ex it will be from catalog.xml)/template/zblock/deptlhpromo.phtml

echo Mage::app()->getLayout()->createBlock('zblocks/block')->setPosition('DEPT_LH_promo')->toHtml();

4. catalog.xml where default loaded if page is not cache that is at first time

<catalog_category_default translate="label">
        .
        .
        .
        .
        .
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view-category.phtml">
                <block type="core/template" name="deptpromo">
                    <action method="setTemplate">
                        <template>zblocks/deptpromo.phtml</template>
                    </action>
                </block>
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                .
                .
                .
                .
                .
         </catalog_category_default>

Imp Note :- in catalog.xml block name should be same as in cache.xml place order  that is

    should be same as

<config>
            <placeholders>
                <deptlhpromo>
                    <block>core/template</block>
                    <template>zblocks/deptlhpromo.phtml</template>
                    <name>deptlhpromo</name><!-- THIS MUST MATCH THE ALIAS IN THE LAYOUT XML EXACTLY

then only it works


texts: Print Invoice - Is there a difference between local and live version?

texts:
I put my latest local version live. Now I have the problem that I can't print invoice pdfs anymore. Packing slips, orders and credit-memos work without problem. On my local version, there was never an issue.

error report tells me that

a:5:{i:0;s:172:"Cannot send headers; headers already sent in /bentoLunch/bentoLunch/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php, line 1";i:1;s:1726:"#0

What is the difference in printing pdf on local server and now trying to print the pdf on live server? Maybe if I know that, I can fix this somehow. I already read a lot of posts, and I can assure you, there is no var_dump, echo or print_r inside the Invoice.php.
There is also no empty char before the <?php.

And another thing. I send a pdf invoice via email after purchase goes through. This pdf is "printed" without problems and attached to the email the customer receives.

####### ########## UPDATE: ############# ##########

There are 12 orders in my overview in admin. I now randomly clicked all of them. And tried to print. One of them was working now. But only once. If I try again, it's showing same error as before. -__-

####### ########## UPDATE 2 ############# ##########

Haha, today another invoice from the list is printable. And this time, also more than once. This is driving me crazy...


texts: Magento 2 pdf generation not in proper language

texts:
In my Magento 2 site having three language stores English,Chinese,Chinese Traditional.All working fine But when comming to PDF in chinise orders it was printing boxes what can i do for fixing this problem

Please any help .I fallowed belowed links

https://github.com/magento/magento2/issues/9666

Hebrew words in PDF invoice are reversed and currency symbol not showing

https://www.sonassi.com/blog/knowledge-base/magento-wrong-charset-conversion-from-utf-16be-to-utf-8-is-not-allowed


texts: Magento 2 get the value of the custom attribute (aleksandar-babic / magento2-moGCR)

texts:
Good evening, I'm using the form
aleksandar-babic
/
magento2-GCR (https://github.com/aleksandar-babic/magento2-GCR/commit/d8d5ed1b8b479d05fd2c85e7365a671f3175a2f4)
to participate in google customer reviews. I would need to modify Success.php as it uses getSku for gtin but this is not good for me as I use a custom attribute for Ean so I need to change getSku with the custom attribute labeled Ean. I tried to change with getEan () but this gives me an error in the console: Error: Product GTIN format is invalid!
(anonymous) @ cb = gapi.loaded_0: 682. Not being an expert programmer I ask you for help.


texts: Updating product attributes for multiple (but not all) Store Views at once?

texts:
On a current project, we have one store view per country that the shop targets. Here's an example list of store views:

Switzerland (German)
Germany (German)
UK (English)
USA (English)
Australia (English)

All store views share one catalog, so the products are the same across all Store Views. Products are created in German initially. Now we need to add translations for some product attributes for the different languages, for example the product's descriptions need to be translated from German into English for the Store Views targeting English speaking countries.

The way that I have previously solved this (when there was just one Store View per language) was by opening each product in the Admin Panel and manually updating its description. But this is obviously too much work when there are multiple Store Views per language, because then I'd have to manually update the description once per Store View, using the same values for all English Store Views.

Is there a way of updating a product attribute's value for multiple Store Views at once? So that I can enter the product description in English just once, and it will be updated for all Store Views where the language is English?

I doubt that this can be solved using Magento Core so I'm open for suggestions using extensions or external tools.

Thanks!


texts:
Does anyone have any experience of doing this?
It is all new to me and I have tried to follow the guidelines but get the following error...

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.fsfixings.com/index.php/api/v2_soap/index/?wsdl=1' : failed to load external entity "http://www.fsfixings.com/index.php/api/v2_soap/index/?wsdl=1"

Any guidance would be much appreciated!


texts: Creating Order Programatically Showing Wrong Grand Total

texts:
I've successfully created an order programmatically using custom prices for items.
When I view the order, the item is correct, the subtotal is correct, but the Grand Total is double.

Here is my code...

    global $StoreId;

    $CustomerId = $_POST['CustomerId'];

    $Quote = Mage::getModel('sales/quote')->setStoreId($StoreId);

    $Customer = Mage::getModel('customer/customer')->load($CustomerId); // insert customer ID

    // Assign Customer To Sales Order Quote
    $Quote->assignCustomer($Customer);

    $address =  $Customer->getDefaultBillingAddress();

    $Quote->getBillingAddress()->importCustomerAddress($address);
    $Quote->getShippingAddress()->importCustomerAddress($address);

    $Quote->setSendCconfirmation(0);

    // Loop to add order. $Item contains the Sku, Qty, Price
    AddItemToQuote($Item, $_product, $Quote);

    try
    {
        $Quote->collectTotals()->save();
        $Quote->getShippingAddress()->collectTotals();
        // Collect Rates and Set Shipping & Payment Method
        $Quote->getShippingAddress()
            ->setCollectShippingRates(true)
            ->collectShippingRates()
            ->setShippingMethod('freeshipping_freeshipping');
        $Quote->getPayment()->setMethod('checkmo');

        // Create Order From Quote
         $service = Mage::getModel('sales/service_quote', $Quote);
         $service->submitAll();
         $increment_id = $service->getOrder()->getRealOrderId();
    }
    catch (Exception $e)
    {
        echo '
Caught exception: ',  $e->getMessage(), "
";
    }

function AddItemToQuote($Item, $_product, $Quote)
{
    global $StoreId;

    try
    {
        $Quote->addProduct($_product, new Varien_Object(array('qty'   => $Item["Qty"])));
        $Quote->save();
        $QuoteItem = $Quote->getItemByProduct($_product);
        $QuoteItem->setOriginalCustomPrice($Item["Price"]);
        $QuoteItem->setCustomPrice($Item["Price"]);
        $QuoteItem->setIsSuperMode(true);
        $QuoteItem->save();
    }
    catch (Exception $e)
    {
        echo 'Caught exception: ',  $e->getMessage(), "
";
        print "Product ID: " . $_product->getId() . "
\n";
        print "Product Sku: " . $_product->getSku() . " - " . $_product->getName() . "
\n";
    }
}


texts: Only including products in a collection based on their category sort position

texts:
When building a product collection, is there a way to only include products with a category sort position greater/less/is than (x)?

I've tried searching but couldn't find a case of where anyone had asked this before.

$collection = Mage::getModel('catalog/product')->getCollection()
    ->addCategoryFilter($category)
    ->addAttributeToFilter('visibility', array('neq' => 1))
    ->addAttributeToSort('price', 'asc')
    ->load();

In the above product collection, we only want to include products if their sort position in the category is 0. We are forcing a large amount of products to appear at the end of the category by setting their position to 1000.

I suppose I could create a custom attribute with something like a Yes/No value and set all the products to Yes that we want to include in this product collection including it with a addAttributeToFilter but was hoping for a less fiddly/time-consuming way if possible.


texts: PHPUnit add products to cart and shipping methods

texts:
I have followed the instructions here on how to link Magento up to PHPUnit and THAT works.
I have created some custom shipping methods that, based on the order weight, order total, and a couple of custom attributes, will dictate which shipping method is available.
How do I add products to the cart and go through the checkout process using PHPUnit so that I can see which shipping method(s) is(are) available?
The idea being I would change the combination of products in the cart as needed without having to do it manually.
My function so far is:
public function testFirstMethod()
{
        $this->_model = new Company_CustomShippingMethod_Model_Carrier;
        $request = new Mage_Shipping_Model_Rate_Request();
        $response = $this->_model->collectRates($request);

        $this->assertEquals(FALSE, $response);
}

which passes as at this point there is no order and the model returns false.
So, how do I add products to the cart and go through the checkout process using PHPUnit?
[Edit]
Using the answer from programmatically adding product to cart returns empty price, I can add products using:
$quote = Mage::getSingleton('checkout/session')->getQuote();
$quote->addProduct($product, $qty);

$quote->collectTotals()->save();

How do I programmatically perform a checkout to get the shipping methods being returned by Magento?


texts: jQuery function call on focus out for form field not working

texts:
I have created a Magento admin form with following fields.
    $skuField = $fieldset->addField(
        'sku',
        'text',
        [
            'name' => 'sku',
            'label' => __('SKU'),
            'title' => __('SKU'),
            'required' => true
        ]
    );
    $fieldset->addField(
        'product_name',
        'text',
        [
            'name' => 'product_name',
            'label' => __('Product Name'),
            'title' => __('Product Name'),
            'required' => false,
            'readonly' => true
        ]
    );
    $skuField->setAfterElementHtml("
        <script type=\"text/javascript\">
            require([
                    'jquery',
                    'mage/template',
                    'jquery/ui',
                    'mage/translate'
                ],
                function($, mageTemplate) {
                    $('#edit_form').on('focusout', '#item_sku', function(event){
                        $('#item_product_name').val($('#item_sku').val);
                    })
                }
            );
        </script>"
    );

jQuery function works, if I use "change" event instead of "focusout". I searched web for solution and did not find. May I know the correct event name for focus out ?


texts: store_url does not render link correctly

texts:
I am using this link in my static CMS block

<a href="{{store_url='produkte/insektenschutz/fenster/spannrahmen.html'}}">

but it renders as https://www.mysite.de/produkte/insektenschutz/fenster/

Why is spannrahmen.html cut off?


texts: Custom Module Admin Grid View "Search by Keyword" Not Working

texts:
How to make my search bar work in my custom grid module? I have added the search field by inserting this code <filterSearch name="fulltext"/> inside my <listingToolbar name="listing_top"> tag.

The search field have been displayed but it's not working, what should I do?


texts: Magento 1.9.2.2 Back in stock alert emails are shown as sent on the backend but are not being received

texts:
I am using Magento 1.9.2.2 and I am having trouble with back in stock alert emails.  The basis of the problem is that all indicators on the backend say that the emails are being sent but they are never being received.

The functions run when they are supposed to, no errors are thrown, no functions return a value that suggests a problem.
In the admin panel the Product Alerts table for each product is being updated by the system to show the alerts as sent and the information is correct.
The cron_schedule table is being filled and has jobs with the job code set to catalog_product_alert. These jobs are being marked by the system as complete and successful.
Other transactional emails such as New Orders, and Password Recovery are being sent and received perfectly.

The only real abnormality is that the core_email_queue and core_email_queue_recipients tables are not being filled with any rows relating to back in stock emails.  They are being filled with rows relating to the other emails mentioned above, and this only happens when it is supposed to. In the code the problem seems to occur in Mage_Core_Model_Email_Template->send. When this function is reached during the processing of a back in stock email, $this->getQueue() returns nothing. When other emails are being processed in that same function $this->getQueue() returns a Mage_Core_Model_Email_Queue Object with information that matches what the email should contain.  In the back in stock case an error is not thrown as the Mage_Core_Model_Email_Template->send has other methods of sending the email. I have followed these right up until the base php email function is called and everything runs without an error, yet the email is never received. I am using one of my own email addresses for these tests so I know for a fact that they are not being received, nor are they labeled as spam or junk.

If you would like additional information please let me know.
Thank you in advance for your help.


texts:
Recently I create two after plugins, one that point to Magento\Catalog\Pricing\Price\FinalPrice::getValue() and other that point to Magento\Catalog\Model\Product::getPrice() and Magento\Catalog\Model\Product::getFinalPrice()

etc/frontend/di.xml

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
  <type name="Magento\Catalog\Pricing\Price\FinalPrice">
      <plugin disabled="false" name="morwifinalprice" sortOrder="99" type="Morwi\PrecioRegional\Plugin\FinalPrice"/>
  </type>
  <type name="Magento\Catalog\Model\Product">
      <plugin disabled="false" name="morwifinalprice" sortOrder="99" type="Morwi\PrecioRegional\Plugin\Price"/>
  </type>
</config>

Plugin/FinalPrice.php

<?php
namespace Morwi\PrecioRegional\Plugin;

class FinalPrice
{
    ...

    /**
     * @param \Magento\Catalog\Pricing\Price\FinalPrice $subject
     * @param float $result
     * @return float
     */
    public function afterGetValue(\Magento\Catalog\Pricing\Price\FinalPrice $subject, $result){

      ...

      return $result;
    }
}
?>

Plugin/Price.php

<?php
namespace Morwi\PrecioRegional\Plugin;

class Price
{
    ...

    /**
     * @param \Magento\Catalog\Model\Product $subject
     * @param float $result
     * @return float
     */
    public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result){
      ...

      return $result;
    }

    /**
     * @param \Magento\Catalog\Model\Product $subject
     * @param float $result
     * @return float
     */
    public function afterGetFinalPrice(\Magento\Catalog\Model\Product $subject, $result){

      ...

      return $result;
    }
}
?>

The plugins work fine and are executed without problem on all the site. Except on checkout. When I pass from cart to checkout, my plugins are ignored. I debugged and detected that the original methods are executed:

Magento\Catalog\Pricing\Price\FinalPrice::getValue()

Magento\Catalog\Model\Product::getPrice()

Magento\Catalog\Model\Product::getFinalPrice()

But the plugins not. Why is it? How can I run my plugins on checkout?

Thanks.


texts: X-Magento-Cache-Control Header Extra Variables

texts:
Has anyone else had the issue with 2.2.6 and Varnish 5, where extra variables are included in the header?

My header retruns;

  X-Magento-Cache-Control: max-age=86400, public, s-maxage=86400,
  max-age=0, no-cache, s-maxage=10

Where i would expect it to return;

  X-Magento-Cache-Control: max-age=86400, public, s-maxage=86400

Does anyone know how this is possible please?


texts:
I realize that this mayb be a subjective question, but is there anything from the core team or code itself that expresses good versioning practices for Magento modules?

Specifically, because of the naming convention of SQL upgrade scripts on modules (eg: mysql4-upgrade-0.0.3-0.0.4.php, I'm wondering if module versioning should be dependent upon database interaction. In other words, should I only increment my module's version as new upgrade scripts are added?


texts: I installed a theme but they will not be loaded after installing the site's photos.


texts:
I made an ajax request (in the admin html) and got the following response:

"{"error":true,"message":"You entered an invalid Secret Key. Please refresh the page."}"

  new Ajax.Request('getAjaxExportUrl() ?>', {
              method:     'get',
              parameters: {
                  "store" : "someStore"
              }

.

  public function getAjaxExportUrl()
      {
      return $this->getUrl('someURL');
      }

What's wrong?


texts: Magento 2 - Category page sorting does not work on grouped products

texts:
I added the new product sorting attribute related to price in category page like price low to high and price high to low. It showed on Sort By drop down. It is working fine for configurable product and simple product but the problem is, it is working grouped products case.

Grouped product shows the price of their lowest simple product price in category page.

  For Reference please see the screenshot

  For Reference I use code for price sorting

$collection->getSelect()->order("price_index.final_price asc");

Any help, experience and knowledge sharing would be appreciated.


texts:
The FPC is turned off in admin, product page is not cache, I have tested all attribute and its working when i edit a content.

But on my custom block every time I change a value in my custom table in the database its not showing in product page unless i clear static cache in admin.

My problem is my custom block is always caching.

FPC is turned off in admin product page is not cache test all attribute its working when i edit a content but on my custom block every time i change a value in my custom table in the database its not showing in product page unless i clear static cache in admin.

Tried all possible solution ive seen in s.o


texts: Magento 2: How to get product by SKU in custom page?

texts:
I created a custom page, where users can input SKU of product and after they submit the button, its load product details, like name, image and a configurable option for configurable product.

Here is the issue:
I get the SKU from the input field, but product details are not loading on my view page, or details not successfully sent from the controller to view(Actually from block to view, as some page suggested).

I am following the answer: Magento 2 - Send form data to Controller using AJAX and return Result to PHTML

File: viewproduct.phtml

Path

  SimpleMagento/AddBulkProduct/view/frontend/templates/viewproduct.phtml

<form data-mage-init='{"validation": {}}' id="load_product">
   <div class="control">
       <input type="text" name="get_product" id="get_product" class="input-text" placeholder="<?= __('Product SKU') ?>" data-validate="{required:true}" />
   </div>
   <button type="submit" class="action-primary"><?= _('Submit') ?></button>
</form>

<?php
echo $test = $block->getProductBySku();
//var_dump($test); exit();
?>

<script>
 require(['jquery'],function(){
    jQuery(document).ready(function() {
        jQuery("#load_product").submit(function(){

            var getProduct = jQuery("input[name='get_product']").val();

            var url = "<?php echo $block->getBaseUrl().'AddBulkProduct/loadproduct/Index/' ?>";
             jQuery.ajax({
                url: url,
                type: "POST",
                data: {get_product:getProduct},
                showLoader: true,
                cache: false
                success: function(response){
                    console.log(response.output);
                }
            });
            return false;
         });
     });
 });
</script>

File: viewproduct_loadproduct_index.xml

Path

  SimpleMagento/AddBulkProduct/view/frontend/layout

<body>
    <referenceContainer name="content">
        <block class="SimpleMagento\AddBulkProduct\Block\Index"  template="SimpleMagento_AddBulkProduct::viewproduct.phtml">

        </block>
    </referenceContainer>
</body>

File: Index.php (Controller)

Path

  SimpleMagento/AddBulkProduct/Controller/loadproduct/Index.php

public function execute()
{
    $getProduct = $this->getRequest()->getParam('get_product');
    $result = $this->jsonFactory->create();
    $resultPage = $this->pageFactory->create();
    $block = $resultPage->getLayout()
        ->createBlock('SimpleMagento\AddBulkProduct\Block\Index')
        ->setTemplate('SimpleMagento_AddBulkProduct::viewproduct.phtml')
        ->setData('get_product',$getProduct)
        ->toHtml();
    $result->setData(['output' => $block]);
    return $resultPage;
}

File: Index.php (Block)

Path

  SimpleMagento/AddBulkProduct/Block/Index.php

class Index extends Template
{
   /**
   * @var ProductRepositoryInterface
   */
    protected $productRepository;

    public function __construct(Template\Context $context, ProductRepositoryInterface $productRepository)
    {
        parent::__construct($context);
        $this->productRepository = $productRepository;
    }

    public function getProductBySku($sku)
    {
       return $this->productRepository->get($sku);
    }
}

Current Situation:
As a new in Magento, Please tell me if I am using a correct flow or not?

As per my understanding, I am using the block to pass data from controller to my phtml file, but after using block, Magento's default layout is not showing just basic html input text and button, How can I restore my layout?

Currently after press submitting button, its just reloading with '?get_product=24-MB01' url.

Any help or suggestion would be appreciated.

Thanks