texts: Adding custom link and page in my account page

texts: how can a link with a workable page be created in the my account menu????


texts: cart no, city and buttons are showing incorrect in Magento 2.2.7

texts:
Some how the city is not displaying during the cart summary. Also, another address is not clickable anymore, it is just an empty box.
I have checked with the repo, and it seems that all files are identical.

The city should display right next to the postal code.

Is there anybody out there to help me out?

Thank you very much!


texts: Using Magento Framework as a dependency in module.xml

texts:
Currently I am working on a plugin that modifies the Search in Magento 2
The file that I am trying to intercept is located at:
\Magento\Framework\Search\Adapter\Mysql\Query\Builder
To be able to use my plugin I need to add the "framework" folder inside my module.xml but I do not know if I can even include it

Already tried:

<module name="Magento_Framework" />
<module name="Framework" />
<module name="framework" />

Any suggestions would be much appreciated!

EDIT:

<?php

namespace Vendor\ExtendedQuickSearch\Plugin;

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

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

That is my Plugin to intercept the "getMatchQuery()" public method.
I thought the only way it is not working because I could not declare the Framework as a dependency.

Any idea's?


texts: sample data not loading in 0.74.0-beta10

texts:
I'm having no luck getting the sample data to load in the current rev., and I've had no trouble at all in previous versions. My composer.json contains the following, edited for brevity:

  {
    "name": "magento/magento2ce",
     "description": "Magento 2 (Community Edition)",
     "type": "project",
     "version": "0.74.0-beta10",
     "license": [
         "OSL-3.0",
         "AFL-3.0"

and ...

  "magento/sample-bundle-all": "1.0.0",
          "magento/sample-data": "0.74.0-beta9"

and at the end of the file:

  "minimum-stability": "beta",
      "prefer-stable": true,
      "repositories": {
          "magento": {
              "type": "composer",
              "url": "http://packages.magento.com"
          }
      }
  }

Here's what's happening. The sample-bundle-all downloads and installs correctly. The sample-data does not download the main file, but ONLY downloads the required files in sample-data-media and sample-data-fixtures.

First time through the web installer interface, the sample modules install, but the sample data box is greyed out.

I checked the vendor/magento directory to see what packages it contained for install and it lists the following:

magento-composer-installer
sample-data-fixtures
sample-data-media
sample-module-interception
sample-module-minimal
sample-module-modifycontents
sample-module-newpage
sample-module-service-contract-client
sample-module-service-contract-replacement
sample-module-theme
sample-module-webapi-client
sample-module-webflow
zendframework1

I admit I am at a loss to figure this out.

I have tried clearing the composer cache with clearcache. I have tried installing the sample-data both with the initial install, and having that fail, again as a separate install later. Neither works.

I get one of two errors or outcomes, I either get a 'nothing to update or install' message from composer when I try to install AFTER the initial install. I ran composer update on the base directory.

The other error is various text telling me that there is no such file in the magento repository, which I find dubious at best.

I'm baffled and any advice and counsel is gratefully welcomed.

Last point, I did use the 'uninstall magento' prior to upgrading, so the database was dropped and reloaded by the uninstall/install process.


texts:
I have problem login to backend when memcache is enabled. It doesn't generate backend page new key? Looks it is always same... All works when memcache is disabled. How fix this issue?
Error
Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /home/user/public_html/vendor/magento/framework/Session/SessionManager.php on line 531

env.php file
'session' => [
    'save' => 'memcached',
    'save_path' => 'tcp://localhost:11211'
],

(Also tested with 'save_path' => '127.0. 0.1:11211')

Magento 2.3.5-2,
Centos 7,
Memcache,
PHP 7.3


texts: Order entered via Admin not showing in Customer Login Account - Magento 2

texts: When we create an order for a customer via the admin console the order is not visible by the customer when they login to their account to check the order.


texts: How to initialise a carousel and use Knockout observables in the same JS file

texts:
I'm experimenting with Require JS and Knockout JS in Magento 2 and I've ran into a strange problem where I can't use Knockout JS and initialise a carousel in the same JS file.

The carousel works fine if I initialise the JS without using Magento_Ui/js/core/app but then the Knockout observables won't be applied.

But if I do use Magento_Ui/js/core/app the carousel doesn't work correctly, it does get initialised but it won't actually slide. There are no errors in the console.

I know the carousel works correctly when not used alongside Magento_Ui/js/core/app.

My question is why would using using Magento_Ui/js/core/app prevent the carousel from sliding? I suspect I have done something wrong in the JS.

Even if you have done something similar your code might help me out, the dev docs are still pretty poor/none existent when it comes to using Knockout.

This is my code:

carousel.phtml

            TEST Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci beatae blanditiis cupiditate doloribus ducimus eos fuga harum illo inventore iusto minima molestiae omnis provident quaerat quod reiciendis, sequi temporibus veniam!

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta hic maxime neque numquam perferendis quis sed? Dolorem ducimus et exercitationem fugiat ipsa iure magni nam, perspiciatis quidem sunt ut, vitae.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia, sit, voluptatum? Accusantium aspernatur at dolores earum enim excepturi id molestiae molestias nesciunt officia perspiciatis, repudiandae, saepe sed sint ullam veritatis.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia, sit, voluptatum? Accusantium aspernatur at dolores earum enim excepturi id molestiae molestias nesciunt officia perspiciatis, repudiandae, saepe sed sint ullam veritatis.

carousel.js

define(['jquery', 'ko', 'slick', 'domReady!', 'Magento_Ui/js/core/app'], function($, ko) {
    'use strict';

    return function(config, node) {
        console.log(config);
        console.log(node);

        this.title = ko.observable(config.carouselTitle);

        $('.carousel').slick({
            slidesToScroll: 1,
            slidesToShow: 1
        });
    };
});

Proof the carousel and Knockout observable both get initialised:


texts: After upgrading my local instance of magento 2.1 to 2.1.2 the bin/magento tools stopped working. I do not get an error or any output. For instance when I run php bin/magento setup:upgrade after upgrade it seems like it is doing something, but get no output and does not seem to have done the upgrade on modules. Anyone else seen this issue?


texts: Product Price showing as 0 (Zero) on Products List and Home page

texts:
Our products purchase option starts from 10 grams / .35 oz to 1 KG / 35 oz with different pricing option for different weight. We do not have a base price so the base price of the product is set to 0.

Then we have created custom options from 10 grams / .35 oz to 1 KG / 35 oz with different pricing.

Now the issue is that the price of 10 grams / .35 oz shows up fine in the product view page but it is showing as 0 (Zero) on products list and home page.

How can I resolve this issue?


texts: Event Snippet Google Ad Conversion Tracking Magento 2

texts:
I am trying to figure out how to get Google Ad conversion tracking working in Magento 2.3.5 - the Google Ad API setting isn't available under admin area of this version. Universal Tracking Code already installed on every page.
So far I've added the following to the success.phtml file:
<?php
$OrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$Order = Mage::getModel('sales/order')->load($OrderId);
$incrementId = $Order->getIncrementId();
?>

<!-- Event snippet for Purchase conversion page -->
<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-XXXXXXXX/XXXXXXXXXXX',
      'value': <?php echo number_format($Order->getSubtotal(),2,".",""); ?>,
      'currency': 'GBP',
      'transaction_id': <?php echo "'".$incrementId."'"; ?>
  });
</script>

I think the above code may work for Magento 1. Can anyone suggest an update for Magento 2?


texts: How can I convert Magento 1 helper api function code to Magento 2?

texts:
I have an API connection method in the Magento-1.9 helper. I want to use the same method in Magento 2.
This is Magento 1.9 Helper Code:
<?php
class Vendor_Module_Helper_Class extends Mage_Core_Helper_Abstract
{

    const WSDL_NAME             = 'interface-data.WSDL';
    const EXCEPTIONS            = true;
    const TRACE                 = 1;
    const UsernameToken         = 'WSUSER';
    const PasswordText          = 'WSUSER_1';
    const SessionType           = 'Stateless';

    public function apiConnection(){
        ini_set("soap.wsdl_cache_enabled", 0);
        ini_set('soap.wsdl_cache_ttl',0);
        //ini_set('default_socket_timeout', 25);

        $wsdlPath = Mage::getModuleDir('etc', 'Vendor_Module');

        $client = new SoapClient($wsdlPath.DS.self::WSDL_NAME,
            array(
                'exceptions' => true,
                'connection_timeout'=> 15,
                'trace' => true ,
                "stream_context" => stream_context_create(
                        array(
                            'ssl' => array(
                                'verify_peer'       => false,
                                'verify_peer_name'  => false,
                            )
                        )
                    )
            )
        );

        $Auth = new stdClass();
        $Auth->UsernameToken = self::UsernameToken;
        $Auth->PasswordText = self::PasswordText;
        $Auth->SessionType = self::SessionType;
        $header = new SoapHeader('http://example.com/ApiInterface/','Auth',$Auth,false);
        $client->__setSoapHeaders($header);

        return $client;
    }

}

How Can I do this?


texts: Magento2 How to create a contact Us form in venia theme for PWA

texts:
Magento2.3.5  I have installed the PWA - venia theme. I can't see the Contact Us form in it. How can I added Contact Us form & connect it with Magento.
I want user to submit contact form & sent email to admin as normal form in Magento frontend but via PWA storefront


texts: How to add digital signature in Magento 2?

texts:
In Magento2 I want to learn how can I add digital signatures for customer at checkout. What library should be used ?

I want to take digital signatures on customer agreement form.

I am currently using Magento CE 2.2.6


texts: Get related products per attributeset ID

texts:
My products have a bunch of related products, some of which are in a separate attribute set. I want to split these out in two different views on view.phtml. I figured to need addAttributeToFilter and I Googled around for the markup and came up with this

