texts:
I am wokring on coding standard and  need to replace echo with $this->getResponse()->setBody($relatedBlock) But below code is not working for me. with echo it working perfectly.

public function showpopupAction(){

$this->loadLayout();

if($this->getLayout()->getBlock('minicart_head')){
    $relatedBlock = $this->getLayout()->getBlock('minicart_head')->toHtml();

    $this->getResponse()->clearHeaders()->setHeader('Content-type','text/xml',true);
    $this->getResponse()->setBody($relatedBlock);

}


texts: Cloudfront not configuring Magento 2 CORS Policy error

texts:
I am getting error

  No 'Access-Control-Allow-Origin' on Magento 2 website.Although i add
  Header set Access-Control-Allow-Origin '*'.But still its not enable
  it.

enter image description here


texts: Magento 2: Cart product image shows 404 error in new products

texts:
I have uploaded some new products to my store, and when I add some of the new product to the cart, the images are not seen:

And this happens because the image are not generated in pub/media/catalog/product/cache:

I have tried to deploy, compile, reindex, flush cache but this doesn´t work. I also have tried to catalog:images:resize but it takes a long time:

The funny thing is that with the old products it doesn't happen, it's with the new ones that I've uploaded...
What can I do?
Thank you so much!!!


texts: Magento 2- how to prevent magento from telling that article is not in storage

texts:
We are a company which creates products, so we always have everything in storage, otherwise we are producing it. But magento often shows messages like "This article is not in storage".
How can I completly disable this feature without having to rewrite the code?


texts: Could using local.xml lead to another outcome than using one of the default layout .xml files?

texts:
EDIT: I decided to rephrase my original question, trying to make it a more general question.

I'm trying two options to achieve the same result, but they turn out differently... I'm working in Magento's DEFAULT package and apart from the two options that I will describe below, everyting else in my configuration is left the same.

Here are my two options:

Option 1: Using catalog.xml to apply a change

I copied app/design/frontend/BASE/default/layout/catalog.xml to
app/design/frontend/DEFAULT/default/layout/ and changed line
285 from:

<block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml"/>

into this:

<block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
    <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
    <block type="core/text_list" name="product.info.options.configurable.after" as="after" />
</block>

This option 1 leads to the following result (the result that I need)

Option 2: Using layout.xml trying to apply the same change

I have not copied and modified catalog.xml but instead created app/design/frontend/DEFAULT/default/layout/local.xml which is fully working. In this file I have added the following code:

<layout>

    ....

    <PRODUCT_TYPE_configurable>

        <reference name="product.info.options.configurable">

            <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
            <block type="core/text_list" name="product.info.options.configurable.after" as="after" />

        </reference>

    </PRODUCT_TYPE_configurable>

</layout>

In my view (please correct me if I'm wrong) this is the only correct way to add the block instances product.info.options.configurable.renderers and product.info.options.configurable.after to the block instance product.info.options.configurable (which in this Option 2 comes from app/design/frontend/BASE/default/layout/catalog.xml).

This option 2 however leads to the following result (not the result that I need)

I have checked everything multiple times and this really sums up my two options which lead to different results. I would expect them to lead to the same result (unless the code I added to local.xml is incorrect).

So my question basically comes down to this: Could it be possible that using local.xml leads to another result than doing the exact same thing by using one of the default layout .xml files (e.g. catalog.xml)?


texts: Magento 2- FREE SHIPPING for 3 or 3+ products

texts:
Magento2 experts. I need a help.

I need FREE SHIPPING on 3 or 3+ products. I set in cart price rule.
in Action- "Quantity in cart  equals or greater than 3"

When I add same 3 products to the cart, it works. but, If I add separate 3 products in the cart, It doesn't work.

How can I solve it? Do I need an extension?


texts: Magento 2 - How to add color picker in admin configuration options?

texts: How can I add color picker in Magento admin configuration options?


texts: How to add button of social share in custom page magento 2

texts: I have created a module that enable the client to apply for  job and iw ant to add in the page of detail of offer job 3 button :facebook, linkdin, twitter so how do do that without using extension any help please


texts: How can I add Layered Navigation my Vendor Shop page?

texts:
I am using the CED marketplace and I want to add Layered Navigation vendor shop page.
There is list of products that I want to with Layered navigation.
I have added Layered navigation but filter not working with vendor product list.
Here is Link
https://lincoln.wyzefoxstaging.com/vendor_shop/aldo-nero.html


texts: Magento 2: Disable search function catalogsearch/result

texts:
Does anyone know about way to disable any request like this

http://site.lo/catalogsearch/result/?q=flower

just don't need implement any request for that.

please do not suggest disable magento-search or magento-advanced-search modules.

Many Thanks for any advance on that.


texts: local.xml column layout not having an effect - how to fix or debug?

texts:
My local.xml is not affecting my product page layout. Any idea how to debug it or, better yet, fix it?

I have this in my theme/local.xml.

...
    </default>
<catalog_product_view>
   <reference name="root">
      <action method="setTemplate"><template>pages/2columns-left.phtml</template></action>
   </reference>
</catalog_product_view>
...

Changing it has no effect. Another developer has used per-product layout updates to "fix" the problem, but I think the best solution is to get the xml directive to work, rather than fill up the database with 1 million new entries.

I found this magento.stackexchange answer on how to trace the layout building process, but it isn't helping me find the actual problem.

I've inserted this into the top of my theme/product/view.phtml:

<?php var_dump(Mage::app()->getLayout()->getUpdate()->getHandles()); ?>

The output is essentially the same for a product that has no per-product layout update applied vs one that does have one applied:

1.) no per-product layout applied:

array(11) {
  [0]=>
  string(7) "default"
  [1]=>
  string(13) "STORE_default"
  [2]=>
  string(28) "THEME_frontend_default_mytheme"
  [3]=>
  string(20) "catalog_product_view"
  [4]=>
  string(19) "PRODUCT_TYPE_simple"
  [5]=>
  string(14) "PRODUCT_157610"
  [6]=>
  string(19) "customer_logged_out"
  [7]=>
  string(9) "MAP_popup"
  [8]=>
  string(19) "MAP_price_msrp_item"
  [9]=>
  string(14) "SHORTCUT_popup"
  [10]=>
  string(17) "SHORTCUT_uk_popup"
}

2.) per-product layout applied (visible in the admin product page under Design/Page Layout: "2 columns with right bar")

array(11) {
  [0]=>
  string(7) "default"
  [1]=>
  string(13) "STORE_default"
  [2]=>
  string(28) "THEME_frontend_default_mytheme"
  [3]=>
  string(20) "catalog_product_view"
  [4]=>
  string(19) "PRODUCT_TYPE_simple"
  [5]=>
  string(12) "PRODUCT_2563"
  [6]=>
  string(19) "customer_logged_out"
  [7]=>
  string(9) "MAP_popup"
  [8]=>
  string(19) "MAP_price_msrp_item"
  [9]=>
  string(14) "SHORTCUT_popup"
  [10]=>
  string(17) "SHORTCUT_uk_popup"
}


texts:
I have tried to disable Magento_CatalogSearch in config.php.

After edited config.php, While trying to run commands throws the following error.

  "Source class
  "\Magento\CatalogSearch\Model\ResourceModel\Fulltext\SearchCollection"
  for
  "Magento\CatalogSearch\Model\ResourceModel\Fulltext\SearchCollectionFactory"
  generation does not exist."

Can any one please resolve my problem


texts: Moving Configurable Product From Wishlist to Cart

texts:
I am using the following URL in wishlist/item/list.phtml to move products from my wishlist to the cart.

 <?=$this->getBaseUrl()?>checkout/cart/add?product=<?=$item->getId()?>&qty=1

I understand that in order to move configurable items that the product options need to be included in the URL. I can't for the life of me figure out how to pull the super attributes IDs or how to include them in the URL.


texts:
For a professional project in Magento 2, my coworkers have to supply me a full static HTML integration. On the magento side, to make it easier, I want to start from the most empty theme and to stick as close to the HTML DOM they will create as possible.

But I'm not sure which way I can follow :

Every topic I read on this subject suggest to start with a new custom theme which herite from the blank theme.
Another way would be to create a custom theme which herite from no other theme, and create custom page layout (avoiding empty.xml to add some html), ...

Do you have some advices on these both ways ? I would need pros and cons to make the right choice.


texts: Filter customer collection by custom attribute in magento 2

texts:
I created a custom attribute for customer and would like to filter my collection through it.

My UpgradeData:

if (version_compare($context->getVersion(), '1.0.6', '<')) {

    $attributesInfo = [
        'celular'  => [
        'label'    => 'Celular',
        'type'     => 'varchar', // can be static too
        'input'    => 'text',
        'unique' => true,
        'position' => 90,
        'visible'  => true,
        'required' => true,
        'system'   => 0, // Important otherwise attribute is not seen as custom attribute
    ],
];

    foreach ($attributesInfo as $attributeCode => $attributeParams) {
        $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, $attributeCode, $attributeParams);
    }

    foreach ($attributesInfo as $attributeCode => $attributeParams) {

        $attribute = $customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, $attributeCode);
        $attribute->setData(
            'used_in_forms',
            ['adminhtml_customer']
        );
        $attribute->save();
    }
}

My Collection:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerObj = $objectManager->create('Magento\Customer\Model\ResourceModel\Customer\Collection');
        $customer = $customerObj->addAttributeToSelect('*')
        ->addAttributeToFilter('celular',$username)
        ->load()->getData();

Even though I am attaching a value to this field, no customer is found, what should I do?

--EDIT!

Images database:


texts: Strange behaviour of app/code/core/Mage/Core/functions.php file

texts:
I have Magento 1.9.3.1 CE installed and unaltered in my Uwamp localhost.

I was just casually testing some functions from the app/code/core/Mage/Core/functions.php file, by calling those functions in my root script as below:

<?php
require_once 'app/Mage.php';
Varien_Profiler::enable();
Mage::setIsDeveloperMode(true);
error_reporting(E_ALL);
ini_set('display_errors', 1);
umask(0);
Mage::app('default');

