texts: add values to dropdown of product attribute

texts: let say I made an attribute named Cities, how can I add options to this dropdown on the fly, considering there will be a hundred of more cities in my country.


texts: magento 2 rest api accessing products based on store code giving same products

texts:
I'm using below url to access products which are specific to store

http://<magento_host>/rest/<store_code>/V1/products/product_name

but in output, i can see all other products as well. What may be the error or did I missed anything in a parameter.


texts: Firebear Studio - Improved Import & Export showing ERROR 500 Magento 2

texts:
I have Installed Firebear Studio - Improved Import & Export v3.1.3 Installed perfectly even setup:upgrade, setup:static-content:deploy and setup:di:compile finished successfully. But when I am trying to visit Module page from Admin panel it shows HTTP ERROR 500

Apache Error Log:

[Thu Mar 14 07:23:07.924591 2019] [proxy_fcgi:error] [pid 12890:tid 140422370076416] [client 127.0.0.1:35210] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Cannot instantiate interface Firebear\\ImportExport\\Api\\JobRepositoryInterface in /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116\nStack trace:\n#0 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->createObject('Firebear\\\\Import...', Array)\n#1 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Firebear\\\\Import...')\n#2 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\\Framework\\ObjectManager\\Factory\\Compiled->get('Firebear\\\\Import...')\n#3 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Firebear\\\\Import...', Array)\n#4 /opt/bitnami/apps/magento...\n'
[Thu Mar 14 07:23:21.163407 2019] [proxy_fcgi:error] [pid 12890:tid 140422403647232] [client 127.0.0.1:35220] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Cannot instantiate interface Firebear\\ImportExport\\Api\\ExportJobRepositoryInterface in /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116\nStack trace:\n#0 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->createObject('Firebear\\\\Import...', Array)\n#1 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Firebear\\\\Import...')\n#2 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\\Framework\\ObjectManager\\Factory\\Compiled->get('Firebear\\\\Import...')\n#3 /opt/bitnami/apps/magento/htdocs/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Firebear\\\\Import...', Array)\n#4 /opt/bitnami/apps/m...\n'

I have tried flushing all caches including JS/CSS. Thanks


texts: Price Template addPriceBlockType on Related and Upsell Items

texts:
I was able to successfully create a new template for price in product listing as well as in product page using this:

<reference name='product_list'>
            <action method="addPriceBlockType">
                <type>simple</type>
                <block>catalog/product_price</block>
                <template>catalog/product/reseller/price.phtml</template>
            </action>
        </reference>

However, I could not do it in upsell or in related products block:

<reference name='catalog.product.related'>
            <action method="addPriceBlockType">
                <type>simple</type>
                <block>catalog/product_price</block>
                <template>catalog/product/reseller/price.phtml</template>
            </action>
        </reference>

The rendered template is still using the old price template.
How can I possibly change price template in these blocks?

Thank you.


texts: Backend category tree slow - manage categories

texts:
Recently i have imported a good number of categories. But now whenever i go to the manage categories in the backend panel, it loads the page extremely slow.

It takes about 20-30 seconds to load the manage categories page, and about the same time when clicking on a desired category for it to load it's data or adding a new category.

Tried so far:

Reindex all the data
Made sure the server is well configured(memory,caching,ini,msql etc.)
Tried the compiler
Used the magento repair database tool to see if it gave any errors(none)
Tried the same setup on a highend localhost server (without any plugins/extensions)

But the problem persists.

Some stats:
- About 250.000 different products
- About 1.2 million product-category relations
- About 200.000 different categories
- On a reliable and fast VPS server with a decent host (no cheap out of the box solution)
- Running on Nginx
- Flat catalog/products both enabled

Here's an output of magento's profiler on the manage categories page:

I'm not a pro so the only thing what gets my attention is the time and cnt values of mage, tree.phtml and catalog_Category_tree_ismovable. But i'm not sure what to do with this info.

If anyone knows an idea, can point me in the right direction or anything else helpful i would be very grateful!

If any information is missing from this post i'll be glad to add it if asked for.


texts:
We are using a checkout module called checkitout by EcomDev and we are using Ogone for the payment module. We have to add a js file to the checkout module. the js file is located at: netresearch/ops/osc_payment.js

What is the best way to do this? We have added this to checkitout.xml

<checkout_onestep_index>
    <reference name="head">
        <action method="addJs"><script>netresearch/ops/osc_payment.js</script></action>
        <action method="addJs"><script>netresearch/ops/payment.js</script></action>
    </reference>
</checkout_onestep_index>

But this doensn't add these files to the loaded javascript. Any Ideas?


texts: how to Fetch data from database in magento

texts: Which methods are available for fetching information from the Magento database?


texts: Can I add 3.5% Surcharge Fee for Credit Card Payment ?

texts:
I want to add 3.5% Surcharge Fee to the Total Shopping Cart Quote for using Credit Card option.  Is this possible ?

Thanks.


texts: Magento 2 : Does Not See Payment From Client

texts:
I have 2 online payment module. PayU and DotPay.

When customer selects the online payment option in advance and make a payment (I see payment in the payment system that has been made correctly) then magento  can not see of this payment.

the order appears as "unpaid"


texts:
I added cronjob on the server but I still got this error 'One or more indexers are invalid. Make sure your Magento cron job is running.' on admin

I tried

cat /var/spool/cron/magento
*/1 * * * * /usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento cron:run
*/1 * * * * /usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/update/cron.php
*/1 * * * * /usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento setup:cron:run

It seems it's working

cat /var/log/cron | grep php
Dec 27 09:59:01 CROND[31588]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento cron:run)
Dec 27 09:59:01 CROND[31589]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento setup:cron:run)
Dec 27 09:59:01 CROND[31590]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/update/cron.php )
Dec 27 10:00:01 CROND[31651]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento cron:run)
Dec 27 10:00:01 CROND[31653]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento setup:cron:run)
Dec 27 10:00:01 CROND[31663]: (magento) CMD (/usr/local/bin/php -c /usr/local/lib/php.ini /home/users/magento/www/update/cron.php )

I also tried

cat /var/spool/cron/magento
*/1 * * * * php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento cron:run
*/1 * * * * php -c /usr/local/lib/php.ini /home/users/magento/www/update/cron.php
*/1 * * * * php -c /usr/local/lib/php.ini /home/users/magento/www/bin/magento setup:cron:run

both seems working on server but Magento2 admin still show the error 'Make sure your Magento cron job is running.' How to solve and make it work? Thank you!


texts: Magento 2 - Add method to Quote Item Api Data Interface

texts:
I added a new column to quote item(lets call custom_type). So I extended \Magento\Quote\Model\Cart\Totals\Item to implement getters and setters for my column.

public function getCustomType()
{
   return $this->_get('custom_type');
}

public function setCustomType($type)
{
   return $this->setData('custom_type', $type);
}

