texts: Magento 2.2.2 ERROR Unable to serialize value

texts:
After clean installation of Magento 2 and Template I got these error:

1 exception(s):
Exception #0 (InvalidArgumentException): Unable to serialize value.

Exception #0 (InvalidArgumentException): Unable to serialize value.
#0 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/lib/internal/Magento/Framework/App/PageCache/Kernel.php(153): Magento\Framework\Serialize\Serializer\Json->serialize(Array)
#1 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/app/code/Magento/PageCache/Model/Controller/Result/BuiltinPlugin.php(96): Magento\Framework\App\PageCache\Kernel->process(Object(Magento\Framework\App\Response\Http\Interceptor))
#2 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/lib/internal/Magento/Framework/Interception/Interceptor.php(146): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->afterRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\App\Response\Http\Interceptor))
#3 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#5 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/lib/internal/Magento/Framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#7 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()
#8 /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main}


texts:
UPDATEDetc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Block\Product\ListProduct" type="Tagalys\Tglssearch\Block\Catalog\Product\ListProduct" />

Should i override the \Magento\Catalog\Block\Product\ListProduct.php listproduct in etc.di or etc/frontend/di.xml

I get the core method executed


texts: Load email from quote or order or billing address?

texts:
What is the correct structure to load the email of the customer from? It should work in all order variants: orders by guests, orders by registrered customers, already saved addresses, newly entered addresses in checkout process.

Background:
I'm investigating an issue with a payment extension. I turned out that sometimes the extension doesn't have an email address for the customer.

We found that the extension loads the email address for order processing the following way:

$quote->getBillingAddress()->getEmail()

Testing in stock magento 1.7.0.2 with sample data showed that the email address is not saved into the billing address if

customer creates an account (just name, email, password, no addresses)
customer loads cart and starts checkout with entering billing/shipping address.

In this case billing/shipping address don't have email set and the extension fails.
You can confirm this by looking at the tables

sales_flat_quote
sales_flat_quote_address

during order.

There are more places to load the email from:

$order->getCustomer()->getEmail()
$order->getCustomerEmail()
$quote->getCustomerEmail()

So what is the correct structure to load the email from?


texts: How to make the input is selected on admin form?

texts:
I have a form like this. This is used to save a new custom admin. But I have a problem with showing a value in the store_id field while editing.

While showing this form the store field must be selected. The name of this field is store_id but I have to show the name of the store instead. so I need to make a class for getting the store's name. I can get all the names of the stores and use them for the dropdown list. But after seeing the detail when editing, the store_id field is empty and doesn't even show the store_id or the store_name. However, the store_id can be saved to the database.
This is the part for the store_id field at admin_form.xml
<field name="store_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Module\Vendor\Model\Select\Source\Store</item>
        <item name="config" xsi:type="array">
            <item name="componentType" xsi:type="string">field</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="label" xsi:type="string">Store</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="source" xsi:type="string">Customer</item>
            <item name="dataScope" xsi:type="string">store_id</item>
        </item>
    </argument>
</field>

and this is the class for showing the name of the store
<?php

class Store extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{

    /**
     * @var \Vendor\Module\Model\CustomFactory
     */
    private $customFactory;

    /**
     * @param \Magento\Customer\Model\CustomerFactory $customerFactory
     */
    public function __construct(\Module\Vendor\Model\ResourceModel\Store\CollectionFactory $customFactory)
    {
        $this->customFactory = $customFactory;
    }

    /**
     * Get all options
     *
     * @return array
     */
    public function getAllOptions()
    {
        $customCollection = $this->customFactory->create();

        $customCollection->addFieldToFilter('status', 'Active');

        $customCollection->setOrder('store_name', 'ASC');

        $this->_options = [['label' => 'Please select', 'value' => '']];

        foreach ($customCollection as $custom) {
            $this->_options[] = ['label' => $custom->getData('store_name'), 'value' => $custom->getData('id')];
        }
        return $this->_options;
    }

}

How can I make this field is selected based on the store_id and the selected field shows the store's name?


texts: Magento PIM integration, how best to handle attribute set

texts: Having to import products from a PIM solution and seeking recommendation on the best way to handle attribute_set. Would this typically be mastered in PIM and extracted or is there any other suggestions?


texts: Tried to implement the datetime picker magento2, but only date is coming

texts:
I have tried to implement datetime picker in Magento2, only date is coming, datetime picker is not appearing,

$eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'start_date',
            [
                'type'                    => 'datetime',
                'backend'                 => 'Magento\Catalog\Model\Attribute\Backend\Startdate',
                'frontend'                => '',
                'label'                   => 'start date',
                'note'                    => 'Add start date with 24 hours time format Ex: mm/dd/yyyy hh:mm:ss(05/01/2017 13:10:10)',
                'input'                   => 'date',
                'frontend_class'          => 'starting_date',
                'source'                  => '',
                'global'                  => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible'                 => true,
                'required'                => false,
                'user_defined'            => true,
                'default'                 => '',
                'searchable'              => false,
                'filterable'              => false,
                'comparable'              => false,
                'visible_on_front'        => true,
                'used_in_product_listing' => true,
                'unique'                  => false,
                'apply_to'                => '',
                'is_used_in_grid'         => true,
                'is_visible_in_grid'      => true,
                'is_filterable_in_grid'   => true,
                'group'                   => 'CustomAttribute',
            ]
        );

I have tried different option including this [url][1]

[1]: Magento 2 Create Date with Time attribute for product anyone have done this, it will be awesome to share.


texts:
I have a requirement to add GA Events throughout the Website.

I found this plugin

http://www.anowave.com/marketplace/magento-extensions/magento-google-analytics-event-track/

Found this article is as well.

http://claudiucreanga.github.io/analytics/magento-analytics-event-tracking.html

Better to use Plugin or do custom way?


texts: Magento 2: Getting custom product attribute value

texts:
I am trying to get a custom product dropdown(yes/no) attribute value.
These are my methods:

protected $logger;
protected $orderModel;

public function __construct(
    \Psr\Log\LoggerInterface $logger,
    \Magento\Sales\Model\Order $orderModel
)
{
    $this->orderModel = $orderModel;
    $this->logger = $logger;
}

public function execute()
{
    $orders = $this->orderModel->getCollection();
    $orders->getSelect()->order('main_table.created_at DESC');
    foreach($orders as $k => $order) {
        $items = $order->getAllVisibleItems();
        foreach ($items as $item) {
            var_dump($item->getAttributeText('subscription'));
        }
    }
    return;
}

The attribute code is: subscription. Most of the posts are suggesting to use the getAttributeText method. But in my case, the output of the var_dump is null. Any clue why? :)

Thnx


texts: Magento 2 : Override Magento\Framework\App\Cache\TypeList.php

texts:
Is their anyway we can override
Override Magento\Framework\App\Cache\TypeList class in module ?


texts: All payment methods either cause a "there was an error processing your order" or "user authentication failed". But the order will often go through on both Magento and PayPal...but not the credit card on PayPal advanced. I've checked the logs but can't figure out what the issue is. Even saved cc and purchase order throw and error.


texts: magento 2: Customize collection of product not effecting in layer & toolbar area

texts:
I extend the collection query using event 'catalog_block_product_list_collection'. Query displaying proper data, as well as showing proper record in product list page.
But same collection is not loading for layer & toolbar section.

here is my code

events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_block_product_list_collection">
        <observer name="review" instance="PR\Catalog\Observer\CatalogBlockProductCollectionBeforeToHtmlObserver" shared="false" />
    </event>
</config>

CatalogBlockProductCollectionBeforeToHtmlObserver.php

namespace PR\Catalog\Observer;

use Magento\Framework\Event\ObserverInterface;

class CatalogBlockProductCollectionBeforeToHtmlObserver implements ObserverInterface
{
    /**
     * Review model
     *
     * @var \Magento\Review\Model\ReviewFactory
     */
    protected $_vendorProductFactory;

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $productCollection = $observer->getEvent()->getCollection();
        if ($productCollection instanceof \Magento\Framework\Data\Collection) {

           $productCollection->getSelect()->join(array(
                    'vendor_product' =>  'pr_vendor_product'),
                    "e.entity_id = vendor_product.marketplace_product_id and vendor_product.status = 1",
                    array('vendor_product.*')
                    );
            $productCollection->getSelect()->group('marketplace_product_id');
        }
    }
}


texts: how disable automatic send mail confirmation ORDER in magento?

texts:
How disable automatic send mail confirmation ORDER in magento ?
but i can send manually order email with button SEND MAIL ?


texts: How to find if target path in custom url rewrite exists in magento 2

texts:
how to check if the target path for custom url is present in the url rewrite table in magento 2.

I had created custom url rewrite using following code.

$urlRewriteModel = $this->_urlRewriteFactory->create();
$urlRewriteModel->addData(
            [
                'entity_type' => \Magento\UrlRewrite\Controller\Adminhtml\Url\Rewrite::ENTITY_TYPE_CUSTOM,
                'entity_id' => 0,
                'request_path' => "abc",
                'target_path' => "xyz/index/view/id/".$displayText['videoData']['id'],
                'redirect_type' => \Magento\UrlRewrite\Model\OptionProvider::PERMANENT,
                'store_id' => 1,
                'description' => null,
                'is_autogenerated' => 0,
                'metadata' => null
            ]
        );
$urlRewriteModel->getResource()->save($urlRewriteModel);

This data add when i save any new record in from admin. if i edit same record then also it will call. so i want to know if that target record is already ther in magento 2. if yes delete and add again using above code.


texts: Get linked manufacturer name on product page and listing page above product title on Magento2

texts:
On magento 1.9, I could achieve this with this code

<a href="<?php echo strtolower ($manufacturerName = $_product->getAttributeText('manufacturer')) ?>.html"><?php echo $_product->getAttributeText('manufacturer') ?>

