texts: how to change the success message of newsletter subscription?

texts: I want to change the success message content after the newsletter subscription.Can anyone tell me where the success message template resides in magento?


texts: How to set Paypal Website Standard New Order Status as Complete instead of Processing?

texts:
I have a problem with my new order status when using Paypal website payment standard. When payment is complete with PayPal, it sets the order status to processing while I want it to be complete.

The payment works fine. The problem is that the order status is stuck in processing. Of course I Know i could set it to complete manually.

How do I get it so that orders are automatically set to complete? i.e. I don’t want to do so this manually, each time an order is complete via PalPal, I want the status to be “complete”.

The above content is mostly from an old post from a couple of years ago, no one really answered this question.


texts: Clicking on a product on a category page just routes me back to the parent category

texts: In my Magento 2 store whenever I click on a product in a category page I get routes to the parent category page instead of going to the product page. Is this a url rewrite issue? Duplicates?


texts: Magento 2 - Stuck Checkout loader and Javascript error

texts:
I recently upgraded from Magento 2.0.7 to Magento 2.1.2

After the upgrade, I keep running into this issue with a stuck checkout loader and the following javascript error message when I begin the checkout process:

  region.js:59 Uncaught TypeError: Cannot read property 'indexedOptions'
  of undefined

I have cleared cache, static-content, and so forth with no avail on fixing the problem. Not sure how to go about fixing this issue.

I attached an image of what is happening, and a screen grab of the javascript error presented by the console on the browser.


texts: How do I run code if and only if certain items are successfully added to the Cart?

texts:
I have 4 products with IDs:

FreeSilver = 9575
Silver = 9576
Gold = 9577
Platinum = 9578

If anyone adds those specific items I want to run different codes to update customer attributes.

is checkout_cart_product_add_after EVENT observer the best way to do this?

Thanks.!


texts: Incorrect inventory when saving a product as an order gets placed

texts:
I experienced the following behavior in Magento 1.7.0.2:

Edit product
Go to inventory tab
View inventory

In my test inventory on the product was sitting at 9 units.

I place an order for the product on the front-end whilst keeping the product edit page open
After the order is placed, I click Save on the product edit page (while inventory is still at 9)

Now inventory is sitting on 7 (in other words, 2 units deducted) even though only 1 was ordered.

I repeated this by placing the order in a similar fashion in the back-end, and experienced the same behavior.

Is this just me or do your sites behave similarly? If so, how can this be resolved? I haven't found any official bug report.

Edit: If you view the product inventory level in a new tab after having just placed the order, it seems like the stock level is correct. However, once you click Save on your open tab (whilst editing), the inventory is then reduced by 2 units.

Edit 2: I've posted what I think may be the solution to this issue.

So am I correct in saying that the answer I posted is a solution?
Can anybody think of any problems this change may have?
What exactly were the dev team thinking with the setQtyCorrection method?


texts: Magento 2 - Configurable product get all options and for out of stock add product alert

texts:
How can I display all configurable options including the products which are out of stock?

Also, for out of stock products can we set notify me when in stock as it is done for simple products?

I am using Magento 2.3

Can this me done by setting system configuration or programmatically?


texts:
While installing Magento 2 (the recent stable version is Magento 2.0.7), I used different ways except archive/download.

The first used is Git clone:

$ git clone -b 2.0 git@github.com:magento/magento2.git

Then, another one is Composer

$ composer create-project --repository-url=https://repo.magento.com/magento/project-community-edition magento2

Then, the rest of the installation procedures are the same. And both ways could setup Magento 2 properly.

Whey use "git clone..." created the app/code/Magento, but compare with "composer create-project..." the app/code is empty?

Is "app/code/Magento" does not exist won't affect any other procedures?
Such as installing 3rd party module or self created module in "app/code/Custom_module"?


texts:
When you save a customers address trough API you have the option to GetFax() and SetFax() but if i look at my backend i don't see Fax anywhere in the addresses

Anyone any idea if there is a setting or something to enable/disable that field?

Even though i do find that field in the database and i can SetFax() that field


texts: Proper exception list for iPhone - Android etc theme

texts:
I am using this list for our iPhone theme

iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini

We see the theme when viewing from a testing site (Virtual phone) but when I look at it on a real phone we are getting the default theme? We are using Saucelabs.com for testing.


texts: Magento2 : Adding my own Background Image to a Custom Theme

texts:
I've added a custom magento theme, and now im trying to add a background image to it.

But the dev console in chrome & firefox keeps saying:

"Could not load the image".

I've put the image in both of these directories:

/web/css/source/images/brushed_alu.png

/web/images/brushed_alu.png

And then my _extend.less is:

body {
  background: #fff url(/images/brushed_alu.png) top center;
}

I've cleared cache and static files, but it just igves me the "Could not load the image" error in both chrome & firefox.

Any ideas?


texts: Magento 2: Does dependency injection affect performance?

texts:
I was wondering if dependency injection can be bad for the performance of the website.

For example:

Let's say that I'm building a helper class for my module and it contains a lot of useful methods that use a lot of injected dependencies (let's say 20+), but, not everything is always needed at the same time (so it's not really a "dependency" for the whole helper class).

Now, I know that it's good practice to use the constructor in order to inject the dependencies (and also that it's better for allowing overrides using di.xml), but wouldn't it be more efficient in terms of performance to load the dependencies on demand using the object manager?


texts: Magento 2 setup:static-content:deploy symlinks

texts: When removing all the pub/static files in Magento 2 and opening the homepage, the files are generated as symlinks. When using the command setup:static-content:deploy the files are copied, even after setting the deploy mode to developer with the command bin/magento deploy:mode:set developer. How can I get the static generated as symlinks from terminal, as in the browser it takes much more longer?


texts: Add New Functionality on Overridden Module

texts:
Currently, I am trying to add new functionality whereby customize the City field from text to select in edit address book page. I made this change on my own module (path: local/Company/NewDirectory) and result is working fine at the frontend.

Then, I decided to move this functionality to overridden module. However, I am confused in defining the class prefix in the config.xml for this functionality.

<config>
<modules>
    <Company_Directory>
        <version>0.0.2</version>
    </Company_Directory>
</modules>
<global>
    <helpers>
        <directory>

            <rewrite>
                <data>Company_Directory_Helper_Data</data>
            </rewrite>
        </directory>
    </helpers>
    <models>
        <directory>

            <class>Company_Directory_Model</class>
            <resourceModel>directory_resource</resourceModel>
        </directory>
        <directory_resource>

            <class>Company_Directory_Model_Resource</class>
            <entities>
                <region_city>

directory_region_city

                </region_city>
            </entities>
        </directory_resource>
    </models>
    ...
</global></config>


texts:
I need to calculate the shipping price based on the condition Weight Vs Destination in Magento 2. when I added a product of particular weight then I got preferable shipping price, But when I tried to add more no of the same product to the cart I found that the table rate is not changing based on the increased weight. So please suggest me how to add the weight values in the table rate CSV file. For now, I have used '*' in the weight( and above) column. The figure below shows the CSV file I imported to Magento 2 Table rate shipping method.

I am adding my results from the checkout page
This is the expected result given below

The image below shows the result I am getting on my website. Here the table rate calculations are not increased as the weight is increased.


texts: Exception: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket

texts:
I have installed Magento Community Edition 1.9.0.1 on Digitalocean application. I extracted the error report and listed below, can you help take a look and let me know what to do in order to fix?

a:4:{i:0;s:109:"SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)";i:1;s:2884:"#0 /var/www/html/magento/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /var/www/html/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /var/www/html/magento/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /var/www/html/magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /var/www/html/magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /var/www/html/magento/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /var/www/html/magento/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /var/www/html/magento/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /var/www/html/magento/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /var/www/html/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /var/www/html/magento/index.php(87): Mage::run('', 'store')
#22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}


texts: Removing Header and Footer from CMS page

texts:
is it possible to remove both the header and footer and only display the contents of a CMS page?  If so, how?

Currently the html looks something like this by default:

...

...

...

Thanks in advance for any elucidation.


texts:
I have tried to edit the title and make all the letters capitalize in file app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml but it doesn't works on the frontend. The add to cart is visible as "Add To Cart", And I want it like "ADD TO CART"

Thanks


texts:
I am trying to add a number of items in cart given an array of product Ids but it  is adding only the first product.

 $approverCart= Mage::getSingleton('checkout/cart');
 foreach($itemIds as $itemId){
 $item = Mage::getModel('sales/quote_item')->load($itemId);

      $qty= $item->getQty();
      $productId= $item->getData('product_id');
      $pModel = Mage::getModel('catalog/product')->load($productId);
      $approverCart->addProduct($pModel, array('product'=>$productId,'qty' => $qty));
      echo $productId." ".$qty."<br>";
      $approverCart->save();

      }


texts:
How do I list categories dynamically on Magentech Megamenu? Currently, I can only create static items then drag-drop them to other items to make their children. Is it possible for the mega menu to create a dynamic category list?

Magentech Mega Menu 3.2.0,
Magento 2.3


texts: How can I add a model to a custom module?

texts:
I'm extending custom module. One of the functions using dynamic models load, based on input param

$reportProcessor = Mage::getSingleton(
    'amreports_reports/' . $data['report_type']
);

If I creating my new $data['report_type'], I need to add a new model. How can I do this for existing module?


texts:
We have magento 2 site.
We use Ves Megamenu for main menu.
Menu working properly in front side.
But when edit from admin side; menu open; then also open 'Menu Editor'.
But when we click on 'Expand All' button not open any menu.
We get error in consol 'Uncaught ReferenceError: Unable to process binding "click: function(){return addItem }"'
Any person help me for solve it.


texts: Braintree Integration "Unable to place order. Please try again later." - Magento 2.1-rc3

texts:
I'm working the Braintree integration, I have Magento 2.1-rc3 installed.

Two issues are happening:

1) Error: "Unable to place order. Please try again later." and Magento redirect to Shopping Cart again.

