texts: saving new category programmatically with setPath

texts:
Now this is the sort of problem I would help others with but I am flummoxed.
I am creating new categories in an import routine, e.g.

$this->magObject = Mage::getModel("catalog/category");
$this->magObject->setName($item["name"]);
$this->magObject->setData("agilityId",$item["id"]);
$this->magObject->setIsActive($this->isActive);
$this->magObject->setIsAnchor($this->isAnchor);
$this->magObject->setPageLayout($this->pageLayout);
$this->magObject->setStoreId(Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID));
//$this->magObject->setPath ("1/2/6") ); //actually got by getting path of specific required parent
$this->magObject->save();

Without the setPath it saves fine, but with the wrong path (obviously).  When the setPath is included, nothing happens.  I know that there are devious magento elements at work that prevent writing to _entity tables unless certain circumstances are met but I thought I was meeting them .   I am already performing the usual

define("ADMIN_STORE_ID",1);
//...
Mage::app();
Mage::setIsDeveloperMode(true);
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));

at the start but in this instance it just is not working.  I have similar scripts on other sites that do work.  Only difference with this site is that there are multiple store fronts

3 UK
7 Spanish
5 German
6 French
1 Default Store View

Anyone spot something obvious that I am missing, whilst I still have some hair left?

Oh this is using Magento 1.9.1.1.


texts: Using /en and /fr Magento 2 multi language and domains

texts:
I have a Magento ver. 2.2 installation with two store views, one for English and one for French.

I want to use /en and /fr for the domains but when I do, all of the template assets try to call from /en and /fr as opposed to the root domain itself.

I am hosting through Nexcess.net and they said that it isn't on their end but they used to help with Magento 1 in this respect.

Am I missing something to be able to set the base url for each store view to example.com/en and example.com/fr?


texts: How to enable review section in magento 1.9.2.2

texts:
I have 'Write a review' link in my product details page.It was working fine in magento 1.9.0.1. Now when I migrated my code to fresh magento 1.9.2.2 The link is not working instead a page like this is opening indicating error:

Should I do anything at backend admin panel?

Here is my code which I used to display the 'Write a review' link in details page.

            <?php
                        $summaryData = Mage::getModel('review/review_summary')->setStoreId($storeId)->load($_product->getId()); // returns

                        $reviewsCount = $summaryData->getReviewsCount();
                        if($reviewsCount){

                            }
                        else{ ?>

<a href="<?php echo $this->getStoreUrl()."/review/product/list/id/".$_product->getId()."/#review-form";?>">Write a Review

<?php }
                        ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'default', false)?>


texts: How to call custom created phtml file in Cms page in magento 2?

texts:
I am finding a way to call my custom created phtml file in Cms page. The file is located in Magento_catalog > product > bestseller.phtml, And the way which I am trying is -

{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_catalog::product/bestseller.phtml"}}

{{block class="Magento\Catalog\Block\Product\View\Description" template="Magento_Catalog::product\bestseller.phtml"}}

But the file is not loading in Cms page. Please help me to do it.

Thanks


texts: Enable Cache while installing extension?

texts:
The custom for me has always been to totally disable the cache before installing any extensions.   Today I went to install an extension and discovered the installation instructions said,

  It’s required to enable cache in the administration panel of your site. Go to System/Cache Management. Choose all caches and take action “Enable” then submit.

I have never heard of Enabling Cache the first.

Is this the correct way to install an extension?

While the custom is to disable the cache (it seems obvious why), can someone elaborate on the ramifications of having the cache on/off while installing an extension?


texts: How to add shipping price for all individual product

texts: I want shipping price for individual product, not depending country, state or anything. For example one product's shipping price is $5 but another one product's shipping price is $8. How to give shipping price for individual product?


texts:
I get it, Magento 2 is slow. We are following all the official best practices from Magento docs and suggestions and tips you can find out there: Varnish, Redis, no bundling, AWS, etc. In conclusion, our store works fine on cached pages, loading under 1 second... which is good "in theory", but we are still dealing with 2 major problems:

Our product catalog gets updated constantly so we are forced to flush cache several times during the day. When this this happens, every single page goes slow the first time it is visited by any customer.

There are some dynamic pages, ie. Customer's My Dashboard that are not meant to be cached based on the URL.

In these 2 scenarios, we are talking about loading times of around 10-15 seconds. Which is simply unacceptable.
All suggestions point to cache. But cache doesn't cater for a store that requires constant updates and dynamic pages.
Are we missing something or is this just the reality of Magento 2?
Thank you.


texts: Trouble in saving data to DB table, getting error 'Call to a member function setData() on a non-object'

texts:
I am getting some trouble in magento development i am trying database operation with custom my module
trying to save info to database table but getting error

Fatal error:  Call to a member function setData() on a non-object in ..../magento/app/code/local/Dinesh/Mymodule/controllers/IndexController.php on line 13

my code is here
namespace/modulename/etc/config.xml

<global>
        <models>
            <modulename>
                <class>Namespace_Modulename_Model</class>

                <resourceModel>namespace_modulename_mysql4</resourceModel>
            </modulename>
        </models>

        <namespace_modulename_mysql4>
                <class>Namespace_Modulename_Model_Mysql4</class>
                <entities>
                    <tablename>

namespace_modulename_tablename

                    </tablename>
                </entities>
         </namespace_modulename_mysql4>
</global>

Namespace_Modulename_Model_Transactions.php

class Namespace_Modulename_Model_Transactions extends Mage_Core_Model_Abstract
{
    protected function _construct()
    {
        $this->_init('namespace_modulename/transactions');
    }
}

Namespace_Modulename_Model_Mysql4_Transactions.php

class Namespace_Modulename_Model_Mysql4_Transactions extends Mage_Core_Model_Mysql4_Abstract
{
    protected function _construct()
    {
        $this->_init('namespace_modulename/transactions', 'entity_id');
    }
}

Namespace_Modulename_Model_Mysql4_Transactions_Collection.php

class Namespace_Modulename_Model_Mysql4_Transactions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
    protected function _construct()
    {
        $this->_init('namespace_modulename/transactions');
    }
}

Dinesh/Mymodule/controllers/IndexController.php

    class Dinesh_Mymodule_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
     //$this->loadLayout();
     //$this->renderLayout();
      echo "testing
";
        $paytransaction = Mage::getModel('namespace_modulename/transactions');

         print_r($paytransaction);
         //$paytransaction->setData('entity_id', $name);
      $paytransaction->setData('order_id', '2752');
      $paytransaction->setData('transaction_id', '7527');
      $paytransaction->setData('paykey', 'dsfds');
      $paytransaction->setData('transaction_status', 'dfvdf');
      $paytransaction->setData('currency', 'ffg');
      $paytransaction->setData('amount', '145');
      $paytransaction->setData('vendor_mail', 'fdbdf');
      $paytransaction->setData('sender_mail', 'dfbfb');
      $paytransaction->save();

        //$load = $paytransaction->load('2');
        //print_r($load);exit;

echo "
";
    }


texts: What is the best way to extend Store Group model?

texts:
I would like to modify Store Group model to add a few more columns needed by my business logic.

Magento 2 document only writes about extending models by EAV but I find that Store Group model does not support EAV.

Technically, It's possible to modify store_group table during module's Setup/InstallSchema.  But is it ok, by principles, to do so?

Thanks.


texts: How can I get custom attribute value from a product?

texts:
I have Magento 1.9. I have to get the value of the custom attribute of an order item. I already have the product like this:

$product = Mage::getModel("catalog/product") -> load($p -> ID);

and this is fine (I logged it, and the object is product object is ok).
To get the custom attribute value, I tried this, and none worked:

error_log("DEV 1:" . print_r($product -> getData("ds_dropship_product_id"), true));
error_log("DEV 2:" . print_r($product -> getDsDropshipProductId(), true));
error_log("DEV 3:" . print_r($product -> getAttributeText("ds_dropship_product_id"), true));
$attribute_code="ds_dropship_product_id"; // attribute with text value
$some = $product -> getDsDropshipProductId();
error_log("DEV 4:" . $some);
error_log("DEV 5:" . print_r($some, true));

$attribute_value = Mage::getResourceModel('catalog/product')->getAttributeRawValue($p -> ID, $attribute_code, 1);
error_log("DEV 6:" . $attribute_value);

$description_attribute = $product->getResource()->getAttribute($attribute_code);
error_log("DEV 7: " . var_dump($description_attribute));
//error_log("DEV 8" . print_r($description_attribute, true));

$description_attribute_value = $description_attribute ->getFrontend()->getValue($product);
error_log("DEV 9" . $description_attribute_value);
error_log("DEV 10" . $product->getData($attribute_code));
error_log("DEV 11" . $product->getResource()->getAttributeRawValue($product->getId(), $attribute_code,  $product->getStoreId()));

$attribute_code="ds_dropship_product_id";

error_log("DEV 12" . $product->getAttributeText($attribute_code));
error_log("DEV 13" . $product->getResource()->getAttribute($attribute_code)->getDefaultFrontendLabel());
error_log("DEV 14" . $product->getResource()->getAttribute($attribute_code)->getStoreLabel());
error_log("DEV 15" . $product->getResource()->getAttribute($attribute_code)->getFrontendInput());

Do you know any other known way to do this?


texts: How to remove JS added in page.xml , in One Page Checkout?

texts:
In page.xml, I added jQuery in page.xml :

<action method="addJs">
  <script>lib/jquery/jquery-2.1.3.min.js</script>
</action>
<action method="addJs">
  <script>lib/jquery/noconflict.js</script>
</action>

However, I have to remove jQuery in One Page Checkout page, which is controlled by checkout.xml. How can I remove the jQuery in One Page Checkout pages?

I'm using Magento 1.9.1.


texts: Why isn't the order updating when something is added to the cart?