It is sufficient to get/set my new column values. It works when we get the column values. But if I try to get the value in checkout review page(#payments), the value is not returned because Magento uses REST to get the item information(missing interface signatures).

So the problem arises here. I need to add interface for these two methods in \Magento\Quote\Api\Data\TotalsItemInterface to get the values using REST. I am creating a separate module, so I can't touch the core code.

How do I achieve this? Any suggestions.


texts: Magento 2: CLI command is taking too much time to execute

texts: I have installed the docker and my Magento project deployed on docker, the issue is CLI command is taking too much time to execute.


texts: Remove price decimals on list and product view

texts:
I want to remove the decimals of our price only on the list and product view.
For example I want to change the price from $14,00 to $14,-

In the checkout, e-mails and PDF I want to keep the decimals for the tax.

How can I easily fix this?


texts: Magento 2 Terminal Progress bar while uploading csv file from terminal

texts: I want to develop progress bar in a terminal because when I import CSV file its started to import but user has no idea how many records have been imported indicator will be like when we hit php bin/magento s:s:d -f I have added example image answer will be appreciated!


texts: Magento 2 2.3 fallback to MySQL search engine if Elasticsearch goes offline

texts:
Store is configured with Elastic Search
Is it possible to fallback to MySQL search if ES goes offline?


texts: How to clear a custom option via REST product update

texts:
I am using product repository save() (rest POST /V1/products) to create/update products.

With a single select attribute I can add an option, but can't see any way to clear the attribute option if it's already set.  Have tried sending 'null' and '' - doesn't add a new attribute, but also doesn't remove any existing ones either.

Here's a sample of the custom_options object within the product object.

 "custom_attributes": [
    {
      "attribute_code": "color",
      "value": "98"
    }

If I do something like this, the value remains in the database.

  "custom_attributes": [
    {
      "attribute_code": "color",
      "value": null
    }


texts: Magento 2.3.4: How to reverse admin configuration settings

texts: In the Magento admin, I had to remove {{depend fax}}<br/>F: {{varfax}}{{/depend}} from all the text boxes under Address Templates under Store->Configuration->Customer->Customer Configuration to remove the fax field from the checkout page. This removed the fax field, but resulted in Place Order button doing nothing during a test order I was trying to place after removing the fax field. I just need to reverse the Admin settings to bring site back to the previous state. Any help is greatly appreciated. Screenshot attached shows where I initially edited but later switched back to Use System Value which now doesn't take any effect now.


texts: How to show storeview in ui component grid in Magento 2?

texts:
I want to show store-views in ui component grid. I am using this code in:

  /app/code/Mymodule/Myimages/view/adminhtml/ui_component/communieimages_name.xml

<column name="store_ids" class="Magento\Store\Ui\Component\Listing\Column\Store">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                <item name="sortable" xsi:type="boolean">false</item>
                <item name="label" xsi:type="string" translate="true">Store View</item>
            </item>
        </argument>
    </column>

but it is showing as blank. Can anyone please help me to fix this issue???


texts: How to add drop down in admin grid in magento 2

texts:
I need to add a drop down in the admin grid of a custom module. I have set the editor type as select, but how to set the data source of the select to read from another database table?

I need to populate the select with data coming as result of SQL query.


texts:
I have created multiple websites .Main website worked perfectly but second website has the following issues seen in console:

CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Please help me
Thanks


texts: How to know which template I am currently working in magento 2

texts:
good morning everyone, I am a little bit new on Magento 2.x, I am working the full time make some changes in some view which contains a template but I suffer and struggle to know which template in question I am working within the current path, can anyone please give me some hints how to know which template I am working within the current path

--> can anyone save my time by telling me how, please?


texts: How to deploy Magento code to one host in a cluster

texts:
We run a Magento 1 CE cluster where we have split the frontend and admin away to separate clusters. This gives us the ability to deploy schema changes to the admin host first, which is great, but it also introduces a problem.

When we deploy modules to the admin host, we typically leave all caches on except layout cache. With our last deploy our admin broke, because it threw an error on a missing helper class.

The reason for this is probably, that the fronts (admin and fonts share the same cache prefix id) did not have that module, and the admin picked up on that cache?

How could we prevent this in future?
Would it help to disable all caches when we deploy?


texts: Session has been destroyed at product details page

texts:
From last few days, I have been facing a strange issue at product detail page.

At product details page, session is changing.. Old session has been destroyed at new session is being created.

Have inspected, checked cookie and found that frontend  cookie has been changed at details page.

Have tried some thing

disable all magento 3rd party extensions
Checking magento setting delayed with cookie.

Till the issue is persistent at system.

Some info:

using magento CE 1.9.1
Missing patch:6482,7405,6788,5994,6285

So,

can any one give some idea what is the reason for this section change?

and how to debug why the session has been changing?


texts: 301 URL rewrite to remove language parameters when switching store

texts:
Is it possible to do a custom rewrite to remove the parameters when a user changes language?

For example:

  www.website.com/product?___store=ca_fr&___from_store=ca2014_en

Should become:

  www.website.com/product

I have read about a bit, but I need to do this both ways (so that there is never a parameter for the store change shown in the URL). Is this possible to do? Is it possible through the Magento admin, or does it need to be a .htaccess rewrite?


texts: Different layout for the same URL base on session settings

texts:
Currently I have two different controllers and Magento checkout is split into two ways, let's say A and B, thus URL is checkout/A checkout/B - both available for customer. Both of them are onepage checkout.
For both of them I have layout XML file; for B I'm removing many blocks from whole page so it's very simplified.
I would like to move these changes to one URL, so by some settings there will be displayed checkout A or checkout B randomly.
How to force in custom controller changes that I made with layout XML file?


texts: How to fetch data value from quote_item_option table in cart page?

texts:
How to fetch value of no_of_windows ?
I want to display custom field information in cart page? How to do that?

a:12:{s:4:"uenc";s:72:"aHR0cDovLzE5Mi4xNjguNS41OC9NYWdlbnRvMjE3L2luZGV4LnBocC9uZXR0aW5nLmh0bWw,";s:7:"product";s:4:"2115";s:28:"selected_configurable_option";s:0:"";s:15:"related_product";s:0:"";s:15:"super_attribute";a:2:{i:162;s:3:"223";i:93;s:2:"49";}s:13:"no_of_windows";s:1:"2";s:7:"width_1";s:1:"1";s:8:"height_1";s:1:"2";s:7:"width_2";s:1:"1";s:8:"height_2";s:1:"3";s:11:"total_price";s:3:"100";s:3:"qty";s:1:"1";}


texts: Order email confirmation not send - Magento 2.3.4

texts:
I've done an update to Magento and now I have a problem:

In the cron logs I have

main.ERROR: Cron Job sales_send_order_emails has an error: Return value of Magento\Framework\Filter\DirectiveProcessor\DependDirective::process() must be of the type string, object returned. Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":79691776,"emalloc_start":29990192} [] []
main.CRITICAL: Error when running a cron job {"exception":"[object] (RuntimeException(code: 0): Error when running a cron job at /vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:330, TypeError(code: 0): Return value of Magento\\Framework\\Filter\\DirectiveProcessor\\DependDirective::process() must be of the type string, object returned at /vendor/magento/framework/Filter/DirectiveProcessor/DependDirective.php:53)"} []

Confirmation email is not sending and also when I got in admin to the order, and then click on Send Email is also not working.

I've tried to send a comment on an order, and that one is working.

Can someone help?

Thanks.


texts: Remove/cancel a particular product from all pending orders in admin

texts:
I am doing a magento project in which i have to select all pending order at once and move to complete status from the order management page in admin.

I have done this modification and it is working fine. But the requirement is, while moving those orders to complete status, if the order consist of one particular product i have to remove that product or have to change the quantity to 0 and process it.

As a newbie to magento i fall short of logic's/ideas here. Any help will be greatly appreciated.


texts: How to edit Magento 2 Database Configuration file

texts:
i have changed the password of database in the server. then, i get error message for front store  and admin panel of magento. how can i solve it ? immediately , please.

front store:
"There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 1429988333864"

admin:
"There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 1030432780141


texts:
How can i get a param from my url??

  ?access_token=Atza|IQEBLjAsAhR6-eMBCha6N7pV6bZ3i1Z3kv2IrgIUfOwQ_NUK0yf4e4Cb3lWsqA91zrmc7JRnwtNtQH1U433_A9odU1QF6O-RR4hHPuU5_1i1XZZyg7Sk_P0hs6cLzMaLQzaZ0JZtYhWsoCWBDu8Piuu3AHq8wu4mPQdTFaaCvT4tP-gHPBFu5Cu5uPbrPli-VOYo51sWSRFEWYFpzypjxkU4Ti-Y8bzFjcHo6RYJF6jXvIE8a4ZVG-5bX2k9ftjvsJQQsOsywh8ir3wJkVm9I-rG_RfuGf_OiCwZ5pbn63k0161Gwr4Phv0TaUjBV-UaCfBjFP7eiBwmKL53hPPYiUFakRmHKctVp1PodOMo83y1ovuX7XZfQujmWHrvkJmfDOgjiuqxOLnGhK_xCbu09hFNLwMvcV15E19OQ_247S68j2c9nSLDVeH1HKOGzxsgeQnNFfIMzTmOPNx8zThQeD5upjDFbxfrIDGNZeApJWWUVgfJLkbnvdAem_K1qeQNAnWp8IwRgoWWr7wNip5Dm5LXA64z4vQsT_NkykoOdFWE943Pd1nGOIAbcTe_AEdsjuibZ3azJ4TfVVPtgG8J9KMcxxe6npnb35sMI-kqOgDb3J4&token_type=bearer&expires_in=3600&scope=profile
  payments%3Awidget payments%3Ashipping_address

I want to get access token data on my phtml page!

I used <?php echo $this->getRequest()->getParam('access_token');?> but not wroking for access_token

How can get that??


texts: Get list of all order item for a product

texts:
I want to get the list of sales_flat_order_item for a product.

I tried the following

$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $read->query("SELECT order_item.* FROM sales_flat_order_item AS order_item WHERE order_item.product_id='".$sku."'");
$row = $result->fetch();

And this is giving me wrong result. How to get the list of all transactions of a given product id?


texts: Magento 1.9.1.0 Full Text Search Not showing Exact Result

texts:
I am Using Magento 1.9.1.0 and  i a haven't search the proper searched Product.
if in enter Windows 7 the result contains Windows as well as 7
so the result Comes Windows 10 Windows 8 and all. How i Can Get the Exact Result.

I already Tried Below One:-

if ($like) {
                    $likeCond = '(' . join(' AND ', $like) . ')';
                }

in function prepareResult() in FullText.php But No clue. having same result

Update:-1 whole Function

public function prepareResult($object, $queryText, $query)
    {
        $adapter = $this->_getWriteAdapter();
        if (!$query->getIsProcessed()) {
            $searchType = $object->getSearchType($query->getStoreId());

            $preparedTerms = Mage::getResourceHelper('catalogsearch')
                ->prepareTerms($queryText, $query->getMaxQueryWords());

            $bind = array();
            $like = array();
            $likeCond  = '';
            if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE
                || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE
            ) {
                $helper = Mage::getResourceHelper('core');
                $words = Mage::helper('core/string')->splitWords($queryText, true, $query->getMaxQueryWords());
                foreach ($words as $word) {
                    $like[] = $helper->getCILike('s.data_index', $word, array('position' => 'any'));
                }
                if ($like) {
                    $likeCond = '(' . join(' AND ', $like) . ')';
                }
            }
            $mainTableAlias = 's';
            $fields = array(
                'query_id' => new Zend_Db_Expr($query->getId()),
                'product_id',
            );
            $select = $adapter->select()
                ->from(array($mainTableAlias => $this->getMainTable()), $fields)
                ->joinInner(array('e' => $this->getTable('catalog/product')),
                    'e.entity_id = s.product_id',
                    array())
                ->where($mainTableAlias.'.store_id = ?', (int)$query->getStoreId());

            if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT
                || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE
            ) {
                $bind[':query'] = implode(' ', $preparedTerms[0]);
                $where = Mage::getResourceHelper('catalogsearch')
                    ->chooseFulltext($this->getMainTable(), $mainTableAlias, $select);
            }

            if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) {
                    $where .= ($where ? ' AND ' : '') . $likeCond;
            } elseif ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) {
                $select->columns(array('relevance'  => new Zend_Db_Expr(0)));
                $where = $likeCond;
            }

            if ($where != '') {
                $select->where($where);
            }

            $sql = $adapter->insertFromSelect($select,
                $this->getTable('catalogsearch/result'),
                array(),
                Varien_Db_Adapter_Interface::INSERT_ON_DUPLICATE);
            $adapter->query($sql, $bind);

            $query->setIsProcessed(1);
        }

        return $this;
    }


texts: Product migration Magento 2.0.7 to Magento cloud 2.3.2

texts:
What is the best way to migrate all products from Magento 2.0.7 to Magento Cloud 2.3.2?

I try to export all products from M2.0 and import with M2.3 with Magento import/export tool, but didn't work.

I this moment I have arround 3000 product to import (16 attribute set and several attributes that were already created in the M2.3).

There is any trick to do this?

Thank you in advance


texts: Uncaught Error: Call to a member function toOptionArray() on boolean in widget magento 1.9.4.0

