texts: How to enable or add layered navigation to search result page in Magento 2

texts:
I found some equal questions, but no answers are available in Magento 2.

Any one can tell me how to enable or add layered navigation to search result page in Magento 2.

Any help would be appreciated.


texts: See if your local.xml is disregarded or not

texts:
When editing my local.xml, if I make a syntax error the entire document is disregarded.
For example if I write:

<reference name="left">
    <block type="catalog/navigation" name="catalog.vert" template="catalog/navigation/vert"/>
</block>

Ussualy I write a remove action in <default> to see if the block dissapears and the local.xml is parsed, but there must be a better way to see if this file is loaded properly.

Sometimes I think that my sintax is incorrect, but in fact there was an error previously and the entire document is diregarded. How can you check it?

Thanks!


texts: The shopping cart items counter doesn't display 0 when there are no items in the cart

texts:
On my website header I have a shopping cart icon with a badge that display the number of the items in the cart. When you enter in the website, it should display 0, as you have no item in the cart. However the badge is empty until you add a item in the cart. But if you later remove all items than it does display 0.

This is my code:

  <span class="badge  badge-inverse">
      <?php echo $this->getSummaryCount();?>
  </span>

How to modify it to always display 0 if there are no items in the cart? I tried to use conditionals but for some reason it doesn't work.


texts:
So I created a rule with these conditions:

Everything is working fine except for the State/Province conditions. It seems the rule is not taking the conditions for the state/province section. My rule is only to be applied for customers in the U.S. but not Hawaii or Alaska. But since it is not working correctly the rule is applying to these countries.

Can anyone help?


texts: How to make a form and submit datas using popup modal in magento2?

texts:
When a user clicks the open modal button the popup modal opened correctly.

I want a form in a modal and save the data into the database. please, anyone gives the solution.


texts: Magento 2 Remove JS added with requirejs-config.js

texts:
Edit

So after removing the pub/static folder and also removing the .htaccess file with it and breaking my site I'm finally back to where I was.

Still having issues with JS files that don't exist but were included with requirejs-config.js.

I've tried several solutions yet nothing is working. The way I added the custom JS files was by creating a requirejs-config.js file in my theme folder, and then mapping the paths to the files inside. I then included them in the default_head_blocks.xml file. But now that I've deleted the JS files, and removed the requirejs-config.js file, and also removed them from the default_head_blocks.xml file I get these errors in the screenshot above.


texts: Magento 2 - Add new attribute (delivery_time) to recently viewed widget

texts:
What files need to be changed to display additional attributes in recently view products widget?

In the widget settings there is only name, price, image and learn_more available.

For the product attribute name i've spotted the file

vendor/magento/module-catalog/view/frontend/ui_component/widget_recently_viewed.xml:

<column name="name" component="Magento_Catalog/js/product/name" sortOrder="1" displayArea="details-area">
    <settings>
        Name
        <bodyTmpl>Magento_Catalog/product/name</bodyTmpl>
    </settings>
</column>

and vendor/magento/module-catalog/view/base/web/template/product/name.html:

I'm really confused about the $col.getLabel($row()), is there any documentation out there that covers this functionality?

What files needs to be changed for adding delivery_time or sku to the widget and where to put them?

Any help would appreciated


texts: Stopwords not working in Magento 2.3 for ElasticSearch 6.0+

texts:
I want to implement stopwords functionality in Magento 2.3 but it is not working.
I am overriding the file stopwords.csv using a custom module.
Someone, please suggest the solution.
Thanks,
Rashi


texts: How to change free downloaded theme default color in magento 1.9?

texts:
I am a magento learner i have created a dummy website and installed free magento 1.9 theme692 from given link.
https://www.templatemonster.com/free-templates/responsive-fashion-store-magento-theme-53078.html

Now I want to change default aqua color highlighted with red in given screenshot.

I have replaced the existing color with a new color code in style.css file but not take effect on frontend. Please guide me where can I change this colours according to my choice of colors?


texts: 'Option values are not specified' when saving configurable

texts:
I have a product import routine which calls $this->productRepository->save($product); but it's failing with the following error:

[Magento\Framework\Exception\InputException]
Option values are not specified.

Exception trace:
() at /vendor/magento/module-configurable-product/Model/OptionRepository.php:271
...

I have checked the eav_attribute_option_value table and the attribute options all have values. What am I missing?

--UPDATE--

So after further digging, and comparing SQL dumps before/after saving through the admin area, it appears Magento replaces (deletes then inserts) the configurable option settings in the following tables:

catalog_product_super_attribute
catalog_product_super_attribute_label
catalog_product_super_link

Every time a configurable product is saved... Can anyone explain why this happens?


texts: Paypal Controller Overriding/Extending not working

texts:
I have Magento 1.9 CE and I'm trying to create a new module for extend the class Mage_Paypal_Controller_Express_Abstract, but it doesn't work.
Here's the code:

Name_Module.xml  in /app/etc/modules

<?xml version="1.0"?>
  <config>
    <modules>
     <Name_Module>
        <active>true</active>
        <codePool>local</codePool>
        <depends></depends>
     </Name_Module>
  </modules>
</config>

config.xml from /app/code/local/Name/Module/etc/

<?xml version="1.0"?>
 <config>
  <modules>
    <Name_Module>
        <version>1.0.0</version>
    </Name_Module>
</modules>
<frontend>
    <routers>
          <paypal>
            <args>
                <modules>
                        <Name_Module before="Mage_Paypal">Name_Module _Paypal</Name_Module >
                </modules>
             </args>
        </paypal>
    </routers>
</frontend>

and Abstract.php app/code/local/Name//Controller/Paypal/Express/

<?php
include_once('Mage/Paypal/Controller/Express/Abstract.php');
class Name_Module_Paypal_Express_Abstract extends        Mage_Paypal_Controller_Express_Abstract{

/**
 * Submit the order
 */
 public function placeOrderAction()
 {
      //code
  }
 }

Why doesn't it work?


texts: How do I "force" a theme layout of 1 column for a single page?

texts:
we edited the xml and now the sidebar does not show but we need to, for that page, to make the theme be 1 column and now 2 as it is right now. It's from a module so we can't edit the layout on the backoffice but it comes with this on the xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

But it's always at 2 columns, how can we force this page to be always 1?
Best regards,
Rui Silva


texts: Magento security question database available in root dir /

texts:
I worked on a Magento install where I found database dumps lying in the root index / i.e. the same directory as the magento base url. Like:

mystore.com/databasename.datethedumpwasmade.sql
mystore.com/databasename.datethedumpwasmade.sql

The database name can not be guessed easily, now my question is how worried should I be about this. The possibilities that I see here for first finding out the filename of the dumps:

There are bots roaming the internet searching for these dumps, for them to be effective they would need to have some way of figuring out the database name and then running through each possible date extension. Is this plausible
At the time of creation, I'm assuming the developer has downloaded the dump via a browser and then not deleted it. Risk of the filepath having stuck in some log somewhere and hence automated bots being able to find it
Other way of guessing/knowing such a file exist and downloading it

Assuming someone did obtain the database, even though MD5 hashed, I'd assume the reasonable thing would be to e-mail customers asking them to change their passwords. What computing power and determination is required to crack 80 000 passwords (of which 60 000 is not actually user accounts and mean nothing).

The files as such has been deleted of course.


texts: Something went wrong with processing the default view magneto 2

texts:
when I try to access "products" in the backend, I"m getting an error.

Debug this

[2020-01-15 05:04:13] main.CRITICAL: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity, line: 1 {"exception":"[object] (Exception(code: 2): DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity, line: 1 at /var/www/vhosts/xyz.com/vendor/magento/framework/Escaper.php:78)"} []


texts: Why in Magento EE the DOB and Gender configuration are "disabled"?

texts:
I was looking for a way to enable DOB and Gender and well I saw that there is a configuration under System → Configuration → Customers → Cusotmers Configuration → Name and Address Options and there should be two dropdowns with the configuration for DOB and Gender. The thing I saw is that in app/code/core/Enterprise/Customer/etc/system.xml is that they are not configurable through any of the three scopes (Default, Website and Store), the code here:

<?xml version="1.0"?>
<!--
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition License
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magentocommerce.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Enterprise
 * @package     Enterprise_Customer
 * @copyright   Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://www.magentocommerce.com/license/enterprise-edition
 */
-->
<config>
    <sections>
        <customer>
            <groups>
                <address>
                    <fields>
                        <street_lines>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </street_lines>
                        <prefix_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </prefix_show>
                        <middlename_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </middlename_show>
                        <suffix_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </suffix_show>
                        <dob_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </dob_show>
                        <taxvat_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </taxvat_show>
                        <gender_show>
                            <show_in_default>0</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        </gender_show>
                    </fields>
                </address>
            </groups>
        </customer>
    </sections>
</config>

I hope someone has the answer.


texts: How to get the custom email templates list in magento2

texts:
How to get custom email templates list collection in magento2.
how to get the collection


texts: Compare attribute value of different attribute sets

texts:
What I'm trying to accomplish:

I have 2 types of products.

Rental cars
Rental companies (of those cars)

When comparing rental cars I want to show the rental cars attributes but also the attributes of its rental company.

So what I did was:

I added a dropdown attribute in rental cars with the rental companies so that I can make a connection between the two.

In logical terms it should be something like this:
When rental car attribute X = 'Rent-A-Car', then display attributes of rental company 'Rent-A-Car'.

To be exact:
The rental cars and the rental companies both have different attribute sets.

I believe this is doable but after days of trying I'm stuck. Anybody?

EDIT

What I have pulled of myself so far is this:

        <?php
        $product = Mage::getModel('catalog/product')->load($provider_id);
        $attributes = $product->getAttributes();

        foreach ($attributes as $attribute)
        {
            if ($attribute->getIsVisibleOnFront())
            {
                $attributeCode = $attribute->getAttributeCode();
                $label = $attribute->getFrontend()->getLabel($product);
                $value = $attribute->getFrontend()->getValue($product);

                echo '
';
                echo '' . $label . '	';

                foreach ($items as $_item)
                {
                    echo '' . $value . '	';
                }

                echo '
';
            }
        }
    ?>