$product_id = $this->getProduct()->getId();
$allRelated = Mage::getModel('catalog/product')->load($product_id)->getRelatedProductIds();
$specificRelated = $allRelated->getProductCollection()->addAttributeToFilter('attribute_set_id','10');

foreach ($specificRelated as $specificProd) {
    var_dump($specificProd);
}

But it gives me this error

Uncaught Error: Call to a member function getProductCollection() on array

It seems to be a minor mark-up problem, but I can't seem to figure out what it is. Anyone?


texts: Load collection in foreach() is already flagged as loaded

texts:
In a custom module UpgradeSchema, I've this constructor :

function __construct(
    AttributeManagementInterfaceFactory $attributeManagementFactory,
) {
    $this->attributeManagementFactory = $attributeManagementFactory;
}

and this upgrade method :

public function upgrade( ModuleDataSetupInterface $setup, ModuleContextInterface $context ) {
    $attribute_id = 135;
    foreach([4, 9, 10] as $set_id) {
        // Get the attributes list for current attribute set
        $attributeManagement = $this->attributeManagementFactory->create();
        $attributes = $attributeManagement->getAttributes(\Magento\Catalog\Model\Product::ENTITY, $set_id);

        if($attributes[$attribute_id]) {
            var_dump($attributes[$attribute_id]->getAttributeSetId());
        }
    }
}

The product attribute with the id 135 is assign in three Attribute Sets (ids : 4, 9 and 10 in the foreach).

When I run the setup:upgrade, the var_dump outputs :

string(1) "4"
string(1) "4"
string(1) "4"

Three times the first Attribute Set ids, instead of 4, 9 and 10.

When I look into the AttributeManagement::getAttributes(), the load is called three times here :

$attributeCollection = $this->attributeCollection
    ->setAttributeSetFilter($attributeSet->getAttributeSetId())
    ->load();

return $attributeCollection->getItems();

But into the load method called (Magento\Framework\Data\Collection\AbstractDb::load()), Magento check if the collection is loaded (and returns the collection) or not (and so goes on) :

public function load($printQuery = false, $logQuery = false)
{
    if ($this->isLoaded()) {
        return $this;
    }

    return $this->loadWithFilter($printQuery, $logQuery);
}

I can't understand why, but it's a fact that the collection is not flagged as loaded the first time (hopefully) and flagged to true the two others times Magento check. And that despite I create new object in the foreach of my Upgrade script :

$attributeManagement = $this->attributeManagementFactory->create();

Someone to explains this phenomenon ? Or/And to explains how to fix it ?


texts: Magento products stubbornly using old theme

texts:
I'm trying to change the package+theme for a magento installation.

The old theme is at default/paws
The new theme is at ebajes/default

While the rest of the views (home page, categories, etc.) have been changed to the new one, the products are still being shown with the old theme

I have tried :

making a change in admin system > design
setting the value of "package" and "template" in system > config > design
setting custom display of the supercategory of all products
setting custom display for specific categories

I even tried renaming the entire default/paws folder, but its now falling back to the default/default theme.

Where should this change be made? The caches are disabled.


texts: How migrate products from Magento database 1.9 to 2.3.2?

texts: I migrate data from Magento 1.9 to Magento 2.3.2, after that customer adds new products to 1.9, so I'm in trouble. I have a database with new products that were added at Magento 1.9, but I don't know how to migrate them safely and what tables I should migrate. As I know products records consist of "product entity" tables, but they connected to other tables. Here a screenshot of the database, and "catalog_product_entity" have a 17 products here. 1.9 site version is dead so I cant use admin tools for export, the only database available.


texts: Source fields are not mapped - migration error

texts:
I am migrating from magento 1.9.2.4 to magento 2.1.6. While run data migrate command I got below error

[2017-05-18 12:38:48][ERROR]: Source fields are not mapped. Document: customer_eav_attribute. Fields: is_used_for_customer_segment
.............................................
.............................................
[2017-05-18 12:53:38][ERROR]: Source fields are not mapped. Document: cms_page. Fields: published_revision_id,website_root,under_version_control

I have added below content into map-eav.xml ( source->field_rules ) for fixing the above error

<ignore>
    <field>customer_eav_attribute.is_used_for_customer_segment</field>
</ignore>
<ignore>
    <field>cms_page.published_revision_id</field>
</ignore>
<ignore>
    <field>cms_page.website_root</field>
</ignore>
<ignore>
    <field>cms_page.under_version_control</field>
</ignore>

first error got fixed but the second error still come, how to solve this?


texts:
Need to Set quote.shippingAddress() , after adding new billing address in checkout form magento 2 in js file.
Actually quote.shippingAddress() gets null after adding new billing address. That's why i need some solution to set it.


texts: how to load customer by email in magento2?

texts:
In magento 1.9, I used loadByEmail method from resource model.

But in magento2 in Magento\Customer\Model I see loadByEmail method. Customer factory, as well as customer entity which I get from quote, returns Magento\Customer\Model\Data\Customer which does not have this method.

Also CustomerRepository have only getById method.

how to load customer entity by email ?


texts: "Specified URL Already Exists" Error on Product Import in magento 2.1.4

texts:
I am getting an error as "Specified URL key already exists in row(s): 1"
when I am trying to import the products using a csv file.
The product I am trying to import is the one that already is created and i am trying to update only the product attributes with the sku field. No url_key field in csv.
Anyone can help me in solving this????????


texts: Magento 2 two different magento having same cart value

texts:
I have installed two magento on my local server.I added product from my first magento installation its added fine but it also display in second magento installation. Why does this happen? Any one have same issue?

Display product in cart in second image it is not exists in my second magento.


texts:
we integrated custom payment method. once it redirect to payment page after clicking on place order, its displaying below error. but same module worked fine in another site.

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
'sitename.payucheckout_api_debug' doesn't exist, query was: DESCRIBE
 `payucheckout_api_debug`


texts: Magento2 - Show Instant Purchase on product listing

texts:
By default Instant-purchase button is shown on product details page, but I want it also to be shown on Product listing as well.

I searched in backend, but didn't find any solution. How can this be done via custom programing ?

Anyone help to me.


texts: Product descriptions & titles are stored in which file in Magento?

texts:
So basically some tables in my ecommerce magento website are missing, and the whole website basically cannot load properly / 'empty'. I cannot access the admin panel, and when I put in forgot password/username, it says my email is not found. I'm fine with that since I haven't touched it for 2 years or so, and I am not using the website.

However now, I want to retrieve the product descriptions and titles, as I stored all the measurements and full descriptions of the products there. Is there a way I can grab all these infos from maybe the FTP side? or are they strictly in the magento admin page? Someone please advise on how I can retrieve them without loggin in to admin panel.

I found the pictures already located in the media folder, so I just need the descriptions now. Would be great if you can put detailed steps as I am in no way an expert in coding. Thank you for your help and time, appreciate it!


texts: what it means by Magento cache fast-backend and slow-backend?

texts:
What it means by  cache
backend
slow_backend
slow_backend_store_data
auto_refresh_fast_cache

I have see this types of caches config in local.xml.additional  file.
I want to is know
what is meant by this type of caches and
why this is used and which section is affected by it on Magento
and
I need details of explanation


texts: Anchor category - display only price/category filter in layered navigation

texts:
I'll explain you what am I trying to achieve. Basically I am setting up a shop for a customer. We've got categories like:
-Clothes:

pants
tshirts

We want products from subcategories (pants, tshirts) to be displayed in parent category (Clothes) too. However products are linked only to subcategories. That is why we enabled Anchor in Clothes category. Everything is okay now but we've got big amount of filters available in Clothes category. The thing is: in parent category I want only 2 filters to be displayed (Category, Price). Other filters should be only visible in categories without childs.
So what I already achieved is hiding all filters in specified category (like Clothes) by adding

referenceContainer name="catalog.leftnav" remove="true"

to Layout Update XML. Is there any way to render only Price and Category filter by using xml? Or any other ideas how can I achieve this ?


texts: How do I list all products in ascending order in Magento?

texts:
I try to list all product names in a store, so I try the following code.

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

$collection->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

foreach ($collection as $product) {
    echo $product->getName();
    echo "
";
}

This gives the following result.

After that I try to sort this. The code is:

$collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->setPageSize(5000)->setCurPage(1);
$collection->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

foreach ($collection as $product) {
    $pro[] = $product->getName();
}

sort($pro);

foreach ($pro as $pr) {
    echo  $pr; echo"
";
}

This gives the following result.

It gives two lists in ascending order.

Why does it behave like this?

I need only one list with ascending order for that. What should I do?


texts:
I am trying to get when the Id of Customer or Visitor on every page load from customer/visitor session through event.

I had used this controller_front_init_before event for the purpose but don't know if it is the proper one because sometimes (don't know the reason for sure, maybe it's fired too early) it returned empty session for both.

So my question is when the customer/visitor session gets initialized ?
and which event should be used to get the session ?
and is it the proper one controller_front_send_response_before to use or there is a better choice I don't know of ?

Thanks


texts: Can I add new Form fields using javascript onlick to work with PHP submit?

texts:
I trying to add a two fields to a contact form and append the form data to the submit.

<script type="text/javascript">
$(document).ready(function(){

alert(document.getElementById("customer:quantity").value);

alert(document.getElementById("customer:usage").value);

$(":submit").click(function () {
$("div").append("customer:quantity");
});

$(":submit").click(function () {
$("div").append("customer:usage");
});

});
</script>


texts:
I'm reading the documentation here. My goal is to remove the "Customize and Add to Cart" button, for a bundled product