texts:
I am facing issue of toOptionArray() in widget. I tried all of the way but not fixing this issue.

  widget.xml

<?xml version="1.0"?>
<widgets>
    <modulename_article type="modulename/article" translate="name description" module="modulename">
        <name>Article</name>
        <description type="desc">Article</description>
        <parameters>
            <parameter1>
                <label>Brands</label>
                <visible>1</visible>
                <required>1</required>
                <type>multiselect</type>
<source_model>modulename/system_config_source_brands</source_model>
            </parameter1>
        </parameters>
    </modulename_article>
</widgets>

  ModuleName\Model\System\Source\Brands.php

class Namespace_ModuleName_Model_System_Config_Source_Brands{

    public function toOptionArray(){
        $options =  array();

        $options[] = array(
            'value' => 'text',
            'label' => 'Only Text'
            );
    }}

What is wrong in my code?


texts:
I have an external file containing product details, I'm looping through this file and for each product in said file I have to check if the product already exists in magento.

The value to evaluate if the product already exists is an attributename and it's value.

So I check this by using (per product)

$collection = Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToSelect('sku')
                ->addAttributeToSelect("$supplier_name")
                ->addAttributeToSelect('production_nr')
                ->addAttributeToSelect('sku_supplier')
                ->addAttributeToFilter($supplier_name,array('eq' => $suppliers_product_nr));

This selection itself doesn't seem to take much time:

            echo 'check: ',round(microtime(true) - $time, 2) , "s<br/>\n";

reports 0.00 s,

however to check if it's an empty collection (ie the product exists in my magento database takes about 0.34-0.40 s

$collection->getSize()

Considering I've got several hundred of thousands of products to check. This will add up quickly. Very quickly.
I was hoping for something more akin to 0.01 or lower in time.

So I'm looking for the fastest way to check if a product exists.
I have quite a bit of freedom in how to change and implement the code so if there's an completely different way of appreaching this problem I'd like to hear about it.

Update:

I've changed it slightly so that instead of checking with magento if a product exists product by product, I instead get an array of all products that have the attribute to check against. I use this array to check if the attribute to check against exists.