I get the right attributes and the right attribute values but only from the first product in the list. The other compare products always have exactly the same values.

I believe I nead a sort of 'foreach product' but I don't know how :(


texts: How to change driver between amqp and db

texts:
We have an extension that can make use of either MySQL driver db or RabbitMQ amqp.
The drive is mentioned on these files:

etc/queue_consumer.xml
etc/queue_publisher.xml
etc/queue_topology.xml

https://github.com/Nosto/nosto-magento2/blob/develop/etc/queue_consumer.xml

https://github.com/Nosto/nosto-magento2/blob/develop/etc/queue_publisher.xml

https://github.com/Nosto/nosto-magento2/blob/develop/etc/queue_topology.xml

By default, the XML definition causes it use the db(MySQL). In order to switch over to RabbitMQ, all of the three XML files cited above need to be manually edited to set connection to amqp. Having done that, you need to run setup:upgrade.
We cannot ship with the default being amqp as RabbitMQ isn't enabled by default in all Magento installations.

What is the recommended way - using overrides or the CLI - to force a queue to use the amqp? While it is possible to do this manually by editing extension sources, it seems to be an anti-pattern of editing sources directly.
Does anybody have another idea? I appreciate the help!


texts: Proper way to get config values in overridden template in Magento 2

texts:
I need to get theme's Default Title configuration value in my logo.phtml.

So after many searches, I'm using a bad way for do that!
I'm using the Object Manager Instance directly in template file!

app\design\frontend\MyVendor\myTheme\Magento_Theme\templates\html\header\logo.phtml:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_pageConfig = $objectManager->get('Magento\Framework\View\Page\Config');
$_metaTitle = strip_tags($_pageConfig->getTitle()->getDefault());

And it works!

But how can I get anything from Configuration Values in overridden templates in proper way like Block Class or Layout stuff?!

By the way, I'm using Magento v2.1.9 with PHP 7.0.24.


texts:
We recently moved from magento1 to magento2. The price and product structure seems to be different in magento2.

Example: We sell bags in 20 different colors and with 5 different (selectable) accessories so after generating configuration we get 100 simple products for each bag!

In magento1 we only had 20 simple products (priced at 0$) for each color that were assigned to each configurable product. The price was defined by the configurable product and the accessories would add x$ to the price.

I am not sure if I did something wrong.. Is it normal to have so many products in magento2 and is there a reason to this ?


texts: Magento install missing magentotheme button from admin panel

texts:
I am very new to Magento and have recently taken over a website running Magento version 1.9.2.3.

In the admin panel, it seems to be missing the "magentotheme" button which I have seen in several instructional videos.

I was wondering is this a version issue? or like a missing plugin? if so how can I fix?

Thanks in advance.

Here is an illustration of the button I am missing.


texts: Add new tab in product edit page and call custom phtml in Magento 2.1

texts:
I want to add new tab in product edit page and for that i have follow this steps :

Create di.xml and add below code:

<virtualType name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Pool">
    <arguments>
        <argument name="modifiers" xsi:type="array">
            <item name="custommodule" xsi:type="array">
                <item name="class" xsi:type="string">Namespace\Custommodule\Ui\DataProvider\Product\Modifier\Customtab</item>
                <item name="sortOrder" xsi:type="number">200</item>
            </item>
        </argument>
    </arguments>
</virtualType>

Create Customtab.php and by modifyMeta() function new tab is
created.

Now I want to call custom phtml file to render html. How can I call custom phtml file ?


texts: how to get magento categories and set values of categories while adding a product programatically?

texts:
I want to add a product programmatically.
I have the categories like below.

Vehicles --
           Toyota--
                   Yaris
                   Corolla
                   Allion
           Honda--
                   Accord
                   Civic
                   Ascot

How can i get the magento subcategories with above category level?

How can i set the subcategories while adding the product?

i can set the category like this ->setCategoryIds(array(catid))

Update

I want to get the categories in 3 level.

Ex. Vehicle(Main Category) - level 1

Toyota(Sub Category of Vehicle)  - level 2

Yaris(Child category of Toyota)  - level 3

I want to view the all subcategories(Toyota,Honda) in one Drop Down.
once i choose a subcategory i want to view the child category of selected subcategory.


texts: Correct method for setting URL keys in a multi-language store?

texts:
I have a multi-language store with two views, EN and DE.
I use the store view in the URL, so a page might look like:

http://www.mysite.de/en/news.html

When I create the DE version (which I do by changing view and editing the text in my pages), do I need (or should I) create unique URL keys, or is it enough that the country code is changing. In other words, which of these is best?

http://www.mysite.de/de/news.html
http://www.mysite.de/de/news-de.html


texts: How to remove store code when changing store views?

texts:
So I've setup multiple views for my website, but the thing is, when I change store views, the URL ends up looking like this:

  https://www.domain.com/shop/product1.html?___store=english&___from_store=hindi

I'd like to be like:

  https://www.domain.com/shop/product1.html

Any suggestions on how to do this?

P.S. I have set the option to 'add code to the URL' as No.


texts:
I am new to Magento and we are planning to use it for our new store.
We are in the process of finalizing the budget for first release where we need minimal set of features ( for sure there should not be any compromise to the  features which must be present for a good store example is one page checkout, Guest checkout).

For this we need what all the features are freely available in the CE and what all are paid.

is there any where I can see what all the features are free?


texts:
How to enable CSS Critical Path in Magento 2.3.0

Reff: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css-critical-path.html

When I try to enable, I'm getting the below error.
Magento v 2.3.0

The "dev/css/use_css_critical_path" path doesn't exist. Verify and try again.


texts:
After exporting my previous database, allot of my product names where upper case. I now want to run a sql query to update the product names to title case.
What is correct way to do this


texts:
Easily with any email you can subscribe to Magento 2 newsletter.

The only available control is to send confirmation email to provided address.

If provided email address is not valid Magento confirmation email will bounce back.

The issue is:

If you are using email provider like mandrill or sendgrid they are charging per outgoing email, so you are losing money because of this SPAM newsletter subscribers, any solution?


texts: Rearranged Subcategory Does not Reflect Store View

texts:
So this is bugging me for months now, and I have yet found any real solution.
(Forgive me if this is already posted)

In the backend where you can manage category, it gives you an option to rearrange the subcategory by simply drag-and-drop then save. Which I did. But when I try to view the store view did not change to reflect the backend.

Sample image below:

The "Biological" page is suppose to be between the "Stereo" and the "Educational". But instead is at the very end.

Please help! I've tried refreshing the cache/index management but nothing is working...


texts:
Can anyone help me to find online training courses for Magento 2?
I need training courses which cover from scratch to advanced, which also provides certification also.


texts: "SSL certificate problem: unable to get local issuer certificate" in Magento 1.9.3.0

texts:
I've only been able to find info regarding "SSL certificate problem: unable to get local issuer certificate" in relation to Magento 2.

My install is a Magento ver. 1.9.3.0 hosted locally on Ampps.

When I try to Install New Extensions, I receive the "SSL certificate problem: unable to get local issuer certificate" message.

This has only been happening since the upgrade from 1.9.2.4, it was working fine before that. Any ideas how to get around this?


texts: Magento 2 REST - SKU to items on cart totals API response is not available, How to get SKU in response API

texts:
Magento 2 Rest API of cart totals doesn't provide SKU, Which is necessary for any operation like extension_attributes

/rest/V1/carts/mine/totals

The return array of Items is

array (size=21)
          'item_id' => string '139' (length=3)
          'name' => string '40Cm Width Protective Packaging Pe Air Bubble Roll Film Wrap' (length=60)
          'qty' => int 2
          'price' => string '0.0000' (length=6)
          'base_price' => string '0.0000' (length=6)
          'discount_percent' => string '0.0000' (length=6)
          'discount_amount' => string '0.0000' (length=6)
          'base_discount_amount' => string '0.0000' (length=6)
          'tax_percent' => string '0.0000' (length=6)
          'tax_amount' => string '0.0000' (length=6)
          'base_tax_amount' => string '0.0000' (length=6)
          'row_total' => string '0.0000' (length=6)
          'base_row_total' => string '0.0000' (length=6)
          'row_total_with_discount' => string '0.0000' (length=6)
          'price_incl_tax' => null
          'base_price_incl_tax' => null
          'row_total_incl_tax' => null
          'base_row_total_incl_tax' => null
          'weee_tax_applied' => null
          'weee_tax_applied_amount' => null
          'options' => string '[]' (length=2)

I want to add extension attribute of Image but I need SKU for that, But in this return data Magento doesn't provide SKU.

  File is used for API

/vendor/magento/module-quote/Model/Cart/CartTotalRepository.php

  Function is used for API

public function get($cartId)

Any one have Fixed the above issue, Or Reported the issue in git ?

  How to get SKU in /rest/V1/carts/mine/totals response API


texts:
I input code

<owave.com/media/wysiwyg/images/good.jpg" />

1 2 3 <img alt="fair" src="http:/5

jquery carousel by WOWSlider.com v8.7

&nbsp;

and cms-homepage-content input

<reference name="head">
    <action method="additem">
    <type>skin_css</type><name>css/style.css</name>
    </action>
<action method="additem">
    <type>skin_js</type><name>js/jquery.js</name>
    </action>
<action method="additem">
    <type>skin_js</type><name>js/jquery.js</name>
    </action>
</reference>

to admin-CMS-homepage to add new java script.

The problem is, the new java script I entered works fine, but the original java script or xml files that are related to advanced menu are not running, resulting sub menu to not function properly.

What do you think is the problem?


texts: editWebsite page in admin showing blank page

texts:
I have two sub website in my magento store, and those was working properly.

But now editWebsite page in backend showing blank page.

What is the problem in my magento store?


texts: Adding internal JavaScript file to Magento