The path for the layout can be found here /vendor/magento/module-gift-registry/view/frontend/layout/catalog_product_view_type_bundle.xml. I want to remove the first action
<action method="setGiftRegistryTemplate">
    <argument name="blockName" xsi:type="string">customize.button</argument>
    <argument name="template" xsi:type="string">Magento_GiftRegistry::product/customize.phtml</argument>
</action>

which meets the criteria in the documentation for overriding a layout file

Examples of customizations that involve overriding layouts:

Suppressing method invocation.

Note there is no method to cancel the prior invocation in the Block class itself. So I have added this file in my custom theme
/app/design/frontend/vendor/theme-name/Magento_GiftRegistry/layout/override/base/catalog_product_view_type_bundle.xml, duplicating the stock layout file and omitting the first action (referenced above).
There is no change on the frontend, the button is still there. I found this thread, however the original question was not answered, and I'm looking for an answer to that very question now.
So what am I doing wrong?


texts: Magento set moq in product in particular category using observer

texts:
i want to set moq if user open same product in category A.

for that i used below modules

<catalog_product_load_after>
            <observers>
                <setcustomprice>
                    <type>singleton</type>
                    <class>Module_Customgroup_Model_Observer</class>
                    <method>loadaftercatalog</method>
                </setcustomprice>
            </observers>
</catalog_product_load_after>

and loadaftercatalog function

public function loadaftercatalog(Varien_Event_Observer $event) {
        $product = $event->getEvent()->getProduct();
        $originalprice = $product->getPrice();
        $customprice = 2*$pricetoadd->getPrice();
        $product->setPrice($customprice);

   }

give error and does not work can i set moq here so if by default show price of two


texts: Why Magento automatically changes product URL?

texts:
This has been going on for quite a while but I haven't had any solid proof until now.

Please search Google.com for "Princess Ivory Lace Tulle V Back Wedding Flower Girl Dress with Big Bow" and open up the first result:

https://www.princessly.com/ivory-lace-tulle-v-back-wedding-flower-girl-dress-with-big-bow-2664.html

(Forgive me for listing the URL prominently here as it facilitates understanding of the URL change)

Which is now a 404 not found error, a few days after the page was crawled by Google, when it was perfectly fine or Google wouldn't index the page in the first place.

Now when I do a catalog search, the exact product is now at a totally different URL:

https://www.princessly.com/ivory-lace-tulle-v-back-wedding-flower-girl-dress-with-big-bow-1.html

See the different integer at the end of the URL key.

This has also happened quite some times with product pins on Pinterest.com that the URL of a particular product somehow automatically changes this way and the Visit button of the pin leads also to a 404 not found page.

Apparently we never changed these URLs by ourself. Magento automatically changed them.

While I understand Magento has to append an integer of some sort to discriminate products with similar titles but why change it after it's been created?

Why? What could be the culprit here? How can we prevent it from doing this?


texts: proper way to Override the php file in magento 2

texts:
I need to override the file
Magento\Framework\Search\Adapter\Mysql\Query\Builder\match.php
and make the

const MINIMAL_CHARACTER_LENGTH = 3;

to

const MINIMAL_CHARACTER_LENGTH = 1;

should I change it in vendor itself or override. help me with the override.

Minimal Query Length under Stores -> Configuration -> Catalog -> Catalog Search is set to be 1


texts: Shopping cart rule: one item, highest price

texts:
I'm wanting to set up a promotion that is 25% off one item only from specific categories.

How would I do this so that the cart applies the discount to only one item, preferably the highest priced item in the cart?


texts: How to get category thumbnails in navbar menus?

texts:
I have been very happy so far with "Responsive Custom Menu", however it does not have the option to pull in thumbnail images for categories and subcategories on the menu.  I was about to extend it by adding a getThumbnail call to the getter and renderers for this navbar, but ran into some issues where it did not construct the url properly.

It seems that the main files to modify would be app/code/local/WP/CustomMenu/Block/Navigation.php and perhaps app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml.

Can anyone provide some specific modifications that would insert the thumbnails into the menu for further styling?

Additionally, I'm fine with modifying this extension directly to provide these thumbnails, but would there be a better method to extend an extension such as this so that updates are still tenable and likely still work?

EDIT:

It seems that this may hold some keys here to implementing this properly: http://www.h-o.nl/blog/using_category_images_in_your_magento_navigation/


texts: Removing Magento Store URLs Param ?__store=

texts:
Magento's store URL wuery param is really annoying me and I'm not sure of the point of it when there is a store cookie for holding this info, also it only appears when you first visit a site or switch store views.

I would like to remove it as I think it may not work well with SEO & Search Engine Indexing.  Also it looks bad!

I tried changing the setting on System > Configuration > Web > URL OPTIONS > Add Store Code to Urls to Yes but this is bad in another way as the default store view code and others are appended to every url.  SEO duplicated content.

I don't know.  Is there good logic behind how Magento is working that I'm not getting or can I remove this?

I tried the Bubble_HideDefaultStoreCode module to remove store codes but it did not.

I'm thinking maybe I can remove these URLS params with an NGINX re-write but am not sure how I can do this?


texts: Restrict Place Order if Shipping Country is USA

texts:
I want to RESTRICT "Place Order" for Shipping Country USA if certain products are in Cart.

Can anyone please suggest me how to achieve this functionality?


texts: Seeing duplicate cookie response headers

texts:
When looking at the request headers for my Magento 1 site I can see it has 2 cookie request headers.

Set-Cookie:frontend=3dt1aedashghghg1vr9ua0tghms7; expires=Fri, 20-Oct-2017 07:52:20 GMT; Max-Age=3600; path=/; domain=www.example.com; secure; httponly
Set-Cookie:cookiesEnabled=1; expires=Fri, 20-Oct-2017 06:52:50 GMT; Max-Age=30

Please could someone advise if this is normal and if its not the best way to solve this issue


texts: Magento relaunch: Migration of live and test databases

texts:
our agency has a local magento test environment. Database was a clone from a day XY in the past.

Since then, the old, live magento has got new customers, new orders.

Do you have some tips for migrating this databases?
Do you use any third-party tools and if yes, what tools do you prefer?

Thanks for your responses in advance!


texts: Why doesn't custom block appear on product page

texts:
Good afternoon, I'm suspecting this is an easy oversight.. I've been working today on putting a custom block onto a product page. But, nothing from my template is showing up. Take a look at my code below:

my config.xml:

<config>
    <modules>
        <Foo_Bar>
            <version>1.0</version>
        </Foo_Bar>
    </modules>
    <global>
        <models>
            <foo_bar>
                <class>Foo_Bar_Model</class>
                <resourceModel>bar_resource</resourceModel>
            </foo_bar>
            <bar_resource>
                <class>CWD_Appratings_Model_Resource</class>
                <entities>
                    <rating>bar_rating</rating>
                </entities>
            </bar_resource>
        </models>
        <blocks>
            <foo_bar>Foo_Bar_Block</foo_bar>
        </blocks>
        <helpers>
            <foo_bar>
                <class>Foo_Bar_Helper</class>
            </foo_bar>
        </helpers>
    </global>
    <frontend>
        <layout>
            <foo_bar>
                <file>foo_bar.xml</file>
            </foo_bar>
        </layout>
    </frontend>
</config>

My theme/default/layout/foo_bar.xml

<layout version="0.1.0">
    <catalog_product_view>
        <reference name="product.info">
            <block type="catalog/product_view"  name="bar_widget" as="bar_widget" template="foo/bar/widget.phtml" />
        </reference>
    </catalog_product_view>
</layout>

and my code in theme/template/catalog/product/view.phtml

<div class="app-ratings">
    <?php echo $this->getChildHtml('bar_widget'); ?>
</div>


texts: magento price slider not working when i min walue is $0?

texts:
when i start filtering the priceslider from the min price in which in my case is $0 the slider works fine but when i start filtering from max value (keeping the min value to 0 ) nothing changes but when adjust /increase the filter to a non zero value the max value limit is applied, even if i set some static min value  like 1$ or 2$ slider works fine but not with zero value

this is my slider code (relevent code)

$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
        $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
        $rate = round(Mage::helper('directory')->currencyConvert(1.0000, $baseCurrencyCode, $currentCurrencyCode),2);
        if($this->_currMaxPrice > 0){$Curmax = $this->_currMaxPrice;} else{$Curmax = $this->getMaxRangePrice; }
        if($this->_currMinPrice > 0){$Curmin = $this->_currMinPrice;} else{$Curmin = $this->getMinRangePrice;}
        $minRange = $this->getMinRangePrice();
        $maxRange = $this->getMaxRangePrice();
        $minRange = $minRange * $rate;
        $maxRange = $maxRange * $rate;
        if(!isset($_GET['rate'])) {
            $Curmax = $Curmax * $rate;
            $Curmin = $Curmin * $rate;}

script file
/slider

$jq( "#slider-range" ).slider({
    range: true,
    min: min,
    max: max,
    values: [ currentMinPrice, currentMaxPrice ],
    slide: function( event, ui ) {
        $jq( "#amount" ).val( currencies + ui.values[ 0 ] + " - "+ currencies + ui.values[ 1 ] );
        $jq('input[name="first_price"]').val(ui.values[0]);
        $jq('input[name="last_price"]').val(ui.values[1]);
    },
    stop: function( event, ui ) {
        var first =   ui.values[0];
        var  last =  ui.values[1];
         var baseUrl = '<?php echo $baseUrl; ?>'+'?rate='+rate+'&first='+first+'&last='+last+params;
             ajaxFilter(baseUrl);

    }
});

$jq( "#amount" ).val( currencies + $jq( "#slider-range" ).slider( "values", 0 ) +
    " - "+currencies + $jq( "#slider-range" ).slider( "values", 1 ) );