echo Mage::helper('core')->__('any text to be printed');
echo Mage::helper('core')->now();

But when I called the now method of the same functions.php file, I got the below error:

Fatal error: Uncaught Error: Call to undefined method Mage_Core_Helper_Data::now() in C:\UwAmp\www\[magento-root]\test.php on line 11

I was astonished, confused and annoyed to find that even though functions.php actually contains the function now, it doesn't allow it to be called from any other file(or root script as in my case).

Please check here to ascertain that now function actually exists in functions.php file.

What on the earth could be possible cause for this weird scenario?


texts: magento 2 - best practice to modified database structure

texts:
What is the best practice to extend / modified structure database?
Let say we want to add some field in customer_entity table,
is it violate the rules, or we have to add new table?

I didn't find any guide documentation about it.


texts: Order confirmation not received to the customer

texts:
1 (maybe a few more) specific customers are not receiving their order confirmations. This is odd since every other customer is not having this issue in any way.
Emails are received by both us and the customer, but when it comes to that 1 customer: No.


texts: How to hide the column entries in admin grid?

texts: I have a column called goods. I can enter the number inside that column and save. After save I don't want to show the entry in the grid. It should be empty. I want to show only the column name as goods but I don't want to show the entry. Please help. Thanks in advance.


texts: How to create an invoice with status "complete"

texts:
I have a function which is creating an invoice, just the status of the invoice created is "pending". How can I create the invoice with the status "Complete"?

$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();

if (!$invoice->getTotalQty())
    Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));

$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::STATE_PAID);
      $invoice->register();
$transactionSave = Mage::getModel('core/resource_transaction')
    ->addObject($invoice)
    ->addObject($invoice->getOrder());

 $transactionSave->save();

CE 1.9


texts: How to display the thumbnails of the products in the cart

texts:
I have been trying to work this out for the past few hours. Hope you guys can help. I am working on a magento website 1.9.0.1 and trying to display the products currently in the cart as a widget elsewhere. I am able to display the Product Name, Price, qty and the grand total. However I can not get the product image to display. Instead of the product image the default magento placeholder image is displayed.

This is the code block that i am working with :

<?php
$quote = Mage::helper('checkout')->getQuote();
foreach ($quote->getItemsCollection() as $item) { ?>

        <img src="<?php echo Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail')->resize(50, 50); ?>" alt="<?php echo $item->getName(); ?>" />

        <?php
            $maxLength = 50;
            $productName = $item->getName();
            echo '
'.substr($productName, 0, $maxLength).'...
';
            echo '
'.$item->getName().'
';
            echo '
'. $this->helper('checkout')->formatPrice($item->getPrice(), 2).'
';
            echo '
Qty : '. $item->getQty().'
';
        ?>

<?php }
?>

The problem I am having is on this line:

<img src="<?php echo Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail')->resize(50, 50); ?>" alt="<?php echo $item->getName(); ?>" />

I have searched for the past few hours, and tried different solutions, but couldn't get them to work, so I thought I'd display the code in question.

Help and advise appreciated. Thanks


texts: Not seeing custom Product Attribute in Images Tab

texts:
So I created a custom attribute to be used on every product, and it's called product_detail_image (the client will upload a macro photo of the fabric).

Here is how my attribute is setup:

But I'm not seeing this show up in the Images tab on the product edit page.

What am I doing wrong?


texts: Magento2 Product Listing page how to adding custom tab?

texts:
I am using  magento2 and  i need to add custom tabs in product listing page,but i can't find out any solution if anyone know please reply me.
I want custom tabs in listing page which show in detail page as attached image.


texts: Magento 2.3: How to override page content

texts: How to override the content editing page to customize it. do you have any ideas?


texts: Magento 2 : How to add sorting option to review?

texts:
I need to add sorting option (By New, By Old, By Highest Rating, By Lowest Rating) to review section in Magento 2.1 Product Detail View.

So that the customer can sort ratings using the drop down.By default, this does not provide Sorting drop-down except the pagination.Has someone done this in Magento 2.1?

Please help..


texts: Classnames 'Void' inside vendor/magento/

texts:
I'm trying to re-compile using

  php bin/magento setup:di:compile

But when I run this command, I get:

  Fatal error:  Cannot use 'Void' as class name as it is reserved in  /var/www/html/magento/vendor/magento/module-sales/Controller/Adminhtml/Order/Invoice/Void.php on line 9

I am running PHP 7.1.0-alpha.


texts: I am getting text like  Method, Total (ms),Average (ms),Count in footer when I change website mode developer to production mode. Can someone help me with this? How can I resolve this?


texts: How to pass value to Input KnockoutJS attr via xml

texts:
We are trying to pass placeholder value to input element via xml files. So far, the only solution we've found was modifying input.html from:

<input data-bind="(...)
attr: {
    (...)
    placeholder: placeholder,
    (...)
}" />

to

<input data-bind="(...)
attr: {
    (...)
    placeholder: tooltip.placeholder,
    (...)
}" />

and passing our argument inside checkout_index_index.xml with:

<item name="telephone" xsi:type="array">
    (...)
    <item name="config" xsi:type="array">
        <item name="tooltip" xsi:type="array">
            <item name="description" xsi:type="string" translate="true">For delivery questions.</item>
            <item name="placeholder" xsi:type="string">Some text</item>
        </item>
    </item>
</item>

But this is the least elegant solution We could think of.
Can you please tell us the proper, elegant way to pass <item name="placeholder" xsi:type="string">Some text</item> to input.html?

Our best guess is, that, somehow <item name="placeholder"(...) is checked/validated before adding to #checkout JSON and thus it's not appearing in it (We've checked it, assigned placeholder value won't appear there).

P.S.
We're aware about "placeholder: label" ""fix"", but this is even less elegant way than ours, as We'd like to keep templates intact and iteract with xmls only.


texts: Adjusting additional_info info before adding to sales_flat_order_payment

texts:
I want to remove some information from being added to the serialized column called additional_info before it is saved  to the sales_flat_order_payment

I see that there is a function called:

unsAdditionalInformation()

which seems to be what I am looking for. However, I am not really sure where to call it without messing up something else from the order flow. I think it should be added just before the additional_info column is saved to the DB. But not sure where that is.

I am using authorize.net with magento 1.8

Thank you.


texts: Error on "Online Customers" page: Call to a member function getBackendType() on a non-object

texts:
I getting this error for my online collection tab on Magento. 1.9.1

  Fatal error: Call to a member function getBackendType() on a
  non-object in
  /home/*****/public_html/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php
  on line 72

I can usually figure this out, but I don't know much about the online customers tab in Magento. It started happening when we went to our 4 server cluster a couple months ago.


texts: Product is not being created programmatically with quantity in magento 2

texts:
I am trying to create product programmatically with code. Product is successfully created but without quantity. How can add quantity.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
                $product = $objectManager->create('\Magento\Catalog\Model\Product');
                $product->setSku('conf5'); // Set your sku here
                $product->setName('conf5'); // Name of Product
                $product->setAttributeSetId(9); // Attribute set id
                $product->setStatus(1); // Status on product enabled/ disabled 1/0
                $product->setWeight(10); // weight of product
                $product->setWebsiteIds(array(1));
                $product->setVisibility(4); // visibilty of product (catalog / search / catalog, search / Not visible individually)
                $product->setTaxClassId(3); // Tax class id
                $product->setTypeId('configurable'); // type of product (simple/virtual/downloadable/configurable)
                $product->setDescription('descript');
                $product->setShortDescription('shortdes');
                $product->setPrice(100);*/ // price of product
                $product->setStockData(
                    array(
                        'use_config_manage_stock' => 0,
                        'manage_stock' => 1,
                        'is_in_stock' => 1,
                        'qty' => 9
                    )
                );


texts: Uncaught Error: Cannot instantiate interface Developer.php

texts:
HELP!!!

Tried to upgrade Magento from 2.1.7 to 2.1.8 and now I getting below error, when I load the store.

  Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\Config\ConfigSourceInterface in /srv/www/vhosts/mysite/htdocs/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73

I can't do anything with the bin/magento command, it just errors with the above.

Installation steps

