texts: Magento 2: How to remove attributes of the customer in the backend?

texts:
I need remove from customer addresses the next attributes: Prefix, Middle name and Suffix.

How I do this?


texts: Where is the js file where the _required class is written? I would like to add a custom class to the label underneath (.label .label--required)


texts: magento add many additional price to cart, and user can choose one

texts:
Assumption : A customer added a mobile phone worth ₹2000 to cart Situation : Our client wants the customer to select one recharge amount for eg. ₹100(from many available recharge amount eg. ₹50, ₹100, ₹150, ₹200, ₹250) in cart, these amount can be added from admin backend. And the final price of product is ₹2100. (for each product customers have to select the recharge amount seperately) Modifying the price would reflect in many areas like invoice, email exchange, checkout total.

In which module the price calculations are there? and whats the better way to achieve this?

Any steps to do this or a sample piece of code would be much appreciated.

Thanks.


texts: Magento 2.3.5 extend \Magento\Catalog\Model\Layer

texts:
I'm able to add layered navigation to a custom page, but if I try to extend \Magento\Catalog\Model\Layer class i've got this exception:

1 exception(s):
Exception #0 (Exception): Notice: Undefined offset: -1015 in /mnt/vdb/vhosts/emlineamoto.com/subdomains/dev/vendor/magento/framework/Search/Dynamic/Algorithm.php on line 302

Here the code i use:

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Magento\LayeredNavigation\Block\Navigation\Outlet" type="Magento\LayeredNavigation\Block\Navigation">
        <arguments>
            <argument name="layerResolver" xsi:type="object">Bileamara\SpecialCollection\Model\Layer\Resolver</argument>
            <argument name="filterList" xsi:type="object">searchFilterList</argument>
        </arguments>
    </virtualType>
    <type name="Bileamara\SpecialCollection\Model\Layer\Resolver">
        <arguments>
            <argument name="layersPool" xsi:type="array">
                <item name="outlet" xsi:type="string">Bileamara\SpecialCollection\Model\Layer\Outlet</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="Bileamara\SpecialCollection\Model\Layer\Context" type="Magento\Catalog\Model\Layer\Context">
        <arguments>
            <argument name="collectionProvider" xsi:type="object">Magento\CatalogSearch\Model\Layer\Category\ItemCollectionProvider</argument>
            <argument name="stateKey" xsi:type="object">Magento\Catalog\Model\Layer\Category\StateKey</argument>
            <argument name="collectionFilter" xsi:type="object">Magento\Catalog\Model\Layer\Category\CollectionFilter</argument>
        </arguments>
    </virtualType>
    <type name="Bileamara\SpecialCollection\Model\Layer\Outlet">
        <arguments>
            <argument name="context" xsi:type="object">Bileamara\SpecialCollection\Model\Layer\Context</argument>
        </arguments>
    </type>
</config>

and class:

<?php
namespace Bileamara\SpecialCollection\Model\Layer;

class Outlet extends \Magento\Catalog\Model\Layer
{
    public function getProductCollection()
    {
        if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
            $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
        } else {
            $collection = $this->collectionProvider->getCollection($this->getCurrentCategory());
            $collection->addFieldToFilter('real_stock',1);
            $this->prepareProductCollection($collection);
            $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
        }

        return $collection;
    }
}

any suggestions?


texts: Category Image with Category Id in Magento 2 Api

texts:
I want to show category id with category image in magento 2 rest api
http://domainname/rest/all/V1/categories?rootCategory=2
this is my api response and here not show category image
{
"id": 1,
"parent_id": 0,
"name": "Root Catalog",
"is_active": null,
"position": 0,
"level": 0,
"product_count": 0,
"children_data": [
{
"id": 2,
"parent_id": 1,
"name": "Default Category",
"is_active": true,
"position": 1,
"level": 1,
"product_count": 546,
"children_data": [
{
"id": 20,
"parent_id": 2,
"name": "Main Category Name",
"is_active": true,
"position": 3,
"level": 2,
"product_count": 1,
"children_data": []
}
]
}
]
}
Please help anyone...


texts: jQuery optimized load for module, using only one file (layout)

texts:
In Magento environment, prototype rules. In order to play with jQuery, we need to:

load jQuery before prototype
check if jQuery is already loaded before loading it (by some other module, or the webdesigner)
prevent conflicts with prototype using jQuery.noConflict();

Complementary to that, I prefer to avoid packaging again and again the JavaScript libraries, so the solution would be to load external_js; two major benefits:

Module easier to debug
Gain loading speed by using cached files (for instance, using cdn), the more developers use this practice, the better for us all it will be.

How to mix all these requirements?


texts: Magento 1.9 after installing patch the add to cart, customer login are not working?

texts:
Magento 1.9 after installing patch the add to cart, customer login is not working the list of patch that is installed was-

PATCH_SUPEE-10415
PATCH_SUPEE-10266
PATCH_SUPEE-9767
PATCH_SUPEE-9652
PATCH_SUPEE-8788
PATCH_SUPEE-7405
PATCH_SUPEE-6788
PATCH_SUPEE-6482
PATCH_SUPEE-6283
PATCH_SUPEE-5994


texts: Problem in submitting Magento Login form

texts:
Here is my simple magento login form but I am unable to submit my form. What may be the possible reasons?

<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
 Email:
 <input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>"  title="<?php echo $this->__('Email Address') ?>" />
 Password:
 <input type="password" name="login[password]" id="pass" title="<?php echo $this->__('Password') ?>" />
 <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><?php echo $this->__('Login') ?></button>


texts: 'Customer email is required' error while checking out as guest

texts:
I am getting an error 'Customer email is required' when clicking on Place Order button while checking out using guest account.
How to fix this?


texts: i am using mailchimp ebizmart extension it was working before but some how its stop to sync order how i debug this issues.


texts: Magento products not showing up after import

texts:
I've been trying to import products from Magento 1.7 to 1.9, but have been running into a lot of problems.

When trying to export with System-Import/Export-Export and then Importing through Dataflow Profiles I'm getting the error:

  Skipping import row, required field "sku" is not defined.

I tried saving with encoding UTF-8 in Sublime Text 2, but that didn't work.

When trying to export through dataflow profile and then import through dataflow profile the products don't show up, but it does finish the import without errors.

Processed 100% 241/241 records
Imported 241 records

Here a person found a solution, but I do not really understand what he did there: https://stackoverflow.com/questions/12953584/product-is-not-displaying-in-listing-in-magento-after-import

EDIT:
Products appear under category products and when making new product, you can select them as related product.


texts: magento 2 add/call css file in email template of custom module

texts:
I am trying to add inline CSS in the email template in my custom module.
Example
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <style type="text/css">
        {{var template_styles|raw}}

        {{css file="css/email.css"}}
    </style>
</head>

I reviewed some other modules in Magento 2 for reference like Ebizmarts but no one adds CSS file in the email template he just written all CSS code in the email template instead of adding a new file.
I am not sure what is an issue. Looking for help...


texts: Quote Quantities are wrong for Arabic Store

texts: I had multiple stores English and Arabic , when i switches to the Arabic store , all the cart item quantities turned to one. But in English store they are Same as quantity added. Can some one help me regarding this? Thanks in Advance.


texts: Using construct instead of object manager

texts:
I'm running into an error while converting below code that uses object manager to injecting within construct instead.

In this example i have this code:

$objectManager->create('Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable')->getParentIdsByChild($product->getId());

So I want to use the Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable within the construct so assumed i would add to my current construct like below:

//1. Add variable
protected $catalogProductTypeConfigurable;

public function __construct(
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility,
    \Magento\Framework\App\Http\Context $httpContext,
//2. Add Class here next to variable defined before construct
   \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable $catalogProductTypeConfigurable,
    array $data = []
) {
    $this->_productCollectionFactory = $productCollectionFactory;
    $this->_catalogProductVisibility = $catalogProductVisibility;
    $this->httpContext = $httpContext;
    //3. Also add here so this class is passed to our variable
    $this->catalogProductTypeConfigurable = $catalogProductTypeConfigurable;
    parent::__construct(
        $context,
        $data
    );
}

So steps 1 sets variable, 2 takes class and passes to construct, and 3 sets this to a local variable. This then allow me to use getParentsIdsByChild function from $this->catalogProductTypeConfigurable.

e.g.

$this->catalogProductTypeConfigurable->getParentIdsByChild($product->getId());

This however throws following error:

 PHP Fatal error:  Uncaught TypeError: Argument 5 passed to Vendor\\Module\\Block\\CustomBlock::__construct() must be an instance of Magento\\ConfigurableProduct\\Model\\ResourceModel\\Product\\Type\\Configurable, array given

I would like any advice on how to do this correctly.


texts:
I have a question about best practice for running a dedicated Magento server. We have a security consultant who want to run the site as APACHE while the Magento documentation says we should run as a web user

http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after

  Dedicated Magento server only. As a user with root privileges, enter
  the following command to set ownership of the Magento installation
  directory and all its subdirectories: chown -R web-server-user-name .

I am trying reconcile the reasoning on running as the apache user compared to a different user? Is running as the apache user more secure?


texts: Magento 2.3 : Mixin function is not rendering

texts:
I have a mixin which is extending functionality for validation purpose. See the code below

define([
'jquery',
'Magento_Ui/js/lib/validation/validator'
], function ($, validatorlib) {
"use strict";
console.log('test');
return function () {
    console.log('test123');  // this is coming in console
    var regex_pattern = window.address_field_pattern;

    if (regex_pattern == '')
        return true;

    validatorlib.addRule(
        'validate-gearalphanumeric',
        function (value) {
            if (value)
                return regex_pattern.test(value);
            else
                return true;

        },
        $.mage.__('Please use only numbers and Latin characters in this field.')
    );

    $.validator.addMethod(
        'validate-gearalphanumeric',
        function (value) {
            if (value)
                return regex_pattern.test(value);
            else
                return true;

        },
        $.mage.__('Please use only numbers and Latin characters in this field.')
    );
}
});

  NOTE : It was working in 2.2 version

and I do have verified the implementation as well but it seems not working.

Anyone find any issue in above do let me know.


texts: Creating shipment programatically does not update order items shipped - order never complete