$jq('input[name="first_price"]').val($jq( "#slider-range" ).slider( "values", 0 ));
$jq('input[name="last_price"]').val($jq( "#slider-range" ).slider( "values", 1 ));


texts: Add links inside My Account in header Magento 2

texts:
How can i add links inside Myaccount in header of magento 2
See https://prnt.sc/ren9h3


texts: How can i modify Magento 2 response to include additional info?

texts: When I try to access API when i'm not authorized I want to customize response to return link where I can get token. What class should I override or change? I have no idea where to start with this and sorry for this long post but i can't post shorter. :/ I did not tried anything because I don't know how. Just let me post question please


texts: Remove shipping information from Email template if method is "freeshipping"

texts: How to remove or hide a shipping information in Email template order_new.html if the shipping method is freeshipping, i named it "Shop pick up" so we don't need to display this information because there is no shipping.


texts: Customer name always "guest" for PayPal Express/User name not save

texts:
When I get an order from PayPal Express the customer name in the confirmation mail is always "Guest". I checked the mail template and there it says {{htmlescape var=$order.getCustomerName()}}.

I tried calling this from normal code like this:

$n = Mage::getModel('sales/order')->load($id)->getCustomerName();
var_dump($n);

This also returns "Guest" for the Express order. How is it possible to get the real name for a PayPal Express order, just like for the other orders with different payment methods?


texts: Magento2: how to add remove header links conditionally

texts: how to add remove header links conditionally. I am trying to show my account link only when the customer is logged in. Otherwise it should be hidden. How to do the same using xml files.


texts:
When i try to update all products QTY = 0, Actually its uploading and successfully uploaded, and go to back end QTY column is 0, the terrific error is, stock availability still "in stock", (Actually QTY is 0 mean stock availability "Out Of Stock").

After i go to individual products just click save button with any changes, shockingly its working, the thing is i did nothing changes, just click save button.

How can i solve updated not working on Magento version : 1.9.2.3


texts: Magento 2: Disable default header and add custom header content

texts:
I have created a custom header container and placed inside

app/design/Foo/bar/Magento_Theme/templates/html/header.phtml

Now the content I need is showing up, but also displaying default header contents link links, welcome message, search, logo and titles.

I tried removing them by remove="true" in frontend default.xml, it removes my custom design as well.

Please correct me or let me know how I can use a custom header. Right way of doing it. Thanks


texts: I tried to enable compilation after adding a module and when I run the compilation process, I get this error "Class not found in"

texts:
this is eroor:-

Fatal error: Class 'Mage_GiftMessage_Model_Resource_Setup' not found in /home/brandhype/public_html/granda/includes/src/Mage_Core_Model_Resource_Setup.php on line 234


texts:
I'm trying to create a new table in the Magento database using Magento's *Varien_Db_Ddl_Table*. Using fresh Magento 1.7.0.2 CE install for this.

I'm at a loss for syntax though. I'm trying to create a BOOLEAN field but I will also settle for a TINYINT if needs be. My createTable looks like this:

$table_one = $installer->getConnection()
->newTable($installer->getTable('my_module/table'))
->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'unsigned' => true,
    'identity' => true,
    'nullable' => false,
    'primary' => true,
), 'Entity id')
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_TEXT, 63, array(
    'nullable' => true,
    'default' => null,
), 'Store view id')
->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_TINYINT, 1, array(
    'nullable' => false,
    'default' => 1,
), 'Status')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
    'nullable' => true,
    'default' => null,
), 'Creation time')
->addIndex($installer->getIdxName(
    $installer->getTable('my_module/table'),
    array('store_id'),
    Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
),
array('store_id'),
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
)
->setComment('My Module Table');
$installer->getConnection()->createTable($table_one);

The field I'm struggling with is is_active. MySQL tries to set as AUTO-INCREMENT and NULL?!?

Can anyone set me straight please or point me to some useful docs? I found these, but no syntax guidelines really :(

Thank you.


texts:
I have checked Overriding community adminhtml controllers but all are not working.
Related questions:
override community controller in local codepool. Rewrite controller magento

I have to rewrite the adminhtml controllers in the Path:

community/Magestore/Slider/controllers/Adminhtml/SliderController.php

to My Local path:

local/Mymodule/Slider/controllers/Adminhtml/SliderController.php

My Config.xml:

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mymodule_Slider before="Magestore_Slider_Adminhtml">Mymodule_Slider</Mymodule_Slider>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

SliderController.php

require('Magestore/Slider/controllers/Adminhtml/SliderController.php');

class Mymodule_Slider_Adminhtml_SliderController extends Magestore_Slider_Adminhtml_SliderController
{
    public function indexAction()
    {
        echo '1';die();
    }
}

it is not coming into the Slider controller overridden in the local. What was wrong with my code ?
Thanks


texts: What are the different xsi:noNamespaceSchemaLocation in Magento 2 and when to use them?

texts:
Looking through Magento 2 di.xml files there are various types of xsi:noNamespaceSchemaLocation

When should we be using each schema?


texts: How to install Magento-CE-2.0.2 Full Release with Sample Data?

texts:
I downloaded Magento-CE-2.0.2 Full Release with Sample Data (ZIP with sample data) from

https://www.magentocommerce.com/download

How can i install  Magento-CE-2.0.2 Full Release with Sample Data (ZIP with sample data) my local Xampp Server.

I try to install from my browser but after 97% complete no progress. I also check my MySQL Database no process running (MySQL Command:SHOW PROCESSLIST).
[http://MyIP/Magento2/setup/#/install]

Screenhot:

I found error issue Github:
https://github.com/magento/magento2/issues


texts: Magento 2 : Get product collection with set if condition

texts:
How to set if condition in magento 2 with product collection?

 public function getCategoryProducts($categoryId)
    {
        $products = $this->getCategoryData($categoryId)->getProductCollection()->$products->addAttributeToSelect('*');
        echo $products->getSelect()->setOrder(IF('cat_index_position' = '0',1,0));exit;
        return $products;
    }

How to give if condition in above collection?

Above IF condition not working in collection and throws error for syntax error.

Thanks.


texts: Magento 2.3 Contact form in modal popup not showing Google recaptcha

texts:
I have written a module that loads the default contact form in to a default Magento modal window (I load the form in to the footer first):

/app/code/Sulman/PopupContactForm/view/frontend/layout/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">

        <css src="Sulman_PopupContactForm::css/contact-popup.css" />

    <referenceContainer name="footer">
        <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
            <container name="form.additional.info" label="Form Additional Info"/>
        </block>
        <block class="Magento\Framework\View\Element\Template" name="popup-button" template="Sulman_PopupContactForm::popup-button.phtml"></block>
    </referenceContainer>
</page>

/app/code/Sulman/PopupContactForm/view/frontend/templates/popup-button.phtml

    Contact Us

This is working correctly and loads the contact form in the popup just fine.

But now I want to add the default Magento Google recaptcha to the contact form. I have enabled it and it is showing correctly on the contact form (/contact) but it does not show on the contact popup. Any ideas?

I can see the code to load the recaptcha in the source of the main contact page:

But it is not appearing on the popup source.


texts: Fraud: Is there any way to block a specific postal code (address)?

texts:
we've been receiving quite a lot of fraudulent transactions and they're all being delivered to the same address, I was wondering if there was any way I could block customers from using a specific post code or address?

We're actively blocking ip addresses but they're changing so frequently

TIA


texts: Magento 2 - Custom REST api POST method not working

texts:
I have created a custom rest api module. When i am using GET method it's working fine. But when i am trying to use POST method it giving below error

Request does not match any route.

Does anyone have any idea why it is not working?
My webapi.xml
Second method (GET) working but First method (POST) not working
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/test/info" method="POST">
        <service class="Bwip\ApiEndpoints\Api\CustomInterface" method="info"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/test/data" method="GET">
        <service class="Bwip\ApiEndpoints\Api\CustomInterface" method="data"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

My di.xml file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Bwip\ApiEndpoints\Api\CustomInterface" type="Bwip\ApiEndpoints\Model\Api\Custom"/>
</config>

Interface file
interface CustomInterface{

    /**
     * GET for Post api
     * @param string $value
     * @return string
     */

    public function info();
    /**
     * GET for Post api
     * @param string $value
     * @return string
     */

    public function data();
}

My Model
<?php
namespace Bwip\ApiEndpoints\Model\Api;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\App\RequestInterface;
use Bwip\ApiEndpoints\Api\CustomInterface;

class Custom implements CustomInterface
{
    /**
     * Returns greeting message to user
     *
     * @api
     * @param string $name User name.
     * @return string Greeting message with users name.
     */
    protected $request;

    public function __construct(
        RequestInterface $request,
        array $data = []
    ){
        $this->request = $request;

    }
    public function info(){
        $post= $this->request->getPost();

        $info[] = array('message' => 'POST Working.', 'status'=> 0);
        return $info;

    }
    public function data(){
        $post= $this->request->getPost();

        $info[] = array('message' => 'GET Working.', 'status'=> 0);
        return $info;

    }

}

Thanks in advance.


texts: How to change default logo of magento admin panel


texts: warning hash() unknown hashing algorithm sha256 when try to access admin in magento 2.3.0

texts: Getting error / warning when trying to access admin owing to unknown hashing algorithm sha256


texts: Magento 2: Cron job not logging value of Product in log file [SOLVED]

texts:
I'm creating new Cron Job.

app\code\Custom\Module\Cron\MyTask.php

namespace Custom\Module\Cron;

class MyTask {

    protected $_logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->_logger = $logger;
    }

    public function execute() {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
        $productCollection->addAttributeToFilter('price', array('gt' => 500));
        $productCollection->load();

        foreach ($productCollection as $products) {
            $this->_logger->debug($products->getName());
            $this->_logger->info($products->getName());
        }
        return $this;
    }
}

When I'm executing through command it's not logging Product Name in var/log/debug.log or var/log/system.log

Some time it will log, sometime don't


texts: When the user adds a product to wishlist then the product's quantity should not be passed. In the wishlist the product should have single quantity.


texts: capture offline invoice soap api v2 call

texts:
What is the method for creating invoice with capture offline?
We are capturing at erp,so we need to generate invoice with capture offline on magento side.

$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionID = $proxy->login('apiUser', 'apiKey');

$orderIncrementId = '100000016';

//Create invoice for order
$qty = array(
    array('order_item_id' => '15', 'qty' => '1')
);
$invoiceIncrementId = $proxy->salesOrderInvoiceCreate(
     $sessionID,
     $orderIncrementId,
     $qty);

//Capture invoice amount
$result = $proxy->salesOrderInvoiceCapture(
     $sessionID,
     $invoiceIncrementId
);


texts: I have a Magento 1.9.1 installation and I wish to convert the e-mail field to be non-required on the checkout process.


texts: How to get last generated invoice in magento 1.9

texts:
I want to get the last invoice detail like invoice id invoice pdf file order status.

I tried the following code but no data found.

$orders_invoice = Mage::getModel("sales/order_invoice")->loadByIncrementId($orderIncrementId);


texts: Magento 2 - If search using less than min query length then it gives me error

texts:
If search less than min query length it gives me error on the front website in magento2. In catalog search, I have set min query length to 3. And if I search with 2 char length then it giving me an error like,

  Sorry, something went wrong. You can find out more in the error log.

Please let me know the issue.

Thanks in advance.


texts: Magento 2: How to delete multiple store views?

texts:
How do I delete multiple store views in Magento 2?

I need a path to delete all store views in admin.


texts: Magento 2 - How to override knockoutjs template which is already overriden from a third party module?

texts:
I try to override the knockoutjs template vendor\amasty\module-single-step-checkout\view\frontend\web\template\checkout\summary\item\details.html from my own Theme.
The module amasty\module-single-step-checkout is registered as Amasty_Checkout
Attempt:
I copied the file into my theme at THEME\Amasty_Checkout\web\template\checkout\summary\item\details.html and made my changes, then I flushed the cache and the browser cache, but it still loads the old template.
I also executed grunt clean to clear static files. But it does not help either.


texts: Magento2: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

texts:
The above code written in catalog_product_view.xml in module-catalog.
For this block, customer info in header after login not loading. In console I'm getting this error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.

If I comment this block it works well. Any solution for this?

Thank You


texts: Associate specific configuration of configurable product to product

texts:
I am trying to create a section of our product view page which will contain a "looks good with.."-part.

Most of the products are configurable in color and size.
If the current product would look good with another product of a certain color.. How would one go about making that relation?

Ideally the customers would click the related item and be shown another configurable product with the color preselected.

We are using Magento CE 1.9.0.1


texts:
This should be a fairly easy one, I hope. I've looked over Alan Storm's tutorial on the topic a hundred times, but still can't figure out what I'm missing. I just want to get my custom admin page to hit my controller's indexAction(), where I will then be rendering my layout, etc. For this question I'm just looking for an answer that hits my controller die statement when I click on my page in the admin.

Have already made sure:

cache is cleared
module is enabled and working, overall

Here's the relevant code:

app/code/local/Company/MyModule/etc/config.xml:

<config>
    <modules>
        <Company_MyModule>
            <version>1.0.0</version>
        </Company_MyModule>
    </modules>
    <global>
        <blocks>
            <mymodule>
                <class>Company_MyModule_Block</class>
            </mymodule>
        </blocks>
        <helpers>
            <mymodule>
                <class>Company_MyModule_Helper</class>
            </mymodule>
        </helpers>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule before="Mage_Adminhtml">Company_MyModule_Adminhtml</mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <adminhtml>
        <menu>
            <mymodule module="mymodule">
                <title>My Custom Page</title>
                <sort_order>100</sort_order>
                <action>adminhtml/MyModule/homepage/index</action>
            </mymodule>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <mymodule translate="title" module="mymodule">
                            <title>MyModule</title>
                            <sort_order>1000</sort_order>
                            <children>
                                <mymodulebackend translate="title" module="mymodule">
                                    <title>My Custom Page</title>
                                </mymodulebackend>
                            </children>
                        </mymodule>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>

app/code/local/Company/MyModule/controllers/Adminhtml/MyModule/HomepageController.php:

<?php
die();
class Company_MyModule_Adminhtml_MyModule_HomepageController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Just a test action
     */
    public function indexAction()
    {
        die('here');
        $this->loadLayout();
        $this->renderLayout();
    }

}