magento maintenance:enable
composer require magento/product-community-edition 2.1.8 --no-update
composer update
rm -rf ./var/page_cache/*
rm -rf ./var/generation/*
magento setup:upgrade
find . -type d -exec chmod 770 {} \;
find . -type f -exec chmod 660 {} \;
chmod u+x bin/magento
magento maintenance:disable
service varnish restart

I also tried

magento setup:di:compile
magento setup:static-content:deploy
service redis restart
service nginx restart

Environment

openSUSE 13.2 (Harlequin) (x86_64)
Redis 3.2.3
nginx/1.11.4
varnish-4.1.3 revision 5e3b6d2
mysql Ver 15.1 Distrib 10.0.27-MariaDB, for Linux (x86_64) using readline 5.2

Since the magento command is not working I can not restore from the backup I made before trying to upgrade.  I've done many upgrades in the past year and never got this before.

Anyone have any suggestions?


texts: How can i solve Error : UPS connected By API - Calculate Rates Error

texts:
The API is connected successfully, when i try to test, its not working.
How can i solve Error

Note :

1)Without Products Weight UPS Rates Should be Displayed
2)After give weight to products, the UPS weight not calculated.


texts: Magento 2: Broken Order print pdf layout in Mozilla

texts: When taken a print order from My account ->My orders-> View Order-> Print Order, getting a broken layout on Fire fox web browser, But there is no issue on Chrome browser. How to fix this issue in Fire fox.


texts: Magento 2: Block in Layout not Respecting Cacheable = False

texts:
I have a block my custom module. The layout file is called                         davecms_shopping_checkout.xml.
 Lets assume the module name is davecms and it has a route with a name and id as davecms.

Find below contents of the layout files:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root">
        <block class="Gloo\DaveCMS\Block\Checkout" name="gloocms.checkout" template="Gloo_Davecms::checkout.phtml" cacheable="false" />
    </container>
</layout>

The page is still being cached. Subsequent calls to the url does not get to the controller, it just displays the .phtml template file. What could be the issue?


texts: How to identify pages and set meta info in Magento

texts:
I have some pages in my magento store which are not CMS Pages.
They have phtml files and common head.html files.
This pages not also have databases tables.
I want to set Meta info for that pages.
How can I programmatically set Meta for that pages by identifying loaded URL in Browser dynamically.

Pages urls like -

http://example.com/contacts/

http://example.com/questions/

http://example.com/customer/account/create/

http://example.com/customer/account/forgotpassword/

Any help would be appreciated.
Thanks


texts:
After setup new magento site, i've met some weird situation.
All my vendor folders go to app/code instead.
Also i can't find the Magento/Framework folder too.

How to fix this situation, thanks.


texts: Multiple Magento 2 Systems on a Server and Composer

texts:
I’ve been reading up a lot and it’s confusing as everyone seems to recommend using Composer to install and maintain Magento 2 but I can’t find answers to some basic questions:

I have a server with lots of cPanel accounts. I believe Composer is something that is installed per server - not per cPanel account?
Can Composer only look after one Magento 2 system? I want to have a Development system on a subdomain, another rough test system (with demo data to play around with) in a subfolder on a different domain and eventually have a Live system on yet another domain, the Live domain. These will all be on the same server under different cPanel accounts. The live system will be a copy of the dev system so I will need to clone dev system at some point. Could all these be updated by Composer at different times?
If I don’t use Composer and use Setup Wizard is it easy to apply Magento updates, patches, extensions and extension upgrades.
Would I have any problems in the future if I didn’t use Composer? Is it still easy to do updates even if not as easy as with composer?
What is best way to install and manage the 3 Magento systems I outlined?

Thanks


texts: lowest tier price on home page is not showing

texts:
I have following codes on my home page product listing. I have to calculate the difference between lowest tier price and normal price of a product, But I can't find the lowest tier price. All other information about product are coming but lowest tier price. I can't understant what to do as I am new to magento. Please help.
Here is the code snippet..

<?php
$storeId = Mage::app()->getStore()->getId();
$_productCollection=Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('is_featured', 1)
        ->addAttributeToFilter('status', 1)
        ->joinField('value','catalog_product_entity_tier_price','value', 'entity_id=entity_id','{{table}}.website_id='.$storeId, 'left')
        ->setPageSize(9)
        ->setStoreId($storeId)
        ->addStoreFilter($storeId);
foreach ($_productCollection as $_product):
$lowestTierPrice = product->getResource()->getAttribute('tier_price')->getFrontend()->getValue($_product); //It is not working
$normalPrice = $_product->getPrice();  //it works fine

print_r($_product->getTierPrice());  //getting all the tier price
    endforeach;


texts:
I am Working on a website, after uploading the website on the server an unwanted "print(''); " is shown in the header, i have tried to remove it but i'm unable to do that please help.

screen short is given below


texts:
I have admin prices excluding tax in admin, with a 19% tax on some stores. The client wants the prices to come out rounded - eg. 26.90
I made a simple calculation to find out what price I should enter, and it's something like 22.605042...
So 22.60 would not work, and 22.61 would not work, due to rounding. It had to be with at least 3 decimals. So I modified the admin validation to allow 4 decimals (to actually show them), and it seems to work (also checked catalog_product_entity_decimal and catalog_product_index_price after reindexing), all prices are saved as expected with 4 decimals.
The problem is on frontend - on both the product page and category page, I can't make it show 26.90 whatever I try.
22.6050 => 26.91
22.6049 => 26.89

There is a pretty weird  tag, shows 26.905901 when the admin price is 22.605, which is really weird. Something similar happens when I enter 22.6049 as the price.

I don't really know how to approach this issue, my main concern is that if I modify anything related to rounding I will mess up the price calculations for order processing, and don't want to cause some false "Suspected Fraud" payments because of a 0.01 price difference :-)


texts: Magento 2: How to remove decimal from cost price in catalog grid

texts:
I want to remove 2 decimal from cost price in the admin grid.

I want to show 9.61 instead of 9.6100.

Please let me know any quick fix for this.


texts: Store switching module still pulls theme and payment methods from main site

texts:
I'm currently trying to create a module for Magento 2 (2.3.4) which switches the store based on customer group using observers.

The code seems to work (uses the correct logo, header for the switched store) but unfortunately the different stores are supposed to use different payment methods and themes and for some reason the switched store still seems to pull it's theme and payment methods from the main site rather than it's parent site.

Ideally I need to change the website along with the store view. Is this possible or is there an alternative?

The code is below.

<?php

namespace GroupSite\SiteSwitch\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Customer\Model\Session as CustomerSession;

class AddHandles implements ObserverInterface
{
    protected $customerSession;
    protected $_storeManager;
    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        CustomerSession $customerSession
    ) {
        $this->customerSession = $customerSession;
        $this->_storeManager = $storeManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $layout = $observer->getEvent()->getLayout();
         if ($this->customerSession->isLoggedIn())
             {
             $customerGroup = $this->customerSession->getCustomer()->getGroupId();
                if($customerGroup === '5' || $customerGroup === '6' || $customerGroup === '7'|| $customerGroup === '8'){
                    $this->_storeManager->setCurrentStore('14'); //Set your desired store ID that you wish to set.
                }
                else{
                    $this->_storeManager->setCurrentStore('1');
                }
             }
    }
}

Can anyone suggest a solution please?


texts: In the persistent cart steps, customer is sent to the login page to re-enter the login information. What I want to do is if the customer is logged in (step also adds "Not" in welcome msg header), I want to auto populate email address in the login form. But since no sessions(customer and checkout) are available at this point I cant do it. What would be the best way to achieve this?


texts: Getting 404 error while configuring REST API using RestClient in Magento 1.9

texts:
When I try to initiate oauth for getting oauth tokens with callback in my localhost, it throws 404 page not found error. I configured consumer key and secret and with oAuth 1.0 and using GET method.

URL I'm using for getting oauth tokens is below:
http://your-magento-path/oauth/initiate?oauth_callback=http://example.com

Please help me out in this.


texts: Magento 2.4.1: uncaught error: script error: //connect.facebook.net/en/sdk.js

texts: Not sure why the error as seen in the image below appears on the product page. Please advise as to what needs to be done to fix it. This error message is found when the page is open only on our client's computer in the US. I'm outside the US and opening the same link on my computer doesn't display this error message. I wonder if it is country-specific?


texts: Magento module stopped working after PHP update

texts:
A Magento 1.9 website worked perfectly with PHP 5.6.40, but the server (which I don't have access to) was upgraded to PHP 7.1 and the custom contact forms stopped working.

It does not give any error, however, the action of the form is not done correctly and redirects to a Login page that I have never seen. It was to send an email and redirect to a pdf.

Does anyone know what can it be?

The module that no longer works:

Controller

<?php
class Empresa_Liga_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }

    public function postAction()
    {
        $post = $this->getRequest()->getPost();

        if ($post){
            try {
                $name = $post["name"];
                $telefone = $post["telefone"];
                $email = $post["email"];
                $ddd = substr($telefone, 0, 2);

                $to = "comercial@empresa.com.br";

                $subject = "Novo Contato";
                $body .= "
Novo contato pelo formulario: 'A empresa liga pra você'
";
                $body .= "
Nome : " . $name . "
";
                $body .= "
Telefone  : " . $telefone . "
";
                $body .= "
Email  : " . $email . "
";

                $from = "empresa@gmail.com";

                $mail = Mage::getModel('core/email');
                $mail->setToName('Your Name');
                $mail->setToEmail(array($to,'marketing@empresa.com.br'));
                $mail->setBody(utf8_decode($body));
                $mail->setSubject($subject);
                $mail->setFromEmail($from);
                $mail->setType('html');// YOu can use Html or text as Mail format
                $mail->setBodyHTML(utf8_decode($body));  // your content or message

                $mail->send();

                Mage::getSingleton('core/session')->addSuccess('Sua solicitação foi enviada... Em breve entraremos em contato');
                $this->_redirect("agradecimento-a-empresa-liga-pra-voce");
                return;
            } catch (Exception $e) {
                Mage::getSingleton('core/session')->addError('Ocorreu um erro, tente novamente mais tarde');
                $this->_redirect('*/*/');
                return;
            }
        } else {
            $this->_redirect('*/*/');
        }
    }
}

config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <Empresa_Liga>
      <version>0.0.1</version>
    </Empresa_Liga>
  </modules>
  <frontend>
       <routers>
          <brochure>
              <use>standard</use>
              <args>
                 <module>Empresa_Liga</module>
                 <frontName>empresa-liga</frontName>
              </args>
           </brochure>
       </routers>
       <layout>
            <updates>
                <empresa_liga>
                    <file>brochure.xml</file>
                </empresa_liga>
            </updates>
        </layout>
    </frontend>
  <global>
    <helpers>
      <module>
        <class>Empresa_Liga_Helper</class>
      </module>
    </helpers>
  </global>
</config>

Data.php

<?php
class Empresa_Liga_Helper_Data extends Mage_Core_Helper_Abstract
{
}


texts: Magento 2: What's the `ui_component` folder for?

texts:
In addition to containing familiar folders like layout, and templates, a Magento 2 module's view folder also contains a ui_component sub-folder.

view/adminhtml/ui_component

What is this folder for?  It seems to have something to do with rendering UIs in the back end, but it's not clear how I, as a Magento module developer, would use the files in this folder. Is this something reserved for core Magento modules that has no functionality exposed for third party developers, or can I use it to re-use Magento UI components and/or create my own UI components?  If so, how?


texts: Magento 2 UI component category form disable attribute based on system configuration toggle?

