texts: What is step by step process for add products to magento guest cart using Rest apis?

texts:
I am trying like this,

Step 1:
Post(empty) baseurl/rest/V1/guest-carts

get: guest customerid =02ccea0d67a4be667fa6ebf7905tia21

Step 2: I want add items to cart,so am using this api, POST /V1/guest-carts/{cartId}/items

Post: {
"cartItem": {
"itemId": 2,
"sku": "RJ0111",
"qty": 1,
"name": "Normal Kit",
"quoteId": "02ccea0d67a4be667fa6ebf7905tia21",

}

baseurl/rest/V1/guest-carts/02ccea0d67a4be667fa6ebf7905tia21/items

it gives response as 400 Bad Request,how can i get this and please tell me process step by step.

and what is "quoteId" here,


texts: How to regenerate products URLs with diacritics properly

texts:
I need regenerate urls for all products (about 3000). Befere my regeneration urls are like https://my-shop.example.com/product/view/id/xxx/s/name-of-product. I need my products urls will be like https://my-shop.example.com/name-of-product.html.

I'm trying use magento method \Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator->generate($product). It works but my diacritics (like ąęłóźż) are trimmed (e.g. product link become https://my-shop.example.com/jaki-tam-adny-produkt.html instead of https://my-shop.example.com/jakis-tam-ladny-produkt.html)

I tried use also $product->setUrlKey($generated_by_me_url_key_with_diacrtitics_replaced_by_english_characters) and $product->save(). Backend shows my changed url keys but I didn't seen changes on frontend. I tried use steps from https://github.com/magento/magento2/issues/5929#issuecomment-238170690 but it only restore ugly urls like was on start ( e.g. https://my-shop.example.com/product/view/id/xxx/s/name-of-product)

I'm using Magento 2.2.4


texts: Categories don't work after migration, shows "Class do not exits"'

texts:
I am running Magneto 2.3.4 version I migrate the database successfully, but my false I don't check categories after migration and I start working.
So now I have an error that I can't resolve "Exception #0 (ReflectionException): Class does not exist ". The problem is that the Class is empty.

I am sending you a screenshot from error.

Any suggestion?

Thank you.


texts: Magento 2 - Inject arguments into constructors of fabricated objects

texts:
When we are using a SDK third party library of any service we can not change it and when this service requires a parameter as argument. Example:

/**
 * @param string $apiKey
 * @param int|null $timeout
 */
public function __construct($apiKey, $timeout = null)
{
    $this->client = new Client(
        new GuzzleClient(
            [
                'base_url' => 'https://api.urlapi/'
            ]
        ),
        $apiKey,
        $timeout
    );
}

In a custom module, we need to take this apiKey from a configuration and pass it as an argument in the creation of this object.

I would not like to instantiate with "new" of course, because of the high coupling.

My solution so far was to fabricate this object via Magento:

<?php
namespace MyVendor\MyModule\Model;

use ServiceVendor\Sdk\ClassNameFactory; // Create automatically

class MyModelExample
{
     protected $classNameFactory;

     public function __construct(
        ClassNameFactory $classNameFactory
     ){
         $apiKey = ''; // Get my apiKey from any other method.
         $this->classNameFactory = $classNameFactory->create([
             'apiKey' => $apiKey
         ]);
     }
}

This works fine in developer mode when we do not run the command:

bin/magento setup:di:compile

Because the create method of the \Magento\Framework\ObjectManager\Factory\Dynamic\Developer class is executed and the _resolveArguments method resolves this argument injection.

But if we run the command:

bin/magento setup:di:compile

This stops working because it is executed by the create method of the class: \Magento\Framework\ObjectManager\Factory\Compiled

And instead of injecting the apiKey argument an ObjectManager instance is injected. I think there is something missing for the di.xml file to work correctly.

It only works for both cases, if I pass with the key "0" of the array as well:

$this->classNameFactory = $classNameFactory->create([
     0 => $apiKey,
     'apiKey' => $apiKey
]);

I understand that even if it's working that way, it's not the best way to do it, and to ensure it's easy to create tests.

What do you suggest for the best way to work with this?

Thanks


texts: Magento Event Observers: Singleton versus Model

texts:
So Magento offers 2 ways of declaring an observer. Singleton and Model (new instance) by specifying the <type> tag in Magento 1.x and by specifying the shared attribute in Magento 2.

Magento 1 way of doing it.

<events>
    <event_name>
        <observers>
            <unique_observer_name>
                <type>model|object|singleton|null</type>
                <class>class/alias_here</class>
                <method>methdNameHere</method>
            </unique_observer_name>
        </observers>
    </event_name>
</events>

Magento 2 version:

<event name="event_name">
    <observer name="unique_observer_name" instance="Class\Name\Here" method="methodNameHere" shared="true|false" />
</event>

So in the case of Magento 1, if the <type> tag is model or object, the class will be instantiated with Mage::getModel(). If it's singleton or it's missing it is instantiated using Mage::getSingleton().

In the case of Magento 2, if shared is false then the class is instantiated using $this->_observerFactory->create()  (new instance).
if shared is true it is instantiated using $this->_observerFactory->get() (singleton).

Between the two versions the event observer idea is very similar, but most of the observers in Magento 1 are used as singletons, because the type tag is missing and in Magento 2 most (I think all) of the observers have shared="false".

I'm puzzled. When should I use singletons and when should I use new instances for observers?
Magento version (1 or 2) is not important here.
A simple use case would do for each approach (new instance or singleton)


texts:
I run

bin/magento setup:static-content:deploy en_GB

and it deletes my magento install!!

it deletes

index.php
app/
lib/
js/
dev/
feeds/
skin/

What the hell is wrong with it?


texts: How to display one of the simple product price in configurable product price?


texts: Specific Custom Design Layout for Product Attribute Set

texts:
My store has 2 different types of Attribute Sets for my Simple Products:

Default
Custom

For all my products that have the attribute set name of Custom I need to remove the following sections from the page layout:

<reference name="root">
    <remove name="header" />
    <remove name="breadcrumbs" />
    <remove name="footer" />
</reference>

Is there a way i can easily assign all products in this attribute set to always remove these 3 sections.

I know I can place the above in the Custom Design Layout section but I currently have over 100,000 products with the attribute set of Custom so going through one by one is not an option.


texts: Is Possible Magento Allows Change Shipping Cost calculate by Individual Product Weight instead of Package Weight?

texts:
When I try to calculate shipping price, it calculated by overall package weight, I need shipping cost calculated by individual products weight,I need like if two products in the cart the shipping price should be calculated by individually now the shipping price calculated by overall package weight.

explanation:
Product Details:

Product A: weight 100kg - shipping cost 100
Products B: weight 10kg - shipping cost 10

Shipping Cost Details:

100kg : 100
10kg : 10
110kg : 90

*Here my cart weight 110kg, the cost obviously 90. I need the shipping price calculated by individual product weight, what I expected is the shipping cost 10 + 100 = 110.

Is possible?

Note : Using Matrix Rate


texts: Magento 2 Product Collection sort order by custom attribute

texts:
I have a problem to list products collection by a custom attribute.

I created a product custom attribute of decimal type.
I made this attribute usable for sorting products  ("used_for_sort_by").

At first sight the result is good: the new filter choice appears. But there is an issue: the values 'null' and '0.0000' are bigger than positive values.

So: when listing in ASC order: the products with the null or 0 value in this attribute are listed in last and when listing in DESC order they are listed in first, the opposite that it should be.

Any hint?

EDIT: this is how I created my product custom attribute, in UpgradeData.php

 if (version_compare($context->getVersion(), '1.5.0') < 0) {
        try {
            // Attribute to count sales qty
            $eavSetup = $this->eavSetupFactory->create(['setup' => $this->setup]);

            $eavSetup->addAttribute(
                Product::ENTITY,
                ExtendedProduct::SALES_COUNTER,
                [
                    'type' => 'decimal',
                    'label' => 'Quantity sold',
                    'input' => 'text',
                    'global' => ScopedAttributeInterface::SCOPE_WEBSITE,
                    'visible' => false,
                    'required' => true,
                    'user_defined' => false,
                    'default' => 0,
                    'searchable' => false,
                    'filterable' => false,
                    'comparable' => false,
                    'visible_on_front' => false,
                    'used_in_product_listing' => true,
                    'used_for_sort_by' => true,
                    'unique' => false,
                    'apply_to' => '',
                    'group' => 'General',
                    'system' => true
                ]
            );


texts:
I have noted that in default Magento .htaccess the /errors/ folder is accessible and open it in a browser list the content of the folder.

How to address it ?
Add Options -Indexes to the main .htaccess is safe ?


texts: Can There Be Two Installations of Magento 2.0.7 With Only One MagentoUser

texts:
Pretty much is what the question says. I would like to have a development environment for development of my own "make an offer box" module, and since I have 0 clue on how to do that, I want to install some sample modules for reverse engineering.  I know its backwards, buts its how I've learned computers since i was 12.  Rip it apart, and learn backwards.

I digress, regardless of my reasons, I need to know if I can have just one magento_user for the cron tasks, and the file system permissions, or if I need two different users for the different home directories/ installations.


texts: I am not getting all the products after executing my query

texts:
After executing my query i got several products (SKUs) but it is not
  displaying all the products that are stored in the database.

Take a look at this picture:

How do i know that? Well, I put a random SKU in the MAGENTO application, then i clicked on "search" and the product appeared.

I tried to find that SKU in MYSQL but it was not there:

Take a look:

This is my query:

SELECT main.entity_id,main.sku,code_brand.value AS code_brand

FROM catalog_product_entity AS main

LEFT JOIN catalog_product_entity_int AS code_brand
ON main.entity_id = code_brand.entity_id

WHERE code_brand.attribute_id = (
    SELECT attribute_id
    FROM eav_attribute
    WHERE attribute_code LIKE 'code_brand'
    AND `entity_type_id` = (
        SELECT entity_type_id
        FROM eav_entity_type
        WHERE entity_type_code = 'catalog_product'
    )
)

What is happening here? Am i missing anything?

This is the MAGENTO database diagram:

EDIT:

  How can i get all products with status = disabled or enabled?

I've been searching and i found this:

SELECT entity_id FROM `catalog_product_entity_int`
WHERE attribute_id = (
    SELECT attribute_id FROM `eav_attribute`
    WHERE `attribute_code` LIKE 'status'
) AND `catalog_product_entity_int`.value = 2

How can i modify my code in order to obtain that?


texts:
I'm trying source code from used in order items and it will be helpful if I can get the reserved inventory source before creating the shipment.
I managed to get the shipment collection of the order, but I can't get the inventory details of it.
shipmentSources = array();
$shipmentsCollection = $order->getShipmentsCollection();
foreach ($shipmentsCollection as $shipment) {
    $shipmentItems = $shipment->getAllItems();
    foreach ($shipmentItems as $shipmentItem) {
        $shipmentSources[$shipmentItem->getOrderItemId()] = $shipmentItem->getData();
    }
}

So the questions are:

How to get the reservation inventory source code before creating the shipment?
How to get the inventory source code after creating the shipment?


texts: Stock notification e-mails for configurable products

texts:
I recently ran into a problem with a store, when I started noticing certain stock notification e-mails weren't being sent. All of the e-mails for simple products are fine, but when it comes to configurable products, here's my problem:

Right now, customers are able to sign up for the stock notification e-mails. The cron job runs fine, and system logically only sends them when they're actually in stock and not set to 0. The configurable products are however, always set to 0, and the simple products that belong to this configurable do the stock changing. So what happens now is, people are only able to subscribe to a product when ALL of the sizes are out of stock (so not even able to select a size they wish to receive information about), but then when the shoes for example get restocked, they don't receive a notification because the configurable (which is the product they subscribed to) is still at 0.

I'm sure I'm not the first person to run into this problem, so I was wondering if anyone has been able to work around it or find a solution?


texts: Magento Rating and Review - Not Showing Admin Panel

texts:
I need help to show Review and Rating in backend admin navigation panel under catalog similar to link below: http://www.hostknox.com/images/tutorials/magento/ratings-and-reviews/4-zoom.jpg

I have already checked below steps:

System > Configuration > Advanced > Advanced - Mage_Review - Enabled - Mage_Rating - Enabled

No changes have been made to app/etc/modules/Mage_Review.xml

Is there anything else I can do so I can enable the above mentioned ratings?


texts: How to get datas from this table 'directory_currency_rate'

texts:
Table contains these columns.

I need to get data from this table 'directory_currency_rate'

which is come under this directory

/vendor/magento/module-directory/Model/Currency.php
/vendor/magento/module-directory/Model//ResourceModel/Currency.php

This model file does not have any collection.php file so can't able to get datas from this table.

Anyone know how to get data from this table ?

Thanks in advance


texts: Magento 2.1.X USPS API First Class No Longer Working

texts:
Someone already asked this questions about Magento 1.9.3.4, and can be found at the following link Magento 1.9.3.4 USPS API First Class No Longer Working

I tried following the steps found on that question and the steps linked to from that post at the blog.shipperhq.com site and couldn't get the first class option working again.

The steps found at the blog.shipperhq.com mentioned for Magento 2.0.X you should edit the following file, vendor/magento/module-usps/Model/Usps.php but I'm running Magento 2.1.5 and don't have that file.

Does anyone have the proper steps for a workaround that work with Magento 2.1.X? For more context about the issue, please click the link at the top of my question.


texts: "before" and "after" attributes in layout files do not work when blocks are referenced

texts:
Using Magento 2.1.7 on Ubuntu 16.04.

I have a layout file in my custom theme (<my_theme_dir>/Magento_Theme/layout/default.xml) that removes a couple of footer links, adds a couple others, and specifies an the order for all of them.  However, this order is ignored for the blocks that are only referenced in the file, rather than being fully present.  Example:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="footer_links">
            <referenceBlock name="privacy-policy-link" remove="true" />
            <referenceBlock name="search-term-popular-link" remove="true" />

            <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link-name" before="-">
                <arguments>
                    <argument name="label" xsi:type="string">My Link</argument>
                    <argument name="path" xsi:type="string">my-link-path</argument>
                </arguments>
            </block>

            <referenceBlock name="catalog-search-advanced-link" before="sales-guest-form-link" after="" />
            <referenceBlock name="sales-guest-form-link" before="contact-us-link" after="" />
            <referenceBlock name="contact-us-link" after="-" />
        </referenceBlock>
    </body>
</page>

This results in the following order:

My link
Contact Us
Orders and Returns
Advanced Search

Which is not the order I specified.  However, if I change the "contact us" block so that it's defined fully within the current file:

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="contact/contact/enabled" name="contact-us-link">
    <arguments>
        <argument name="label" xsi:type="string" translate="true">Contact Us</argument>
        <argument name="path" xsi:type="string">contact</argument>
    </arguments>
</block>

it moves to the bottom as I would expect.

This leads me to believe that I simply can't use the before and after attributes to order blocks that are only referenced.  They have to be defined in full for that to work.

This seems less than ideal to me, since if one of those blocks is changed in a future update or something, my override won't know and will continue to display it as it used to be.  Is this not worth worrying about?  Or is there a way to specify order when some blocks are locally-defined and some are referenced?


texts: Check if product type is grouped, without loading whole product

texts:
I want to check whether a certain product is of type 'grouped' or something else. And, i need to do this without loading the whole product.

Now for other attributes the code below seems to work perfectly well.

$productResource = $this->objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Action');
$uom = $productResource->getAttributeRawValue($productId, 'uom', $storeId);

But somehow this fails:

$type = $productResource->getAttributeRawValue($productId, 'type_id', $storeId);

$type is always empty.


texts:
Does anybody has a proper solution for rewriting product's URL as per following format:

http://domain/{product_id}_{title}

Any hints?


texts: Change Product Quantity Without Edit on Magento

texts:
I have a question here, how to change product stock without click "Edit" on Magento ?

Thanks Before


texts: Mage_PageCache - External full page cache

texts:
So in Community Edition there is an option under System->Configuration->System->External Full Page Cache Settings that appears to be offering a full page cache using Zend Cache.

When you set these values you then get a new button on the cache page to clear this cache.

So my question is this, after just discovering this recently. What the heck? Does it work? Why have this in CE and then remove it in EE and have a completely different module? Does anyone actually use it?

Note: this module is not in the EE release


texts: Loading configurable product options with Ajax to prevent Varnish from caching them

texts:
we have a problem with Varnish caching the options (in our case available sizes that are in stock) on configurable product pages.
Since our shop has a lot of products with low stock levels that is a huge problem for us. On one hand we want the performance on the other we need to display accurate stock levels at all times.
So we thought the solution could be to load the options via Ajax but should do this.
Thanks for your help!


texts:
Looking into the telemetry of Magento and came across something a bit odd.
Fudged up URL Rewrite Management and cut my server load time in 1/2
https://eliteshoppercentral.com//about.htmlNotice how i added a "/" to redirect to cms page without "duplicating" entry. What would cause this to result in 1/2 of avg load time? Cache or No Cache, results are consistent.


texts: how to change admin panel settings programmatically

texts:
i am using Magento 2 , In my case i want to change programmatically the instance's logo and favicon , but i can't find the right file to change them ,

can anyone help me do that please


texts: varnish + magento 1.9 + login form in header

texts:
I've just enabled Varnish on a site using the Turpentine extension. Everything's fine except I have a login form in the header.

If I use this form on a unsecure page, then it redirects me to the normal login page.
If I use this form on a secure page, it works as expected and the customer is logged in.

Everything was working fine before I enabled Varnish.

The login form has the action "https://..../customer/account/loginPost/"

Any ideas what I can change to get this to work?


texts: Magento 1.9 standard RWD theme -- how do I display image labels on product view?

texts:
I'm sure the answer is something really obvious and staring me in the face but it's doing my head in.

Stock standard Magento, in product view, where it shows the alternative images I need it to print/show the label of the image.

Preferably directly beneath the alternative image as per my (crappy) mock up.

Apart from CSS changes it's just the standard RWD theme if that helps at all.

I've tried the advice here:
http://www.magentosolved.com/display-primary-image-label/

but it's not quite specific enough for me....


texts: Magento 2.2.2 Migrate site in another server. Points to look out

texts:
We are planning to transfer out test site to the production server.

What must we look out for? What changes ought to be made?


texts: Change color of a label in a Magento form

texts:
I have a simple question, I know how to change an the color of an field in a magento form but my problem is i didn't know how to change the color of the label associate to it.

here is an image :

and here is my code :

$fieldset->addField('modeleChoix', 'select', array(

        'label' => 'Modele selection(only update)',

        'name' => 'modeleChoix',

        'style' => 'color:red',

        'values' => $tableau2,

        'onchange' => 'majChampModele()',

    ));


texts: Magento 2 : How to remove _required class for region and region_id in shipping address?

texts:
I have updated Magento 2.3.3 after that I'm getting the error in region and region_id on the checkout page. So I need to remove the _required class in the checkout shipping form.

Please refer attached file for reference.


texts: Downloadable products csv - unable to set links_purchased_separately = 0

texts:
I have a csv for downloadable products. I need to set links can be purchased separately to 0/false.
In my csv file, field downloadable_links is set as url=https://www.feedbooks.com/book/81.epub,downloads=0,group_title=A Tale of Two Cities,title=A Tale of Two Cities,is_shareable=1,links_purchased_separately=0


texts: Submit checkout form with JS after processing payment on checkout page only

texts:
I've integrated some custom payment module. I am getting trouble with form submission with JS  after payment response.
I need to submit the checkout form on click of place order but with JS and that only after processing the payment.

How can I place an order with JS?


texts: how do you limit the number of failed payment attempts in 1 shopping cart session for magento enterpise 1.13. We are trying to minimize fraudulent carding attempts via declined payment authorizations.


texts: Easy MVC question about the Magento controllers/observers methods

texts:
I've created a Magento plugin with a simple admin html observer:

This file looks like this:

//File: /Model/Adminhtml/Observer.php

class Aaa_Bbb_Model_Adminhtml_Observer
{
        public function saveOrderData(Varien_Event_Observer $observer)
        {
        // example
        $this->saveCustomOrderData();
        }

        public function saveCustomOrderData() {
           // save data to a custom database table.
        }
}

Now I've to create an adminhtml controller in the file /controllers/CustomOrderData.php. In this file I have to call the method saveCustomOrderData() in my Observer.php.

How can I call this method? Or is there a better place to store data in a custom table, from 2 files (the observer and controller method)?


texts: Magento 2 : Assign product to multiple category using sql query programmatically

texts:
is their any way i can assign products to category using sql in program ?
as category are too large request gets heavy so not able to save the traditional  way.


texts: I'm trying to access my already existing website that was clone from our repository. Now upon access it keeps on redirecting me to the Setup page. I'm not sure what happen but I already some suggested that the local.xml is missing. Now I'm not sure how to generate it or where to get it.. Also I'm already using our DB so it's not a fresh DB copy. How can I solve this? It keeps on redirecting me to the setup page.


texts: Admin grid not shown in magento 2.3.5 version


texts:
I am looking into the possibility of choosing multiple filters within layered navigation and apply them at the same time via a form submit, rather than applying one filter at a time.

Anyone looked into this before? Is this even doable?

If anyone could shed any light on this would be much appreciated.

Magento version is community 1.9.2.1


texts:
I have created custom admin grid which contains column name sku.

How to make this sku field value into url.That url go for product edit page.

In layout file

 <column name="product_sku" class="Xxx\Stock\Ui\Component\Listing\Columns\Product">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Sku</item>
                </item>
            </argument>
        </column>

Product.php

 public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item[$fieldName])) {
                    $html = "context->getUrl('adminhtml/catalog_product/edit',['id'=>$item[$fieldName]]) . "'>";
                    $html .= __('Product Page');
                    $html .= "";
                    $item[$fieldName] = $html;
                }
            }
        }

        return $dataSource;
    }