texts:
I've created an order for the customer's cart using the following code (When the customer clicks checkout on the app we're making):

$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$order = $service->getOrder();

However, when a product is added/removed to the cart, the order items remain the same as before the update. How am I supposed to handle the update to the order? Do I cancel all orders the cart has and create a new one? Or is there a way to properly update the order when a new item is added to the cart?


texts: Customer Register Page Validate min 1 Char to 10 Charcters - Magento 2

texts:
I am trying to Change Validation in customer Registration page for first name and last name.

I know i can do this by setting maxlimit by overriding core template in theme folder.

  vendor/magento/module-customer/view/frontend/templates/widget/name.phtml

But i dont seem this to be solid.

Any other Suggestions

Thanks


texts:
What is the use of indexer.xml ?
I mean what it does?
Please help.


texts: Magento 2 - Change the layout programatically in Controller

texts: I want to change default layout file programatically such that if a user is logged in, it will load 2-columns. Otherwise, it loads 1-column. How can do it in Magento 2?


texts: I'm getting an error whenever, I click sign in. in magento 2

texts:
I'm having an error messages everytime i click sign in. in my Magento 2 site.

Here's the error message attached:


texts: How to solve order total and invoice total mismatch?

texts:
I am using this extension for adding extra fees,

In checkout page,

Order total before creating invoice,

After creating invoice,

Error :  The invoice total and order total not matching in invoice,

Customer feel order total & invoice total different, How to manage this case?

FYI - If i try with fresh magento, extra fees showing on order total in order page and invoice & order also same total.


texts: Magento 1.9.2. - Filter products on the list page starting from the last tier price

texts:
I would like to be able to filter the products on the list page not for the final price but for the last tier price.

How could I do?

Thanks


texts: The attribute 'translate' is not allowed in Magento 2.2

texts:
I was created simple custom module in magento 2.1. And it's working fine in magento 2.1.9.

But today I tried to installe in magento 2.2 and it's shows this error:

  1 exception(s): Exception #0
  (Magento\Framework\Config\Dom\ValidationException): Element 'item',
  attribute 'translate': The attribute 'translate' is not allowed. Line:
  1920

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'item', attribute 'translate': The attribute 'translate' is
  not allowed. Line: 1920

Here is file where generate this error

<referenceBlock name="checkout.root">
    <arguments>
        ...
        ...
            <item name="fee" xsi:type="array">
                <item name="component"  xsi:type="string">Vendor_Module/js/view/checkout/cart/totals/myfile</item>
                <item name="config" xsi:type="array">
                    <item name="title" xsi:type="helper" translate="true" helper="Vendor\Module\Helper\Data::getCustomText"/>
                </item>
            </item>
        ...
        ...
    </arguments>
</referenceBlock>


texts:
I just started working on a new magento site and when I moved it to my local I got the below error on my nginx server.

  2016/09/14 13:38:41 [error] 7#7: *13 FastCGI sent in stderr: "PHP
  message: PHP Warning:  require(/var/www/html/app/bootstrap.php):
  failed to open stream: No such file or directory in
  /var/www/html/index.php on line 64

I simply removed that line from index.php, but what's that file for?  Why is it in some Magento installs?  It's a Magento ver. 1.9.0.1 install.


texts: Magento 2 - Related products not showing

texts:
I try to show "Related Products, Up-Sells, and Cross-Sells ". All of them work, but "Related Products".

I thought there must be something wrong with the products which I have assigned to Related Products. So I assigned the same products which I have assigned to the working "Up-Sells", but there is still nothing showing.

I also checked out Magento Blank and Magento Luma Theme and cleared the cache. But there is still nothing.

I am using Magento 2.3.4.


texts: How to use messageManager to show an error after redirect

texts:
I have a Module which processes a Post action, and then redirects.

Now there are error cases, and I would like to show messages for them to the users.

I already know, that this code adds the message to the session.

$this->messageManager->addError(
   $this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($message)
);

But I dont see how to trigger the rendering.

Currently it is only shown when i execute another action, which already uses this in a working way.

Like for example the login with wrong password.


texts: MSI source assignment before order is placed

texts:
Having query related to shipping charges when we use MSI.
For example :
We have configured MSI. For each product we are having multiple warehouse/source available.
Cart : 3 items in cart
Item 1 - available in ABC (California) ware house
Item 2 - available in ABC (California) ware house
Item 3 - available in PQR (Washington) ware house
Company registered in Alaska.
Customers can have different product into cart which are available in different sources.
Query:

Is there any way by which we can mark or assign warehouse/source when product added into cart.

And after completion of order restrict the shipment for particular item to the warehouse/source assigned when customer did add to cart.


texts: cannot translate category name for different store view

texts: I'm trying to translate category name for different store view, but unchecking the "Use Default Value" checkbox does nothing. Category name field stays inactive. What could be the problem?


texts: Magento 2 - How to add custom order item field on order export API

texts:
I added a new field on table sales_order_item.

I need to display it on REST API order export, in the "items" node. Is it possible to do that ?


texts: Nothing will save or upload in the back end. is magento down? i cant create new categories or add or remove existing ones and the products within.


texts: List Page:Configurable Product: getPrice: in Magento 2

texts:
In List Page :

1) How the Configurable product price and special price  is displayed ?

2) Which price it will take to display on the product in List page ? and

3) Which file is responsible to display price of the configurable product


texts: Exception: Invalid method Inchoo\SocialConnect\Block\Login::__

texts:
I keep getting this error:

  Invalid method Inchoo\SocialConnect\Block\Login::__

method:

public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Inchoo\SocialConnect\Model\Google\Client $socialConnectGoogleClient,
        \Inchoo\SocialConnect\Model\Facebook\Client $socialConnectFacebookClient,
        \Inchoo\SocialConnect\Model\Twitter\Client $socialConnectTwitterClient,
        \Inchoo\SocialConnect\Model\Pixelpin\Client $socialConnectPixelpinClient,
        \Magento\Framework\Registry $registry,
        array $data = []
    ) {
        $this->socialConnectGoogleClient = $socialConnectGoogleClient;
        $this->socialConnectFacebookClient = $socialConnectFacebookClient;
        $this->socialConnectTwitterClient = $socialConnectTwitterClient;
        $this->socialConnectPixelpinClient = $socialConnectPixelpinClient;
        $this->registry = $registry;
        parent::__construct(
            $context,
            $data
        );
    }

I also put my module on github if you want to dig a bit further: https://github.com/CallumBrankin/Magento2-Inchoo-Social-Plugin


texts: Magento 2 - Prohibits depends directly the ObjectManager, but all object can use factory object

texts: As Magento prohibits depending on and directly using the ObjectManager, whether all object can use factory object to instantiate?


texts: Magento 1 sql query for products with custom attributes

texts:
Need sql query which get products attributes including custom attributes like following:
product_id,product_type,sku,Product_Name,Brand,Color,Size,Price,Special_Price,inventory_type


texts: Magento 1.9.0.1 new product widget problem

texts:
I have added in cms/pages/home page this automatic widget code :

{{widget type="catalog/product_widget_new" display_products="all_products" show_paginator="0" products_per_page="8" products_count="8" template="catalog/product/widget/new/content/new_grid.phtml"}}

But the list feel like unordered?


texts: Magento 2 - How to find out which data is available for an object?

texts:
I have a quote item:
/**
 * @var \Magento\Quote\Model\QuoteFactory
 */
protected $_cartFactory;

public function __construct(
    ...
    \Magento\Checkout\Model\CartFactory $cartFactory,
    ...
) {
    ...
    $this->_cartFactory = $cartFactory;
    ...
}

...
/** @var \Magento\Checkout\Model\Cart $cart */
$cart = $this->_cartFactory->create();

/** @var \Magento\Quote\Model\Quote $quote */
$quote = $cart->getQuote();

How can I figure out, which attributes are available/accessible for $quote?
I know for example that I can call $quote->getTotals() because I found it somewhere in another code.
How do I know all attributes which I can access?
I tried:
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/shipping.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);

$data= $quote->getData();
$logger->info("Data: ");
$logger->info($data);

But it does not print anything and my site stops working.


texts:
I have created a category in Magento with a custom layout as follows:

<reference name="product_list">
<action method="setTemplate"><name>catalog/product/custom.phtml</name></action>
</reference>

In this custom.phtml I have modified the $_productCollection in order to get a desired collection to show up, but there is no toolbar generated in order for the results to be sortable or have proper pagination.

Any suggestions on how I can generate the toolbar for the custom collection I just created?


texts: magento 2: understanding dependency injection

texts:
Recently I came across a situation in magento where settings for instance object were remaining persistent and it made we wonder how magento's di is working.

I created a module that injects magento's curl class \Magento\Framework\HTTP\Adapter\Curl

public function __construct
(
  \Magento\Framework\HTTP\Adapter\Curl $curl
)
{
  $this->curl = $curl;
}

public function getGeoIpResponse($ip)
{
  $this->curl->setConfig(['header' => false]);
  $this->curl->write('GET', $ip);

  return $this->curl->read();
}

This provides back a json with no header, because of ['header' => false], prepended to the response.

Now in a separate class I inject the same curl class and run a similar method but DO NOT set the header to false.  However the response comes back with no header; the default config returns a header.  In order to receive a header i would have to set ['header' => true] in the config.

public function __construct
(
  \Magento\Framework\HTTP\Adapter\Curl $curl
)
{
  $this->curl = $curl;
}

public function getFixerResponse($base) {

  $this->curl->write('GET', $this->fixerUrl . $base);

  $response = $this->curl->read();

  return $response;
}

If I remove the first instance where ['header' => false], leaving the second instance unchanged, then the second instance's response returns a header.

I expected the instances to work independent of each other but it seems the config is shared between the two objects.

Can anyone explain why the configuration of the first instance is remaining persistent on the second?


texts: Magento 2: How to get current date, date time with format in .phtml file?

texts:
I already referred Magento 2 Get Current Store Date Time

But how to use directly in .phtml file? Can able to get Date, DateTime & Also able to set it's format?


texts: What are container types in the context of shipping?

texts:
I'm trying to create my own shipping module where you can customize your shipping option (link to question) and I'm wondering what these functions in Mage_Shipping_Model_Carrier_Abstract do in order to figure out a way to implement customizable shipping options.