texts:
I am trying to disable or enable category attribute based on system config or helper value using UI component can I make this directly from here ?

  system config path :- marketplacesetting/category_commissions/enable

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="category_commission">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Category Commission</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">15</item>
            </item>
        </argument>
        <field name="category_commission_percentage">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">10</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">Category Commission Percentage</item>
                    <!--<item name="disabled" xsi:type="boolean">true</item>-->
                    <!--<item name="disabled" xsi:type="string">${ $.provider }:data.category_commission_percentage.do_we_hide_it</item>-->
                    <item name="config" xsi:type="string">marketplacesetting/category_commissions/enable</item>
                    <item name="scope_info" xsi:type="string">1</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                        <item name="less-than-equals-to" xsi:type="number">99</item>
                        <item name="validate-number" xsi:type="boolean">true</item>
                        <item name="validate-zero-or-greater" xsi:type="boolean">true</item>
                        <item name="validate-not-negative-number" xsi:type="boolean">true</item>
                    </item>

                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: M2 | How to set default store view of product while creating the product programmatically?

texts:
I am creating simple product programmatically, but for displaying it on frontend I need to edit product from admin side and set its view from

  All Store Views

to

  Default Store View

Mannually, then it appears on the frontend.

I am creating product as:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
        $product = $objectManager->create('\Magento\Catalog\Model\Product');
        $product->setSku('my-sku11'); // Set your sku here
        $product->setName('Sample Simple Product11'); // Name of Product
        $product->setAttributeSetId(4); // Attribute set id
        $product->setStatus(1); // Status on product enabled/ disabled 1/0
        $product->setWeight(10); // weight of product
        $product->setVisibility(4); // visibilty of product (catalog / search / catalog, search / Not visible individually)
        $product->setTaxClassId(0); // Tax class id
        $product->setTypeId('simple'); // type of product (simple/virtual/downloadable/configurable)
        $product->setPrice(100); // price of product
        $product->setStockData(
                                array(
                                    'use_config_manage_stock' => 0,
                                    'manage_stock' => 1,
                                    'is_in_stock' => 1,
                                    'qty' => 99999
                                )
                            );
        $product = $product->save();

I have tried this,

$product->setStoreId(0); //1,2,3,4

but it is not working. How can I achieve it ?
Thanks


texts: Magento 2: Not able to save custom dropdown product attribute value programatically

texts:
I am using magento 2.2.3, and created a dropdown attribute "wholeseler" in admin area with some attribute values.
Now I want to update the "wholeseler" attribute value programmatically.

I am using below code but not working

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

use \Magento\Framework\App\Bootstrap;

include('app/bootstrap.php');
$bootstraps = Bootstrap::create(BP, $_SERVER);
$object_Manager = $bootstraps->getObjectManager();
$app_state = $object_Manager->get('\Magento\Framework\App\State');
$app_state->setAreaCode('frontend');

// Instance of object manager
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productFactory = $objectManager->create('Magento\Catalog\Model\ProductFactory');

$productResourceModelFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\ProductFactory');

$productId = "84";

$product = $productFactory->create()->load($productId);
$product->setWhol("rub");
$product->save();

$productResource = $productResourceModelFactory->create();
$productResource->saveAttribute($product, 'whol');
echo "whol added ".$product->getId()."\n";

Please share any alternate solution that work for save the attribute value.


texts: Magento 2.3.2 widgets on home page showing twice

texts:
I am using magento 2.3.2 with zemez theme. I added 8 widgets including slider, featured products and featured brands.
Widgets were showing fine on admin and frontend when checked a month ago. Today when I checked again there weren't any widgets on backend but showing all 8 widgets on frontend. So I imported widgets database tables from a backup and they started showing on backend too.
But the issue I am facing now is that all widgets are showing twice (i.e. 16 widgets) on frontend but on backend 8 widgets.
Seems to be a cache issue. So I Removed var folder and ran all commands but issue is still there


texts: How to move terms & conditions checkout just before place order button in magento 2

texts:
I want to move term & conditions checkbox just before Place order button in Magento 2.
I have tried this code in checkout_index_index.xml
        <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="afterMethods" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="agreements" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_CheckoutAgreements/js/view/checkout-agreements</item>
                                                                <item name="sortOrder" xsi:type="string">100</item>
                                                                <item name="displayArea" xsi:type="string">before-place-order</item>
                                                                <item name="dataScope" xsi:type="string">checkoutAgreements</item>
                                                                <item name="provider" xsi:type="string">checkoutProvider</item>
                                                            </item>
                                                            <item name="agreements-validator" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_CheckoutAgreements/js/view/agreement-validation</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>

But it's just moved checkbox to last in the list of other options like Add a gift, Sign up for newsletter etc.
Current position:

How Can I move it just before Place order and Just After discount block.


texts: Magento2: How to add different custom css file on specific CMS pages

texts:
I tried so may things but unable to add the CSS & JS files for each Static CMS pages.
I know if CSS can be added in cms_page_view.xml but this will reflect in all pages.

is there anyway to add different CSS files for different static pages.


texts: Display text if attribute yes/no is set to YES in Magento2?

texts:
I'm trying to display something in the product page if a YES/NO attribute is set to YES.
Actually the only way I found to do this in multilingual magento 2.1.8 is :

if($_product->getAttributeText('MY_ATTRIBUTE') == 'Oui' || $_product->getAttributeText('MY_ATTRIBUTE') == 'Yes') {
    echo "Set to Yes";
} else {
    echo "Set to No";
};

This method needs to test the YES/NO answer for every language but I'm pretty sure there's a better way to do this...

Thanks for your help


texts: M2.4 - Product prices not displaying on the front end including VAT

texts:
I have just migrated some products from 1.9 to 2.4, but for some reason even with the settings set up for VAT excluded price, and Price to display including VAT
But for some reason, the price is excluding VAT and then in Cart/Checkout the VAT is shown as a separate amount


texts: Magento2. Product getImage returns Thumbnail instead of base

texts:
I have a custom block, which extends from \Magento\Catalog\Block\Product\View\AbstractView.
Within this block I would like to retrieve the base image.
I've tried in this way

$this->getImage($this->getProduct(), 'product_page_image_small');

but what I get is the thumbnail instead of the base image. Should I extend from some other class?


texts: magento2 prepend item into menu tree object (Topmenu)

texts:
So I've already hooked the "page_block_html_topmenu_gethtml_before" event with the observer class, I can add items to the menu tree, and it works fine, but I can't prepend items to the menu tree object. here is my code:

events.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="page_block_html_topmenu_gethtml_before">
        <observer name="topmenu_load_pre" instance="<VENDOR>\<MODULE>\Observer\TopmenuLoadPre" />
    </event>
</config>

TopmenuLoadPre.php:

<?php

namespace <VENDOR>\<MODULE>\Observer;

class TopmenuLoadPre implements \Magento\Framework\Event\ObserverInterface
{
    /**
     * @var \Magento\Framework\UrlInterface
     */
    private $_urlInterface;
    /**
     * @var \Magento\Framework\App\Request\Http
     */
    private $_request;

    /**
     * TopmenuLoadPre constructor.
     * @param \Magento\Framework\UrlInterface $urlInterface
     * @param \Magento\Framework\App\Request\Http $request
     */
    public function __construct(
        \Magento\Framework\UrlInterface $urlInterface,
        \Magento\Framework\App\Request\Http $request
    )
    {
        $this->_urlInterface = $urlInterface;
        $this->_request = $request;
    }

    /**
     * @param \Magento\Framework\Event\Observer $observer
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        /** @var \Magento\Framework\Data\Tree\Node $menu */
        $menu = $observer->getData('menu');

        // we don't have the option to prepend menu item, so...
        // TODO: clone menu tree

        // remove all menu items
        foreach ($menu->getChildren() as $node) {
            $menu->removeChild($node);
        }

        // add item that I want to be first
        $this->addItem($menu, 'First One', 'very-left-one');

        // TODO: add the system default menu items here.

    }

    /**
     * @param \Magento\Framework\Data\Tree\Node $parentNode
     * @param string $name
     * @param string $slug
     * @return \Magento\Framework\Data\Tree\Node
     */
    private function addItem($parentNode, $name, $slug) {
        $data = [
            'name' => __($name),
            'url' => $this->_urlInterface->getUrl($slug),
            'id' => 'uid-' . $slug,
            'is_active' => ( $this->_request->getFrontName() == $slug ),
        ];
        $newNode = new \Magento\Framework\Data\Tree\Node($data, 'id', $parentNode->getTree());
        $parentNode->addChild($newNode);
        return $newNode;
    }

}

The only reason I'm not getting rid of the default menu is that it already has mobile menu support and automatically adds these items in the mobile sections-navigation.

Any help is greatly appreciated.
Thanks.


texts: magento 2.3 when Product export gets “Message is added to queue, wait to get your file soon

texts: when I Product export gets “Message is added to queue, wait to get your file soon”


texts:
In logs i found this

  media/catalog/product/cache/1/thumbnail/800x800/9df78eab33525d08d6e5fb8d27136e95
  /p/a/_lindt_2132.jpg

it's an old image.
I checked in: var/cache the cache is deleted and rewrite correctly.

Does Magento write the information of image in db? Is there a way to delete definition the old image?

Why are there old images in /media/tmp/catalog/product/

Thanks


texts: Is there any possibilities to set Fedex for particular products?

texts:
Is there any possibilities to set Fedex for particular products.
If we enabled Fedex it comes for all products We need only specified products.


texts: How to override post-code.js which is in vendor/module-ui?

texts:
For testing purpose, we have modified the core file post-code.js which is in the path /vendor/Magento/module-ui/view/base/web/js/form/element and see it's working fine. So we have decided to override the file post-code.js.

For overriding, we have followed the below steps:

Created and copied the files on

  app/design/frontend/[VendorName]/[theme]/module-ui/web/js/form/element

Run the below commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

But it's not working as expected.

Could anyone please tell me how to override the "post-code.js"?


texts: How to create controller without creating menu in Adminhtml Magento 2

texts:
I have referred below Article to display button in my Configuration page.

https://magecomp.com/blog/add-a-button-in-magento-2-stores-configuration-with-custom-action/