Help greatly appreciated!


texts: Magento 2 How to use model function in phtml file When override phtml?

texts:
I want to override book.phtml file from my module and want to check if my module is enabled or not. if module is enabled then need to hide links and button from that phtml.

I have module function as below :

========================================

namespace Yourname\Yourmodule\Model;

use Magento\Checkout\Model\ConfigProviderInterface;

class ModuleStatusConfigProvider implements ConfigProviderInterface
{
    const XML_MODULE_STATUS_PATH = "setup/status/enabled"; //Example: test/general/enable

    /**
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_scopeConfig;

    /**
     * ModuleStatusConfigProvider constructor.
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     */
    public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
    {
        $this->_scopeConfig = $scopeConfig;
    }

    public function getConfig()
    {
        $config = [];
        $moduleIsEnabled = $this->checkModuleIsEnable(self::XML_MODULE_STATUS_PATH);

        if($moduleIsEnabled) {
            $config['modulesStatus'] = 1;
        } else {
            $config['modulesStatus'] = 0;
        }
        return $config;
    }

    public function checkModuleIsEnable($path)
    {
        return $this->_scopeConfig->getValue(
            $path,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
}

========================================

I want to use this model in my book.phtml file to check module is enable or not.

Thanks.


texts: Switching picture on a Configurable Product

texts:
I use the 1.9.0.1 version of magento and I would like for configurable products when the user selected a color, pictures of the product changes.

I saw that there are modules for this but none are compatible with the 1.9.0.1 release.

Is there a patch or a module for the 1.9.0.1 version?

thanks


texts: In Magento 2.2.4 Tier price of a simple product does not appear on a configurable product page

texts:
In Magento 2.2.4, Tier price of a simple product does not appear on a configurable product page after editing the cart.

Steps to reproduce:

1)Select all option of configurable product which has a tier price.
   This show tier price in product detail page
2)Add a product to cart
3)Got to the checkout cart page
4)Click an edit button of the product.
   It redirects to the product detail page and there is no tier price is visible.

You can see a screenshot for the better idea.

First Time(before edit)

After Edit(on checkout page)


texts: Magento 2 get custom attribute of a single product inside a plugin

texts:
Hello Everyone :) I'm in a bit of an empasse now: I'm building a module to edit the price of products that have a custom attribute by multiplying their weight by a variable. Now, almost everything works, except I can't seem to understand how to reference the products' attributes inside a plugin...

This is the code of my Plugin:

namespace Namespace\Module\Plugin;

class Product
{
    public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result)
    {

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');

        if($product->getData('has_attribute_x')) {

            $wbtweight = $product->getWeight();

            $helper = $this->helper('Namespace\Module\Helper\Data');
            $wbtvalue = $helper->getConfig('stuff/stuff/variable');
            $wbtfinal = $wbtweight * floatval($wbtvalue);
            return $result + $wbtfinal;

        }
    }
}

But, when I run it, I get an Uncaught Exception saying that I called getData on null, so... I don't seem to understand how Plugins work, I mean don't they act on every instance of a product (sort of like a foreach)? I haven't found a very explanatory dev documentation on this kind of issues...
Thanks in advance for the help.


texts:
After Magento 2.2.1 CE upgrade I ended up situation that error report file is not created to /var/report directory.

  There has been an error processing your request
  Exception printing is disabled by default for security reasons.

Error log record number: xxxxxxx"

Is there a developer mode which can show the error directly in browser? All advises are welcome.


texts: Move existing category attribute into new group

texts:
I basically want to move an existing category attribute into a newly created group in my setup file. This is the way I expected it to work:

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$entityTypeId = 'catalog_category';

$installer->addAttribute($entityTypeId, 'my_attribute', array(
'group'         => 'Adams Group',
'input'         => 'text',
'type'          => 'varchar',
'label'         => 'My Attribute Label',
'visible'       => 1,
'required'      => 0,
'user_defined' => 1,
'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
));

$installer->updateAttribute($entityTypeId, 'meta_title', array(
'group' => 'Adams Group'
));

$installer->endSetup();

It adds the new attribute to the group as expected, but it doesn't move meta_title in the new group. I suppose I'm using the wrong code. Any help much appreciated.


texts: SOLVED - Api token request Curl returns NULL

texts:
I am trying to get a token from my Magento 2 API, my script returns NULL, the call is working fine in Postman and generating a token :

$adminUrl='https://www.xxxxxxx.com/rest/V1/integration/admin/token';
$ch = curl_init();
$data = array("username" => "myusername, "password" => "mypassword");
$data_string = json_encode($data);
$ch = curl_init($adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'Content-Length: ' . strlen($data_string))
);
$token = curl_exec($ch);
$token=  json_decode($token);
var_dump($token);


texts:
I want to add a specific div after every 3 items inside the category list. So I want to extend the code of /app/design/frontend/theme/theme/template/catalog/product/list.phtml

There is the following code that displays every product inside the category:

How can I extend this code and add a specific div after every 3 items, so I get something like this:


texts: How do i get the base parent category name?