texts:
I'm developing a procedure that has to programatically create shipment for orders that are already paid and invoiced.

The problem is that even after creating the shipment, the order status remains to 'processing' instead of going to 'complete'.
This does not happen if I manually Ship from the backend.

I found that the problem is that the quantity shipped for the order items is not updated, but remains 0 after saving the shipment and the order.

This is the procedure i'm using.
No exception is issued, and shipment is correctly created.

    $orders = $this->_orderCollectionFactory->create()
        ->addAttributeToSelect('*')
        ->addFieldToFilter( 'entity_id' , array('in' => $ordersIdsArr) )
        ->setOrder('created_at', 'desc' );

    foreach ($orders as $index => $order) {
        if ($order->canShip()) {
           $shipment = $this->_convertOrder->toShipment($order);;
           $orderItems = $order->getItemsCollection()->addAttributeToSelect('*')->load();

           foreach ($orderItems as $orderItem) {
                if (! $orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {
                    continue;
                }
                $qtyShipped = $orderItem->getQtyToShip();
                $shipmentItem = $this->_convertOrder->itemToShipmentItem($orderItem)->setQty($qtyShipped);
                $shipment->addItem($shipmentItem);
            }
            $shipment->register();
            $shipment->getOrder()->setIsInProcess(true);

            try {

                $saveTransaction = $this->_transactionFactory->create();
                $saveTransaction->addObject($shipment)
                    ->addObject($shipment->getOrder());
                $saveTransaction->save();
            } catch (\Exception $e) {

            }
        }
    }

    /*..........*/

Any clue?


texts: Magento 2 : Change Comment of Onepage Checkout Email Address

texts:
I need to change this text in Magento 2 Checkout Onepage.
Please check in the image.


texts: How to create admin user with only read customer permissions in Magento-2.1?

texts:
I have created one admin role with Customers/All Customers.

This user have permissions for access customers,modify customer details, delete customer.

But I want to restrict this user to delete customer, modify customer in Magento-2.1

How can do that?


texts: Multiple local.xml layout files in a package

texts:
Say there are two themes in a package:

Base (Set as default)
Child (Set as main theme)

Both contain a local.xml in the layout folder - Only the local.xml from the Child theme will be loaded, so any CSS, JS or layout updates in the Base local.xml do not get loaded.

Without using page.xml (so allowing for the same functionality as local.xml but with inheritance), how would I have an xml file for Base and and one for Child that both get called?

Would this require building a module with a sole purpose of adding a usable xml file (eg: base-local.xml)?


texts: notify admin on new order is not working

texts:
I have been try solve this by myself but need help now, notify admin on all new order is not working. When I check var/log/exception on my root file I find this error on it. Please someone tell me what to do?

exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/melmatcb/public_html/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 /home/melmatcb/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/melmatcb/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/melmatcb/public_html/app/code/core/Mage/Core/Model/Email/Queue.php(241): Zend_Mail->send()
#3 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#4 /home/melmatcb/public_html/app/code/core/Mage/Cron/Model/Observer.php(325): call_user_func_array(Array, Array)
#5 /home/melmatcb/public_html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))


texts: Magento 2 - Change the product page layout only for configurable products

texts:
I create the layout for simple products. Magento_Catalog/layout/catalog_product_view.xml

Now I want to add this line:

 <move element="product.info" destination="content" before="-"/>

but only for configurable products.

How I can change the layout only for configurable products?


texts: Magento 2 How to set owner email address to get new order email?

texts: I am Using Magento 2.1.1 version with em-everything default theme.If Any customer ordering the product from store the new order email is not sending to store-owner email id but customer is getting the new order email.How to set Store Owner email id to get mails on all new orders ?


texts: Upgrade existing Magento 1.9 using Open mage or get patches from it

texts:
We want update our Magento 1.9 site with latest patches and came across Open Mage.
We are not sure how to get patch files from it as it seems to be a complete Magento 1 installation repository.
Below are my question:

Can we upgrade our existing Magento 1.9 site using open mage ?
Have anyone implemented the same with their existing website ?
What issues were faced during upgrading if any ?

Please guide us on this and what approaches we can take.
Open Mage link : https://www.openmage.org/magento-lts/install.html
Github link : https://github.com/OpenMage/magento-lts


texts: Onepage Checkout - No place to enter credit card information

texts:
If I select the Credit Card payment method I get a message that I will be required to enter my credit card details after the order is placed.  However, when I click place order, I am taken to an order confirmation page with a confirmation number and no place to enter payment details.

Please help!


texts: Magento 2 : Can we pass multiple variables in layout handle?

texts:
Can we pass multiple variables in layout handle.

like below code :

 {{layout handle="email_product_list" order=$order product=$product area="frontend"}}


texts:
Is it possible to not use a fixed date but just the "current date" as a condition for a price rule for promotions?

For example let's say I want to give a 10% discount to all new products.

I would like to add the simple condition of.
Set as New product from date <= today <= Set as new product to date

However, trying this I can only set fixed dates.

Is there a clever way around this perhaps?
Edit A dumb way is fine too :).


texts: Finding out layout handles being evaluated for a page

texts:
I am working on a project where I want to display few links on left side of top bar at Home page, as shown below.

To do this i created a new block with name left.top.links very similar to Magento's block top.links and modified header template and added this block before currency block, very similar to as described in the post here.

but even though i have named this block differently i.e. left.top.links when I logout Sign Up links gets added on both the blocks, top.links and left.top.links.

First place which I wanted to check was customer_logged_out handle in customer.xml, which looks completely OK to me and In fact, i could not find Sign Up link being added anywhere in Magento frontend layouts.

So, my question is, Is there any way to find out how Sign Up link is added in block? Also, what all layout handles are evaluated to render a page? Which will help me in checking on all those places.


texts: Invalid Form Key. Please refresh the page Magento 2.3

texts:
While trying to login in default theme of Magento 2.3 Front-end after input of all details "INVALID FORM KEY error is coming up"

PLEASE HELP!!


texts: Fetching simple product data from a quote item, based on a configurable product

texts:
In my module I want to do some things if a product in the cart has a custom attribute 'servicepack'.

So by using the /etc/catalog_attributes.xml I exposed the property

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="servicepack"/>
    </group>
</config>

Next, I added my logic.

/** @var /Magento\Quote\Model\Quote $quote */
$quoteItems = $quote->getItems();
foreach($quoteItems as $cartItem){

    $product = $cartItem->getProduct(); //This is the configurable product
    $simpleId= $product->getIdBySku($product->getSku());

    /** @var ProductRepositoryInterface $this->productRepository */
    $simpleProduct = $this->productRepository->getById($simpleId); //Seems overkill?

    if($simpleProduct->getData('servicepack') == 123){ //This property is only on the simple product
        // do stuff
    }
}

I doubt this is the correct way to handle this situation.

The thing that confuses me:
The $cartItem is a configurable product. My 'servicepack' attribute is only set on the simple product. So I need to get the simple product data. I solved this by getting the simple product id, and fetching the simple product from the ProductRepository.

However, this seems inefficient, because it causes a db query for each product.

Question: Is it possible to get the simple product data without a database query?
For example: $product->getSimpleObject($product->getSku()); //Returns the $simpleProduct

Or would my solution be considered a decent way to handle things?


texts: Where can I exactly find the local.xml file to edit the layout of the search results page of the theme? I went through the theme folder but I couldn't find it.


texts: Translate *Required Fields - Magento 2.3