Its not working....


texts: How to add New Column in Magento 2 beginning of the table using Magento 2 way?

texts: I have to add a New column in Beginning of Existing Table on  Magento 2 way.


texts: Magento 2 custom options title not working while csv import

texts:
I am trying to import product through CSV file in magento 2.getting some errors while importing.

custom options (custom_title with comma separated not working).

example: name=Custom Yoga Option,type=drop_down,required=0,price=10.0000,price_type=fixed,sku=yoga3sku,option_title=Platinum(aaa,bbb,cccc)

Can anybody help on this.


texts:
Getting

  ReflectionException]   Class PayPal\Api\PayoutSenderBatchHeader does not exist

error while running

php bin/magento setup:di:compile command


texts: ReflectionException Class Mirasvit\Core\Model\ModuleFactory does not exist, when running setup:di:compile or setup:upgrade

texts:
I received the following error when I run the command

php bin/magento setup:di:compile

Error
  [ReflectionException]
  Class Mirasvit\Core\Model\ModuleFactory does not exist

The extension provider suspect it is trying to access to the older version of the extension, because we can see the new files in the /vendor/ folder that is downloaded via composer.
I also disabled all the caching policies. However, the error still persist.


texts: Magento 2: Get value from Cron system.xml

texts:
I would like to take the value of the ahead schedule of this system.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>

        <group id="cron" translate="label comment" type="text" sortOrder="15" showInDefault="1" showInWebsite="0" showInStore="0">
            Cron (Scheduled Tasks)
            <comment>For correct URLs generated during cron runs please make sure that Web &gt; Secure and Unsecure Base URLs are explicitly set. All the times are in minutes.</comment>
            <group id="template" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                Cron configuration options for group:
                <field id="schedule_generate_every" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Generate Schedules Every
                </field>
                <field id="schedule_ahead_for" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Schedule Ahead for
                </field>
                <field id="schedule_lifetime" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Missed if Not Run Within
                </field>
                <field id="history_cleanup_every" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    History Cleanup Every
                </field>
                <field id="history_success_lifetime" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Success History Lifetime
                </field>
                <field id="history_failure_lifetime" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Failure History Lifetime
                </field>
                <field id="use_separate_process" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
                    Use Separate Process
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
        </group>