In this case I checked the debug.log and it shows the status of Submitted to Settlement, it is communicating normally with Braintree, I can find the tests there, but all of them shows "Submitted to settlement" and the order don't go through.

I'm using amounts of $139, $85.90 and the test credit card:

5555 5555 5555 4444

07/17

111

It should go through. Or at least, Magento should show the some more friendly error to the user, maybe to try a different credit card.

2) Credit Card fields disabled in Google Chrome.

The payment option shows up, the fields are there, but there is no way to type in, they seems to be disabled.


texts: Magento 2 - Layered Navigation for Custom Product Collection

texts:
I created a CMS page for products that contain a certain attribute (On Sale Items).
I extended the ListProduct class and added filters to the product collection to achieve the desired results. (modified the _getProductCollection method).

I was able to add the toolbar and pager (with accurate counts).

However, I cannot seem to get the layered navigation to work.  I added the default layered navigation classes to my CMS page XML.

It shows the layered navigation for the entire catalog but I know that I have to extend the class or classes that render it to show my custom collection.

I have tried extending the product collection classes in layer.php and navigation.php with no luck (added collection filters).

I know that in Magento 1, you can extend the product list and layer classes(located in list.php, view.php, and layer.php if I remember correctly), add the desired filters, and render the custom classes in the CMS page.

I know that people have come across a situation in which they need to create a Clearance, On Sale, or any other CMS page where a custom product collection is used, and needs layered navigation.

Any ideas on how to achieve this in Magento 2?


texts: Can't see British Pound in currency switch Magento 2.2.2

texts: I have Magento 2.2.2 with multi store view, My base currency is Euro, seconde USD and I added British Pound, the problem I can't see the British Pound in the dropdown switch for currency choice I deleted the cache,  same problem.


texts:
AFAIU Magento zoom spot size is defined via CSS (square by default). It takes a large product image and fits it in by the short side and then allows to zoom it to actual size.

So for example if I have a 200x200px spot and 900x3000px image I will only get a top square part of my image inside of the spot and the rest can be zoomed in.

Is there a chance to make it that Magento takes along side of an image for initial downsizing and displays its full length from the start filling it with white spaces to a square?


texts: How to change parent category for an existing child category?

texts: I have a child category and its parent category. How can I change parent category for this child category? Programatically, in a module helper.


texts: Magento 2 Random Order/Invoice/Shipping number

texts: I am looking into ways to implement random sequence for Order/Invoice/Shipping number and make sure they are unique in there entity type. Is there a way to make it correct? Since i know that it is generates/calculates in Magento_SalesSequence module here https://mage2.pro/t/topic/511


texts: Login/Registration pages error/success messages don't show

texts:
i have migrated a magento 1.9 server to a magento 2.3 server.
everything went fine and i am really happy with that.
my only problem is that the page messages on the login and registration page don't work.
so when someone uses an already used email on registration or a wrong password on login the only thing that happens is a reload of the page.
I have been searching for a solution for the last 2 days  with no result. Could someone more experienced show me the way of what to check to debug this?
thank you, and sorry if this is a stupid post. Nothing works.
EDIT:

I have checked that the block is in place with the placeholder. And it is.
I have checked that the cookies work. What i have found is that the mage-message cookie value does change but remains empty.

Any suggestion on what else to check?  thank you.
is it possible this happens because of varnish?


texts:
we have Magento 2.1.7ce and would like to add the MailChimp popup to our homepage.

We currently don't have access to the FTP/SSH so we have to do this with the cms pages.

When i add this code to a CMS page:

<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us7.list-manage.com","uuid":"xxxxxxxxxxxxxxxxxxxxxxxx","lid":"xxxxxxxxxxx"}) })</script>

And access the firebug console sees it's trying to load files from the static files:

"NetworkError: 404 Not Found - https://server.com/static/frontend/Theme/customtheme/nl_NL/mojo/signup-forms/Loader.js

"NetworkError: 404 Not Found - https://server.com/static/frontend/Theme/customtheme/nl_NL/dojo.js"

How can I fix this? Or is it not allowed to use JavaScript in cms pages?


texts: how to rewrite AccountManagement model of customer in magento 2(ver. 0.42.0-beta2)?

texts:
I want to rewrite activate function of AccountManagement.I don’t know how to proceed.

According to documentation

A public interface is a set of code that third-party developers can call, implement, or pluginize. Magento guarantees that this code will not change in subsequent releases without a major version change.

Public interfaces for a module reside in the Api folder for a module. For example, the public interfaces for the Customer module reside in the app/code/Magento/Customer/Api folder. Third-party developers should use only these interfaces. You can use other interfaces but Magento does not guarantee that other interface will not be modified or removed in subsequent releases.

1.I need to rewrite AccountManagementInterface or AccountManagement?

2.It is necessary to use di.xml?

3.following is correct?

<preference for="Magento\Customer\Api\AccountManagementInterface"
                type="Mynamespace\Mymodule\Model\AccountManagement" />

Thanks in Advance.


texts: Magento adding CSS and JS includes to the footer

texts:
I'm doing some Yslow optimization of my Magento site and am trying to add the CSS and Js to the footer of the site.

At the moment I'm using a head reference tag in the layout XML and using addJs and addCss actions to include all my files. I tried swapping the head reference to footer, but was given an error when I tried to view the site. Is there a way of doing this in local.xml  or does this have to be done hardcoded in the footer template file itself?


texts: Error: Class 'IntlDateFormatter' not found in AbstractFactory.php Magento 2.4

texts:
I checked all the similar issues related to this topic and almost everyone says to install php intl module.
However I have it installed and loaded.
Did anyone have similar issue?
Magento 2.4
php7.4
Debian 10
Fresh installation
All the cache flush reindexing, seutp:upgrade done as well
regards
Piotr


texts: How to force shipping quote and order totals calculation on shopping cart page?

texts:
I have a store where, after the customer logs in, predefined products are added to shopping cart and the customer is directed to the shopping cart page. The customer has shipping country defined and this is set to quote.

This is done in customer_login observer.

The problem is that when the customer enters to the cart, it shows default country in the Estimate Shipping selector. Only after page reload the Shipping estimator and totals calculation is run, using the correct shipping country set before.

How can I force the calculation so that correct amounts are shown when the customer lands on the page?


texts:
We have a Magento website that a customer cannot proceed to checkout in IE11.  It hits the one step checkout page, and redirects back to the shopping cart.  The contents are still in the cart.  The ssl is valid and working.  Works in IE11 on other computers, along with Firefox, Chrome, and Safari.

Cleared cache, cleared browser cookies, did a complete IE11 restore.  Flushed their DNS. Still same thing, when they hit proceed to checkout on the shopping cart page it redirects back to the cart.

Any ideas?


texts: Product custom option delete while edit product programmatically

texts:
I have added a custom option in product from the back-end.

After that when I tried to update the product programmatically but Facing an issue: When I edited the product all the custom options of product has been deleted.

It removes all options while editing a product. I have checked all entries in the database that's also get deleted.


texts: Magneto 2: How to add a configurable product with custom options in cart

texts:
I am trying to add configurable product with it's custom options. Right now I have a swatch with 2 custom options. Whenever I try to add that product It just add the swatch value. It doesn't add the custom options in the cart. My params variable is defined as below:
$requestParams = ['product' => $productId, 'qty' => $qty, 'super_attribute' => $variationArray, 'options' => $options] ;

When Their is no swatch and only custom options, I am able to add product in cart with custom options by below code:
$requestParams = ['product' => $productId, 'qty' => $qty, 'options' => $options] ;

Please help me so I can add product in cart with custom options and swatch value together.


texts: How to create a custom menu in account dashboard in magento

texts: How to create  a custom menu in customer account dashboard in magento


texts:
php bin/magento dev:source-theme:deploy

What is the use of this above command?
Explain briefly.

Thanks


texts: Customer account dashboard showing orders from wrong customer

texts:
The recent orders section of the customer dashboard of my website is showing the orders for the wrong customer. However, on the sales/orders section of the Magento backend are correctly associated.

All I've done recently is migrating the database from Magento 1.9.0.1 to a new database for the website running Magento 1.9.1.1

Could anyone please help me solving this?


texts: Magento1- How to add custom field in custom module form like a tier price in product

texts:
Here I have got this error, when add this file.. What i have to do???

Fatal error:

Uncaught Error: Class 'Sharesoft_Donations_Block_Adminhtml_Donations_Edit_Tab_Amount' not found in D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php:491

Stack trace:

#0 D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('Sharesoft_Donat...', Array)

#1 D:\xampp71\htdocs\magento\app\code\local\Sharesoft\Donations\Block\Adminhtml\Donations\Edit\Tabs.php(24): Mage_Core_Model_Layout->createBlock('donations/admin...')

#2 D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(922): Sharesoft_Donations_Block_Adminhtml_Donations_Edit_Tabs->_beforeToHtml()

#3 D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()