texts:
How to add internal JavaScript file to Magento, so it's code would be included on every frontend page?

Edit: i edit this question because it isn't duplicate because in other question, ask how can add external Javascript.


texts:
An error has happened during application run. See exception log for details.

[2018-01-12 02:00:11] main.CRITICAL: Dotmailer connector API endpoint cannot be empty. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Dotmailer connector API endpoint cannot be empty. at /home/site/public_html/vendor/dotmailer/dotmailer-magento2-extension/Model/Apiconnector/Client.php:118)"} []

Hello, I just used commands:

php bin/magento setup:upgrade
./n98-magerun2.phar cache:clean

That's it, I'm using the latest Magento version at the momment: 2.2.2.


texts: How to solve "No Valid Data Send" message in magento product export

texts:
When we export product detail in magento at time "No Valid Data Send" message display.
How to solve it?


texts: Magento 2.X credit card Authorize.net using as set sandbox after place order but checkout page getting error

texts:
I am using Magento2.3.1 and I have to use payment method credit card authorize.net and right now I set payment method as sandbox mode after place order all fillup information correctly but getting the issue on the checkout page

An error occurred during processing. Please try again.

In console getting this error on network response is

{"messages":{"resultCode":"Error","message":[{"code":"E00001","text":"An error occurred during processing. Please try again."}]}}

below my configuration setting share with you

Thanks in advance


texts:
Is it possible to customer email variables? For example, there is a variable for Shipping description: {{var order.getShippingDescription()}}

In the email I want to change new lines (\n) to be line breaks (<br>) for the shipping description.

Is this possible?


texts: How the upsell products handled in view page?

texts:
How magento 2 displayed only the in-stock upsell products in view page. How they handled and displayed

I wish to display upsell product collection in list page on each product.
I got the upsell product collection using below code and I got the upsell product collection (But it got both in-stock and out of stock products). I need to display only instock upsell products. So Please Provide me a solution to get in-stock upsell products

  $product->getUpSellProductCollection()

but while getting collection itself ,how do i add stock status filter then wish to get the upsell collection.

  I don't want foreach each item and check stock status


texts: Determining the Current Page without use of request or URL

texts:
I'm in a situation whereby our Caching module is obfuscating the requests and the URLs, making it difficult to tell what the current page is.

For example - without caching:

/checkout/cart

with caching:

/899472304723khb4i23grhi29dhokhsabidb3q78bdi2bdiwbyudybasud6s81g

This is true regardless of reading the request via $this->getRequest();, $_SERVER['REQUEST_URI']; or by reading Mage::helper('core/helper')->getCurrentUrl(); - the URL in all cases is obfuscated as above.

Due to this, I'm a little stuck on how to detect the current page without this information. Can someone help?


texts: Configurable product price removed after assigning simple products

texts:
We have configurable products each with a price. These products are ordered by price on category pages.

When assigning simple products to an existing configurable product, the price of the configurable product is taken over by the simple products assigned to the configurable product. The price field on admin site is greyed out and can't be changed anymore.

The problem is that the order on category pages is still ordered by the price set on the configurable product and not by the prices of the simple products assigned to the configurable product.
+ when saving the configurable product again after it has simple products assigned to it, the price is removed of the configurable product. This means that the product is set on the first place on category pages because Magento only looks at the price of the configurable product which is 0 because it was removed after saving.

The only solution we find is to update the price of the configurable product with the bulk method and set it to a price of an assigned simple product.
But this is not a correct and fast way.

The image below show a configurable product with no price because it's removed after saving with simple products.

Information:
Magento ver. 2.3.1

Is it normal for Magento to only look at the prices of configurable product for the order on category pages and is there anyone who knows a solution for this?


texts: Check if email is subscribed to newsletter - always returns TRUE

texts:
I have created a custom observer method for event "newsletter_subscriber_save_after":

    <newsletter_subscriber_save_after>
      <observers>
        <customscripts_common_controller_checkout_newsletter>
          <class>Customscripts_Common_Model_Observer</class>
          <method>controller_checkout_newsletter</method>
        </customscripts_common_controller_checkout_newsletter>
      </observers>
    </newsletter_subscriber_save_after>

Inside method's code, I check if email is subscribed to newsletter list. But the check always returns true:

$email = Mage::getSingleton('customer/session')->getCustomer()->getData('email');
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
if($subscriber->getId()) //this is ALWAYS TRUE
{
       //do stuff
}

Any idea about this strange issue???


texts:
I am searching table but it not giving only table related records. It giving me other products also, which is irrelevant. I have set criteria in admin panel short description, price, and image. What will be issue ?

I am searching product Table but it gives me result of => "Karoo Angel - Guardian Angel Dark Purple" this also. Description also not contain table key anywhere. Image name also nothing related to table.


texts:
How to get custom price by observer in magento?

My code:

public function updatePrice(Varien_Event_Observer $obs)
{
    $quote = $obs->getEvent()->getQuote();

    //$quote = $observer->getEvent()->getData();

    foreach ($quote['data_object']->getAllItems() as $key => $item) {
        if( !$item->getCustomPrice() ){
            echo "Hello";
            print_r($customPrice); die;
        }
    }


texts: Admin form not pulling through form values when turning collapsible to tabbed form using ui form xml

texts:
I'm working on an admin ui form

https://github.com/DominicWatts/Announce/blob/hotfix/tabs/view/adminhtml/ui_component/xigen_announce_group_form.xml

I've added tabs

In order to get the tabs working I've removed the <item name="template" xsi:type="string">templates/form/collapsible</item> from the XML

My form elements have changed from <input name="name"> to <input name="general[name]">

Which makes sense

However when editing a record the form fields now appear blank. I've forgotten a step.

It's to do with dataScope and chaining

Any suggestion?


texts: Do you know any good courses/tutorials/blogs?

texts:
I am learning more and more about Magento 2 yet I still feel like there is much to learn. I was wondering what good sources/methods of learning the following subjects are.
Basics
Things like the information about the MVC architecture of Magento 2, Resources for finding classes to use in your modules (Which classes to use in what situation) or the workflow of making a webshop in Magento 2.
Advanced
I find it difficult to find good KnockoutJS information compatible with Magento 2. Information about widgets and specifically their admin options.


texts: Magento2 - Products suddenly disappeared on frontend

texts:
I've been developing Magento 2.0 themes/extensions for a while now and almost releasing the first Magento webshop. My problem is that in this webshop the products are suddenly disappeared on the frontend. The backend still shows the products correct. I've spent a lot of hours now to search for a solution, but I still did not manage to get it working again.

I checked all standard possible solutions:

Cleared/flushed Magento cache/ Cache storage (via admin and command line)
Product is in stock and has a qty of 10
Product visibility is enabled
Run indexer:reindex

Did anyone have a similar problem?


texts:
I am dealing with huge collections of products and categories right now and am looking for the most efficient way of handling large collections.

I stumbled upon this: Mage_Core_Model_Resource_Iterator
 and have read that this should be used.

Can anyone point out why I would use this over setting the pageSize on a collection?

And also, what is the preferred way of dealing with a massive product collection.

The exact scenario is that I have 120,000 products + 10 websites and 37 stores and I need to get the urls and other bits of data from each ready for a custom csv export.

I am currently looping loading the store collecton, and the for each store loading the product collection and looping over each.


texts: How to change the Maximum Number of Customer Login Attempts?

texts: I want to know how to change the customer's maximum login attempts in Magento 2. I know how to do it for the admin but can't figure it out for customers.


texts: display categories based on custom attribute value

texts:
i have added a boolean custom attribute for categories using the following code

<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute  = array(
    'group'                => 'General',
    'type'              => 'int',//can be int, varchar, decimal, text, datetime
    'backend'           => '',
    'frontend_input'    => '',
    'frontend'          => '',
    'label'             => 'popular category',
    'input'             => 'select', //text, textarea, select, file, image, multilselect
    'default' => array(0),
    'class'             => '',
    'source'            => 'eav/entity_attribute_source_boolean',//this is necessary for select and multilelect, for the rest leave it blank
    'global'             => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
    'visible'           => true,
    'frontend_class'     => '',
    'required'          => false,//or true
    'user_defined'      => true,
    'default'           => '',
    'position'            => 100,//any number will do
);

$installer->addAttribute('catalog_category', 'attribute_popular', $attribute);
$installer->endSetup();
?>

now i want to show the categories having the attribute value "yes" in home page


texts: Magento 2.3 - Fetching child/associated products of configurable product only returns In Stock products

texts:
In order to fetch all associated products of configurable product. I used this code

$childProducts = $configurableproduct->getTypeInstance()->getUsedProducts($configurableproduct);

It return the collection of child products having status In Stock

Any help, knowledge sharing and experience would be highly appreciated.


texts: $this->getChild("custom_block") loading same instance

texts:
I am trying to execute below code on product listing page.

$this->getChild("custom_block")->setData("product", $_prd->getId());
echo $this->getChildHtml("custom_block");

But when I am fetch the ID using below code

$this->getProduct();

in catalog/custom.phtml

<catalog_category_layered>
        <reference name="product_list">
            <block type="custom/custom" name="custom_block" as="custom_block" template="catalog/custom.phtml" />
        </reference>
    </catalog_category_layered>

I am getting the same id for the all the products, the id of the product which is first in the list.


texts:
I need to customize admin grid which is in Content->Pages.

What is the correct way to add new feature/customize to the admin grid?

Suppose in the above-mentioned grid, I need to change the "Add New Page" to "Add Pages"

Thanks


texts: Magento 2 pass data from template html to phtml file

texts:
So far I have created file MyModule/ProductAlert/view/frontend/email/stock.html -

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

{{var alertGrid|raw}}

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

And I would like to pass my variable email to .phtml file in
MyModule/ProductAlert/view/frontend/templates/email/stock.phtml and call it there -

    <?php
use MyModule\ProductAlert\Block\Email\Stock;

/** @var $block Stock */
?>

    <?php if ($_products = $block->getProducts()): ?>
        <?php foreach ($_products as $_product): ?>

<?= __('Hello!') ?>

Your email: <?php $block->getData('email') ?>
 // Email should be here
        <?php endforeach; ?>
    <?php endif; ?>

Currently it returns me nothing. How can I achieve that? Thank you!


texts:
Every time when I save a product with changes or without changes following index required reindex:

Product Attributes
Product Prices
Stock Status

All Index mode is set to " Update on Save ". I have checked the exception and system log, there is no error related to this.

Can you help me to guide how can I debug this issue ?


texts:
Take this random class

https://github.com/magento/magento2/blob/2.3/app/code/Magento/Checkout/Helper/Cart.php

Got a mixture of code comments for class, variables, constants, methods etc all nice and tidy. I'm finding it really time consuming to comment my code to this standard. This is something that the official coding standards picks up on. I guess I could not bother but does make life easier when returning to 'old' code.

https://github.com/magento/magento-coding-standard

I'm using VScode.  Is there a plugin or something out there than can generate some of this for me?  Happy to even look at other editors.


texts: Adding a block snippet to a static block not working

texts:
Built a module with one block - List.php

class Pts_HireCms_Block_List extends Mage_Core_Block_Template
{
    protected $productRange;
    public function loadCollection($productRange)
    {
        return Mage::getModel('hirecms/hire')
                            ->getCollection()
                            ->addFieldToFilter('product_range', $productRange)
                            ->setOrder('position', 'asc');
    }
    public function getHireProd()
    {
        return $this->loadCollection('Hire Prods');
    }
    public function getNonHireProds()
    {
        return $this->loadCollection('Non Hire Prods');
    }
}

Then I have a theme xml file of hirecms.xml:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="root">
            <block type="hirecms/list" name="hireProd" template="hirecms/hire-prod.phtml" />
            <block type="hirecms/list" name="nonHireProd" template="hirecms/non-hire-prod.phtml" />
        </reference>
    </default>
</layout>

and i've added:

{{block type="hirecms/list" template="hirecms/hire-prod.phtml"}}

to a static block, then on a category i've set display mode = static block only and cms block = to the one ive created.

However when i visit the route, the page loads but my block {{block type="hirecms/list" template="hirecms/hire-prod.phtml"}} is not being called.

Any ideas why?

I have this working perfectly on my local site, and the code has been pushed using github so no amendments along the way.

Thanks


texts: Change default select all to select all on this page in orders table in magento 2

texts:
I have local setup of Magento 2 Enterprise edition (ver:2.2.3)

In the sales->orders table for mass action i need to select all on this page by default. Now if i click on the checkbox it selects all by default

But now i have to change the default action of selecting all to select all on this page.


texts:
i updated magento, and now in the checkout page i get this error.
How can i debug this?
Thank you!

                [2018-07-31 16:16:15] main.CRITICAL: Report ID: webapi-5b608b4fab129; Message: Property "CheckoutFields" does not have corresponding setter in class "Magento\Quote\Api\Data\AddressExtensionInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5b608b4fab129; Message: Property \"CheckoutFields\" does not have corresponding setter in class \"Magento\\Quote\\Api\\Data\\AddressExtensionInterface\". at /home/r2gutenb/public_html/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Property \"CheckoutFields\" does not have corresponding setter in class \"Magento\\Quote\\Api\\Data\\AddressExtensionInterface\". at /home/r2gutenb/public_html/vendor/magento/framework/Reflection/NameFinder.php:100)"} []