What do requestToShipment / returnOfShipment do?
What are containers / container types?
-> 2.1. What does getCustomizableContainerTypes do / what are customizable containers?
What does the flag fixed mean?


texts: inconsistent shipping charge calculation in cart page

texts:
Enabled shipping charge in my Magento1.9 store is table_rate and in store pickup.

If As a login user I have added few items into my cart and logout. I login again and moving to cart page. It is not showing and shipping charges on cart screen. If I do refresh the same page, it shows shipping charges from table rate.

I logout and login again, moving to cart again shipping charges is not showing and do refresh it appears.

This seems inconsistent.

Try 1#: I disabled all custom modules and flushed cache. No luck

Try 2#: Disabled all custom modules switched to default theme (not rwd, magento default). Flushed cache. No luck.


texts: How to apply specific shipping charges if order is below X amount?

texts:
I am working on magento-1.9.2 version. I want to apply the specific amount of shipping charge if order is below x amount ?
i tried with flat rate and table rate but it doesn't help me out


texts:
I am checking website for XSS and Cross Site scripting issues and i found that in account form fields or user registration page form fields for First name and Last name A user can enter html/js code. For testing when i place the following JS code :

<script>alert("Here")</script>

It is saved and is run on page load. This is very strange, because i checked the template files and values are escaped as below:

<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>

I have also confirmed if i am in correct template file by changing the label of field.
I have read the following questions and tried to used them but did not worked for me.

How to escape output data?

Is there a generic way I can apply input filtering to Magento form processing?

Regarding to the observer method, it works, but when i try to login to magento admin, i cant, but when iremove the observer, i can login again.

Update:
Check the two attached screenshots.

Kindly help me with this issue.

Thank you


texts: Magento 2 Admin grid requires setup:upgrade for changes

texts: I have an admin grid with a custom collection but changing database name requires setup:upgrade and setup:di:compile for changing in admin grid.


texts: Magento 2 Cart get empty on page referesh only in Mozila firefox

texts: I am using magento 2.1.7 version. I have upgraded it to 2.1.9 after upgradation it is working fine on google chrome, but on Firefox cart get empty on refresh page or apply coupon code it also get empty.


texts: How apply Discount Sticker(Label,image) on Selected Product or Category

texts: I want to this type of the image as a sticker on Product left or Right upper corner. Has any extension or anything else.


texts: In magento 2.3.5 Swagger is not working (Failed to load API definition.)

texts:
I had upgraded the magento version to 2.3.5 after that swagger is not working in my setup
Image Reference :

To debug the i click invalid button it shows
{"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://My Domain/rest/all/schema?services=all"}]}

The below errors i got in the debug.log
[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-bundle.js.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-bundle.js.map' [] []
[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/css/swagger-ui.css.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/css/swagger-ui.css.map' [] []
[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-standalone-preset.js.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-standalone-preset.js.map' [] []

I ran the below commands and tested

bin/magento deploy:mode:set developer - (Set the store to developer mode)
Removed the pub/static frontend and adminhtml
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
chmod -R 777 root_file/*


texts: Cannot update extensions in the Web Setup Wizard

texts:
I am currently trying to update two MSP exensions in my version of Magento 2.3.2. But whenever I run the readiness check I get the following error:

  Check Component Dependency We found conflicting component
  dependencies. Hide detail

  Command "update" failed: Loading composer repositories with package
  information Updating dependencies (including require-dev) Your
  requirements could not be resolved to an installable set of packages.

  Problem 1
  - Installation request for magento/product-community-edition 2.3.2 -> satisfiable by magento/product-community-edition[2.3.2].
  - magento/product-community-edition 2.3.2 requires msp/twofactorauth 3.1.1 -> satisfiable by msp/twofactorauth[3.1.1] but these conflict with your requirements or minimum-stability.

I've tried the solutions in the help documents but none of them seem to work.

The composer file seems to have the correct requirements:

"require": {
    "magento/product-community-edition": "2.3.2",
    "composer/composer": "@alpha",
    "mageplaza/module-gdpr": "^1.2",
    "msp/twofactorauth": "3.1.1",
    "msp/recaptcha": "2.1.2",
    "xtento/customtrackers": "2.1.7",
    "zendframework/zend-mime": "^2.7",
    "geoip2/geoip2": "^2.9",
    "livechat/module-magento-livechat": "2.3.0"
},
"require-dev": {
    "allure-framework/allure-phpunit": "~1.2.0",
    "friendsofphp/php-cs-fixer": "~2.13.0",
    "lusitanian/oauth": "~0.8.10",
    "magento/magento-coding-standard": "~1.0.0",
    "magento/magento2-functional-testing-framework": "~2.3.14",
    "pdepend/pdepend": "2.5.2",
    "phpmd/phpmd": "@stable",
    "phpunit/phpunit": "~6.5.0",
    "sebastian/phpcpd": "~3.0.0",
    "squizlabs/php_codesniffer": "3.3.1"
},

I've run the usual commands as follows but these have not resolved the issue:

composer update
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

Can anyone suggest what might be causing the issue.


texts: access parent class on class overwrites in magento, from a sibling

texts:
It is required to overwrite customer_resource class. I added required config.xml options for resource rewriting, but when overwritten class method calls parent class method from itself, it actually called the parent method from which I extend to, nor the parent of Mage_Customer_Model_Resource_Customer:

  class My_Plugin_Model_Resource_Customer extends Mage_Customer_Model_Resource_Customer
    {

    protected function _beforeSave(Varien_Object $customer){
        parent::_beforeSave($customer);
    ...
        }
    }

So, how to call parent method correctly in this case ? some kind of double downcasting is possible in PHP?

Update:

if found some solution, but not sure if it worked for me, cause via the customer_entity table it still not saves customer correctly:

        call_user_func(array(get_parent_class(get_parent_class($this)),
                       '_beforeSave', $customer));


texts: Magento Programmatically Customer Group Create and Update

texts:
I have used the below code for create the customer group programmatically, it works well.
But i need that if the same customer group exist it should update the values, instead of creating new one with same name.

$customer_group=Mage::getModel('customer/group');
$customer_group->setCode($typename.'_'.$id);
$customer_group->setTaxClassId(3);
$customer_group->save();


texts: Magento 2 : how to get customer id on observer?

texts:
I need customer id on my observer, but it is giving error on page load.
My code is:

<?php

namespace //..\Observer;

use Magento\Framework\Event\Observer;

class AddressObserver implements \Magento\Framework\Event\ObserverInterface {
    public function execute( Observer $observer ) {
        $customer = $observer->getCustomer();
        $Id = $customer->getId();
    }
}


texts:
I am adding one custom pdf functionality in my magento store, for that I want to use TCPDF but I am not able to add it. it always shows that class is not found and all.
Can anyone tell me what is proper way to add and use tcpdf in magento 2 ?

Thanks in advance.


texts: Magento 2.3 Convert Quote from store to another store

texts:
I need to convert a quote from one store in GBP to another website store in EUR dynamically on the fly, but i can save the item with the new store_Id and the quote with the correct store_id but collectTotals is not recalculating to get the store level prices.

       $quote = $this->quoteRepository->getActive($cartId);

        $quote->setStore($store);

        $items =  $this->quoteRepository->getActive($cartId)->getAllItems();
        foreach($items as $item)
        {
            $item = $quote->getItemById($item->getId());
            $item->setData('store_id',$storeId);
            $item->calcRowTotal();
            $item->getProduct()->setIsSuperMode(true);
            $item->save();
        }

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

Any advice? Or any ideas would be appreciated.


texts:
Has anyone any experience on configuring Magento + Zend OpCache on Apache ?

I have configured in my testing environment using Nginx + PHP-FPM and Zend OpCode with PHP 5.5.9 and it seems to work fine but i don't know if is ready for production since it is still beta.

My other question is, i have multiple Magento installation in the same server, may this be a problem since their files are the same (but may have different code) ?

Any other recommendation on it's configuration to have e faster Magento site?


texts:
I am installing Magento 2 into a subdirectory beside the main installation. I would like to configure the subdirectory named "test". However, when I try to access localhost/test to enter the setup page, it just tells:

  localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.

Here is my NGINX config :

server {
    listen 80 reuseport;
    server_name localhost;

    access_log  /var/log/nginx/access.log ;
    error_log   /var/log/nginx/error.log  ;

    set $MAGE_ROOT /var/www/magento2;
    root $MAGE_ROOT/pub;

    ## Magento Setup Tool
    include conf_m2/setup.conf;

    # Deny all internal locations also default phpmyadmin
    location ~ ^/(app|bin|var|tmp|phpserver|vendor|magento_version|php[mM]y[aA]dmin|pma)/? { deny all; }

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    ## Static location
    include conf_m2/assets.conf;

    location @static { rewrite /static/(version\d*/)?(.*)$ /static.php?resource=$2 last; }
    location @media { try_files $uri $uri/ /get.php$is_args$args; }

    ## Process php files (strict rule, define files to be executed)
    location ~ (index|health_check|get|static|report|404|503)\.php$ {
        try_files $uri =404;

        include conf_m2/php_backend.conf;
        fastcgi_cache microcache;
        fastcgi_cache_key $scheme|$host|search|$arg_q;
        fastcgi_cache_valid 200 301 302 2h;
        fastcgi_cache_use_stale updating error timeout invalid_header http_500;
        fastcgi_pass_header Set-Cookie;
        fastcgi_pass_header Cookie;
        fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
    }

    ###Here is the directory I want to installed another magento 2, but it now works
    rewrite ^/test /test/$1 permanent;
    location /test {
        try_files $uri /$uri/index.php?$args;
        index index.php index.html index.htm;
    }
    rewrite ^/test/admin /test/admin/$1 permanent;
}


texts: Magento 2 : How to edit invoice PDF, Add Product Attributes

texts:
How to edit the invoice PDF, I want to add more product attributes to the pdf invoice. For example, I have a product which is a book I want to add publisher, author attribute to the invoice.

See Image Below For More Clarification.


texts: Magento 2.3 idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

texts:
I have Installed Fresh Magento2.3  php version 7.2.12 . When System try to send any email like order,contact,register customer etc .. .