texts:
We have an issue that we are not able to translate "*Required Field" and "This is a Required field"
I also notice that the previous developer have put the Norwegian Language pack under /vendor/magento2translations. I would like to think it should be under app/i18n/magento2translations (create this path ofc.
The owner told me they have used translateline to translate everything on the web page, as in manually. Shouldn't the translate pack do this for them? except if there is any specific translation? We also have problems where we are able to translate via translateline but will not save after we put the site back to production mode.
Another question, do i need to set the i18n/no/NO on every module i have, or have does this work?
Any help is appreciated


texts: How to use fixture files in Magento2 Integration test?

texts:
I am beginner in integration testing and I need a brief highlight on concept of using fixture files in Magento 2 Integration Testing .
    I tried with following simple code to test what impact in integration test in db and what it returns :

Vendor\Module\Tests\Integration_files\Config.php

<?php
$model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
    ->create(\Magento\Framework\App\Config\Storage\WriterInterface::class);
$model->save('web/unsecure/base_url',  'http://mymagento.com/');
$model->save('web/secure/base_url',  'https://mymagento.com/');

file location : Vendor\Module\Tests\Integration\Block\Form\LoginTest

<?php

namespace Vendor\Module\Tests\Integration\Block\Form;

use Magento\TestFramework\Helper\Bootstrap;

class LoginTest extends \PHPUnit\Framework\TestCase
{
    public static function loadFixture()
    {
        include __DIR__ . '/../../_files/Config.php';
    }

    /**
     * @magentoDbIsolation enabled
     * @magentoAppIsolation enabled
     * @magentoDataFixture loadFixture
     */
    public function testGetFormActionUrl()
    {
        $urlBuilder = Bootstrap::getObjectManager()->create('\Magento\Framework\UrlInterface');
        $this->assertSame('http://mymagento.com/frontname/controller/action/', $urlBuider->getUrl('frontname/controller/action/'));
    }
}

After executing test :

1. builder return URL : http://localhost/index.php/frontname/controller/action/ (So it give false assertion because expected is 'http://mymagento.com/frontname/controller/action/' )


texts: Allow edit product attributes on user permission

texts: I need my users not able to edit attributes, but they can view the attributes.


texts: URL builder always redirect to dashboard

texts:
I've enabled secret key and use url builder to generate edit product and customer link for Magento 2 Backend like this for my custom grid:

public function __construct(
   ...
   UrlInterface $urlBuilder,
   ...
) {
   ...
   $this->urlBuilder = $urlBuilder;
   ...
}

public function setCustomerEditLink($customerId,$customerName){
  $editUrl = $this->urlBuilder->getUrl('customer/index/edit/', ['id' => $customerId]);
  $url = '' . $customerName . '';
  return $url;
}

public function getProductEditLink($productId,$productName){
  $editUrl = $this->urlBuilder->getUrl('customer/index/edit/', ['id' => $customerId]);
  $url = '' . $productName . '';
  return $url;
}

It will generate a href link in my custom grid, but the problem when i click the link it always redirect me to admin dashboard, but if i click the href for new tab it redirects to the correct page


texts: How to import products from another database into magento2's database

texts:
I have an ERP system with a database that holds more or less 400,000 items.

I need the 400,000 items to be migrated to my Magento 2.1.3 database.

Is it possible to directly import items from my ERP database to magento's using an sql query? Will all thats needed after be to run the indexer to have the pages displayed?

What is the correct procedure for a direct import? Is there any example SQL out there someone has on hand to show me how its done?

Thanks!


texts: Inventory does not match between FE and BE

texts:
I use MAGMI to import and manage inventory of products in magento 1.9.3. Many items show in_stock and qty > 0 in admin but display as out of stock on the front end, saving the product on the admin site seems to fix the issue, but it's not reasonable to re-save full catalog as it's quite large. The products are visible on the front end and in the right category.

Please help!


texts:
my system log says:

[2016-07-07 06:57:49] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_3bc116a8dbf5ce43f9f3e452fa24f453b and handles default, tglssearch_result_index: Please correct the XML data and try again.  [] []

[2016-07-07 06:57:49] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_3a7ccd8094436548b564a588f6303121c and handles 2columns-left: Please correct the XML data and try again.  [] []

My custom layout file :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="content">
        <block class="Vendor\Module\Block\Navigation" before="-" name="catalogsearch.leftnav" template="Vendor_Module::search/filter.phtml" />
    </referenceContainer>
</body>
</page>

Could someone please help on this .


texts:
Hi I am focusing the Order Summary on my shopping cart, I found below file

/magento/module-checkout/view/frontend/web/template/summary/item/details.html

Inside above, there has a line of code, how does below works to grab the value?

where should I start to check the code which generate qty of the items in the Shopping cart - order summary block?

Thanks


texts: ReflectionException in magento site loading time


texts: Magento 1.9 add to cart button validation

texts:
I am new in Magento field. can you buddy help me to make understand how "add to cart button" validation HTML filed can find and works .? I reached

  /var/www/html/magento/app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml.

  /var/www/html/magento/app/design/frontend/rwd/default/layout/catalog.xml

  /var/www/html/magento/app/design/frontend/rwd/default/template/catalog/product/view.phtml

/catalog/product/view.phtml in this folder what should I analyze to understand about "add to cart" button validation please tell me to step by step with folder and directory name.


texts: Pass custom attribute from product listing to cart page

texts:
I need to get a custom attribute from the product list page to the cart page.

I need to know how to send the attribute from the product page and then how to get that attribute for that product on the cart page.

Any help would be great.

Thanks
S


texts: how to show all attributes even filters applied in magento 1.9?

texts: how to show all attributes even filters applied i.e., if we click on like category options then some options get cleared so I want to display all filters whether if we choose another option also.


texts:
How to custom id input on field in form ui component Magento 2?
Here's my code:

<input class="admin__control-text" type="text" data-bind="
    event: {change: userChanges},
    value: value,
    hasFocus: focused,
    valueUpdate: valueUpdate,
    attr: {
        name: inputName,
        placeholder: placeholder,
        'aria-describedby': noticeId,
        id: uid,
        disabled: disabled,
        maxlength: 255
}" name="general[sku]" aria-describedby="notice-MBFNF2H" id="MBFNF2H" maxlength="255">

I want custom id field input.

$fields = [
    [
        'label' => __('Attribute: '.$nameAttribute),
        'formElement' => 'input',
        'source'=>'general',
        'sortOrder' => 0,
        'validation'=> ['required-entry'=> true]
    ]
];


texts: How to add an often used attribute to the collection loaded on category page, related products, cart page etc

texts:
If you have a custom attribute that you use everywhere, on category page, on product page, in related items, on cart page, on checkout etc., how do you add it to the collection that gets loaded by default?

For example in related items (product/list/items.phtml), if I call:

$_item->getCustomatribute()

I get null.
$_item->getData() shows only a handful of "important" attributes to select, like id, sku, name etc.

I would like to add it so that I can call $_item->getCustomatribute() and not load the entire product via id.

Thanks!


texts:
I've searched everywhere and just can't seem to find the correct answer. I'm a complete novice when it comes to cron jobs! (However I do understand the principle behind them)

I'm running Magento 2.0.6 and I need to reindex - however I do not have SSH access and can't do anything through CLI. I do have access to cPanel and it's corresponding Cron Job utility. I was just wondering if anyone could tell me the exact command I need to pass to this utility?

These are my attempts at the cron jobs that I sourced from the Magento Documentation: (Does not work)

/usr/bin/php -c /usr/local/lib/php.ini /bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/log/magento.cron.log

/usr/bin/php -c /usr/local/lib/php.ini /update/cron.php >> /var/log/update.cron.log

/usr/bin/php -c /usr/local/lib/php.ini /bin/magento setup:cron:run >> /var/log/setup.cron.log

Can any one give me final solution which working


texts: Google Shopping Feed - Configurable Products

texts:
Hi, everyone!
I have a question about Google Shopping and Configurable products.
We use Magento's community edition for the website and then Mageplaza's product feed extension to push everything out to Google. Individual products that are part of a configurable product are being listed on Google Shopping's search but when clicked on they return a 404 error.
Is there a quick way to solve this? Adding 301 redirects doesn't feel like the right way (though if it is, we're happy to do this!). To solve the issue, should we change the visibility of individual products in the catalogue or is there a better way?
Thanks, Dave


texts: How to build a regex to capture the contents between DIV?

texts:
This is my test input string
Test code
Testing here. Div contents
 Blah Blah
Second div
Blah

I need to capture the contents between . Please help me understand how to build the regex to accomplish this with some explanation?


texts:
I have included following block in default category.
its working fine with main product collection.I mean its displaying only 2 products.but layered navigation getting all products count.

Can you help me on this?

Thanks in advance.

     <?php

namespace Dcw\Search\Block;

class Form extends \Magento\Framework\View\Element\Template {

    /**
     * @var \Magento\Catalog\Model\Layer
     */
    protected $catalogLayer;

    public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer\Resolver $layerResolver, array $data = []) {
        $this->catalogLayer = $layerResolver->get();
        parent::__construct($context, $data);
        $this->apply();
    }

    public function apply() {
        $skus = array('sku1', 'sku2');
        $collection = $this->catalogLayer->getProductCollection();
        $collection->addAttributeToFilter('sku', array('in' => $skus));
    }

}


texts: How to print an HTML Table multiple times inside a custom email template in Magento 2?

texts:
In custom email template placed at:
Vendor/Module/view/frontend/email/custom_email_template.html

I have a table which prints structure of a giftcard in email, For Example like this:

and table printing it is(suppose):

                                660

                                  56876478
                                  valable jusqu’au : 15 / 08 / 2020

If I have more then one gift cards to send in one email, how can I print the HTML content multiple times ? I can get amount value multiple times as:

{{var templateVars.amount|raw}}


texts:
I want to move the product price on the right part.

Screenshot:

The catalog product view root template is 2 columns right. I tried to find the block name using path hints so I can manipulate it from local.xml (test.xml in my case because I'm using custom theme) but I couldn't find it.

<?php echo $this->getPriceHtml($_product); ?> This is that piece of code that renders the product price in template/catalog/product/view.phtml but I can't figure whether this could be helpful or not.

If someone could tell me which is the right approach, I'd be very thankful!


texts: Blank Filters Using PHP SoapClient to Make Calls into WSI-Compliant API

texts:
I'm working on a project where we need to extend Magento's SOAP Api--we want to add a method for an existing .NET application using WSI-compliance mode.  I don't have access to this .NET application, so I'm trying to use PHP to make WSI-compliant calls into Magento, and I'm having some trouble with PHP's SoapClient. I can't seem to get a populated filters array through.

Specifically, I have a small test program that looks like this

$api = new SoapClient(
    'http://magento.example.com/index.php/api/v2_soap?wsdl=1',
    [
        'soap_version'=>SOAP_1_2,
        'trace'=>1
    ]
);
$result = $api->login([
    'username'=>'apitest',
    'apiKey'=>'apitest1'
]);
$session = $result->result;

$request = [
    'sessionId' =>$session,
    'filters'   => [
        'test'=>'foo'
    ]
];

$result = $api->salesOrderList($request);
var_dump($api->__getLastRequestHeaders());
var_dump($api->__getLastRequest());

var_dump($result);

The program is able to successfully fetch a session id from the server.  It's also able to successfully make a salesOrderList call into the server.  However, the program is not able to successfully send a filters array through.  That is, the __getLastRequest function above returns

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:Magento">
    <env:Body>
        <ns1:salesOrderListRequestParam>
            <sessionId>3590ffdb691bc65498dac32909d24da1</sessionId>
            <filters />
        </ns1:salesOrderListRequestParam>
    </env:Body>
</env:Envelope>

Does anyone know

If it's possible, using the V2 SOAP Api with the WSI-Compliant WSDL, to get a filters array through in a SoapClient call.
If not, does anyone know the proper format for the <filters/> XML of a SOAP request so I can modify it in a __doRequest method override.
Alternately, is there a composer package that supports the more modern WSI-compliant WSDL? i.e. an alternate SoapClient.


texts:
I can't translate something and i have no idea how to do it.
I need to translate an ajax popup that happens after you press add to card.

This wil give an popup from plugin (Ajax Filter and Cart - team V) that gives 2 buttons (Continue shopping and Proceed to Checkout) but i can't get this text translated.

I already tried:

on the FTP: app/locale/nl_NL/Mage_Catalog.csv i added the translation lines here.
on magento backend i put on translate inline but the buttons do not get the red square around them.

What can i do to fix this?


texts: how to add product to cart in magento api V2

texts:
I am trying to add product in to cart. I am facing lot of trouble with this. I have searched a lot of blogs. But could not find feasible answer.

I have also used the link in magento soap api v2 for adding product.

Every time i am getting error

  Fatal error: Uncaught SoapFault exception: [1022] Please specify the
  product required option(s).

Pls give  me a proper example that what are the input values should be there and what are their values..I am attaching my code here..

 <?php
$proxy = new SoapClient('http://www.magentohost.com/api/v2_soap/?wsdl');
 $sessionId = $proxy->login('user', 'apikey');
 $resultCartId = $proxy->shoppingCartCreate($sessionId, '1');
$productList = $proxy->catalogProductList($sessionId);
$product = (array) $productList[0];
$product['qty'] = 1;
$product['product_id'] = '234';
$product['sku'] = 'xxxxxxxx';
$product['name'] = 'abcdefgh';
$product['description'] = 'abcdefgh';
$product['short_description'] = 'abcdefgh';
$product['weight'] = '123.0000';
$product['status'] = '1';
$product['url_key'] = 'ab_cd_ef';
$product['url_path'] = 'ab_cd_ef.html';
$product['visibility'] = '2';
$product['tax_class_id'] = '1';
$product['price'] = '899.0000';
$result = $proxy->shoppingCartProductAdd($sessionId, $resultCartId, array($product));
//var_dump($result);
echo json_encode($result);
?>


texts: SOAP API Call not working with Magento 1.9.1.0

texts:
I am facing a issue with the SOAP Call request in Magento ver 1.9.1.0. I have tested the code in my local site, it works fine, but when i move the code to my online server it is not working.

I have checked SOAP is enabled in server, Please find the code i used for SOAP call,

$host = "81.82.212.166:8888/magento/index.php";
    $username = 'XXXXX';
    $apikey= 'YYYYYYY';
    try
    {
        $client = new SoapClient("http://" . $host . "/api/V2_soap?wsdl=1"); //soap handle
        $session_id = $client->login($username, $apikey);
    } catch (SoapFault $fault)
    {
        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
    }

When i run the above code faced below error,

Fatal error: SOAP Fault: (faultcode: WSDL, faultstring: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://81.82.212.166:8888/magento/index.php/api/V2_soap?wsdl=1' : failed to load external entity "http://81.82.212.166:8888/magento/index.php/api/V2_soap?wsdl=1" ) in /var/www/html/magento/ingram_import/ingram_category_import.php on line 59


texts:
I'm trying to understand the config paths, but I have problems with getting values from the payment section.

My goal was to get the value of the sandbox_flag of paypal_express, but I am not even able to get the merchant country via

$configValue = Mage::getStoreConfig('payment/account/merchant_country');

Since the config xmls of payments are a bit bigger than others, I think that I need another approach?


texts: Magento checkout page goes blank when checking out also product image not uploading

texts:
hello everyone am new in magento and am trying to built a site in magento everything working prefect on localhost but not working on server when i checkout also product image not uploading .checkout page is showing blank
am getting this error

  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 786432 bytes) in /home/rails/public_html/shoperhub/app/code/core/Zend/Date.php on line 2440

Array
(
    [type] => 1
    [message] => Allowed memory size of 33554432 bytes exhausted (tried to allocate 786432 bytes)
    [file] => /home/rails/public_html/shoperhub/app/code/core/Zend/Date.php
    [line] => 2440
)

I have already changed  in .htaccess file.

 php_value memory_limit 256M
 php_value max_execution_time 18000


texts: Magento 2.4.2 blank unsubscription link in email

texts:
I have already tried many given answers on the internet but none of them work such as I can't find below code in Subscriber.php, guess it was for Magento 1.x
$email->sendTransactional(
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE),
    Mage::getStoreConfig(self::XML_PATH_SUCCESS_EMAIL_IDENTITY),
    $this->getEmail(),
    $this->getName(),
    array('subscriber'=>$this)
);

I have also tried adding var unsubscribe or var subscriber.getUnsubscriptionLink() but none of them work.
in my footer of email I am trying to add unsubscribe url for the receivers, but how do i get in 2.4.2? Previously in 2.3.5-p1 it was working with subscribe_data.getUnsubscriptionLink() but with recent upgrade its not.
any help/suggestion please?


texts: knockout js drop down store list display on checkout page magento 2

texts:
app/code/Vendor/Module/Model/CustomConfigProvider.php  (data provider)

<?php

namespace Vendor\Module\Model;

use Magento\Checkout\Model\ConfigProviderInterface;

class CustomConfigProvider implements ConfigProviderInterface
{

    public function getConfig()
    {
        $storepick_config = array();
        $storepick_config[] = ['value' => 1, 'label' => 'label1'];
        $storepick_config[] = ['value' => 2, 'label' => 'label2'];
        $storepick_config[] = ['value' => 3, 'label' => 'label3'];
        $storepick_config[] = ['value' => 4, 'label' => 'label4'];

        $config = [
            'storepick_config' => $storepick_config,
            'storepick_config_encode' => json_encode($storepick_config),
        ];
        return $config;
    }

}
?>

app/code/Vendor/Module/view/frontend/web/js/view/checkout/shipping/storepickup.js

define([
    'jquery',
    'ko',
    'uiComponent',
    'Magento_Checkout/js/model/quote'
], function ($, ko, Component, quote) {
    'use strict';

    console.log(window.checkoutConfig.storepick_config);
    console.log(window.checkoutConfig.storepick_config_encode);

    return Component.extend({
        defaults: {
            template: 'Vendor_Module/checkout/shipping/storepickup',
            storepickConfig: window.checkoutConfig.storepick_config,
            storepick_config_encode:window.checkoutConfig.storepick_config_encode,

        },

    });
});

app/code/Vendor/Module/view/frontend/web/template/checkout/shipping/storepickup.html

<select data-bind="options:storepickConfig"></select>

now i want require drop down in checkout page but drop down not display proper way

i want to display store list in drop down
Please help if any one know


texts: Do not want to install custom modules during Magento 2 installation

texts:
I've a project which contains magento 2 core files and a few custom modules. Now I'm trying to install Magento.

During magento installation I see all custom modules are getting installed.

I don't want these modules to be installed during Magento installation.

Later based on necessity I want to install those modules.

How to achieve it?


texts: Magento 2 SALES Order and REPORT Orders Export data qis inconsistent

texts:
Two different operating places in the background.
Choose the same time (one day) for testing.
The output is different.
SALES Order count is same as my database query result.

This is SALES Orders

This is  REPORTS Orders

The results of the query after time conversion.


texts: Possible to send admin emails from a alternative email depending on the customer group?

texts:
I need to separate B2B from B2C, even for our clients, so I have defined in the backoffice let's say the email b2c@email.com, this is the email account that sends the emails to the clients, that's all right, but now I need to make a condition so if the client is from one of the B2B groups that email is changed.
I didn't find any module to do this and I thought about creating a module that uses as even before sending the email, but I don't know a way to basically change the email magento is using (the one in the backoffice) so it sends from the correct one.
Anyone knows a way to do this? or any module that would help?
Thanks!
Best regards,
Rui Silva


texts: How Do I get Order id from module-checkout/Block/Onepage/Success.php in magento 2

texts:
I want to get the order details from

  module-checkout/Block/Onepage/Success.php.

I got only the increment id to my custom template using the above block file.

How can I get the entire order details?


texts:
I am trying to set an automatically generated coupon code to a Magento 2 quote.
The code I am using is:

    $this->_checkoutSession->getQuote()->setCouponCode($post['coupon_code'])->setTotalsCollectedFlag(false)->collectTotals()->save();

The coupon code is being set in the quote but it is not updating when redirected by to the Magento cart page


texts:
I just installed Magento 2, it shown the success page result however the admin folder is not found.

Also the main page does not seem to be ok, seems like css is not in place, there is no menu... just their text and images.

Didn't find any error message.
Any idea?

Thanks!


texts: How to restrict user to access website by index.php

texts:
My client don't want home page accessible if someone type www.domain.com/index.php.

He only want home page accessible by domain name only(without index.php).
He thought it is affecting the site SEO

Is it possible? Please suggest guys.

Thanks in advance


texts: Magento 2 while reindex INSERT INTO 'catalog_category_product_index_store1' stuck the query

texts:
I am working on Magento 2.3.2. When I run re-index command php bin/magento i:rei Design Config Grid and Customer Config Grid is completed. But it is taking too much time to re-index Category Products and Product Categories

I checked the SHOW PROCESSLIT; in my database and I am getting the following query which is running from a while.

  INSERT INTO `catalog_category_product_index_store1

After a long time, it is displaying

  INSERT INTO `catalog_category_product_index_store2

I tried to reset the indexer and again re-index only those two indexers. But the same thing happening.

I have 60k Products in my Magento Store.

It has suddenly happened from a few days in live only. In local, it is re-indexing everything. The issue is only in live. I have the same number of products in local.

Is it any permission issue to any folder like var or generated?

Please guide me on that. Thanks in advance.


texts: Invalid template file within custom template

texts:
I am trying to work out why related products arent being displayed on my frontend, and when I check the logs I am presented with the below.
Any help would be great.
Thanks

[2019-02-14 13:56:02] main.CRITICAL: Invalid template file: 'public_html/var/view_preprocessed/pub/static/app/design/frontend/GladiatorFitness/Gladiator/Magento_Catalog/templates/product/list/items.phtml' in module: 'Magento_Catalog' block's name: 'catalog.product.related' [] []
[2019-02-14 13:56:02] main.CRITICAL: Invalid template file: 'public_html/var/view_preprocessed/pub/static/app/design/frontend/GladiatorFitness/Gladiator/Magento_Catalog/templates/product/list/items.phtml' in module: 'Magento_Catalog' block's name: 'product.info.upsell' [] []


texts: How to Validate Google Recaptcha on contact Page in Magento 2

texts: I use https://github.com/karliuka/m2.ReCaptcha module for google recaptcha its work fine. But if when we submit the form without checked the captcha then its refresh the Page and then show error. how can show error before refresh the page like https://crosstec.org/breezingformsdemo/index.php/breezingforms-demos/bootstrap-based-forms/recaptcha.html


texts: Show lowest price simple product from configurable product outside of product page

texts:
I have a configurable product with a number of simple products associated with it.

I am showing the lowest price simple product on the product page with this code:

$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions()->addAttributeToSort('Price', 'asc');