here the extension_attributes that maybe are causing the problem...


texts:
I'm trying to render a bundle product's options (html) in a block for a custom module that I'm working on, without much success and I hit a dead end so far.

For for configurable or grouped products it works with:

$blockOptionsHtml = null;
if($product->getTypeId()=="configurable")
{
    $blockViewType = Mage::app()->getLayout()
        ->createBlock("Mage_Catalog_Block_Product_View_Type_Configurable");
    $blockViewType->setProduct($product);
    $blockViewType
        ->setTemplate("catalog/product/view/type/options/configurable.phtml");
    $blockOptionsHtml .= $blockViewType->toHtml();
}
return $blockOptionsHtml();

The same is not working for a bundle product.

Well, we modified the type in  createBlock type and the addOptionRenderer, which for bundles is actually just addRenderer and doesn't accept the 3rd parameter (the template, which is declared inside the block file).

Hope this makes any sense and maybe someone has an idea, it will be greately appreciated, as I'm pretty stuck for the moment...

Code we use for bundles:

$blockOptionsHtml = null;
$blockViewType = Mage::app()->getLayout()
    ->createBlock("Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option");
$blockViewType->setProduct($product);
$blockViewType->setTemplate("bundle/catalog/product/view/type/bundle/options.phtml");
$blockOptionsHtml .= $blockViewType->toHtml();

but in the browser the message is "No options of this product are available".


texts: Magento 2 : How to get parent method while we extend the class

texts:
I am extending this class :
Magento\Sales\Model\Service\InvoiceService

My extended file :

namespace Company\Vendor\Model\Service;

use Magento\Sales\Api\InvoiceManagementInterface;
use Magento\Sales\Model\Order;

class InvoiceService extends \Magento\Sales\Model\Service\InvoiceService implements InvoiceManagementInterface
{

    public function prepareInvoice(Order $order, array $qtys = [])
    {
        $invoice = $this->orderConverter->toInvoice($order);
        $totalQty = 0;
        $qtys = parent::prepareItemsQty($order, $qtys); // modified line
        //$qtys = $this->prepareItemsQty($order, $qtys); // core line
        foreach ($order->getAllItems() as $orderItem) {
            if (!$this->_canInvoiceItem($orderItem)) {
                continue;
            }
            $item = $this->orderConverter->itemToInvoiceItem($orderItem);
            if ($orderItem->isDummy()) {
                $qty = $orderItem->getQtyOrdered() ? $orderItem->getQtyOrdered() : 1;
            } elseif (isset($qtys[$orderItem->getId()])) {
                $qty = (double) $qtys[$orderItem->getId()];
            } elseif (empty($qtys)) {
                $qty = $orderItem->getQtyToInvoice();
            } else {
                $qty = 0;
            }
            $totalQty += $qty;
            $this->setInvoiceItemQuantity($item, $qty);
            $invoice->addItem($item);
        }
        $invoice->setTotalQty($totalQty);
        $invoice->collectTotals();
        $order->getInvoiceCollection()->addItem($invoice);
        return $invoice;
    }
}

I am getting an error here:$this->prepareItemsQty($order, $qtys);

So I am a bit confused about how to call another function of parent functions here.

  Note: I don't want to declare code of prepareItemsQty() here
  (extended class).


texts: Layout Update XML for Category in Magento 2.3.4

texts: Can anyone help me how to change number of products per page for a SPECIFIC category. I am on magento 2.3.4 and noticed that Layout Update XML does not exist anymore.


texts: read from csv and how to update images like base image ,small_image, thumbnail through REST api in magento 2

texts:
I am unable to update the images through rest api in magento 2,below this is my code.please guide me right direction.Here got the error

string(47) "{"message":"Request does not match any route."}"

$adminUrl = 'http://localhost/#####/index.php/rest/V1/integration/admin/token/';
        $ch = curl_init();
        $data = array("username" => "######", "password" => "############");

        $data_string = json_encode($data);
        $ch = curl_init($adminUrl);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            'Content-Type: application/json',
            'Content-Length: ' . strlen($data_string))
        );
        $token = curl_exec($ch);
        $token=  json_decode($token);

        //Use above token into header
        $headers = array("Authorization: Bearer $token","Content-Type: application/json");

        foreach ($list as $sku => $skus) {

          $requestUrl='http://localhost/##############/index.php/rest/V1/products/' . $skus['Product ID'] . '/media';

//print_r($requestUrl);exit;

        $productData = array();

$productData = [
        "custom_attributes" => [
                ["attribute_code" => "image", "value" => "/w/i/sample_1.jpg"],
                ["attribute_code" => "small_image", "value" => "/w/i/sample_2.jpg"],
                ["attribute_code" => "thumbnail", "value" => "/w/i/sample_2.jpg"]

            ]
    ];

//print_r($productData);exit;

        $productData = json_encode(array('product' => $productData));

          $ch = curl_init();
          curl_setopt($ch,CURLOPT_URL, $requestUrl);
          curl_setopt($ch,CURLOPT_POSTFIELDS, $productData);
          curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
          curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          $response = curl_exec($ch);
          curl_close($ch);
          var_dump($response);

          unset($productData);
          unset($sampleProductData);
        }


texts: Redirecting from Observer after calling external API when executing payment method

texts:
I am developing a payment module.
I am trying to redirect to an external url after calling an API with curl.
The api returns a redirect url (https://.....com/..../..), which I would like to follow and continue with payment on the page it should open.
I am trying to do that from an Observer (before_save_order_payment)
I tried every possible way (resultRedirectFactory, _redirect(), header("Location:"), etc)
but none of them redirects to that external url.
Sometimes it happens to redirect to the cart page... o_O
This is my first Magento 2 development, so I am not sure if doing that from the observer is the correct way.


texts:
I am getting 404 error. Only home page is working only.

Can anybody tell me what could be reason for that

Thanks


texts: Selenium test hits exception and times out instead of continuing

texts:
I am trying to test my store by running the functional tests provided in CE 1.9.2.0.

I have configured the environment and when the test starts a browser opens up and I can see it working.

However, before completing the first CreateAdminUserRoleEntityTest test, I run into an error.  I would expect PHP Unit to mark the test as failed and move on to the next.  Instead it just hangs and tries to find the same CSS selector over and over again, until the timeout is reached and the testing stops.

Is this expected behavior?  How can I get it to keep testing when getting an exception from Selenium?

The Magento error I'm getting after save is Invalid current password.  The error in Selenium is

10:59:34.704 INFO - Done: [execute script: return document['readyState'], []]
10:59:34.706 INFO - Executing: [find element: By.cssSelector: .success-msg li])
10:59:36.724 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":".success-msg li"}
Command duration or timeout: 1.66 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'