it will through Exception and not sending any email

  main.CRITICAL: Deprecated Functionality: idn_to_ascii():
  INTL_IDNA_VARIANT_2003 is deprecated in
  /public_html/vendor/zendframework/zend-validator/src/EmailAddress.php
  on line 560

error throw from here:

 if (extension_loaded('intl')) {
            if (defined('INTL_IDNA_VARIANT_UTS46')) {
                return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email);
            }
            return (idn_to_ascii($email) ?: $email);
        }


texts: new SoapClient() not working within class

texts:
I am new with SoapClient(). I have a code which I execute with normal PHP script it works fine. But when I try to put that code within class structure it throws an exception as below :

$url = "https://api.demo.ezidebit.com.au/v3-5/pci?singleWsdl";
$soapclient = new SoapClient($url);
$params = array("digitalKey" => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
     "token" => "XXXXXX",
     "paymentAmountInCents" => "1600",
     "customerName" => "User Test",
     "paymentReference" => "1549678");
$response = $soapclient->ProcessRealtimeTokenPayment($params);

Class base

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' https://api.demo.ezidebit.com.au/v3-5/pci?singleWsdl' in

<?php
class HDEziDebit{
    public $DigitalKey = '';
    public $PublicKey = '';
    //public $PciMode = '';
    public $Environment = '';

    public $pciURL = '';
    public $nonpciURL = '';
    public $pulicRestURL = '';

    public function __construct($DigitalKey, $PublicKey, $Environment){
        // if (! in_array($PciMode, array('pci', 'nonpci','public-rest'))) {
        //  throw new Exception("Invalid PCI mode");
        // }
        if (! in_array($Environment, array('live', 'test'))) {
            throw new Exception('Invalid environment');
        }
        $this->DigitalKey = $DigitalKey;
        $this->Environment = $Environment;
        $this->PublicKey = $PublicKey;
        $this->initializeConfigurations();
    }

    public function initializeConfigurations(){
        $domain = '';
        switch ($this->Environment) {
            case 'live':
                $domain = 'https://api.ezidebit.com.au';
                break;
            default:
                $domain = ' https://api.demo.ezidebit.com.au';
                break;
        }
        $this->pciURL = $domain.'/v3-5/pci?singleWsdl';
        $this->nonpciURL = $domain.'v3-5/nonpci';
        $this->pulicRestURL = $domain.'/V3-5/public-rest';
    }
}

class paymentMethods{
    private $HDEziDebit;
    public function __construct($HDEziDebit){
        $this->HDEziDebit = $HDEziDebit;
    }

    public function createSoapClient($url){
        $soapclient = new SoapClient($url);
        return $soapclient;
    }

    public function getSoapClientResponse($soapclient){
        $response = $soapclient->__getLastResponse();
        return $response;
    }

    public function ProcessRealtimeTokenPayment($parameters){
        $soapclient = $this->createSoapClient($this->HDEziDebit->pciURL);
        $params = array(
          "digitalKey" => $this->HDEziDebit->DigitalKey,
          "token" => $parameters['token'],        // The ads ID
          "paymentAmountInCents" => $parameters['paymentAmountInCents'],
          "customerName" => $parameters['customerName'],
          "paymentReference" => $parameters['paymentReference'],
        );
        $soapclient->ProcessRealtimeTokenPayment($params);
        return $this->getSoapClientResponse($soapclient);
    }
}
?>


texts: Show Wishlist icon as selected when clicked

texts:
I need to show the icon as selected (may be color change) when user add a product to wishlist.
I've searched and tried the solution here How to check if a product is already on the wishlist in Magento 2?
but not clear where to add this code.
Please guide me in the correct direction.

Thanks.


texts: Magento 2.3.4 and Elasticsearch: Getting a blank result page when searching

texts:
I am having issues with my company's Magento test site. The issues are when searching using Elastic search, the resulting page is a blank page. Then, when I look for relevant errors in various logs, I see the following PHP error in the /var/log/httpd/error_log file:

[php7:error] [pid 22228] [client xx.xxx.xxx.xxx:xxxxx] PHP Fatal error:
    Uncaught TypeError: Argument 1 passed to Magento\\Elasticsearch\\Model\\Adapter\\FieldMapper\\Product\\AttributeProvider::getByAttributeCode()
    must be of the type string, null given, called in /var/www/html/test/vendor/magento/module-elasticsearch/SearchAdapter/Query/Builder/Sort.php
    on line 92 and defined in /var/www/html/test/vendor/magento/module-elasticsearch/Model/Adapter/FieldMapper/Product/AttributeProvider.php:72\nStack
    trace:\n#0 /var/www/html/test/vendor/magento/module-elasticsearch/SearchAdapter/Query/Builder/Sort.php(92):
    Magento\\Elasticsearch\\Model\\Adapter\\FieldMapper\\Product\\AttributeProvider->getByAttributeCode(NULL)\n#1
    /var/www/html/test/vendor/magento/module-elasticsearch/Elasticsearch5/SearchAdapter/Query/Builder.php(91):
    Magento\\Elasticsearch\\SearchAdapter\\Query\\Builder\\Sort->getSort(Object(Magento\\Framework\\Search\\Request))\n#2
    /var/www/html/test/vendor/magento/module-elasticsearch/Elasticsearch5/SearchAdapter/Mapper.php(66):
    Magento\\Elasticsearch\\Elasticsearch5\\SearchAdapter\\Query\\Builder->initQue in
    /var/www/html/test/vendor/magento/module-elasticsearch/Model/Adapter/FieldMapper/Product/AttributeProvider.php
    on line 72, referer: www.mytestsite.com

Does anyone have any ideas on how to solve this error?

Now, here is my test site's setup:

PHP version: 7.2.27

Magento version: 2.3.4 community edition

OS: CentOS 7.7.1908

Elasticsearch: 6.8.7-1

Also here is further information on my test site's setup: I performed an in-place upgrade where I created the test site from a base Magento 2.3.4 install. Then, added all of the modules I needed. Finally, I copied over a backup of my company's production database and ran the Magento upgrade and compile commands (e.g., "magento setup:upgrade" and "magento setup:di:compile"). And note the production database was based-on Magento 2.3.1.

Thanks in advance for any answer, suggestions, and/or help you can provide.

Regards,

Alvaro


texts:
I try to add radio buttons to all individual options (Catalog -> Manage Articles -> Open a configurable article -> Individual Options) so that the backend user can pick which one he likes to be selected by default.

Example:

Do I need to create an extension and add a new EAV attribute? How does it work?

I found out that I can add a new column if I edit the template file app\design\adminhtml\default\default\template\catalog\product\edit\options\type\select.phtml

But I also need the value to stay saved and need to know how I can access the new value.


texts: Load details of a root category and subcategories

texts:
How do i load all the sub categories of a particular Root Category?

I need to form a tree like structure for traversing all the sub categories (including the inactive ones).

Kindly help.


texts: How to populate a custom table data in a dropdown field within adminhtml -> UIComponent ->form.xml

texts:
<field name="agent" sortOrder="170" >
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object"></item>
        <item name="config" xsi:type="array">
        <item name="label" xsi:type="string" translate="true">Module</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="dataType" xsi:type="string">number</item>
        <item name="formElement" xsi:type="string">select</item>
        <item name="source" xsi:type="string">Test</item>
        <item name="dataScope" xsi:type="string">Module</item>
    </item>
</argument>
</field>


texts: How to create a new action in an admin controller?

texts: How to create a new action in an admin controller which already exist to call a third party api ? Any idea ?


texts: How to Set, Retrieve and Unset Session Variables in Magento 2?

texts:
What is the equivalent for session in Magento 1

Mage::getSingleton('core/session')->setMyValue('test');
Mage::getSingleton('core/session')->unsMyValue();

Same in Magento 2?


texts: Magento project redirecting to installation page

texts:
I have magento 2.17 project which is working fine. I just created a copy of this project and then updated its env.xml with my new database details. But unfortunately when I'm accessing the project it redirect to the installation page.
Actually the project is already created and I have created a new database with data (the new database is imported from the original project). So I need to use this database and skip the installation process. Please let me know how to solve this issue.
these things are I already checked:

deleted files from var/ folder


texts: Rest API with Magento using PHP with example.

texts: I am new to Magento and want to know how to write Rest web services with PHP. Please suggest me with any material or example with full explanation because i gone through many, but couldn't find a good one which is working. I can also say that i don't know how to execute that. please give me a full explanation with example. Thanks in advance :)


texts: Change product image size for virtual products only

texts: Is it possible to change the product image size for virtual products only? I'm aware of the view.xml file to change image resolution, but it changes the product image size for all product types. Maybe it's possible through a template file, but I can't figure out how to achieve that.


texts: Error While Upgrading Magento2.1 to Magento 2.3

texts: while upgrading Magento run command composer update error shown :


texts:
A very good thing about Magento 2 is that we put together all files inside the module itself. Layout XML, Templates, Less/Sass, Blocks, Models, Helpers, API, SQL scripts and everything. It's important because when we enable, disable or even delete the module everything lays on a single directory.

However, when I add a @magentoDataFixture for an integration test, it says it should be placed on dev/tests/integration/testsuite directory, and not on the module itself. The more directories, the more difficult to maintain. It looks like M1 with app and skin directories where files became very far away from each other, in terms of tree directory.

Example:

/**
 * @magentoDataFixture MyNamespace/MyModule/_files/create_some_data_here.php
 */