but don't know how to do for Magento2.

Can anybody help me?


texts: Magento 2 Js issue when try to adding to cart

texts:
I receive a js error everytime i try to add products in cart.
I already run all this command but nothing changed :

  php bin/magento setup:static-content:deploy nl_NL
    , magento setup:static-content:deploy, php bin/magento setup:di:compile,  php bin/magento setup:upgrade, php bin/magento cache:clean,
        php bin/magento cache:flush, bin/magento deploy:mode:set --skip-compilation production
        bin/magento setup:static-content:deploy nl_NL en_US
        bin/magento setup:di:compile-multi-tenant
        rm -Rf var/di/relations.ser

I deleted manually all the static files and generation but no result.
I searched for an answer for almost 3 days, and i am running out of ideas.

Here is a print with my js problem:

Can anyone know how can i solve this problem?


texts:
I have mobile site where it should not contain pinch zoom. I have done this using below statement in head.

user-scalable property stopped the pinch zoom.

My challenge is in product details page, on clicking product image, the image will open in popup where the image should contain pinch zoom.

How to achieve pinch zoom to only image part?


texts: Restoring related products from database back up

texts:
All of our related products have disappeared. If I look in the database the 'catalog_product_link' table is empty.

I have a db backup which has the data in it. Can I just import the data from the back up into the 'catalog_product_link' and 'catalog_product_link_attribute_int' tables or is there more to it?

Note that I can't just restore the full database from the backup - it's too old and too much has potentially changed

The products are a mixture of both configurable and simple with visibility set to catalog/search

Using Magento CE 1.8


texts: MailChimp / Magento Connection Issue When Uploading Files to FTP

texts:
I am trying to connect my MailChimp account to my Magento multistore. I couldn't seem to connect it using the Access Key and Magento Connect so I have downloaded the TGZ files from Magento Marketplace, unzipped them and copied the folders into my Magento store root directory, following the instructions from MailChimp (here).

I am having two issues:

The following file will not copy over to my FTP: MailChimp Connect Files\skin\js\app\design\adminhtml\default\default\template\ebizmarts\mailchimp\system\config\form\field\array_dropdown.phtml

This is the only file that is returning an error. I have tried to upload it multiple times but I get the same error message every time. This is the only error information that's coming up on the FTP.

This is the main issue: MailChimp does not appear in my Magento Configuration Settings panel and therefore doesn't look like it's connected.

I have followed all the instructions to the letter (famous last words), so I'm really confused as to why it's not connecting.

Can anyone advise?

Any help would be greatly appreciated.

Many thanks
Anna


texts: Magento - Again Advertising page in my site

texts:
i reopen this question because the problem of advertising page is still present in my site. Any time that change category from navigation menu of my site opens a page of advertising. I try to install someone component for my browser but without results. I try to search a virus on my site but always without any type of virus. And finally I tried to do a scan on my PC but found nothing.

This is the page... http://demo.promowebkit.com/sitoweb/index.php/catalog/category/view/s/estate/id/4/

Where you could be the problem?


texts: Change scope of validation rules of customer attribute property from global to website

texts:
How can I change the scope of the customer attribute property "validation_rules".
This attribute exists in customer_eav_attribute (containing min_text_length and max_text_length).

Adding it to customer_eav_attribute_website does not work. Scope is still "global". Where do I have to customize?

$installer->getConnection()->addColumn($installer->getTable('customer/eav_attribute_website'), 'validate_rules',
    'text DEFAULT NULL');

Any ideas?


texts:
im having an unusual problem when i try to access a saved file. i am saving an image to the media folder where i have created another floder called customers. the folder is set to 775. when i add an image using php it saves the image correctly to the folder but when i try to access the image using theu url link it doesn't work - i have checked if the image url is correct and it is but i don't know why i am getting a 404 error when i access the image. i have uploaded pictures using php before on this site for the blog section and it works fine and i can see the images correctly but i don't know why when i upload images to the customers folder, the images don't display

Please could someone help


texts: How to hide the ui component field using form modifier on condition in magento2

texts:
I have two ui component filed :

i want to make visibility false of second component if first's value is true

how to use Form modifier in magento2 ui


texts: how to show tier price with tax in magento 2 catalog listing page?

texts:
<?php
                        if($_product->getTierPrice()){
                            $tierPrice = $_product->getTierPrice();
                            foreach ($tierPrice as $key => $value) {
                                $qty = (int)$value['price_qty'];
                                $price = $value['price'];
                                $formattedTierPrice = $this->helper('Magento\Framework\Pricing\Helper\Data')->currency(number_format($price, 2), true, false);
                                $savePercentage = ceil(100 - ( (100 / $_product->getPrice())* $value['price']) ) ."%";
                                echo "Buy $qty for ".$formattedTierPrice." each and save ".$savePercentage."<br>";
                            }
                        }
                        ?>**what we can add in this code for the show tier price with tax**


texts: magento 2 add associate Simple Products with custom options to Configurable Product not working

texts:
I want to add the simple products with custom options to configurable product.When I am trying to add the simple product to configurable product, it's not showing after product save.Need suggestion to achieve this .
Basically it not updating into database once it assign it saved but not showing in configuration grid i think it some conditions based can any one tell me where i need to change that conditions


texts: Magento 2.1.9 to Magento 2.2.1 upgrade error

texts: I am trying to update to latest version but when I run upgrade command from the console than its showing below upgrade error.


texts: Magento shows tier price twice (in grid/list view)

texts:
I'm trying to figure out why prices on my magento eshop show up twice on the grid/list view. This only happens when i add a 'sale' price to the product. Is there any way to disable the 'al vanaf: €...' (meaning 'starting from') so it won't show anymore?

sidenote: i use an ERP system to import products and determine the (tier)price .


texts: Error generated when clicking on insert image in a CMS page

texts:
While in a CMS page, when I click on "Insert image", it creates the following error.  This error is repeated for the number of images displayed in the popup window! If the pop up displays 6 images, the error is repeated 6 times in the system.log.

But clicking on the "Insert image", pointing to the same folder, the second or third time the error is not generated.

What is causing this?  How can I prevent this error from being generated?  Is this some how being cached?

Note: I have tried turning off all my third party extensions, but it produces the same errors.

2016-08-20T22:26:59+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /home/magento/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /home/magento/lib/Zend/Controller/Response/Abstract.php:768
[2] /home/magento/app/code/core/Mage/Core/Controller/Response/Http.php:84
[3] /home/magento/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] /home/magento/app/code/core/Mage/Core/Model/App.php:354
[5] /home/magento/app/Mage.php:684
[6] /home/magento/index.php:91
</pre>


texts:
everyone.
I need to calculate price in my store by formula:
price = ((cost in other currency) * (currency rate) + (fixed markup)) * (markup in percents) or (manual price) if set.
I found a few payable addons, that could help, but all of them can have only one type of markup for one product.
So it looks like I need to extend core functionality by my own. Is there other possibilities? If no, could you advise me something to get started?

Essentially i would like to add different currency prices and allow them to be converted by my base currency.
e.g shirt=$20 i must be able to add it as $20(creating an attribute called _foreign_price) on the csv as $ and once uploaded it should convert that price of the shirt to pounds.
Is this possible?


texts: Magento 1 EE 1.13 - 3 errors when adding new products (related to product view page)

texts:
I have three related problems when creating either new or configurable products in Magento. This occurs whether or not I create the products by running a CSV import or do it manually through the admin panel. I suspect (I could be wrong) that they are related and were caused by modifications to the core files made before I joined this project.

Version: EE 1.13

Theme: Default (but many undocumented customizations)

Problem #1: Price won't display at all on the front end product page (but is visible in the admin panel and the category grid).

this is what older looking items (that i did not create) display as.

this is how they look in the admin panel:

But, I have no idea how to duplicate this. Simply adding an identical custom option to a new product does nothing as far as displaying price. What's especially irritating is that sometimes I am able to create products that display price this way if I import items through CSV, and sometimes I am not. There doesn't seem to be any rhyme or reason as to why.

Problem #2: This (happens with both simple and configurable products). Actually this is the least of my worries since it's just a cosmetic issue and probably the easiest to fix but it sure is ugly.

Problem #3 is the biggest one as it interferes with operation of the site and makes it virtually useless to customers. When I try to add new products to the shopping cart, I get a "The product has required options" error. Lately this has been happening when I create any new product, no matter the method of creation. I have looked at the database tables and has_options/required is already set to zero, so what gives? I have no idea why this is happening or how to fix it.. other than manually copying pre-existing products and modifying them one at a time, which isn't really a practical solution. Please help!

Here is the CSV file structure I am working with:


texts: XS Vulnerability - Failed.XSS Patch not detected (APPSEC-1716)

texts:
I have checked magento security scan and i am getting the failed patch. can any one please let me know . How to fix this and how to apply patch . is there any way to do this?
Thanks


texts: Logging Magento 1.9 database queries. What doe the

texts:
With the below code, what does "#0000000005dc945b000055af41b2fb74#" from lines 5 and 6 represent? Is this related to the PID or session hash? Any idea.

This code is taken from database queries after editing the file "lib/Varien/Db/Adapter/Pdo/Mysql.php" as mentioned in https://firebearstudio.com/blog/the-complete-guide-to-magento-debugging.html