#4 D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(923): Mage_Core_Block_Text_List->_toHtml()

#5 D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(641): Mage_Core_Block_Abstract->toHtml()

#6 D:\xampp71\htdocs\magento\app\co in D:\xampp71\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 491


texts: Magento 2 display configurable Price Range in product listing

texts: I want to display price range for configurable products instead of the minimal price in category listing.


texts: Load extra category to a category product list page

texts:
I'm trying to achieve a custom layout that displays two categories on a specific page.

For example, I have a New Arrivals page that lists the products for this category with a category ID of 5. On this page, I want to also show 12 products that are in their own category of Top Picks with a category id of 15.

So far, I've successfully created a new layout and updated the category page to use this layout for a custom design.

NOTE: We use ManaDev's AJAX product and filter plugins to do sorting, etc. This feature would have to work for both categories that are being loaded onto the page.

I've created a module called Newarrivals which contains a Lists.php block and config.xml file.

The Lists.php block extends the Mage_Catalog_Block_Product_List.

I've tried manually setting the category ID's in the _getProductCollection function and push each array of products into another associative array and display them in the layout.

In my layout.xml file I've done something like this:

<new_arrivals_layout>
    <reference name="head">
        <action method="addItem">
            <type>skin_css</type>
            <script>css/responsive-catalog.css</script>
        </action>
    </reference>
    <reference name="content">
        <block type="tm_newarrivals/lists" name="lists" template="tm/newarrivals/lists.phtml"></block>
    </reference>
</new_arrivals_layout>

I guess my first issue is that the lists.phtml block is not rendering. But I was getting an error at one point where it was saying I can't set the current page value on a null value, or something similar to those lines.

Here's the config.xml for my module:

<?xml version="1.0"?>
<config>
  <modules>
    <TM_Newarrivals>
      <version>0.0.1</version>
    </TM_Newarrivals>
  </modules>
  <global>
    <blocks>
      <tm_newarrivals>
        <class>TM_Newarrivals_Block</class>
      </tm_newarrivals>
    </blocks>
  </global>
</config>

Here's a shortened version of Newarrivals/Block/Lists.php

class TM_Newarrivals_Block_Lists extends Mage_Catalog_Block_Product_List
{
  /**
   * Retrieve loaded category collection
   * @return Mage_Eav_Model_Entity_Collection_Abstract
   */
  protected function _getProductCollection()
  {
    $categories = [5, 15];
    foreach ($categories as $id) {
      // Code to get products and push into array.
    }
    // Other code
    return $this->_productCollection;
  }

Any insight or ideas would be greatly appreciated.


texts: Getting the order object from observer issue in Magento 1

texts:
Is there a way to get the order object from this event

controller_action_postdispatch_checkout_onepage_saveOrder

Apparently it doesn't know about the order by using this:
$observer->getEvent()->getOrder() .I know I could use the save order after or before event, but I would like to use that event . Is there a way to get the order object from that event ?

Thank you !


texts:
I have an attribute set, men's apparel and I have added to attributes;
color and size.

When I go to add a product, I select the mens apparel attribute set and configurable product. Then i get a screen with 2 checkboxes, color and size.

If I check both boxes and select continue, neither shows up. If i go back and check the color box only and click on continue, the size box only shows up. and the opposite is true. any help would be sincerely appreciated.

both items are set to global and Use To Create Configurable Product "Yes"


texts: I need to add some extra fields to the existing customer address form in magento. Please help.


texts: Magento2: how override translates in language pack?

texts:
I installed language pack in app/i18n/magento2translations/language_nl_nl/ with file nl_NL.csv It's works perfect.
Also, I added in custom theme file app/design/frontend/COMPANY/PROJECT/i18n/nl_NL.csv with my custom translates, but it not working (mode: developer, static content and caches were cleaned).When I move custom translates to language pack's nl_NL.csv custom translates works fine.
I think the language pack has more priority as a custom theme i18n translates.
How override translates in language pack in the correct way?


texts: How to call static block into plugin Processor php file in magento2

texts:
How to call the static block into magento2 plugin processor php file.

thanks


texts: How to initiate tabs widget when all payment methods are rendered

texts:
I want to initialize tabs widget on payment methods on checkout.
How would I know if all the payment methods are rendered and it is now safe to initialize tabs.
Thanks


texts: Custom product listings based on data from 3rd party datasource

texts:
We need to display the product listings based on data from a 3rd party datasource. We have populated a category with all the products (700+). A customer may see a sub section of products i.e. upto 450 products, based on criteria passed to the 3rd party datasource.

We are using the SKU as point of reference in both data sources. We only want to display products that appear in both datasources.

At the momment we are looping through the loadedProductCollection in the catalog/product/list.phtml file to check if the product sku code exists in the other data source if so then display the magento product. This works but the paging is completely wrong.

I need to address this issue, but I don't know magento well enough to undertake such a major change or location of the files necessary to change.

Any help would be very much appreciated.

EDIT

I have extended the Mage_Catalog_Block_Product_List class see below:

class MyCompany_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
{

    protected function _getProductCollection()
    {
        Mage::log( "MyCompany_Catalog_Block_Product_List _getProductCollection() called" );

        if (is_null($this->_productCollection))
        {
            $layer = $this->getLayer();
            /* @var $layer Mage_Catalog_Model_Layer */
            if ($this->getShowRootCategory()) {
                $this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
            }

            // if this is a product view page
            if (Mage::registry('product')) {
                // get collection of categories this product is associated with
                $categories = Mage::registry('product')->getCategoryCollection()
                    ->setPage(1, 1)
                    ->load();
                // if the product is associated with any category
                if ($categories->count()) {
                    // show products from this category
                    $this->setCategoryId(current($categories->getIterator()));
                }
            }

            $origCategory = null;
            if ($this->getCategoryId()) {
                $category = Mage::getModel('catalog/category')->load($this->getCategoryId());
                if ($category->getId()) {
                    $origCategory = $layer->getCurrentCategory();
                    $layer->setCurrentCategory($category);
                    $this->addModelTags($category);
                }
            }
            $this->_productCollection = $layer->getProductCollection();

            /*
            ////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                        Custom Code starts here
            ////////////////////////////////////////////////////////////////////////////////////////////////////////
            */

            if (Mage::getSingleton('customer/session')->isLoggedIn())
            {

                $_skuArray = array();

                // Call 3rd party datasource to get customer sku codes and store in array

              $this->_productCollection->addAttributeToFilter('sku', array('in'=>$_skuArray));

            }

            /*
            ////////////////////////////////////////////////////////////////////////////////////////////////////////
                                                        Custom Code finishes here
            ////////////////////////////////////////////////////////////////////////////////////////////////////////
            */

            $this->prepareSortableFieldsByCategory($layer->getCurrentCategory());

            if ($origCategory) {
                $layer->setCurrentCategory($origCategory);
            }
        }

        return $this->_productCollection;
    }
}


texts: Listing page product grid design not applied on home page

texts:
I am trying to add category products on the home page using widgets, the product grid is shown without design what I made on the listing page.
Listing page product grid :

I moved wishlist icon from bottom of the product to top right corner and update the wishlist icon image
Added On sale label on bottom left corner of the image
Added free delivery condition on botton of the product grid.

Home page :
Using widgets to get category products.
The default design is only shown, how to include my listing page design.
I have developed a custom theme inherit from the blank theme.


texts: Make Google reCaptcha field mandatory on a custom form (works fine on contact us and login form but not on a custom form)

texts:
I have a custom form and need to make recaptcha a mandatory field. It works just fine on a login and contact us page but not a separate custom form.
code for a .phtml file is below-
<?php
$url = $_SERVER['REQUEST_URI'];
$productName =  parse_url($url, PHP_URL_QUERY);
$productName = str_replace("%20"," ",$productName);
?>

<form class="quoteform" action="<?php echo $block->getBaseUrl().'quote/index/post/';?>" id="quoteform" method="POST">
 <class="pro_name">
Quote for: <?php echo $productName?>

  Organisation Name:
  <input type="text" id="organisation" name="organisation" value="" data-validate="{required:true}" placeholder="Organisation Name">
  Contact Name:
  <input type="text" id="contact" name="contact" value="" data-validate="{required:true}" placeholder="Contact Name">
  Email:
  <input type="email" id="email" name="email" data-validate="{required:true}" placeholder="Email Address">
  Quote For:

   <input type="hidden" id="productname" name="productname" value="<?php echo $productName?>">
    Contact Number:
  <input type="text" id="telephone" name="telephone" value="" placeholder="Phone Number">
  <textarea name="comment" placeholder="Comment"></textarea>

  <input type="hidden" name="all_sizes" value="No">
  <input type="checkbox" placeholder="I 'd like a free trial" name="all_sizes" value="Yes" checked>&nbsp; I'd like a free trial

  <div class="g-recaptcha" data-sitekey="<?php echo '6LeeiO0UAAAAAMsNCF6nM5ORROe21Ony' ?>" data-validate="{required:true}">

  This is a required field.