class CustomIntegrationTestTest extends AbstractController
{

Magento will look up on the directory:
dev/tests/integration/testsuite/MyNamespace/MyModule/_files/create_some_data_here.php

and not somewhere like this:
app/code/MyNamespace/MyModule/Test/....../_files/create_some_data_here.php

Can @magentoDataFixture files be inside the module itself and not on default directory dev/tests/integration/testsuite?


texts: Use knockoutjs in Ui component of Admin form

texts:
I have created a form using UI component on Admin side. If i want to add a .phtml then i can add the file this way.

<htmlContent name="driven_form_design">
  <block class="Magento\Backend\Block\Template" template="Avesh_Faq::temp.phtml" name="testing_tmp" />
<htmlContent>

Inside temp.phtml

Hello World

The Custom custom-component.js file includes

define(['jquery', 'uiComponent', 'ko'], function ($, Component, ko) {
    'use strict';
    return Component.extend({
        defaults: {
            template: 'Avesh_Faq/knockout-test'
        },
        initialize: function () {
            this._super();
        }
    });
  }
);

And the knockout-test.html file contains

My Name is Avesh

The Expected Output should been

Hello World

My Name is Avesh

What i am getting is

Hello World

No errors in console neither on the site.

But

If i use this same block directly in the layout file then it works. What is wrong with UI component. What is the correct way that my Knockoutjs will run in UI componnet file?


texts: Images Blank on Magento Front End and Backend

texts:
I have a site that some of the images are appearing blank on the website. There is some images showing but some are missing and just show the Magento image place holder.

I have checked in the back-end where there images are and there is a broken images. I have checked the folders and they are all 777 for the media folders, I have tried a few different browsers also.

I have also done a reindex and cleared both the Magento Cache and Browser Cache

Website is http://www.furnitureplusonline.co.uk/ranges/siena-oak-range.html


texts:
We have a magento multistore website and we are facing an issue with the pricing in Cart. Products on magento are pushed from ERP system. The products pricing is website specific.

I will explain the complete scenario here:

We have near about 8k products in our store. And near about 50 products are showing different price from their final price in Cart Page. There is no difference between the products which are showing wrong price and the products which are showing correct price.

And the products which are showing wrong price are actually showing Original price in place of Special Price. I have debugged alot on it and I found the following points on it:

When I open a product in magento admin and save it on default view, its price gets correct and it show correct price in cart page also. But if I save by selecting correct store view, it does not affect anything.
When we click on add to cart button, Quote _initItem() method is
called twice. _initItem() save the item quote price on sales_flat_quote_item table. On first call the $finalprice is the correct and on second time it saves wrong price.
I have checked the price on different observers like: checkout_cart_product_add_after & checkout_cart_add_product_complete and here the price is correct.

If anyone faced this kind of issue, Please let me know. Or if someone have any doubt or wants to help please let me konw.


texts: How to add "Add to cart button" on custom product detail section?

texts:
I am working on custom Magento 2 site development. And I want to add the add to cart button on product view page.

Where there are 3 tabs i.e. Details, Reviews and Accessories/part.

I have created Accessories/Part content in phtml file in tabular format in which last column is "Add to Cart", and in that  "Add to cart" button is placed

So, when user click on add to cart button it should add that product to cart

How should I do this functionality? Can anyone help me by which way I can do it.


texts: how to call ajax request in knockout js?

texts:
I have button on checkout page with knowckout js to find pincodes with my API. Now I want to send one ajax request to that API.

define(
    [
        'jquery',
        'ko',
        'uiComponent'
    ],
    function(
        $,
        ko,
        Component
    ) {
        'use strict';

        $(document).on('click', '.common-place-order', function (event) {

        });
    }
);

So how do we call ajax request from knockout js?


texts: Add custom captcha field to customer forgot password form

texts:
I need to add math captcha to forgot password form in magento. I don't want to change default magento form layout. I want to add new magento form which overrides the default form.
I have added below code in my layout file.

<customer_account_forgotpassword>
        <reference name="head">
        <action method="setTitle" translate="title" module="contacts">
            <title>Forgot Your Password</title>
        </action>
    </reference>
        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
            <action method="setHeaderTitle" translate="title" module="customer">
                <title>Forgot Your Password</title>
            </action>
        </reference>
        <reference name="content">
            <block type="core/template" name="forgotpassword_form" template="mathcaptcha/forgotpassword.phtml">
                <block type="mathcaptcha/index" name="ripples_mathcaptcha" as="ripples_mathcaptcha"
                template="mathcaptcha/index.phtml" />
            </block>
        </reference>
    </customer_account_forgotpassword>

Here, mathcaptcha/forgotpassword.phtml file contains my form where I have added required fields in my form. and mathcaptcha/index.phtml contains the captcha field. But I am not able to override default form. It is displaying me default form and my form both on the page.

You can see it in the screenshot.
Can anyone please help me how to override magento default forgot password form?


texts:
I have created a admin user by below command.

php bin/magento admin:user:create --admin-user="admin1" --admin-password="admin@123" --admin-email="admin1@gmail.com" --admin-firstname="fname" --admin-lastname="lname"

Now, Admin is login successfully but I do not have permission for anything in admin. Below is the Error.

Sorry, you need permissions to view this content.
Please help me how can I solve this.


texts:
I want to create on coupon code with these conditions but not able to do so .

Website discount need to be applied as per total cart value.
0-299 no discount,
above 300-499 - 10%,
500 and above - 20%

How can I achieve this kindly help
Thank you


texts:
I'm trying to understand the Unit Testing for Magento2.

public function getPostUrl()
{
    $ticketId = $this->getRequest()->getParam('ticket_id');
    $params   = ['ticket_id' => $ticketId];

    $url = $this->backendUrl->getUrl(self::QUOTE_MERGE_URL, $params);

    return $url;
}

Now i want to write a Unit Test for this code. But i have no clue how to proceed.

I have a unit test for

public function getTest()
{
    return 'Test';
}

and in the test page:

public function testGetTest()
{
    $this->assertEquals('Test', $this->block->getTest());
}

This works.

But how do i check the post url if that is how i expect?


texts: How to call block method from Controller in magento 2

texts:
I want call block methods from controller. My files are below

Controller

namespace Vendor\ModuleName\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;

class Index extends Action
{
   public function __construct(Context $context) {
        parent::__construct($context);
    }

    public function execute() {
   }
}

Layout

cms_index_index

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd" layout="2columns-left">
     <head>
    </head>
    <body>
        <referenceContainer name="content">
            <block   class="Vendor\ModuleName\Block\ProductTabs" name="producttabs" template="producttabs.phtml" ifconfig="form_section/form_group_general/status">
            </block>
        </referenceContainer>
    </body>
</page>

Block

namespace Vendor\ModuleName\Block;
class ProductTabs extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context,array $data = [])
    {
        parent::__construct($context, $data);
    }

    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }

    public function getMsg(){
      return 'i am in block';
    }
}

I want getMsg() to be accessed in controller. If anybody know then please share your experience.


texts: magento 2 custom attributes value frontend return No value of select

texts:
I have a problem in retrieving the value of custom attribute of type select, it returns a value No

I try this code in

list.phtml:

 <span class="product_badge_value">
 <?php /* @escapeNotVerified */ print_r($_product->getResource()->getAttribute('product_badge')->getFrontend()->getValue($_product)); ?>
  </span>


texts: Thumbnail Image option is not showing in categories admin panel

texts:
The "Thumbnail Image" option is not showing in the category admin panel.

see below image.

is this an issue with magento or issue with what?


texts: How to create attributes programmatically in magento?

texts: I have different attributes in a product coming from opencart. Now i want to insert these attributes in magento and then assign attributes to configured products.


texts: How to get product details and associate category names in only one query in Magento

texts:
I want to run only one query $prod_details and then run a loop that gives me some product detials, but i am failing to get the category name.

(i don't want to run another query inside the loop to get the category name)

This is the code i'm using:

$prod_details = Mage::getModel('catalog/product')->getCollection()->addWebsiteFilter($web_id)->addAttributeToFilter('status', 1)->addAttributeToSelect('*');
$prod_details->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
$prod_details->distinct(true)
->joinField('category_id', 'catalog/category_product', null, 'product_id = entity_id','{{table}}.category_id', 'inner')->addAttributeToFilter('category_id', array('in' => $category_id))
->joinField('qty','cataloginventory/stock_item','qty','product_id=entity_id','{{table}}.stock_id=1','left')
->addAttributeToFilter('qty', array('gt' => 0));    foreach ($prod_details as $product) {
  $product_data["pid"]=$product->getId();
    $product_data['qty']=$product->getQty();...
$product_data['category'] = $product->getParentCategory()->getName();

I can get the produt ID and quantity fine but the category name will not populate, i don't want to have to run $_category = Mage::getModel('catalog/category') inside the loop to get the category name.

When i change the values on category 'attributetofiler' either the whole query doesn't run or i get an error or it runs without category name. Can anyone spot any errors? Thanks


texts: Create a language package, install a language package via admin?

texts:
I have a Magento 2 shop hosted using a traditional cPanel hosting solution. Performance seems to be stable with the demo data and I'd like to install a language pack.

My problem is that I can only access a file manager, or run very simple commands by creating one-time cron jobs that execute a command ! and I have to manually delete them afterwards.

How can I install a language pack using these restrictions, since I do not believe I have composer installed ?


texts: Remove Regular Price from Product Page of Magento 2

texts:
I'm trying to remove the 'Regular Price' from the product page of a child luma theme I've created. My client only wants the special price showing.

Removing the regular price entries from the final_price.phtml and configured_price.phtml within my child theme doesn't make any difference.

/app/design/frontend/customtheme/child-luma/Magento_Catalog/templates/product/price/configured_price.phtml
/app/design/frontend/customtheme/child-luma/Magento_Catalog/templates/product/price/final_price.phtml

How do I remove the Regular Price?


texts: What do "source" and "dataScope" mean in admin form Ui component configuraion file

texts:
There are source and dataScope nodes in Magento2 admin form UI component configuration. What do they mean and how are they supposed to be used?

<field name="title">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Page Title</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">page</item>
            <item name="sortOrder" xsi:type="number">20</item>
            <item name="dataScope" xsi:type="string">title</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>


texts: FPC module breaks sites - what are the alternatives?

texts:
Today I installed the Lesti FPC module. In our test environment this worked great and speeded up things a lot. So I installed it on production. The effect was much less significant. In the end I had to disable the module because it turned out it break several sites.

We tried to install APC, but this turned out to break our Magento installation. We needed to install several PHP libraries (if I recall correctly php-pear, php-devel, pecl, php-apc), and somehow this broke our Magento installation. To be sure we reverted to a snapshot.

Now I'm wondering what alternatives I have. I turned on compiling.

Should I try a paid module like Full Page Cache Pro?
Do I have to remove the Lesti module?


texts: Magento 2: How to edit existing Order without cancel?

texts:
I am trying to edit Order that includes the below possible cases:

Update Order Item Price
Increse Order Item Qty Or Cancel Order Item Qty
Add New Item into Order

For Adding new Item in Order, I am following the below Way:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $this->_orderFactory->load('3445');
$order = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);

$quote = $objectManager->create('\Magento\Quote\Model\Quote')->load($order->getQuoteId());

$productId = 4272;
$productQty = 2;

$product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);