#5 Mage_Sales_Model_Quote[Mage_Core_Model_Abstract]#0000000005dc945b000055af41b2fb74#->save() called at [app/code/core/Mage/Sales/Model/Quote.php:1966]
#6 Mage_Sales_Model_Quote#0000000005dc945b000055af41b2fb74#->save() called at [app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php:380]
#7 Webshopapps_Adminshipping_Adminhtml_Model_Sales_Order_Create[Mage_Adminhtml_Model_Sales_Order_Create]#0000000005dc9424000055af41b2fb74#->initFromOrder(&Amasty_Orderattr_Model_Sales_Order#0000000005dc949d000055af41b2fb74#) called at [app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php:358]
#8 Mage_Adminhtml_Sales_Order_CreateController#0000000005dc97d2000055af41b2fb74#->reorderAction() called at [app/code/core/Mage/Core/Controller/Varien/Action.php:418]
#9 Mage_Adminhtml_Sales_Order_CreateController[Mage_Core_Controller_Varien_Action]#0000000005dc97d2000055af41b2fb74#->dispatch('reorder') called at [app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:254]
#10 Mage_Core_Controller_Varien_Router_Admin[Mage_Core_Controller_Varien_Router_Standard]#0000000005dc971c000055af41b2fb74#->match(&Mage_Core_Controller_Request_Http#0000000005dc971a000055af41b2fb74#) called at [app/code/core/Mage/Core/Controller/Varien/Front.php:172]
#11 Mage_Core_Controller_Varien_Front#0000000005dc97c6000055af41b2fb74#->dispatch() called at [app/code/core/Mage/Core/Model/App.php:354]
#12 Mage_Core_Model_App#0000000005dc9758000055af41b2fb74#->run(array('scope_code' => '', 'scope_type' => 'store', 'options' => array())) called at [app/Mage.php:684]
#13 Mage::run('', 'store') called at [index.php:89]```


texts: Magento2: Override issue for lib/web/jquery.js

texts:
I am trying to override below file in my custom theme.

  lib/web/jquery.js

Seems it been override. But It stop other jquery from working.

Due to this a lot of console error arise.

Here is my code

  app/design/frontend/custom/theme/requirejs-config.js

var config = {
    map: {
        '*': {
            'jquery':'js/custom-jquery'
        }
    }
};

I have placed my override file here:

  app/design/frontend/custom/theme/web/js/custom-jquery.js

Can anyone please suggest how to override lib/web/jquery.js properly.


texts: How to Render the container1 Block in controller

texts:
I have try this code in controller to render the block.

$layout         = Mage::getSingleton('core/layout');
$block_header  = $layout->createBlock('core/template_facade');
$block_header->setDataByKey('alias_in_layout','container1');
$block_header->setDataByKeyFromRegistry('options_container','product');
$block_header->append('product.info.options.wrapper');
$block_header->append('product.info.options.wrapper.bottom');
echo $block_header->toHtml();

But its doesn't render the blocks.

And my layout file is

<block type="core/template_facade" name="product.info.container1" as="container1">
   <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
   <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
   <action method="append"><block>product.info.options.wrapper</block></action>
   <action method="append"><block>product.info.options.wrapper.bottom</block></action>
</block>

how can i render block.

Assist me.


texts: What is the best way to include Amazon Payments into Magento?

texts:
We are looking for a way to include Amazon Payments to a Magento CE.

How would we best include them to an existing store?


texts: magento 2 get all products video gallery

texts: I need to get all videos in one page, How I can get all the videos or get all product that has video?


texts: subdomain.domain is redirecting to domain/subdomain

texts:
Anyone know what is going on?

Here is my .htaccess file (only rewrite conf):

RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^api/rest api.php?type=rest [QSA,L]

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]


texts: How get category ID of products on wishlist and compare pages

texts:
I want get category ID of products on wishlist and compare page (on wishlist and compare pages I add products of different categories).

On the helper of my module I write:

Mage::registry('current_category');

(and then ->getId())but I get NULL (on other pages - GOOD!)

When on the helper of my module I write:

Mage::getSingleton('catalog/session')->getLastVisitedCategoryId();

I get category Id of last category. It's wrong for me, becouse in wishlist or compare there are product of different categories.


texts: database upload from localhost to live server problem

texts:
I'm trying to move mac localhost Magento 2 DB and site to a live server using phpMyAdmin import. I've exported this DB to an .sql file. When I attempt to import I get this error:

#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

How do I correct this?

OK, I killed that error, now I'm getting:

What the? Is there some export / import setting I'm missing? I've never had this much trouble importing a DB.

I don't want to have to restructure the local DB out of concern for crashing the whole thing. Any suggestions are appreciated.


texts: Magento Database dump restore not working

texts:
I have got a dump of my live Magento database: it is 11GB in size and when I go to restore it, it does not do anyhting.

Shows these variables being set then says dump completed but no tables are actually being created, why is this ?


texts: Simple Configurable Products - add text before price of simple product

texts:
I am using the Simple Configurable Products extension.

Right now there is text before a configurable product price that reads "starts at"

How can I add text to precede the price of a simple product?

Can I limit that text to simple products in certain categories only?


texts: Index.php is stuck with name of site Name magento 2

texts: I get the name of Site glue with name odf Site like this : Siteindex.php and i can't get my admin url. error 404 not found on this server


texts: Magento 1.7.0.2 : How to redirect home page with specific account

texts:
I am kindda new with magento 1, so here is what i don't understand.
In admin, configuration is look like this:

So what i care about is Default Web URL and CMS Home Page, So i dont understand about these two, so as far as i know, CMS Home Page is just a page which call to a template.

But what is Default Web URL for? That's my side question
Okay, so my main question is How to  redirect home page with specific account.
Here is the problem,every NORMAL account after refresh the home page is redirect to CMS Home Page as i mentioned before, but for only one account i called "boss", its different, it redirect to a new url, called "boss_url".
Which mean after i refresh the home page, normal account go "example.magento.com" and boss go "example.magento.com/boss_url".

Is there some solution to do that?


texts: How to get sum of rows of different id's at a time?


texts: Try to get qty for a single product issue

texts:
I try to get qty for a single product which came from o grouped product after a finish my order

In my observer i can take the product name, id,price, attribute id and so on but i can't take the qty