foreach($simple_collection as $simple_product){
echo '
Price: ' . Mage::helper('core')->currency($simple_product->getPrice()) . '

';
break;
}

I have a banner on the homepage which is where I want to show the price for a certain product.

I need to modify this code to load the price from configurable product ID 80 and show it on the Homepage


texts: Massachusetts State Sales Tax and In Store Pick Up

texts: I need to create an option for our customers to be able to select store pick-up under shipping that will include Massachusetts State Sales Tax. We still want to be able to ship to customers outside of the state and not apply the Sales Tax but when I change the tax to be calculated to Shipping Origin then this creates a problem for out of state purchases by adding the Sales Tax.  How do I have a In Store Pick Up option with Sales Tax included and not affect this?


texts: Determining product ID from URL in magento

texts:
Here is a sample url from my company's Magento site (and we're obviously using stores in the URL hence the smi000.. code)

http://shop.mystore.com/smi130495/catalog/product/view/id/35830/s/men-s-traditional-ring/category/312834/

I understand that the category id is 312834, and the product id is 35830.  I understand how to use Mage::helper->getURL() to get the URL, but how do I get the product ID using magento code (i.e. the "Magento Way"?)


texts: How do I change this sql query to Magento2 filter collection method?

texts:
I have below query
SELECT * FROM newsletter_subscriber WHERE change_status_at >=  (NOW() - INTERVAL 10 DAY);

How do I make it works with below?
        public function  getSubscriberStatus()
    {

        $subscriberCollectionData =$this->subscriberCollection->create();

/***********************query where cause **************************/

        foreach($subscriberCollectionData as $subscriber)
{
    print_r($subscriber->getData());
}

        return $subscriberCollectionData;
    }

Thanks!


texts: Getting a PHP Fatal Error: Uncaught Error: Class 'Zend_Cache' not found

texts:
Something went wrong when I was using the Component Manager to install a module, and now I cannot see my front or back ends.

When I try to do anything through the CLI I get this message:

PHP Fatal error:  Uncaught Error: Class 'Zend_Cache' not found in /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Frontend/Factory.php:148
Stack trace:
#0 /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Frontend/Pool.php(67): Magento\Framework\App\Cache\Frontend\Factory->create(Array)
#1 /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Frontend/Pool.php(146): Magento\Framework\App\Cache\Frontend\Pool->_initialize()
#2 /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Type/FrontendPool.php(84): Magento\Framework\App\Cache\Frontend\Pool->get('default')
#3 /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Type/Config.php(49): Magento\Framework\App\Cache\Type\FrontendPool->get('config')
#4 /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(65): Magento\Framework\App\Cache\Type\Config->_getFr in /chroot/home/urbanta1/devm2.urbantactical.com/html/vendor/magento/framework/App/Cache/Frontend/Factory.php on line 148

Can anyone tell me what to do? I have looked in the Factory.php, Pool.php etc and I can't tell what is wrong.

Thanks!


texts: Get Applied shopping cart price rule/Catalog price Rule name in product details page

texts: I'm using magento 1.9. How to Get, Applied shopping cart price rule/Catalog price Rule name in product details page.


texts: Product Search in Backend (Admin Area) - Something went wrong. - Magento 2.1-rc3

texts:
I upgraded my Magento from 2.0.2 to 2.1-rc3 some days ago, and today I had a strange issue with the Product Search (Products > Catalog) page, I'm getting the message "Attention: Something went wrong" and the searchs stop.

It was working some hours ago, the different thing is I imported some products.

I already flushed cache, re-compile, re-indexed and nothing.

Any help would be appreciated.

UPDATE 2016-07-22 - I was able to fix it, deleting all the products and importing them again. I have no idea what was causing it.


texts:
I am trying to add my own module to the admin in version 1.x but I'm getting the blank page when I try to open the module

This is what I have managed to achieve so far;

  My module appears as a menu item within the admin
  When I click the link the controller/action fires but when I try to add the content and create the block I get a blank page.

My controller is as follows:

  Foobar/Storelocator/controllers/Adminhtml/Store/IndexController.php

public function editAction() {

    echo "We got here...";
    ....

    $this->_addContent($this->getLayout()->createBlock('storelocator/adminhtml_store_edit')

    ....

}

I have the following block setup:

Foobar/Storelocator/Block/Adminhtml/Store/Edit.php

class Foobar_Storelocator_Block_Adminhtml_Store_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{

   public function __construct() {

        echo "____________";exit;

   }

}

  }

My config.xml:

<config>

....

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <storelocator before="Mage_Adminhtml">Foobar_Storelocator_Adminhtml</storelocator>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

    <adminhtml>
        <layout>
            <updates>
                <storelocator>
                    <file>storelocator.xml</file>
                </storelocator>
            </updates>
        </layout>
    </adminhtml>

</config>

It seems that the construct of the block isn't reached. I've spent a day checking my class names and folder structure over and over and the server logs have not revealed anything.

Any suggestions or help would be greatly appreciated.


texts: Magento Certified Developer Plus: are EE questions eliminatory?

texts:
I'm planning to book my Developer Plus certification this year.

However, I haven't worked a lot with EE.

I already got my Developer certification and I was wondering if the EE questions in the Developer Plus exam are eliminatory ?

For instance, if I get the questions from the Developer exam right and all the EE questions wrong, will I still pass ?


texts: Magento 2 get customer email in guest checkout

texts:
I've tried all posts on this subject but couldn't make it work.

I need to retrieve customer email during checkout, just after he fills the address form, on select payment method page.

This info is not stored in session (it is only if customer is logged in).

I've checked the table "quote_address" in database as well. The column "email" is empty while "firstname", "lastname", "street" have data.

I've tried javascript with no success either.

Where is that email stored?

Can someone help me on this? If so, please provide detailed answer.

Thanks in advance.


texts:
Using Magento ver. 2.2.5

I've following

$ composer info | grep elastic
elasticsearch/elasticsearch                       v6.7.2    PHP Client for Elasticsearch
magento/module-elasticsearch                      100.2.4   N/A