//Adding New Item into Quote
$objectManager->create('Magento\Quote\Model\Quote\Item')
                ->setProduct($product)
                ->setQuote($quote)
                ->setQty($productQty)
                ->save();

//Quote Address Update
$shippingData = $order->getShippingAddress()->getData();
$quoteAddress = $quote->getShippingAddress();
$shippingData['address_id'] = $quoteAddress->getAddressId();
$quoteAddress->setData($shippingData);
$quoteAddress->save();

$billingData = $order->getBillingAddress()->getData();
$quoteAddress = $quote->getBillingAddress();
$billingData['address_id'] = $quoteAddress->getAddressId();
$quoteAddress->setData($billingData);
$quoteAddress->save();

//Quote Collect Totals
$quote->getShippingAddress()
        ->setShippingMethod($order->getShippingMethod())
        ->setCollectShippingRates(true);
$quote->setTotalsCollectedFlag(false)->collectTotals();
$quote->save();

then I am planning to add this new Quote Item to convert into Order Item. But using the above code, All Quote Items are deleted and all grand total and subtotal in quote set to 0.

  My question is: What is correct way to modify the existing Order ?

Like in sales_order_item table we have the field qty_canceled, Using the below code I can cancel the complete Item ordered qty. But when I am saving the order, Subtotal and Grand total all are set to 0.

$order = $this->_orderFactory->load('3432');
if ($order->canCancel()) {
    $orderItems = $order->getAllItems();
    foreach ($orderItems as $item) {
        if($item['product_id']==3341) {

            $item->setQtyCanceled($item['qty_ordered']);
            $item->save();
        }
    }
    $order->save();
}


texts: Magento Category page not showing product list

texts:
I am new on magento. Please help me with this issue.
I moved my magento site from one system to another system. And after that this URL localhost/magento/men/tops-men/hoodies-and-sweatshirts-men.html is not showing products. It is showing "We can't find products matching the selection."
And to resolve this, I ran this command: php bin/magento indexer:reindex but it is showing :

Catalog Search index process unknown error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request
[/magento2_product_1_v2/document/_mapping] contains unrecognized
parameter:
[include_type_name]"}],"type":"illegal_argument_exception","reason":"request
[/magento2_product_1_v2/document/_mapping] contains unrecognized
parameter: [include_type_name]"},"status":400}


texts:
Trying to do a module check from the command line gets me a Fatal Error.

I'm using XAMPP to run Magento 2.3


texts:
Magento Version: EE 2.2.5

In my store product detail page is accessible using three urls:

1) https://www.domain-name.com/L1category/L2category/test-product

2) https://www.domain-name.com/test-product

3) https://www.domain-name.com/catalog/product/view/id/7862

But I need the product url to be a single one (https://www.domain-name.com/L1category/L2category/test-product)

And I can't use url rewrites as there are too many products.

Is there any other way?


texts: How can i add a single gift for every order?

texts:
Hello I want to be able to give a product that I will have in the 2 magento with every purchase. So I would like that when adding a product I would automatically add it to the cart, but there could only be one product of these that I am giving, I mean?

I have Magento 2.2.4

Edit:

Now i must put the product gift with SKU right?

And then add the free_gift attribute to the product that I want a free product to be given, is that correct?


texts: Odd error - main.CRITICAL: Notice: getimagesize(): Read error!

texts:
main.CRITICAL: Notice: getimagesize(): Read error! in [full path removed]/public_html/vendor/magento/framework/Image/Adapter/AbstractAdapter.php on line 304 [] []
Getting this error on pages that are categories but the products don't load.
Php 7.1 and Magento 2.2.8
Any help would be great


texts:
What is the best way to keep around 10K to 15K products to be imported on daily bases to make any changes to attributes or pricing ? we did try using default Magento but its either goes

Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

or

Uncaught exception 'PDOException' with message 'SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Is there any other easy way of keeping the daily import?
Thanks


texts: Get long-description in magento template

texts:
How to fetch long description in template.

I have want to fetch the long descritpion of Product

and show it in Template file list.phtml


texts: magento i need to display category images in my home page

texts:
Here is my code it is displaying categories with sub categories and working fine, my requirement is to show category images, now i am displaying static images

    <?php
        $obj = new Mage_Catalog_Block_Navigation();
        $storeCategories = $obj->getStoreCategories();
        Mage::registry('current_category') ? $currentCategoryId =Mage::registry('current_category')->getId() : $currentCategoryId='';
        Mage::registry('current_category') ? $currentCategoryId = Mage::registry('current_category')->getThumbnail() : $currentCategoryId='';
        foreach ($storeCategories as $_category):
        ?>

                <?php echo $_category->getName();?>
                <?php $categoryChildren = $_category->getChildren(); ?>
                <?php  if($categoryChildren->count()) : ?>

                        <?php foreach($categoryChildren as $_categoryChild) : ?>
                            <?php $_categoryChildModel = Mage::getModel('catalog/category')->load($_categoryChild->getId());?>
                            <?php $categoryGrandchildren=$_categoryChild->getChildren(); ?>

                                <?php
                                   $currentCategoryId===$_categoryChild->getId() ? $bold="style=\"font-weight:bold\"" : $bold='';
                                    echo '&emsp;' . 'getUrl() . '">' . ' &nbsp; getskinurl().'/images/menu_ic1.png" align="absmiddle" /> &nbsp;' .  $_categoryChild->getName() . '';

                                ?>

                            <?php if($categoryGrandchildren->count()) : ?>
                                <?php foreach($categoryGrandchildren as $_categoryGrandchild) : ?>
                                    <?php $_categoryGrandchildModel = Mage::getModel('catalog/category')->load($_categoryGrandchild->getId());?>

                                        <?php
                                            $currentCategoryId===$_categoryChild->getId() ? $bold="style=\"font-weight:bold\"" : $bold='';
                                            echo '&emsp;&emsp;' . 'getUrl() . '"' . $bold . '>' .  $_categoryGrandchild->getName() . '(' . $_categoryGrandchildModel->getProductCount() . ')';
                                        ?>

                                <?php endforeach; ?>

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

                <?php endif; ?>

        <?php endforeach ?>


texts: How to implement affiliate code in thank you page

texts:
i need to implement an affiliate code in the thank you page for every payment method (Paypal, Credit Card and COD) in my magento installation

This is the code and the fields that must be replaced are SALE_ID and 99.99. SALE_ID is the order id and 99.99 is the amount of sale without the shipping cost.

I have little knowledge of PHP, could you suggest me a solution?

Thanks

<script type="text/javascript" src="https://go.affiliate.de/delivery/afl/afl.js"></script>
<script type="text/javascript">
Affiliate.load_action("11501", "SALE_ID", "1::99.99", "", "pending");
</script>
<noscript>
 <img src="https://go.affiliate.de/delivery/afl/afl.php?cam_id=11501&trans_id=SALE_ID&sale_amount=1::99.99&adv_subid=&status=pending" style="width:0px;height:0px;"/>
</noscript>


texts: Magento2.3 - Change column layout order on mobile view

texts:
When I go to the Category back on Desktop view the using 3 column layout.
I get sidebar-main, main-content, and sidebar-additional in that order across the screen.
When I look at the site on a mobile the columns still appear in that order.
I would like to If possible rearrange the order they appear on a mobile device so the main content is available first or remove the sidebars for view on a mobile device.
I have added the following code to _extend.less file in my theme and deployed the code does show up in the CSS file but there is no different in layout, I have flushed the cache, CSS and static files.
Magento version 2.3.5
    //
    //  Mobile (styles-m.css)
    //  _____________________________________________

    .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
    .sidebar .sidebar-main {display: none;}
    .sidebar .sidebar-additional {display: none;}
    }

    .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
    .sidebar .sidebar-main {display: none;}
    .sidebar .sidebar-additional {display: none;}
    }

I have got this working on the home cms pages but cannot get it to work on the category pages. to get it working on the home page I have used code
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.cms-index-index .columns .sidebar-main,
.cms-index-index .columns .sidebar-additional {display: none;}

}

and I have tried the following code for category view but not working
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.catalog-category-view .columns .sidebar-main,
.catalog-category-view .columns .sidebar-additional {display: none;}

}


texts:
This might be a dumb question, but what is the best way to add new "order types" in Magento? For example, when we gift an order, or it's internal, or we manually create it for any number of reasons.

I figured it would be super easy (like creating new order statuses), but it's not.

If I wanted to just add a new column to the sales_flat_order table, would that be a good approach? I've only added new tables, never changed one part of the core.


texts:
I'm using Magento 1.9.1.1 with the latest patches on PHP 5.6.

I am attempting to add a dynamic link to the top.links nav on the frontend.  I have managed to get to the point where my block seems to be loaded, but I do not see anything from my template.  Here are the relevant files:

app/design/frontend/callcenter/default/layout/local.xml

<?xml version="1.0" ?>
<layout>
    <default>
        <reference name="top.links">
            <block type="callcenter_frontadmin/adminaccount" name="adminaccount" template="frontadmin/adminaccount.phtml" />
        </reference>
        <remove name="left.permanent.callout"/>
        <remove name="right.permanent.callout"/>
    </default>
</layout>

app/design/frontend/callcenter/default/template/frontadmin/adminaccount.phtml

Hello, world!

My block is located in app/code/local/Callcenter/Frontadmin/Block/Adminaccount.php and is in fact being loaded (if I die() inside it, the site dies).  If I substitute the <block> tag for something else, like an <action method="addLink" whatever I add seems to appear in the correct place.