In file

  app\code\Vendor\Extension\Block\System\Config\Button.php

there is a function where we can define our Ajax URL

public function getAjaxUrl()
    {
        return $this->getUrl(‘your action Url’);
    }

So for this, I want to create controller in Adminhtml which i can access using action url.
but all the examples i found also creates menu in sidebar in addition to controller action.

For example this one:
https://www.maximehuran.fr/en/admin-controller-creation-with-magento-2/

Is there any way to access controller action without creating menu?

Edit:
After some modification to code, I can get into the controller using below URL:

  my_backend_url/route_id/controller_name/index

but it redirects back me to Dashboard page.

As mentioned in this article:

Magento 2 Custom Admin Action Redirected to Dashboard

It's Secret Form Key issue.

We can get Secret form key only if we add controller to menu which i don't want to do!

Disabling Secret Form key is not what i prefer!


texts: How to add some custom text on action area on admin side

texts:
From the image given below how can i add a text in that area.

I have created the listing page using ui components

 <argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">order_edit.order_items</item>
        <item name="deps" xsi:type="string">order_edit.order_items</item>
    </item>
    <item name="spinner" xsi:type="string">spinner_columns</item>
    <item name="buttons" xsi:type="array">
        <item name="back" xsi:type="array">
            <item name="name" xsi:type="string">back</item>
            <item name="label" xsi:type="string" translate="true">Back</item>
            <item name="class" xsi:type="string">action-default scalable back</item>
            <item name="url" xsi:type="string">*/*/index</item>
        </item>
        <item name="update" xsi:type="string">Company\mModule\Block\Adminhtml\Orders\Edit\Button\Send</item>
    </item>
</argument>


texts:
I am trying to install Magento in mac 10.10, I tried both version 1 and 2, after installation.

It just show the white screen no content, chrome says "Failed to load resource: net::ERR_EMPTY_RESPONSE" when I checked the apache log it says "[core:notice] [pid 87] AH00052: child pid 95385 exit signal Segmentation fault (11)"

ini_set('display_errors', 1); is added to index page but there is no any error message in the page

Developer mode has also been enabled.

Jul 21 12:48:47 dtuladharmac.local CloudKeychainProxy[730]:  __39-[UbiqitousKVSProxy doSyncWithAllPeers]_block_invoke_2 <UB--s--C---> syncWithAllPeers (null), rescheduling timer
Jul 21 12:48:55 dtuladharmac com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.system): Session adoption is only allowed in user domains.
Jul 21 12:48:55 dtuladharmac.local nohup[15931]: Could not adopt Background session: 125: Domain does not support specified action
Jul 21 12:48:55 dtuladharmac com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.system): Session adoption is only allowed in user domains.
Jul 21 12:48:55 dtuladharmac.local nohup[15932]: Could not adopt Background session: 125: Domain does not support specified action
Jul 21 12:48:55 dtuladharmac com.apple.xpc.launchd[1] (com.mysql.mysqld[15873]): Service exited with abnormal code: 1
Jul 21 12:48:55 dtuladharmac com.apple.xpc.launchd[1] (com.mysql.mysqld): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Jul 21 12:49:02 dtuladharmac.local secd[566]:  __SOSCCProcessSyncWithAllPeers_Server_block_invoke sync with all peers failed: (null)

this is system log issue


texts: Ship to certain countries but allow any country in billing address

texts: My company only ships to a few countries but we would like to allow billing addresses from additional countries we do not ship to. How can I change the countries available in the dropdowns for shipping and billing addresses independently?


texts: Magento 2.1.11 - Interceptor throwing ltrim expects 1 parameter to be string, object given warning exception

texts:
I want to make a plugin to do something around a custom made checkout method. I do have other interceptors working prior to adding this, but this one I am getting a ltrim warning.

  CRITICAL: Exception: Warning: ltrim() expects parameter 1 to be string, object given in /mnt/magento_prime/vendor/magento/framework/Code/Generator/EntityAbstract.php on line 152 in /mnt/magento_prime/vendor/magento/framework/App/ErrorHandler.php:61

I have no clue what should be causing this, and it is giving me a headache.

Vendor\Module\etc\di.xml

<!--Snippit-->

<type name="Vendor\Module\Model\Magento_Checkout\PaymentInformationManagement">
    <plugin name="Vendor_Module::Model_PaymentInformationManagement" type="Vendor\Module\Plugin\Vendor_Module\Model\PaymentInformationManagementPlugin" />
</type>

<!-- Snippit -->

Vendor\Module\Plugin\Vendor_Module\Model\PaymentInformationPlugin

namespace Vendor\Module\Plugin\Vendor_Module\Model;

class PaymentInformationManagementPlugin
{

    public function aroundSavePaymentInformationAndPlaceOrder(
        \Vendor\Module\Model\Magento_Checkout\PaymentInformationManagement $subject,
        \Closure $proceed,
        $cartId,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
    ){
        // run parent method and capture int $orderId
        $orderId = $proceed($cartId, $paymentMethod, $billingAddress);

        return $orderId;
    }
}

I have looked at questions like:

Magento 2 Error occured after upgrade : Warning: ltrim() expects parameter 1 to be string, array given

But the solutions, like removing the var folders, do not work.


texts: Multi-store: Stores inherit global products

texts:
I saw a similar question which was closed due to being "to broad," so I'm really hoping my is more specific/simple. In short, I'm in need of a multi-store solution/module which allows the concept of "global products," where each store can only inherit them with certain customizations – pricings, coupons, inventory etc – and not add new ones.

So, is there a module available for this requirement? Apparently Marketplace doesn't support this.


texts: Magento 1.9.3.3 one page checkout - Unable to go ahead of Payment Information tab

texts: I am using default Magento one page checkout. on checkout page I am unable to continue to "Order Review" tab.


texts:
I added a prodct list widget that should show products from one category, sort by position.
Sort products in widgets seems not to work, so I tried a suggested module from this question. It adds a plugin for afterCreateCollection() and (nearly) works.
It adds
ORDER BY `cat_index_position` ASC

but the query still isn't correct.
SELECT DISTINCT  `e`.*, `cat_index`.`position` AS `cat_index_position`,
`price_index`.`price`, `price_index`.`tax_class_id`,
`price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL,
LEAST(price_index.min_price, price_index.tier_price),
price_index.min_price) AS `minimal_price`, `price_index`.`min_price`,
`price_index`.`max_price`, `price_index`.`tier_price` FROM
`catalog_product_entity` AS `e`

 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON
cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND
cat_index.visibility IN(2, 4) AND cat_index.category_id=1146

 INNER JOIN `catalog_product_index_price_store` AS `price_index` ON
price_index.entity_id = e.entity_id AND price_index.customer_group_id = 0
 AND price_index.website_id = '1' WHERE (price_index.store_id = 1) AND
(price_index.store_id = 1) AND (price_index.store_id = 1) AND
(((IFNULL(`e`.`entity_id`, 0) IN (SELECT
`catalog_category_product`.`product_id` FROM `catalog_category_product`
WHERE (category_id IN ('1397')))) )) ORDER BY `cat_index_position` ASC

This part is correct, 1397 is my select category.
WHERE (category_id IN ('1397')))) )) ORDER BY `cat_index_position` ASC

This one is wrong. 1146 is the root category. It is not set as "anchor", contains no product, but has entries in catalog_category_product_index_store1. The position is set for some reason, with different values as for category 1397.
AND cat_index.category_id=1146

Any ideas how to fix this?
Magento 2.3.6


texts: Magento 2 changed .php file in core but nothing happens

texts:
I am doing some changes to make digits in units working. I changed

vendor/magento/module-checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

In my test it works correct, but in live environment the change is not comming true.

Other changes in .php files are working correct


texts: Magento2 price filter with special price for configurable product

texts:
For Configurable product how can we get price filter with special price in magento2? Now its filtering with original price.
if i have a product with retail price:20 and special price:10, price filter is working with retail price. How to change it to special price range.


texts: Extract Magento original image file from cache url

texts: An example how can i get the original image file without watermark (cache) http://media.cdn.perfectwatches.cn/media/catalog/product/cache/41/thumbnail/d58d221d145737832062eac5ca81956a/r/rl103/f.jpg


texts: How to add featured grid column in category section just after position

texts:
I want to add a featured column just after position column in the following section

Catalog -> Manage Categories -> Category Products

This column should have checkboxes. The products for which checkboxes are checked will be considered as featured products for that specific category and will be listed in the frontend.

Any help or clue will be highly appreciated.

Thanks.


texts:
Getting below error while sending mail with Magento 2.3.2:

Line <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html style="font-size: 62.5%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-size-adjust: 100%; background-color: #f5f5f5;"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <style type="text/css"> does not match header format!

The Code being tried is as Below:

$toemail = "example@example.com";
$emailTempVariables = array('cid'=>$customer->getId(),'cemail'=>$email,'cname'=>$firstname.' '.$lastname);
            $senderName = $firstname.' '.$lastname;
            $senderEmail = $email;
            $postObject = new \Magento\Framework\DataObject();
            $postObject->setData($emailTempVariables);

            $sender = [
                        'name' => $senderName,
                        'email' => $senderEmail,
                      ];

            $transport = $this->_transportBuilder->setTemplateIdentifier('email_template_identifier')
                ->setTemplateOptions(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID])
                ->setTemplateVars(['data' => $postObject])
                ->setFrom($sender)
                ->addTo($toemail)
                ->setReplyTo($senderEmail, $senderName)
                ->getTransport();
            $transport->sendMessage();

Please help if someone have any idea on it.


texts: Get discount amount for customer group in magento

texts:
I have customer group id.

I need to get sales rule for this customer group.

And after that I want to get discount amount in % for this sales rule;

$customer_from_session = Mage::getSingleton('customer/session')->getCustomer();
$customer_from_db = Mage::getModel('customer/customer')->load($customer_from_session->getId());
$group_id = $customer_from_db->getGroupId();

And by $group_id I need to find actual discounts

Much thanks!


texts: Ajax request issue on adminhtml controller

texts:
This is my prototype code:

new Ajax.Request(BASE_URL + 'hospitals', {
        method: 'post',
        postBody:'store_id='+store_id+'&isAjax=1',
        onSuccess: successFunc,
        onFailure:  failureFunc
    });

This is my controller:

class Mynamespace_Mymodul_Adminhtml_HospitalsController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
      var_dump($this->getRequest()->getPost('store_id')); exit();
    }
}

The url it set correct. The post parameters are correct and they are sent. But i  the response is this:

{"error":true,"message":"Invalid Form Key. Please refresh the page."}

What should I do ?


texts: CSV Import: editing configurable childs not working

texts:
I want to change the price of associated simple product for a configurable product. I want to do it by CSV import. this is my csv file.

sku,price,_super_products_sku,_super_attribute_code,_super_attribute_option,_super_attribute_price_corr
L_TABLET_ASUS_TRANSFORMERPAD_TF103CG,300006,,,,
,555555,L_TABLET_ASUS_TRANSFORMERPAD_TF103CG-white,atrb_color,white,2222

I put the behavior to "replace existing complex data" and all the values are valid.

The price change in the configurable product works, but for the simple product is not changing.


texts: How to get Cart Id and Subtotal in sales_order_save_after observer?

texts:
I have to call some API on order status complete. For that I need values for the following.

credit card number (16 digits).
CVV
subtotal
and I have already called an API while place order I need to pass some of the response of that API here.

and my code is below

 public function execute(Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        $controller = $observer->getControllerAction();

        if($order->getState() == "complete")
        {

           $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
           $cart = $objectManager->create('Magento\Checkout\Model\Cart');
           $payment = $order->getPayment();
           $order_id = $order->getIncrementId();
           $creditCardNumber =  $payment->getCcNumber();
           $CCV = $payment->getCcCid();
           $SubtotalAmount =(double)$cart->getQuote()->getSubtotal();
           $Rate = $_SESSION["rate"];//This is the response of API called on place order.

        }

for the above code my output is

credit card number = null (if i use getCcLast4() its working, but i want full 16 digits number).
CVV  = null
subtotal = 0
and I have already called an API while place order I need to pass some of the response of that API here. = log error.

can any one help me to solve this?


texts: How to Display Cross Sell Products on Products Details Page Under tab Section?

texts:
I am trying to add cross sell products under product details page tab section, and using below code but not working in magento 2.3.5
<block class="Magento\Checkout\Block\Cart\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssellstab" as="crossselltab" group="detailed_info" >
            <arguments>
                <argument translate="true" name="title" xsi:type="string">Cross sell</argument>
                <argument name="type" xsi:type="string">crosssell</argument>
            </arguments>
        </block>

Please help, how to i can fix this issue ?


texts: How to ad background image on header-panel

texts:
so, i am trying to customise my header-panel! i want add background image insted of background color!! inside my _theme.less file

     .page-header {
.panel.wrapper {
     position: fixed; width: 100%; height: 100px; z-index: 5;
    .lib-css(background-color, @white);
}

}

this code is working fine! but i want to add image instead of that color!! what i exactly need to do?


texts: Most efficient way of saving a product attribute

texts:
In Magento 1 we used to use the 'saveAttribute' function to avoid using the save() function of the product model.

How can we do this in Magento 2? Which ways are best to use?

Edited:

Here is my code:

$key[] = 'url_path';
$data[] = 'some-uri';

if ($this->productModel->getIdBySku($productData['sku'])) {
    $product = $this->productRepository->get($productData['sku']);

    foreach ($productData as $key => $data) {
        $product->setData($key, $data);
        try {
            $this->productResource->saveAttribute($product, $key);
        } catch (\Exception $e) {
            echo $e->getMessage() . "\n";
        }
    }
}

The error I get:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'catalog_product_entity.value_id' in 'field list', query was: SELECT `catalog_product_entity`.`value_id`, `catalog_product_entity`.`value` FROM `catalog_product_entity` WHERE (attribute_id='74' AND entity_id='4' AND store_id=0)

Importing product 1003

Thanks!


texts:
I'm using the Magento 1.9 Modern Theme and trying to add the third column but having trouble.

http://www.janetscloset.com/admin4190/Library

That's the link above, I can't get it to the right. Any ideas?

Also, on my left hand column I'm trying to move the compare products and cart to the right column. How would I do that? I just want my vertical menu in the left column.

Any help would be appreciated


texts: How to show Gift Message on Order Invoice Pdf Magento 2?

texts:
I am trying to display Gift Message on Order Invoice Pdf if order
  customers are applying Gift Message While placing order Magento 2. If
  anyone have idea please guide me.


texts: Displaying a specific product's attributes on a CMS page

texts:
Hi Guys I am just wondering how I can display a specific product on a CMS page and display it's attributes?

Any ideas on how how this can be done?


texts: Blank order detail page after rename product SKU in magento 1.8


texts: Magento add FROM-TO filter in column sales grid

texts:
we added a custom column that has integer value. How can we now add a FROM-tO filter like below?

Is there a special command for this?

$this->addColumn('created_at', array(
    'header' => Mage::helper('sales')->__('Purchased On'),
    'index' => 'created_at',
    'type' => 'datetime',
    'width' => '100px',
    'filter_index' => 'main_table.created_at'
));


texts: How to get product category data from observer

texts:
I am using the following to get the complete product data from the observer:

$product = $observer->getProduct()->getData();

But I could not notice any information about the category of the product.

How can I get the data about the product category, such as category id from the observer?


texts: How to know which of the Magento Pages is the active homepage?

texts:
I'm new to Magento. It looks like there's no label which of the pages is the homepage.

How would I know which of the pages in the screenshot is the active homepage?


texts: Out of stock products and count not displaying in layered navigation

texts:
We have 1 out of stock product and 78 in stock products. But in layered navigation I am getting In stock(79) which is wrong.

I have set "Display out of stock product to YES" in admin configuration.

Please check image for more clarification.


texts: How to hide custom template in checkout page for specific products in magento 2

texts:
I created a custom module which adds an input in shipping method for all products in the checkout page. I want to hide and show this input as per specific category products and replaced this old to new inputs on the checkout page. Does anyone knows this? Thanks in advanced.

checkout_index_index.xml

<item name="shippingAdditional" xsi:type="array">
 <item name="component" xsi:type="string">uiComponent</item>
  <item name="displayArea" xsi:type="string">shippingAdditional</item>
     <item name="children" xsi:type="array">
        <item name="delivery_date" xsi:type="array">
           <item name="component" xsi:type="string">Module_name/js/view/delivery-date-block</item>
           </item>
        </item>
     </item>
 </item>


texts: Magento 2.3.4 order and comment email stops working after upgrading from PHP 7.1 to 7.2

texts: I'm having an issue when upgrading my PHP version to 7.2 to get ready for a system upgrade to Magento 2.4 and the backend email system stops working.  I don't receive new order emails and can't send out comment emails to customers.  Any ideas?


texts:
Can anyone suggest what are the best practices relevant to the followings.

Magento coding standards.
Magento naming conventions (including folder names, file names etc.)
Folder structure which should follow when creating new module / overriding core files etc
Versioning standards.


texts: How to debug php which is run by cron job only

texts:
I am trying to customize Ebizmart Mailchimp extension. This extension has few batch processing which are run by Cron job.
My Server is in Ubuntu VM and my IDE is netbean run on Windows. Debugging elsewhere is fine.

By customizing Ebizmart Mailchimp extension, I’ll collect specific subscribers and send them to mailchimp account. If I could trace its underlying php files which are run by cron job, I could easily modify its model.

Thanks.


texts: How to convert rate from any currency to base currency in magento 2

texts:
class Data extends AbstractHelper
{
    protected $_storeManager;
    protected $_currencyFactory;

    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Directory\Model\CurrencyFactory $currencyFactory,
        ) {
        $this->_storeManager = $storeManager;
        $this->_currencyFactory = $currencyFactory;
        parent::__construct($context);
    }

    function convertRate(){
        $quoteAmmount = 15;
        $baseCurrencyCode = $this->_storeManager->getStore()->getBaseCurrency()->getCode();
        $quoteCurrency = 'CAD';
        $rateToBase = $this->_currencyFactory->create()->load($quoteCurrency)->getAnyRate($baseCurrencyCode);
        $totalAmount = $quoteAmmount * $rateToBase;
    }
}

This is my custom code and I want to convert my CAD quote price to my store base currency which is USD. But this code returned 0.
What is the problem?


texts: Reporting tools for shopping basket price rules useage

texts:
I'm looking for a way to find information on promotional code in the Shopping basket price rules such as how many times it's been used, on what products etc.

Using a standard google search I've been unable to find anything related to this, so anything to put me in the correct place to find more information would be useful.

To note: I'm looking for a reporting tool and would like to avoid checking each order one by one if possible.


texts: Magento 2: Reset password link returns 404 page

texts:
I seem to have a problem with the reset-password-page in Magento 2.2.5.
On my dev server with email configured, I successfully receive the reset-password-link via mail. Checking the database reveals that the rp_token is updated once I request a new password reset. However, visiting the reset link gives me a magento-404-page. ("Whoops, our bad...").
I also tried to create a fresh local install of Magento 2.2.5. Except I didn't set up email and just used the URL pattern to manually create the reset link with the corresponding data from the database (after I went through the forgot-password-form, so the token gets updated). Still the same 404 error.
It doesn't seem to be a problem with Magento itself since I also tried a fresh install of Magento 2.1.7 with the same
Edit:
I configured the email service via mageplaza/module-smtp on my fresh Magento 2.1.7 install and the reset-password link works now. So the problem seems to lie there. The original install on my dev server is actually a migration from Magento 1 to Magento 2, I haven't touched the email settings since they were working fine for everything else. I'll try to mess around with the settings and keep this post updated, in case anyone runs into a similar problem.
disclaimer: this is my first Magento project
Edit 2:
Configuring mageplaza/module-smtp on my dev server didn't seem to help. All emails are being sent correctly, but the reset-password-link is still returning a 404 error.
Last Edit:
Looks like reverting the email templates back to the corresponding defaults at "Stores>Configuration>Customers>Customer_Configuration>Password_Options" in combination with a configured mageplaza smtp-module has solved my issue.


texts: Magento 2 : Setting session variable not working

texts:
I have a problem with session variable. Basically it's not working and ruining what is working.
Here my code :

  app/code/vendor/CustomerZipCode/Block/Ziplist.php

<?php
namespace Vendor\CustomerZipCode\Block;
use Magento\Framework\View\Element\Template;

class Ziplist extends \Magento\Framework\View\Element\Template
{
    public function __construct(Template\Context $context,array $data = array())
    {
        parent::__construct($context, $data);
        $this->setData('zip','');
    }

    public function setZipcode($zipcode)
    {
        $this->setData('zip',$zipcode);
        Mage::getSingleton('core/session')->setZipCode($zipcode);
    }
}

Should I code a use something or import something for use

    Mage::getSingleton('core/session')->setZipCode($zipcode);

?

If someone had the same issue and solve it or see what is wrong I would be really glad.
PS: In case of minus please let me know so that I can improve the post


texts: CMS Pages are not reflecting changes even after upgrade-deploy-flush-clean

texts:
The problem is that the CMS pages are created once they are newly added.
But when i edit and do changes from backend(admin) the changes are not showing even after upgrade and deploy which is followed by flushing.
when i am using mgt-development tool
the toolbar show the mode of application.when i created a CMS page in default mode and i change the mode after it, it still shows default mode for it and other dynamic pages show correct mode


texts:
hey guys i have a problem running Meagento commands setup & compile because of memory limit it's 256.

i have requested from the hosting company to increase my memory limit to 1024MB and they did. i can see the change on php.ini file at root folder in cpanel.

but when i ran the commands i got the same errors again of memory limit so i checked the limit with

php -r "echo ini_get('memory_limit').PHP_EOL;"

i found that it is still 256MB. Is there any place where in my Magento that this limit is saved ???

any help please i'm stuck


texts:
I have a cart rule as specified here. It is applied to the shipping when 2 items have been added to the cart

http://imgur.com/a/1Ulrw

I have a 20% tax rule (United Kingdom) being applied to the product price and the shipping. For the product price it is being deducted correctly, for delivery however it is applying it PRE discount instead of POST discount (so TAX is being applied to £160 shipping instead of £120)

http://imgur.com/a/zSGth

Here is my tax rules, I am pretty well stumped to why this is happening

imgur.com/a/DBq4f

Any help appreciated


texts: Why are all product options selected on the update page?

texts:
Before I add a bundle product to the cart, I'll uncheck one product option from bundle selected options (attach)

but when I want to edit this product, all parameters are selected by default in the update page (attach)

Is this ok?


texts: Strange email sending behaviors on CE 1.9.1.0

texts:
I have read about and am realized that order-related emails are now queued up in the database instead of being sent out directly in CE 1.9.1.0.

I have installed two magento's onto two different servers, both of which are CE 1.9.1.0. And I have not configured the cronjobs for any of them. One of them behaved just as described in the release note. I could find new records in the table core_email_queue. However, for the other one, emails were sent out immediately without any records created in the table core_email_queue.

Actually, the one that "bypassed" the email queue was not installed and configured by me. So I wonder how I could find out why they behaved differently, given that no classes have been overridden in both magento's.

Thank you in advance.


texts: Magento2.1 not loading css, js and admin panel after installation

texts:
I have installed magento2.1 CE. And it is not loading css, js and admin panel also.

I have set web/seo/use_rewrites to 0, but still admin is not loading.

I have also tried to remove contents under pub/static (excpt .htaccess) and changed the recommended path to,

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

And also cleared var folder. But still nothing happened, no loading of css, js and admin panel.

Also, running this command :

php bin/magento setup:static-content:deploy

I keep getting this error :

PHP Fatal error: Uncaught Error: Class 'Locale' not found in /var/www/html/magento2/vendor/magento/framework/Locale/Bundle/DataBundle.php:64
Stack trace:

0 /var/www/html/magento2/vendor/magento/framework/Locale/Bundle/DataBundle.php(28): Magento\Framework\Locale\Bundle\DataBundle->cleanLocale('en_US')
1 /var/www/html/magento2/vendor/magento/framework/Setup/Lists.php(80): Magento\Framework\Locale\Bundle\DataBundle->get('en_US')
2 /var/www/html/magento2/vendor/magento/framework/Validator/Locale.php(42): Magento\Framework\Setup\Lists->getLocaleList()
3 /var/www/html/magento2/vendor/magento/module-deploy/Console/Command/DeployStaticContentCommand.php(107): Magento\Framework\Validator\Locale->isValid('en_US')
4 /var/www/html/magento2/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Magento\Deploy\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
5 /var/www/html/magento2/v in /var/www/html/magento2/vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64


texts: How to override wishlist template file view.phtml

texts:
I have tried this two code in my local.xml file to override wishlist view.phtml

First one:

<wishlist_index_index translate="label">
        <reference name="my.account.wrapper">
                <block type="wishlist/customer_wishlist" name="customer.wishlist" template="inquiry/wishlist/view.phtml"/>

        </reference>
    </wishlist_index_index>

But it is not showing the content of view.phtml though file got overridden by these two code.
(OR)

<wishlist_index_index translate="label">
            <reference name="customer.wishlist">
                <action method="setTemplate">
                    <template>inquiry/wishlist/view.phtml</template>
                </action>
        </reference>
    </wishlist_index_index>

Both are override my view.phtml file but content of view.phtml not showing.

what is the proper way to override wishlist view.phtml ?


texts: Product created programmatically unable to add to cart in magento 1.9.2?? It gives error "The product could not be found."

texts:
public function createcustomerproduct($data)
{
    Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
    $product = Mage::getModel('catalog/product');
    try {
        $LastProduct=Mage::getResourceModel('catalog/product_collection')->getLastItem();
        $custname = $this->getcustomerdata() ;
        $rnd = (int)$LastProduct->getId() + 1;
        $newsku = "$custname$rnd";

        $product
            ->setStoreId(0) //you can set data in store scope
            ->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array
            ->setAttributeSetId(47) //ID of a attribute set named 'default'
            ->setTypeId('simple') //product type
            ->setCreatedAt(strtotime('now')) //product creation time
            ->setSku($newsku) //SKU
            ->setName($newsku) //product name
            ->setWeight(4.0000)
            ->setStatus(1) //product status (1 - enabled, 2 - disabled)
            ->setTaxClassId(0) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
            ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility
            ->setDescription('This is a long description')
            ->setShortDescription('This is a short description')
            ->setSelected_category_id($data['selected_category_id'])
            ->setSelected_product_id($data['selected_product_id'])
            ->setselected_raid_hdd_qty($data['selected_raid_hdd_qty'])
            ->setPrice($data['totalamount']) //price in form 11.22
            ->setStockData(array(
                'use_config_manage_stock' => 0, //'Use config settings' checkbox
                'manage_stock' => 1, //manage stock
                'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
                'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
                'is_in_stock' => 1, //Stock Availability
                'qty' => 999 //qty
            ))
            ->setCategoryIds(array(347)); //assign product to categories

            $product->save();

        $pr = Mage::getModel('catalog/product')->loadByAttribute('sku', $newsku);
        $id = $pr->getId();
        if ($id) {
            $cart = Mage::helper('checkout/cart')->getCart();
            $data['newproductid']   = $id;
            $data['newproductsku']  = $newsku;
            $data['newproductname'] = $newsku;

            $compid = $this->saveproductquote($data);
            if($compid) {
                return $id;
            }
        }
        return $compid;
    } catch(Exception $e){
        Mage::log($e->getMessage());
    }
}

// Add to cart Function
public function saveaddtocart($visitorid)
{
    $updatecustomer  = Mage::getModel('compatibility/compatibility')->updatecustomerid($visitorid);
    $cart            = Mage::helper('checkout/cart')->getCart();
    $customerid      = Mage::getSingleton('customer/session')->getId();
    $model           = Mage::getModel('compatibility/compatibility');
    try {
        $savequote   = Mage::getModel('compatibility/savedquote')->createcustomerproduct($updatecustomer);
        $pid         = (int)$savequote;
        $newproducts = Mage::getModel('catalog/product')->load($pid);
        $cart        = Mage::helper('checkout/cart')->getCart();
        $params      = array('product' => $id ,'qty' => 1);

        $request  = new Varien_Object();
        $request->setData($params);

        $cart->addProduct($newproducts, $request);
        $cart->save();
    }
    catch(Exception $e) {
       var_dump($e->getMessage());
    }
    exit();
}


texts:
I am using Magento 2.3.3 in which I have products with name like DR. Aqua guard. Whenever Customer search using a query like "DR." It showing result from product name contains "DR" in names like "H2GO DRINKING WATER BOTTLE–SINGLE" Rather than Result of those products start with "DR.".

Execpted Result:

Actual Result:

Any clue on this please. Thank you in advance.


texts: Fatal error: Uncaught Error: Call to undefined method getScope()

texts:
getScope() method generates:

  Fatal error: Uncaught Error: Call to undefined method Magento\Framework\App\Config::getScope()

public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Framework\App\Config\ScopeConfigInterface $scope
) {
    $this->objectManager = $objectManager;
    $this->scope         = $scope;
    $this->entities      = $this->scope
        ->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
        ->getValue('oei/export_entities');
}


texts: Magento 1.9.1 Upgrade Causing Cookie to be reset

texts:
We have an AWS ELB setup for our Magento application. The ELB strips away https:// and replaces it with http://. So in our nginx we make use HTTP_X_FORWARDED_PROTO to stop Magento from redirecting to an infinite loop by making it think it's using secure session. Now we have another problem, the session is being reset every time Magento tries to access the session cookie. This started happened after we upgraded to Magento 1.9.1. The upgrade introduced the following code in Varien.php

 if (Mage::app()->getFrontController()->getRequest()->isSecure() && empty($cookieParams['secure'])) {
    // secure cookie check to prevent MITM attack
    $secureCookieName = $sessionName . '_cid';
    if (isset($_SESSION[self::SECURE_COOKIE_CHECK_KEY])
        && $_SESSION[self::SECURE_COOKIE_CHECK_KEY] !== md5($cookie->get($secureCookieName))
    ) {
        session_regenerate_id(false);
        $sessionHosts = $this->getSessionHosts();
        $currentCookieDomain = $cookie->getDomain();
        foreach (array_keys($sessionHosts) as $host) {
            // Delete cookies with the same name for parent domains
            if (strpos($currentCookieDomain, $host) > 0) {
                $cookie->delete($this->getSessionName(), null, $host);
            }
        }
        $_SESSION = array();
    }
    if (!isset($_SESSION[self::SECURE_COOKIE_CHECK_KEY])) {
        $checkId = Mage::helper('core')->getRandomString(16);
        $cookie->set($secureCookieName, $checkId, null, null, null, true);
        $_SESSION[self::SECURE_COOKIE_CHECK_KEY] = md5($checkId);
    }
}

As you can see the it checks for isSecure(), which is true because of HTTP_X_FORWARDED_PROTO. And then $cookieParams['secure'] is empty, I can assume because the session really is secure the cookie is for unsecured session. Whatever the reason it forces the cookies to be deleted.

Now User can't use session at all. Login, add to cart and checkout are all now working.

Anybody has any solution to this problem? I can't change how ELB is handling https:// and http://. So I am looking for an Nginx and Magento solution. Anybody has any ideas?


texts: Remove extra sign up newsletter checkbox on one step checkout

texts:
I have two sign up to newsletter checkboxes on the last tab of my one step checkout. How do I get rid of only one of them?

I have inspected them both and they defined exactly the same way, but they work independently from each other. So if a customer doesn't wish to receive a newsletter, they have to uncheck both.

Has anyone found this before and have a solution.

Many Thanks

Bevan


texts: Item is out of stock but available on storefront

texts:
Can you please guys explain, me how can I do this ?

"If an item is out of stock can it stay on the site but say 'More stock on its way' and not allow people to order until stock is available again."


texts: Shipping methods controlled by post codes

texts:
I use Magento 2.3.4 and I have 3 shipping methods that are running at the same time but I want them to only display one at a time.
The entire shipping system runs off a set of post codes. for the sake of clarification, these are the post codes:
IV1 1AA,
IV1 1AD,
IV1 1AX,
IV1 1BA,
IV1 1DA,
Secondly, the shipping system runs off a minimum order amount of $1.
Below are the present settings for the 3 shipping methods
1. Table Rate
This runs off a set of post codes and only displays when the available post code is inserted. This works great. no concerns here.
2. Flat Rate
This runs off a minimum order amount of $1 but we want it to display based on the above post codes. In the absence of the above post codes, it shouldn't display
3. Free Shipping.
This runs off a minimum order amount of $1 but we want it to display based on the above post codes. In the absence of the above post codes, it shouldn't display.
I tried to use CART RULES but didn't work out great.
My Request is this... I want an extension that can manage the display of each of the above 3 shipping methods 1 at a time and not all 3 to display at the same time
I need to know of any premium extension that can handle the 3 options above or any  method in Magento platform I can use to get it done.


texts: Show one category products at the end of product search results page

texts:
I have a category "pre-order". How can I have the products from this category shows at the end of product search results page?

i found this plug-in to have the out of stock display in the ned, how to i have the product in category id:123 to show up at the end?

<?php
/**
 * @author Rakesh Jesadiya
 * @package Rbj_OutOfStock
 */