texts:
this is my code:

    $product_id = Mage::registry('current_product')->getId();
    $product = Mage::getModel('catalog/product')->load($product_id);
    $cats = $product->getCategoryIds();
    foreach ($cats as $category_id) {
        $parentId = Mage::getModel('catalog/category')->load($category_id)->getParentId();
        $parent = Mage::getModel('catalog/category')->load($parentId);
        echo $parent->getName(); // getting the parent category, but not the base category(first level)
        $_cat = Mage::getModel('catalog/category')->load($category_id);
        echo  $_cat->getName(); // getting the category
    }

I have multiple level of categories. I want to get the first level of category using one of the subcategories id. How can i do that ?


texts: Magento doesn't validate my select field

texts:
I am using two custom extensions in my Magento checkout process. One that makes a nice onestep checkout without the different steps, and one that allows the customer to choose a pickup point for picking up their parcel.

However, the field yo choose the pickup point is not validated, when used with the onestep checkout. The field has class="required validate-select", but the page can easily be submitted without choosing anything in the field.

I can't really figure out where to look for the error, since I thought this was everything that is needed in order to validate a field. Can someone please point me in the right direction?

Thanks!


texts: Magento 2 - Frontend page giving 404 error page

texts:
Hi I have created a module to view a form in the frontend. below is my code

/app/cod/TerrificMinds/Test/Block/Registration.php

<?php

namespace TerrificMinds\Test\Block;

class Registration extends \Magento\Framework\View\Element\Template
{
    /**
     * Construct
     *
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    )
    {
        parent::__construct($context, $data);
       }

    /**
     * Get form action URL for POST booking request
     *
     * @return string
     */
    public function getFormAction()
    {

        return '/test/registration/save';

    }
}

etc/frontend/routes.xml

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

etc/module.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="TerrificMinds_Test" setup_version="1.0.1" active="true"/>
</config>

view/frontend/layout/test_index_index.xml

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

        <referenceContainer name="content">
            <block class="TerrificMinds\Test\Block\Registration" name="test" template="TerrificMinds_Test::registration.phtml" cacheable="false"/>
        </referenceContainer>

</page>

templates/registration.phtml

Booking page

<form action="<?php echo $block->getFormAction() ?>" method="post">
    <input name="firstname" type="text">
    <input name="lastname" type="text">
    <input name="phone" type="text">
    <input name="bookingTime" type="date">
    <input type="submit" value="Send booking informations">
</form>

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'TerrificMinds_Test',
    __DIR__
);

Controller/Save.php

<?php

namespace TerrificMinds\Test\Controller\Registration;

use Magento\Framework\Controller\ResultFactory;

class Save extends \Magento\Framework\App\Action\Action
{
    /**
     * Booking action
     *
     * @return void
     */
    public function execute()
    {
        // 1. POST request : Get booking data
        $post = (array) $this->getRequest()->getPost();
        if (!empty($post)) {
            // Retrieve your form data
            $firstname   = $post['firstname'];
            $lastname    = $post['lastname'];
            $phone       = $post['phone'];
            $bookingTime = $post['bookingTime'];

            // Doing-something with...

            // Display the succes form validation message
            $this->messageManager->addSuccessMessage('Booking done !');

            // Redirect to your form page (or anywhere you want...)
            $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setUrl('/companymodule/index/booking');

            return $resultRedirect;
        }
        // 2. GET request : Render the booking page
        $this->_view->loadLayout();
        $this->_view->renderLayout();
    }
}

When I try to hit mysite/test/index/index
its giving me 404 errorpage after setup upgrade,di compile and cache flushing.
What could be the error I am making.Please help.


texts: AJAX response $product->getPrice() not working for child of configurable product

texts:
Below is my code in question.  I will list a few things below it.

if ($product->getTypeId() == 'configurable') {
    $child = $product->getTypeInstance(true)->getProductByAttributes($params['super_attribute'], $product);
    $product = $child;
}
$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
$response['status'] = 'SUCCESS';
$response['message'] = $message;
$this->loadLayout();
$topCart = $this->getLayout()->getBlock('topCart')->toHtml();
$response['topCart'] = $topCart;
$response['image'] = (string)Mage::helper('catalog/image')->init($product, 'thumbnail');
$response['name'] = $product->getname();
$response['price'] = Mage::helper('core')->formatPrice($product->getPrice(), true);

When $product is a simple product outright, there is no issue.  The functions $product->getname(), $product->getPrice(), and init($product, 'thumbnail'), all return valid results.

When $product is found to be configurable, it's child product replaces it.  I can then get the name, thumbnail but when I call the getprice function I get no results.

I don't understand why this would be.  Anyone out there care to elucidate?


texts: How to get $this->getAddToCartUrl($product) in magento

texts:
In my magento application created a phtml page in template/page/ folder..

Here displayed a products...Then there is a need for displaying

$this->getAddToCartUrl($product)

But it return null value...that means no value returned it.

How can i get it in my phtml page?

This is the html code:

<input id="url_<?php echo $_iterator;?>" name="url_$_iterator;" type="text" value="<?php echo $this->getAddToCartUrl($product) ?>">


texts: Howto install Magento2 Testframework as dev requirement

texts:
until now, I developed my Magento2 Modules in the app/code directory of a running magento2 instance. This is pretty easy and you can run your tests without having much to think about.

after reading this: Magento 2 as composer dev requirement for extensions, I wanted to try a more "clean" approach to develop a Module.

So I started by creating a new Project and pulled in all needed dependencies with composer.

While writing my first integration test i recognized that I'm missing the Testframework classes. For the first step, I just want to have the autocompletion in my IDE.

So my question is: Is there any possibility to install the Magento Integration Test Framework without having to install the whole mage2-base package? I couldn't find a composer package for this. (talking about this: https://github.com/magento/magento2/tree/develop/dev/tests/integration/framework/Magento/TestFramework)

Here is an example of what I'm trying to do (still a work in process - much potential for improvement)

https://github.com/davidverholen/magento2-blog


texts: Customer name is not displayed after login in Magento 2

texts:
Customer name is not displayed after successful login in Magento 2.
It only displays the default welcome message.

Can anyone help me?


texts: import with import behaviour add/update not working

texts:
Can somebody please help me out. Thanks in advance.

Even if i try to import one row, without any images, with a product that already exists and i want to add/update it, i'm getting the same error always. If checking it says no errors, but if i after checking i click on import it gives the error. I am working with a clean new version of magento 2.2.5, but also tried on 2.1 etc.
If i use replace instead of add/update no problems, but do not want to use that because of the images.


texts: Magento 2: Shopping Cart Rule discount based on item quantity

texts:
I'm a Magento 2 newbie. My customer wants to add a cart rule like,
apply 2% discount if item quantity >=12
apply 4% discount if item quantity >=24
apply 6% discount if item quantity >=36
apply 8% discount if item quantity >=48
and so on.

I've added a rule like below image. But here the discount will remain at 2% even if 24 is ordered.
What changes need to done to follow above conditions. Please help me. Thanks in advance.


texts: Installing Magento Community Edition (free version) as two web sites in Apache

texts:
I need to install Magento Community Edition (free version) as two web-sites in my web server (Apache 2.2), one MagentoCE with the sample data and one Magento CE without sample data. How to achieve this ? I have tried keeping one web-site with sample data (sample data given in the web site), but I am unable to proceed with installing a second web-site (with an empty database) because the installation gets halted in the process of installing.

Appreciate your comments!


texts: Magento 2 can't get the selected color swatch value in options.phtml file

texts:
I am trying to get the selected color swatch value in options.phtml

  module-catalog/view/frontend/template/product/view/options.phtml

file with following code.But i am not able to get the value.

<script>
   require([
    'jquery',
    'Magento_Catalog/js/price-box'
], function($){
    jQuery(document).ready(function(){
        //for swatches1
        $('.swatch-option').click(function () {
            alert('hello');
        });
    });

});

 </script>


texts: Separate Admin to new server with subdomain on AWS

texts:
I want to separate the backend on another server on AWS (not changing the path), Here is my desired design:

One EC2 (should be for frontend only and in auto-scaling)
One for admin, cron and images source for cloudfront (I think i will need subdomain for it)
RDS, REDIS,Cloudfront

I'm using nginx, SSL certificate installed on the ELB.

What i have tried:

created new instance with same files as the backend
changed the admin url from the backend to be
http://admin.example.com/
Set up Magento backend on a separate node
tried both disable and enable the auto redirect to base url.
disabled and enabled ssl in the backend
googled for any good documentation (it look like easy thing to do
but no one talk in detailed how to do it)

Here is my nginx configuration:

server {
    server_tokens off;
    access_log  off;
    listen 80 default;
    server_name www.example.com *.example.com;
    root /var/www/vhosts/example.com;

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
      if (!-e $request_filename) {
                    rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
            }
    }

    set $ssl "off";
    if ($http_x_forwarded_proto = "https") {
    set $ssl "on";
    }

    location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
         access_log        off;
         log_not_found     off;
         expires           30d;
     }

    location @handler {
        rewrite / /index.php;
                                   }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }

        expires        off;
        fastcgi_pass  unix:/var/run/php-fpm/example.sock;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default;
        fastcgi_param  MAGE_RUN_TYPE store;
        fastcgi_buffer_size 1024k;
        fastcgi_buffers 512 32k;
        fastcgi_busy_buffers_size 1024k;
        fastcgi_temp_file_write_size 1024k;

        include        fastcgi_params; ## See /etc/nginx/fastcgi_params
    }
}

I disabled any SSL for the backend and updated the nginx configuration for the admin server as below but got (ERR_TOO_MANY_REDIRECTS) error:

server_name admin.example.com *.example.com;
set $ssl "off";


texts: Magento2.4.1- show/hide editor not working

texts:
I upgraded magento2.3 to 2.4.1