I have the fallowing code in my observer:

   public function execute(\Magento\Framework\Event\Observer $observer)
{
      $order = $observer->getEvent()->getOrder();
      $order_id = $order->getIncrementId();
     foreach($order->getAllItems() as $item){
             $ProdustIds = $item->getProductId();
     // product name
     $proName[] = $item->getName();

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $customProduct = $objectManager->get('Magento\Catalog\Model\Product')->load($ProdustIds);

     $productAttributeId = $customProduct->getData('attribute_set_id');

    //get attribute set name for each product
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $attributeSet = $objectManager->create('Magento\Eav\Api\AttributeSetRepositoryInterface');
    $attributeSetRepository = $attributeSet->get($productAttributeId);
    $attribute_set_name = $attributeSetRepository->getAttributeSetName();
    $attribute_name = strtolower($attribute_set_name);

    //get prodcut price
    $productAttributePrice = $customProduct->getData('price');
    //product qty
    $productAttributeQty = $customProduct->getData('qty');
    $proQty[] = $item->getQty();

I  already tried  with  $productAttributeQty = $customProduct->getData('qty'); and

$proQty[] = $item->getQty()

But is not working.

Does anyone know where is the problem?


texts:
I have a web form on a Magento 1.9 website and would like the user to sign-up or login to submit the web-form. How can I can add the sign-up form on a static block? I will then place the static block place it in the web-form.

Static Block code: {{block type="core/template" template="custom.phtml"}}

Template custom.pthml file code: <?php if(!Mage::getSingleton('customer/session')->isLoggedIn()){ //customer not logged in. Redirect to login page? }else{ //customer is logged in. Show webform from static block or template. } ?>

Static block in webform HTML block: {{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="5"}}


texts: Magento 2: Is there any way to add bulk option add in attribute?

texts:
I have list of option value for attribute, But i just need to save this value in attribute at one time .

i already used below script, using this script i have to save attribute on every new option add.

$languageValues[0] = $item;
$attr = $objectManager->create('\Magento\Eav\Model\Entity\Attribute');
$attr->load($attributeShopbyID->getId());
$option = array();
$option['value']['shopbyattribute'] = $languageValues;
$attr->addData(array('option' => $option));
$attr->save();

instead of saving attribute every time i just need to save all option at once.


texts:
Not very experienced with Magento layouts, so forgive me, if the question is too vague.

I have defined a layout in config.xml similar to this:

 <page>
    <layouts>
        <campaign module="page" translate="label">
            <label>Campaign</label>
            <template>page/campaign.phtml</template>
            <layout_handle>campaign</layout_handle>
        </campaign>
    </layouts>
</page>

But I seem not the get the <layout_handle> definition correct, have tried define a separate file, using another handle, etc. Nothing seems to work, the default layout for the page (category) is always used.

Edit: the code is in module's config.xml. I wish to use my own layout instead of the catalog_category_default


texts: color swatches for products not working in magento 2

texts:
all the settings and attributes are proper yet the color swatches not working.
kindly help !!
product link : http://www.i-ranu.com/yellow-plain-western-crepe-dresse-for-girls.html


texts: Version 2.3 API Image Import with a path and not base64

texts:
I am using the catalogProductRepositoryV1 (/V1/products) for importing a bunch of products (about 9.000). We have a very high fluctuation of products per day/import. So I would like to import images separated of those calls. I know, that the "media_gallery_entries" can import a Base64 string of the image, but with hundreds of products it would simply take too long.

If I would upload the images to a specific folder, would there then be a way to just set a path + filename during the import of the products?

That would have a way better performance.


texts: How to remove block in view page in magento2

texts: I need to remove social shares from product view page in magento2


texts: How to Set “cash on delivery” per store view magento 2

texts: How to Set cash on delivery per store view Magento 2


texts:
I have this problem now:

  Fatal error:  Undefined class constant 'CHECK_USE_CHECKOUT' in
  /home/jwearfet/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php
  on line 652

How to fix this problem?

Another problem, I just can not access to the payment page, just stay at "continue" process, how to solve this?


texts: Adding a custom checkbox in sales orders admin grid

texts:
I want to add a checkbox on admin grid in sales order page. I want to have in between "New order Rss" and "export menu".

Having a hard time figuring out how to do this as I am quite new to Magento.

Here is what I have done up to now:

I created a module and from what I have read, I should avoid doing rewrites. So I am trying to work it out with observers.

Here is the config of my module:

<config>
    <adminhtml>
        <events>
            <core_block_abstract_prepare_layout_before>
                <observers>
                    <training_testing>
                        <type>model</type>
                        <class>Training_Testing_Model_Observer</class>
                        <method>coreBlockAbstractPrepareLayoutBefore</method>
                    </training_testing>
                </observers>
            </core_block_abstract_prepare_layout_before>
        </events>
    </adminhtml>
</config>

Here is my observer:

class Training_Testing_Model_Observer {

    public function coreBlockAbstractPrepareLayoutBefore(Varien_Event_Observer $event){

        $block = $event->getBlock();
        if(!isset($block)){
            return $this;
        }

        if($block->getType() =='adminhtml/sales_order_grid'){

            // should i set a new admin grid template here??

        }

    }

}

I am having a hard time trying to figure what should be my next step. Should I set a new template where I check if its the sales order grid block?

Added a link to show exactly where I want to have the checkbox.


texts: I have created a custom shipping method in Magento but my question how i can call a request from external gateway and read XML data in Magento shipping method .


texts: Why separately placing methods in interface instead of abstract class?

texts:
I want to delete Interface Mage_Shipping_Model_Carrier_Interface.

interface Mage_Shipping_Model_Carrier_Interface
{

    /**
     * Check if carrier has shipping tracking option available
     *
     * @return boolean
     */
    public function isTrackingAvailable();

    /**
     * Get allowed shipping methods
     *
     * @return array
     */
    public function getAllowedMethods();

}

And copy functions to isTrackingAvailable() &
getAllowedMethods() to abstract class
Mage_Shipping_Model_Carrier_Abstract.
and any  shipping method only extends like this

class Mage_Shipping_Model_Carrier_Freeshipping
    extends Mage_Shipping_Model_Carrier_Abstract

{
.......................some code...............

}

I think may be meaning less. But Can anyone explain what is wrong to do it like this?


texts: Invalid argument supplied for foreach() magento version 2.1.3

texts:
php bin/magento setup:upgrade

  [Exception]   Warning: Invalid argument supplied for foreach() in
  G:\workspace1\magento2-
  alexa\vendor\magento\module-store\Model\Config\Processor\Fallback.php
  on li   ne 121

  setup:upgrade [--keep-generated] [--magento-init-params="..."]


texts: Add to cart button is not working magento 1.9.2, after reload the page, product are showing already added.

texts:
Hello Everyone I hve a running store based on magento 1.9.2.1 Everuything was fine till yesterday. But today I ma shocked to see  that After click on add to cart button only ajaz loader gif is showing moving bit product didn't get added in minicart. But when I refreshed the page minicart is showing the product are already added in this.

Nothing find rediculous in system.log and exception.log
my web url is -

  https://www.berkowits.in

If anyone can help me in this please.


texts: Add an AND condition inside an OR condition

texts:
I have a collection that I have to filter according to multiple strings in one field. The trick is that one of the possible values in that field needs to be picked only if another field's value meets a certain condition.
For example:

$this->addFieldToFilter(
  'my_field1',
  array(
    'val1', |
    'val2', |  <--- This is the OR part
    'val3', |
    'val4 AND my_field2 like 'my_field2_val' // <-- This is the tricky part
   )
);

Can any of you guys help me?
PS: My collection is a flat one not EAV.


texts: What's the difference between getLastOrderId() and getLastRealOrderId()?

texts:
Does anyone have a quick and dirty explanation of the differences?

Mage::getSingleton('checkout/session')->getLastOrderId()

Mage::getSingleton('checkout/session')->getLastRealOrderId()

I generally would use getLastOrderId()


texts: How to retrieve custom attribute set ID by name

texts: I have created couple of custom Attribute Set and now I want to assign a group in those attribute sets programmatically, so is there any way to retrieve attribute set IDs based on name?


texts: Remove/hide product actions from category page via XML layout

texts:
for Magento 2.1, does anyone know the block name for the product actions in the category page?

I'm trying to add an XML layout update to a specific category via Products > Categories > specific category > Design > Layout Update XML

I would like to remove the block that contains the add to cart button etc for all products in a certain category.

I have tried this but it doesn't work...

<referenceContainer name="content">
    <referenceBlock name="product.info.addtocart" remove="true" />
</referenceContainer>

Ideally I'd like to remove the whole div that has a class of 'product-item-inner' or the div with class 'product-item-actions'.

I could probably do it with CSS but I'd like to remove it if possible?

Thanks


texts: Product URL issue in Observer Magento 1.9

texts:
I have create an Observer function which is call after product save but having some issues with product url.
Getting product like:
$product = $observer->getEvent()->getProduct();

Getting product url path:
**$product->getUrlPath();  //Return empty path**

$product->getProductUrl(); //Show error for function

//Finally I have used it
Mage::app()->setCurrentStore('default'); //set the default storeview
$url = Mage::helper('catalog/product')->getProductUrl($product->getId()); //get url for .html
Mage::app()->setCurrentStore('admin'); //set the admin store again

But now the issue is url is shown as :
https://local.com/index.php/catalog/product/view/id/290/s/surestep-pro-diabetic-test-strips-50-strips-professional-care/

instead of

http://local.com/surestep-pro-diabetic-test-strips-50-strips-professional-care.html

I want product .html url else url_path in observer.


texts: Magento 2.1.7 How to Create a multi-language store

texts:
How can i get to Create a multi-language store ?

As store view changes entire website language should change


texts: Magento 2.2.3: Create order in backend, add product had discount rule showing incorrect

texts:
I had some bug in backend magento 2.2.3
Steps to reproduce
1.Create a discount rule based on attribute set which have configurable products
2. Save & Apply rule
3.Run command reindex to apply catalog price rules
4.Open Backend Magento 2 : Go to Customers -> All customers -> Choosen one customer
5. Click Manage Shoping Cart -> Selected product has discount rule -> Click " Add selections to my cart " .
Expected result
Product has been added showing correct price with discount rule like in frontend. ( Discount 30% )

But in backend, price product showing incorrect

Backend :I tried to click " Update Items and Quantities" in backend, but product had price rule not updated price.
In Frotend
Price of product showing incorrect, but subtotal show correct price when product had discount rule.

I tried to reproduce in Magento 2.3. No error to show,price had discount rule showing correct , pls let's me some my mistake. Thanks!


texts: Magento 2.1 error: Class Magento\Framework\View\Element\Html\Search does not exist

texts:
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

I want to display the search bar above the top links, at the right of the logo:

For this purpose, I wrote the line below, in my default.xml file:

<move element="top.links" destination="header-wrapper" after="logo" />
<move element="top.search" destination="header-wrapper" before="top.links"/>

<referenceContainer name="header.panel">
  <block name="panel.top.links" class="Magento\Framework\View\Element\Html\Links" after="-">
    <arguments>
      <argument name="css_class" xsi:type="string">header links</argument>
    </arguments>
  </block>
</referenceContainer>

<referenceContainer name="header.panel">
  <block name="panel.top.search" class="Magento\Framework\View\Element\Html\Search" after="-">
    <arguments>
      <argument name="css_class" xsi:type="string">header search</argument>
    </arguments>
  </block>
</referenceContainer>

The <block name="panel.top.search" class="Magento\Framework\View\Element\Html\Search" after="-"> part produces the error: Class Magento\Framework\View\Element\Html\Search does not exist in the browser.

As you can see, on the website's homepage, the search box does not appear anywhere.

What am I doing wrong? How shall I change my code to make it work?


texts: Catalog Price Rule for Cross-sell product

texts:
I'm using Magento 1.9 and I'd like to do the following.

If the cart is a subtotal bigger than X amount, I'd like to discount a cross-selling item (or only show an item at a certain price). Else still show the cross-selling item but not discounted.

What would be the best way to go about this?


texts: Search Disappears from header when copy default.xml

texts:
So I copied public_html/vendor/magento/module-theme/view/frontend/layout/default.xml to public_html/app/design/frontend/<vendor>/<themeName>/Magento_Theme/layout/default.xml

I did not change the contents of default.xml

And yet the "default" search that lives in the header next to the logo disappears…

If I remove the <container name="header-wrapper"> section from new default search will pop back in.

This doesn't make any sense, since public_html/vendor/magento/module-search/view/frontend/layout/default.xml targets header-wrapper for the topSearch block.

So duplicated default.xml into my theme from the module shouldn't cause search to spontaneously no longer render?


texts: Magento 2.2 : How to programatically clear the varnish cache by cache tag

texts:
I need to switch the currency based on user IP location so I'm using this auto currency extension, it works only when I disabled the FPC otherwise it just cache the previous content and never gets changed.

I'm looking to programmatically clear the varnish cache by the cache tag of the store currency. I tried the below logic in the observer (controller_action_predispatch) but it does not work.

protected $config;
protected $purgeCache;

public function __construct(
    \Magento\PageCache\Model\Config $config,
    \Magento\CacheInvalidate\Model\PurgeCache $purgeCache
) {
    $this->config = $config;
    $this->purgeCache = $purgeCache;
}

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $tags = [];
    $pattern = "((^|,)%s(,|$))";
    $tags[] = sprintf($pattern, 'store');
    $this->purgeCache->sendPurgeRequest(implode('|', array_unique($tags)));
}

Thanks in advance.


texts: Magento2 : Check it is frontend or backend?

texts:
I want to check whether it is front or backend.
How can I do that?


texts:
I have changed my domain name. I want to redirect users when they type old URL...

suppose Old URL was: Google and New old URL is : googled

So when a user enters my old URL, it should redirect to new URL..

can we manage this through magento admin area?

or we have to write it in magento htaccess file?


texts: Why do some big extension companies choose not to use repositories while others do

texts:
We are currently installing extensions from different companies on our new M2 site.

Some companies (not gonna call names, don't know if that's allowed) just have you
 composer require their repository so you don't have to manually download any .zip files, composer does everything for you.

While others, you have to download the .zip file of the extension and composer require path to the zip files.

I am curious, why companies would possibly not choose to use repositories for client convenience?


texts: Is it possible to use a plugin for a Framework class?

texts:
I have written the plugin below but I can't seem to get it triggered.

<?php

namespace Vendor\ExtendedQuickSearch\Plugin;

use Magento\Framework\Search\Adapter\Mysql\Query\Builder\Match;

class QuickSearch
{
    public function beforeGetMatchQuery(
        \Magento\Framework\DB\Helper\Mysql\Fulltext $subject,
        $columns, $expression, $mode = self::FULLTEXT_MODE_NATURAL
    )
    {
        var_dump('Plugin1 - beforeGetMatchQuery');die;
    }
}

Any ideas?


texts: Call controller function on checkbox value change in Magento 1.9

texts: I have a checkbox in my page , if the user check the box means , then I need to call a function in controller and do some db operations. Can you please tell , how I achieve this


texts: Currently creating a product doesn't need any image. How do I make it required? Using javascript is ok. I know how to do it with input text field, but image is quite different.


texts: RequireJS components sometimes not loading

texts:
We are launching a Magento 2.1.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load, in which case a slider is not displayed and the console log shows error messages such as "Uncaught TypeError: $(...).swMegamenu is not a function".

How would we go about troubleshooting and resolving the source of these issues?


texts: Magento 2.2.2: Customer session not working with cache enable

texts:
I tried this code but when cache is disable. it works, but when I enable cache it does not work.

$ObjectManager = \Magento\Framework\App\ObjectManager::getInstance();
$session =  $ObjectManager->get('Magento\Customer\Model\Session');
if($session->isLoggedIn())
{
}


texts: Magento Fatal Error - setSaveParametersInSession() on a non-object

texts:
I tried to create an admin grid on magento.Get the error while click on the admin menu setSaveParametersInSession() on a non-object.

My Config.xml : path(\app\code\local\ORD\UpdatePro\etc)

<admin>
 <routers>
     <updatepro>
        <use>admin</use>
        <args>
           <module>ORD_UpdatePro</module>
           <frontName>admintest</frontName>
        </args>
     </updatepro>
  </routers>
</admin>
<adminhtml>
   <layout>
      <updates>
          <updatepro>
              <file>updatepro.xml</file>
           </updatepro>
      </updates>
   </layout>
   <menu>
      <updatepro translate="title" module="adminhtml">
         <title>updatepro</title>
         <sort_order>100</sort_order>
         <children>
             <set_time>
                   <title>Report</title>
                   <sort_order>0</sort_order>
                   <action>admintest/adminhtml_index</action>
              </set_time>

          </children>
       </updatepro>
   </menu>
</adminhtml>

My IndexController.php : Path(\app\code\local\ORD\UpdatePro\controllers\Adminhtml)

class ORD_UpdatePro_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
protected function _initAction()
{
    $this->loadLayout()->_setActiveMenu('updatepro/set_time')
            ->_addBreadcrumb('updatepro Manager','updatepro Manager');
   return $this;
 }
//END of initaction
public function indexAction()
  {
     $this->_initAction();
     $this->renderLayout();
  }
}

My Block Class Grid.php : Path(\app\code\local\ORD\UpdatePro\Block\Adminhtml)

class ORD_UpdatePro_Block_Adminhtml_Grid extends Mage_Adminhtml_Block_Widget_Grid_Container
{
  public function __construct(){
     $this->_controller = 'adminhtml_grid';
     $this->_blockGroup = 'updatepro';
     $this->_headerText = 'Adressbook management';
     $this->_addButtonLabel = 'Add a contact';
     parent::__construct();
 }
}

My Layout file updatepro.xml : Path(\app\design\adminhtml\default\default\layout)

<?xml version="1.0" ?>
   <layout version="0.1.0">
   <updatepro_adminhtml_index_index>
     <reference name="content">
      <block type="updatepro/adminhtml_grid"  name="updatepro" template="updatepro/afficher.phtml" />
    </reference>
   </updatepro_adminhtml_index_index>
</layout>

while click on the admin panel menu link i got the below error message

Fatal error: Call to a member function setSaveParametersInSession() on a non-object in C:\xampp\htdocs\staging_furryfriends\app\code\core\Mage\Adminhtml\Block\Widget\Grid\Container.php on line 69

it was a common error and found in many threads, Followed every steps carefully, unfortunately i am unable to figure out the problem and what was the error.
Expecting your kind explanation if any one can help me on this topic.


texts: Magento 2 - Override luma themes module less file

texts:
I try to override css code from the file vendor\magento\theme-frontend-luma\Magento_Checkout\web\css\source\module\_cart.less:
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .checkout-cart-index {
        .page-main {
            padding-left: @layout__width-xs-indent;
            padding-right: @layout__width-xs-indent;
        }
    }
...

So I created the file in my own theme and made my override
MY_THEME\Magento_Checkout\web\css\source\module\_cart.less.
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .checkout-cart-index {
        .page-main {
            padding-left: 35px;
            padding-right: 35px;
        }
    }
}