namespace Rbj\OutOfStock\Plugin\Product\ProductList;

class Toolbar
{
    /**
     * @param \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $subject
     * @param bool $printQuery
     * @param bool $logQuery
     * @return array
     */
    public function beforeLoad(\Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $subject, $printQuery = false, $logQuery = false)
    {
        $orderBy = $subject->getSelect()->getPart(\Zend_Db_Select::ORDER);

        $outOfStockOrderBy = array('is_salable DESC');

        /* how to i get the array of products from category 123"? */

        /* reset default product collection filter */
        $subject->getSelect()->reset(\Zend_Db_Select::ORDER);
        $subject->getSelect()->order($outOfStockOrderBy);

        return [$printQuery, $logQuery];
    }
}


texts: magento2 upgrade - readiness check fails and uses system php instead of webserver

texts:
I've installed magento2 without issues and at installation it detected my php version correctly (7.0.0, using mamp). Now at upgrade it detects the system one (5.5.31) and some packages missing, like mcrypt.

using phpinfo() on my webserver gives version 7.0.0 and mcrypt enabled.

Why is that and how can it be fixed?


texts: Magento category layout update: Set "Position of attribute in layered navigation block"

texts:
Magento attributes sort order (position) can be set on the attribute level using the element Position of attribute in layered navigation block.