Show/hide editor not responding.


texts: magento 2 : Product listing default sorting order based on attributes

texts:
i have add sort by attributes to products say like below one.

"Publish date"
"Product Name"
"Price"

Now i want to change sort order based on default attributes. For eg
1: Publish date -> Descending order
2: Product Name -> Ascending order
3: Price -> Ascending order

I tried below xml code in category layout xml update, but by adding it my product are sorted in descending order for all attributes, can i define sort order based on attributes in below code

<referenceBlock name="category.products.list">
        <action method="setDefaultDirection">
            <argument name="dir" xsi:type="string">desc</argument>
        </action>
    </referenceBlock>


texts:
Magento 2.3.4
Weight does not show for any products in admin.
The attribute exists and is part of the attribute set.
Database values seem to all be there for the attribute.
Can't understand why it doesn't show on admin.


texts: How to create Advanced search in magento2.2.3.3.1?

texts: how to create advanced search like amazon site, please check attached screenshotenter link description here if you have any custom code please share me.


texts: Add to cart in localhost doesn't work in IE, Why?

texts:
I have my development site in

http://localhost/mydevsite/

Everything is working fine, until I tested it in IE browser. When I click add to cart button (no changes made to this functionality), it gets redirected to cart page, but the cart is empty.

In other browsers, it is working fine. I use IE 10, also tested in IE9, IE8, IE7 (checked using the Browser Mode option). The problem prevails. I checked with both Magento CE and EE.

Is there a problem with IE settings, so that localhost websites doesn't hold cookies or something like that? Can anyone help me on this?

EDIT:
sorry I forgot to mention, I don't have permissions to edit hosts file, otherwise I could have created a virtual domain.
If other browsers can add products to cart, why not IE? I remember I have used loclhost in IE sometime back and it worked.


texts: need to disable cash on delivery to particular cities(not country), using magento 2

texts:
I am using magento 2. And I need to disable one payment method 'cash on delivery' to specific cities(not for countries).I found so many solutions but those are not meant for magento 2, I think those are for older versions.Because I couldn't find those files(or methods in the specified location) in my code. Can anyone help me ?
Any help will be appreciated.


texts: How to show Applied discount from Shopping Cart on Shipping Step Checkout Page Magento 2?

texts:
Please Check Attached screenshot:

On Checkout Page under Shipping Step i want to display Shopping Cart page applied discount Coupon Code and Amount.

Please check below code:

  app\code\Vendor\Module\view\frontend\layout\checkout_index_index.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="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="sidebar" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="summary" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="cart_items" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="details" xsi:type="array">
                                                            <item name="component"
                                                                  xsi:type="string">Vendor_Module/js/view/summary/item/details</item>
                                                        </item>

                                                </item>

                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                   </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

If Anyone having any idea please suggest, Thanks in Advance!!.


texts:
I'd like my logo to link to my homepage / when on my Indonesian side and the /en/ page when on the English side of the site. This is the code right now:

<?php echo $this->getLogoAlt(); ?><a href="<?php echo $this->getUrl(''); ?>" title="<?php echo $this->getLogoAlt(); ?>" class="logo"><img width="170" height="65" src="<?php echo $this->getLogoSrc(); ?>" alt="<?php echo $this->getLogoAlt(); ?>" />

What happens is the logo automatically links to /id/ which isn't my homepage. I've decided to go with the root as my homepage.

So essentially the problem is that on the Indonesian side everything links to /id/ when I want it to link to /

What is the php code that I have to replace

<?php echo $this->getUrl(''); ?>

with to make that happen?

Any help is much appreciated!


texts: What could be bad about using symbolic links with local.xml

texts:
Synopsis

First and foremost nobody likes to work on production applications.  Therefore it is advised and good practice for someone to set-up separate stores, my structure is as follows:

dev.magento.local -> Development store;
stage.magento.local -> UAT/QA store;
magento.local -> Production store;

Meanwhile the store is tracked in source control, including the app/etc/local.xml, which is the first conflict of this structure. Nevertheless once the Magento installation process has complete and we have the local.xml, the idea was to:

1) Export the recently installed however fresh Magento store.

icanhas$ mysqldump --single-transaction magestore_dev > magestore_dev.dmp.sql

2) Then import the structure for the remaining environments.

icanhas$ mysql -u'magestage_user' -p'magestage_pwd' < magestore_dev.dmp.sql
icanhas$ mysql -u'mageprod_user' -p'mageprod_pwd' < magestore_dev.dmp.sql

3) The new environments need their urls corrected, although that's beyond this question let's assume they've been done.

4) As previously mentioned, we need to solve the conflict with app/etc/local.xml so I created the following directories:

/app/etc/development/local.xml -> Moved local.xml here;
/app/etc/staging/local.xml -> Copied development/local.xml here;
/app/etc/production/local.xml -> Copied development/local.xml here;

5) I corrected the database credentials for each environment, this was committed to the repository.

6) Finally I had so create the following symbolic links:

On dev.magento.local; app/etc/local.xml -> app/etc/development/local.xml;
On stage.magento.local; app/etc/local.xml -> app/etc/staging/local.xml;
On magento.local; app/etc/local.xml -> app/etc/production/local.xml;

Questions

Could there be anything bad about using this method?
After installation does Magento write to this file at any point?

Any advice would be greatly appreciated.


texts:
I've tried adding:

<?php echo $_helper->productAttribute($_product,$_product->getName(),'name') ?>

to description.phml but receive an error.

Do I have to make a new block for  product name and then add that via local.xml?


texts: How to disable One Page Checkout on Mobile Magento 1.9.1

texts:
I have installed ONE ONEPAGE CHECKOUT on my magento store 1.9.1 and it works great on desktop but on mobile devices is not clickable. How can i disable it only for mobile devices? I am very beginners so I will apreciate some help.

Thanks
Anna


texts:
I wants to update magento2 theme.

What is standard way to do this or just override files?
It's same as magento 1.9?
Whats care should be taken before and after upgrading?


texts: enterprise_refresh_index Sleeping MySQL Connection

texts: There are times that the indexer that is ran by cron seems to get stuck at the MySQL as Sleeping connections can be seen. Indexer runs for several hours and this actually not running at all. I've searched for this but I couldn't find any related. Anyone who can shed a light? Possibly server configuration or Magento bug?


texts: Magento 2 - How To Display Cross Sell Products Against Each Line In Basket

texts:
I am looking to try and add Cross-Sell products against the specific product they are related to.

I understand that currently, the cross-sell products are shown on the cart page in relation to every product in the cart.

I would like it to be the following format:

  Product Added To Cart 1
  [Cross Sell For Product 1][Cross Sell For Product 1][Cross Sell For Product 1]
  Product Added To Cart 2
  [Cross Sell For Product 2][Cross Sell For Product 2][Cross Sell For Product 2]

This would ensure that a customer who buys an Oak Dining Table Can be prompted to buy matching Oak seats, side table, and TV cabinet. On the line below maybe they purchased some Flowers and need to be reminded that they should buy a vase, fertilizer, and watering can.

Many Thanks


texts: How to change only a specific image size in magento 2?

texts:
I have changed the below section of my custom themes' view.xml
<image id="product_page_main_image_default" type="image">
    <width>1200</width>
    <height>1552</height>
</image>

After that when I go to the product detail page image sizes are showing for the previous size only.
I run the php bin/magento catalog:images:resize it taking lot of time.
Is there any way to run the command for the specific change only.


texts:
I am developing a custom module with a custom block which displays a list of products.

My Block class:

use \Magento\Framework\View\Element\Template;

class Products extends Template
{
    protected $_productCollectionFactory;

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    )
    {
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($context, $data);
    }

    public function getHomeProducts()
    {

        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setPageSize(6);
        return $collection;
    }
}

.phtml file:

<?php
$productCollection = $block->getHomeProducts();
?>
<?php if($productCollection->count() > 0) : ?>

            <?php foreach ($productCollection as $product) : ?>

                    <a href="<?php echo $product->getProductUrl(); ?>">
                        <img src="<?php echo $block->getUrl('pub/media/catalog') . 'product' . $product->getImage(); ?>" alt="<?php echo $product->getName(); ?>" />

<a href="<?php echo $product->getProductUrl(); ?>"><?php echo $product->getName(); ?>

                    // here I would like to print the price

            <?php endforeach; ?>

<?php endif; ?>

I am trying to show product price in the phtml file but could not find proper way to show the price.

I now I can print it with:

  $product->getPrice()->getPrice('final_price')->getValue()

and searching which automatically prints the final_price, the special-price if these are present etc.

How can I achieve this?


texts: Async loading of javascript in Magento for PageSpeed

texts:
I'm trying to optimize my Magento 1.9.3 website, following Google PageSpeed hints, saying I have js and css that load synchrounously and block the page rendering.

To solve this issue, I'm putting all the javascript files with async loading, as advised in this answer.

So all my loaded scripts looks like this:

<action method="addItem"><type>skin_js</type><name>js/jquery.fancybox.2.1.5.min.js</name><params>defer</params></action>
<action method="addItem"><type>skin_js</type><name>js/jquery.fancybox.2.1.5.min.js</name><params>async</params></action>

This way, running PageSpeed again, gives better results.

The problem is that I get plenty of javascript exceptions, because probably the scripts that are inside templates files (.phtml), load before the script has been loaded.  This is worse, if I clear the browser cache and reload the page.
I've also tried an external module, pagespeed, but it also gives no better result on PageSpeed.
I've read other questions like this, for the best practices, but still don't get what is the best way to solve this "problem".

I mean, selecting which scripts should be loaded before the html, in order to make the 'above-the-fold' content to be working, seems crazy, but I also would not like to ignore PageSpeed Insights.