Then I executed grunt refresh but the change is not getting applied.


texts: Custom Stock status when product goes below X, Product specific

texts:
I want to show a custom stock status when a product reaches a certain amount.
The amount will be different per product and custom attributes will be added to the attribute set to get the information.

I am modifying product/view/type/default.phtml

Here is what I have:

$stock_limit = $_product->getstock_limit();
$actual_stock = $_product->/*the correct way to get stock?*/

        <?php if ($_product->isAvailable() && $stock_limit < $actual_stock): ?>

<?php echo $this->__('Limited:') ?> <?php echo $this->__(' Only ' . $actual_stock . ' items in stock') ?>

        <?php elseif ($_product->isAvailable()): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

       <?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

       <?php endif; ?>


texts:
I've searched for 2 hours how to set up a cronjob in Magento 2, without success.

I've tried it like the Magento Support Page suggested. I've logged into the SSH server of my provider with Putty.exe and tried to start the command:

crontab -u <Magento file system owner user name> -e

Of course with the Magento File owner name, but crontab can't be found as a command.

sudo or su for installing crontab doesn't work either. How do I install the cronjob then?

My PHP version is 7.0.1.


texts: Cart showing empty in safari only in ipad

texts:
We are using magento 1.5.1.0, In ipad - selected item not showing in cart when using safari browser.

Please help us how to solve it.

Thanks,
Kumar


texts: Magento 2 after customer login redirect to my orders failed to set login_redirect session

texts:
Steps to produce :

Login to customer
click on my order link

This redirects to login page again(Session not able to handle login)

  This happens only on FIREFOX browser.

I need proper solution which can be solved by programatically.

  Note : I have tried to set "network.http.response.timeout" and it's working but I can not tell each customer to do so.


texts: Install extension using composer Magento 2

texts: I'm using magento 2 , and I'm trying to install an extension from  composer.json file , now I've installed composer through SSH , but I'm new to composer installations , how do I proceed now with the installation ?


texts: Magento 2 UI Component conflicts between observable value

texts:
I try to add UI Component to product item on product list due to difficult FE login for each item. But I was wondering when conflicts between components appeared. All components for each item has a unique name.

This is an example how I try to implement it:

Added div with scope to list.phtml and added script for each item:

<div class="test-component" data-bind="scope: 'test_<?= $_product->getId() ?>'">

Then I added JS Component test-component.js:

define([
    'jquery',
    'uiComponent',
    'ko'
], function ($, Component, ko) {
    return Component.extend({
        testObservable: ko.observable(1),

        initialize: function() {
            this._super();
        }
    });
});

Finally added HTML template test-component.html

    <input type="text"
           data-bind='value: testObservable'
           class="input-text qty" min="1"/>

As a result, fields display for each product and observable works but when I change it for one item it changes for all items:

The real example is much more complex but this is an example of a problem. Maybe UI components don't a good solution?
As a solution, I can call some JS method on changing and set it to some observable object with the productId key but it looks weird when observable value shares between components.

Thanks.


texts: Magento 2 : When I special price bulk update price sorting is not working

texts:
My site has just configurable products only.
I want to sort by price. For products so when users sort products by price, sorting looks wrong.
So I have checked so Price(Low to High) Sorting not working correctly with the special price.
Please let me know if you have face the same issue as this.

Your help and answers are appreciated!
Thanks in advance!


texts: Configurable product set variant per store view

texts:
I have cloths website, with multi store view for french, germany etc. For a configurable product with attributes like say color, size say:

Size: M, L, XL
Color: red, green, yellow, black

I have created that configurable product and it works absolutely fine. Now the requirement is say for france, the shirt is available in color green and black with size L only. So when a visitor selects france, it will only show these options only to select and not other options, and same for other store.
Is there is any way or any other module/extension to manage it?


texts: Custom Exceptions for module for Magento 2

texts:
There are a few good-answered questions like this for Magento 1, but I haven't found anything for Magento 2.

What should be the way for adding in custom module custom Exception class. Can I add some constant message renedered when custom exception is catched? I have foun 'heart' of exceptions in magento/framework/Exception, but I am not sure if this is place which I should extend from, because there can be found some exception classes in symfony vendor.

Are there any good practices for Magento 2 for custom Exceptions or do you think it is not worth adding our own exceptions and we should just customize message displayed or logged?


texts: Force to show the billing address form on checkout

texts:
What I want to do is to force user to fill out the billing address on step two at checkout.

In my javascript file I've added a subscription:

quote.billingAddress.subscribe(function (billingAddress) {
    billingAddress.isAddressDetailsVisible = function () {
        return false;
    }
});

The problem is that the in the file:

vendor/magento/module-checkout/view/frontend/web/js/view/billing-address.js

there is a subscription too:

quote.billingAddress.subscribe(function (newAddress) {

and in line 104:

this.isAddressDetailsVisible(true);

And this subsciption is running after my subscription so the value always  will be true, and the form not shown.

Is there a method to force this to set false? I want to show the form anyway.


texts: What is the best way to go about removing unnecessary fields during the billing process as Guest? How i can Removing mandatory validation of email field in Guest checkout Case


texts: Magento 2 : Add gift message block to billing step in onepage checkout

texts:
I am trying to add gift option section on checkout page.

I called gift option by following code. in checkout_index_index.xml

<referenceContainer name="content">
        <block class="Magento\GiftMessage\Block\Cart\GiftOptions" name="checkout.cart.order.actions.gift_options" template="cart/gift_options.phtml" cacheable="false">
                <arguments>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="types" xsi:type="array"/>
                        <item name="components" xsi:type="array">
                            <item name="giftOptionsCart" xsi:type="array">
                                <item name="component" xsi:type="string">Magento_GiftMessage/js/view/gift-message</item>
                                <item name="config" xsi:type="array">
                                    <item name="template" xsi:type="string">Magento_GiftMessage/gift-message</item>
                                    <item name="formTemplate" xsi:type="string">Magento_GiftMessage/gift-message-form</item>
                                </item>
                                <item name="sortOrder" xsi:type="string">1</item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>

And it display in last.
But I want this section in payment methods brfore payment selection like this.

How can I achieve this.


texts: How to group products by attribute in product list?

texts:
Is there a way to display products of category so that products are grouped by an attribute?

For example if we have a car parts shop and we want to display all parts that belong to certain car model and we want the products to be divided into sections by the type of the part (brakes, motor parts...). That way it would be easier for customers to scan the listing when the same type of products would be grouped together.


texts: Magento 2: Minicart update product id issue with CustomerData

texts:
I am showing a popup on click of checkout when these two products(81, 83) added in the mini cart and this is working fine. Now I have added the 81 products and any other products in the cart. But when I deleted 81 from the cart and other products are showing in the cart then clicking on checkout still showing the popup.
var resultItems = customerData.get('cart')().items;
                    $('#top-cart-btn-checkout').click(function (event) {
                        _.each(resultItems, function (item, key) {
                             console.log('testing');
                             console.log(item.product_id);
                            var myArray = ['81', '83'];
                                if(_.contains(myArray, item.product_id)) {
                                    jQuery('#mini-cart-popup').show();
                                    jQuery(this).prop('disabled', true);
                                }
                        }, this);
                    });

Here is the console output.
Showing array results multiple times. I am not getting what's going on.


texts:
i have this code

$product_model = Mage::getModel('catalog/product')->getCollection()
            ->setPageSize(5)
            ->setOrder('entity_id', 'DESC')
            ->addAttributeToFilter('attribute_set_id', array('in' => array('4', '12')))
            ->addAttributeToFilter('price', array('gteq'=>80))
            ->joinField(
                'qty',
                'cataloginventory/stock_item',
                'qty',
                'product_id=entity_id',
                '{{table}}.stock_id=1',
                'left'
            );

        $product_model->getSelect()->joinLeft(
            array('_inventory_table' => $product_model->getTable('cataloginventory/stock_item')),
            "_inventory_table.product_id = e.entity_id",
            array('is_in_stock', 0)
        );

I want to get all the products that out_of_stock

How can this be done in my request?

and how can my code be optimized?


texts: Remove attribute from layered navigtaion for one category?

texts:
I'm trying to remove/hide the price attribute from layered navigation for a certain category which has all configurable products. Reason is because the price attribute is only considering the config.'s associated products price but not the price of the config. product itself.

How can I remove the price attribute in layered navigation for just one category?


texts:
How can I update shipping methods on checkout with changes in zipcode input?

My shipping methods are not updating with zipcode input change value. Only with page refresh.


texts: Magento 2: Message displays After disable Product Review Module "Attention: Something went wrong"

texts:
I'm using Magento 2 CE Version 2.1.1.

As per requirement i don't need "Product Review" Module. So i disable from Admin & Clear Cache

When i Edit any of the Admin Product then it says

  "Attention: Something went wrong"

If i enable Product Review Module again then it works fine.

On product detail page we have "Product Reviews" tab, may be they are not checking.

If Review Module is Disabled then we don't need to show this tab.


texts: Adding template File in customer account page

texts:
I am adding one phtml file in customer account dashboard index page. I have used the code as

<customer_account_index>
    <reference name="customer_account_dashboard">
      <block type="ecustomers/myphtml" name="myphtml_page"  after="customer_account_dashboard_hello" template="ecustomers/myphtml.phtml" />
    </reference>
</customer_account_index>

And I want to show the phtml after the hello.phtml  in user dashboard.

If I use <reference name="content"> handle then it shows my phtml content but if I use <reference name="customer_account_dashboard">  handle it does not show the my phtml file.

I think we can use the reference for the block which we want to update as I want to update the customer_account_dashboard so I referenced it. Please let me know if I am wrong in here.


texts: Creating static block by custom module magento2

texts:
How to create a Static block for custom module creation in magento2

Thanks


texts: Magento1.9 - AWS SES not working with Magento1.9 SMTP extension

texts:
I'm getting the below error message while sending an email using Amazon SES in Magento1.9.2.4(Aschroder SMTPPro extension).

I'm using the same credentials in Magento2.3(Mageplaza SMTP extension) which are working.

I think the below code is used to get authentication key:

<?php
private function _buildAuthKey($date){
    return sprintf('AWS3-HTTPS AWSAccessKeyId=%s,Algorithm=HmacSHA256,Signature=%s', $this->_accessKey, base64_encode(hash_hmac('sha256', $date, $this->_privateKey, TRUE)));
}
?>

Thank you.


texts: Magento 2 CSS - Trying to target home page only with .cms-home but styling affects other pages too

texts:
I am using the Magento 2.1.6 blank theme as a base for my own theme which is working correctly.

However, I want to add CSS code to target the home page only and not affect any other pages.

I have added this to _theme_extend.less (which I think is the correct location):

.cms-home h1, h2, h3, h4, h5, h6, p {
    padding-left: 30px;
    padding-right: 30px;;
}

However, when I go to another CMS page (which definitely does NOT have the class cms-home) it still picks up the padding and applies it. Here's a screenshot showing what the browser is rendering:

Can anyone help with what I have done wrong?


texts: How to get all customers ever paid/complete an order

texts:
I am working on a custom Magento Extension.

Here is how i take all customers in a customer group:

                $customers = Mage::getModel('customer/customer')
                                    ->getCollection()
                                    ->addAttributeToSelect('*');

                foreach($customers as $customer)
                {

                    $email=$customer->getEmail();
                    $CustomerPhone = $customer->getPrimaryBillingAddress()->getTelephone();
                    $CustomerName = $customer->getName();
                    $CustomerEmail = $customer->getEmail();
                 }

This how i get information about the users in a specific customer group.

My question is how i can get all the users ever paid or complete(for example) an order ?

Is it even possible, and if so how ?

Thanks in advance!


texts: How to insert custom link before last menu in magento 2?

texts:
I have 5 categories in main menu and want to add custom link in between menu.

How can I add this?

For example:

Menu1  Menu2 Menu3 Menu4 Custom_Link(Static) Menu5

Code Is:

        <?php /* @escapeNotVerified */ echo $_menu; ?>

<a href="<?php echo $block->getUrl('custom')?>"><?php echo __('Our story')?>

<a href="<?php echo $block->getUrl('custom1')?>">

<img src="<?php echo $this->getUrl('pub/media/wysiwyg/') ?>custom1.jpg" />

<?php echo __('custom1') ?>

<a href="<?php echo $block->getUrl('custom2')?>">

<img src="<?php echo $this->getUrl('pub/media/wysiwyg/') ?>custom2.jpg" />

<?php echo __('custom2') ?>

        <?php /* @escapeNotVerified */ //echo $block->getChildHtml(); ?>


texts:
I have certain products that we can only deliver in our local city. All our other products can be distributed throughout the entire country. When you go to checkout in our store you’ll see the option to deliver locally, and the option to deliver throughout the country.

Now I want to make the “deliver throughout the county” invisible for the products that aren’t allowed to be shipped outside our city. Is there a way to do this? Can I set certain shipping methods only for certain products?

I really hope someone can help me out.

Thank you,

Etienne


texts:
Title says it all. Persistent Shopping Cart settings are as follows:

Enable Persistence
Yes
Persistence Lifetime (seconds)
31536000
Enable "Remember Me"
Yes
"Remember Me" Default Value
Yes
Clear Persistence on Log Out
No
Persist Shopping Cart
Yes

This problem only occurs when a guest registers, logging into an account that had previously been created works just fine.

Please let me know if I need to provide further details or any specific code.

Please help!
Thanks


texts: Consistent 404 from custom module URL... Why?

texts:
I'm trying to make a really simple module to add the Category Thumbnail back to Magento 2.2.1 and having a real time with it. I've been working on this simple issue for many hours, and read many pages with no real progress.

Here's my app/code/Tridium/Thumbnail/etc/adminhtml/routes.xml file:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="thumbnail" frontName="thumbnail">
            <module name="Tridium_Thumbnail" />
        </route>
    </router>
</config>

And my app/code/Tridium/Thumbnail/view/adminhtml/ui_component/category_form.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="thumbnail">
            <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">category</item>
                    <item name="label" xsi:type="string" translate="true">Category Thumbnail</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="formElement" xsi:type="string">fileUploader</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="required" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">40</item>
                    <item name="uploaderConfig" xsi:type="array">
                        <item name="url" xsi:type="url" path="thumbnail/image/upload"/>
                    </item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

The controller is at app/code/Tridium/Thumbnail/Controller/Adminhtml/Image/Upload.php.

The thumbnail image field appears just fine on the Category Form, but it will not upload because the URL continually throws a 404.

The URL it is attempting to upload the file to looks like:

<admin_path>/thumbnail/image/upload

Please, any thoughts about this?

I've looked around to see if there is a way to output all the parsed routes, but there doesn't seem to be. It seems that would be a really helpful addition to the magento binary...


texts: How to select all fields in multi-select on single click in magento 1.9

texts:
I am working in magento 1.9 . I am making a muliselect field. I want to select all fields on single click . Did magento 1.9 gave such tag by default ? .
My code in system.xml looks like .

<serviceOptions>
    <label>Domestic Services </label>
    <frontend_type>multiselect</frontend_type>
    <source_model>FedExSmall/Source_FedExSmallServices</source_model>
    <sort_order>12</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <can_be_empty>1</can_be_empty>
    <show_in_store>1</show_in_store>
</serviceOptions>

Thank you in advance !


texts: Magento 2: "404 Not Found" when calling a controller

texts:
I created a simple module, it is registered and shows up in Stores -> Configuration -> Advanced -> Advanced, then I created routes.xml and Display.php.

app\code\Jurgis\Twilio_settings\etc\frontend\routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="Jurgis" frontName="Twilio_settings">
            <module name="Jurgis_Twilio_settings" />
        </route>
    </router>
</config>

app\code\Jurgis\Twilio_settings\Controller\Index\Display.php

<?php
namespace Jurgis\Twilio_settings\Controller\Index;

class Display extends \Magento\Framework\App\Action\Action
{
  public function __construct(
\Magento\Framework\App\Action\Context $context)
  {
    return parent::__construct($context);
  }

  public function execute()
  {
    echo 'Hello World';
    exit;
  }
}

But when I go to: "http://localhost/magento2/Twilio_settings/index/display" I get the 404 not found error. What have I done wrong?


texts: Does anyone know how I can change H1 and H2 tags in Magento 1.9 on the product and category pages?

texts: I understand the H1 pull through from the meta title but would like to tweak it and add H2.


texts: Move breadcrumb before sort by feature of toolbar section in Magento2

texts:
How to move breadcrumb of category list page into toolbar section of category list page.

I need to move the breadcrumb to toolbar or either left sidebar before the filters.

Is it possible to do like that? Please anyone suggest me. Below code i used to move breadcrumb.

<move element="breadcrumbs" destination="content" before="-" />

from above code i am able to move it before the toolbar, but i need to move it into side bar.

Like this i want it.


texts:
I have create observer which sends the email. The email is working file but the problem is with the logo. I have added the logo for the all email. All the emails including the sales order shows me the new logo which i updated. Only this one doesn't.

Here is my observer code

    $enableEmail = $this->config->getGeneralConfig('email');
    $ccEmail = explode(",",$this->config->getGeneralConfig('cc_email'));

    $templateOptions = array(
        'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
        'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
    );

     $fileName = "Order #".$orderId.".pdf";
            $transport = $this->transportBuilder
                ->setTemplateIdentifier($template)
                ->setTemplateOptions
                (
                    $templateOptions
                )
                ->setTemplateVars($content)
                ->setFrom($sender)
                ->addTo($email)
                ->addAttachment($generated_file->render(), $fileName)
                ->addCc($ccEmail)
                ->getTransport();
            $transport->sendMessage();

Here is the template header which is responsible to show logo.

      {{template config_path="design/email/header_template"}}

The above code is there in sales order. But sales order show the correct logo.


texts: installation of magento2 step 1 have 500 error

texts:
When i check the log error the following errors are showing:

  [24-Oct-2016 13:04:59 UTC] PHP Fatal error:  Uncaught exception 'Zend\Stdlib\Exception\RuntimeException' with message 'No wrapper found supporting "UTF-8"' in /home/brasilmart/public_html/vendor/zendframework/zend-stdlib/src/StringUtils.php:135
  Stack trace:


texts: Why does one of many attributes does not get updated with SOAPv2 WS-I?

texts:
I'm using Magento CE 1.7.0.2 with SOAPv2 and WS-I.
I'm trying to update products with the catalogProductUpdate-Method.

The description in the code example below gets updated, but the manufacturer-attribute (=select) doesn't.
The result of catalogProductUpdate is bool(true).

I tried some (not too good, but I'm desperate ;-) ) variations such as:

assign the integer value 777 to $manufacturer->value set the value
within/without the additional_attributes field set the product id (but I'm sure it need's to be set within additional_attributes)
set the manufacturer-name as $manufacturer->value instead of the value 777

Code:

$newProductData = new stdClass();
$additionalAttrs = array();

$manufacturer = new stdClass();
$manufacturer->key = "manufacturer";
$manufacturer->value = "777";
$additionalAttrs['single_data'][] = $manufacturer;

$newProductData->description = "Description Test1";
$newProductData->additional_attributes = $additionalAttrs;

$result = $client->catalogProductUpdate((object)array('sessionId' => $sessionId,
        'productId' => "2110000010058 ",
        'productData' => (object)$newProductData,
        NULL,
        'sku'
    ));

Edit:

I tested it with SOAPv2 without WS-I - works fine.
I also created another attribute for testing with the same settings (Dropdown, Scope,...) which also doesn't get updated with SOAPv2 WS-I but does with SOAPv2. So these newly created attributes behave as the manufacturer-attribute.
Trying to set the value of a text-field within the additional_attributes doesn't work either.

Any ideas, links, suggestions on this?

Link:
http://www.magentocommerce.com/api/soap/catalog/catalogProduct/catalog_product.update.html


texts: Sorting products on price and tier price

texts:
In the catalog product list i'm using the sort on price option. But somehow this option doesn't add the Tierprice in the sorting. So when I order on price i see the following:

€ 6,40
€ 6,50
From € 5,50 (this is the cheapest price)
€ 6,60

And I would like to achieve the following:

From € 5,50 (this is the cheapest price)
€ 6,40
€ 6,50
€ 6,60


texts: Magento 2 - How to properly load quote model by quote id?

texts:
I used to load the quote like this:
$quote = $this->quoteModel->load($quoteId);

But now I get a warning in PhpStorm saying that this method is deprecated:

Deprecated:
100.1.0 because entities must not be responsible for their own loading. Service contracts should persist entities. Use resource model
"load" or collections to implement service contract model loading
operations.

So I tried it like this:
use \Magento\Quote\Model\Quote;
use \Magento\Quote\Model\ResourceModel\Quote as QuoteResourceModel;

...

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

/**
 * @var \Magento\Quote\Model\ResourceModel\Quote
 */
protected $quoteResourceModel;

...

public function __construct(
    Quote $quoteModel,
    QuoteResourceModel $quoteResourceModel
) {
    $this->quoteModel = $quoteModel;
    $this->quoteResourceModel = $quoteResourceModel;
}

...

$quote = $this->quoteResourceModel->load($this->quoteModel, $quoteId);

$logger->info($quote->getId());  // empty

But $quote->getId() returns nothing, so it failed.
Another Attempt:
use \Magento\Quote\Model\QuoteFactory as Quote;
use \Magento\Quote\Api\CartRepositoryInterface;

...

protected $quoteModel;
protected $cri;

...

public function __construct(
    Quote $quoteModel,
    QuoteResourceModel $quoteResourceModel
) {
    $this->quoteModel = $quoteModel;
    $this->cri = $cri;
}

...

$q = $this->quoteModel->create();
$quote = $this->cri->load($q, $quoteId);

$logger->info($quote->getId());  // empty


texts:
Is there any way to export the values of "Description" for Default Store View into a csv ?
I run a export but it is showing only the Description content of the Default Scope .
Im able to see the values in database by running
 select * from catalog_product_entity_text where store_id = 1 . But i want them in a csv .


texts: What will be the $product->getFinalPrice()?

texts:
A configurable product having prices as [10,12,15,15].

What will be output of the $product->getFinalPrice() ?


texts: Why are we sending the POST data as JSON in jQuery

texts:
I need to send data into controller. So I have to use ajax call to send it.

$.ajax({
       url: self.options.link,
       data: {product_id: product, form_key: formKey, email: emailId, mobile: mobNo}
});

Why and when we use the data:JSON.stringify({}); and data:{} for sending post data via ajax.

$.ajax({
       url: self.options.link,
       data: JSON.stringify({product_id: product, form_key: formKey, email: emailId, mobile: mobNo})
});

Thanks.


texts:
I need to apply a Tier Pricing by 10 Units. But not for unit number 11. Just by group of 10 units or 20 o 30. This is because we offer discount by closed package.
And the package contained 10 units. We don't want to discount the other units that doesn't fits in a closed package.


texts: Magento2: redirection problem from observer or Logging Out from two application at same time from observer

texts:
I am trying to logout from two applications

I have a logout observer, where I am trying to logout from external application and also from Magento.

Here Problem is

  when I am logged out from the external application successfully, But not able to logout from Magento2 application.
  when I am logout from Magento2 application successfully, But not able to logout from external application

What I tried

\app\code\Mycompany\Customerhomepage\etc\frontend\events.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/framework/Event/etc/events.xsd">
    <event name="customer_logout">
        <observer name="mycompany_mymodule_customer_logout" instance="Mycompany\MyModule\Observer\Customerlogout"/>
    </event>
</config>

\app\code\Mycompany\MyModule\Observer\Customerlogout.php

Here below code after setRedirect, I used die();. It will logout from external application successfully not from Magento2 application.

<?php

namespace Mycompany\MyModule\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\UrlInterface;
use Magento\Framework\App\ResponseFactory;

/**
 * Class customerlogout
 * @package Mycompany\MyModule\Observer
 */
class Customerlogout implements ObserverInterface{
    protected $_responseFactory;
    protected $_url;

    /**
     * @param UrlInterface $url
     * @param ResponseFactory $responseFactory
     */
    public function __construct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
    }
    /**
     * @param Observer $observer
     * @return void
     */
    public function execute(Observer $observer)
    {
        $customerBeforeAuthUrl = $this->_url->getUrl('http://example.com/logout.php');
        $this->_responseFactory->create()->setRedirect($customerBeforeAuthUrl)->sendResponse();
        die();

    }

2nd by changing die(); to $this. this logout from Magento2 not from external application

<?php

namespace Mycompany\MyModule\Observer;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\UrlInterface;
use Magento\Framework\App\ResponseFactory;

/**
 * Class customerlogout
 * @package Mycompany\Customerhomepage\Observer
 */
class Customerlogout implements ObserverInterface{
    protected $_responseFactory;
    protected $_url;

    /**
     * @param UrlInterface $url
     * @param ResponseFactory $responseFactory
     */
    public function __construct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
    }
    /**
     * @param Observer $observer
     * @return void
     */
    public function execute(Observer $observer)
    {
        $customerBeforeAuthUrl = $this->_url->getUrl('http://example.com/logout.php');
        $this->_responseFactory->create()->setRedirect($customerBeforeAuthUrl)->sendResponse();
        $this;

    }


texts: Magento 1.9 set default 'Qty' to 100 and 'Stock Availability' to Blank

texts:
In magento 1.9 I need to set the default qty value to 100 and Stock Availability to blank while creating a duplicate product.

So when a user duplicates a product, he should see qty value as 100 and Stock Availability as blank within inventory tab.


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

texts:
After deleted custom attribute and getting

  Fatal error: Uncaught Error: Call to undefined method
  Magento\Customer\Model\Indexer\Source::addAttributeToSelect() in
  /vendor/magento/framework/Indexer/Handler/AttributeHandler.php on line
  38

Is this bug in Magento 2.2.3? (https://github.com/magento/magento2/issues/10838)


texts: How can I overwrite vendor/Magento/framework/View/Element/Html/links.php file?

texts:
How can I override following function??

protected function _toHtml()
    {
        if (false != $this->getTemplate()) {
            return parent::_toHtml();
        }

        $html = '';
        if ($this->getLinks()) {
            $html = '<ul' . ($this->hasCssClass() ? ' class="' . $this->escapeHtml(
                $this->getCssClass()
            ) . '"' : '') . '>';
            foreach ($this->getLinks() as $link) {
                $html .= $this->renderLink($link);
            }
            $html .= '</ul>';
        }

        return $html;
    }


texts: Magento 2.0 How to apply One product Custom Option to all Catalog Products

texts: I have set custom option in one catalog product. Now i can import this custom option to another product by editing that product custom options. But i want to import this custom option to all catalog products.


texts: Set shipping address issue with shipping.js : M2

texts:
{"message":"Error occurred during \"shipping_address\" processing.
  Error occurred during \"street\" processing. Invalid type for value:
  \"string\". Expected Type: \"string[]\".","trace":null}

Getting above error when i'm trying to set shipping address in shipping.js file.

shipping.js

setShippingInformation: function () {

                    //alert('trtrt');
                        var shippingAddress = quote.shippingAddress();
                        shippingAddress.firstname = 'gggg';//$('[name="pickup_name"]').val();
                        shippingAddress.lastname  = 'hhhhh';//$('[name="pickup_lastname"]').val();
                        shippingAddress.street    = 'Abcd street';//new Array(place.street);
                        shippingAddress.city      = 'Los Angeles';//place.city;
                        shippingAddress.countryId = 'US';//place.country_id;
                        shippingAddress.telephone = '1234512345'; //+place.telephone;
                        shippingAddress.region  = "illionis";
                        shippingAddress.regionId  = "12";
                        shippingAddress.postcode  = '45454';//place.postcode;

                        selectShippingAddress(shippingAddress);
                        quote.shippingMethod('mpcustomshipping');

                        selectShippingMethodAction('mpcustomshipping');

                        setShippingInformationAction().done(
                                function () {
                                    stepNavigator.next();
                                }
                        );
            },

rest/default/V1/guest-carts/f3fea8d0bef3344599bfc3467da43139/shipping-information

<response>
<message>Request does not match any route.</message>
<trace/>
</response>


texts:
How is it possible to add to Magento 2 fonts font-display: swap ?

I don't find the correct way in the typography.less, or in a custom CSS file, it breaks all the CSS.

.lib-font-face(
    @family-name: @font-family-name__base,
    @font-path: '@{baseDir}fonts/opensans/semibold/opensans-600',
    @font-weight: 600,
    @font-style: normal
);

Thank you for your ideas!


texts:
I have an issue with the reinitialization of the password.
When the user asks to renew the password, he receives the email (until now, all is working).
When he clicks on the button, he access to the website but with the error message "the link has expired" so he cannot update/change his password.
My Magento website is 2.2.7, has not so much installed extensions, and none of them should surcharge the password feature.

How can I solve this issue ?


texts:
I've checked Varien_Data_Form_Element_Multiselect and I don't see any support for such a thing, but I thought I'd ask my peers: Is there any built-in way to provide a default value to a Widget Form multiselect?

I have a store selector, and I want All Store Views to be selected by default. I know that I could set store_id to have a default of 0 in my database table, but the UI still asks the user to select a value when first creating an entry.


texts: Magento 2.3 - Render billing address in checkout sidebar

texts:
I want to render the billing address inside the checkout sidebar, above the shipping address.

How can I achieve this?


texts: Magento 2.1.9 - Custom Module tab not showing

texts:
I have followed different posts in order to get the solution and the tab working, but It doesn't show up.

I have followed this ones:

Custom admin configuration tab not showing Magento CE 2.1

Magento Custom Module Not Showing

Not even the ones that they put as an example, here is the code:

module.xml:

    <?xml version="1.0"?>

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="MSP_ReCaptcha" setup_version="1.4.11"/>
</config>

acl.xml

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="MSP_ReCaptcha::config" title="Google ReCaptcha" sortOrder="50" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

system.xml:

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="msp_tab" translate="label" sortOrder="1000">
            MSP_SECURITY
        </tab>

            <class>separator-top</class>
            Google ReCaptcha
            <tab>msp_tab</tab>
            <resource>MSP_ReCaptcha::config</resource>

            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
                   showInStore="1">
                General
                <field >

                </field>
            </group>

    </system>
</config>

I run these commands:

rm -rf pub/static/*;
php bin/magento setup:upgrade;
php bin/magento cache:flush;


texts: Magento2 : Facing proble with call custom jquery function in Backend

texts:
I have to call custom jquery function into Magento backend (sales > Order > View)

I have created custom js in adminhtml/web/js/order_status_validation.js

require(['jquery'], function(jQuery){
jQuery(function(){

    function do_validation_history() {
        alert('Coming');
        return false;
    }

  });
});

While we can click on submit button we are getting an error like

 ReferenceError: do_validation_history is not defined

I have called custom js into sales_order_view.xml

Can anyone know how we can resolve this error?


texts: Language store switcher redirect on home page

texts:
I have five language store switcher drop-down

EN store is my base store

when click on cms page then showing cms page with content

after cms page when click on different store (FR) then its redirect on home page

I have already created store wise cms page

anyone can help me in this how to redirect with correct cms page with store wise

anyone help here, thanks in advance


texts: Not able to store four decimal values in custom_price & price columns in Quote_item table

texts: I am trying to save four digit value after decimal (0.5312) to custom_price and price columns in quote item table but it is saving only two digits after decimal (0.53)


texts: change in JS file not reflected in magento frontend

texts:
I have made a change in opcheckout.js file but the change is not reflected in frontend.
I have flushed magento cache, cache storage, Javascript/CSS cache, Purged Varnish but the change is not at all reflecting in the frontend.
I inspected the element and looked into the JS file and it shows the older one in firebug.
Can anyone please tell me some way to get the change done in JS file to be reflected in live?


texts: Website Continously loading but nothing show

texts: When i hit main domain name or any other page link website starts loading but it shows nothing and keep loading.its magento 1..Any luck


texts: How to add Promotional Rule to the Orders Grid in Magento?

texts: I would like to show Promotional Rule applied or used for an order in the orders grid as a column in admin panel. How do I do this? please help me in this.


texts: Display calculated price by catalog promotion rule on products list page

texts:
Is this a way to display product's calculated price by catalog promotion rule (not special price) on products list page?

Thanks


texts: Please help me to add a block in the red area like on the image. Thank you

texts: Help me to add a cms block in the red area like above image (after sidebar) by checkout / index / index. Thank you for your help


texts: How to get a simple product's value of configurable attribute

texts:
I have a configurable product. I need a function that when given the product id of one of it's children products, will return the configurable attribute value it applies to the parent configurable product.

To rephrase the question. I have a configurable product with a size attribute of size, and it has three children products, one for small, medium, and large. When I get the product id of the small child product, how I can I get value of the size attribute. This should ideally be attribute agnostic, so I don't need to know beforehand that I'm getting the size attribute, it should be whatever configurable attribute applies.

I have tried the following.

$productAttributeOptions = $parent_product->getTypeInstance(true)->getConfigurableAttributesAsArray($parent_product);
$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
    foreach ($productAttribute['values'] as $attribute) {
        $attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
    }
}

This gives me all the attributes for a configurable product, being small, medium, and large. Passing in the current product gives an error, because the getConfigurableAttributesAsArray function is only available to configurable products.

Searching google and stack gives me results on how to do things such as get all configurable attributes, get a specific already known attribute, and so on.

Update: To clarify, my question specifies that I shouldn't need to specify the name of the attribute, and need to return all configurable attributes regardless of name. Getting attribute from simple products of configurable products does not apply. In the answer it includes this code to make it work. addAttributeToSelect('color')-> groupByAttribute('color')