Solution

I found the error was

Fatal error: Call to undefined method Mage\Admin\Test\TestCase\CreateAdminUserEntityTest::hasExpectationOnOutput()

I was using the wrong version of phpunit.  Instead I needed to use the version that was installed with composer.


texts:
We use magento 2.2.2 and we need a longer SKU.
We set "const SKU_MAX_LENGTH = 255;"
in the file module-catalog/Model/Product/Attribute/Backend/Sku.php
but it does not work


texts: Javascript is not working properly on product view page magento , but only for a part of the products?

texts:
i'm looking to solve a problem for few days now ! I have a website in some pages the javascript is loaded properly but in some of them not i'm getting some errors in console !
I will post an example with a good page and one with a bad one !
Good Page

http://www.abcsports.co.uk/index.php/mens/2015-under-armour-boys-heatgear-tech-big-logo-short-sleeve-training-t-shirt.html

Bad page :
http://www.abcsports.co.uk/index.php/mens/bottoms/golf-shorts/under-armour-2016-ua-heatgear-match-play-paterned-flat-front-mens-golf-shorts.html

On the good page sliders and tabs are displayed properly but in the bad ones the slider , tabs , all javascript cant be executed !

I really appreciate if somebody can help me with this !
Thank you


texts:
I have a small problem.
I have installed the new magento 2 on a ubuntu 16-04 server
with php 7.0.

I installed everything OK, now errors..
The i whant to install extension..
and i got this:

So i test to make a new crob.

* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/update/cron.php >> /var/www/html/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento2/bin/magento setup:cron:run >> /var/www/html/magento2/var/log/setup.cron.log

And i still cant install extension.

Please help.


texts: How to display custom database field in M2

texts:
I created a custom db table inside my Magento2 database and am having trouble making my custom phtml file display the field. (I'm new to M2 and php)

Here's my code and when I echo $result it display properly on the website but when I try to display the field with the last line it breaks the page:


texts: Magento 2 : Catalog Search With Elastic Search Engine does not take into account entity_id

texts:
By default when configuring the Mysql Search Engine on category pages besides the selected sort products were also sorted by entity_id desc.
When configuring Elasticsearch as the search engine this is no longer the case.
Does anyone know a fix for this?


texts: Uncaught TypeError: Cannot read property 'replace' of undefined in admin on Chrome

texts:
I cannot at all work in admin on Google Chrome. I saw in developer console a lot of error message like "Uncaught TypeError: Cannot read property 'replace' of undefined(..." The javascript seems to be messed up for some reason. Settings and the thigns I already tried several times each are:
1.Reinstalled Chrome.
2.Uninstalled using appzapper, manually cleaning /Applications/LaunchAgents,
3.Deleting any directory with Google and/or Chrome in it.
4.Signed out of my Google account. I thought this might have something to do with it, but it doesn't.
5.Javascript is set properly in my Chrome settings
6.I don't have any extensions.
7.Incognito mode also doesn't work.


texts: Why Magento 2.2.3 returns empty collection?

texts:
I don't have any prior experience in this. I want to fetch the products from Database. I am trying from past few hours.But not working.

I am using following code.

protected $_productCollectionFactory;

public function __construct(
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    array $data = []
)
{
    $this->_productCollectionFactory = $productCollectionFactory;
}

public function getProducts()
{
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->setPageSize(3); // fetching only 3 products
    return $collection;
}

I am getting following response.

Anything wrong with this code?

Even I also want to fetch the customer collection as well.

Also I want to know the difference between ProductCollectionFactory & product.

Also I tried below code.

 namespace Testmod\FetchDataApi\Api;

 interface CustomerRepositoryInterface
{

   /**
   * @param int|string $number
  * @return  \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
  */
    public function getCustomerParchases();
}

And my class:

namespace Testmod\FetchDataApi\Model;
use Magento\Framework\View\Element\Template;

 class CustomerRepository extends Template
 {

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    array $data = []
) {

    $this->_productCollectionFactory = $productCollectionFactory;
    parent::__construct($context, $data);
}

  public function getCustomerParchases()
  {
    $collection = $this->_productCollectionFactory->create();
      $collection->addAttributeToSelect('*');
    return $collection;

 }
}

Above code will return []. But collection->count(); returns product count wwhich is 5.


texts: Cannot send Shippment Email using PHP - Magento

texts:
I have a script to create shipments using PHP code.

I have everything working but I am not able to send Shipment emails to customers. See it says (the shipment email is not sent) ... I always have to press Send Tracking Information button to send emails, and then it starts showing (the shipment email was sent)

This is my complete code.

Mage::init();
$comment = null;
$email = true;
$includeComment = true;

$orderId = $data[5];  //get ordernumber from csv

$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);

if ($order->getId()) {

    $orderStatus = $order->getStatus();

    if ($order->getShipmentsCollection()->getData()) {
        echo 'Debug 1
';
        foreach ($order->getShipmentsCollection() as $shipment) {
            $shipmentid = $shipment->getId();
            echo 'Debug 2 ' . $shipmentid . '
';

            $shipment = Mage::getModel('sales/order_shipment')->load($shipmentid);
            $trackdata = array();
            $trackdata['carrier_code'] = $data[22];  //get CARRIER_NAME from csv
            $trackdata['title'] = $data[22];    //get title from csv
            $trackdata['number'] = $data[20];       //get CONSIGNMENT_NO from csv

            $track = Mage::getModel('sales/order_shipment_track')->addData($trackdata);
            $shipment->addTrack($track);
            $transactionSave = Mage::getModel('core/resource_transaction')
                    ->addObject($shipment)
                    ->addObject($shipment->getOrder())
                    ->save();

            $shipment->sendEmail(true, '');
            $shipment->setEmailSent(true);
        }
    } else {

        $convertor = Mage::getModel('sales/convert_order');
        $shipment = $convertor->toShipment($order);

        foreach ($order->getAllItems() as $orderItem) {
            if (!$orderItem->getQtyToShip()) {
                continue;
            }
            if ($orderItem->getIsVirtual()) {
                continue;
            }
            $item = $convertor->itemToShipmentItem($orderItem);
            $qty = $orderItem->getQtyToShip();
            $item->setQty($qty);
            $shipment->addItem($item);
        }

        $trackdata = array();
        $trackdata['carrier_code'] = $data[22];  //get carrier_code from csv
        $trackdata['title'] = $data[22];    //get title from csv
        $trackdata['number'] = $data[20];       //get track number from csv
        $track = Mage::getModel('sales/order_shipment_track')->addData($trackdata);
        $shipment->addTrack($track);

        $shipment->register();
        $shipment->addComment($comment, $email && $includeComment);

        $shipment->getOrder()->setIsInProcess(true);

        $transactionSave = Mage::getModel('core/resource_transaction')
                ->addObject($shipment)
                ->addObject($shipment->getOrder())
                ->save();

        $shipment->sendEmail(true, '');
        $shipment->setEmailSent(true);
    }

    $order->addStatusHistoryComment("My comment why the status was changed", Mage_Sales_Model_Order::STATE_COMPLETE);
    $order->save();

    echo "

Shipment Tracking Number Updated For the Order Id {$orderId} Successfully";

} else {
    echo 'Order with ID ' . $orderId . ' does not exists in magento
';
}

You can see the

$shipment->sendEmail(true, '');
$shipment->setEmailSent(true);

part of code but its not working.

Where I am going wrong? I have Magento ver. 1.9.2.4


texts: Get product collection by root category and all its subcategories in Magento 2?

texts:
How can I retrieve a product collection by a root category and from all its subcategories?

Eg:

Root Category (2 products)

Subcategory 1 (2 products)
Subcategory 2 (3 products)

So I want to retrieve all 7 products in the collection.


texts:
I went into Admin->System->Permission->Roles & edit the role for Admin

Now, i am unable to re-set back it to original "ALL" permissions.

How can i revert back to original settings ?

Thanks


texts: How to Add Custom Validation on Magento 2 Admin?

texts:
I have created some fields in Magento 2 Admin I want to add some custom validation in Admin Area.

If I add 200 in Product Cost Column in first row then I want to add 201 in next row if i add value less than 200 then i want to show like ( Please enter greater than value of 200 ) error on saving like it shows on required.


texts: Change magento transactional emails logo_url to external link

texts:
I need to change

  logo_url

for transactional emails with external link, for example

  https://exampledomainname.com/image.png

but I can't hardcode all or even one file in

  app/locale

Is there any way to add external url as logo_url? As when I go here:

  System > Configuration > General > Design > Transactional Emails

I can only add image to hosting area


texts: Date behaves differently in column and form field

texts:
Date stored in database: 2014-02-07 00:00:00

Magento Timezone: IST (GMT +5.30)

When I display this in column - it displays - 2014-02-07 05:30:00 which is correct and expected (since magento stores dates in UTC).

However, when I try to display the same date in textbox (readonly), it displays 2014-02-07 00:00:00 i.e. exactly same as in database - without any conversion.

How can I convert the date to show correct value in textbox?

$fieldset->addField('end_date', 'date', array(
            'label'     => Mage::helper('survey')->__('End Date'),
            'index'     => 'end_date',
            'name'      => 'end_date',
            'class'     => 'readonly',
            'readonly'  => true,
            'format' => Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
      ));


texts: Why do I see action notification messages on other pages?

texts:
Sometimes when I added products to the cart or I type wrong my password, I see the warning message in the checkout success page.

How could I fix it?


texts: URL Rewrite - Rewrite all path and subpath to one page

texts:
Is it possible to rewrite a 'general' path to one page.

Ex.

suppose I want to rewrite all pages that contains