We have some categories that are built bassed on a specific attribute. Normally size is the 6tc position/order of atrtibute filters in layered navigation.

For one category I would like to move the "Position of attribute in layered navigation block" to say position 1 (top).

Question: can this be done via a category layout update?

thanks, Sean


texts: How to upload svg iamges in CMS pages in magento 2

texts:
I wish to add svg images in cms pages in backend.
While uploading .svg images, it shows invalid file.
Please provide me a solution to upload svg images in cms pages in magento 2


texts: Magento 1.x - How to create a copy of my shop for testing?

texts:
I want to create a copy of my shop so I can develope and test without destroying anything on the live.

I already copied the database and renamed it to "magento_dev", but what do I have to change in my copied magento project, to tell it to use the new database "magento_dev"?

I also changed <dbname><![CDATA[magento]]></dbname> to <dbname><![CDATA[magento_dev]]></dbname> in app/etc/local.xml.

I also edited web/unsecure/base_url and web/secure/base_url in the database table "core_config_data" to fit the new url.

Before: http://localhost/projekte/magento/shop/
After: http://localhost/projekte/magento/shop_dev/

I also deleted the folder var.

But I get "There has been an error processing your request".


texts: Magento 1.9 how to remain products after customer logout also in cart

texts:
I want to keep products in cart after customer logout also.