Caching is turned off.  Logging does not reveal anything suspicious in the logfiles.

EDIT: Here is my block

app/code/local/Callcenter/Frontadmin/Block/Adminaccount.php

<?php

class Callcenter_Frontadmin_Block_Adminaccount extends Mage_Core_Block_Template {

}


texts: Magento 2: on swatch image hover upadate product image on category page

texts:
How to update the swatch image on hover rather than click ?

I have created the custom module to show the color count,here is my code:

<?php

namespace Swatch\SwatchCount\Block\Product;

class ListProduct extends \Magento\Catalog\Block\Product\ListProduct {

public function getProductDetailsHtml(\Magento\Catalog\Model\Product $product) {
   if ($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE) {

         $_children = $product->getTypeInstance()->getUsedProducts($product);
         foreach ($_children as $child){
          $colorarr[$child->getColor()] = $child->getColor();
         }
         if(count($colorarr) > 0) { ?>
            <div class="color-total">
                <?php
                if(count($colorarr) == 1){
                    $cc= 'Colour';
                }else{
                    $cc= 'Colours';
                }

                echo count($colorarr)." ".$cc; ?>
            </div>
        <?php  }
    }
    $renderer = $this->getDetailsRenderer($product->getTypeId());
    if ($renderer) {
        $renderer->setProduct($product);
        return $renderer->toHtml();
    }
    return '';
}

}

Please guide me to do the next part, Thanks


texts: Do have sales_flat* tables a lifecycle like catalog_product_flat* tables?

texts:
I'm quite new to magento development and could not find any information on this theme.

I know that the catalog_product_flat* tables are indexed and are only existing, if magento is set to use flat tables. Therefore data stored here might get deleted and the tables could get recreated with data from other tables.

Is the same true for the sales_flat* tables? I'm writing a module and I'm storing data in these tables. If they could get dropped and then reconstructed by magento i would loose this data. Is it safe to store data only in these tables? Or should i use other tables and then populate the data in sales_flat* with these?

For example i would like to store the payment date if an invoice in sales_flat_invoice and sales_flat_invoice_grid. Because the german tax office needs these dates instead of the date the invoice was issued.


texts: Magento 1.7.0.2 create attribute programmatically

texts:
I am creating a small magento extension to add a link to category banner image

I have this code to create an attribute but seems not to be working

app/code/community/Klevis/CategoryBannerLink/sql/Klevis_CategoryBannerLink_setup/install-0.0.1.php

 <?php
$this->startSetup();
$this->addAttribute('catalog_category', 'category_banner_link', array(
'group'             => 'General',
'type'              => 'varchar',
'backend'           => '',
'frontend_input'    => '',
'frontend'          => '',
'label'             => 'Banner Link',
'input'             => 'text',
'class'             => '',
'source'            => '',
'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible'           => true,
'frontend_class'    => '',
'required'          => false,
'user_defined'      => true,
'default'           => '',
'unique'            => false,
'note'              => ''
));
$this->endSetup();
Config file

app/code/community/Klevis/CategoryBannerLink/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Klevis_CategoryBannerLink>
        <version>0.0.1</version>
    </Klevis_CategoryBannerLink>
</modules>
<global>
    <resources>
        <Klevis_CategoryBannerLink_setup>
            <setup>
                <module>Klevis_CategoryBannerLink</module>
                <class>Mage_Catalog_Model_Resource_Setup</class>
            </setup>
        </Klevis_CategoryBannerLink_setup>
    </resources>
</global>
</config>

Modules Xml file app/etc/modules/Klevis_CategoryBannerLink.xml

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

I don't see why this it not working. Thanks in advance for your help.


texts: One Image uploading instead of two for Programtically created Product

texts:
Once we click on button present in Product view page, we are doing 2 things :

Creating 2 images in folder media/custom_product_preview/quote/
Creating new Product Programtically & uploading those 2 images to that Product

Issue : Only 1 image is uploading to Product , but we need both images.

if ($doSave) {
    $images = array(
        'image1' => 'image.png',
        'image2' => 'image2.png'
    );

    $imag_data = Mage::getSingleton('core/session')->getProductImage();
    $newImagePath = $imag_data;
    $io = new Varien_Io_File();

    foreach ($images as $imageType => $imageFileName) {
        $path = '';
        if ($newImagePath != "") {
            $dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
            $path = $dir . $newImagePath;
        } else {
        }

        if ($io->fileExists($path)) {
            try {
               $product->addImageToMediaGallery($path, array('image', 'thumbnail'), false);
            } catch (Exception $e) {
                echo $e->getMessage();
            }
        } else {
            echo "Can not find image by path: `{$path}`<br/>";
        }
    }
}
$product->save();


texts: How to get product image by label in cart

texts:
I have Magento 1.9.2 that comes with swatches feature.

I have product with following swatches: Color, Size

I created configurable product using configurable options and added assiciated products.

All images uploaded in main configurable product with label e.g. Black, White, Red ...

Child products do not have any product images.

I wish to get product image of selected option in cart (not the image set as Base or small or thumbnail).

Please help


texts: Magento 2 Add Custom Sale Order Grid Column and Export in CSV

texts:
i added custom columns in Sales Order Grid successfully, but when i export data in CSV file the custom column blanked

<?php
namespace Vender\Module\Ui\Component\Listing\Column;

use \Magento\Sales\Api\OrderRepositoryInterface;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Ui\Component\Listing\Columns\Column;
use \Magento\Framework\Api\SearchCriteriaBuilder;

class CGST extends Column
{
    protected $_orderRepository;
    protected $_searchCriteria;

    public function __construct(ContextInterface $context, UiComponentFactory $uiComponentFactory, OrderRepositoryInterface $orderRepository, SearchCriteriaBuilder $criteria, array $components = [], array $data = [])
    {
        $this->_orderRepository = $orderRepository;
        $this->_searchCriteria  = $criteria;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

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

                $order  = $this->_orderRepository->get($item["entity_id"]);
                $export_status = $order->getData("cgst");

                $item[$this->getData('name')] = $export_status;
            }
        }

        return $dataSource;
    }
}

and here is my xml file

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="cgst" class="Vender\Module\Ui\Component\Listing\Column\CGST">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="string">true</item>
                    <item name="label" xsi:type="string" translate="true">CGST</item>
                </item>
            </argument>
        </column>

    </columns>
</listing>


texts:
I'm having some trouble understanding why magento is throwing this exception when I attempt to access my backend.  This appears, at least to my eyes, to be configured correctly.  Any ideas?

Below is my modules config.xml (located at ProjectName/etc/config.xml):

<global>
    ....
    <models>
        <projectname>
            <class>NameSpace_ProjectName_Model</class>
            <resourceModel>projectname_mysql4</resourceModel>
        </projectname>
        <projectname_mysql4>
            <class>NameSpace_ProjectName_Model_Mysql4</class>
            <entities>
                <projectname>

project_name_table

                </projectname>
            </entities>
        </projectname_mysql4>
    </models>
    ....
</global>

Below is my system.xml (located at ProjectName/etc/system.xml):

<config>
    <sections>
        <cataloginventory>
            <groups>
                <options>
                    <fields>
                        <namespace_projectname_import translate="label">
                            Import project
                            <frontend_type>import</frontend_type>
                            <backend_model>projectname/csv</backend_model>
                            <sort_order>60</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </namespace_projectname_import>
                    </fields>
                </options>
            </groups>
        </cataloginventory>
    </sections>
</config>

Below is my model (located at ProjectName/Model/CSV.php):

class NameSpace_ProjectName_Model_CSV extends Mage_Core_Model_Config_Data
{
    public function save()
    {
        Mage::log("this is configured correctly");
        Mage::getResourceModel('projectname/projectname')->uploadData();
    }
}


texts:
When some person try to login with username and password already created or try to reset password magento says this mail id is not registed in the database even if person buy some product and come back again even then it shows email id is not registed. How to rectify this problem.

I think this is cookies issue but don't know how to resolve this issue can any person help me in this problem...


texts: How to change product price using drop down option in Magento 2?

texts:
I want to change product price when drop down option is change. Here drop down is dynamic means you can add N number of drop down and it's options from admin side.

(Note: This is not a product custom option)

I think i can get this using jQuery can anyone suggest me script.

Thanks In advance


texts: Magento2 controller redirecting to blank page

texts:
Magento2 after executing the file controller redirecting to a blank page. can anyone please help me?

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

routes.xml

<router id="standard">
    <route id="promotion" frontName="promotion">
      <module name="Company_Promotion"/>
    </route>
  </router>

layout

<referenceContainer name="content">
            <block class="Company\Promotion\Block\Promotion" name="coupon_generate" template="Company_Promotion::products.phtml"></block>
        </referenceContainer>

Thanks.


texts: How to stop redirect on-click wishlist icon

texts:
My wishlist code:
<?php
/**
* Copyright Â© Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist $block */
?>
<?php if ($block->getWishlistHelper()->isAllow()) : ?>

<a href="#"
class="action towishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"
aria-label="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($block->getProduct()) ?>'
data-action="add-to-wishlist"
role="button">
<img class="whislist-icon product-id-<?php echo $block->getProduct()->getId();?>" src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/whislist_icon.jpg'); ?>" />
<?= $block->escapeHtml(__('Add to Wish List')) ?>

<?php endif; ?>
<?php
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $_objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStore = $storeManager->getStore();
$mediaUrl = $currentStore->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
$wishimage = $mediaUrl."after_added.jpg";
?>

Now, if click wishlist icon its redirect to the wishlist landing page, how to stop that?


texts: Catalog Price Rules Stops working automatically so need to reapply them programmatically?

texts:
I am facing a very strange problem of catalog price rules in magento. I have created catalog price rules to effect prices of product but sometime they automatically stop working then i have to reindex everything again and apply them again.
Now i am looking for permanent solution.
What i think the solution is to set a cron job and Re-Apply all the Catalog Price Rules through it. So how to Re-Apply all the Catalog Price Rules Programmatically ?