  <input type="submit" class="submit-form">

</form>


texts: Input field name is not populated on checkout page shipping address

texts:
I want to add a new field to my shipping address section on checkout page, I was able to achieve it by below code.

<item name="shippingAddress" xsi:type="array">
    <item name="children" xsi:type="array">
        <item name="shipping-address-fieldset" xsi:type="array">
            <item name="children" xsi:type="array">
                <item name="location" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
                    <item name="label" xsi:type="string">Location</item>
                    <item name="provider" xsi:type="string">checkoutProvider</item>
                    <item name="visible" xsi:type="string">true</item>
                    <item name="sortOrder" xsi:type="string">200</item>
                    <item name="config" xsi:type="array">
                        <item name="template" xsi:type="string">ui/form/field</item>
                        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
                        <item name="tooltip" xsi:type="array">
                            <item name="description" xsi:type="string" translate="true">Search your location.</item>
                        </item>
                    </item>
                </item>
            </item>
        </item>
    </item>
</item>

The field is added to shipping address form but the name attribute is null. I need to set it as location but it always stays null. I have tried adding name and inputName attributes to xml but nothing seems to be working. Please check below as the html generated for my field.

<input class="input-text" type="text" data-bind="
    value: value,
    valueUpdate: 'keyup',
    hasFocus: focused,
    attr: {
        name: inputName,
        placeholder: placeholder,
        'aria-describedby': getDescriptionId(),
        'aria-required': required,
        'aria-invalid': error() ? true : 'false',
        id: uid,
        disabled: disabled
    }" name="" aria-invalid="false" id="YCYKNDR">

Do anyone have any idea how we can set name attribute for input field on shipping address section?


texts: Issue in Magento site after migration to AWS

texts:
I am new to Magento, I have a task to migrate the Existing website built with Magento to AWS cloud(EC2)

Existing Magento Version - 1.9.1.1. I do not want to Upgrade it, as it is out of our scope of work.

I have Migrated all the source files and Database from old server to EC2 instance, So far so good.

After i point the DNS A record to new IP address, a blank page was showing, further debugged and changed as per https://stackoverflow.com/questions/35611696/fatal-error-uncaught-error-function-name-must-be-a-string-in-c-xampp-htdocs-e
from

$out .= $this->getBlock($callback[0])->$callback[1]();

to

$out .= $this->getBlock($callback[0])->{$callback[1]}();

Web Pages are Partially loading.

Now below lines are getting displayed and Product detailed page is also not working

getChildHtml('topContainer'); ?>
getLayout()->createBlock('cms/block')->setBlockId('banner-block')->toHtml(); ?>
getChildHtml('cms_footer_links') ?> getChildHtml('footer_links') ?>

Please Help in getting this resolved.

New Environment running on  - PHP 7.2/Mysql/Apache

URL : http://viviscal.ae/


texts:
I have multi websites in one magento. Magento version is 2.3.2
I have multiple categories in magento. I am showing here for "es" store view code.
https://localhost/catalizadores (Without slash at the end) redirects to https://localhost/es/catalizadores/
but
https://localhost/catalizadores/ (With slash at the end) does not redirect and is the same page as (https://localhost/catalizadores/)
So now i have 2 Urls for the same category page
https://localhost/catalizadores/
https://localhost/es/catalizadores/

I want always this URL https://localhost/es/catalizadores/ (Always with store view code)
How can i achieve this? Any idea? I have multiple category URLs so i am not preferring to add in .htaccess file.


texts: Shopping cart rule actions to stop sale items being discounted

texts:
I have a coupon code currently set that applies 10% off an order. I would like to be able to set the actions so that the items i have in the sale category will not be allowed to be applied at checkout. Currently the rule allows the coupon to be applied to both sale and non sale items.
I ultimately would like a customer to only be able to get the 10% discount on the non sale items at checkout even if they have both a sale and non sale item in the cart.

Any assistance would be appreciated.
Mike


texts:
This unanswered question is asked by someone else. And I do encounter the same exact question with the same exact scenario.

I tried to query a Stellar API which works perfectly fine using the curl command line. But it somehow return "Unable to parse request" when the query is made by PHP/Magento. I have tried to use all various methods to make the client request including curl_init, Varien_Http_Client, and all return the same message.

After some time, I realize that the error is not necessarily magento error message. It could be the error message returned by stellar.

But even though it is stellar error, how can we create the same exact POST request between curl and PHP.

curl -X POST https://test.stellar.org:9002 -d '
{
     "method": "account_currencies",
     "params": [
          {"account": "gM4Fpv2QuHY4knJsQyYGKEHFGw3eMBwc1U"}
     ]
}'

PHP Code:

<?php
$method = "account_currencies";
$params = Array("account" => "gM4Fpv2QuHY4knJsQyYGKEHFGw3eMBwc1U");
$request = xmlrpc_encode_request($method, $params);
$ch = curl_init();
$headers[] = "Content-Type: text/xml" ;
$headers[] = "Content-length: ".strlen($request) . "rn";
curl_setopt($ch, CURLOPT_URL, "https://test.stellar.org");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PORT , 9002);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Clue 1:

I suspect that the error came from Stellar when the following condition executed.

if ((request.size () > 1000000) ||
    ! reader.parse (request, jvRequest) ||
    jvRequest.isNull () ||
    ! jvRequest.isObject ())
{
    return createResponse (400, "Unable to parse request");
}

Clue 2

The error only occur when the json is invalid. could be because of any newline character or escaped character.