<events>
    <customer_logout>
        <observers>
            <pengo_customer_logout_observer>
                <type>singleton</type>
                <class>Pengo_Customer_Model_Observer</class>
                <method>preserveQuote</method>
            </pengo_customer_logout_observer>
        </observers>
    </customer_logout>
</events>

public function preserveQuote(Varien_Event_Observer $observer)
{
    $customerQuote = Mage::getModel('sales/quote')->loadByCustomer($observer->getCustomer());
    $currentQuote = Mage::getSingleton('checkout/session')->getQuote();
    $currentQuote->merge($customerQuote);
}


texts:
I am on a site magento 1.7.0.2

I created a module to add an attribute in the customer account.
At first it worked, my field has been added and then I realized that I had made a spelling mistake.

so I deleted directly attribute from phpmyadmin.

And when I relaunched the website I get this error when I go to customer management:

Fatal error: Call to a member function getBackend() on a non-object

I tried many things but I have found no solution.

Here are my files :

$installer = $this;

$installer->startSetup();

$this->addAttribute('customer', 'demande', array(
    'type' => 'int', // varchar, text, int, static, datetime
    'input' => 'boolean', // text, select, date
    'label' => 'Demande de compte professionnel',
    'global' => 1,
    'visible' => 1,
    'required' => 0,
    'user_defined' => 1,
    'visible_on_front' => 1
));

/**
 * Si attribut de type select :
 * 'type' => 'select',
 * 'source' => 'eav/entity_attribute_source_table',
 * 'option' => array('values' => array('Mon Option 1', 'Mon Option 2')),
 */

Mage::getSingleton('eav/config')
    ->getAttribute('customer', 'demande')
    ->setData('used_in_forms', array('adminhtml_customer', 'customer_account_create', 'customer_account_edit', 'checkout_register'))
    ->save();

$installer->endSetup();

my config.xml file :

 <admin>
    <routers>
        <customfield>
            <use>admin</use>
            <args>
                <module>Digitgold_Demande</module>
                <frontName>customfield</frontName>
            </args>
        </customfield>
    </routers>
</admin>

<global>
    <fieldsets>
        <customer_account>
             <demande><create>1</create><update>1</update><name>1</name></demande>
        </customer_account>
    </fieldsets>
</global>
<global>
    <resources>
        <customfield_setup>
            <setup>
                <module>Digitgold_Customer</module>
                <class>Mage_Customer_Model_Entity_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </customfield_setup>
        <customfield_write>
            <connection>
                <use>core_write</use>
            </connection>
        </customfield_write>
        <customfield_read>
            <connection>
                <use>core_read</use>
            </connection>
        </customfield_read>
    </resources>
</global>

thanks


texts: Magento connect manager is not present at the admin panel

texts: I've installed magento on my local server but the issue is that i don't see magento connect manager at the admin panel please advise.


texts: Upgrading magento2 installation with fresh install, outdated modules warning

texts:
I'm a little stuck when i started om my project i cloned the Magento2 dev repo instead of composer or manual instal..

Now i want to sort this out since my project is almost going live but still on 2.0.0. When i create a clean install i get the following error

The following modules are outdated:
Magento_Theme schema: current version - 2.0.1, required version - 2.0.0
Magento_Theme data: current version - 2.0.1, required version - 2.0.0
Magento_Customer schema: current version - 2.0.7, required version - 2.0.6
Magento_Customer data: current version - 2.0.7, required version - 2.0.6
Magento_Cms schema: current version - 2.0.1, required version - 2.0.0
Magento_Cms data: current version - 2.0.1, required version - 2.0.0
.....

This is just een excerpt many more modules..
Am i mising something?