mage.local.com/brands/*

to:

mage.local.com/brands/brands.html

There is any way to accomplish this


texts: How to display product view page in custom module Popup in Magento 2?

texts:
In my custom module, I have created a Popup and I want to display product view page in the popup. Is there any possible way to do this?

Please help me how to achieve this ASAP?


texts: show different product price using observer

texts:
on product detail page i want to show price other than original price via observer.

Say product with price 100 will show price as 120 or 110

which observer should i use to do same

I found product price comes from catalog/product/price.phtml

is there any way in admin > catalog > category > custom deign

to call my custom price.html for specifi category

something like below

<reference name="product.info">
            <action method="setTemplate"><template>catalog/product/view_mour.phtml</template></action>
</reference>

Update code:

<?xml version="1.0"?>
<config>
  <modules>
    <Mour_Customgroup>
      <version>0.1.0</version>
    </Mour_Customgroup>
  </modules>
  <frontend>
    <events>
         <catalog_product_load_after>
            <observers>
                <setadiscountprice>
                    <type>singleton</type>
                    <class>Mour_Customgroup_Model_Observer</class>
                    <method>changeprice</method>
                </setadiscountprice>
            </observers>
          <catalog_product_load_after>
    </events>
  </frontend>
</config>

and observer.php

<?php
class Mour_Customgroup_Model_Observer
{

    public function changeprice(Varien_Event_Observer $event) {
    if($_GET['id']){
        $pricetoadd=Mage::getModel('catalog/product')->load($_GET['id'])->getPrice(); // error comes after adding this line

        $product = $event->getEvent()->getProduct();
        $originalprice = $product->getPrice();
        $customprice = $originalprice+$pricetoadd;
        $product->setPrice($customprice);
    }
   }
}

i am trying to add price of product (id from get parameter) to product price

if i remove this line : $pricetoadd=Mage::getModel('catalog/product')->load($_GET['id'])->getPrice();

it works fine


texts: Magento 2 - losing the theme after module:enable

texts:
So in Magento 2, I seem to lose all of the static assets after I install a module. This is what happens:

bin/magento module:enable [module name or --all]

Which of course tells me:

  To make sure that the enabled modules are properly registered, run
  'setup:upgrade'.

Now the issue is when I run:

bin/magento setup:upgrade

All of the pregenerated static files are gone. The whole admin and store frontend breaks.

Then I have to run a bunch of commands to process and re-generate all of the required files. Now, please tell me I am making a noob mistake here. I might be on the wrong mode etc.

How do you guys handle this?


texts: Why is the Magento2 .gitignore file ignoring itself?

texts:
Line 61 of the .gitignore file reads

  /*.*

which includes itself so the .gitignore file is not committed. Is there a reason behind this?

https://github.com/magento/magento2-community-edition/blob/master/.gitignore


texts: After Magento admin login, the dashboard screen continuously loading

texts:
After the Magento admin login, the dashboard screen continuously loading.

Please provide a solution to this problem?


texts: XAMPP Magento 2 vendor folder does not have any core modules

texts: I tried to use Magento 2.3.0 in my Localhost.But vendor folder is not having required modules.Please help why it is happening.


texts:
I get a warrning on Magento\Catalog\Block\Product\ListProduct->getIdentities()

Warning: Invalid argument supplied for foreach()

I checked the specified method but I do not understand what does return

  /**
     * Return identifiers for produced content
     *
     * @return array
     */
    public function getIdentities()
    {
        $identities = [];
        foreach ($this->_getProductCollection() as $item) {
            $identities = array_merge($identities, $item->getIdentities());
        }
        $category = $this->getLayer()->getCurrentCategory();
        if ($category) {
            $identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $category->getId();
        }
        return $identities;
    }

locally I set var_dump() and die but is never getting touched


texts: Magento 2 how to change url of attribute filter layer navigation?

texts:
I want to change color=red instead of color=18.

I have change here : vendor\magento\module-catalog\Model\Layer\Filter\Item.php we have getUrl() function

public function getUrl()
{
    $query = array(
        $this->getFilter()->getRequestVar()=>$this->getValue(),
        Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
    );
    return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
}

to

public function getUrl()
    {
        $query = array(
            $this->getFilter()->getRequestVar()=>$this->getLabel(),
            Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
        );
        return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
    }

change $this->getLabel() filter stop working.


texts: redirect to localhost/magento2 after change folder name

texts:
I change magento2 folder name to magento2-me, but when i open localhost/magento2-me, it redirect to localhost/magento2/index.php/?SID=qfj3f4tkjlpukb9se92434dvt3 404 page.

How i resolve this problem.


texts: cloudflare best optimized setting for magento?

texts:
I have cloudflare CDN for my magento, what are the best & recommended setting I should set to optimize the speed.

I see that there is cache everything option in page rules. do you recommend this and how should I set it ?


texts: Magento 2 admin - can no longer save configurable products after upgrade to 2.1

texts:
After upgrading from 2.0.7 to 2.1, none of my configurable products will save on edit.  In the browser console I can see there is an ajax call to the Product/Validate controller that returns a 404 response (ex. admin/catalog/product/validate/id/269/type/configurable/store/0/set/4/?isAjax=true). This failure stops the save step from ever occurring.

Creating new configurable products works fine, editing simple products works fine (for example admin/catalog/product/validate/id/270/type/simple/store/0/set/4/?isAjax=true resolves correctly).

Accessing the validate URL directly in the address bar also works (at least to resolve to a 200 response).

I've tried deleting and completely re-installing the vendor directory via composer, after clearing the composer cache so new files were pulled.

Tried recompiling, all the usual cache clearing, re-indexing.

Does anyone have any ideas on what to try to possibly resolve this? I'm baffled.

------- Update -----------

The OS distro that I am running this on is CentOS 6.7. Interestingly, I have a Windows 10 development installation on XAMPP that I upgraded to 2.1 and all seems to work there.
I also tried a clean install of 2.1 in a new directory on CentOS, but that also failed in the exact same way.

I find it interesting that  a GET request (pasted into browser address bar) returns a 200 response, but a POST request does not. To me that signals some sort of failure at the routing level to recognize the URL pattern via POST, but I'm not quite sure how to track it down.  Is it related to this particular Linux distro? No idea yet.


texts: Hidden values in an extension - encode decode data transaction

texts:
I found an interesting extension for onepagecheckout. It seems to be free but when I installed the extension I realized that the code is sending and encoding data to developer servers. In theory its validating a license value - I don't know why because its free, additionally the site is not telling anything about that hidden value passed to their servers but.. OK. - its free.

Based on the fact that this particular area manages information about credit cards I would like to know which values are they passing. In my research I found that the code send to their servers are in a line called id=opc_s_data with a call to:

public function getSUrl($mode = '') {
    $code = Mage::getStoreConfig('onepagecheckout/sdatacode');
    eval(base64_decode($code));
    if(!isset($url))
        $url = '';
    return $url;
}

and the value sent is something like:

<input type='hidden' id='opc_s_data'
    value='http://company.com/magento/opclicense/opcaction.php?sdata=bWFEuN......=='/

Does anyone know what can I do to decode the information sent to my application from their servers? If I erase this hidden ID the onepagecheckout doesn't work.

Disclaimer: I wrote to the developer but I never received a response.


texts: The system field 'weight' is disappeared from backoffice

texts:
When I try to insert a new product I don't find the system field weight in the General attribute group.
It is present in the Manage Attribute Sets but not in the Manage Products.

Any ideas?


texts: what will happen if overriding a class in my module used by another module

texts:
I'm working on a module and I need a block file to be overridden in order to add new functionality. I know how to override blocks, model and controllers but I want to know that what will happen if the class I'd extended was being used by another module class?

The above scenario is as follows:
In my module config.xml I'd overridden a block file as:

<blocks>
    <checkout>
        <rewrite>
            <cart_shipping>Company_Module_Block_Cart_Shipping</cart_shipping>
        </rewrite>
    </checkout>
</blocks>

and override a method getEstimateRates()

but there's another module whose block file extends Mage_Checkout_Block_Cart_Shipping. My question is -

  "Will that class be able to see the changes made in the overridden class in my module?"

OR

  "Do I have to override the other modules block file?"


texts:
How to move an inactive quote to a checkout page.

At some point i change the active quote to an inactive quote. But after some times the customer will use this inactive quote and proceed to checkout.

Is there a way to make an inactive quote to an active


texts:
I'm trying to inject a scroll to anchor javascript globally in Magento 2.

More specifically this script:

$('a[href^="#"]').on('click', function(event) {
    var target = $(this.getAttribute('href'));
    if( target.length ) {
        event.preventDefault();
        $('html, body').stop().animate({
            scrollTop: target.offset().top
        }, 1000);
    }
});

I have taken the reference from this blog post.

I converted it to include defines and stuff:

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

$('a[href^="#"]').on('click', function(event) {
    var target = $(this.getAttribute('href'));
    if( target.length ) {
        event.preventDefault();
        $('html, body').stop().animate({
            scrollTop: target.offset().top
        }, 1000);
    }
});

});

And injecting it in to my themes default_head_blocks.xml with <link src="js/custom.js" />

The injection works but I am getting the following error in Chrome console:

Uncaught Error: Mismatched anonymous define() module: function ($) {
    'use strict';

require.js:166


texts:
I'm trying to All4coding Offline Maintenance Page using Magento Connect Manager ver. 1.9.2.4 and I'm getting this error: Unknown cipher in list: TLSv1

I found some solutions on here already, however it looks like either my Magento is broken, or they removed the line of code that everyone is talking about..

$this->curlOption(CURLOPT_SSL_CIPHER_LIST, 'TLSv1');

I'm using Hostgator Shared hosting to host the website, if that makes a difference.
Does anyone have a solution for this, or what should I try to do?


texts: Magento 2.3 - Can not hide account navigation links based on customer groups

texts:
I'm trying to hide account navigation links based on customer groups. In order to hide the links, I have installed a module https://github.com/KishanSavaliya/magehelper-magento2-hide-account-sidebar-tabs by creating different block files for the corresponding links but unfortunately, the links are not hiding.

XML file:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="MageHelper\HideSidebarTabs\Block\Account\WishlistLink" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link">
                <arguments>
                    <argument name="path" xsi:type="string">wishlist</argument>
                    <argument name="label" xsi:type="string" translate="true">My Wish List</argument>
                    <argument name="sortOrder" xsi:type="number">210</argument>
                </arguments>
            </block>
            <referenceBlock name="customer-account-navigation-orders-link" remove="true" />
                <block class="MageHelper\HideSidebarTabs\Block\Account\OrderLink" name="customer-account-navigation-orders-link-new">
                    <arguments>
                        <argument name="path" xsi:type="string">sales/order/history</argument>
                        <argument name="label" xsi:type="string" translate="true">My Orders</argument>
                        <argument name="sortOrder" xsi:type="number">230</argument>
                    </arguments>
                </block>
                <block class="MageHelper\HideSidebarTabs\Block\Account1\AccountLink" name="customer-account-navigation-account-link">
                    <arguments>
                        <argument name="label" xsi:type="string" translate="true">My Account</argument>
                        <argument name="path" xsi:type="string">customer/account</argument>
                        <argument name="sortOrder" xsi:type="number">250</argument>
                    </arguments>
                </block>
        </referenceBlock>
    </body>
</page>

Block file:

<?php

namespace MageHelper\HideSidebarTabs\Block\Account;

class AccountLink extends \Magento\Framework\View\Element\Html\Link\Current
{
    protected $_customerSession;
    protected $customerGroup;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\App\DefaultPathInterface $defaultPath,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Customer\Model\ResourceModel\Group\Collection $customerGroup,
        array $data = []
     ) {
         $this->_customerSession = $customerSession;
         $this->customerGroup = $customerGroup;
         parent::__construct($context, $defaultPath, $data);
     }

    protected function _toHtml()
    {
        $responseHtml = null; // need to return at-least null
        if ($this->_customerSession->isLoggedIn()) {
            $customerGroup = $this->_customerSession->getCustomer()->getGroupId(); // Current customer groupID
            //Your Logic Here
            if ($customerGroup == '2') {
                $responseHtml = parent::_toHtml(); // Return link html
            }
        }

        return $responseHtml;
    }
}

If you see the logic in the block, I have written a condition to show the link only if the customer group belongs to the group-id 2, if not it should be hidden. In my case, the link displays even in group-ID 1.

I'm not sure what am I missing. I'm trying this to work from a couple of days but not a success.

Could anyone please help me to resolve this issue?


texts: Magento 2 How to make status disable when create new products

texts:
While creating new product in admin of magento 2.
Product status is enable.

How can i change that status to disable as by default at a time of create new product?


texts: Plugin email sender incorrectly uses ISO-8859-1

texts:
I'm using a free plugin:
http://www.magentocommerce.com/magento-connect/product-inquiry-1.html

That works great, with the exception of sendind its emails with the wrong encoding (ISO-8859-1), thus rendering garbled text (since the input text is UTF-8)

From: =?iso-8859-1?Q? (...) = <address@example.com>

Every other email send by the platform is correctly encoded in UTF-8.

The code sending the email seems rather usual:

    $mail = Mage::getModel('core/email')
                ->setToName($userName)
                ->setToEmail($userEmail)
                ->setBody($processedTemplate)
                ->setSubject('Questão '.$productName)
                ->setFromEmail($senderEmail)
                ->setFromName($storeName)
                ->setType('html');

I've tried htmlentities(), but the result is no better.
How do I force this to use UTF-8?

Thanks


texts: {{media url="..."}} doesn't work on product attributes

texts:
After magento update to version 2.3.2 i noticed that {{media url="..."}} is not working on product attributes like 'description' attribute. In backend the url is resolved correctly and i can see the image in the editor. But in frontend i see <img src="{{media url=&quot;wysiwyg/......jpg&quot;}}" alt="">
Someone else having this problem? Or best way to debug and solve this problem?


texts: How to migrate all product from host 1.9.0 to host 2.0?

texts:
I'm not a technical person, i'm facing with a problem with my Magento site. I have a site Magento 1.9.0 in host and domain A, i want to migrate all products form host + domain A to host and domain B. How i can do it?
Please help me and thanks in advanced.


texts:
I sit with a simple issue, but I can't seem to find any simple solutions.

I made a file in /skin/frontend/ultimo/default/js called custom.js, included this in the header, all is fine. I then paste in

$j('Bliv Medlem').insertAfter(".navigation-toggle");

which appears. As I think I got success, I then wanna do a proper code, and change it to

var $j = jQuery.noConflict();