Any suggestion?
Thank you in advance.

EDIT
Actually the extension I've installed works pretty well even though it is causing some problems with my css.
Any chance to make things work WITHOUT any extension?


texts:
I'm observing email_invoice_set_template_vars_before event.

And i want to alter event data. I'm doing it like this:

$transport = $observer->getData('transport');

doMagic($transport);

$observer->setData('transport', $transport);

But, it won't alter the data. Outside of my observer.

I'm using very similar approach with email_order_set_template_vars_before event. Just with difference, that transport is object with setter and getters.


texts: Payment method in Checkout page issue in Magento 2.2.6

texts:
I am facing the serious issue which road block for the order placement in my Magento instance. I have made some customization in Checkout side. And it was working properly. Suddenly, I am facing this issue like, getting Payment method instead of Shipping address template.

I don't know what wrong with that, because no error is showing in console.


texts: Magento 2.3.4 JS Uncaught ReferenceError with custom payment method

texts:
I could need some help.
I've added a custom payment method to our shop following this tutorial:
https://webkul.com/blog/create-custom-payment-method-magento2/
So far so good, but after loading the checkout page we get the following error:
Uncaught ReferenceError: Unable to process binding "if: function(){return quoteIsVirtual == 0 }"
Message: Unable to process binding "if: function(){return isIncludingDisplayed() }"
Message: Unable to process binding "if: function(){return haveToShowCoupon() }"
Message: haveToShowCoupon is not defined
    at if (eval at createBindingsStringEvaluator (eval at require.load (b1654aa9974d62289672a4f5a5a23090.min.js:1)), <anonymous>:3:55)
    at ko.computed.disposeWhenNodeIsRemoved (eval at require.load (b1654aa9974d62289672a4f5a5a23090.min.js:1), <anonymous>:373:702)
    at Function.evaluateImmediate_CallReadThenEndDependencyDetection (eval at require.load (b1654aa9974d62289672a4f5a5a23090.min.js:1), <anonymous>:205:240)

Here is a simmilar problem: Uncaught ReferenceError: Unable to process binding "if: function(){return isExcludingDisplayed() }" After Magento 2.3.4 Upgrade Checkout Cart Page
The thing is i have'nt altered the shipping.js files.
And when i remove the payment method, the checkout is back in his normal state.
Does someone have an idea what file could have such an impact? Or where i could look to fix it? Or if you need more information, ask. I'll try to give you as many as possible.
Thanks in Advance!


texts: Catalog price rule to exclude some categories

texts:
I have to give $100 discount when cart subtotal is greater than $1000 and quantity is greater than 1 and also exclude some categories.

For example, if the cart have the following items from category ids 15, 76, 77, 78, 79, 80, 81, 200 then not give discount. It is working properly when items in cart only from category ids 15, 76, 77 at a time. But when I am adding some product from another category the coupon code is also applied.

In short, if cart contains items from 15, 76, 77, 78, 79, 80, 81, 200 with any other allowed category for discount then coupon code should not applied.

If cart contains items from 15, 76, 77, 78, 79, 80, 81, 200 then coupon code should be invalid.


texts: Magento 2 - Where is the template for sales/order/print/order_id/x

texts:
I am searching the template for the order PDF which is showing in checkout success when you click the "print receipt" link.
Where can I find it? I have to change the header.


texts: Eav attribute type int which input to use

texts:
I am currently creating some product attributes and some of them should be of type integer but Magento doesn't offer any input type for integer values.

If I use 'input' => 'text' it seems that Magento parses it into int and if I enter a correct int value it's stored correctly. On the other hand, if I enter a string value like "abc" it's just stored as 0.
I am not sure whether it's a good practice to just use 'input' => 'text' or if it has many risks and there's a better way to handle those cases. What could be the risks of using text as an input method?

I don't really want to use varchar for them because they are clearly numbers and parsing them to int with a backend_model is not a good approach either in my opinion. And using 'input' => 'price' too, due to it's a decimal indication.

Update
Based on the comment of Alex is it okay to use combinations of 'input' and 'type' that are not used when you create a attribute from backend or what could be risks of that??


texts:
I'm building a Magento site for a client in Sarasota. I'm having an issue with the sales tax, Sarasota is a discretionary surtax county, and as a result I need to add a tax of 1% for the first $5000 of each sale for any orders with a billing address in FL.

Are there any extensions that can achieve the desired functionality?


texts: Magento custom option text field max length

texts:
Previously when it was specified, Magento used to honor the max character length for custom input fields, so if I set that to two characters (for initials), it would not let the customer type in more than two characters.

Now I see that even though the note underneath the text field still says maximum two characters allowed, I can type in as many characters as I want. Anyone know how to troubleshoot such problem, I checked my browsers console and see no JavaScript errors being thrown there, any help is welcome.

Thanks in advance!


texts: How to remove Default Grand Total from View Order Page Backend in Magento2?

texts:
How to remove Default Grand Total from View Order Page Backend.

As I have added new Grand Total and Modified Existing once, now I have to remove Core Magento Grand Total and Set my Customize Grand Total.

Please check Attachment also.


texts: How to input store location for each product?

texts:
We want to offer our online customers the possibility to have same day order delivery. But it will be available only if the customer is located 2/3 miles from the store that has the product they want to buy? (We have 5 physical stores)

For that, first of all, we need to input store location for each product. Where should I input this? is there the possibility in Magento Catalog to update product/store location( Address and Postcode) for each product?


texts:
I tried all ways to enable debug but it doens't work.
I modify all box on dashboard about debug on "Yes". I tried to use command line with "bin/magento setup:config:set --enable-debug-logging=true" and cleaning cache but it still doesn't working.
(Version 2.3)


texts: Font from origin as been blocked from loading by Cross-Origin Resource Sharing policy on multiple websites magento

texts:
I have created two websites using one magento installation, like:

abc.com (original)
xyz.com (second domain)

Both are working fine except the fonts issue I got on sub domain (second website). Error is:

  Font from origin 'abc.com' has been blocked from loading by
  Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin'
  header is present on the requested resource. Origin 'xyz.com' is
  therefore not allowed access.

I have add the following code to .htaccess of main site but not working.

.htaccess code:

<FilesMatch "\.(ttf|otf|eot|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "xyz.com"
    </IfModule>
</FilesMatch>
<IfModule mod_headers.c>
    <FilesMatch "\.(svg|ttf|otf|eot|woff|woff2)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>


texts: How to change ajax load for magento2 ui_component form

texts:
I have created a ui_component form in magento custom module. Below is my ui_component file

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            ...
        </item>
        <item name="label" xsi:type="string" translate="true">Grid</item>
        <item name="config" xsi:type="array">
            ...
        </item>
        <item name="buttons" xsi:type="array">
          ...
        </item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
    </argument>
    ...
</form>

Uisng this my form loading using ajax after page load , But I want to load form on page load.

Is it possible in magento2 or for this I have to create my own template? If so then How to do?


texts: Modify core tables vs custom tables and joins

texts:
I'm aware that there are multiple different ways of adding a custom column to the order grid, from overloading the block to custom layout handle with event observer for loading data. My question is more about where this custom data should be stored. Historically speaking we have achieved this by adding custom columns to the sales_flat_quote, sales_flat_order and sales_flat_order_grid tables as appropriate and copying the data over using the fieldsets in the configuration.

This process works and has suited our needs to this point, however modification of core tables in this manner feels a little dirty. This approach could cause issues with later upgrades to Magento and multiple modules working in this manner could cause compatibility issues with third party modules. This seems especially concerning in the case of us deciding to distribute an extension.

The only other approach that springs to mind is if our Cool_Feature extension was to create it's own cool_feature_order_extra table, probably with a foreign key reference to the sales_flat_order table, that we can then join whenever we need the information.

Is there a alternative (neater?) approach which I've neglected?
Is there a 'Magento best practice' way of doing it?
Has anybody ran into any issues with either approach?


texts: Magento 2 Authorize.net and Billing Information loaded simultaneously

texts:
I am having virtual products in my magento store and want to use authorize.net in the checkout process.

However, when I activate the authorize.net checkout it seems that the billing information and the credit card fields are loaded automatically.

As you can see, I have right below the billing information the "Cancel" and "Update" button. So in order to be able to place the order, I would have to enter the billing information, click UPDATE, then enter the credit card information and then place the order.

This seems a bit weird to me, however i tried it on different magento installations and it always looked the same... Is there any configuration option I might be missing? Or any way I can omit the UPDATE step somehow?

Thanks for your help!


texts: How to add Continue Shopping button in checkout page Magento 2

texts:
We are trying to add "Continue Shopping" button after "Next" button in checkout page Magento 2.
We found that below file is the .html rendering the content.

\vendor\magento\module-checkout\view\frontend\web\template\shipping.html

Can any one help me on how to add "Continue Shopping" after next button.


texts: How to set write permission to folder in magento 2 in windows?

texts: I want set write permission to folder pub/static in magento 2 in windows localhost. can anyone help me how to set write permission to folder usig CLI.


texts: How to change a number of rating stars - Magento 1.9.2

texts: I want to know how to add one star to the rating stars to become five. Im using a potor theme.


texts: Need to define UPS Declared value in magento for Orders cost $100 or more ? My shipping cost is coming different

texts: Need to define UPS Declared value in magento for Orders cost $100? My shipping cost is coming different for order values $100 or more. Please suggest.


texts: When remove module in magento2 still issues showing

texts:
I removed the module in magento2 but it showed error after running the commands. can someone help me?

php bin/magento module:disable Vendor_Module
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f en_US

and flush the cache also. Still issues like

  Exception #0 (ReflectionException): Class
  Vendor\Module\Model\Attribute\Source\Menutype does not exist.

Thanks