Bad Day with bad Question :(

Please ignore this question. Apparently it is indeed an invalid json was created in the POST data.

For my case, I manage to create the POST data using the following code:

<?php

$request_data = array(
    "method" => "account_currencies",
    "params" => array(
        array(
            "account" => "gM4Fpv2QuHY4knJsQyYGKEHFGw3eMBwc1U"
        )
    )
);

$client = new Varien_Http_Client($url);
$client->setMethod(Varien_Http_Client::POST);
$client->setRawData(json_encode($request_data), 'application/json');
$client->request();


texts:
I am using magento 2.1 C.E. I have initialized my own model with a custom table. I am trying to implement mass actions and clicking on one of the massactions, I get this error:

Exception #1 (PDOException): SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause'

Below is my massaction controller code:
Index/MassAccept.php

<?php
namespace Vendor\Module\Controller\Adminhtml\Index;
use \Vendor\Module\Model\ResourceModel\Module\CollectionFactory;
use \Magento\Ui\Component\MassAction\Filter;
use \Magento\Backend\App\Action\Context;
use \Magento\Framework\View\Result\PageFactory;

class MassAccept extends \Magento\Backend\App\Action {

    protected $resultPageFactory = false;
    protected $_moduleFactory;
    protected $filter;

    public function __construct(
        Filter $filter,
        CollectionFactory $moduleFactory,
        PageFactory $resultPageFactory,
        Context $context
        ) {
        $this->filter = $filter;
        $this->_moduleFactory = $moduleFactory;
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute() {
        // $ids = $this->getRequest()->getParams('id');
        // Create/load module model
        $model = $this->_moduleFactory->create();
        // Get collection of the loaded model using filter to get the data
        $collection = $this->filter->getCollection($model);

        foreach($collection as $item) {
            echo $item->getId();
        }
        die();
        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setRefererOrBaseUrl();
        return $resultRedirect;
    }
}


texts:
I would like add a number of blocks into a custom block without having to create a template that literally has <?= $this->getChildHtml() ?> - is this possible?

I have added a layout update in my config.xml
I have create a core/template block with template test.phtml
The test.phtml contains only `getChildHtml() ?>

This works wonderfully, however I don't want to have to have the test.phtml I would like the children to just display automatically.

I have tried setting output="toHtml" which does not work.


texts: Are varied banners loaded at each site visit counter-productive for Magento because of caching?

texts:
I have a customer that would like a different banners loaded for each visit to a page.  They like how teehanlax.com loads something different each time. They like the idea of a new experience each time.  They would like it to rotate between five different scenes.

Does Magento caching kill that experience?


texts:
I need to print the query before the save method in a model class. Is it possible?
thanks


texts:
I need to write to mysql database related products and upsells. This should be done by php. I can now set this for 1 product, but need to loop through all the products. My script:

<?php
set_time_limit(0);

require_once "blablabla/app/Mage.php";//my path here
umask(0);
Mage::app();

$sku="876297-6";  //some Sku
$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);

$param = array(
101=>array(
'position'=>3
),
102=>array(
'position'=>5
)
);
$_product->setRelatedLinkData($param);
$_product->save();

echo "Great!!";

 ?>

What I cannot do is the following:

1.Get all product IDs
  2.For each product ID set a related product as a random product from collection

Position does not matter at all.    + do this until there are 20 related products would be cool, but I can also run script 20 times, no pressure. Better to work with product IDs and not skus.

My script is just example. main purpose is to set 20 random related products to each product
Thanks in advance!


texts: Magento 1.9 / Simple product / Description / maximum size

texts: Is there a size limit for the description of a simple product in Magento 1.9.3.1? When I paste the description into the Description field, save the result, and then view the product, the last 30% is being chopped off.


texts: Configurable and custom options problems in magento 1.9

texts:
I'm having problems with Configurable and custom options, the simple products works fine and it shows the add to cart button, but with Configurable and custom options it disappears and the drop down options doesn't work.
Can anyone help me?

eg https://floty.com/sinalizador-nado-costas-metro-linear.html
as you can see, there is no add to cart button nor the dropdown options works


texts: What is the difference in database of magento C.E 1.9 when compare with magento C.E 1.8?

texts:
Is there any difference in database of magento C.E 1.9 when compare with magento C.E 1.8?

Whether in structure or fields?


texts: How to handle dynamic data in a script tag in head section for every page

texts:
I am absolutely new to Magento 2 (1 week in). I am trying to develop a Magento module that lets the admin specify a string (token) and when the admin saves the module I would like the token to inserted together with a <script> tag into the <head> section of each page.
If the admin changes the token and saves the config, it would be nice if it can update the same <script> tag. Or even remove it if no token is specified.
The module UI is no problem and also the saving works fine and intercepting the token value (with PHP), but I got stuck on how exactly to control the  that gets inserted.
I experimented with view/frontend/layout/default.xml and can influence the header, but this seems to be very static.
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="https://some-external-website.com/external-script.js"
                data-token="token_value"
                src_type="url"></script>
    </head>
</page>

So basically I would like to change the value in data-token ("token_value") when the admin saves the config from the module, which I do from a Plugin\Config file:
    ...
    public function aroundSave(\Magento\Config\Model\Config $subject, callable $proceed) {
        // your custom logic
        $section = $subject->getSection();
        $returnValue = $proceed();
        $newConfigs = $this->scopeConfig->getValue($section);
        $token = $newConfigs["general"]["token_value"];

        // +++ here would like to write value of $token to the <script> tag +++

        return $returnValue;
    }
    ...

Any help appreciated!


texts: Speeding up a "Multiple Version Jump" Database Update

texts:
I'm working a project to bring up an old Magento EE system up to date with the  latest and greatest version of EE.  Running some tests locally on my development laptop (spinning disks), the Setup Resource Migration scripts took around 90 minutes to run.

On one hand I was surprised it was only 90 minutes, given the number of new indexes and foreign keys an upgrade adds. At the same time, I'm not wild about taking my client's side down for 90 minutes when we perform the actual upgrade. (or, alternately, dealing with keeping the old store up for those 90 minutes and reconciling and new orders, customers, or data that's added to the system)

Is there any known science for speeding up the setup resource script running?  (Skipping certain unneeded updates, temporary tweaks to my.cnf, etc.)


texts: M1 bundel products, get product Id by their value

texts:
I created one bundle product, in bundle items I created one checkbox option with three products, ids 5,6 and 7.

In the frontend It have some values assigned to them, 13, 14, 15.

I want to get by ajax the product id selected, but I don't know how to do that with the value.

any idea?


texts: Magento 2.2.7 - How to access custom attributes of the associated products of a grouped product on final_price.phtml

texts:
Sorry in advance if this is a silly question. I'm fairly new to backend development.

I have a custom attribute that determines whether or not a price should be visible on the frontend. It works just fine with simple products, but I can't get it to work with grouped products, since it doesn't seem that Magento loads the associated simple products as objects in the template file. As a result, I can't access the values of custom attributes.

Here's that part of the template file:

$product = $block->getSaleableItem();

if (!$product->getData(\Vendor\Pricing\Helper\Data::ATTRIBUTE_PRICING_VISIBLE)) {
    return '';
}

When this runs for grouped products, getData always returns 0/No even if ATTRIBUTE_PRICING_VISIBLE = Yes. When I try something like getCustomAttribute instead of getData, it returns a null value. Additionally, I tried getResource and got the error "Trying to get property of non-object."

To get the full product to load, I tried the Product Factory method, like so:

<?php

namespace Vendor\Fixes\MagentoCatalog\Plugin\Block;

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

  protected $_productloader;

  public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\ProductFactory $_productloader

    ) {

        $this->_productloader = $_productloader;
        parent::__construct($context);
    }

    public function getLoadProduct($id) {
        return $this->_productloader->create()->load($id);
    }

}

.phtml file:

$productId = $block->getSaleableItem()->getId();
$product = $block->getLoadProduct($productId);

if (!$product->getData(\Vendor\Pricing\Helper\Data::ATTRIBUTE_PRICING_VISIBLE)) {
    return '';
}

But this also returns a null error when trying to access that attribute. The only thing that seems to work is Object Manager, which I know is a huge no-no. This is the code that works:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productId = $block->getSaleableItem()->getId();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);

<?php if (!$product->getData(\Vendor\Pricing\Helper\Data::ATTRIBUTE_PRICING_VISIBLE)) {
    return '';
} ?>

So how can I accomplish this without the use of Object Manager? Thanks in advance for your help!


texts: Magento 2 Task "Update attributes for 2 selected products": 1 item(s) are currently being updated.1 item(s) have been scheduled for update

texts:
Magento version 2.3.5
Does anyone know how to solve this?

Cron is working fine I cross-check with indexing and when run this command -
php bin/magento queue:consumers:start product_action_attribute.update

then the problem is solved but it's not a good way, again and again, to run these commands


texts: How to change product size in magento. For e.g the size of the product is different for different products. I want all the products to have same size. Kindly see the issue in the picture below:


texts: Magento 1.9.3 - "Warning: strpos() expects parameter 1 to be string" warnings

texts:
I'm seeing a lot of the following warnings after upgrading to 1.9.3.1 in the system.log:

"Warning: strpos() expects parameter 1 to be string, array given  in ../app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 79"
"Warning: strpos() expects parameter 1 to be string, array given  in ../app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 79"
"Warning: strpos() expects parameter 1 to be string, array given  in ../app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 79"

Also checked the affected Model already near line 79 it says..

...
70: /**
71:  * Get a text for option value
72:  *
73:  * @param string|integer $value
74:  * @return string
75:  */
76: public function getOptionText($value)
77: {
78:   $isMultiple = false;
79:    if (strpos($value, ',')) {  # <--- this line causes the warning...
80:        $isMultiple = true;
81:        $value = explode(',', $value);
82:    }
83:
84:    $options = $this->getAllOptions(false);
...

Any ideas how to fix this?


texts: Authorize.net : An error occurred on the server Please try to place order again

texts:
I have configured Authorize.Net Payment method in Magento 2.1.7, In checkout page, I'm using credit card transaction both production and test mode while placing the order, I am getting "An error occurred on the server. Please try to place the order again".

Activating debug mode I didn't get any log files. Please Let me know it is a Magento issue or payment gateway issue.


texts: Issue when Full page cache enable in magento2

texts:
I have found issue related to full page cache enable. I am not able to remove the label on document ready in magento2

<script type="text/javascript">

    require(['jquery'], function ($)
    {
        $(document).ready(function ()
        {
            $("label:contains('Please type captcha here')").remove();
        })
    });
</script>

jQuery not working with full page cache


texts: Recently viewed section is cached and not updated

texts:
I have added the /etc/widget.xml, to call the recently viewed in Footer container.

The recently viewed block is display but it's applied with cache so the newly viewed products are not updated.

The Recently viewed section is getting updated, Only after the cache is flushed.

<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
     <widget id="catalog_recently_viewed" class="Magento\Catalog\Block\Widget\RecentlyViewed"
            placeholder_image="Magento_Catalog::images/product_widget_viewed.gif">
        <containers>
             <container name="footer">
                <template name="grid" value="grid" />
                <template name="list" value="list" />
            </container>
        </containers>
    </widget>
</widgets>


texts: how can i solve upsell product appear same due to full page cache in enterprise edition?

texts: I have an issue in my upsell product block,display same product when reload the page.This problem is due to full page cache. can any one have idea , how can i solve this issue.


texts: Impossible to save category with more that 1000 products

texts:
This is a known issue caused by PHP 5.3.9 and max_input_vars that by default it is set to 1000.

The solution 2 proposed here it is the best in my opinion but doesn't work: for some strange reason it limit the category to 527 products.

For that reason I'm posting this question with related corrected answer


texts: How can we remove/delete the custom attribute(created for customer) in Magento 2

texts:
I want to remove the custom attribute created for customer using installchema,I followed this link but it didn't helped.Anyone tried earlier,please help.Thanks in advance!
I have added attribute manually using installschema script and the code is here

namespace Bibhu\Customattribute\Setup;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'sample_attribute',
            [
                'type' => 'int',
                'label' => 'Sample Attribute',
                'input' => 'select',
                'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
                'required' => true,
                'default' => '0',
                'sort_order' => 100,
                'system' => false,
                'position' => 100
            ]
        );
        $sampleAttribute = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'sample_attribute');
        $sampleAttribute->setData(
            'used_in_forms',
            ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address']
        );
        $sampleAttribute->save();

            }
}

and to remove using this Uninstall.php script

    <?php
namespace Bibhu\Customattribute\Setup ;

    class Uninstall implements \Magento\Framework\Setup\UninstallInterface
    {
        protected $eavSetupFactory;
        public function __construct(\Magento\Eav\Setup\EavSetupFactory $eavSetupFactory)
        {
            $this->eavSetupFactory = $eavSetupFactory;
        }
        public function uninstall(\Magento\Framework\Setup\SchemaSetupInterface $setup, \Magento\Framework\Setup\ModuleContextInterface $context)
        {
            $setup->startSetup();
            $eavSetup = $this->eavSetupFactory->create();
            $entityTypeId = 1;
            $eavSetup->removeAttribute($entityTypeId, 'sample_attribute');
            $setup->endSetup();
        }
    }


texts:
How do you display the current logged in customers name or customer ID inside a content block?

Or

How do you add dynamic variables to custom variables?


texts: Magento 2: RequireJS not working in Payment Method

texts:
I trying to use requireJS in my custom payment method, but its not working..

cc-form.html :

<fieldset data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + getCode()}">

     <legend class="legend">

     </legend>

             <input type="hidden"
                    name="payment[cc_type]"
                    class="input-text"
                    value=""
                    data-bind="attr: {id: getCode() + '_cc_type', 'data-container': getCode() + '-cc-type'},
                    value: creditCardType
                    ">

        <input type="text" name="payment[vtoken]" class="input-text" value="" id="vtoken" />

.....
.....
....

I am not able to figure out why my jquery is not loading.
Any idea what might be wrong?


texts: An error occurred on the server. Please try to place the order again. In Magento 2

texts:
I have configure Authorize.Net Payment method in magento 2,
But i am getting "An error occurred on the server. Please try to place the order again" after click on place order.

Also sometimes its work's perfectly. So i need to know is ti magento issue or payment gateway issue. Thanks in advance. Let me know if you need more information.


texts: magento google analytics order data is showing double

texts:
We have installed yireo google tag manager for GTM.

Issue is when I order google analytics is showing 2 transactions, 2 qty and 2 unique purchases and also revenue

can anyone help me on this issue

thanks


texts:
When I import produt image with .jpg then working correct. But when I upload .jpeg then return Disallowed File Type. when upload product image
Can anyone help how to change I can upload .jpeg?


texts: How can I get the type of the selected associated product in a configurable product in Javascript?

texts:
I got a configurable product with these options:

Download (Downloadable product type)
CD (Simple product type)

How can I get the product type of the selected associated product in Javascript?


texts: How to insert a text into before all magento notification messages in magento 2 with plugin?

texts: I'm new Magento. Can someone tell me how to insert a text into before all system messages of Magento 2 with a plugin. When I do anything, I get the message.Ex :login, create account, add to cart,...


texts:
How to disable the hover option for swatches?

For Ex., Color attribute has the swatches. While we hover a swatch a div displaying that colour in a respective height and width.

Suggest the solution for this please.


texts: How to Export First 100 product using dataflow profile

texts: How can i Export only first 100 products from magento using magento inbuilt data flow profile functionality. i want to export first products but there are 20000 products there on my store so i want to export products in bunch of 1000.Waiting for suggestion.


texts:
I found the following answer regarding import of related products (How to import related products in normal import process?). The answer suggests that it is possible to perform this type of import and recommends manually adding some examples via the Magento admin in order to see how the related fields are populated.

I performed a manual related product association and can see the related product in the back and front end, but upon export, the links_related_sku and links_related_position fields are empty.

I have since tried an import with an SKU in the links_related_sku field via Magmi, which was unsuccessful.

Am I doing something incorrectly or is the related products export/import "buggy"?


texts: Magento 2 - Catalog rules cronjob stuck at working with increased number of backlogs

texts:
Catalog Rule Product, it always shows as working and and 735 in backlog

Tried these but didn't work for me:

Reindexing
Changed state to "Update on Save" then revert back to scheduled
Wait for a day to reindex using magento cron


texts: Magento 2 pass data from Controller to Block and display in Template

texts:
I'm a little bit stuck. I want to send a form and display it in a phtml.

Here is my code:

1. Controller Search.php

<?php

namespace Vendor\SearchStores\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Registry;
use Magento\Framework\Controller\Result\JsonFactory;

//use Magento\Framework\Controller\Result\Forward\Factory;

class ReadSearch extends Action
{
    protected $resultPageFactory;

    protected $resultJsonFactory;

    protected $_coreRegistry;

    public function __construct(Context $context, PageFactory $pageFactory, Registry $coreRegistry, JsonFactory $resultJsonFactory)
    {
        $this->resultPageFactory = $pageFactory;
        $this->_coreRegistry = $coreRegistry;
        $this->resultJsonFactory = $resultJsonFactory;

        parent::__construct($context);
    }

    public function execute()
    {

       $search_word = $this->getRequest()->getParam('search');
      // $search_word = $this->getRequest()->getPost('search');

         $resultPage = $this->resultPageFactory->create();

        $result = $this->resultJsonFactory->create();

        $block = $resultPage->getLayout()
            ->createBlock('Vendor\SearchStores\Block\ShowResult')
            ->setTemplate('Vendor_SearchStores::results_modal.phtml')
            ->setData('search',$search_word)
            ->toHtml();
       $result->setData(['output' => $block]);
        return $result;
    }
}

2. Block ShowResult.php

<?php
namespace Vendor\SearchStores\Block;

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

class ShowResult extends Template
{

    protected $_coreRegistry;

    public function __construct(Context $context, Registry $coreRegistry)
    {
       $this->_coreRegistry = $coreRegistry;

        parent::__construct($context);
    }

    public function getSearchWord()
    {
         //HERE IS WHERE I WANT TO GET THE DATA FROM THE CONTROLLER
         return $this->getSearch();

    }
}

3. xml result_index_readsearch.xml

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

    <body>

        <referenceContainer name="content">
            <block class="Vendor\SearchStores\Block\ShowResult" name="show_result" template="Vendor_SearchStores::results_modal.phtml"/>
        </referenceContainer>
    </body>
</page>

4. Template results_modal.phtml

<?php
    echo $block->getSearchWord();
?>

  NOTE: I can get info in the controller but I don't know how to send it to Block. I try to display in template, but it seems that when I send the form, and display template, the form arrives before loading the template, so I see no data in template. Please suggest a solution.

Thanks!!


texts: magento database file not importing completely

texts:
we are trying to move the magento site from one domain to another domain.

but the database filoe size is 800mb.

we are using cpanel.

when we are trying to import the database, its not uploading completely.

lot of tables are missing  after importing.

is there any way to import 800mb database file completely

thanks in advance


texts: Migration after a non well formed numeric value encountered in

texts:
I have migration done Magento 1.9.3.3 to Magento 2.3.2
but after migration checkout page not showing any shipping methods

I have checked my exception.log file and below type error showing

  A non well formed numeric value encountered in
  vendor/magento/module-shipping/Model/Carrier/AbstractCarrier.php on
  line 537


texts: How to transfer user accounts (user ID, password) from Magento 1.3.1 to 1.9.1?

texts:
I've setup a brand new Magento shopping cart (1.9.1) and imported all products by hand. Now I realized that customers who created accounts on the old shopping cart are upset because they are no longer able to use their existing accounts to login into the new shopping cart...

What would be the best way to import the user accounts from the old 1.3.1 to the newest version of Magento?


texts: Update Custom attributes of a product through CSV import

texts:
I am programatically updating some attributes of products through CSV import in "Advanced Dataflow Profiles". Of which, i have found the code to update quantity i.e. inventory information of a product.

Now there are some custom attributes which i need to change similarly. All these are string kind of attributes. But in dont get that in which database tables their values are stored. Can anyone modify the _updateAttribute() function so that i can update custom product attributes similarly??

I am using the following code:

<?php

class Mage_Catalog_Model_Convert_Adapter_Updateqty extends Mage_Catalog_Model_Convert_Adapter_Product
 {

public function saveRow( array $importData )
{
   function _getConnection($type = 'core_read'){
   return Mage::getSingleton('core/resource')->getConnection($type);
}

function _getTableName($tableName)
{
   return Mage::getSingleton('core/resource')->getTableName($tableName);
}

function _getAttributeId($attribute_code = 'price')
{
    $connection = _getConnection('core_read');
    $sql = "SELECT attribute_id FROM " . _getTableName('eav_attribute') . " WHERE entity_type_id = ? AND attribute_code = ?";
    $entity_type_id = _getEntityTypeId();
    return $connection->fetchOne($sql, array($entity_type_id, $attribute_code));
}

function _getEntityTypeId($entity_type_code = 'catalog_product')
{
    $connection = _getConnection('core_read');
$sql = "SELECT entity_type_id FROM " . _getTableName('eav_entity_type') . " WHERE entity_type_code = ?";
return $connection->fetchOne($sql, array($entity_type_code));
}

function _checkIfSkuExists($sku)
{
    $connection = _getConnection('core_read');
    $sql = "SELECT COUNT(*) AS count_no FROM " . _getTableName('catalog_product_entity') . " WHERE sku = ?";
    $count = $connection->fetchOne($sql, array($sku));
    if($count > 0)
    {
        return true;
        }
    else
    {
    return false;
        }
}

function _getIdFromSku($sku)
{
        $connection = _getConnection('core_read');
    $sql = "SELECT entity_id FROM " . _getTableName('catalog_product_entity') . " WHERE sku = ?";
    return $connection->fetchOne($sql, array($sku));
}

function _updateStocks($sku,$newQty)
{

    $connection = _getConnection('core_write');
        $productId = _getIdFromSku($sku);
    $attributeId = _getAttributeId();

        $sql    = "UPDATE " . _getTableName('cataloginventory_stock_item') . " csi,
                   " . _getTableName('cataloginventory_stock_status') . " css
                   SET
                   csi.qty = ?,
                   csi.is_in_stock = ?,
                   css.qty = ?,
                   css.stock_status = ?
                   WHERE
                   csi.product_id = ?
                   AND csi.product_id = css.product_id";

   $isInStock      = $newQty > 0 ? 1 : 0;
       $stockStatus    = $newQty > 0 ? 1 : 0;
   $connection->query($sql, array($newQty, $isInStock, $newQty, $stockStatus, $productId));
}

function _updateAttribute($sku,$newattri)
{
$connection = _getConnection('core_write');
    $productId = _getIdFromSku($sku);
$attributeId = _getAttributeId();

$sql  = "UPDATE `catalog_product_flat_1` tbl
    SET
    tbl.materials_value = ?
    tbl."

}

set_time_limit(0);
ini_set('memory_limit','1024M');
$message = '';
$count   = 1;

    if(_checkIfSkuExists($importData['sku']))
{
    try
    {
            _updateStocks($importData['sku'],$importData['qty']);
            $message .= $count . '> Success: Qty of Sku "' . $importData['sku'] . '" has been updated.';
    }

    catch(Exception $e)
    {
            $message .=  $count .'> Error: while Upating  Qty "' .$importData['qty'] . '" of Sku (' . $importData['sku'] . ') => '.$e->getMessage().'';
        }
    }

else
{
        $message .=  $count .'> Error: Product with Sku "' .$importData['sku']  . '" does\'t exist.';
    }
    $count++;
echo $message;
}

}


texts: Tax Class does not appear in product Magento 2.3.0

texts:
I migrated from Magento 1.9.x to Magento 2.3.0.

When editing a product in admin the Tax Class is not shown and is not in any of the expandable sections.

I can see the tax class in the product list (if I add it to the columns) but can see no way of adding it to the product detail edit pages.

Any help would be very much appreciated.


texts: Disable fronend in Magento 2 for a specific module for using only the Admin and the API routes

texts: How to disable the fronend in Magento 2 for a specific module so I can use the Adminpanel and the API routes.


texts: If the price is 0 deactivate the product

texts:
I want products that have a price of 0 to be deactivated.
How can I do this?
My store is on magento 1.9.3
Thanks


texts:
I want to add slick slider on my home page in magento using static block and phtml with rotating images. if anyone have idea about that then please answer my question as soon as possible.

Thank you in Advance.


texts: Why nginx shows product list in "html" form instead of "phtml"

texts:
When i mouse hover on product list then it shows likes "dove.html","computer.html" etc instead of "dove.phtml","computer.phtml".

In apache server it shows "dove.phtml","computer.phtml" etc and executes perfectly.

My question is:- how i configure nginx with phtml file then nginx shows product list in "phtml" form.

here nginx configure file

server {
listen 80 default_server;

root /usr/share/nginx/mydomain.com/;
index index.php index.phtml index.html index.htm;

server_name domain.com;
location / {
try_files $uri $uri/ /index.php;
}

location ~ \.(php|phtml)$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include snippets/fastcgi-php.conf;
}
}


texts: Payment gateway with redirects in magento2

texts:
How would I implement this exact logic in M2 with the new gateway API? https://github.com/ergopalpatel/Magento_Payment_Gateway_Skeleton

Steps

Customer selects a custom payment method
When 'Place Order' is clicked, customer is redirected to the external payment page with some additional POST data
Payment page redirects on success/failure back to a specified magento controller, which processes the result

I had a look around and found that \Magento\Payment\Model\Method\Cc is deprecated and that you should use the gateway api. I read the articles by Max Pronko and https://www.maxpronko.com/blog/magento-2-payment-gateway-api and tried to analyze the sample magento module and Braintree module, but I just can't wrap my head around those, either too much or too little going on.

Where do I even start if I want to implement this flow with redirects?
Is there a comprehensive documentation somewhere or a module implemented on the gateway API that does exactly what I need?

EDIT

I dug into the Magento_Payment code and it seems like this kind flow is not supported at all, classes implementing the Magento\Payment\Gateway\Http\ClientInterface, which handle the requests and responses, seems to be only working with synchronous requests against a webapi.

So what are the options then? Use deprecated components?

EDIT

Seems like using the Magento\Payment\Model\MethodInterface (which has an @api annotation, so I'm hoping it won't get deprecated anytime soon) and implementing your own logic for redirects/validations etc is the way to go as of now.


texts: Updating Basket quantity (using ENTER) clears the basket entirely

texts: I have been developing my own site for the last couple of years i am still using Magento 1.8. with a 3rd party theme. I noticed whenever i try to update the quantity of a product in my basket, for example type 3 in the box at the first checkout stage and press enter, I receive the page showing my basket is empty and the customer has to start again adding items 1 at a time. Can anybody help please. My site is stickerstocker.co.uk


texts: Unable to add Product image in New order Email Magento 2.3.5

texts:
I have tried below 2 solutions:

Get product image for invoice email in magento 2.3

(Solved) Magento 2, Add product image in all transaction emails(shipment, invoice, credit memo)

I am using Claue theme, I pasted the below code in invoice/default.phtml & order/default.phtml, then did a setup:static-content:deploy -f. Created new Order, but I do not see the product image in email only the items as shown in the image below.
PATH:

app/design/frontend/Mgs/claue/Magento_Bundle/templates/email/order/items/order

CODE:
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_id = $_item->getProductId();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);

$_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image');
$image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl();
?>
<img src="<?php echo $image_url ; ?>" alt="<?php echo $product->getName(); ?>" />

This is what I see in email:

I am using Magento 2.3.5-p1, I am not sure if I am pasting the code in correct block. I pasted it below
 and above .


texts: Create customer programatically with difference shipping address

texts:
I create customer programatically, bellow is my code

$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->setStore(Mage::app()->getStore());
$customer->setFirstname($fname);
$customer->setLastname($lname);
$customer->setEmail($email);
$customer->setPassword($password);
$customer->save();

$address = Mage::getModel("customer/address");
$address->setCustomerId($customer->getId());
$address->setFirstname($customer->getFirstname());
$address->setLastname($customer->getLastname());
$address->setCountryId($addressData['country']); //Country code here
$address->setRegionId($addressData['RegionId']);
$address->setCity($addressData['City']);
$address->setPostcode($addressData['Zipcode']);
$address->setTelephone($addressData['Telephone']);
$address->setFax($addressData['Fax']);
$address->setCompany($addressData['Company']);
$address->setStreet($addressData['Street']);
$address->setIsDefaultBilling('1');
$address->setIsDefaultShipping('1');
$address->setSaveInAddressBook('1');
try
{
    $address->save();
}
catch (Exception $e)
{
    $msg = Zend_Debug::dump($e->getMessage());
}

It is working good but i want add different shipping address, and not set it as Default billing address, means my shipping address is difference.

How can i save shipping address in this ?


texts: How to show custom field (Account Number) on cash on delivery payment check?

texts:
How to add custom field (Account Number) on cash on delivery payment check with it's additional data saved?

I have referred this link http://www.ibnab.com/en/blog/magento-2/save-payment-method-with-additional-data-show-custom-field-on-payment-check

as the above link saves data for bank transfer payment and i have replaced it with cash on delivery payment method.. i have applied the module but no changes..
Could someone guide me on this
Any help would be appreciated


texts: Magento order data not getting using observer event from admin

texts:
I want item's data in observer from particullar order which order place from admin.
following config.xml

<adminhtml>
    <events>
        <sales_order_place_after>
            <observers>
                <test_module_after_order>
                    <class>Test_Module_Model_Observer</class>
                    <method>orderAfterAdmin</method>
                </test_module_after_order>
            </observers>
        </sales_order_place_after>
    </events>
</adminhtml>

following Observer.php

public function orderAfterAdmin($observer)
{
    Mage::log("orderAfterAdmin");
    try
    {
        $order = $observer->getEvent()->getOrder();
        $productIds = array();
        Mage::log("In orderAfterAdmin");
        Mage::log($observer);
    }
    catch(Exception $e)
    {
        Mage:log($e->getMessage());
    }
}

When I placed order from admin panel at that time I got

  User Error: Some transactions have not been committed or rolled back
  in ..\lib\Varien\Db\Adapter\Pdo\Mysql.php on line 3937

error massege when Mage::log($observer) occur. system.log print In orderAfterAdmin but not next step.


texts: Adding a cost record (attribute) to Magento's Tiered Price in Admin

texts:
Below I have submitted a picture of the section I am looking to modify.  I need to add a custom price record to each tiered price.  Magento has a record for cost of an item, however, my particular customer needs a way to save a tiered_cost for each row.  This record will need to be accessible from all transactional emails.

Ideally, my rows would be as follows: Website, Customer Group,Qty, Price, Quantity Cost and remove.

On the transactional email I will then need to display the cost per item.  Say the price is 14.86 per unit after 100 and cost is 10.00, If a customer orders 125, I need to display purchased 125 of X units and your total cost is $1000.

How can I achieve this?

UPDATE:
Ok, so I have the template file with the required fields and it uses the Magento price validator.   However, I still need to add my column to catalog_product_entity_tier_price and learn how to add one via Magento installer. Then to grab the model to save to the custom table.

This is from /app/design/adminhtml/default/default/template/catalog/product/edit/price/tier.phtml

+ '<input class="<?php echo $_htmlClass ?> required-entry <?php echo $_priceValueValidation ?>" type="text" name="<?php echo $_htmlName ?>[{{index}}][price]" value="{{price}}" id="tier_price_row_{{index}}_price" />	'

This is from the price row,  but I don't understand how this is saving. What are:

{{price}} and tier_price_row_{{index}}_price?

I've also reached the end of the internet trying to find someone who has even added anything to this column.


texts: Override magento 2 module Success message on "Save Config"

texts: The default success message is 'You saved the configuration.' while hitting the 'Save Config' button in the Magento 2 Module. How to override with my customized message?


texts: Magento 2 checkout page custom dropdown field selected value not showing

texts:
I have added dropdown custom field on checkout page with custom values.  It's working fine but when i move to next step it doesn't work.

If i add a text field and click next console shows the input field value but if I change it to select then it doesn't even field name in a console.  What could be the issue?

  <?php
   namespace Jack\CheckoutAdditionalField\Plugin\Checkout\Model\Checkout;

 class LayoutProcessor
  {
/**
 * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
 * @param array $jsLayout
 * @return array
 */
public function afterProcess(
    \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
    array  $jsLayout
) {
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date'] = [
        'component' => 'Magento_Ui/js/form/element/abstract',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/date',
            'options' => [],
            'id' => 'delivery-date'
        ],
        'dataScope' => 'shippingAddress.delivery_date',
        'label' => 'Delivery Date',
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 250,
        'id' => 'delivery-date'
    ];

    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['drop_down'] = [
        'component' => 'Magento_Ui/js/form/element/select',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/select',
            'id' => 'drop-down',
        ],
        'dataScope' => 'shippingAddress.drop_down',
        'label' => 'Drop Down',
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 251,
        'id' => 'drop-down',
        'options' => [
            [
                'value' => '',
                'label' => 'Please Select',
            ],
            [
                'value' => '1',
                'label' => 'First Option',
            ]
        ]
    ];

    return $jsLayout;
}

}

When i move to next step on payment method then field and it's value is not showing in console if i will add text field then it will show posted value in console.

Need help why select dropdown value not showing in console?  Also, how can i save this value to show in order information.


texts:
I created custom router in custom extension. For eg. : I created 5 custom extension and in all extension there are custom router available.

Now, when i execute url like this : http://127.0.0.1/mg231/en/testing1 It will go for check in all extension's custom router file.

But, this url is for 1st extension.

Is it feasible way?

Should it be working like if executed url is related to 1st extension url then it should be only check in 1st extension's custom router.

1st extension :

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="test1" xsi:type="array">
                    <item name="class" xsi:type="string">Vendor\Module\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">33</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

2nd Extension :

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\RouterList">
        <arguments>
            <argument name="routerList" xsi:type="array">
                <item name="test2" xsi:type="array">
                    <item name="class" xsi:type="string">Vendor\Module\Controller\Router</item>
                    <item name="disable" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">34</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

Please help me.

Any help would be appriciated.

Thanks.


texts:
I have been working on a Magento 2 development project for a few months now, and until recently, there have been no issues. When I started it up today, though, my main css file came back as this: <link  rel="stylesheet" type="text/css"  media="all" href="https://mysite.localhost/core/index/notFound" /> and none of the main css site css is working. The css for the other extensions still work, only the main site's styles.css file isn't working.

I have flushed cache, ran setup:upgrade, s:s:d, setup:di:compile, composer update and nothing has worked to get rid of this error. No errors are being logged as well. I have searched everywhere, but I have not been able to find anything relating to this particular error, especially since it was working just fine yesterday.


texts: Trying to complete my 2.3.5 site and need to add my Authorize.net configuration. I see no place to accept credit cards under the "Payment Methods". We are setup with Auhtorize.net and also use it on our 1.9 site. However on 2.3.5 it is "Deprecated". How else can we utilize Authorize.net and configure it. After all this has no way of being able to accept credit cards


texts: Displaying remaining available products when mouse is hovering over the product image

texts:
As i mentioned in the title, i want to display the remaining available products when the cursor is hovering over the product image.
To be more specific let's say that my product is a nike t-shirt, what i want is when the customer puts the cursor over the product image to appear a text box with the remaining available sizes, for example sizes left: small, medium, large.
Is something like that possible, with the use of an extension, or doing it manually with code??


texts:
I have some issue, customers can't login or create account and redirects to login-register page !

The form key is well present in all login.phtml files.


texts:
Hi i'm new at magento 2 and i've been trying to create a Observer for checkout_submit_all_after and looks like that the Observer is not even called.

events.xml

 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_submit_all_after">
       <observer name="place_order" instance="SussexDev\Extrato\Observers\Observers\PlaceOrder"/>
    </event>
</config>

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="SussexDev_Observers" >
        <sequence>
            <module name="SussexDev_Extrato"/>
        </sequence>
    </module>
</config>

PlaceOrder.php

    <?php
namespace SussexDev\Extrato\Observers\Observers;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;

class PlaceOrder implements ObserverInterface
{
    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function execute(Observer $observer)
    {
        /*
        $order = $observer->getEvent()->getOrder();
        $orderId = $order->getId();

        $sql = "update teste_order set order_id =".$orderId.";";
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $connection->query($sql);
        */
        $txt = "\n aaaaaa ";

        $this->_logger->log('DEBUG', $txt);
        $this->logger->info('Observer Atingido2', $observer->debug());

    }
}

registration.php

    <?php

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'SussexDev_Observers', __DIR__);

I want to Observer the event that happens when this button (Place Order) get click.


texts: If i disable wysiwyg, is it going to delete the content?

texts:
If I disable WYSIWYG, is it going to delete the content that is inside?

I'm not sure about it and do not want to take the chance.

I'm trying to add automatic meta description from the description but it takes the code from the WYSIWYG instead of the content inside.

please help.


texts: Retreive product list Magento REST API error

texts:
I have no idea what should I do with this error. The error says:

Notice: Undefined index: state in /home/kataloggrosir/server/magento/rest.php on line 26
Warning: Use of undefined constant OAUTH_AUTH_TYPE_URI - assumed 'OAUTH_AUTH_TYPE_URI' (this will throw an Error in a future version of PHP) in /home/kataloggrosir/server/magento/rest.php on line 26
Fatal error: Uncaught Error: Class 'OAuth' not found in /home/kataloggrosir/server/magento/rest.php:27 Stack trace: #0 {main} thrown in /home/kataloggrosir/server/magento/rest.php on line 27

This is the code that I use:

<?php
/**
 * Example of retrieving the products list using Admin account via Magento REST API. OAuth authorization is used
 * Preconditions:
 * 1. Install php oauth extension
 * 2. If you were authorized as a Customer before this step, clear browser cookies for 'yourhost'
 * 3. Create at least one product in Magento
 * 4. Configure resource permissions for Admin REST user for retrieving all product data for Admin
 * 5. Create a Consumer
 */
// $callbackUrl is a path to your file with OAuth authentication example for the Admin user
// $callbackUrl = "http://yourhost/oauth_admin.php";
$callbackUrl = "http://localhost/rest.php";
$temporaryCredentialsRequestUrl = "https://fashionbag/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'https://fashionbag/admin/oAuth_authorize';
$accessTokenRequestUrl = 'http://fashionbag/oauth/token';
$apiUrl = 'http://fashionbag/api/rest';
$consumerKey = '9c766c5480101ac0869d843472b1640c';
$consumerSecret = '004e99e3958bb0cbd739d983a6ad76fc';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
    $_SESSION['state'] = 0;
}
try {
    $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
    $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
    $oauthClient->enableDebug();

    if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
        $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
        $_SESSION['secret'] = $requestToken['oauth_token_secret'];
        $_SESSION['state'] = 1;
        header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
        exit;
    } else if ($_SESSION['state'] == 1) {
        $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
        $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
        $_SESSION['state'] = 2;
        $_SESSION['token'] = $accessToken['oauth_token'];
        $_SESSION['secret'] = $accessToken['oauth_token_secret'];
        header('Location: ' . $callbackUrl);
        exit;
    } else {
        $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);

        $resourceUrl = "$apiUrl/products";
        $oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json'));
        $productsList = json_decode($oauthClient->getLastResponse());
        print_r($productsList);
    }
} catch (OAuthException $e) {
    print_r($e->getMessage());
    echo "&lt;br/&gt;";
    print_r($e->lastResponse);
}

Thanks for the help in advance. Sorry, I'm super noob at Magento, and this is my first time trying to use the API.


texts: Avoid __store in URLs when behind a proxy

texts:
I have this setup in Magento 2

How does Magento determine the route / getting 404 behind proxy

Magento behind a NGINX reverse proxy
Rewriting store urls from /en/shop to __store=en

Now I am only left with the problem, that the language switch appends __store=en and so on to the URLs.

Can this be elegantly avoided?

References I found:

Magento multistore, __store and ___from_store in URL
A closed issue for Magento 2: https://github.com/magento/magento2/issues/1101


texts: How to automatically send a transactional email on customer group change?

texts:
I would like to send a custom transactional email automatically to a user when he is assigned to a specific user group.

I think doing that with on observer but do not manage to find which event to trigger…

Thank you for your help,


texts:
I need to override this class

Magento\CatalogSearch\Model\ResourceModel\Fulltext
Collection

in my custom module. I have created di.xml in etc/frontend folder.

and created the class and overridden the method. This my code:

di.xml

    <preference for="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection" type="Daiva\Customsearch\Model\Resource\Fulltext\Collection"/>
</config>

Class:

namespace Daiva\Customsearch\Model\Resource\Fulltext;

/**
 * Fulltext Collection
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection {

    /**
     * @inheritdoc
     */
    protected function _renderFiltersBefore() {
echo "Daiva";
        exit;
        $result = parent::_renderFiltersBefore();
        $this->_totalRecords = null;
        return $result;
    }

}

But it is not working. Did i make any mistake?


texts: Modify Shopping Cart Rules Function to apply discounts by Percentage of Original Price Instead of Product Price Discount

texts:
I'm working on a project where the entire store products have a special price different (lowered) from the original price.

I want to be able to apply shopping cart discounts By Percentage of the Original Price just like Catalog Discount Price Rules does.

Right now, if I apply a shopping cart “Percentage of product price discount” rule, it will apply the discount to the special price instead of the original price.

Where is the function for Shopping Cart Rules at? Any details on modifying it to apply discounts on original price will be appreciated.