$j(document).ready(function() {
    $j('Bliv Medlem').insertAfter(".navigation-
    toggle");
});

This code just won't appear. It still displays the first part.

I've tried to merge js, empty all sorts of cache possible and waited some time. Can I make changes kick in immediately?

jQuery is included in my project.


texts:
We want to offer special discount for Order Number "10000900 - 10001000". Anyone who's order/purchase comes under this range will get a special discount of 40%. As far as i know magento doesn't have any feature for this. This requires code tweak in magento code. Please suggest me how can i achieve this.

Regards


texts:
Is there a way to add productId to soap request?

My soap request is missing productId argument. I can't change source of request. But I was thinking to add it from api extension module?

Any suggestions ?

[...]
<data xmlns="">
        <complexObjectArray>
          <sku>0110000001249</sku>
          <productData>
[...]

should be

[...]
<data xmlns="">
        <complexObjectArray>
          <sku>0110000001249</sku>
          <productId>10914</productId>
          <productData>
[...]

Many Thanks


texts: How to run CLI command in docker Magento 2

texts:
I am stuck with docket installed by my client. Whenever i'm running command it says not available and when i tried to run external php file from Magento root its throwing following error

PHP Warning:  require_once(/bitnami/magento/htdocs/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in /bitnami/magento/htdocs/vendor/autoload.php on line 5
PHP Fatal error:  require_once(): Failed opening required '/bitnami/magento/htdocs/vendor/composer/autoload_real.php' (include_path='.:/opt/bitnami/php/lib/php') in /bitnami/magento/htdocs/vendor/autoload.php on line 5

Any idea?


texts: How to get order from customer Magento 2?

texts:
I'm learning Magento 2 and got a headache while trying to find how to get all orders from customer.

With Magento 1.x, we can get all orders from customer with the below code.

$yourCustomerId = '123123';
$field          = 'customer_id';
$collection     = Mage::getModel("sales/order")->getCollection()
                   ->addAttributeToSelect('*')
                   ->addFieldToFilter($field, $yourCustomerId);

Anyone out there can please show me the correct way in 2.x version?

UPDATED:

I want to get the orders from customer (Magento\Customer\Model\Data\Customer) event observer.


texts: How to Restrict Submit Order for unavailable products from magento backend

texts:
Magento frontend not allowed to process the order if cart contains either out of stock product or unavailable product.

But When I create an order from Magento admin then How to Restrict Submit Order for unavailable products.

For example, I create a order from admin and add two products in the cart, one is out of stock and for second 2 qty not available in stock.
But Submit order button not disabled there, When I click on submit order Magento placed an order. Due to this inventory is disturbing.

Below image describe my case :

How to disable Submit Order button if cart contains either out of stock product or unavailable product?


texts: Adding Predefined Variables to New Email Template?

texts:
I am creating a new email template and am trying to attach predefined variables (specifically Order Id) to the new template.  I would like the option of clicking on the "Insert Variable" button and being able to insert the Order ID variable into the Template Content section.

However, I am not given the option to select that Order ID variable.

I am given the Order ID variable in the New Order template so when I started creating the new template I loaded the New Order template in but it still didn't show me the Order ID variable.

I've looked through a few similar questions but they were a bit older and did not apply.

Thanks.


texts: Magento 2.2.4 - Checkout summary in custom phtml

texts:
I have a custom off-canvas sidebar (foundation 6) which I declared via a standard phtml template. It shows only in the checkout.

Now I would like to display the content of the checkout's sidebar (summary, cart_items etc.) inside of it.

I figure I need to initialize a component via knockout:

    <button aria-label="Close menu" type="button" data-close="">
        ×
    </button>

I have no idea how to do the proper initialization so the templates summary and shipping_information are available.


texts: Magento 1.9.3 Customer Login Internal Server Error

texts:
After some reports of customers, I found a strange behavior.

These customers receive an internal server error page while accessing their account. I found that these errors in the server's errror_log:

End of script output before headers: index.php, referer: https://[my-domain]/customer/account/login/

To solve the problem with the account it is necessary to open the account in question in the backend and save it without making any changes.

After this procedure it is possible to log in from the frontend without any problem, at least for a while.

Has anyone else encountered this problem?

A similar behaviour was asked in this post, but the errors are a bit different, so i made another post.
1.9.3 Internal server error on account login


texts: Magento2 - Varnisch - Hard cache problems

texts:
We recently released a Magento 2.0.7 webshop. This webshop uses Varnish as Full Page cache.

When a customer visits the homepage, logs in and returns to the homepage there's still a button with 'Log in', instead of 'My acccount'. This is the cached version of the homepage.

Also, some customers should get different prices based on their customer group. After login these customers still see the old prices, after a hard refresh the correct price is shown. This is confusing for a lot of customers.

Is there a solution to these sort of cache-issues?


texts:
I have an attribute in use on Magento where the data has been split between
catalog_product_entity_varchar and catalog_product_entity_decimal due to the datatype being changed in the database.

The correct data is stored in the majority in catalog_product_entity_varchar, however products added whilst the datatype was changed to decimal are always referencing the catalog_product_entity_decimal table for this attribute, even when that entry is deleted and then a new value saved from inside magento.

This leads me to believe there is a setting somewhere that tells magento which table to use for each attribute, per product. Does anyone know where this is?


texts: Magento worldship Business rules need some Information. How I can get information from Magento?

texts:
I need some information from magento
1.Magento Address
2.Magento API endpoint(ex. /index.php/api/v2soap/index)
3.Port
4.Magento Api Username
5.Magento Api Password


texts:
I have a Magento that I would only like to access from another web portal. If the user copies the Magento base url, I don't want the portal to appear. You should only be able to access Magento if the user comes from another web portal that I decide.
What options to implement do I have?
I have thought of concatenating an MD5 string to the URL and in the Magento nginx if the request comes with the string I allow access and if not give a forbidden is this option correct?
Is there an alternative already implemented in Magento to meet this need?
Thank you very much.


texts: M2 equivalent of trying to process some information and return html in an AJAX response

texts:
What's best practice for an ajax request which involves - receiving some params in a request, loading data based on these params, processing this data, generating html and sending the html back in a json response?

For instance, say I have a product id that I pass as a param, I have to
return html for related product listing html as a json response.

In M1 I would create a controller action and do the following:

$product = Mage::getModel('catalog/product')
$this->loadLayout();
$html = $this->getLayout()->getBlock('mycustom_module/block')- >setProduct($product)->toHtml();
$response('html' => $html);
$this->getResponse()->setBody($response);
$this->getResponse()->setHeader('Content Type: json');
$this->sendResponse();
return $this;

In my custom module's block class I would basically load the collection of related products for the product and form the html in the template and return the html output in the json. How do I go about doing this sort of a thing with M2?

Doing a similar thing as M1 while making sure I use best practices like using DI instead of object manager is good enough? Or would you design this sort of functionality differently?


texts: How to import extension reviews from Magento Connect to my store for same extension?

texts:
I have a Magento online store which sells magento extensions and I have also put my extensions on Magento Connect. I want import reviews given by customers on Magento Connect on my store. Is there any API or Code snippet available for this?

Thanks in advance...


texts: Product Description is not showing on product page

texts: Getting my webstore up and going. Just noticed that I don't have a product description tab. Only the more information tab is showing. I am using the Luma theme and the only changes I have made are to the final_price block for configurable products. Any ideas on where to look or how to fix this issue?


texts:
In Magento 1.9.3.10 when trying to Checkout in OneStep Ajax module with downloadable (virtual) product,
after clicking the payment method one of the shipping modules gives an error and doesn't show me Order info with prices and product description:

  Notice: Undefined offset: 0  in /home/admin/domains/**/public_html/app/code/community/Balticode/Dpd/Model/Carriers/Courier/Courier.php on line 331

Line 331:

$quote = $request['all_items'][0]->getQuote();

And the whole code of the function in Courier.php:

    public function getShippingRateResult($_code, $request)
{

    $quote = $request['all_items'][0]->getQuote();

    $storeId = $request->getStoreId();

    if ($request->getFreeShipping() === true) {
        $price = '0.00';
    } else {
        $price = $this->getPrice($quote, $storeId);
    }

    if ($price === false) { //Method not available for this quote
        return false;
    }

    if (Mage::helper('dpd/data')->getConfigData('classic_sallowspecific', $storeId)) { //Specific Country
        $country = explode(',', Mage::helper('dpd/data')->getConfigData('classic_specificcountry', $storeId));
        if (count($country)) {
            if (!in_array($quote->getShippingAddress()->getCountryId(), $country)) {
                return false;
            }
        } else {
            return false; //Nothing select
        }
    }
    /** @var Mage_Shipping_Model_Rate_Result_Method $rate */
    $rate = Mage::getModel('shipping/rate_result_method');
    $rate->setCarrier($_code);
    $rate->setMethod($this->key);
    $rate->setCarrierTitle('DPD');
    $rate->setMethodTitle(Mage::helper('dpd/data')->getConfigData('classic_title', $storeId));
    $rate->setPrice($price);
    $rate->setCost($price);

    return $rate;
}

Could anybody help me with this?


texts: M2 Multistore - Create module for one store only

texts:
In a Magento 2 multistore, is there a way to create a module available for one particular store only?

I know that I can disable a module using the admin, but that only disables the output of it. Is it possible to add some kind of rule into module.xml or something like that to limit the scope of the module?


texts: Custom customer attribute for Magento CE

texts:
I am using Magento 1.9 CE, so "manage customer attributes" is not a default feature, but I want to add a simple yes/no customer attribute that could be set from admin panel.

I cannot seem to find any decent tutorials for Magento 1.X...

If anyone could guide me through this or link a tutorial it'd be much appreciated


texts: I am having issues with unsecure media on my secured site. I have secured my website with a SHA-2 SSL, but whenever I go to my frontend, all of my images that I set up with {{media url="image"}} are pointing to unsecure images. However, if I put in the url directly with //www.domain.com/media/wysiwyg/image, the image pulled is secure.


texts: Magento 1.9.3 re-indexing page and URL Issue

texts:
Every time Magento 1.9.3  re-indexing page and URL automatically increases

every time when I run re-indexing,  URL Rewrite Management increases ???

even product or fix


texts: How to duplicate config.xml file for payment methods custom module in magento1.9.


texts: Show products minimum quantity allowed in cart page

texts:
How to show products minimum quantity allowed on cart page. For list and view pages I used this code

<?php
$productQuantity = Mage::getModel("cataloginventory/stock_item")->loadByProduct($_product->getId());
$i = $productQuantity->getMinSaleQty();
?>

But this code is not working in cart page default.phtml, can someone please help me with correct code.


texts: Category items not matching the search done

texts:
First of all, I have been trying to get a better search engine for Magento without adding a plugin.

After changing some query options I have got more or less the result for a search I was looking for. And now I have seen there is a little bug on the category side. At the left side of the products shown. If the product I have searched get 5 products, 2 for textile and 3 for technology, for example, I see on the category menu:

  Textile(2)
  Technology(3)

So this is right, the results are correct, the problem is when I click on it, it is  supposed I should get the 2 textile products when click on it, but this is not happening, it shows me the whole textile products from my database.

When not doing a search on the website and I do only navigate on my products it works perfect. There is something interesting and it is that after doing a search the link changes to: /catalogsearch/result/?q=whateverilookedfor and after clicking on textile I get: /textile.html?q=whateverilookedfor so the search is saved but not showing up.

Do anyone know if there is an option to activate the filter search when click there or something?


texts: Is a `requirejs-config.js` needed to include a JavaScript file?

texts:
Many answers here on StackExchange and in documentation around the Internet indicate that to include a custom JavaScript file in a Magento 2 store that you should create a requirejs-config.js to specify a file alias that you will then separately reference to require it.

For example, you might have this requirejs-config.js file:

var config = {
   map: {
       '*': {
           myscript: 'My_Module/js/myscript',
       }
   }
};

And this in your PHTML:

<script type="text/javascript">
    require(['myscript'], function($) {
        // optional loaded callback here
    });
</script>

This works, but the question is:

Are both steps really necessary to include the JavaScript file?


texts: magento 2 payment methods page keep reloading

texts: I am a beginner to magento2 and installed magento CE 2.0.0 version . Whenever i access configuration  payment methods that page keep reloading and antivirus blocks URL.is it virus issue ?can anybody help to solve this issue.


texts:
Need to use latest version of TinyMCE V5 with Magento V2.3.

I tried to update tinymce js to latest version but its doesn't works at all after update. What are steps are required to integrated TinyMCE V5.

Is there any module available for it?


texts:
I am attempting to get the quantity of an item by inputting the sku. The following code works great on my WAMP local installation:

require_once('app\Mage.php');
umask(0);
Mage::app();
$sku='TEST1';
$product = Mage::getModel('catalog/product/info')->loadByAttribute('sku',$sku);
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
echo $stock->getQty();

However, when I change to the production server I get the following errors:

PHP Warning:  PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0
PHP Fatal error:  Uncaught exception 'Zend_Cache_Exception' with message 'can't get apc memory size' in /var/www/html/Example.com/us/lib/Zend/Cache.php:208
Stack trace:
#0 /var/www/html/Example.com/us/lib/Zend/Cache/Backend/Apc.php(191): Zend_Cache::throwException('can't get apc m...')
#1 /var/www/html/Example.com/us/lib/Zend/Cache/Backend/TwoLevels.php(488): Zend_Cache_Backend_Apc->getFillingPercentage()
#2 /var/www/html/Example.com/us/lib/Zend/Cache/Backend/TwoLevels.php(173): Zend_Cache_Backend_TwoLevels->_getFastFillingPercentage('saving')
#3 /var/www/html/Example.com/us/lib/Zend/Cache/Core.php(381): Zend_Cache_Backend_TwoLevels->save('a:7:{s:10:"bloc...', 'JFMG_CORE_CACHE...', Array, NULL)
#4 /var/www/html/Example.com/us/lib/Varien/Cache/Core.php(76): Zend_Cache_Core->save('a:7:{s:10:"bloc...', 'CORE_CACHE_OPTI...', Array, NULL, 8)
#5 /var/www/html/Example.com/us/app/code/core/Mage/Core/Model/Cache.php(349): Varien_Cache_Core->save('a:7:{s:10:"bloc...', 'CORE_CACHE_OPTI...', Array, NULL)
#6 /var/www/html/Example.com/us/app/code/c in /var/www/html/Example.com/us/lib/Zend/Cache.php on line 208

The production server is running Linux so I did change the back slash to forward slash in the first line to:

require_once('app/Mage.php');

"Example.com" is substituted for my domain name. In both cases I am using Magento 1.4.1.1. Any help or comments would be greatly appreciated.
Thanks.


texts: Magento 2 how to add ZipCode to Register form?

texts:
I'm trying to add just zipcode to register form when user creates new account. I have managed to add the whole address fields, but I just want zip code, how can I achieve it?
Greetings!


texts: magento2. Get SQL string frontend search

texts: When a user makes a search on a site(where search product), I would like to see SQL request this search. How can I see him?


texts:
I would like to remove text-align:center in the closing text of email footers.

However, when I open \skin\frontend\rwd\default\scss\email-inline.scss, i see the following disclaimer:

  Do not edit or add to this file if you wish to upgrade Magento to
  newer versions in the future. If you wish to customize Magento for
  your needs please refer to http://www.magento.com for more
  information.

Not the most useful disclaimer in the world.  How do I make this tiny formatting change and retain it after future updates?