$curl -XGET 'localhost:9200'
{
  "name" : "ThinkPad",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "Bxpu3ocET3iHvSax1nIzgw",
  "version" : {
    "number" : "7.4.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "fc0eeb6e2c25915d63d871d344e3d0b45ea0ea1e",
    "build_date" : "2019-10-22T17:16:35.176724Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

In Magento Search

 catalog/search/engine =>elasticsearch5

When I try to do following

$php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
DateTime::__construct(): Failed to parse time string (2016-03-09 00:00:00 2016-03-09 00:00:00 2016-03-09 00:00:00 2016-03-09 00:00:00 2016-03-09 00:00:00 2016-03-09 00:00:00 2016-03-09 00:00:00) at position 20 (2): Double date specification

2nd Time

$php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Could not convert [custom_layout_update.index] to boolean"}],"type":"illegal_argument_exception","reason":"Could not convert [custom_layout_update.index] to boolean","caused_by":{"type":"illegal_argument_exception","reason":"Failed to parse value [no] as only [true] or [false] are allowed."}},"status":400}

Is this version compatibility issue or am I missing anything?


texts: payment methods cannot be saved in cart price rule after upgrade to Magento 2.3.2

texts:
I have a custom plugin that follows this guide:
Magento 2 - discount depend on Payment Method does not work
So customer will get 4% discount if they choose online payment solution instead of bank transfer. It worked fine in Magento 2.2.6, but when the shop has upgraded to Magento 2.3.2, the payment method in the cart price condition can not be saved. (the value of choosing payment method is always shown blank at the backend - cart price rule)

Here is the main code:

  app/code/Vendor/ModuleName/Controller/Checkout/ApplyPaymentMethod.php

<?php
/**
 * Copyright © 2016 MagestyApps. All rights reserved.
 *  * See COPYING.txt for license details.
 */

namespace MagestyApps\FixRules\Controller\Checkout;

use Magento\Checkout\Model\Cart;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\Controller\Result\ForwardFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\View\LayoutFactory;
use Magento\Quote\Model\Quote;

class ApplyPaymentMethod extends Action
{
    /**
     * @var ForwardFactory
     */
    protected $resultForwardFactory;

    /**
     * @var LayoutFactory
     */
    protected $layoutFactory;

    /**
     * @var Cart
     */
    protected $cart;

    /**
     * @param Context $context
     * @param LayoutFactory $layoutFactory
     * @param ForwardFactory $resultForwardFactory
     */
    public function __construct(
        Context $context,
        ForwardFactory $resultForwardFactory,
        LayoutFactory $layoutFactory,
        Cart $cart
    ) {
        $this->resultForwardFactory = $resultForwardFactory;
        $this->layoutFactory = $layoutFactory;
        $this->cart = $cart;

        parent::__construct($context);
    }

    /**
     * @return ResponseInterface|ResultInterface|void
     * @throws \Exception
     */
    public function execute()
    {
        $pMethod = $this->getRequest()->getParam('payment_method');

        /** @var Quote $quote */
        $quote = $this->cart->getQuote();

        $quote->getPayment()->setMethod($pMethod['method']);

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

        $quote->save();
    }
}

  app/code/Vendor/ModuleName/Plugin/AddPaymentMethodOptionBack.php

<?php

namespace MagestyApps\FixRules\Plugin;

use Magento\SalesRule\Model\Rule\Condition\Address;

class AddPaymentMethodOptionBack
{
    /**
     * @param Address $subject
     * @param $result
     * @return Address
     */
    public function afterLoadAttributeOptions(Address $subject, $result)
    {
        $attributeOption = $subject->getAttributeOption();
        $attributeOption['payment_method'] = __('Payment Method');

        $subject->setAttributeOption($attributeOption);

        return $subject;
    }
}

  app/code/Vendor/ModuleName/view/frontend/web/js/action/select-payment-method.js

/*
 * Copyright © 2016 MagestyApps. All rights reserved.
 *  * See COPYING.txt for license details.
 */

define(
    [
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/full-screen-loader',
        'jquery',
        'Magento_Checkout/js/action/get-totals',
        'mage/url'
    ],
    function (quote, fullScreenLoader, jQuery, getTotalsAction, url) {
        'use strict';
        return function (paymentMethod) {
            quote.paymentMethod(paymentMethod);

            fullScreenLoader.startLoader();
            var linkUrl = url.build('magestyapps_fixrules/checkout/applyPaymentMethod');
            console.log(linkUrl);
            jQuery.ajax(linkUrl, {
                data: {payment_method: paymentMethod},
                complete: function () {
                    getTotalsAction([]);
                    fullScreenLoader.stopLoader();
                }
            });

        }
    }
);

Can anyone help to see why the payment method can't be saved in cart price rule at the back-end (Magento 2.3.2)?

Thanks in advance


texts: Should addon of any extension use  tag in addon registration file(package1_module2.xml)?

texts:
One package1_Module1 extension is created and I want to make its addon of package1_Module1.

<depends>
   <Package1_Module1/>
</depends>

this above code need in `app/etc/modules/Package1_Module2.xml` for `package1_Module1` extension addon ?


texts: CE 1.9.2 - Send Queued Transactional Custom Email

texts:
I have a custom module working as I want it to that sends external stakeholders emails depending on the items in the order. I am observing the sales_order_save_after event and checking if the order status is set to Processing.

All works good using

$emailTemplate->send($emailSendAddress, $emailSendName, $emailTemplateVariables);

Now, the 2 payment method modules we are using automatically set the order status to *Processing" upon validation of payment, and the emails are sent immediately, and I do notice some slight latency while getting to the Checkout Success page (could be my imagination as well!).

Long story short ... How do I add my emails to the new email queue feature that was introduced with CE 1.9.1? Should I create a cron script for my module?


texts: Magento Frontend and admin panel logging out often

texts:
My magento frontend and admin panel both are logging out often.
they are not withstanding for even 10 seconds.
Can u help to resolve this?


texts:
I am creating a new module to shipping methods in Magento 2.

I create a model where appends the methods but I need run a web service soap client. I add the row: $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl'); but when run the code show an error but not have message:

If I not put the line it works correctly. I know this is the error.

Error in console:

The error I think is because the line $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl'); not work and the code not continue and not append methods. If I commment this line not show errors the console

Use this:

try {
     $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl');
} catch (Exception $e) {
     $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/module1.log');
     $logger = new \Zend\Log\Logger();
     $logger->addWriter($writer);
     $logger->info($e->getMessage());
}

In file module1.log not show anything.


texts: After implement Security Patch SUPEE 8788v2 , site is giving 404 ERROR

texts:
I am working on  Magento 1.9.2.1. I have uploaded the Patch files of SUPEE 8788 on the root of the website. I have also deleted the below listed files:

/skin/adminhtml/default/default/media/flex.swf
/skin/adminhtml/default/default/media/uploader.swf
/skin/adminhtml/default/default/media/uploaderSingle.swf

also checked for the following files that have been modified:

/js/mage/adminhtml/uploader/instance.js  contain "fustyFlowFactory"
/skin/adminhtml/default/default/boxes.css  contain "background:url(images/blank.gif) repeat;"

But still this patch failed in Magento Security scan.

After that i implemented 8788v2 and my site starts giving 404 ERROR.
I used the below link to revert 8788 and implement 8788v2.

https://devdocs.magento.com/guides/m1x/other/ht_install-patches.html

Please guide me to implement the patch.


texts:
I make a user role that needs to create a configurable product, to do this I need to give him the ACL for Store/Attribute/product.

But I don't want to let him create / add / delete an attribute, so I remove the create new attribute button in the configuration panel.

There is still one problem, the user can go to Store > Attribute > Product menu.

How can I make it invisible for my user role?


texts: Magento 2 how to sort categories based on a custom attribute in rest API

texts: I am using V1/categories and V1/categories/list API calls for retrieving categories. I have created a custom attribute "featured_sort_order". Now I want to sort the categories based on the ascending values of "featured_sort_order". How can I do it?


texts: How to remove payment information rows in sales information tab?

texts:
I'd like to ask about payment method in Magento 2.
How to remove the credit card number, and cc_save row from the table?
Admin -> Sales -> View Order -> Information Tab -> Payment Method Header


texts: How to change product price depending on an option

texts: I'd like to know if it is possible to create an option who set the price in Magento ? For example, if my option set to 2, then my price will be price+$2, option == 1156 then price == price+1156, so on ..


texts: Magento Analytics - Detect CategoryId & ProductId?

texts:
I have a custom tracking script which is recording things like Product and Category Page views. Because the script loads on every page, not all pages are category pages and would have a $categoryid OR a Product_View with a $productid.

What would be the best way to detect if $categoryid OR $productid exist in order to pass those values to the tracking script?


texts:
Which Mode usually should be use for Magento 2 online store?

Default Mode or Production Mode ?


texts: Sorting associated products (configurable) in 1.9.2

texts:
I have Magento 1.9.2 and a configurable product with size options (S,M,L,XL) those options are associated simple products. At the moment Magento is sorting the options by ID. Is there anyway to sort by a specified order that I give?

Thank you very much


texts:
I can’t enter the admin panel

Going to Authorization -
I enter the data, everything is correct, and loading is in progress, nothing else happens, if you enter the wrong data, then everything correctly knocks the error

Debt long loading, nothing happens, I try to create a user through CLI, change the settings in the database

I checked everything as they write everywhere, it did not help me

Maybe someone had the same problem and who can help me

Thanks


texts:
In admin for grids there is filter named Period which has 3 possible values:; day, month and year. I would like to add an extra option called quarter which will give results for each 3 months.The function which needs to be edited is the following from my custom collection

    protected function _getPeriodFormat()
{
    $adapter = $this->getConnection();
    if ('month' == $this->_periodType) {
        $periodFormat = $adapter->getDateFormatSql('i.created_at', '%Y-%m');
    } else if ('year' == $this->_periodType) {
        $periodFormat = $adapter->getDateExtractSql('i.created_at', Varien_Db_Adapter_Interface::INTERVAL_YEAR);
    } else if ('quarter' == $this->_periodType) {
        $periodFormat = $adapter->getDateExtractSql('i.created_at', what should be here);
    } else {
        $periodFormat = $adapter->getDateFormatSql('i.created_at', '%Y-%m-%d');
    }

    return $periodFormat;
}


texts: How Configurable Product's option rendered in magento 2

texts:
Actually I am creation a custom product view page fore understanding the rendering of product view

I have created controller like this

namespace Tasks\BulkAdd\Controller\Index;
class Vivek extends Action{
    ...
    public function execute()
    {
        $sku = $this->getRequest()->getParam('sku');
        $product = $this->repository->get($sku);
        $this->registry->register('product', $product);
        $this->registry->register('current_product', $product);

        $result = $this->pageFactory->create();
        return $result;

    }
}

In my layout file "bulkadd_index_vivek.xml" I have copied all the content of "catalog_product_view.xml"

My link is show like "http://10.16.16.188/magento/wholesaler/bulkadd/index/vivek/sku/24-MB01-1"

For simple products, It is working fine and showing all customisation options of product. Take a look bellow

but for Configurable products, It is not making configuration. See the output

I found that two Blocks are taking product from registry with key "product" and "current_product". That's why I set them in my controller.

Please tell what else i need to set from my controller to get product Configurations?

Thank You


texts: Magento 2 - change database in etc/env.php

texts:
My environment:

Magento 2.0.7
Production mode
Cache enabled

I cloned current Database that my store has been normaly working with:

  original_db

and named it:

  original_db_dev

All DB details that changed are: database name, and user name. The rest (host, password) remained the same.

I change details in etc/env.php file by simply replacing appriopriate data. Then flush the cache. However, although the DB is cloned (= is exactly the same as the original one) the store it's not working. I'm getting error:

  There has been an error processing your request Exception printing is
  disabled by default for security reasons. Error log record number:
  455082819174

Questions

How can I found out more about the error? Nothing is generated in var/log
How can I fix the problem?

Thanks


texts: Magento 1.9.2 not sending new order confirmation emails

texts:
I'm new to Magento. I've upgraded recently Magento to 1.9.2 and it's not sending new order confirmation emails.

I checked email templates and they're in a place (I use default Magento templates from locale folder).

Exception log shows these errors:

2015-08-12T12:00:04+00:00 ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/user/webapps/app_name/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 /home/user/webapps/app_name/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/user/webapps/app_name/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/user/webapps/app_name/app/code/core/Mage/Core/Model/Email/Queue.php(239): Zend_Mail->send()
#3 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Aoe_Scheduler_Model_Schedule))
#4 /home/user/webapps/app_name/app/code/community/Aoe/Scheduler/Model/Observer.php(79): call_user_func_array(Array, Array)
#5 /home/user/webapps/app_name/app/code/core/Mage/Core/Model/App.php(1357): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#6 /home/user/webapps/app_name/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#7 /home/user/webapps/app_name/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#8 /home/user/webapps/app_name/cron.php(76): Mage::dispatchEvent('default')
#9 {main}

My cron settings:

Aoe scheduler shows that heartbeat is older than x minutes:

I'm on a shared server and I don't have access to mail logs, but my host provider checked it for me and they said there were no emails that match up time-wise for orders that were placed. They also checked if cron.sh and cron.php run properly.


texts: Magento 2 regsitered user add to cart API

texts:
In postman , I tried to add the product to the cart for registered user using this API :

  /rest/V1/carts/mine

but I am facing an error like

{
    "message": "Consumer is not authorized to access %resources",
    "parameters": {
        "resources": "self"
    }
}


texts:
How can i get this "cat" parameter from my cms page block

{{block class="Magento\Framework\View\Element\Template" template="Altravista_Carousel::product/carousel.phtml" cat="3"}}

in my Block Class?

  Altravista\Carousel\Block\Product.php;


texts:
It is possible, with a stock Magento, to have the system hide a price from users until the product's been added to a cart?

If this isn't possible with stock Magento, is there known science for accomplishing this? ("known science" meaning third party extensions, proven and tested customization routes, etc)

Bonus Question: Does this (increasingly common) tactic have a name in the ecommerce industry?  (Googling has proven difficult since I don't know what to call this)


texts: onepage checkout page only order total without order total incl tax

texts: In my web when I use theme luma, order total incl.Tax can been see in checkout.But if I change to my theme x, it only have order total without order total incl tax .So what should I do for my theme to display like luma with order total incl. Tax.


texts: Magento 2: Problem in installing installation?

texts: I'm installing Magento 2 using composer that I have downloaded from GitHub. While installing I'm asked with the username from repo.magento.


texts: Magento 2 Want to move the "This Is A Required Field" attribute message below the Color Swatch

texts: I have tried this fix but it did not work. I wondered if anyone else had any suggestions. I am in M2.1.2 using a custom theme based on the parent blank theme.


texts: Authorize.net:- An error occurred while trying to report this transaction to the merchant

texts:
I'm using Sandbox Authorize.net and everything working fine on one of my website which is in Magento2.2.4 and currently this site is running fine with the autorize.net.

While on other site I'm using same details and this site is on Magento2.3.1 but on this site i'm getting following problem on the checkout page:-

"An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card."

As i checked order get placed and order status is "pending" instead of "processing" and seems payment didn't process successfully.

When i checked Merchant Mail then getting following:-

Authorize.Net Developer Center Merchant,

Your script timed out while we were trying to post transaction results to it.
   Transaction ID: 60123298125
Transaction Result: This transaction has been approved.

The following message was displayed to the customer:

------------------------------An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service.

Here is my sandbox authorize.net settings:-

Note1:-  I think,we can run multiple websites by same SANDBOX authorize.net credentials so it won't be the problem.

Note2:-  Same settings and configuration is working fine on one of my M2.2.7 site.

Please help me as this is very urgent.


texts: Statick Block wysiwyg Image Uploader Button is not shown in Magento

texts:
This is the Image with Problem in which I did not see "image upload" and "Delete" button

Our Magento See this button like below image
The Magento Actual Output

So how can i display this button

Console Shows Error like

Uncaught TypeError: Cannot read property 'description' of undefined
    at Object.Flex.getFlashPlayerVersion (flex.js:164)
    at Object.Flex.checkFlashPlayerVersion (flex.js:46)
    at klass.detectFlashVersion (flex.js:425)
    at klass.initialize (flex.js:200)
    at new klass (prototype.js:101)
    at klass.initialize (flexuploader.js:63)
    at klass (prototype.js:101)
    at eval (eval at <anonymous> (prototype.js:612), <anonymous>:6:56)
    at prototype.js:612
    at prototype.js:865


texts:
I'm using mageplaza sharecart extention and I need to use its function in PWA.I have triggered the already implemented pdf downloading function in magento backend extention with a mutation.
my resolver
    public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
    {
        $mpCartToken = $args['mp_share_cart_token'];
        $this->printProcess->downloadPdf($mpCartToken);

    }

The follwing code is already implemented to download cart pdf in magento backend
public function downloadPdf($quote)
{
    $html = $this->readFile($this->getBaseTemplatePath() . 'template.html');
    $mpdf = new Mpdf(['tempDir' => BP . '/var/tmp']);

    $processor = $this->templateProcessor->setVariable(
        $this->addCustomTemplateVars($quote)
    );
    $processor->setTemplateHtml($html);
    $processor->setStore($quote->getStoreId());
    $html = $processor->processTemplate();
    $mpdf->WriteHTML($html);
    $mpdf->Output($this->getFileName(), 'D');
}

But the file is not downloading when I triggered the above code from PWA frontend.Please help I'm a beginner.


texts: Redirect url with key formula in Magento 2

texts:
I'm trying to do this in Magento 2:

I have my url : https://www.example.com/page/
I'd like to add after /page a key value. Example : /page/key1, /page/key2 ...
Then I get the key value with $this->getUrlParams() and depending of the key value I display something different.

Getting the key value works if I do a rewrite url through Magento 2 Admin but I want to do it programmatically.
Any advice ? If you need more explanation, don't hesitate to tell me.
Thank you!


texts: How to add hreflang tags (or other meta tags) to pages in magento?

texts:
Hi using info from this site and around the web I have started to add hreflang tags to my magento store.  They work and display as they should on the default (American)site, however on the alternate (Canadian)site it does not work, here is the code & how it displays.

<link rel="alternate" href="http://www.example.com<?php
$urlString = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($urlString);
$path = $url->getPath();echo $path
?>" hreflang="en-us" />
<link rel="alternate" href="http://www.example.com/ca<?php $urlString =
Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($urlString);
$path = $url->getPath();echo $path ?>" hreflang="en-ca" />

which on the main site properly displays as (on a product page for example)

<link rel="alternate" href="http://www.example.com/sample-product.html"
hreflang="en-us" />
<link rel="alternate" href="http://www.example.com/ca/sample-product.html" hreflang="en-ca" />

so far so good, however when you are on the Canadian ca site, it now displays as

<link rel="alternate" href="http://www.example.com/ca/sample-product.html" hreflang="en-us" />
<link rel="alternate" href="http://www.example.com/ca/ca/sample-product.html" hreflang="en-ca" />

as you can see there is an extra (/ca/) on each url.  I'm not quite sure how to tackle this problem, I guess what I need is the code to output everything after the base url as opposed to the domain of each site.  Any help that you could provide will be greatly appreciated! Thank you.


texts:
Good morning all - this is probably a stupid question but I am a newbie.

We sell "packs" made up of predetermined quantities of simple products.

So for example:

1 x BESTVALUEPACK might contain
5 x SKU123
5 x SKU321
5 x SKU999

There are no options - if you buy 1 x BESTVALUEPACK you get the 15 items listed at a price that may bear no relation to the price of the component items (it is probably cheaper).

How do I set this up?

Magento Community Edition 1.9


texts: Creating Attribute set is taking time because of "initFromSkeleton"

texts:
I have written a script to create attribute set and attribute from csv and it worked fine on my localhost but after uploading it to server I found that it is taking so much time to do the job even with 1 entry. So I was debugging it and I found out that "initFromSkeleton" is taking time.

$entityTypeId = Mage::getModel('eav/entity')
                ->setType('catalog_product')
                ->getTypeId(); // 4 - Default

$newSet = Mage::getModel('eav/entity_attribute_set');
$newSet->setEntityTypeId($entityTypeId);
$newSet->setAttributeSetName($setName);
$newSet->save();

$newSet->initFromSkeleton($entityTypeId);
$newSet->save();

I don't know what to do because to build new attribute based on default attribute set I have to write this initFromSkeleton. While searching google I found this link. But it understood from there.

Could any one has done this before. Please help me out. Thanks in advance


texts: How to apply shipping charge for particular product

texts:
I have used flat_rate shipping method which charges 20 Rs for cart total in magento shop.

I have created a shopping cart price rule, according to it if cart total is greater than and equal to 200 Rs then no shipping charge will be apply on cart total. It works correctly.

I have a product which has price approximate 2000 Rs (it means greater than 200), according to above rule no shipping charge will apply on cart total, but I want to apply shipping charge 10 Rs on this product.

How to do that?


texts: How can you calculate the prices with 2 decimals, not with 4 decimals?

texts:
How can you set in Magento2 that all the calculations you make on orders, invoices, price rules,…, to be done with 2 decimals not with 4 decimals?

Attention, I mean the calculation of prices and not the display of
prices.


texts: Different Order Success Mail for Selected Category

texts:
When a customer purchase a selected category products , then the order success mail should be different

I wants to customize the order status mail for selected category only, for other categories default mail should send.

Any ideas?


texts: How to override _UpdatePrice function in vendor\magento\module-swatches\view\frontend\web\js\swatch-renderer.js

texts:
in my app\code\X\Y\view\frontend\requirejs-config.js I have:

var config = {
    map: {
        '*': {
            'configurable':'X_Y/js/configurable',
            'swatchRenderer':'X_Y/js/swatchRenderer'

        }
    }
};

in my app\code\X\Y\view\frontend\web\js\swatch_renderer.js I have

define([
    'jquery',
    'underscore',
    'Magento_Swatches/js/swatchRenderer'
], function ($, _, swatchRenderer) {
    'use strict';
    _.extend(swatchRenderer.prototype, {

        _UpdatePrice: function () {
            var $widget = this,
                $product = $widget.element.parents($widget.options.selectorProduct),
                $productPrice = $product.find(this.options.selectorProductPrice),
                options = _.object(_.keys($widget.optionsMap), {}),
                result;

            $widget.element.find('.' + $widget.options.classes.attributeClass + '[option-selected]').each(function () {
                var attributeId = $(this).attr('attribute-id');

                options[attributeId] = $(this).attr('option-selected');
            });

            result = $widget.options.jsonConfig.optionPrices[_.findKey($widget.options.jsonConfig.index, options)];
            console.log("testing override");
            $productPrice.trigger(
                'updatePrice',
                {
                    'prices': $widget._getPrices(result, $productPrice.priceBox('option').prices)
                }
            );

        },
    });
});

any idea why it is not working?


texts: Get locale specific value of selected product option by attributeText

texts:
I have a product attribute for delivery time akeneo_delivery_time, that's filled from a PIM (akeneo) by import. This is of type "Dropdown" with scope of "Store View" (We have two storeViews, with locales of de_DE and fr_FR). The options contain translations of the delivery time text for every locale.

I wanted to keep the delivery_time attribute that comes with magento (mage_setup), which is of type "text", in order to not break compatibility which 3rd party extensions.

My idea was to write an indexer that transferes the attribute frontend-values of the "Dropdown" to the text attribute "delivery_time". There is no problem with that, it works fine.

But i cannot get the locale specific value. getAttributeText gives my the correct option for the storeViews, but not in the locale of that storeView. I get the option text in "de", never in "fr".

    $stores = Mage::app()->getStores();
    foreach ($stores as $store) {
        Mage::app()->setCurrentStore($store);
        $productCollection = Mage::getModel('catalog/product')->getCollection();

        $resource = Mage::getResourceSingleton('catalog/product');
        foreach ($productCollection as $product) {
            $akeneoDeliveryTime = $product->getAttributeText('akeneo_delivery_time');
            $product->setData('delivery_time', $akeneoDeliveryTime);
            $resource->saveAttribute($product, 'delivery_time');
        }
    }

What am i doing wrong here? Do I need to set locale somewhere?

I have seen in Mage_Catalog_Block_Product_View_Attributes, it works like this:

   public function getAdditionalData(array $excludeAttr = array())
{
    $data = array();
    $product = $this->getProduct();
    $attributes = $product->getAttributes();
    foreach ($attributes as $attribute) {
        if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
            $value = $attribute->getFrontend()->getValue($product);

But here "$product" contains translates option values from the start.


texts: Admin Page error "The page isn't redirecting properly" after changing base url in magento 2.1

texts: I have changed my base url in magento 2.1. After that frontend is working fine but admin page giving me "The page isn't redirecting properly. website redirected you too many times" error. Please help me on this.


texts: how to get all attributes of products in magento 2?

texts:
Is there any way to get all attributes of configurable products in the product listing page. Like as magento 1

<?php $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions(); ?>

So how to show all attributes ?


texts: Several conditions in the loop - magento

texts:
I need to show the H1 tag - if the values are present. But if the values are not present - do not display H1. H1 should be shown only once. I know that this code runs in a loop.

    <?php $attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes(); ?>
    <?php $filterBlockName = 'amshopby/catalog_layer_filter_attribute'; ?>
    <?php foreach ($attributes as $attribute): ?>
    <?php if ($attribute->getAttributeCode() == 'my_attribute'): ?>
    <?php $result = Mage::app()->getLayout()->createBlock($filterBlockName)->setAttributeModel($attribute)->init(); ?>

Artist list

    <?php foreach($result->getItems() as $option): ?>
    <?php if (($option->getValue() == '24') || ($option->getValue() == '31')): ?>
        <?php echo '
getUrl() . '">'.$option->getLabel().'
    <?php endif; ?>
    <?php endforeach; ?>

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

It should look:

Artist list

Barry White
Alice cooper

But if values are not present - does not display anything.

Please help!


texts: How to get Order ID on product view.html

texts:
I'm trying to get all Order ID's for each Product ID.
So far I'm getting the Product Id with the following code:

Mage::getModel('sales/order_item')->getCollection()->addFieldToFilter('product_id', $product->getId());


texts: frontend button only accessible to admin

texts:
{
        $dateTime = $this->_objectManager->create('Magento\Framework\Stdlib\DateTime\DateTime');
        $adminConfig = $this->_objectManager->create('Magento\Security\Model\Config');
        $lifetime = $adminConfig->getAdminSessionLifetime();
        $currentTime = $dateTime->gmtTimestamp();
        $adminSession = $this->_objectManager->create('Magento\Security\Model\AdminSessionsManager');
        $lastUpdatedTime = $dateTime->gmtTimestamp($adminSession->getCurrentSession()->getUpdatedAt());
        if (!is_numeric($lastUpdatedTime)) {
            $lastUpdatedTime = strtotime($lastUpdatedTime);
        }
        if ($lastUpdatedTime >= ($currentTime - $lifetime) &&
            $adminSession->getCurrentSession()->getStatus() == 1
        ) {
            return true;
        } else {
            return false;
        }
    }```


texts: How to display individual rating summary?

texts:
I am using Review module to allow customers to set rating to product.
I have three different ratings.
Then i call ->getRatingSummary() from
code\core\Mage\Review\Model\Review\Summary.php
to get summary rating from all votes.

What should i do to get summary rating for each my rating? (I have three records in "select * from  rating")

I suppose the data for this is stored in

select * from  rating_option_vote_aggregated

in the column [percent].

What method should i call to get summary rating for my each rating?
Thank you.


texts:
We have problems with page 404 page and our URLs have two formats without knowing why.
See the example below.
www.mywebsite.com/catalog/category/view/s/herboristerie/id/419/ (Okay)
www.mywebsite.com/herboristerie.html (404 Not found)


texts: Hide fields under Account Information on admin page

texts: I'm trying to hide the field "Last Name" from the admin page, but I'm not sure what I need to change since the HTML gets populated from a JS code. I'm trying to do the exact same thing mentioned at Remove field in Customer Account Information but on Magento 2. Is this possible?


texts: Base image is not set when import csv using custom script magento?

texts:
I am using custom script to import products in magento. product thumbnail or small image set using the code but the base image not set.
I am using the below code :

            $mediaArray = array(
                'image'       => $data['image'],
                'thumbnail'   => $data['image'],
                'small_image' => $data['image']
            );

            // Remove unset images, add image to gallery if exists
            $importDir = Mage::getBaseDir('media') . DS . 'import/product/';
            //echo $importDir;exit;
            foreach ( $mediaArray as $imageType => $fileName ) {
                $filePath = $importDir . $fileName;
                if ( file_exists($filePath) ) {
                    try {
                        $product->addImageToMediaGallery($filePath, $imageType, false);
                    } catch (Exception $e) {
                        echo $e->getMessage();
                    }
                } else {
                    echo "Product does not have an image or the path is incorrect. Path was: {$filePath}<br/>";
                }
            }

What is the missing in the code. Can anyone suggest the solution ?


texts:
We use Aitoc Reviews Booster for generating review reminder mails. Whenever a client receives a mail it has a link to the product page in it. The client needs to login to write a review, as we have disabled anonymous reviews.

Is it possible to create/use a link in the mail that makes the client login automatically? (I'm not experienced in creating magento plugins.) If another review plugin can do this, I'm prepared to take a serious look and possibly replace Reviews Booster.


texts: I am developing magento application using the enterprise edition. Everything was working fine until I gave an option 'Use Flat Catalog Category': 'Yes'. Now the top navigation displays only one category without any child categories in it. I this setting is changed to 'No', it works fine. Any one knows what is causing this problem or how to solve this. The categories are created under 'Default Category'. It seems the project is working great in my localhost but in server only on category is shown and its child categories are not shown. Any one please help. will be greatfull.


texts: In my Magento 2 setup, I have products called something like 'Xxxx 1 DS'. When I search for 'xxxx', the product pops up. But when I search for '1 ds', there are no search results. Is this because the search starts with a number? I have set the minimun search characters to 1..


texts:
I Have Cms Page I want to add contact us block withing it so I do as follows

<!– CONTACT FORM CODE BEGIN–>
{{block type="core/template" name="contactForm" form_action="/~argentaustcom/contacts/index/post" template="contacts/form.phtml"}}
<!– CONTACT FORM CODE END–>

but url not correct  so I Do As follows

<!– CONTACT FORM CODE BEGIN–>
{{block type="core/template" name="contactForm" form_action={{store_url=""}}/contacts/index/post" template="contacts/form.phtml"}}
<!– CONTACT FORM CODE END–>

but I echo block code instead of  echoing form
this echo

{{block type="core/template" name="contactForm" form_action={{store_url=""}}/contacts/index/post" template="contacts/form.phtml"}}

not form    I am trying to change "" to '' but not work


texts:
In Magento 2 I have a custom theme and in the layout folder layout>default_head_blocks.xml which contains the css link.

The css file is contained in web>css>customcss.css - but the file is not linking


texts: How to solve base currency with the selling currency

texts:
If the Euro base currency is configured, and frontend to sell in dolar.

The finalization of the cart shows in dollars, but sends the value in euro for means of payments, and there are few means of payment that interprets that the value is in another currency

I wanted to know how to solve this, I did a lot of research, and how even started to work on the core of the magento to send the currency of the frontend and not the base, I did not find anything

Would have a module or some configuration in the source code to build this?

Base currency of the EURO magento, and Dollar frontend, and finalize the order in the same payment in Dollar, the products are bought in euro and suffer the daily change, so i am need a solution, than to change base currency to dollar


texts:
I need help with my Magento 2.2.0 theme, I setup a new theme based on blank theme. Then I try to install IWD one page checkout extension and it seems that this extension is not work anymore there, I mean there is not any style.

Someone can help me with a idea or something?

Thank you very much

Like this is my onecheckout page


texts: Some new products are omitted from the SOLR index

texts:
I have a serious problem with Magento 1.14 using SOLR. From this week, for no apparent reason, all new products that are created or updated, they are visible without problem in frontend in its categories. However, when you search the same products in searcher, the site returns that no result was found.

I run reindex of catalogsearch_fulltext several times, but the result was the same, no change. I tried going to the SOLR admin and making the query in solr directly, but the result was the same; the products were not found.

One thing I noticed is that, though I reindex or new products are added, if I run the query:

  *:*

This always return to me the numFound as 6300. Likewise, if I go to stats.jsp in solr admin, I see that numDocs and maxdoc have the same value, 6300:

  numDocs : 6300 maxDoc : 6300

But thery do not change, they remain constant. I do not know if it has anything to do with this problem.

What can be the source of this?


texts: Getting 400 Error when Product Search Magento 2.3.5

texts:
When I tried to search a product in Admin Product Grid iam getting the Error, The corresponding error comes when particular search keyword enters.

Something went wrong with processing the default view and we have
restored the filter to its original state.

When dig the issue found a error for the action in network call,

The Response from the call
error: "The product that was requested doesn&#039;t exist. Verify the product and try again."
errorcode: "0"

If there is no product then it leads to show no product only, why it is showing the Error?
Thank You


texts: function isAvailable (always?) returning true for configurable products

texts:
I have set Allow Alert When Product Comes Back in Stock = Yes.

The link to 'suscribe to stock alerts' is being shown in simple products which have no stock. Nice.

The link to suscribe to stock alerts is never shown in configurable products.

Just for testing purposes I have removed $this->_product->isAvailable() check in function prepareStockAlertData() in ProductAlert/Block/Product/View.php,

From:

public function prepareStockAlertData()
    {
        if (!$this->_getHelper()->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable()) {
            $this->setTemplate('');
            return;
        }
        $this->setSignupUrl($this->_getHelper()->getSaveUrl('stock'));
    }

To:

public function prepareStockAlertData()
    {
        if (!$this->_getHelper()->isStockAlertAllowed() || !$this->_product) {
            $this->setTemplate('');
            return;
        }
        $this->setSignupUrl($this->_getHelper()->getSaveUrl('stock'));
    }

Then the link to suscribe to stock alerts is shown in configurable products.

Why is isAvailable() returning true if all of the simple products associated to the configurable product have no stock?

I have also tried to change the configurable product Stock options, Manage Inventory (yes/no) and availability (yes/no). Nothing seems to change.

Any ideas?

(I am using Magento 1.9)