This is way faster, but I fear for the overhead impact (primarily ram or cpu) this will have once the amount of products returned becomes too great (we've got about 40.000 products in our magento installation)


texts: Magento 2 REST API for reset password of admin

texts: How to reset of password of admin using rest api in Magento 2.Any options to reset password of admin using rest api


texts: Admin URL "broken" after updating Domain Name

texts:
Aim

Update Domain Name of M2 instance from example.co to beta.example.com

Steps

So, I changed the Domain Name of my Magento 2 store using the following commands:

bin/magento setup:store-config:set --base-url="http://beta.example.com/"

bin/magento setup:store-config:set --base-url-secure="https://beta.example.com/"

bin/magento cache:flush

bin/magento cache:clean

Result

This worked fine, until the next day. When I tried to load my admin url (http://beta.example.com/admin), I was forwarded to the below URL with this error:

http://beta.example.com/admin/http:/admin/admin/index/index/key/1a2376cc1c89ea53ca4a903003d3a4859b5c62347cc763a6c0105ea3bae466e/
"This page isn’t working beta.example.com redirected you too many times."

Regardless of trying to load http://beta.example.com/admin after clearing cookies on different Browsers and Devices, I couldn't get past this point.

Temporary Workaround

In order to resolve this, I have to clear the cache by running the below commands.

bin/magento cache:flush

bin/magento cache:clean

This seems to work for a bit until I go to load the backend the next day. I can't even reproduce the error until the next day...

Any ideas what could be causing this? Or even why my temp workaround only works for a few hours?

Notes: Day 1

The only thing I can think of that happens overnight is Indexing (maybe). So, I've ran the below command. Will report back in 24 hours

bin/magento indexer:reindex

Notes: Day 2

Indexing had no affect. Admin URL still reset to "broke" the next day. I'll try clearing all cache folders today using the below command. Will report back in 24 hours

rm -rf var/page_cache var/cache var/generation var/div var/view_preprocessed generated/metadata/* generated/code/*

Notes: Day 3

No affect. Tried updating Admin URL to see if that does anything with:

bin/magento setup:config:set --backend-frontname="admin_path"

Notes: Day 4

No affect.

Notes: Day 5

I've narrowed down that it's config that requires either Cleaning of Flushing with either command.:

bin/magento cache:clean config or bin/magento cache:flush config

I've yet to determine what changes over ~24hrs for me to have to keep doing this though.


texts:
Hi am trying to export order data in magento 1 to csv

here is my script

<?php
require_once 'app/Mage.php';
Mage::app();
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
$orderCollection = Mage::getModel('sales/order')->getCollection();

$fp = fopen('orders_exported.csv', 'w');

foreach ($orderCollection as $order) {
        $orders['orders'][] = array(
            'id'            => $order->getIncrementId(),
            'store'         => 'magento',
            'status'        => $order->getStatus(),
            'name'          => $order->getCustomerName(),
            'email'         => $order->getCustomerEmail(),
            'telephone'     => $order->getShippingAddress()->getTelephone(),
            'street'        => $order->getShippingAddress()->getStreet(),
            'pincode'       => $order->getShippingAddress()->getPostcode(),
            'city'          => $order->getShippingAddress()->getCity(),
            'weight'        => $order->getWeight(),

        );

     foreach ($order->getAllItems() as $item) {
       $orders['orders']['items'][] = array(
            'id'            => $order->getIncrementId(),
            'name'          => $item->getName(),
            'sku'           => $item->getSku(),
            'Price'         => $item->getPrice(),
            'Ordered Qty'   => $item->getQtyOrdered(),

        );

    }
    }

echo "<pre>"; print_r($orders);


texts: Magento 1.9 - Abandoned Cart reminder email showing Rupee while user added as Dollar

texts:
We have two store in Magento "India" and "Not India". We setup currency and it is reflecting at front end for both type of customers.

The issue is when from admin, we look for Not India customers abandoned cart, then it shows Rupee (Rs.).

Please help to resolve the issue.


texts: Magento 2 dynamically change dependency injected based on configuration?

texts:
I have a simple interface, PurgerInterface that has the methods needed to purge items from a cache backend (Varnish or Fastly). I have some custom configuration (standard system.xml stuff) that allows an admin to decide which backend they'd like to use (Varnish or Fastly).

I also have an Observer that listens to various events and will purge the appropriate caches. Here is the issue: I would like to inject, in my observer constructor, this purger interface like so:

public function __construct(
   CacheConfig $config,
   \Psr\Log\LoggerInterface $logger,
   PurgerInterface $purger)
{
....

Now, the issue is that the concrete implementation of the PurgerInterface that I'd like injected is dependent on a configuration. If the Varnish backend is selected, I'd like VarnishPurger injected. If Fastly is selected, I'd like FastlyPurger.

Now, I'm familiar with other frameworks where you are able to dynamically bind items in the "service container" (I'm thinking Laravel here). Basically the logic / code controlling dependency injection can be interacted with, so when the container asks for a PurgerInterface I can run some code to check which concrete class I should return, and that is the class that is injected.

So, is this possible?


texts: Breadcrumbs not displaying in frontend and admin in Magento 2.2.4?

texts:
I don't know how to implement this task. In admin page, I have stores->Configuration->Advanced->developer

I have to choose to enable path hints in front page "yes".

But in Front-end not display breadcrumbs.

Can you please help me?


texts: Magento 2 for logged In customer need to add shipping address every time i place a new order?

texts:
This is what i am following...

1. Add Configurable product in cart.

http://magento-host/index.php/rest/default/V1/carts/mine/items

method : POST
Authorization : Bearer <customer token>
body data : json

{
  "cartItem": {
    "sku": "HKrh15hc", <product SKU>
    "qty": 5,
    "quote_id": "75", <Quote ID - Cart ID>
    "product_option": {
      "extension_attributes": {
        "configurable_item_options": [
          {
            "option_id": "93",
            "option_value": 49
          },
          {
            "option_id": "141",
            "option_value": 168
          }
        ]
      }
    },
    "extension_attributes": {}
  }
}

  Now, this is saving my configurable product in my cart.

2. Get & put Shipping Information.

http://magento-host/index.php/rest/V1/carts/mine/shipping-information

method : POST
Authorization : Bearer <customer token>
body data : json

{
    "addressInformation": {
        "shippingAddress": {
            "region": "MH",
            "region_id": 0,
            "country_id": "IN",
            "street": [
                "221,Baker-street (e)"
            ],
            "company": "Lumos",
            "telephone": "12345678",
            "postcode": "400001",
            "city": "Mumbai",
            "firstname": "Aditya",
            "lastname": "Shah",
            "email": "Aditya@Shah.com",
            "prefix": "address_",
            "region_code": "MH",
            "sameAsBilling": 1
        },
        "billingAddress": {
            "region": "MH",
            "region_id": 0,
            "country_id": "IN",
            "street": [
                "221,Baker-street (e)"
            ],
            "company": "Lumos",
            "telephone": "12345678",
            "postcode": "4000001",
            "city": "Mumbai",
            "firstname": "Aditya",
            "lastname": "Shah",
            "email": "Aditya@Shah.com",
            "prefix": "address_",
            "region_code": "MH"
        },
        "shipping_method_code": "flatrate",
        "shipping_carrier_code": "flatrate"
    }
}

Now, this 2nd STEP - Do i need to add shipping and Billing address every-time ?
Whenever i place a new order with the same customer ?

3. Get payment method.

http://magento-host/index.php/rest/V1/carts/75/payment-methods

method : POST
Authorization : Bearer <customer token>

4. Place an order.

http://magento-host/index.php/rest/V1/carts/mine/order

method : POST
Authorization : Bearer <customer token>
body data : json

{
    "paymentMethod": {
        "method": "checkmo"
    }
}

Concern

IN Step -2

  1. Do i need to add address (Billing and Shipping) every-time to place
      an order ?

  2. Is there any thing like pass the address_id or default address -
   so i don't need to add
      addresses every-time.


texts: Layered Navigation showing on the left, but products not showing when a category clicked

texts:
Help! My layered navigation on the left bar works, showing number of products in each category correctly. The attribute filter also works. But if any category on the left is clicked, there is no product showing in the content area.

I copied some code and put it in Layout Update XML:

<reference name="left">
     <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

<reference name="content">
    <block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
        <action method="setCategoryId"><category_id>14</category_id></action>
        <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                        <block type="page/html_pager" name="product_list_toolbar_pager"/>
        </block>
        <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
    </block>
</reference>

The website is www.amledtek.com.

Thanks.


texts: I have memory limit of 5G, still memory get exhausted and getting component dependency failed as attached screenshot.


texts:
I have just launched my 2nd Magento store on calzeat.com and i am having an issue where going between certain pages the url doesn't work right. For example when i go to calzeat.com/contact then i click on the Stores link it will try to go to calzeat.com/contact/stores. Really Strange.

Only between a few pages in certain directions it happens.

Any ideas would be greatly appreciated.


texts: SHow Block with php via .phtml on home page only

texts:
I  am using this code to display a block on my home page, I opted to add it via the onecolumn.phtml file because when I added it as a widget via the cms method it would not allow for correct placement and full width without messing a bunch of other related stuff up.

However now it displays on all static cms pages ie about us etc.

Is there some kind of way to check and only display on home page ?

heres my snippet

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('threeblock1')->toHtml(); ?>

farther down the page i use this one and it only shows up on home page?

 <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('brands')->toHtml(); ?>

heres the complete code

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * 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    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Template for Mage_Page_Block_Html
 */
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">

<?php echo $this->getChildHtml('head') ?>

<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper <?php echo $this->getLang().'-lang-class';?>">
    <?php echo $this->getChildHtml('global_notices') ?>

        <?php echo $this->getChildHtml('header') ?>

            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('threeblock1')->toHtml(); ?>

                            <?php echo $this->getChildHtml('breadcrumbs') ?>

                                        <?php echo $this->getChildHtml('global_messages') ?>

                                        <?php echo $this->getChildHtml('content') ?>

                                        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('product-categories')->toHtml(); ?>
                                            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('brands')->toHtml(); ?>

        <?php echo $this->getChildHtml('footer') ?>
        <?php echo $this->getChildHtml('before_body_end') ?>

<?php echo $this->getAbsoluteFooter() ?>


texts: Overriding price.phtml template using addPriceBlockType in Magento CE 1.7.0.2

texts:
I'm writing a custom extension and trying to override the price.phtml template (catalog/product/price.phtml) with my own but I cannot get it to work.

The documentation and examples I have seen suggest I should use the addPriceBlockType method in the layout update xml file as shown below. However, this doesn't work and it is driving me mad.

Other layout updates work so I know the layout xml file is being called correctly from the module's config.xml.

One thing - I think in older versions of Magento there was different product price template files for each of the product types but this is no longer the case in 1.7? Could that mean that addPriceBlockType will no longer work and I need to use some other method?

Any help would be much appreciated.

Thanks!
Chris

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="catalog_product_price_template">
            <action method="addPriceBlockType"><type>simple</type><block>catalog/product_price</block><template>hideprice/price.phtml</template></action>
            <action method="addPriceBlockType"><type>grouped</type><block>catalog/product_price</block><template>hideprice/price.phtml</template></action>
            <action method="addPriceBlockType"><type>configurable</type><block>catalog/product_price</block><template>hideprice/price.phtml</template></action>
            <action method="addPriceBlockType"><type>virtual</type><block>catalog/product_price</block><template>hideprice/price.phtml</template></action>
            <action method="addPriceBlockType"><type>bundled</type><block>catalog/product_price</block><template>hideprice/price.phtml</template></action>
        </reference>
    </default>

...

Update: Thanks to Marius below for shedding some light on this. I have now found another approach which to me is much cleaner than messing round with the insanely complicated xml layouts.

In my module I have extended Mage_Catalog_Block_Product_Price and added a call to

$this->setTemplate('hideprice/price.phtml')

in the _toHtml() function. This single change ensures that my new price.phtml template is used everywhere.


texts:
On my development store, I changed the URL recently which made the logo disappear. The image link keeps showing the old URL unless I use unsafe URL's in the frontend in

  stores > configuration > general > web

That seems like strange behavior to me.

Why does this old URL persist in https and how to get rid of it?


texts: Search Engine Robots Section Can't Be Changed (Grayed Out)

texts:
I have a fresh install of Magento 2.2. This is a test site, so we need to hide it from search engines.

I found the Search Engine Robots section under - Content - Design - Configuration - Our theme, but the options are grayed out and cannot be changed.

Is it possible that there is a setting we are missing to unlock this section? We tested 1.9 and did not have this issue.


texts: Magento 2 - How to get class file from event name observer on stripe payment module

texts:
I got this event observer code in the stripe payment module

<event name="payment_method_assign_data_stripecreditcards">
        <observer name="stripecreditcards_payment_gateway_data_assign" instance="Stripeofficial\CreditCards\Observer\DataAssignObserver" />
    </event>

I looking for dispatch event for payment_method_assign_data_stripecreditcards but I'm not found it on the vendor folder, my goals is get know when and from what class file that make this event name triggered.


texts: Sort By Products By Creation Date in EE with SOLR

texts: I need to sort product collection by creation date. It's static attribute in the product entity table. SOLR can index and sort by eav attributes. One option is to create a new attribute and copy date on product save event.  Any other suggestions?  Ideas what is the best way to add custom data to the SOLR index?


texts:
I am learning Magento Admin menu development. I am trying to develop a simple menu in Magento Admin Panel. My codes are as below

location of file: app/etc/modules/Alanstormdotcom_Helloworld.xml

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

location of file: app/code/local/Pulsestorm/Adminhello/etc/adminhtml.xml

<?xml version="1.0"?>
<config>
    <menu>
        <pulsestorm translate="title" module="pulsestorm_adminhello">
            <title>Pulse Storm</title>
            <sort_order>1</sort_order>
            <children>
                <example>
                    <title>Example</title>
                    <sort_order>1</sort_order>
                    <action>adminhtml/adminhello/index</action>
                </example>
            </children>
        </pulsestorm>
    </menu>
</config>

location of file: app/code/local/Pulsestorm/Adminhello/etc/config.xml

<?xml version="1.0"?>
<config>
    <config>
        <modules>
            <Alanstormdotcom_Helloworld>
                <version>0.1.0</version>
            </Alanstormdotcom_Helloworld>
        </modules>
    </config>
    <global>
        <helpers>
            <pulsestorm_adminhello>
                <class>Pulsestorm_Adminhello_Helper</class>
            </pulsestorm_adminhello>
        </helpers>
    </global>
</config>

location of file: app/code/local/Pulsestorm/Adminhello/Helper/Data.php

<?php
class Pulsestorm_Adminhello_Helper_Data extends Mage_Core_Helper_Abstract
{
}

But I could not see any menu in my admin panel. what is the issue here?? Thanks


texts: One or more indexers are invalid. Make sure your Magento cron job is running. ISSUE NOT RESOLVING

texts:
I'm getting this error on my dashboard and when i try to reindex through command line via this command from my magento root directory.

/var/www/html/magento

then

php bin/magento indexer:reindex

so it is giving me an error, see it below

  Could not open input file: bin/magento

Please help me, because many things are not working properly even my theme.
Thank you!


texts: How we can remove cart item in webservice in magento1.9.3

texts:
please check my code because this code removes all cart item. I want to remove 1 by 1.. please check the code and let me know what is the issue.

<?php
ini_set("default_socket_timeout", 200);
ini_set("max_execution_time", 200);
ini_set('display_errors','On');
error_reporting(E_ALL);

if($_REQUEST['hashkey'] == 'NXqXAgFZA0jiWp5t6+=lGpgWJXEkbo' AND $_REQUEST['custid'] != '' AND $_REQUEST['itemid'] != '')
{
    $customer = $_REQUEST['custid'];
    $item_id = $_REQUEST['itemid'];
    require_once ($_SERVER['DOCUMENT_ROOT'] .'/app/Mage.php');
    Mage::app();
    Mage::app()->getTranslator()->init('frontend');
    Mage::getSingleton('core/session', array('name' => 'frontend'));

if ($customer) {

       $storeIds = Mage::app()->getWebsite(Mage::app()->getWebsite()->getId())->getStoreIds();

      $quote = Mage::getModel('sales/quote')->setSharedStoreIds($storeIds)->loadByCustomer($customer);

    if ($quote) {
        $collection = $quote->getItemsCollection(false);
        if ($collection->count() > 0) {
            foreach( $collection as $item ) {
                if ($item && $item->getId()) {
                    echo $item->getId();
                    die();
                    $quote->removeItem($item->getId());
                    $quote->collectTotals()->save();
                }
            }
        }
    }

}

    $retfinal=array("success"=>"1" ,"message"=>"deleted from cart");
    $result=json_encode($retfinal);
    echo $result;

}else
{
    $ret['success'] = "0";
    $ret['message'] = "This is error message...";
    $result=json_encode($ret);
    echo $result;
}

?>


texts: Magento 2 how to restrict previous date in datepicker , for frontend detail page custom options

texts:
In Magento 2 how to restrict previous dates in datepicker ,in detail page customizable options,

Please help me out on this .


texts: How can I add an observable to my template form for Onepage Checkout?

texts:
I am trying to add a checkbox to the checkout page in Magento2, but I am having issues with it. I have worked through http://devdocs.Magento.com/guides/v2.0/howdoi/checkout/checkout_form.html and successfully add a checkout form with a button, which works all well and good. I am able to bind an element to a function, but I need to bind a checkbox to an observable.

Now, I have read a I need an observable because when I try to click the checkbox, it remains empty. I don't know how to do that and am looking for some assistance.

I have seen in other questions code similar to:

var viewModel = {
    setInstoreShipping: ko.observable(false)
};

viewModel.setInstoreShipping.subscribe(function (newState) {
    if (newState) {
        alert("Checked!");
    } else {
        alert("Unchecked!");
    }
});
ko.applyBindings(viewModel);

but when applying this, I receive an error:
You cannot apply bindings multiple times to the same element. So my question is, how do I bind a checkbox to an observable and how do I create the observable to bind to?


texts: sql error when insert new product (magento 1.9.0.1)

texts:
i have that error when try to insert new product programatically

  string 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot
  add or update a child row: a foreign key constraint fails
  (magento.catalog_product_entity, CONSTRAINT
  `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_AT

My code is

               Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
            $product = new Mage_Catalog_Model_Product();
                //if(!$product->getIdBySku($single_product['id'])){

            try{
            $product

                ->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array
                ->setAttributeSetId(9) //ID of a attribute set named 'default'
                ->setTypeId('simple') //product type
                ->setCreatedAt(strtotime('now')) //product creation time
                ->setUpdatedAt(strtotime('now')) //product update time

                ->setSku('214dd21d') //SKU
                ->setName('test name') //product name

                ->setStatus(1) //product status (1 - enabled, 2 - disabled)
                ->setTaxClassId(1) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
                ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility
                ->setManufacturer(28) //manufacturer id
                ->setColor('red')
                ->setNewsFromDate(11/10/2014) //product set as new from
                ->setCountryOfManufacture('US') //country of manufacture (2-letter country code)

                ->setPrice(2000) //price in form 11.22
                ->setCost(2000) //price in form 11.22
                // ->setSpecialPrice($single_product['price']) //special price in form 11.22
                // ->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)
                // ->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)
                // ->setMsrpEnabled(1) //enable MAP
                ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)
                //->setMsrp(99.99) //Manufacturer's Suggested Retail Price

                ->setMetaTitle('test title')
                ->setMetaKeyword('test keyword')
                ->setMetaDescription('test meta ')

                ->setDescription('test')
                ->setShortDescription('test')

                //->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization
                //->addImageToMediaGallery('media/catalog/product/1/0/10243-1.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery

                ->setStockData(array(
                                   'use_config_manage_stock' => 0, //'Use config settings' checkbox
                                   'manage_stock'=>1, //manage stock
                                   'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                                   'max_sale_qty'=>1, //Maximum Qty Allowed in Shopping Cart
                                   'is_in_stock' => 1, //Stock Availability
                                   'qty' => 1 //qty
                               )
                )

                ->setCategoryIds(array(3)); //assign product to categories
            $product->save();
            die('done');
          }catch(Exception $e){

            die(var_dump($e->getMessage()));
            //Mage::log($e->getMessage());

           }
       //}


texts: Need code of edited things through admin panel

texts: How we can get the code of edited pages through the admin panel?


texts: How to render UI form in popup modal from modifier file- magento2

texts:
In the product form I want to add dependency button with customizable options values, for this I am adding below function by overriding the customoptions data-provider file :

protected function getIsdependFieldConfig($sortOrder)
{ //FIELD_DEPEND_NAME
    $modalTarget = 'product_form.product_form.' . static::GROUP_DEPENDS . '.' . $this->dataScopeName . '.modal';
    $content= __(
        ''
    );
    return [
        /*'children' => [
                'modal' => $this->getGenericModal(
                    $this->scopePrefix . static::DATA_SCOPE_DEPENDS
                ),
        //static::DATA_SCOPE_DEPENDS => $this->getGrid($this->scopePrefix . static::DATA_SCOPE_DEPENDS),
        ] ,*/
        'arguments' => [
            'data' => [
                'config' => [
                            'formElement' => 'container',
                            'componentType' => 'container',
                            'component' => 'Magento_Ui/js/form/components/button',
                            'actions' => [
                                [
                                    'targetName' => $this->dataScopeName . '.dependancyModal',
                                    'actionName' => 'toggleModal',
                                ],
                                [
                                    'targetName' => $modalTarget . '.' . $this->dataScopeName . '.dependancyModal',
                                    'actionName' => 'render',
                                ],
                            ],
                            'title' => __('Dependancy'),
                            'sortOrder' => 60,

                        ],
            ],
        ],

    ];
}

Reference block in the layout file :

<referenceBlock name="product_form">
        <block name="customoptions.form.dependant.matrix" class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix" template="Vendor_Namespace::products/assign_products.phtml" as="custom_dependant">
            <arguments>
                <argument name="config" xsi:type="array">
                    <item name="collapsible" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string" translate="true" />
                    <item name="sortOrder" xsi:type="string">1000</item>
                    <item name="canShow" xsi:type="boolean">true</item>
                    <item name="componentType" xsi:type="string">fieldset</item>
                    <item name="provider" xsi:type="string">product_form.product_form_data_source</item>
                    <item name="form" xsi:type="string">product_form.product_form</item>
                    <item name="modal" xsi:type="string">dependancyModal</item>
                    <item name="nameStepWizard" xsi:type="string">variation-steps-wizard</item>
                    <item name="dataScope" xsi:type="string">customoptionsFormDependant</item>
                    <item name="urlWizard" xsi:type="string">customoptions/items/dependancy</item>
                </argument>
            </arguments>
        </block>
    </referenceBlock>

Popup is able to open on click of button but no data and UI component form has render.


texts: Magento 2 : Update shipping price in checkout summary by default on shipping step when there is only one shipping method available

texts:
I need to update checkout summary with shipping price by default when only one shipping method is available on shipping step.
Currently shipping price is updated when I move on to payment step.

If someone can help then it will helpful, thanks in advance.


texts:
I'm testing a Magento store (CE 1.7.2) with 180k fake products. A big problem is the reindex time process (reindex all), 2-3hrs. (2hrs with Magento CE 1.8).
Has anyone any suggestions about how to speed up the whole process?
Thanks


texts: How can I display current product attribute in a callout phtml file?

texts:
There is a callout phtml file called in my right sidebar (let's call it attribute.phtml), on the product page.

I'm trying to show the attribute value in that callout.

The attribute is a drop down, so it should be

<?php echo $_product->getAttributeText('attributecode'); ?>

But I am missing something before that, I'm wondering how can I load it for the current product ? Note: this is not inside list or view , it's in template/callouts . I'm stuck, any help would be really appreciated right now...


texts: Add a note under a form field using ui components

texts:
How can I add a small text under a field in Magento 2 using ui components.
Using Magento\Framework\Data\Form I could do this:

/** @var \Magento\Framework\Data\Form $form */
$form = $this->formFactory->create();
$fieldset = $form->addFieldset(
    'base_fieldset',
    [
        'legend' => __('Some legend here'),
        'class'  => 'fieldset-wide'
    ]
);
$fieldset->addField(
    'name',
    'text',
    [
        'name'      => 'name',
        'label'     => __('Name'),
        'title'     => __('Name'),
        'note'      => __('Some note here')
    ]
);

The code above would produce this (notice the text under the field).

How can I achieve the same thing using form ui-components?
I have the form defined like this:

<field name="name">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Name</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">[entity]</item>
            <item name="sortOrder" xsi:type="number">10</item>
            <item name="dataScope" xsi:type="string">name</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

I tried adding <item name="note" xsi:type="string" translate="true">Some note here</item> but, guess what?


texts: How to pass payload in POST V1/invoices when i generate invoice of bundle product in Magento-2.1?

texts: I want to generate invoice for bundle product. I don't know what data is pass for generate invoice for bundle product. Please tell me which data is passed,when i create invoice using POST V1/invoices in Magento-2.1.


texts:
Hopefully someone can help me with my shipping methods.

Current set up has:

Table Rates Price vs Destination - $0-$100 free, > $100 $7.50 Shipping.
Fixed Rate = $0 for Pick up from store option.

This works fine but we have added gift card products which can cost less than $100 but shouldn't cost to ship. So I have set up a shopping cart rule that gives 'free shipping' on Gift Card Products. This seems to work in cost calculations but in the checkout there is no selection for shipping it automatically selects "Pick up from store $0" option not 'Free Shipping'

What should happen is that if there is a gift card product in the cart the options should be 'Free shipping' and 'Pick up'

Does anyone have a solution?


texts: Magento 2.2.2 Advanced Reporting Not working

texts:
I went through this process https://docs.magento.com/m2/ce/user_guide/reports/advanced-reporting.html

but yet I still get 404.

Anyone have any idea what else could be?
Thank you.


texts:
I have a custom module with it's own api requests, but I wish to create an alias to an Magento api request.

My api path:

GET    /V1/orders/get-new

which is a simple alias to Magento owns GET /V1/orders but with predefined parameters:

searchCriteria[filter_groups][0][filters][0][field]=is_new
&searchCriteria[filter_groups][0][filters][0[value]=false
&fields=items[...]

I have tried calling OrderRepositoryInterface getList with a search criteria matching the above. This returns all the orders, but the items for each order is only an array of ids and not the full details. It also includes the extension attributes.


texts: COGS (Cost of Goods Sold) Tracking in Magento?

texts:
What is the suggested method for tracking COGS for products within Magento?  We have recently learned that it will be necessary to track the inbound cost of each item that is sold in the store and it seems that this might be something that would be provided by Magento out of the box, however I'm not seeing this option.

One option I've seen is to perhaps follow the method outlined here: "How do i show Manufacturer’s Suggested Retail Price?," however I'm just not convinced that this is the right vector of attack.


texts: How to get selected values of product custom options?

texts:
I have a virtual product and it consists with various types of custom options such as drop-downs, text fields, radio buttons etc. Once the place order clicks I'm firing an event observer. There I want to get the selected values of all these custom options.

How to achieve this? I can get the option titles. But can't get the selected values of them.


texts: Blank white screen of magento admin after upgrade

texts:
I have just upgraded my magento site from 1.7.0.2 to latest version and when i visit my frontend, it is working fine but when I try to open admin panel, it shows nothing and display white screen.

I used following in index.php file to see any error but nothing is appearing still.

error_reporting(E_ALL);
ini_set('display_errors', 1);

Please help me


texts:
If I am on the admin section for creating manual orders and I have selected to use an existing customer rather than create a new one how can I access that customers details?

To clarify, by manual orders I mean by clicking - Sales -> Orders -> Create New Order and then selecting a customer to create an order for.

I'm hoping there is a function similar to the Mage::registry for products and categories so that I can select the customer email address within a template loaded via a custom module.


texts: Use Product Descriptions from "All Stores Views instead of Default Store View"

texts:
I'm relatively new to Magento, I'm on version 2.2.5 . The product descriptions on my site are correct under the "All Stores Views" however those descriptions aren't being applied to the "Default Store View".

  I need the product descriptions to pull from the "All Stores
  Views" otherwise I'd have to re-write about 1,000 product
  descriptions. How can this be done?

Thank you in advance.


texts: Sub-Folder Store View - Only homepage loads

texts:
I have a store set on a different domain to my main magento installation. I then have stores in sub-folders using the second domain e.g.

maininstall.com
aliasdomain.com
aliasdomain.com/store1
aliasdomain.com/store2

etc...

Now I added the nginx code to get my aliasdomain working in the root in my .conf

map $http_host $MAGE_RUN_CODE {
    aliasdomain.com viewcode;
    www.aliasdomain.com viewcode;
}
....
 location ~ \.php$ { ## Execute PHP scripts
...
        fastcgi_param  MAGE_RUN_TYPE store;
        fastcgi_param  MAGE_RUN_CODE $MAGE_RUN_CODE;
...
    }

The aliasdomain.com works fine however the subfolders do not. Basically upon opening one in browser it all works fine, but clicking onto ANY page / product in that store causes a redirect back to "aliasdomain.com" with no subfolder.

I have not added nginx configuration for these stores as there is no need they all have their own index.php with the following in:

$mageRunCode = 'viewcode2';
$mageRunType = 'store';

Mage::run($mageRunCode, $mageRunType);

Does anyone know what could be causing this behaviour? I am stumped! This worked fine on Apache and I have just moved to nginx but can't see why the homepage would load (the store code is working) but then subsequent pages don't.

I have "Auto Redirect to BASE URL" set to Yes (302) in the backend (which was working fine on Apache) and if I turn it off the pages load the correct url e.g. aliasdomain.com/store1/page1 but I get a 404. Thought that was worth noting!

Thanks in advance!

EDIT:

I just found going into the store backend and setting "Use webserver rewrites > No" fixes the issue.

The problem is I am sure I need this ticked to yes, does this narrow down where my problem lies?

Thanks!


texts: Creating store specific products from product->duplicate

texts:
basically i want to create store specific versions of a product with out saving the product first and loading it back up.

I would like to do this so i can use the core/resource_transaction model to save all of the products at same time and rollback if something goes bad.

I have the admin store product that contains all the default values. I'm duplicating that and then setting the storeid for the product and setting store specific names, descriptions and so on...

$storeprod = $adminprod->duplicate();
$storeprod = $storeprod->setStoreId($germanstoreid);
$storeprod->setName($germanName);
$storeprod->setDescription($germanDesc);

then I'm adding all the products to transaction

$transactionModel = Mage::getModel('core/resource_transaction');

foreach($products as $product){

   $transactionModel->addObject($transaction);

}

$transactionModel->save();

This is where i hit the rocks. The transaction save fails with a integrity constraint violation.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '246903-1' for key 'CATINV_STOCK_ITEM_PRD_ID_STOCK_ID'

What do i need to change in the store specific products to get the transaction to work? Is what I'm trying to do even possible, can you even create store specific products without saving the admin product first?

cheers.


texts: Magento2.3 installation issue on wamp Winodws 10

texts:
I am asking this question after several attempt to install magento2.3 on windows10 WAMP. Every time the installation stops and shows error at zero percent or at 70 percent or in between. Lot of people advised to try it on Ubuntu but that is not possible because our company using Windows10 as OS and not permitted to use Ubuntu.

The steps/configuration that i follows for Magento 2.3 installation on WAMP

Wamp Version 3.1.7
PHP 7.1.26
Apache 2.4.23
Enabled Open SSL
Set max_execution_time = 18000
Set memory_limit = 2G
max_input_time = 1800
Enabled Exception  printing
Set Full permission to magento folder/files (777)
Then setup virtual host in The Directory "D"

Virtual Host Settings

<VirtualHost *:80>
ServerAdmin webmaster@local.mage230ce.com
DocumentRoot "D:/Projects/mage230ce"
ServerName local.mage230ce.com
ErrorLog "logs/local.mage230ce.com-error.log"
CustomLog "logs/local.mage230ce.com-error-access.log" common

<Directory "D:/Projects/mage230ce">

    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted

</Directory>

Then runs the url now stops at 0 percent Installing... 0% Please check the below image

System.log

main.ERROR: Error: Application is not installed yet.  [] []

debug.log

 main.ERROR: Error: Application is not installed yet.  [] []

install.log

  Starting Magento installation:
  File permissions check...
  [Progress: 1 / 773]
  Required extensions check...
  [Progress: 2 / 773]
  Enabling Maintenance Mode...
  [Progress: 3 / 773]
  Installing deployment configuration...
  [Progress: 4 / 773]
  Installing database schema:
  Schema creation/updates:

Please check the above issue and guide me..


texts:
I'm looking for a solution to allow to add attachments to a contact us form. I tried this module https://github.com/vijayrami/Magelearn_ContactAttachment but it doesn't work well. PDF is not being sent and you can only attach one file.
Are there any good solutions for that? I haven't found anything, even paid.
Also, it would be then connected to a Vue Storefront but this is another question.
It's Magento 2.4.1.
Thanks!


texts: Magento 2: Failed to load resource: the server responded with a status of 404 (Not Found)

texts:
I am trying to override magento 2 core js '

require-config.js file at path Test/JsOverride/view/frontend/

   var config = {
        "map": {
            "*": {
                "menu": "Test_JsOverride/js/menu-custom"
            }

        }
    };

Test/JsOverride/view/frontend/web/js

menu-custom.js

define([ 'jquery', 'jquery/ui', 'mage/menu'
    ], function($){
    $.widget('inchoo.menu', $.mage.menu, {
        _init: function () {
            alert("I'm Inchoo");
        },
        toggle: function () {
            alert("I'm Inchoo");
        } }); return $.inchoo.menu; })


texts:
I need to make my controller login based, so that guest user auto redirect to login page.

And after login he/she should redirect back to that controller.

Please help me achieve this.


texts: Magento 2 how to Load custom collection data using Ajax

texts:
I want to display modal collection data using load more Ajax functionality, currently i am display load more data using jquery & CSS.

Because for now i have a limited collection data but in future collection data size will be bigger and bigger then it will be take more time to load.

so i want to display data using Ajax, first it will display 3 row and when i click on load more then it will load more 3 row, how can i achieve this thing.

  Namespace\ModuleName\Block\Producer\MeetOurProducer.php

/**
 * @var \RB\producer\Model\producerWebsiteFactory
 */
private $producerWebsiteFactory;

public function _prepareLayout()
{
    parent::_prepareLayout();
}

public function __construct(
\Magento\Framework\View\Element\Template\Context $context, \RB\producer\Model\producerWebsiteFactory $producerWebsiteFactory, array $data = array()
)
{
    $this->_storeManagerInterface = $context->getStoreManager();

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

public function getproducerCollection()
{
    $lastId = $this->getRequest()->getParam('last_producer_id');
    //echo $lastId;die('CP');
    $store = $this->_storeManagerInterface->getStore();
    $collections = $this->producerWebsiteFactory->create()
        ->getCollection()
        ->addFieldToFilter('status', array(['eq' => producerStatus::producer_STATUS_ACTIVE], ['eq' => producerStatus::producer_STATUS_VACATION_MODE]))
        ->addFieldToFilter('website_id', ['eq' => $store->getWebsiteId()]);

    $collections->getSelect()->joinLeft(['rb_producer_microsites' => $collections->getTable('rb_producer_microsites')],
                                                                                'main_table.producer_id = rb_producer_microsites.producer_id AND rb_producer_microsites.store_id =' . $store->getStoreId());

    return $collections;
}

  Namespace\ModuleName\Block\Producer\MeetOurProducer.phtml

    <?php foreach($vendors as $vendor) { ?>

            <?php if (!empty($vendor->getLogo()) && $helper->isImageExist($block->getMediaUrlSellerDirectory() . 'vendor/logo' . $vendor->getLogo())) : ?>
                <img src="<?php echo $helper->resize($vendor->getLogo(), 'vendor/logo', null, 200); ?>" />
            <?php else: ?>
                <img src="<?php echo $this->getViewFileUrl('Namespace_Modulename::images/small_image.png'); ?>" />
            <?php endif; ?>

<?php echo $vendor->getBusinessName(); ?>

<?php
                $in = $vendor->getShortDescription();
                $out = strlen($in) > 360 ? substr($in,0,360)."..." : $in;
                echo $out;
                ?>

            <?php if(!empty($vendor->getUrlKey()) && $vendor->getGoLive() != 0) { ?>

                <a class="action btn" href="<?php echo $block->getStoreUrl(); echo $vendor->getUrlKey();?>"><?php echo __('VIEW PRODUCTS'); ?>

            <?php } ?>

    <?php } ?>

    <button id="our_producers_show_more" id="btn_more" class="our-producers-show-more"><?php echo __('LOAD MORE'); ?></button>

And i call this block to admin block

{{block class="Namespace\Modulename\Block\Producer\MeetOurProducer" template="Namespace_Modulename::producer/meetourproducer.phtml"}}

Any help would be appreciated. Thanks.


texts: How to skip a step in magento 2 data migration?

texts: Is there a way to skip the EAV step described in the technical internals of magento 2 migration


texts: Getting Error in SwaggerUI in Magento V.2.2

texts:
The SwaggerUI has been working perfectly fine but now after installing some Modules, I think the Swagger is not at all working.

It's custom module and custom admin theme.

I checked the logs and found the error to be this:

The service interface name "["Magento\\Store\\Api\\StoreRepositoryInterface","Magento","Store","StoreRepository","Interface"]" is invalid.

I have already tried restarting the server and disabled caching as well but still no luck.

Any suggestions?

Thankss!


texts: How to use Ajax in magento 2 custom module

texts:
I am working on one custom module and i need product load when any ID is clicked. Loading is handle by ajax. I am not aware of ajax in Magento 2. Can anybody give me small demo of ajax in Magento 2

Controller file

namespace Vendor\Modulename\Controller\Index;

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

class Index extends Action
{
    /**
     * @var \Tutorial\SimpleNews\Model\NewsFactory
     */
    protected $resultJsonFactory;
    protected $resultPageFactory;

/**
 * @param Context $context
 * @param NewsFactory $modelNewsFactory
 */

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

   public function execute()
    {
        /*Put below your code*/
        // $id = $this->getRequest()->getPost('id', false);
        $responseData = $this->resultJsonFactory->create();
        $resultJson = $this->resultPageFactory->create(ResultFactory::TYPE_JSON);
        $resultJson->setData($responseData);
        return $resultJson;
    }
}

router file

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

Template file

<script>
    require(
        ['jquery','example'],
        function($,example){

        var ajaxurl = '<?php echo $block->getAjaxUrl() ?>';
        example.exampleData(ajaxurl);

    });
</script>

Js file

define([
        'jquery',
        ],
    function($,example){

return {
    exampleData:function(ajaxurl){
    $(document).on('click','.example-list',function (event){
            event.preventDefault();
            var id=$(this).attr('id');
            $.ajax({
                url:ajaxurl,
                type:'POST',
                showLoader: true,
                dataType:'json',
                data: {id:id},
                success:function(response){
                    alert(response);
                }
            });
        });
    }
}

});

The above code is not working. It's showing error.


texts: I am seeing the following broken code with \n characters when I go to Admin->Catalog->Manage Categories.  I was wondering if someone has a clue what kind of bug is this and how can i fix it.


texts:
been looking into the attributes customers use in magento, in the build we have we have a references attribute which we created for card references however every created customer is also given a customer_reference which has is system set to true

in customer_entity_varchar the value is blank (not null, just blank) and i can't find customer_reference in the backend, so i am wondering what it's used for and also how i can stop it from adding data to the database since we have 300,000 customers and we don't want useless eav attributes hanging around


texts: How to get a shopping cart price rule name if I know the id of a rule in product page-View.phtml

texts:
Is it possible to display a shoping cart price rule name in a product page, if I know an ID of that rule?

Is there an easy way? I can access atributes, but i am first time dealling with cart rules in product page.

I am using Magento 1.9.2.

Thank you very much.


texts: Need help with a complex shopping cart rule

texts:
I have a shopping cart rule and I haven't been able to figure out how to make it work. Any help would be appreciated.

Here it is:

A customer can buy 2 skus from a category, but they must not be the same sku. If they do, they get a third, specific sku at a discount.

The first part is the part I'm stuck on. How do I make a rule for 2 skus from a category that are not the same product?

Thanks!!!


texts: Magento 2.1.4: show custom shipping method only for register/logged in user

texts:
I have a custom shipping module and it works fine.

Now I want to show it only in the checkout if the customer/user is logged in/registered.

Is there any file where I can make a function to check this?

The only file I know is the shipping.html but this couldn't be the right one because it's a js generated file.


texts: Magento 2 : How to add Coupon Code Section In mini cart like in the shopping cart

texts: I want to display coupon code section inside the minicart with same functionality as shopping cart page.


texts: Why does magento handle instances of 'product' differently?

texts:
Okay, i'm relatively new to magento and this has been bugging me -- because it's something I would've even considered and it's stopped my ability to complete a project.  Why does Magento instantiate 'product' multiple different ways?  For example when I load a product using 'loadByAttribute()' many aspects of that product simply aren't present.  When I use 'load()' they are!  IMO they should be the same product model.  I don't see a benefit to making them completely different.  Below is some code to clarify what i'm talking about.  Perhaps someone can correct my thinking or clarify my thought process to better align with magmento practice.

I am getting the realized simple product of a configured item in the cart.  To do this I need to do the following:

$productId = $_item->getProductId();
//this loads the initial configurable or simple product
$product = Mage::getModel('catalog/product')->load(productId);
//this is used to get the simple product of the configurable product
if($product->getTypeId() == "configurable"){
    sku = $_item->getSku();
    //this loads a sort of 'psuedo-product' with only some attributes
    $producted = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
    //this loads the actual product with all attributes
    $product = Mage::getModel('catalog/product')->load($producted->getId());
}

Is there a simpler way to do this?


texts: Magento 2 - URLs trailing slash redirection

texts:
I configured my Magento 2 store to ends with trailing slash. This work great.

But when I browse the same page without trailing slash, it redirects to a 404 error page, and not to the trailing slash versión.

Why does it not redirect automatically? Do I need to configure something?

Thanks in advance!


texts: icons are not displaying after setting up content delivery network for static view files?

texts:
I am trying to setup azure cdn for static view files and changed  Base URL for Static View Files with cdn url.but icons are not displaying ,how do i solve this ? I am using nginx server  and I  found out its font awesome cors problem .where do I wanna make changes ?

I am pointed my cdn to /pub/static


texts: Magento 2 DropdownDialog widget showing dropdown when the page load without onclick

texts:
I am using https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_dialog.html if the page refreshes the drop-down popup come 1 second on the page, how to solve this issue on the home page.
My settings:
"dropdownDialog": {
        "appendTo": "[data-block=dropdown]",
        "triggerTarget":"[data-trigger=trigger]",
        "timeout": 2000,
        "closeOnMouseLeave": false,
        "closeOnEscape": true,
        "triggerClass": "active",
        "parentClass": "active",
        "buttons": []
}


texts: Nested database transactions in Magento 2

texts:
I have found the code that uses database transaction (\Magento\SalesRule\Model\ResourceModel\Rule::saveStoreLabels):

public function saveStoreLabels($ruleId, $labels)
{
    ...
    $connection = $this->getConnection();
    ...
    $connection->beginTransaction();
    try {
        ...
    } catch (\Exception $e) {
        $connection->rollback();
        throw $e;
    }
    $connection->commit();

    return $this;
}

I want to get nested transactions where inner transaction should be processed silently (without exception) and outer transaction should be committed if no error occured (even inner transaction is rolled back):

public function someOtherMethod(...)
{
    ...
    $connection = $this->getConnection();
    ...
    $connection->beginTransaction();
    try {
        ...
        /* nested transaction should be committed or rolled back without exception */
        $connection->beginTransaction();
        try {
            ...
            $connection->commit();
        } catch (\Exception $e) {
            $connection->rollback();
        }

    } catch (\Exception $e) {
        $connection->rollback();
        throw $e;
    }
    /* outer transaction should be committed if exception was not thrown */
    $connection->commit();

    return $this;
}

Is it possible?


texts:
Currently the version supported "natively" by AWS Quick Start Reference Deployment is the 1.9.2:
http://docs.aws.amazon.com/quickstart/latest/magento/overview.html

Is there any documentation on deploying (and upgrading afterwards) the latest Magento 2.1 on it?

Thank you


texts: I need to design multiple stores in same domain

texts: I am selling my products in three different countries so I need three different stores with different languages


texts:
I can't seem to get the products showing up on the home page. I keep getting "There are no products matching the selection."

This is what I have tried so far ...

Category ID is 35,

Is Active = Yes,
Show in Nav Bar = No
Display mode = Products & Static Blockx

CMS > Pages > Home > Content >

<div>{{block type="catalog/product_list" template="catalog/product/home.phtml" category_id="35"}}</div>

There are current 6 products under this category. They all are in stock and show up when browsed via navigation bar. The only issue is that I can't get them listed on the home page.

I have tried searching on Google and Magento forum where people advise re-indexing data etc and I have tried all these but still no luck. What am I doing wrong? Any ideas how can I sort it out?

Thanks for your help.


texts: Magento 2.2 : uiComponent Form : show images in a field

texts: I would like to show images in a field without having uploader button. I have images name in the DB column. How could i use a renderer for the field or any other way to do this?


texts: Call to a member function toHtml() on null Magento 2

texts:
I am trying to show Product Collection in .phtml file of custom module

<a href="<?= /* @escapeNotVerified */ $block->getProductUrl($_item) ?>" class="product photo product-item-photo">
    <?= $block->getImage($_item, $image)->toHtml() ?>
</a>

in this line i am getting error as

  Fatal error: Uncaught Error: Call to a member function toHtml() on
  null

anyone please help

i got product Collection By Product ID

$this->_itemCollection=[];
        foreach ($collection as $value) {
            $product = $this->_productRepository->getById($value->getProductId());
            array_push($this->_itemCollection, $product);
        }
        return $this;


texts: Unable to place order with authorized.net direct post magento 2.1.3

texts:
I am having issue with place order with magento 2.1.3 version. When i place order with authorized.net direct post have facing error Which from transact.dll response:

Also you can see directpost_payment response.

But when i check in admin order was placed successfully. But getting this error.
can you please help me resolve the issue.


texts: Checkout Failing after SUPEE-9767 on 1.9.2.3

texts:
I see a lot of issues around said patch. Onepage-checkout wont progress past billing form.

I checked all the .phtml forms and ensured they had the form key code. They do. The form key field is seen in browser inspection. I haves both turned on and off "enable form key validation" no change. I think i have done every thing i has seen in the forums I am at a loss. I can't revert the patch as the -R  option doesn't work. I may have to go to backups.

Any thoughts?


texts: Magento2.2.2: UI Component Grid Filter Issue

texts:
In my custom module, my Grid Records are deleting perfect without applying filter. When i apply filter on grid records and try to delete only filtered records, it not only delete filtered records but other records also gets deleted and grid gets empty.

<?php

namespace Vendor\Module\Controller\Adminhtml;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Framework\Controller\ResultFactory;

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

const REDIRECT_URL = '*/*/';

protected $collection = 'Magento\Framework\Model\Resource\Db\Collection\AbstractCollection';

protected $model = 'Magento\Framework\Model\AbstractModel';
protected $cat = false;

/**
 * Execute action
 *
 * @return \Magento\Backend\Model\View\Result\Redirect
 * @throws \Magento\Framework\Exception\LocalizedException|\Exception
 */
public function execute()
{

    $selected = $this->getRequest()->getParam('selected');
    $excluded = $this->getRequest()->getParam('excluded');

    try {
        if (isset($excluded)) {
            if (!empty($excluded) && is_array($excluded)) {
                $this->excludedDelete($excluded);
            } else {
                $this->deleteAll();
            }
        } elseif (!empty($selected)) {
            $this->selectedDelete($selected);
        } else {
            $this->messageManager->addError(__('Please select item(s).'));
        }
    } catch (\Exception $e) {
        $this->messageManager->addError($e->getMessage());
    }

    $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
    return $resultRedirect->setPath(static::REDIRECT_URL);
}

/**
 * Delete all
 *
 * @return void
 * @throws \Exception
 */
protected function deleteAll()
{
    /** @var AbstractCollection $collection */
    $collection = $this->_objectManager->get($this->collection);
    $this->delete($collection, true);
}

/**
 * Delete all but the not selected
 *
 * @param array $excluded
 * @return void
 * @throws \Exception
 */
protected function excludedDelete(array $excluded)
{
    /** @var AbstractCollection $collection */
    $collection = $this->_objectManager->get($this->collection);
    $collection->addFieldToFilter(static::ID_FIELD, ['nin' => $excluded]);
    $this->delete($collection);
}

/**
 * Delete selected items
 *
 * @param array $selected
 * @return void
 * @throws \Exception
 */
protected function selectedDelete(array $selected)
{
    /** @var AbstractCollection $collection */
    $collection = $this->_objectManager->get($this->collection);
    $collection->addFieldToFilter(static::ID_FIELD, ['in' => $selected]);
    $this->delete($collection);
}

/**
 * Delete collection items
 *
 * @param AbstractCollection $collection
 * @return int
 */
protected function delete(AbstractCollection $collection, $all = false)
{
    $count = 0;
    if ($all) {
        $count = $collection->getSize();

        foreach ($collection as $item) {
            $item->delete();
        }
    }
    foreach ($collection->getAllIds() as $id) {
        /** @var \Magento\Framework\Model\AbstractModel $model */
        if ($this->cat) {
            $msg = $this->_objectManager->create('Vendor\Module\Model\Productcats')->deleteCategory($id);
        } else {
            $msg = null;
        }
        if ($msg != null) {
            $this->messageManager->addError($msg);
            return;
        } else {
            $model = $this->_objectManager->get($this->model);
            $model->load($id);
            $model->delete();
            ++$count;
        }
    }
    $this->setSuccessMessage($count);
    return $count;
}

/**
 * Set error messages
 *
 * @param int $count
 * @return void
 */
protected function setSuccessMessage($count)
{
    $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $count));
}

protected function _isAllowed()
{
    return true;
}
}


texts: Pass data to block file from ajax request

texts:
How do I pass data from the controller to my block file? Below is the code which I am using inside the controller.
 $this->_view->loadLayout();
  $this->_view->getLayout()
                 ->createBlock("Mymodule\Booking\Block\BookingList")
                 ->setTemplate("Mymodule_Booking::content/test.phtml")
                 ->toHtml();


texts:
I have transfer my site from one domain to another. I have cleared cache & session as well. No htaccess issue. URL changed in database.

Still it redirects to

<my domain>/downloader/downloader & giving error This webpage has a redirect loop

Any idea what still i need to check?


texts:
I need to be able to get the discount type applied in the cart.

I can get the discount amount like so:

$cart = Mage::getModel('checkout/cart')->getQuote();
$totals =  $cart->getTotals();
$discount = $totals["discount"]->getValue();

How can i check what type of discount it is - whether it is a percentage or fixed amount off?


texts:
After configuring the domain alias on my website I can no longer access the backend.
"This page does not website.com has redirected you too many times.
Try deleting the cookies.
ERR_TOO_MANY_REDIRECTS"


texts: How to configure live tracking in magento 2 CE?


texts: Magento2: search module result on live directly on catalog

texts:
I'm looking for an extension that will allow me to use a search engine to search directly in a live directory.
So when I start type words in search engine then I get result on live like screen:

Here is video:
https://streamable.com/8tu22e
Can anyone recommend a module?


texts:
I want to use just 5 digit password instead of Caps lock number small character and more.
I want to just use 5 lengh it can be anything like 12345 or abcde


texts: How to get estimate shipping method in magento 2?

texts:
There are two problems mainly:

my Ajax request not firing on change of postal code in cart. don't know why
When I'm changing postal code on cart checkout page, Ajax request need to be fire on this URL

https://mywebsite.com/rest/default/V1/guest-carts/7da47754b424c67d3fe1684ab713b111/estimate-shipping-methods

the output Ajax I get is following

  [{"carrier_code":"fedex","method_code":"FEDEX_GROUND","carrier_title":"Federal
  Express","method_title":"Ground","amount":36.24,"base_amount":36.24,"available":true,"error_message":"","price_excl_tax":36.24,"price_incl_tax":36.24},{"carrier_code":"fedex","method_code":"FEDEX_2_DAY","carrier_title":"Federal
  Express","method_title":"2
  Day","amount":45.94,"base_amount":45.94,"available":true,"error_message":"","price_excl_tax":45.94,"price_incl_tax":45.94},{"carrier_code":"fedex","method_code":"STANDARD_OVERNIGHT","carrier_title":"Federal
  Express","method_title":"Standard
  Overnight","amount":56.38,"base_amount":56.38,"available":true,"error_message":"","price_excl_tax":56.38,"price_incl_tax":56.38},{"carrier_code":"storepickup","method_code":"storepickup","carrier_title":"Store
  Pickup","method_title":"","amount":0,"base_amount":0,"available":true,"error_message":"","price_excl_tax":0,"price_incl_tax":0}]

My question is how to get this: 7da47754b424c67d3fe1684ab713b111 code to make URL complete. if this code is wrong i enter manually I get error in Ajax

  {
      "message": "No such entity with %fieldName = %fieldValue",
      "parameters": {
          "fieldName": "cartId",
          "fieldValue": null
      }

I'm using Magento 2.0.4


texts: magento 1 getting product option ( text field ) from product

texts:
OK this is probably a really simple thing and I am probably missing something really simple.

I am producing price lists and getting data from magento to print the prices in tables for products in choosen category. Everything works fine for me and the price and option price with option name are listed perfectly in the table row.

However One of the options we have on our products is a colour and in magento it is set as a custom option text field. If the field is filled in by the customer a set charge is added to the product.

Now when I list the options in the table the price and the option value name wont show up.

Here is my code :

<?

umask(0);
require_once('../../app/Mage.php'); //Path to Magento
Mage::app();

function priceList($catId)
{

$Category = Mage::getModel('catalog/category')->load($catId);

$catName = $Category->getName();

$products = Mage::getModel('catalog/category')->load($catId)
    ->getProductCollection()
    ->addAttributeToSelect('*')// add all attributes - optional
    ->addAttributeToFilter('status', 1)// enabled
    ->addAttributeToFilter('visibility', 4)//visibility in catalog,search
    ->addAttributeToFilter('price', array('gt' => 0.1))
    ->setOrder('position', 'ASC'); //sets the order by price

    $c = '';
    $pCnt = 0;
    $tBody = "";
    $tBottom = "";

    $c.=  "
" . $catName . "
";

    foreach ($products as $_product):

        $p = Mage::getModel('catalog/product')->load($_product->getId());
        $prodId = $p->getId();

        if ($pCnt < 1) {
            #### only generate table head for first category product
            $tTop = "
";
            $tTop .= "
Product Name	";
            $tTop.= "Price	";

            foreach ($p->getOptions() as $_option) {
                $optionName = $_option->getTitle();
                $tTop .= "" . $optionName . "	";

            }

            $tTop .= "
"; // end table head
        }

        $tBody .= "
";
        $tBody .= "" . $p->getName() . "	";
        $tBody .= "" . number_format($p->getPrice()) . "	";

        foreach ($p->getOptions() as $_option) {

            $values = $_option->getValues();

            ///// this actually will get the colour price !! but when I use it in the values loop it is blank ??
            $getColourPrice = $_option->getData('default_price');   /// THE PROBLEM ONE !!!!!!!

            $tBody .= "";
            $tBody .= "
";
            $tBody .= "
";

                foreach ($values as $v) {
                    $tBody.="";
                    if($v->getPrice()==0) {
                        $tBody .= "&#10004"; // show tick to say this is standard
                        $tBody .= "
 " . $v->getTitle() . "	";

                    } else {
                        $tBody .= $getColourPrice; //// this is always blank
                        $tBody .= number_format($v->getData('default_price'),2); // show price as this is a choosable option
                        $tBody .= "
 " . $v->getTitle() . "	";
                    }
                    $tBody.="	";
                }

            $tBody .= "
";
            $tBody .= "
";

        }

        $tBody .= "
";
        $tEnds .= "
";

    endforeach;

    $result = $c . $tTop . $tBody . $tEnd;

return $result;

}

echo priceList(72);

?>

So the problem is how do you get the value name and price for a custom product option which is a text field, I am at a complete loss and have been searching for days.

Any help would be greatly appreciated


texts: without cacheable false in layout magento2

texts:
Get quote data from block without cacheable="false".

Marketplace doesn't accept cacheable="false" in layout.

It throws the varnish problem. How can resolve without cacheable="false".

Quote subtotal can't get from block without cachable="false".


texts: Get parameters are added to the end of every URL

texts:
I am using Magento 1.6.1.0. The code is running on a server, Linux system. I am accessing the files using ftp connection from the Windows 7 64bit OS.

The problem is that at the end of each url: home page or categories, brands and other pages, I always see this line: ?r=1&width=1536&Height=764, for example: http://www.mywebsite.co.uk/?r=1&width=1536&Height=764 or http://www.mywebsite.co.uk/Locate?r=1&width=1536&Height=764 and etc.

I went to system, configuration, general, web and checked the base urls, there is nothing suspicious. I also tried to revert back the files I was working on in order to find out whether it was my fault. However the problem still exists.


texts: Adding a barcode for Order number and Tracking Number in Shipment PDF

texts:
I am trying to add bar codes for the order number and tracking number in the shipment PDF.
Can anyone help?

Thanks!