</system>

I tried this command in a controller

$scheduleAheadFor = $this->scopeConfig->getValue('system/cron/schedule_ahead_for', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

but it did not work. Someone who can help me?


texts: How to change product name in quote item dynamically

texts:
Is it possible to add several the same product times to the cart with a different name? I did with different price, but I have not managed to do it with a different name.

I used an observer "sales_quote_item_set_product" but sets the same name when there are several products in cart.

The product is added by programming with "checkout_cart_product_add_after" event, using:

$quote = Mage::getSingleton('checkout/session')->getQuote();
$quoteItem = $quoteItem = Mage::getModel('sales/quote_item');
$quoteItem->setProduct($product_model);
$quoteItem->setQuote($quote);
$quoteItem->setQty('1');
$quoteItem->setParentItem(NULL);
$quoteItem->setStoreId(Mage::app()->getStore()->getId());
$quoteItem->setName('Custom Name')//I need this, but does not work
$quoteItem->setOriginalCustomPrice(0);
$quote->addItem($quoteItem)->save();

If I print the value of $quoteItem with var_dump() I see if the name was changed, but in the cart appears with the original name.

Another option was to use $product_model->setName() before $quoteItem->setProduct($product_model) but in the cart appears also  with the original name.


texts: How to add custom fileds in Magento 2,checkout payment method

texts:
How to add two custom fields for all payment methods in my payment section of magento 2,Can any one help me on this?

$jsLayout['components']['checkout']['children']['steps']['children']['payment']['children']
        ['methods']['children']['paymentAdditional'] = [
            'component' => 'uiComponent',
            'displayArea' => 'paymentAdditional',
            'children' => [
                'delivery_date' => [
                    'component' => Vendor_Module/js/view/payment/method-renderer/taxInfo-comp',
                    'config' => [
                        'customScope' => 'methods',
                        'template' => 'ui/form/field',
                        'elementTmpl' => 'vendor_module/payment/taxinfo-form',
                        'options' => [],
                    ],
                    'dataScope' => 'methods.tax_code',
                    'label' => 'Tax Code',
                    'provider' => 'checkoutProvider',
                    'visible' => true,
                    'validation' => false, //['required-entry' => $this->_helper->getConfigIsFieldRequired()],
                    'sortOrder' => 200,
                ]
            ],
        ];


texts: how to correctly display the chart in adminhtml module

texts:
I am trying to display a graph of employee statistics in the module
My function in controller
public function GraphicInfoAction()
    {
        $username = $this->getRequest()->getParam('username');
        if (!empty($username)) {
            $this->loadLayout();
            $this->_title($this->__("Testing module statistic" . $username));
            $this->_addContent($this->getLayout()->createBlock("testing/adminhtml_testing_graphic"));

            $result = Mage::helper('testing/data')->getDataByLastDay($username);

            $this->renderLayout();
        } else {
            Mage::getSingleton('adminhtml/session')->addError('Please, select correctly user');
            return $this->_redirect('*/*/');
        }
    }

In block i created Graphic.php file
class DaniilKrok_Testing_Block_Adminhtml_Testing_Graphic extends Mage_Adminhtml_Block_Abstract
{
    public function _toHtml()
    {
        var_dump('here');
        exit;
        //include 'Graphic.phtml';
    }
}

I don't really like connecting here .phtml file
If i include .phtml file in result i have this

Tell me how this logic can be implemented correctly?


texts:
I have a CSV which I want to use for import. It has clomuns with compatibility information as follows:

|  |Compatible with Product X|Compatible with Product Y|Compatible with Product Z|
|1 |      Y                  |                         |       Y                 |
|2 |                         |       Y                 |       Y                 |
|3 |      Y                  |       Y                 |                         |
|4 |                         |                         |                         |

I want to use value replacer to map the colums to the my Magento attribute "compatibilty" which is a multiselect box.

The value of the "compatibilty" attribute should be as follows for a single value Product X And for multiple values it should be like this Product X;Product Y;Product Z

I first use the column mapper to map every different cloum to campatibility. Then I use value replacer on the compatibility column. I came up with the following code the make it possible to assign the right values to the right products:

{{ {item.'Product_X}=='Y'?'Product X;':NULL }}{{ {item.'Product_Y}=='Y'?'Product Y;':NULL }}{{ {item.'Product_Z}=='Y'?'Product Z;':NULL }}

Or better readable

{{ {item.'Product_X}=='Y'?'Product X;':NULL }}
{{ {item.'Product_Y}=='Y'?'Product Y;':NULL }}
{{ {item.'Product_Z}=='Y'?'Product Z;':NULL }}

Everything gets set correctly. But the problem is that Magmi sometimes adds an ampty value to the attribute and assigns it to a product. I obviously don't want that.


texts: Magento 2 : Add attribute options programmatically in custom attribute

texts:
I have created custom attribute which type is Select. That attribute is available inside custom eav entity type. I want to add attribute options inside that attribute. How to do that?

Any help would be appreciated.


texts: Youtube Video Embed Issue in Magento 2 2.4 ( Blog Post Section )

texts:
I Insert this code on the Magento panel blog post section.

The content is blocked, I don't understand what is the issue? any one guide me how to solve this with free resource? i fond some paid plugin but i need free solution. THanks!


texts: How to configure the indexer to run over the night?

texts: I would like to run my indexer to run over the night since I'm already using the reindex by schedule, how could I do that?


texts: How to get the zonos store Id and API key for magento2?

texts:
I registered in zonos app account and i got the custom hello script via email.I copied that script in head tag of my website and setup the zonos app extension in local also.Now In admin configuration of zonos it showing storeId and ApI key fields are needed.please anyone help me how to get the zonos storeId and API key ?

Thanks in advance


texts: How to create new reference section at top of the home page Magento 1.9

texts:
I want to create a new reference section at top of the home page using a module.

Tut on Inchoo the method mention here is working, but I want to do this by module so that when i install the module new reference will be created.

I want to show a mini slider (which contains some text) at top of the page (Every Page).

I created a slider in phtml file of my module.

Now i want to insert this phtml file at top of the page.

All these things will happen as one install the extension.

In config.xml

 <?xml version="1.0"?>
<config>
  <modules>
    <Maddyboy_Instagramapi>
      <version>0.1.3</version>
    </Maddyboy_Instagramapi>
  </modules>
  <frontend>
    <routers>
      <instagramapi>
        <use>standard</use>
          <args>
            <module>Maddyboy_Instagramapi</module>
            <frontName>instagramapi</frontName>
          </args>
      </instagramapi>
    </routers>
        <layout>
          <updates>
            <instagramapi>
              <file>instagramapi.xml</file>
            </instagramapi>
          </updates>
        </layout>
  </frontend>

In
/magento1/app/design/frontend/base/default/layout/instagramapi.xml

<?xml version="1.0"?>
<layout version="0.1.3">
<default>
     <reference name="header">
            <block type="instagramapi/apislider" name="instagramapi_apislider" template="instagramapi/apislider.phtml" />
        </reference>
</default>

In header.phtml

<?php echo "hello",$this->getChildHtml('instagramapi_apislider') ?>

Update
As suggested by @Yiorgos Moschovitis

<?xml version="1.0"?>
<layout version="0.1.3">
<default>
     <reference name="after_body_start">
            <block type="instagramapi/apislider" name="instagramapi_apislider" before="-" output="toHtml" template="instagramapi/apislider.phtml" />
     </reference>
</default>

Still not working.

Update 2

<default>
        <reference name="after_body_start">
      <block type="core/template" name="instagramapi_apislider" before="-" output="toHtml" template="instagramapi/apislider.phtml" />
        </reference>
    </default>

This code working.


texts: Magento 1.9 : Sending E-Mail after Customer was created via API

texts:
I created an API for a customer, who needs to create new user accounts.

The user accounts can be created, after the process finished, then I would like to send an E-Mail to the created user, with their login details.

Is there a way to achieve this?


texts:
I want to use an instance of a Model into a Block.

in Magento 1 they uses:

$exple = Mage::getModel('exple/standard');

How can I do this with Magento 2?


texts:
I'd like to programatically edit all user reviews, to strip them of HTML tags (brought over from a migration). It doesn't look like exporting/importing with a CSV is possible, so I'm hoping for a programatic solution.

Thanks.


texts:
Hi I Need to round off the final price.
If Grand total 255.25  = Final Price 255
If Grand total 255.53  = Final Price 256


texts: How to add product video at product-page?


texts: Varnish Cache Magento 2 SSL offloading - X-Forwarded-Proto: https vs SSL-OFFLOADED: https

texts:
Previously (older Magento 2.2~ versions), exporting default.vcl Varnish Magento 2 configuration:

Configuration -> Advanced -> System -> Full Page Cache -> Varnish Configuration : Export VCL for Varnish 4.0

This gave me a comment inside default.vcl created:
# The minimal Varnish version is 4.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'

Now, with Magento v2.3.5 VCL files for 4,5,6 are :
# The minimal Varnish version is 4.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'SSL-OFFLOADED: https'

What is the difference between the two Headers, do I need to use both or update from X-Forwarded-Proto to SSL-OFFLOADED?


texts: How to Run the Command 'php bin/magento setup:upgrade' As a CLI Application

texts:
When I run the command '/usr/local/php71/bin/php-cli /home/******/public_html/bin/magentosetup:upgrade'
on a siteground.com hosted site with Magento 2.3.0 installed it worked perfectly

But on an inmotionhosting.com hosted site with Magento 2.3.3 installed it returned the error 'no such file or directory'

Please help


texts: How do I remove estimated shipping and tax from Magento 2.02

texts:
I've scoured the interwebs and have found some information on how to do this but it looks like files and method to accomplish this have changed from 2.0->2.02.

I'm using the standard Luma theme.

all/any help appreciated.


texts:
I'm doing the migration process from Magento 1.9.2.4 to Magento 2.1.6, after migration completed, I move the media folder of M1 to pub/media M2.
Now the problem is some of the images don't generate in the catalog/Cache folder
For example, the below images are going to 404 not found
pub/media/catalog/product/cache/f9c7fbe9b524c081a3ccf800cbd963eb/m/s/msj006c-red_2.jpg
pub/media/catalog/product/cache/75eed2686e01eb22cb4050b2f40ddf97/m/s/msj006c-red_2.jpg
pub/media/catalog/product/cache/f9c7fbe9b524c081a3ccf800cbd963eb/m/s/msj006c-red_2.jpg

I did like simply delete the catalog cache folder and load the page again but still, it goes to a broken image.
My page has 50% of broken images

can share the workaround to fix this issue?


texts: One customer with multiple customer groups Magento 2

texts:
Does anyone know how to apply multiple groups for one single customer?

I have seen one result for Magento 1.8 but it doesn't work.
 I have changed the DB to multiselect and not static value (varchar) on group_id, but in the admin panel the changes are not being saved.

Any idea?


texts: Display Product Name in Magento Transactional Email(magento 1.9x)

texts:
I want to display product name only product name in magento transactional email, but using
 {{layout handle="sales_email_order_items" order=$order}}
whole product grid comes like qty sku total etc. i only want to display product name


texts:
Im attempting to run a 2nd store view on a subdomain, but im just getting a 404 page

Current Website - www.washingtonlighting.co.uk

Subdoamin: showroom.washingtonlighting.co.uk

Im using magento 1.9.0.2 and Cpanel

I have followed this guide to the letter yet it still shows a 404 page.

Guide: https://www.properhost.com/support/kb/30/How-To-Setup-Magento-With-Multiple-Stores-And-Domains

Is there something not included in this guide?

Any questions please fire away.

Thank you,


texts: Customers admin page add grid column as order link in orders grid

texts: I would like to add a column in order grid in the admin customer edit page, the column should be an order link that open the order details page in new tab.


texts: Customer resource address collection override

texts:
We have a custom Customer Address Attribute that contains email of an existing user in the system. If this field is populated for a customer’s address, then this address appears on the list of addresses for the customer (who’s email address is assigned). These addresses appear on product list and detail pages during add to cart. Purpose is to allow store managers to have addresses for some customers so that they can place their orders if needed.

We also need to show this address for customer when he is looking at his addresses in My Stores (Stores).

We have added a collection class that extends from Mage_Customer_Model_Resource_Address_Collection and override method: setCustomerFilter.

Below is the code for the method:

if ($customer->getId()) {

            $this->addAttributeToFilter(array(
                array(
                    'attribute' => 'parent_id',
                    'in' => array($customer->getId()),
                ),
                array(
                    'attribute' => ‘store_manager',
                    'in' => array($customer->getId()),
                ),
            ));

        } else {
            $this->addAttributeToFilter('parent_id', '-1');
        }
 return $this;

Customer data is not loading, and all address for customer just got hide when this code is executed. Please suggest what I am missing.


texts: Last Step On configuring Magento REST and oAuth settings

texts: I am configuring Magento REST API and oAuth settings. But I am stuck in last step, access permissions. The radio button rest role is not showing on clicking rest role tab on left side.


texts: Is there a way to make it so search terms starting with "#10000" be sent to the "my account" page? We have a lot of people attempting to lookup their orders apparently through our search box. Instead of getting no results, might be cool to have them get the actual link to login with the redirect. Possible?


texts: Magento2 : How to change Grouped product child item template in cart?

texts:
I have grouped products made of several child products.
I would like to change these childs template in cart.

I tried to modify checkout_cart_item_renderers.xml, but the original default.phtml template is called and not the one of my module :

<referenceBlock name="checkout.cart.item.renderers.grouped" remove="true"/>
<referenceBlock name="checkout.cart.item.renderers">
    <block class="Vendor\Module\Block\Checkout\Cart\Item\Renderer" as="grouped" template="Vendor_Module::checkout/cart/item/default.phtml">
        <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.grouped.actions" as="actions">
            <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.grouped.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
        </block>
    </block>
</referenceBlock>

in default.phtml, when debugging, the product_type called is the child one.
When I add to cart the same product but alone (not grouped), my template is loaded correctly. (I have the same overload for original type products)

How are child products templates called when in grouped product (in cart)?


texts: How to reset lost admin password in Magento 2?

texts: I tried to reset the admin password via Phpmyadmin in admin_user table but this doesn't seems to work. Also on chrome I am getting "This webpage has a redirect loop" error when loading admin page.


texts: How to create two different form for the customer registration one is default and the other is Seller

texts:
I want to create the separate registration page for the seller and the customer, please guide me.

I created the custom module for the seller registration page, where i called the custom page in merchantregister_account_register.xml

    <referenceContainer name="content">
        <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="Magento_Customer::form/newregister.phtml"/>
    </referenceContainer>
    <referenceBlock name="customer_form_register">
        <action method="setShowAddressFields">
            <argument name="show.address.fields" xsi:type="boolean">true</argument>
        </action>
   </referenceBlock>

The phtml file is created in the /app/design/frontend/bs_complex/bs_complex3_child/Magento_Customer/templates/form/newregister.phtml (duplication of register.phtml)

while calling that module the error throws like the below screenshot:


texts:
I have a vps server wich i installed magento on. When i enter the ip-adress, this is what i get

any solutions?
i deleted all the links in the following text, so i can post it

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien
 * @license     Open Software License (OSL 3.0)
 */

if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo  '

Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer.
Find out how to install
 Magento using PHP-CGI as a work-around.

';
    exit;
}

/**
 * Error reporting
 */
error_reporting(E_ALL | E_STRICT);

/**
 * Compilation includes configuration file
 */
define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Mage::run($mageRunCode, $mageRunType);


texts: Is there way to send the reports generated by magento (under reports) to a mail?

texts: I need to setup a cron job to send the reports generated by magento to a particular mail. Is there way to configure this ?


texts: Checking whether a product can be added to cart or not

texts:
We've recently allowed out of stock products to be shown on the front end.

Now I want to display an "out of stock" image alongside the wishlist image.

I went into: app/design/frontend/default/default/template/catalog/product/view and tried:

<?php if(!$_product->isSaleable()): ?>

<img src="<?php echo $this->getSkinUrl('images/out_of_stock.jpg') ?>" />

<?php endif; ?>

In both addto.phtml and addtocart.phtml template files, but it display the image on both in-stock and out of stock items for some reason. This is strange because I know this is the right template file and the right method. I also cleared cache with no luck.


texts: Magento 2: How the collect totals is saved to database when adding product to cart?

texts:
On clicking on Add-to-cart, the price is added to cart, in Mini cart it shows cart subtotal and this cart subtotal is saved in the quote table database.
 So my question is:
How is these cart subtotal is getting saved to database? from which file?


texts:
Since few days the Graph on the dashboard return Error 503 (ajax call to DashboarController/tunnelAction )

A report is created and contains the following (I removed sensitive data from the url):

a:5:{i:0;s:45:"Unable to read response, or response is empty";i:1;s:1042:"#0 /var/www/clients/client2/web2/web/lib/Varien/Http/Client.php(61): Zend_Http_Client->request('GET')
#1 /var/www/clients/client2/web2/web/app/code/core/Mage/Adminhtml/controllers/DashboardController.php(100): Varien_Http_Client->request('GET')
#2 /var/www/clients/client2/web2/web/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_DashboardController->tunnelAction()
#3 /var/www/clients/client2/web2/web/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('tunnel')
#4 /var/www/clients/client2/web2/web/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /var/www/clients/client2/web2/web/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/www/clients/client2/web2/web/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /var/www/clients/client2/web2/web/index.php(90): Mage::run('en', 'store')
#8 {main}";s:3:"url";s:546:"/index.php/admin/dashboard/tunnel/key/blablalba/?ga=DATA_DATA&h=HASH_HASH";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Does anybody experienced similar issue ?
Maybe Google did some API changes, I google but found nothing ?


texts: What is the effect of deleting a product with associated orders?

texts:
We use an extension by Celigo that pushes products from our CRM/ERM (Netsuite) into Magento. Somehow the system pushed a couple duplicates (still looking into why). I need to delete the duplicate products but there are existing orders that reference these duplicate products. For now I have disabled the duplicates in Magento so no new orders are created. Ideally I would like to change the orders to reference the correct product but I don't know if that is possible. If I can, the sync back to our CRM/ERM should actually accept the order. The duplicate is currently causing this to fail.

Tl;dr
What happens to an order if I just delete the product associated with it?


texts: Magento 2 : The consumer isn't authorized to access %resources

texts:
In postman while i check to
http://local.vendor.com/rest/us/V1/carts/mine/payment-information

It shows
{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "self"
    },

I have added
customer token in
Headers:

Content-Type: application/json

Authorization: Bearer gku8vv7ta3nut5gl1vuayjzyfx139a79

Any thoughts how to solve this ?


texts: Products from a category plus any children and get category ID for conditions from collection

texts:
I'm building a collection for a CSV generator and I need to be able to only get products from a category and any children of it (or if I really have to, just all category ID's in an array) but from that collection, I need to then output specific names based on the category (for CSV category mapping to a 3rd party system).

I've tried countless variations but not successfully managed to achieve what I am after (so I've stripped it right back to start afresh as it was getting pretty confusing).

An example of category structure is:-

Parent Category (Ladies) - id 3
    Child Category (Trousers) - id 10
    Child Category (Shoes & Accessories) - id 11
    Child Category (Jewellery) - id 12
    Child Category (Coats & Jackets) - id 6
    Child Category (Knitwear) - id 7
    Child Category (Tops) - id 8
    Child Category (Skirts & Dresses) - id 9

So in this example, all products in any of these child categories are also in the parent category 'Ladies'.

Here is the product collection:-

// get all configurable products that are enabled and visible in search and/or catalog
$collection = Mage::getModel('catalog/product')
    ->getCollection()
    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
    ->addAttributeToSelect('*')
    ->distinct(true)
    //->addIdFilter($category->getChildren())
    ->addAttributeToFilter('type_id', array('eq' => 'configurable'))
    ->addAttributeToFilter('visibility', array('in' => array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_SEARCH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)))
    ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED))
    ->addStoreFilter($storeId);
$collection->getSelect()->group('e.entity_id'); //prevents duplicate products in collection

If I load the product collection from the parent category ID however like so...

$category = Mage::getModel('catalog/category')->load(3); // 3 is category id

... then when I try to fetch category data from the collection, everything just returns information from the parent category.

What I need to do is not only build the collection from products in any of these child categories but also get the child category data that the product belongs to so I can conditionally output specific labels/names for mapping, for example:-

// build the category names for mapping
if ($category->getId()==10) {
    $cmap = 'Clothing > Trousers';
}

Which returns NULL of course if I load the collection by parent category (id 3).

Should I be trying to build the collection of products from the child categories and then getting the child category data or actually building a separate collection for the categories?

If I try to filter by category_id using the below for example, this doesn't seem to make any difference at all (and loads products from any categories still):-

->addAttributeToFilter('category_id', array('in' => array('6','7')))

Later in the script we loop through the products and also get the associated products so we can fetch sizes/colours etc:-

foreach ($collection as $product) {
    //get associated products (different sizes etc)
    $associatedProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);

    foreach ($associatedProducts as $simple) {
        //load product
        $simple_product = Mage::getModel('catalog/product')->load($simple->getId());

        //output to CSV
        //etc etc

    }
}

So to summarise, I just need to be able to load products from specific categories and then extract the child category ID (it is only the ID I require) from the collection.


texts: Magento 2.3 How to check that customer is logged in using Js

texts:
I want find the whether the customer is logged in or not using Js. I got some links but it dosen't works and i not good at knockout js. Please give solution with brief explanation

Referred Link :

How to check that customer is logged in on frontend in Magento 2.1?

Thanks.


texts: Magento2.2 How to get userContext into ScopeConfig

texts:
It's more a core logic issue than a technical issue!

I created one new table for admin_user: admin_user_config_data

|config_id|user_id|path|value

And, like in core_config_data, in this new table will be stored the data from the specific admin_user.

I tried to create a new scope, but It's very complicated, and looking the code I realized that magento create a new cache from every scope and every time that I need to change the config.

Aways that I need to run this line:

$this->_reinitableConfig->reinit()

Well. Than I created the plugin below that search for the config path in my new table:

di.xml

<type name="Magento\Framework\App\Config\ScopeConfigInterface">
    <plugin name="Mine_User_ScopeConfigInterface" type="Mine\User\Plugin\ScopeConfig" />
</type>

Mine\User\Plugin\ScopeConfig

class ScopeConfig
{
    public function __construct(
        \Mine\User\Model\ResourceModel\UserConfigData\CollectionFactory $userConfigDataCollectionFactory,
        \Magento\Authorization\Model\UserContextInterface $userContext
    )
    {
        $this->_userConfigDataCollectionFactory = $userConfigDataCollectionFactory;
        $this->_userContext = $userContext;
    }

    public function afterGetValue(
        \Magento\Framework\App\Config\ScopeConfigInterface $subject,
        $result,
        $path,
        $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
        $scopeCode = null
    )
    {
        if ($this->_userContext && $this->_userContext->getUserId()) {
            $userConfigData = $this->_userConfigDataCollectionFactory->create()
                ->addFieldToFilter('path', $path)
                ->addFieldToFilter('user_id', $this->_userContext->getUserId())
                ->getFirstItem();

            if ($userConfigData->getId()) {
                return $userConfigData->getValue();
            }
        }

        return $result;
    }
}

But if I do this, my API returns the message:

Consumer is not authorized to access %resources

Without the UserContextInterface in the constructor the API works normally.

Anyone have any idea of how I can get the config stored in the admin_user_config_data after the value provided by the scopeConfig and with current logged in user? (The login is by api token provided by V1/integration/admin/token)


texts:
I'm trying to find out how to add custom event logging in the Magento 2 admin to log actions taken by our employees.

One of the reasons we've upgraded to the Enterprise edition is the addition of action logs, therefore I'd like to implement custom logging events, but I have no clue how to use it. Is there anyone out there who tried to do custom logging of actions?

Example:

One of our sales people updated one of the supplier's information, I'd like to see who did it on the next page:

<domain>/admin/admin/logging/index

How can I implement custom action logging?


texts: Magento2: How to get product description on product page

texts:
When I enter a given brand, then in the headline I have a description about this brand.

I would like to automatically download the description on the product card after entering the product from this brand.

example:

When I open a product from the brand "mybrand1" get description from
"brand1"
When I open a product from the brand "mybrand2" get
description from "brand2"

Any solution?


texts: My template file not showing header and footer

texts:
I want to add a new landing page between cart and checkout page of Magento. I succeeded in adding a new phtml file with the help of controller function.

public function linkAction() {
   echo $this->getLayout()->createBlock('core/template')->setTemplate('vatexempt/checkout/onepage/vatexempt.phtml')->toHtml();
}

But I am facing a weird issue, I am not getting header and footer in this template file.


texts:
I'm using Magento CE 1.9.2.3 and enable email confirmation for registration. Email is sent as normal, but when I click the link, it always fails. The link is like this

  https://domain.com/customer/account/confirm/?id=10&key=1fdc9eb4eb591cfaef5878b907348587

Later on, I found out that under customer_entity_varchar table, Magento stores the plain text (from the password) instead of the hash string, under attribute_id 16 (confirmation). When I change this plain text to the hash string, it works.

My question is, why Magento stores the plain text whilst email the hash string?


texts: Security Patch SUPEE-11086 - Possible issues?

texts:
Magento has released a new security patch for M1, and updates for M1 and M2.

These releases include critical security fixes. "We strongly recommend that all merchants upgrade as soon as possible."

What issues should I look out for when upgrading or applying this patch?

SUPEE-11086

  SUPEE-11086, Magento Commerce 1.14.4.1 and Open Source 1.9.4.1 contain multiple security enhancements that help close remote code execution (RCE), cross-site scripting (XSS), cross-site request forgery (CSRF) and other vulnerabilities.

Magento 2.3.1, 2.2.8 and 2.1.17 Security Update

  These versions contains multiple functional and security updates. Risk: Critical for Magento Commerce and Magento Open Source prior to 2.1.17, 2.2.8 and 2.3.1.


texts: I want to make some changes to the price filter code so my question is: Where can I find all the code that is related to the Category Price Filter?


texts: `Selected` field is missing from the post request for the product grid mass action

texts:
I made a custom mass action for the product grid.
This is the ui component part:
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">
        <massaction name="listing_massaction">
            <action name="barcode">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="type" xsi:type="string">barcode</item>
                        <item name="label" xsi:type="string" translate="true">Create Barcode(s)</item>
                        <item name="url" xsi:type="url" path="modulename_product_barcode/product/massCreateBarcode"/>
                    </item>
                </argument>
            </action>
        </massaction>
    </listingToolbar>
</listing>

In my controller I put this code:
    public function execute()
    {
        var_dump($_POST); exit();
...
    }

The result of the var_dump is:
array (size=5)
  'selected' =>
    array (size=1)
      0 => string '1' (length=1)
  'filters' =>
    array (size=1)
      'placeholder' => string 'true' (length=4)
  'search' => string '' (length=0)
  'namespace' => string 'product_listing' (length=15)
  'form_key' => string 'fgqSDhnd44Eao74Y' (length=16)

As you can see the selected which contains the product entity ids is present! If I do a search in the product grid after the sku, the result of the var_dump is:
array (size=5)
  'excluded' => string 'false' (length=5)
  'filters' =>
    array (size=1)
      'placeholder' => string 'true' (length=4)
  'search' => string 'SP' (length=2)
  'namespace' => string 'product_listing' (length=15)
  'form_key' => string 'fgqSDhnd44Eao74Y' (length=16)

Here the selected is missing. Not sure why ? So how can i get the product entity ids after searching or filtering the product grid for a mass action ?
Thank you


texts: Magento 2 How can I filter orders to see all but completed?

texts: Google is useless. Is there a way to view the orders in M2 and exclude those that have been completed? I know I can filter by all of the statuses, but I cannot find a way to view all but those that have a status of "complete".


texts:
I have a Magento 2.1.7 theme and a form in the footer.phtml that I am trying to get to submit the form fields to a php file that is external from Magento.
My issue is when I click the submit button in the form I get brought to the file that is indivated in the action of the form element. However none of my posted variables are being shown to the page.  I am not sure why my form posts are not working.

Below is the form in the magento footer.phtml file. NOTE the form action when viewed on front end inspection shows https://www . mydomain . com/newsletter_subscribe  where "mydomain.com" is my actual domain name

<form method="post" action="<?php echo $block->getUrl(); ?>newsletter_subscribe" class="form subscribe">
        <input type='text' class='hbox' name='email'><input type="hidden" name='region' value='<?php echo "$storeID";?>'>

            <?php echo __('Sign Up for Our Newsletter:') ?>

                <input name="adr" type="text" id="footer_newsletter" data-validate="{required:true, 'validate-email':true}" placeholder="Enter Your Email"/>

            <button class="action subscribe primary" title="<?php echo __('Subscribe') ?>" type="submit">
                <?php echo __('Subscribe') ?>
            </button>

    </form>

Below is my code in the external from magento2 php file

<?php
   //subscribe user to emme newsletter list
   $countrycode = $_POST['region'];
   $emailaddris = $_POST['adr'];
   $spambox = $_POST['email'];

   echo "$spambox a $emailaddris and the country is  $countrycode";

?>


texts: magento1.9 , set data from postData to config.xml file

texts:
i want to insert data from POST data from my form to my config.xml file
i have this in my confi.xml
 <crontab>
        <jobs>
            <retailmanager>
                <schedule><cron_expr>5 8 * * Sun</cron_expr></schedule>
                <run><model>retailmanager/observer::refresh_data_retail_disks</model></run>
            </retailmanager>
        </jobs>
    </crontab>

i want to update data here<cron_expr>DATA FROM POST DATA</cron_expr> data from POST data
how is this possible to implement?


texts: How to get full rows from core_config_data table?

texts:
I need to get the complete row from core_config_data table, to then make a few conditions. I know you can get a table by table-name, like:

->getTableName('table_name');

But i need to know if there's a way to call directly core_config_data table.

Thank you


texts: Payment success but is amount is due in backend order [Magento PayPal]

texts:
My Magento is redirecting to PayPal payment site and after payment is success, it sends back some details but in "order" it still showing

the payment is due.
What can I do to change it to paid?


texts: $product->getWeight() returning always NULL

texts:
Any idea why a code can stop returning getWeight? (but still returns SKU)
It's so basic I don't know what can be happening.

$products = Mage::getModel('catalog/product')->getCollection()->setStore('xxx');
foreach ($products as $p) {
  $sku = $p->getSku(); //<-- OK
  $weight = $p->getWeight(); //<-- Always null
}

No suspicious log or exception.
Still using 1.8 for a complex reason.
I'm executing this code in a php apart in order to refill a custom field using weight value.


texts:
I'm a little new to Magento, hoping for some help ... running Magento 2.1.13, public site is here

I just upgraded an extension, and somehow now all of the blocks are missing: banner, footer, etc.  I've cleared caches, re-compiled, disabled and re-enabled the theme, re-deployed static content.

Any hints?

Thanks!

Sam Nelson


texts:
I need to override in my module
Mage_Sales_Model_Order_Pdf_Abstract and Mage_Sales_Model_Order_Pdf_Invoice files
i wrote in config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <version>1.0.0.0</version>
        </Namespace_Module>
    </modules>
    <global>
        <models>
            <module>
                <rewrite>
                    <order>Namespace_Module_Model_Order_Pdf_Abstract</order>
                    <order>Namespace_Module_Model_Order_Pdf_Invoice</order>
                </rewrite>
            </module>
       </models>
    </global>
</config>

it is not working? am I missing something


texts:
We are running Magento EE 1.11 with memcache. 2GB per memcahce server, 4GB total. We have about 240k products.

Available ram: 6GB
Cores: 16
Threads: 32

Here is the deal, more new products are added and changes to products occur on a daily basis and of course each time a new product is added/modified in the back-end the cache becomes invalidated, specifically the 'Full Page Cache'.

When Magentos Auto Cache Generation is enabled it takes about 2 days to build up the cache, with 8 threads allocated to the crawler. After 2 days the memcache floats around ~2GB separated between the two ram disks.

The problem is, when products are modified on a daily basis the cache becomes invalidated and as soon as 'Full Page Cache' is refreshed those 2GB of cache are back to square one, 0, and the viscous cycle of Magentos Auto cache starts again. Now, not only is the cache back to 0, but the CPU usage spikes to 90% and the website turns into a 5-10+ seconds waiting game and you can just forget about trying to request a product with 100+ variations, if it's not cached it would take minutes to load the first time, it's ridiculous.

So, my questions to the community.

Is there a way for Magento to automatically "update" the cache if invalidated, without rebuilding the whole cache and starting from 0? I know when the cache is invalidated that Magento knows somethings has changed, but not exactly where in the cache (correct me if I'm wrong). Are there modules/configurations out there to bypass rebuilding the whole cache?

On the side note, we are using Tiny Bricks LightSpeed module.

Can Magentos Automatic Cache Generation be time controlled with a cronjob? Say, to start crawling at 10pm - 6am.
What would be the best way to approach this situation?, As you understand rebuilding a cache that's in gigabytes everyday is just not acceptable.


texts: Magento2 display most viewed sorting option

texts:
hi am trying to display most viewed as a sorting option like this but its not working whereas price high-low and low-high is working

here is my full code:-

config.php

<?php
namespace Learning\Module\Plugin\Model;

class Config
{
    /**
     * Adding custom options and changing labels
     *
     * @param \Magento\Catalog\Model\Config $catalogConfig
     * @param [] $options
     * @return []
     */
    public function afterGetAttributeUsedForSortByArray(\Magento\Catalog\Model\Config $catalogConfig, $options)
    {
        //Remove default sorting options
        unset($options['position']);
        unset($options['name']);
        unset($options['price']);

        //Change label of default sorting options if needed
        //$options['position'] = __('Relevance');

        //New sorting options
        $options['price_desc'] = __('Price High - Low');
        $options['price_asc'] = __('Price Low - High');
        $options['newest'] = __('Newest');
        $options['most_viewed'] = __('Most Viewed');
        // $options['name_az'] = __('Product Name A - Z');
        // $options['name_za'] = __('Product Name Z - A');

        return $options;
    }
}

Toolbar.php

<?php
namespace Learning\Module\Plugin\Product\ProductList;

class Toolbar
{
    /**
    * Plugin
    *
    * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
    * @param \Closure $proceed
    * @param \Magento\Framework\Data\Collection $collection
    * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
    */
    public function aroundSetCollection(
        \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
        \Closure $proceed,
        $collection
    ) {
        $this->_collection = $collection;
        $currentOrder = $toolbar->getCurrentOrder();
        $currentDirection = $toolbar->getCurrentDirection();
        $result = $proceed($collection);

        if ($currentOrder) {
            switch ($currentOrder) {

            case 'newest':
                $this->_collection
                    ->getSelect()
                    ->order('e.created_at DESC');
            break;

            // // case 'oldest':
            // //     $this->_collection
            // //         ->getSelect()
            // //         ->order('e.created_at ASC');

            // break;

            case 'price_desc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price DESC');
            break;

            case 'price_asc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price ASC');
            break;

            case 'most_viewed':
                $this->_collection
                    ->getSelect()
                    ->order('report_event_index');
            break;

            default:
                $this->_collection
                    ->setOrder($currentOrder, $currentDirection);
            break;

            }
        }
        // var_dump((string) $this->_collection->getSelect());
        // You can use this to get a list of all the available sort fields
        return $result;
    }
}


texts: How to check if condition already exists in shopping cart price rule?

texts:
I am trying to find out if the condition that I am going to set in the price rule already exists or not.
I tried to check if it is valid or not but couldn't find the correct function I think.

        if($voucherRule->getConditions()->validate($realProduct)){
            echo "
 Already exists
";
            $foundamatch = true;
        }

        if(!$foundamatch){
             $item_found = Mage::getModel('salesrule/rule_condition_product_found')
        ->setType('salesrule/rule_condition_product_found')
        ->setValue(1) // 1 == FOUND
        ->setAggregator('any'); // match ANY conditions
             $skuCondition = Mage::getModel('salesrule/rule_condition_product')
        ->setType('salesrule/rule_condition_product')
        ->setAttribute('sku')
        ->setOperator('==')
        ->setValue($realProduct->getSku());
            $voucherRule->getConditions()->addCondition($item_found);
            $item_found->addCondition($skuCondition);
        }
        $voucherRule->save();

Did not work, it always creates the same conditions over and over again when ever I run the script.

How can I check this?


texts:
I have a virtual host set up. My local url is http://test.local

When I start ngrok, my local url will become:
http://test.local.ngrok.io so I changed my base secure and unsecure url to: http://test.local.ngrok.io/

My problem is that I cannot login anymore in admin side . I am getting this error validation error: Invalid Form Key. Please refresh the page., after I cleared my cache and session folder and deleted the web/cookie/cookie_domain & web/cookie/cookie_path from core_config_data.

Interesting part is if changed back my base url in http://test.local/ I can login instantly.

Any ideas what should I try more ?


texts: Newsletter subscription at the checkout review

texts:
Expected functionality: user checks the "Subscribe" checkbox in the OnePage Checkout's review step and is subscribed to the newsletter.

So far I have managed to target the right event (after submitting checkout form):

config.xml

<events>
    <checkout_submit_all_after>
        <observers>
            <checkout_newsletter>
                <class>News_Custom_Model_Observer</class>
                <method>assignNewsletter</method>
            </checkout_newsletter>
        </observers>
    </checkout_submit_all_after>
</events>

info.phtml contains

        <input id="subscribe_newsletter" type="checkbox" name="is_subscribed" value="1" checked="checked">
        Subscribe for newsletter

Observer.php

public function assignNewsletter(Varien_Event_Observer $observer)
{
    $event = $observer->getEvent();
    $order = $event->getOrder();
    $quote = $event->getQuote();

    if ($observer->getRequest()->getParam('is_subscribed', false)) {
        Mage::log('got here');
        Mage::getModel('newsletter/subscriber')->subscribe($quote->getCustomerEmail());
    } else {
        Mage::log($observer->getRequest()->getParams());
    }
}

What happends is that $observer->getRequest()->getParams() only contains shipping method. So the issue is to pass/capture the data from checkout view to observer.

Any help or guidance is much appreciated.


texts: Magento 2 - Programmatically update the flat rate shipping method price in checkout

texts: I want to set a custom rate for the flat rate shipping method programmatically in frontend checkout. I have override the file Magento\OfflineShipping\Model\Carrier\Flatrate::collectRates() function but not worked this solution.Which file i have to modify or is there any event is available or any plugin?


texts:
I want to add an image field of UI component on traditional block form.

I want to replace only this field with UI component. The reset field should be in Block class form.

$fieldset->addField(
        'outfit_image',
        'image',
        [
            'name' => 'outfit_image',
            'label' => __('Outfit Image'),
            'title' => __('Outfit Image'),
            'required' => true,
            'data-form-part' => $this->getData('target_form'),
            'note' => __('Maximum file size: 2 MB.'),
        ]
    );

With This

<field name="outfit_image">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">string</item>
                <item name="source" xsi:type="string">Outfit Image</item>
                <item name="label" xsi:type="string" translate="true">Image</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="formElement" xsi:type="string">imageUploader</item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="url" path="outfit/image/upload"/>
                </item>
            </item>
        </argument>
    </field>


texts: Why don't work custom theme layout extension in Magento 2?

texts:
i have created custom theme

/app/design/frontend/VendorName/ThemeName

It works fine. I see it in the admin, styles from it are applied, etc. But When I try to extend module layout Magento 2 don't see xml. I have created:

/app/design/frontend/VendorName/ThemeName/Magento_Catalog/layout/default.xml

wich contains:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="catalog.compare.sidebar" destination="sidebar.additional" after="-" />
    </body>
</page>

And there are no results at all. If I place this rule in

/vendor/magento/module-catalog/view/frontend/layout/default.xml

move works fine. But in custom theme xml just being ignored.
I try to break it like

    <body

and page don't fail with error. So I think xmls from theme are ignored completely.

And yes, I

bin/magento cache:clean

before checking.


texts: Magento 2: After Ajax add to cart redirect to different page

texts:
Magento 2, after ajax add to cart, how can I redirect to the custom page.
Need to redirect only for specific product categories if successful product is added to cart.


texts:
I am looking for product import module for Magento 2 which will allow me to download images and uses cron jobs. Can you recommend anything specific for me?

Kacper


texts: Magento mail doesn't allow special characters

texts:
Mail doesn't allow special characters. I'm using Custom Formbuilder as a module.
The email I'm receiving is turning special characters like this: Ü into Ã¼. I've already looked into topics like this one https://stackoverflow.com/questions/9094023/zend-mail-with-french-characters-in-mail-body and I have UTF-8 enabled. How do I fix this?


texts: creating categories and subcategories using the api catalogCategoryRepositoryV1

texts:
I am able to create categories under default category but I am not able to create sub category while creating a new category under default.
The body I am passing is

{
  "category": {

    "parent_id": 2,
    "name": "test_category1",
    "is_active": true

  }
}


texts: Can we set shipping address, payment and success in same checkout page in magento 2

texts: I want to include success page as third tab in one page checkout. Please give me a solution. #magento2


texts: How to change onClick to onmouseover in product detail page in magento2.3?

texts: Inside of clicking each thumbnails to view main page. I want the main image to be selected and displayed onmouse over.


texts: Database Resources setup in local.xml + magento1.9

texts: I want to setup default_setup and default_read as different databases for both in Magento 1.9. Now the thing is there is something wrong with default_setup DB but default_read DB is proper so homepage should work properly by default_read database right? Or is it required default_setup database to run front-end compulsory?


texts:
I've added a custom input field as a new step in the checkout but now I'm struggling to find the correct way to do some order processing in the back end.
The end goal is to apply a discount to products in the cart based on the input (this isn't a discount code so the standard Magento method for that won't help, I don't think).
Essentially, after entering a value in a new step of the checkout, how do I access that value again?


texts:
I am using Magento 1.9.1.0. Below mentioned error happen after payment made by using paypal express checkout.

Steps 1: Register and add a product to cart

Steps 2: Give the Billing Information & Payment Information -Paypal Express Checkout

Steps 3:  Make payment

after Pay now button click page shows like this:-

Fatal error: Call to a member function getTelephone() on boolean in /app/code/core/Mage/Sales/Model/Order.php on line 1293

Refresh

Unable to initialize Express Checkout.

Error occurred line in this function:-

    public function getShippingCarrier()
{
    $carrierModel = $this->getData('shipping_carrier');
    if (is_null($carrierModel)) {
        $carrierModel = false;
        /**
         * $method - carrier_method
         */
        $method = $this->getShippingMethod(true);
        if ($method instanceof Varien_Object) {
            $className = Mage::getStoreConfig('carriers/' . $method->getCarrierCode() . '/model');
            if ($className) {
                $carrierModel = Mage::getModel($className);
            }  // error occured line
        }
        $this->setData('shipping_carrier', $carrierModel);
    }
    return $carrierModel;
}

how to rectify this issue?


texts: Search and Checkout display only store view specific products

texts: I am working on One Website - Multiple Store functionality. My products are displayed according to store views. I am opening both store urls on two different tabs. But when i search products displayed from stores and when i checkout then also in checkout both products are displayed which are add in cart.I want search and checkout works store specific products only.


texts: How to make Magento 2 development sites fast?

texts:
I turned off all caches and I set deployment mode to development. So my Magento 2 development sites on all machines are very slow compared to Magento 1.x sites.

Is it normal for Magento 2?

What are the server and Magento configurations that we must be using for Magento 2 development sites so that it has maximum speed?

Update:

On mac for local development, I was able to speed up the site by disabling opcache since there was configuration issue.


texts: Show Shipping Cost based on Grand Total on Cart page

texts:
I have a requirement where i need to show free-shipping if grand total is more than some value or else a fixed rate ( flat rate ) should be displayed on Cart page.

How can i set shipping cost based in Grand Total without knowing shipping or billing address.

Thank You.


texts: Fedex realtime not sending line 1 of address

texts:
We have a EE 1.1.3.1 store setup with FedEx realtime shipping. This works fine for street address request but not for P.O. Boxes.

When entering a PO Box, Fed Ex returns rates, where as it should not.

Upon contacting Fed Ex, they indicated that address line1 was not sent in the data packet. The information received was Postal Code, Country, and Residency. They indicated that to fix the problem, line1 information would need to be included in the sent transaction.

Magento support acknowledged the issue but will not fix this or provides a patch.

Does anyone know where to modify the data send to FedEx? It looks like data is passed into fedex.php api script through the function getConfigData().

Thanks


texts: flat price for 6 items then price per additional

texts:
trying to figure out how to do the following

  if customer buys up to 6 tubes the shipping cost is flat rated at 8.25 and every additional after 6 is .25 cents

for usa customers


texts: Replace special characters (german umlauts)

texts:
I need to replace special characters in Magento.

For example:

<?php echo $string; //echoes "ausführung"?>
  <?php if (strpos($string,"ü")!==false)
    {echo "umlaut"}?>

My problem is that the if-statement is never true. I also tried to html_entity_decode or something, without a result.

Does anyone know how to replace special characters there?
I need to use the string as a CSS class name and special characters are not allowed there.


texts: Magento 2: Restrict customer registration by specific mail extension

texts:
Anyone know how to block customer registration with specific email extension?
I am getting so many automated user registrations with ...@163.com and ...@mail.ru
how to block this type email registrations?


texts:
I would like to add ngram in my elastic search.
https://www.elastic.co/guide/en/elasticsearch/guide/current/ngrams-compound-words.html

I had tried this at Magento\Elasticsearch\Model\Adapter\Elasticsearch.php:

/**
 * Create new index with mapping.
 *
 * @param int $storeId
 * @param string $indexName
 * @param string $mappedIndexerId
 * @return $this
 */
protected function prepareIndex($storeId, $indexName, $mappedIndexerId)
{
    $this->indexBuilder->setStoreId($storeId);
    $settings = $this->indexBuilder->build();
    $allAttributeTypes = $this->fieldMapper->getAllAttributesTypes([
        'entityType' => $mappedIndexerId,
        // Use store id instead of website id from context for save existing fields mapping.
        // In future websiteId will be eliminated due to index stored per store
        'websiteId' => $storeId
    ]);
    $settings['index']['mapping']['total_fields']['limit'] = $this->getMappingTotalFieldsLimit($allAttributeTypes);

    $settings['index']['analysis']['filter']['trigrams_filter'] = [
        'type' => 'ngram',
        'min_gram' => 3,
        'max_gram' => 3
    ];
    $settings['index']['analysis']['analyzer']['trigrams'] = [
        'type' => 'custom',
        'tokenizer' => 'standard',
        'filter' => [
            'lowercase', 'trigrams_filter'
        ]
    ];
    $mappings['product']['properties']['name'] = [
        'type' => 'text',
        'analyzer' => 'trigrams'
    ];
    $this->client->createIndex($indexName, ['settings' => $settings, 'mappings' => $mappings]);

    $this->client->addFieldsMapping(
        $allAttributeTypes,
        $indexName,
        $this->clientConfig->getEntityType()
    );
    $this->preparedIndex[$storeId] = $indexName;
    return $this;
}

But this returns following error:

  report.CRITICAL:
  {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting
  mapping update to [254407_product_1_v61] as the final mapping would
  have more than 1 type: [product,
  document]"}],"type":"illegal_argument_exception","reason":"Rejecting
  mapping update to [254407_product_1_v61] as the final mapping would
  have more than 1 type: [product, document]"},"status":400}
  {"exception":"[object]
  (Elasticsearch\Common\Exceptions\BadRequest400Exception(code: 400):
  {\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting
  mapping update to [254407_product_1_v61] as the final mapping would
  have more than 1 type: [product,
  document]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting
  mapping update to [254407_product_1_v61] as the final mapping would
  have more than 1 type: [product, document]\"},\"status\":400} at
  /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:636)"}
  []

Any suggestions?


texts: How can I change the product display order in the front end?

texts: How can I change the product display order in the front end (grid or list) by setting some preferences from back-end? I guess it should be other than best value and name from the default Magento display order property.


texts: Processing an order with products out of stock

texts: Im new to Magento and in doubt how to process an order when there are products sold out. My Magento is set up to automatically process the payments from within the order. But what should I do when there are products that are sold out? I will invoice the products that i can, but then there will still be a part of the payment left and my order status is still "processing". How do you normally handle this situation?


texts: Product Form Modifier Datetime Can't store correct DateTime to product attributes

texts:
I created a product attribute  called datedate  want to store DateTime, in default Magento product attributes, just have a date input type, so I using Ui Modifier to config date picker support time, but it just shows ok:

if submit the data, attribute looks like this, it seems stored not correct

this is my modifier code:
namespace XXX\XXXX\Ui\DataProvider\Product\Form\Modifier;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Framework\Stdlib\ArrayManager;

/**
 * Data provider for "Custom Attribute" field of product page
 */
class Datetime extends AbstractModifier
{
    /**
     * @param ArrayManager                $arrayManager
     */
    public function __construct(
        ArrayManager $arrayManager
    ) {
        $this->arrayManager = $arrayManager;
    }

    /**
     * {@inheritdoc}
     */
    public function modifyMeta(array $meta)
    {
        $meta = $this->enableTime($meta);

        return $meta;
    }

    /**
     * {@inheritdoc}
     */
    public function modifyData(array $data)
    {
        return $data;
    }

    /**
     * Customise Custom Attribute field
     *
     * @param array $meta
     *
     * @return array
     */
    protected function enableTime(array $meta)
    {
        $fieldCode = 'datedate';

        $elementPath = $this->arrayManager->findPath($fieldCode, $meta, null, 'children');
        $containerPath = $this->arrayManager->findPath(static::CONTAINER_PREFIX . $fieldCode, $meta, null, 'children');

        if (!$elementPath) {
            return $meta;
        }

        $meta = $this->arrayManager->merge(
            $containerPath,
            $meta,
            [
                'children'  => [
                    $fieldCode => [
                        'arguments' => [
                            'data' => [
                                'config' => [

                                    'options'       => [
                                        'dateFormat' => 'yyyy-MM-dd',
                                        'timeFormat' => 'HH:mm',
                                        "storeTimeZone"=>"Asia/Shanghai",
                                        'showsTime' => true,
                                    ]
                                ],
                            ],
                        ],
                    ],

                ]
            ]
        );

        return $meta;
    }
}

how to solve this problem


texts: How to show subtotals in first checkout step?

texts:
I want to add the subtotals to first checkout step "shipping" into the sidebar.
In the checkout_index_index.xml

I can see the totals but I have no clue why it is not loading in the first checkout step.


texts:
I am updating magento rwd theme and style sheet and its style is bulild on saas. What is best way to edit the theme so that it remain remain responsive and my new addition also build on responsive design.

Should i edit in css files of in saas files? I only need to update style.css file i think.

Magento version: 1.9.2.1


texts: Magento 2.1 mobile product page doesn't scroll

texts: I'm having an issue with my magento 2.1 installation, basically when I go mobile, on the product page, I can't scroll down because of the product Image, I can just slide it, to scroll to bottom I need to take it from the very button, but I can't tell to do that to the users. Any suggestion?


texts: How to switch developer mode to production mode in magento 2?

texts:
When I run:sudo php bin/magento deploy:mode:set production

Then i received

  Command returned non-zero exit code: /usr/bin/php7.0 -f
  /var/www/html/magento/bin/magento setup:di:compile


texts: Magento2 hide proceed to checkout button on cart page

texts:
Need to hide proceed to checkout button on the cart page when session variable set
Need to add one more button PROCEED TO APPROVAL below the Proceed to checkout button on the cart page.

Followed different approached mentioned here but no luck.

checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<!-- first approach failed -->
<!--<body>
<referenceContainer name="checkout.cart.methods">
        <block class="Ken\Bestseller\Block\Onepage\MyLink" name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml">
        </block>
</referenceContainer>
</body>-->

<!-- second  approach failed -->
<!-- <body>
  <referenceContainer name="content">
        <referenceBlock name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml" />
  </referenceContainer>
</body> -->

<!-- 3rd  approach failed -->
  <!--<body>
       <referenceBlock name="checkout.cart.methods.onepage.bottom" template="Ken_Bestseller::onepage/mylink.phtml"/>
   </body> -->

<!-- added custom button -->
  <body>
      <referenceContainer name="checkout.cart.methods" >
            <block class="Ken\Bestseller\Block\Onepage\MyLink" name="custom.template.kenisum" after="checkout.cart.shortcut.buttons" template="Ken_Bestseller::onepage/mylink.phtml"/>
       </referenceContainer>
   </body>
</page>


texts: Magento frontend and backend CSS is not working

texts:
I have installed Magento 2.2.5 on my server using Cpanel. The problem I am facing is my CSS is not working properly. The Url of my site is http://emcd.tk/. I've looked on so many solutions but didn't find any proper one. I also attached the picture showing errors.

Things I've tried so far:

Giviving permission for var & pub folders.
php bin/magento setup:static-content:deploy
Do reindex php bin/magento indexer:reindex
Clearing cache using commands [php bin/magento cache:clean] and [php bin/magento cache:flush]

The reason of doing this if you take the source code and check, the CSS & JS file path may wrong. So that the style won’t render in a browser even I tried to make it correct but didn't work properly.

I would appreciate any kind of help. Thank you