Has anybody also faced this problem ?

Thanks,


texts: Product dimensions in Magento 2.2.5 update

texts:
I have installed Magento 2.2.5 locally with sample data.

Now three new attributes Length, Width, Height Added. These are the default attributes, created by Magento 2.2.5 or by some third party extensions.

And how to get these attribute values Cart/Checkout.


texts: Magento 2 layered navigation Ajax jquery problem

texts:
I am having this problem from Magento 2.2.5 and when upgraded to Magento 2.3 also. I use custom template

Layered navigation with Ajax isn't working. I use Amasty one

It just refreshes the page and no products is called.

If I disable Ajax everything is fine.
I can't give more details because I don't have any errors in console, nor in log files.
I am having two days now and I can't find anything.

Any help what to check would be much appreciated


texts: meta keyword tag not showing in browser source

texts:
Fist of all I already look these questions Meta Keywords does not appear and Magento meta keywords tag not showing but my question answer is not listed there.

I am using Magento 1.9 CE in my_theme>default>template>page>html head.phtml when I change keywords name to keywords1 like

<meta name="keywords1" content="this keyword, what keyword" />

I can see this in browser source but when I back change to keywords like

<meta name="keywords" content="this keyword, what keyword" />

Magento engine despairs the whole tag.

So there is not the problem if cache etc problem is clear that Magento engine deliberately removing keywords meta tag if anyone knows why it is doing this???

or any solution


texts: How to delete the cookie while customer logged out in magento 2

texts:
I wish to delete cookies while the customer clicked the log out button?
Can you please suggest us the best way to do it in magento 2


texts: How to fetch "created_at" date while applying a coupon code in cart page

texts:
This is regarding mass generation of coupons. I generate many coupons under single rule.

When I apply anyone of those coupons in the cart page I need to perform custom validation apart from magento default validation.

I need to fetch the 'created_at' date displayed in mass generate coupons backend grid.

Can someone tell me how to fetch this parameter.


texts: Adding a checkbox attribute to customer (instead of multi select)

texts:
Ok So I've managed to add a custom attribute to my customers currently only view-able on the admin panel side. Its listing out all the options from another module into the multi selects options as well as the default options at the top of multi select.

Now after I made this I decided that it wasn't quite as user friendly as I would like, so I'm wondering about changing this into a checkbox.

I made an update and changed the attribute as follows:

$installer->addAttribute("customer", "brands",  array(
"type"     => "text",
"backend"  => "",
"label"    => "Brands",
"input"    => "checkbox",
"source"   => "registration/eav_entity_attribute_source_customeroptions13632635690",
"visible"  => true,
"required" => false,
"default" => "",
"frontend" => "",
"unique"     => false,
"note"       => ""

));

This however did not work, So I was wondering if check-box is actually a option for making magento attributes (for customers specifically).

If checkboxes aren't an option, would it be possible to customize the front end to display a check-box list instead of the multi select or would this create problems?


texts:
I have read a number of ways to add JS files to a Magento 2 project, but I haven't seen anywhere where the benefits / best use-cases for each are explained.

The use-cases that are most relevant to my projects are:

Adding a JS library (eg. Owl Carousel)
'' my own JS file with some basic click events and references to the above library.

And the init methods available (to my knowledge) are:

Adding a file through requirejs-config.js and referencing it in a template file where needed.
'' in an xml file within  tags.
'' via the Magento x-init method.

I assume that each method has a best use case due to the fact that there seem to be a few options.

Could anyone give a brief explanation or a link where the benefits/ use-cases are broken down?


texts: Magento report grid running out of memory

texts:
We have a custom order export script that runs out of memory. Exporting a small time range works fine, but exporting all of December does not (more orders than usual, due to the holidays.)

I added some log statements to give me the memory usage at various points in the process, and ran the export for a small time range. It appears that the spike happens when rendering the report.

Beginning of controller action            Memory: 5.84M
<database query happens at this point>
after getReport()                         Memory: 19.48M
<now Magento prepares our HTML output>
End of controller action                  Memory: 44.14M

*When exporting a large dataset, "End of controller action" never gets reached.

We really only need to use the CSV export feature, but we can't even get to that because you have to "Refresh" the grid before clicking "Export."

Short of re-writing this as a stand-alone report (outside of Magento) I'm not sure what to do. Anyone?


texts: Magento 2 Price not updating in all store views when scope set to global

texts:
In my magento 2.3.5 instance I am trying to switch price to global scope. I don't need the function to have different price for a product in each store view.
Unfortunately this store is migrated from magento 1 and there I wasn't use Global scope for price.
So now in Magento 2 when I switch price to global magento isn't taking the default store view price to all store views. Because of my large catalog some products had in some store views different price than default store view.
I can identify the products and when I edit them I see the right price in default store view and the wrong price in another store view.
But when I try to change the wrong price, when I press save magento is changing the price in default store only and in the other store view I have the old wrong price.
Has anyone this issue? Is there a way to solve this without changing all my catalog prices?
I only need to change scope to global and keep default store view price to all my store views


texts: Get all products(id) and attributes out of db

texts:
I have a custom script to update prices and stock automaticly.

To get all products attributes I use:

$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*');

I saw that other people noticed that not all products-id are loaded. This I figured out. Because the disabled products are not in de EAV flat tables.

So my question, how to I get the same output with the collection above but then with the disabled products included?
And also is there another way to load all products id and attributes by name e.g. foreach product, id, price, stock.... without loading all the overhead


texts: Cached Images not shown in Product Image (CDN at AWS S3)

texts:
I am stuck here. As i am using S3 bucket and S3FS-FUSE for syncing my /media folder with S3 bucket with rsync (cronjob).

As rsync is very slow in syncing cached images with S3, thus it results in broken image links on main product pages as cached images are not present in S3.

This is actually a known problem with the CDN, i am also not able to figure out any workout.

Is it possible to modify some code in magento 1.9.3.4 for MAIN PRODUCT IMAGE, that magento will load only original images from CDN S3, not the cached images.


texts:
I need to add attribute through a setup script.Attribute properties are working,but the frontend properties are not applied as specified in the setup script.For example, visible_on_front is_html_allowed_on_front not working.

$installer = $this;

$installer->startSetup();

$entityType = 'catalog_product';
$attributeCode= 'video';

$data = array(
    'label' => 'Video',
    'input' => 'textarea',
    'type'  =>  'text',     //database input type
    'visible' => true,
    'required'  =>  false,
    'comparable'=> false,
    'searchable'    => false,
    'filterable'    => false,
    'unique'    => false,
    'visible_on_front'  => true,
    'is_html_allowed_on_front' => true,
    'global'    =>  Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'user_defined' => true,
    'apply_to'  =>  '',
    'is_configurable'   =>  false,
);

$installer->addAttribute($entityType, $attributeCode, $data);

$installer->endSetup();

Part of config.xml

<config>
    <modules>
        <Company_Video>
            <version>0.1.0</version>
        </Company_Video>
    </modules>
    <global>
        <resources>
            <video_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </video_read>
            <video_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </video_write>
            <video_setup>
                <setup>
                    <module>Company_Video</module>
                    <class>Mage_Eav_Model_Entity_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </video_setup>
        </resources>
    </global>
</config>


texts:
I have a page with products, and when I add a product to the wishlist or shopping cart, my screen jumps to the top of the page.

Is there a way I can stay at the same scrollposition after I add a product to my cart or wishlist from my category page.


texts:
My requirement is to change the order of checkout steps. I have a custom module (Customization with checkout structure) for checkout.

I want to change the function _getStepCodes() in app/code/core/Mage/Checkout/Block/Onepage/Abstract.php (to change the order of checkout order). But I understood that abstract classes cannot be rewritten or overridden.

I want to keep all my changes to my custom module only "Company_CustCheckout". ie, the default checkout should work if my custom module is disabled.

I have copied the function _getStepCodes() to app/code/local/Company/CustCheckout/Block/Onepage/Abstract.php

<?php
class Company_CustCheckout_Block_Onepage_Abstract extends Mage_Adminhtml_Block_Catalog_Category_Abstract
{
    protected function _getStepCodes()
    {
        Mage::log('fdg',null,'order.log');
        return array('login', 'review', 'shipping', 'shipping_method', 'payment');
    }
}

But the log value is not printing, which means it is not entering the function in my module.

I haven't added any changes in module config.xml file.

How is it possible to add custom code in the function.
How is it possible to change the order of checkout process.

Please help


texts: Is there any way to reflect the css,js changes without running static content deploy in Magento 2?

texts: Is there any other method other than running deploy command to get new changes in the files in Magento 2?


texts: Multistore: change default store got admin inaccessible

texts:
I have a magento website with multi store installation, i have a problem that the store domain.com redirects to default.com, the default.com is the default store domain, this is the 1st issue.

The second issue, when i tried to change the default store to domain.com, i got a loop redirection and the admin still loading and i no longer can access it.
Edit: i fixed the 2nd issue in the table store_website i changed the is_default field to 1 for the default.com website


texts:
I am new to Magento, but what I need to do is:

after the order is saved, I have to call an external webservice and pass some order data to this service.

Where or what is the best place to do so?

thanks in advance


texts: Magento Security Patches showing "Unknown" status in Mage Report

texts: I am keep seeing the patches status is "unknown" in magereport, but the patches are successfully installed in the site. I updated the patch codes in core controllers which are extended local/Mage Directory. Can anyone came across this problem.


texts: Magento 2.3.1 exception occured during order load

texts:
How to resolve the issue on Magento 2.3.1 orders grid unable to open in the admin end It throws below error.

  report.CRITICAL:
  a:1:{s:19:"real_transaction_id";s:22:"5682952820116120004012";}Unable
  to unserialize value. Error: Syntax error {"exception":"[object]
  (InvalidArgumentException(code: 0):
  a:1:{s:19:\"real_transaction_id\";s:22:\"5682952820116120004012\";}Unable
  to unserialize value. Error: Syntax error at
  /var/www/html/tupperware/vendor/magento/framework/Serialize/Serializer/Json.php:39)"}
  .