texts: Create part shipment and check if item has been shipped

texts:
Is it possible in Magento to ship single items of an order independently of each other programatically?

For example, say i have an order with 5 order items and i want to ship only 1 of those how can this be done?

Additionally, i would like to determine if any of the single items has been shipped.


texts: How to get images of recently viewed products in sidebar

texts: In my store recently viewed products name only displayed, i need to visible images of recently viewed products.


texts: Add to cart multiple products programatically magento 2

texts:
i have tried with add to cart with multiple products simple, config, virtual all types of product but i am not able to add multiple product. You can see below code of add to cart product.

$product = Array
(
 [0] => Array
    (
        [id] => 1
        [qty] => 1
        [type] => simple
    )

[1] => Array
    (
        [id] => 27
        [qty] => 1
        [type] => configurable
        [options] => Array
            (
                [135] => 4
                [93] => 10
            )

    )

[2] => Array
    (
        [id] => 10
        [qty] => 1
        [type] => downloadable
        [link] => Array
            (
                [links] => Array
                    (
                        [0] => 7
                        [1] => 8
                    )

            )

    )

)
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$quote = $objectManager->get('\Magento\Checkout\Model\Cart');
foreach ($product as $key) {
        $_product = '';
        $_product = $objectManager->get('\Magento\Catalog\Model\Product')->load($key['id']);
        if($key['type']=='simple' || $key['type']=='virtual'){
            $params = array (
                'product' => $key['id'],
                'qty' => $key['qty']
            );
        }
        if ($key['type']=='downloadable') {
            $params = array (
                'product' => $key['id'],
                'qty' => $key['qty'],
                'links' => $key['link']
            );
        }
        if ($key['type']=='configurable') {
            $params = array (
                'product' => $key['id'],
                'qty' => $key['qty'],
                'super_attribute' => $key['options']
            );
        }
        $quote->addProduct($_product, $params);
    }
    $quote->save();

This whole code working with one type of product but there is not working with multiple product type.

can you please suggest how can i resolve the issue ?


texts: Magento : TypeError: source is not an object properties = Object.keys(source);

texts:
I am getting this error in my console what is cause of this error??? it is in prototype.js.I am using magento enterprise edition

Thanks,


texts: Magento 2 - Table not deleting while uninstalling custom module using module:uninstall command

texts:
I'm a newbie in magento 2 development. I'm creating magento 2 module and testing with composer. My test project is in github. https://github.com/hussain-badusha/magento-badusha-test

In my module, i simply created a table in Setup/InstallSchema.
As everybody does, i just want to delete my table when the user is uninstalling my module. So, after minutes of surfing, i found a way and used Setup/Uninstall to delete the table.

But, the table is not deleting while i uninstall the module

To reproduce the error,
I installed it using composer by putting git url in repositories in magento installed root path. Then i used this command

composer require badusha/module-test @dev

To uninstall, i used this command

php bin/magento module:uninstall -r Badusha_Test

Uninstallation is successful but the table is not deleted.

Any help would be appreciable.

Thanks


texts: How to join field value from custom table entity to product listing (field in custom table must filterable)

texts:
My scenario
each product related to one merchant (simplest)

product have attribute merchant_id (int). This attribute not describe product, only field link to merchant table. merchan_id field associated with Merchant model

I have table merchant contain fields : entity_id (int -> value in product), merchant_id (unique string)

After magento 2.3.2 core team have updated

https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductCollection.php#L57

my field cannot filter anymore. So how is the correct way to add merchant_identifier field to product listing data ?

My Approach

  1 Create field to catalog product listing

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="product_columns">
    <column name="merchant_identifier">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="add_field" xsi:type="boolean">true</item>
                <item name="sorting" xsi:type="string">asc</item>
                <item name="editor" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Merchant Identifier</item>
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
    </column>
</columns>

  2 Preference catalog
  etc/adminhtml/di.xml

<preference for="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider" type="Vendor\CatalogMerchants\Ui\DataProvider\Product\ProductDataProvider" />

  3 Add my Provider extend Magento Provider

class ProductDataProvider extends \Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider

in construct add join only

public function __construct(
    //Dependencies
) {
    /*Join with merchant table.*/
    $this->collection->joinTable(
        ['merchant_tbl' => $this->collection->getTable('merchant')],
        "entity_id=merchant_id",
        ['merchant_identifier'=>'merchant_id'],
        null,
        'left'
    );
}

Here is how field show in catalog product listing

+-----------+------------+---------------------+
| entity_id | product_id | merchant_identifier |
+-----------+------------+---------------------+
|         1 |     123453 | merchant_ide123A_Af |
|         2 |     654657 | merchant_ide213A_Af |
|         3 |     345477 | merchant_ide312A_Af |
|         4 |     114673 | merchant_ide231A_Af |
+-----------+------------+---------------------+


texts: Add custom css class to each item in Topmenu - Magento 2

texts:
I'm looking for a way to add a custom css class to each menu item into the Topmenu.

I already tried to it using interceptor method in Topmenu

public function beforeGetHtml(
    \Magento\Theme\Block\Html\Topmenu $subject,
    $outermostClass = '',
    $childrenWrapClass = '',
    $limit = 0
) {
    $rootId = $this->storeManager->getStore()->getRootCategoryId();
    $storeId = $this->storeManager->getStore()->getId();
    /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */
    $collection = $this->getCategoryTree($storeId, $rootId);
    $currentCategory = $this->getCurrentCategory();
    $mapping = [$rootId => $subject->getMenu()];  // use nodes stack to avoid recursion
    foreach ($collection as $category) {
        if (!isset($mapping[$category->getParentId()])) {
            continue;
        }
        /** @var Node $parentCategoryNode */
        $parentCategoryNode = $mapping[$category->getParentId()];

        $categoryNode = new Node(
            $this->getCategoryAsArray($category, $currentCategory),
            'id',
            $parentCategoryNode->getTree(),
            $parentCategoryNode
        );
        $parentCategoryNode->addChild($categoryNode);

        $mapping[$category->getId()] = $categoryNode; //add node in stack
    }
}

and then:

private function getCategoryAsArray($category, $currentCategory)
{
    return [
        'name' => $category->getName(),
        'id' => 'category-node-' . $category->getId(),
        'class' => 'MY_CUSTOM_CLASS',
        'url' => $this->catalogCategory->getCategoryUrl($category),
        'has_active' => in_array((string)$category->getId(), explode('/', $currentCategory->getPath()), true),
        'is_active' => $category->getId() == $currentCategory->getId()
    ];
}

However the classes are added only to submenu items instead of add to parent as well.

Thank you!


texts: Magento 2: Get CMS Page content - from API

texts:
Hi all @magento developer,

I am using Magento inbuild API, domain.com/rest/V1/cmsPage/13

& the response is not like what I want.

{
    "id": 13,
    "identifier": "page2",
    "title": "Find Page",
    "page_layout": "1column",
    "meta_title": "",
    "meta_keywords": "",
    "meta_description": "",
    "content_heading": "Find a Rep",
    "content": "{{block class=\"Magento\\Cms\\Block\\Block\" block_id=\"rep_page\"}}",
    "creation_time": "2018-09-14 18:33:51",
    "update_time": "2019-05-29 18:58:29",
    "sort_order": "0",
    "layout_update_xml": "",
    "custom_theme": "",
    "custom_root_template": "",
    "active": true
}

In the above response, you can see  "content": "{{block class=\"Magento\\Cms\\Block\\Block\" block_id=\"rep_page\"}}",

& this block contains actual information of the page. So my question is if there is any way to get content of block_id = rep_page withpout using another API /rest/V1/cmsBlock/{block_id}.


texts: Magento 1.9 cache permissions being set as 777

texts:
I am getting an issue with Magento where my cache files are being set to 777 every time I re-cache the site.

Is this standard behavior as it seems to be wrong to me, as far as I know no file should ever be set to 777 as it's a security hole.

If this is not the case does anyone know how I can stop this from happening?


texts: Getting 404 cms_wysiwyg directive image URL

texts:
I noticed in the Magento CMS editor TinyMCE, the image thumbnails are set as the following format after a base64 encode of the shortcode {{media url="wysiwyg/foobar.gif"}}

index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l...

This is happening on nginx and not on apache. Perhaps it's an environmental issue however my question aims to solve this on the Magento layer.

My question is, how does Magento decode this ___directive... URL? and where?


texts: how to reterieve all the images of a product using api?

texts: need some sample code for the retrieving the images from magento. I always see the search results in php but not anything in java.


texts: Magento connect not showing available update

texts:
We have a client with an old Magento version 1.7.0.0 we wanted to upgrade this version to the latest version.

So what we did is made a copy to a our test environment, used Magento connect manager and updated it to the latest version 1.9.2.4. worked liked a charm.

The client tested this environment and everything was correct.

Now we wanted to update the original site to this version. But when we logged in we saw that the version in Magento connect manager showt that this was version 1.9.2.4.

How is this possible? Can it be that with the use of Magento Connect Manager that our test server somehow stored at magento our latest installed version with the secret key?

After this I tried using the following solution:

chmod 550 mage ./mage mage-setup . ./mage config-set preferred_state stable ./mage sync ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force php shell/indexer.php reindexall rm -rf downloader/.cache/ var/cache/

But this didn't work at all and gave me tons of errors so we placed back a backup.


texts: Why does an order say processing on Magento when a customer pays by bank transfer?

texts:
When a customer pays by bank transfer on a Magento checkout, why does the order say it is 'processing' even though the payment has not been made yet.

I have set up in the Magento configuration to say 'pending payment' when an order is placed by bank transfer but for some reason it keeps says 'processing' in the actually order.

Is there any way this can be changed?


texts: The custom function is returning error when added in a controller

texts:
I have a custom function in a controller file, the function basically is to be used for converting the time into a different custom format, for example, if the time is indicating the date of yesterday, it shows "1 day ago".

In any case, this is how I added the function in my controller file:

private function changeDate($datetime)
{
    $now = new DateTime;
    $ago = $datetime;
    $diff = $now->diff($ago);

    $diff->w = floor($diff->d / 7);
    $diff->d -= $diff->w * 7;

    $string = array(
        'y' => 'year',
        'm' => 'month',
        'w' => 'week',
        'd' => 'day',
        'h' => 'hour',
        'i' => 'minute',
        's' => 'second',
    );
    foreach ($string as $k => &$v) {
        if ($diff->$k) {
            $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');
        } else {
            unset($string[$k]);
        }
    }
    return $string ? implode(', ', $str,ing) . ' ago' : 'just now';
}

The function itself works fine, for example, I used it in some PHTML file and there was no issue, but when I use it in a controller PHP file, it returns an error.

I have checked the error log and this is the error:

Fatal error:  Uncaught Error: Class 'vendor\module\Controller\Customizer\DateTime' not found in /Users/folder/mag/app/code/vendor/module/Controller/Customizer/finalize.php:108

I am very new to Magento, and it is definitely a user error, but I am not sure what I am doing wrong, any help is greatly appreciated.


texts: Proper method of adding column to table?

texts:
I am extending promo coupon labels so that I can define a failed label that would display when coupons fail to apply. So far I have been able to add the fields using:

class Module_Promomod_Block_Adminhtml_Promo_Quote_Edit_Tab_Labels extends Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels
{

    protected function _prepareForm()
    {
    $rule = Mage::registry('current_promo_quote_rule');
    $form = new Varien_Data_Form();
    $form->setHtmlIdPrefix('rule_');

    $fieldset = $form->addFieldset('default_label_fieldset', array(
        'legend' => Mage::helper('salesrule')->__('Default Label')
    ));
    $labels = $rule->getStoreLabels();
    $fieldset->addField('store_default_label', 'text', array(
        'name' => 'store_labels[0]',
        'required' => false,
        'label' => Mage::helper('salesrule')->__('Default Rule Label for All Store Views'),
        'value' => isset($labels[0]) ? $labels[0] : '',
    ));

    $labels = $rule->getStoreLabels();
    $fieldset->addField('store_default_failed_label', 'text', array(
        'name' => 'store_failed_labels[0]',
        'required' => false,
        'label' => Mage::helper('salesrule')->__('Default Label for failed coupon attempts - All Store Views'),
        'value' => isset($labels[0]) ? $labels[0] : '',
    ));

    $fieldset = $form->addFieldset('store_labels_fieldset', array(
        'legend' => Mage::helper('salesrule')->__('Store View Specific Labels'),
        'table_class' => 'form-list stores-tree',
    ));
    $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset');
    $fieldset->setRenderer($renderer);

    foreach (Mage::app()->getWebsites() as $website) {
        $fieldset->addField("w_{$website->getId()}_label", 'note', array(
            'label' => $website->getName(),
            'fieldset_html_class' => 'website',
        ));
        foreach ($website->getGroups() as $group) {
            $stores = $group->getStores();
            if (count($stores) == 0) {
                continue;
            }
            $fieldset->addField("sg_{$group->getId()}_label", 'note', array(
                'label' => $group->getName(),
                'fieldset_html_class' => 'store-group',
            ));
            foreach ($stores as $store) {
                $fieldset->addField("s_{$store->getId()}", 'text', array(
                    'name' => 'store_labels[' . $store->getId() . ']',
                    'required' => false,
                    'label' => $store->getName(),
                    'value' => isset($labels[$store->getId()]) ? $labels[$store->getId()] : '',
                    'fieldset_html_class' => 'store',
                ));
            }
        }
    }

    if ($rule->isReadonly()) {
        foreach ($fieldset->getElements() as $element) {
            $element->setReadonly(true, true);
        }
    }

    $this->setForm($form);
    //return parent::_prepareForm();
}

}

It seems like the best place to add the field would be in the salesrule_label as an additional column called something like  "apply_failed_label". Is there an equivalent to $installer = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer->startSetup(); $installer->addAttribute('catalog_product',... that I could use to accomplish this when the module is installed?


texts: Magento 1.9.3.2 - attribute showing in backend for only one category

texts:
Today I added two new attributes, assigned to the default attribute set.

Scope: Global, Apply To: All Product Types, Visible on view: Yes, Used in Product Listing: Yes

I was happily implementing and testing and everything was working fine for the one product I was testing - attributes were showing both back end and front end and even got a view.phtml edit to display a attribute dependent static block working.

THEN I checked/edited another product, and the attributes where not visible in the back end for that product.

I then checked other products and  - only products in the original category of the one product I was testing on are showing the attributes.  No other products in any other category.

I tried moving the attributes from 'General' to 'Price' group and they move in the back end the products they were already working ok (that single category) however are still not showing on any other product.

I have cleared cache both back end and manual, re-index multiple time and no joy.

It feels like I am missing something simple but I just can not work it out.  I have checked and cant see any way that I may have mistakenly limited the attribute to a category and just can not work out what is going on.

Any thoughts or assistance would be greatly appreciated.


texts: Show Price Range of Simple Product having Custom Option instead of Base Price

texts:
I am working on Magento 1.9.2.4 and I have to show some simple products on the home page but their price should be displayed in the format of Price: minimum_price To maximum_price instead of base price.

Suppose I have a product in the admin panel with name Gwyneth Basket

Its base price 0
And Under the custom option, I create a drop-down Like

Now in the frontend, I have to show Gwyneth Basket product like

It working as desired on category page using This Reference But how do I achieve this on custom templates.

Thank You


texts: Magento2 get product options and price object in custom javscript

texts:
How can i get the product custom options and price object in my custom javascript.

I would like to modify the product price on quantity change and also  need to update the price of custom options based on the quantity.


texts: Magento - How can I filter display same name product?

texts:
I import the +8000 product on Magento 1.9.1 through Import data flow,
and all products created as simple product and most of them are repeated by the same name but the attribute of size is different and I create the connection between them via upsell product.

For example  product "BITZ POULTICE BOOT"  have 2 different size from  size attribute  views and with upsell option I selected all  of them for each one and now in catolog displaye 2 item from "BITZ POULTICE BOOT" with same name.
how can I filter catalog display as the name just display one of same name product, mean from product "BITZ POULTICE BOOT" just show one of them not all.

by the way, from the first I did not have the option to use bundle product or group because there was 8000 item need to import our database .

Is there any chance to filter the same name product and display just one of them ( no matter which one)


texts:
I want to send all the user the reset password email, we have over 6000 user so it can't be done by hand.

I found this script from this website:

    <?php
    //place this before any script you want to calculate time
    $time_start = microtime(true);

    // MAGENTO START
    include('app/bootstrap.php');

    use Magento\Framework\App\Bootstrap;
    use Magento\Customer\Api\AccountManagementInterface;
    use Magento\Customer\Model\AccountManagement;

    $bootstrap = Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();

    $state = $objectManager->get('Magento\Framework\App\State');
    $state->setAreaCode('frontend');

    $_customers = $objectManager->create('Magento\Customer\Api\AccountManagementInterface');
    $customerCollection = $objectManager->create('Magento\Customer\Model\ResourceModel\Customer\Collection');
    $customerCollection->load();
    $i = 0;
    foreach ($customerCollection as $customers) {

        $email = $customers->getData('email');

        try {
                $_customers->initiatePasswordReset($email, AccountManagement::EMAIL_RESET);
            } catch (NoSuchEntityException $e) {
                // Do nothing, we don't want anyone to use this action to determine which email accounts are registered.
            } catch (\Exception $exception) {
                echo __('We\'re unable to send the password reset email.');
            }
            echo "<pre>";
            echo $i . " Email :-" . $email . " Mail Sent";
        $i++;
    }
?>

But that isn't working :(

Is there a way to make this script work or maybe another solution?


texts: How can i get product id on product page without registry? Such as class registry is deprecated in magento 2.3


texts: How can i hide specific shipping method for specific customer group in magento 2

texts:
i want to make one custom module in that i set customer group and shipping method than that particulate customer group hide that shipping method

can any one help me how can i do that.


texts: magento 2 installation on MAMP. none of the pages work

texts:
I installed MAMP on a MAC PRO.

I then successfully installed magento 2.

The Homepage works. However none of the other pages seem to work. They  all returns a

Not Found
The requested URL /magentotwo/customer/account/create/ was not found on this server.

I presume this might have something to do with the module-rewrite of apache etc.

i did place the following in my apache

httpd.conf :

NameVirtualHost *:80

<VirtualHost *:80>
ServerName magento.com
DocumentRoot /Applications/MAMP/htdocs/magentotwo
</VirtualHost>

EDIT;

when i place an index.php after the base url it works; i.e

  http://localhost:8888/magentotwo/index.php/customer/account/create/

However, i am still not able to log into admin. so this does not work:

  http://localhost:8888/magentotwo/index.php/admin

i am also not able to change my host address to just:

  http://localhost/magentotwo/index.php/customer/account/create/

Is there something else that needs to done in MAMP/htaccess files for mamp  that i am missing i am missing.

I previously  used WAMP the pages worked by default.

SECOND EDIT---

i tried the following but it still does not work:

in my config i placed the following
 httpd.conf :
NameVirtualHost *:80

ServerName magento.dev
DocumentRoot /Applications/MAMP/htdocs/magentotwo
<Directory "/Applications/MAMP/htdocs/magentotwo">
    AllowOverride All
    Allow from all
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
    </IfModule>
</Directory>
</VirtualHost>

i then sudo vi into my host files and changed local host i,e

sudo vi /etc/hosts

and then changed

  127.0.0.1       localhost magento.dev

i then tried to access site at

  http://magento.dev/

and

  https://localhost/magento.dev/

but nothing appears

error message;
This site can’t be reached localhost refused to connect.


texts: Integration tests - error when connecting to the database

texts:
I'm having trouble running the magento2 integration tests.

I followed the documentation and set up the database parameters in install-config-mysql.php :

'db-host' => 'mysql:3306',
'db-user' => 'magento2_test',
'db-password' => 'test_user_password',
'db-name' => 'magento2_test',

And when I run phpunit, I get the following:

PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

S.R.......PHP Fatal error:  Uncaught Zend_Db_Adapter_Exception: Port must be configured within host parameter (like localhost:3306 in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:393
Stack trace:
#0 /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(861): Magento\Framework\DB\Adapter\Pdo\Mysql->_connect()
#1 /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(1189): Zend_Db_Adapter_Abstract->quote('sequence_order_...')
#2 /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(2626): Magento\Framework\DB\Adapter\Pdo\Mysql->showTableStatus('sequence_order_...', NULL)
#3 /var/www/html/dev/tests/integration/framework/Magento/TestFramework/Db/Sequence.php(58): Magento\Framework\DB\Adapter\Pdo\Mysql->isTableExists('sequence_order_...')
#4 /var/www/html/dev/tests/integration/framework/Magento/TestFramework/Application.php(420): Magento\TestFramework\Db\Sequence->generateSequences()
#5 /var/www/html/dev/tests/integration/framework/Magento/TestFramework/Application.php(436): M in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 393

=== Memory Usage System Stats ===
Memory usage (OS):      605.15M (100.86% of 600.00M reported by PHP)
Estimated memory leak:  5.15M (0.85% of used memory)

My database runs in a separate container linked to the website container. I can connect to mysql from the website container using cli.

That error seems odd since the port is indeed configured within the host parameter.

I have disabled the memory limit in my phpunit.xml with this line given in the documentation

<ini name="memory_limit" value="-1"/>

What could be wrong with my setup ?


texts: Magento 2 Rest API get Quote Item Custom Option values

texts:
Hi I have tried with the magento 2 rest apis

1) V1/orders/:order-id

2) V1/orders/items with serach filter order id

3) /V1/carts/:quoteid/items

The above apis are not returning the Order item custom product attribute values. When i checked the DB i can see the values i entered while add the product to cart in the DB table quote_item_option, however i cannot retrieve those values via the api.

Can anyone please help to attain the values with the correct api ?


texts: Bundled product on configurable product page

texts:
So, on Product Detail Page of configurable product, I need to show some bundle product with options, button to buy,  and so on.

Now on this page I have an object of bundled product. The question: is there are any method to show this product with all I need?

My idea , looking at layout bundle.xml is to implement all in PRODUCT_TYPE_bundle node, but I think there are another ways.


texts: Remove render-blocking JavaScript for google maps

texts:
The PageSpeed Insights shows me that I to remove the render-blocking for my google maps js.
It is added the in cms content and this is the code:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=myipcode">// <![CDATA[

// ]]></script>
<script type="text/javascript">// <![CDATA[
function initialize() {
  var myLatlng = new google.maps.LatLng(mycoord1, mycoord2);
  var mapOptions = {
    zoom: 17,
    center: myLatlng
  }
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

  var marker = new google.maps.Marker({
      position: myLatlng,
      map: map,
      title: 'My Title'
  });
}

google.maps.event.addDomListener(window, 'load', initialize);
// ]]>

If I add the async="async" to the  the maps is not loaded but the message from the pagespeed disappers. What should I do ?


texts: How to get used product having attribute size value is L (large)

texts:
$product = Mage::getModel('catalog/product')
                ->load($this->getProduct()->getId());

    /**
     * Get child products id (only ids)
     */
    $childIds = Mage::getModel('catalog/product_type_configurable')
                    ->getChildrenIds($product->getId());

    /**
     * Get children products (all associated children products data)
     */
    $childProducts = Mage::getModel('catalog/product_type_configurable')
                    ->getUsedProducts(null, $product);

    /**
     * Get children products as collection
     * And, select all attributes like name, description, price, etc.
     */
    $childProducts = Mage::getModel('catalog/product_type_configurable')
                    ->getUsedProductCollection($product)
                    ->addAttributeToSelect('size')
                    ->addAttributeToFilter(array(array('attribute'=> 'size','eq' => 'L')));

    var_dump($childProducts->count());die;


texts: Magento 2 URL Key field would generate a URL that already exists

texts:
I'm trying to move my Category Wincomm but I keep getting this message.

I have 2 Store Views and I have changed the url using Marketing -> URL Rewrites but the message keeps returning. I've also tried to delete the category and re-import it but that didn't work.
I have checked these solution but they didn't work.

URL key for specified store already exists Magento 2

The value specified in the URL Key field would generate a URL that already exists

M2: The URL key for the selected store already exists


texts:
I have my store setup and ready to work with it. When I'm going to make a test order, I noticed that Magento is sending the confirmation email multiple times, doesn´t stop sending. I'm receiving the emails two by two.

And I've noticed that an exception is being thrown in exception.log:

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (message_id='3')' at line 1, query was: UPDATE `core_email_queue` SET  WHERE (message_id='3')' in /home/newolders/public_html/store/lib/Zend/Db/Statement/Pdo.php:235
Stack trace:
#0 /home/newolders/public_html/store/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/newolders/public_html/store/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/newolders/public_html/store/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/newolders/public_html/store/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE `core_em...', Array)
#4 /home/newolders/public_html/store/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `core_em...', Array)
#5 /home/newolders/public_html/store/lib/Zend/Db/Adapter/Abstract.php(635): Varien_Db_Adapter_Pdo_Mysql->query('UPDATE `core_em...', Array)
#6 /home/newolders/public_html/store/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(433): Zend_Db_Adapter_Abstract->update('core_email_queu...', Array, 'message_id='3'')
#7 /home/newolders/public_html/store/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Core_Model_Email_Queue))
#8 /home/newolders/public_html/store/app/code/core/Mage/Core/Model/Email/Queue.php(244): Mage_Core_Model_Abstract->save()
#9 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#10 /home/newolders/public_html/store/app/code/core/Mage/Cron/Model/Observer.php(325): call_user_func_array(Array, Array)
#11 /home/newolders/public_html/store/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#12 /home/newolders/public_html/store/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#13 /home/newolders/public_html/store/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#14 /home/newolders/public_html/store/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#15 /home/newolders/public_html/store/cron.php(76): Mage::dispatchEvent('default')
#16 {main}

Could anyone help me?


texts: Call to member function error - please help!

texts:
I am trying to fix an error with an extension.  The error appears when you are in admin and changing a customer's password.  The new password does get saved in the database, but the page throws this error:

  Call to a member function getStoreId() on a non-object in
  /home/demo/public_html/naagtag/app/code/local/FME/Invoice/Model/Order/Pdf/Order.php

Here is the code on that phtml:

class FME_Invoice_Model_Order_Pdf_Order extends Mage_Sales_Model_Order_Pdf_Invoice
{

    public function getPdf ($orders = array())
    {
       // print_r($orders);exit;
        $this->_beforeGetPdf();
        $this->_initRenderer('invoice');

        $pdf = new Zend_Pdf();
        $this->_setPdf($pdf);
        $style = new Zend_Pdf_Style();
        $this->_setFontBold($style, 10);

        foreach ($orders as $order) {
            if ($order->getStoreId()) {
                Mage::app()->getLocale()->emulate($order->getStoreId());
                Mage::app()->setCurrentStore($order->getStoreId());
            }
            $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
            $pdf->pages[] = $page;

            /* Add image */
            $this->insertLogo($page, $order->getStore());

            /* Add address */
            $this->insertAddress($page, $order->getStore());

            /* Add head */
            $this->insertOrder($page, $order, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId()));

            $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
            $this->_setFontRegular($page);
           // $page->drawText(Mage::helper('sales')->__('Order # ') . $order->getIncrementId(), 35, 780, 'UTF-8');

            /* Add table */
            $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
            $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
            $page->setLineWidth(0.5);

            $page->drawRectangle(25, $this->y, 570, $this->y -15);
            $this->y -=10;

            /* Add table head */
            $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
            $page->drawText(Mage::helper('sales')->__('Products'), 35, $this->y, 'UTF-8');
            $page->drawText(Mage::helper('sales')->__('SKU'), 255, $this->y, 'UTF-8');
            $page->drawText(Mage::helper('sales')->__('Price'), 380, $this->y, 'UTF-8');
            $page->drawText(Mage::helper('sales')->__('Qty'), 430, $this->y, 'UTF-8');
            $page->drawText(Mage::helper('sales')->__('Tax'), 480, $this->y, 'UTF-8');
            $page->drawText(Mage::helper('sales')->__('Subtotal'), 535, $this->y, 'UTF-8');

            $this->y -=15;

            $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));

            /* Add body */
            foreach ($order->getAllItems() as $item) {
                if ($item->getParentItem()) {
                    continue;
                }

                if ($this->y < 15) {
                    $page = $this->newPage(array('table_header' => true));
                }

                /* Draw item */
                //temporarily set item as if we were printing an invoice
                $item->setQty($item->getQtyOrdered());
                $item->setOrderItem($item);
                $page = $this->_drawItem($item, $page, $order);
            }

            /* Add totals */
            $order->setOrder($order);
            $page = $this->insertTotals($page, $order);

            if ($order->getStoreId()) {
                Mage::app()->getLocale()->revert();
            }
        }

        $this->_afterGetPdf();

        return $pdf;
    }

}


texts: Get all product descriptions and then update it

texts: i want to get the description of all products in the magento store for all stores. After that i want to change something in the description and update that description in the database. Is this possible? how does the SQL query looks like?


texts:
I want to add header links in magento Blank Theme

Default.xml

<referenceBlock name="top.links">
      <block class="Magento\Framework\View\Element\Html\Link" name="new.link" after="register-link">
        <arguments>
            <argument name="label" xsi:type="string" translate="false">New Link</argument>
            <argument name="path" xsi:type="string" translate="false">newlink</argument>
        </arguments>
      </block>
 </referenceBlock>

i have added top.links because its blank theme.
after that i ran all CLI command. but link is not displaying on frontend.


texts: Unable to read version 4 table /var/www/html/magento217/vendor/magento/zendframework1/library/Zend/Pdf/Font.php(615)

texts:
I have a problem in Arabic characters in invoice pdf print(they are separated and reversed).
I am trying to use the Noto fonts https://www.google.com/get/noto/
but I got this error:

a:4:{i:0;s:30:"Unable to read version 4 table";i:1;s:5227:"#0
/var/www/html/magento217/vendor/magento/zendframework1/library/Zend/Pdf/Font.php(615):
Zend_Pdf_Font::_extractTrueTypeFont(Object(Zend_Pdf_FileParserDataSource_File),
0)
1 /var/www/html/magento217/app/code/Rossmc/SalesPdfFonts/Model/Order/Pdf/SetFontTrait.php(43):
Zend_Pdf_Font::fontWithPath('/var/www/html/m...')

Can any body help ..


texts:
In Magento 2 ui_compoments were introduced to describe grids and forms.

However I would like to know which class of magento converts for example the file:

  vendor/magento/module-customer/view/base/ui_component/customer_form.xml

For the .phtml template

So at this point I check if a post is allowed to change a field.


texts: Magento 2 Minimum Order Amount per User Account

texts: Does anybody know a extension or a way to apply a minimum order amount per user account? The default minimum order amount feature only works per the entire site and I alo found plenty of extensions that go by Customer Group, but I want to set it specifically per User Account.


texts: Magento 2 Calling phtml file using controller

texts:
Hi am trying to call a phtml file using controller below is my code and i dont know why it is not working
Index.php
<?php
namespace Vendor\Module\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action
{

    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory;

    protected $requestforquoteFactory;

    protected $requestforquote;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Vendor\Module\Model\RequestForQuoteFactory $requestforquoteFactory,
        \Vendor\Module\Model\RequestForQuote $requestforquote
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        $this->requestforquoteFactory = $requestforquoteFactory;
        $this->requestforquote = $requestforquote;
        parent::__construct($context);
    }

    public function execute()
    {

        $resultRedirect = $this->resultRedirectFactory->create();

        try{

            $request = $this->getRequest()->getParams();
            $name = $request['name'];
            $company = $request['company'];
            $phonenumber = $request['phonenumber'];
            $email = $request['email'];
            // $email = $request['email'];
            $gstnumber = $request['gstnumber'];

            $requestforquote = $this->requestforquoteFactory->create();

             $requestforquote->setName($name);
             $requestforquote->setCompany($company);
             $requestforquote->setPhoneNumber($phonenumber);
             $requestforquote->setGSTNumber($gstnumber);
             $requestforquote->setEmail($email);
             $requestforquote->save();

            $message = __('Thank you! Your Quote Has Been Submitted');
            $this->messageManager->addSuccessMessage($message);

            $this->resultPageFactory->create();
           // return $resultRedirect->setPath('requestforquote/index/index');
            $this->getResponse()->setBody($block);
            $this->_view->renderLayout();
            $this->_view->loadLayout();

        }catch (\Exception $e){
            $this->messageManager->addException($e, __('We can\'t submit your request, Please try again.'));
            $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e);
            //return $resultRedirect->setPath('requestforquote/index/index');
        }

    }

    public function test(){

        //$resultPage = $this->_resultPageFactory->create();
        $block = $resultPage->getLayout()
                ->createBlock('Vendor\Module\Block\Rfq')
                ->setTemplate('Vendor_Module::rfq_form.phtml')
                ->toHtml();
        $this->getResponse()->setBody($block);
         $this->_view->renderLayout();
        $this->_view->loadLayout();
    }

}
?>

am getting a blank page when i hit controller


texts: Magento 2 German Language Pack Problem - fresh Magento 2.3.1 with docker-compose on Ubuntu 18.04 LTS

texts:
I had problem with Mageplaza German Lanuage Pack. I have recently installed Magento 2.3.1 with docker-compose on Ubuntu 18.04 LTS. I tried to install language pack using composer.

My Magento Installation folder is /var/www/mag

First step is was to start docker-compose so I write in terminal:

dokcer-compose start

And got result:

Then I use command:

composer require mageplaza/magento-2-german-language-pack:dev-master

And got result:

Then I use command:

bin/magento setup:static-content:deploy de_DE

And got result:

So I decided to use command:

bin/magento setup:static-content:deploy -f de_DE

And got result:

Then I use command:

bin/magento indexer:reindex
bin/magento cache:clean
bin/magento cache:flush

And got successful result no errors. Then I go to admin panel Stores/Configuration/Genral/Locale Options and select Germany

Then flush cache and there is no Germany translations on frontend page.
After installation via composer I've got new folder showing in PHPStorm:

Did I do something wrong ?

Thanks in advance!


texts: What is the a good phone order extension?

texts:
We used to be on Volusion and their phone order page was quite nice. If someone called in to place an order we could add products to a cart from the admin side, edit prices for the customer and enter products that did not actually exist in our store. For example if they wanted to place an order for a really old part we could look up the part in a catalog and then enter it in the cart for them.

What extensions out there have people used that enable them to do these things? We've tried a couple and haven't had much luck.


texts: Programmatic category update not taking effect until Save in Admin

texts:
I have a script that looks something like

$parent = Mage::getModel("catalog/category")->load(50);
$parent->setCustomUseParentSettings(false);
$parent->setCustomApplyToProducts(false);
$parent->setPageLayout("two_columns_left");
$parent->save();

And when I look at the category in Manage Categories of the Admin, I can see that the values updated correctly, but when I look on the frontend, I see it's still using a different layout.

All I do then is click "Save" without modifying anything, and then it renders correctly on the front page.

I've tried reindexing Category Flat tables, but this is the only way I've been able to fix this.  There's ~2000 categories so saving them all isn't a solution.  How can I do this programmatically? Why doesn't it work in the first place?


texts: text swatch now showing out of stock Magento 2

texts:
Setting up configurable products and using the text swatch option to select shirt sizes. The issue is the out of stock shirt text swatches are still showing up, clickable, and have not styling to show that they are out of stock. I'd like the swatch to still show up, but not be clickable and appear faded out or something so you know they are out of stock. Any help?

I'm not seeing any class for out of stock being passed through that I can style with CSS. This is the line that shows up:

3XL

Thoughts?


texts: Magento2.3.2: decrease stock quantity on invoice generate

texts:
I created the module for.

1. Decrease Stock quantity  when  invoice  generate and
2. decrease of salable quantity and actual stock" after creating the ship.

But the module is not working properly actually salable quantity decrease twice after invoice generate and stock quantity also decrease twice after ship generate. Now to proper decrement of stock and salable I added code $qty=0; in line number 89 in file/vendor/magento/module-inventory-source-deduction-api/Model/SourceDeductionService.php.
How can I override it in my below module obsever.php
any minor help will be appreciated
here my module.
Meetanshi/Extension/registration.php

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

Meetanshi/Extension/etc/module.xml

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

Meetanshi/Extension/UpdateInventory.php

<?php
        namespace Meetanshi\Extension\Observer;
        use Magento\Framework\Event\ObserverInterface;
        use Magento\Framework\Event\Observer;
        use Magento\CatalogInventory\Api\StockRegistryInterface;
        use Magento\Catalog\Model\ProductRepository;
        class UpdateInventory implements ObserverInterface
        {
            protected $productRepository;
            protected $stockRegistry;
            public function __construct(
                ProductRepository $productRepository,
                StockRegistryInterface $stockRegistry
            )
            {
                $this->productRepository = $productRepository;
                $this->stockRegistry = $stockRegistry;
            }
            public function execute(Observer $observer)
            {
                try {
                    $invoice = $observer->getEvent()->getInvoice();
                    $invoiceItems = $invoice->getAllItems();
                    foreach ($invoiceItems as $item) {
                        $productId = $item->getProductId();
                        $product = $this->productRepository->getById($productId);
                        $sku = $product->getSku();
                        $stockItem = $this->stockRegistry->getStockItemBySku($sku);
                        $qty = $stockItem->getQty() - $item->getQty();
                        $stockItem->setQty($qty);
                        $stockItem->setIsInStock((bool)$qty);
                        $this->stockRegistry->updateStockItemBySku($sku, $stockItem);
                    }
                } catch (\Exception $e) {
                    return $e->getMessage();
                }
            }
        }

Meetanshi/Extension/etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
        <event name="sales_order_invoice_save_after">
            <observer name="Meetanshi_sales_order_invoice_save_after" instance="Meetanshi\Extension\Observer\UpdateInventory"/>
        </event>
</config>


texts:
How to override Plumrocket_CartReservation/js/prcr file in the local module not in theme
var config = {
    map: {
        '*': {
            'prcr': 'Plumrocket_CartReservation/js/prcr',
            'prcrCountdown': 'Plumrocket_CartReservation/js/jquery.countdown'
        },
    },

    shim: {
        'Plumrocket_CartReservation/js/jquery.countdown': {
            deps: ['jquery', 'Plumrocket_CartReservation/js/jquery.plugin']
        },
        'Plumrocket_CartReservation/js/jquery.plugin': {
            deps: ['jquery']
        }
    }
};

I tried below code but not it's not working.
Module path:app/code/Vendor/PlumRocket/view/frontend/requirejs-config.js
var config = {
    map: {
        "*": {
            'prcr': 'Vendor_PlumRocket/js/prcr'
        }
    }
};

Or
var config = {
        map: {
            "*": {
                'Plumrocket_CartReservation/js/prcr': 'Vendor_PlumRocket/js/prcr'
            }
        }
    };

but both method not working.


texts: Sync Magento 2 Customer & Orders data to external mysql database

texts:
I want to take data from Magento 2 DB to another custom MySQL database. What are the possible solutions?
Should I use Magento provided APIs? The issue I see in this approach is when and at what time should I call the API to sync data? If I call it constantly it will put the load on my Magento DB and server.
If I use the API to take data first time then how will I know that there is some update in already synced data? How would I do that then?


texts:
Version: Magento2.3.4-P2 ECE
Issue: Customer sees two orders with the same details within 3 minutes.
Two transactions happened. But the order placed only one time.
Paypal through Braintree payment method used.
Findings: Two quotes are displayed with diff quotes created time and diff reserved_order_id.
So how can be 2 quotes active at the same time for the customers?
All the order details are same with Ip.


texts:
I'm using this extension:

Ajax Cart Popup

It works fine, but there is a problem of updating items counter which renders together with mini cart icon in the header.

With original developers help on GitHub I've figured out how it works. It takes cart complete link with count span strips out everything except value within that span element and after updates using js.

My problem is here (module controller):

    private function _getLinkText()
{
    if ($block = $this->getLayout()->getBlock('cart_header')):
        $cartlink = $block->toHtml();
        preg_match('/<a.+skip-cart.+>(.+)<\/a>/Us', $cartlink, $linktext);
    else:
        $toplinks = $this->getLayout()->getBlock('cart_header')->toHtml();
        preg_match('/<a.+top-link-cart.+>(.+)<\/a>/Us', $toplinks, $linktext);
    endif;

    return $linktext[1];
}

Regex pattern match should give something like:

`<span class="label"><i class="fa fa-cart-arrow-down fa-2x"></i></span><span class="count">11</span>`

However $linktext var which should contain the complete link is always null which I can see from JSON key in debugger. That why I get no update of counter.
I think the right Block is loaded (cart_header), at least Magento Debugger Tool says so, but for some reason there is no matching pattern from that function.
Could it be that Block is not loaded at he right time which I find very unlikely since ajax calls are made after the whole page has been loaded?
Any other ideas?


texts: why magento doesn't enable flat model by default?

texts:
we can see that the following two options at

system > configuration > system > catalog

1.Use Flat Catalog Category

2.Use Flat Catalog Product

it is clear that the flat model reduces the database operations and increase efficiency then why magento can use it by default

is there any reason magento can't enable this option by default , and remove these from system > configuration > system > catalog ?

is it needed for any reasons?


texts:
I have tried to install magento 2.2 version in my localhost.

But when I complete whole steps home page shows blank screen.

So Can some one help me into this ?


texts: "%fieldName is a required field.", in Magento2 REST API Call for GET Method Type

texts:
Calling this http://localhost/XXX/rest/V1/XXX/uid/2

and My Model Code is

/**
     * Returns greeting message to user
     *
     * @api
     * @param int $uid User Id.
     * @return string Greeting message with users name.
     */

    public function test($uid)
    {
return $uid;
}

and My Interface like

/**
     * Returns greeting message to user
     *
     * @api
     * @param int $uid.
     * @return string Greeting message with users name.
     */
    public function test($uid);

In webApi.xml

 <route url="/V1/XXX/uid/:id" method="GET">
            <service class="XXX\XXX\Api\XApiInterface" method="XXX"/>
            <resources>
                <resource ref="anonymous"/>
            </resources>
        </route>


texts:
While using Magento default rest API (/rest/V1/cmsBlock/1) to fetch blocks content it returns as
{
"id": 1,
"identifier": "main_menu",
"title": "Main Menu",
"content": "{{widget type="CleverSoft\CleverMegaMenus\Block\Widget\Megamenu" menu="main_menu"}}",
"creation_time": "2017-07-14 09:44:12",
"update_time": "2017-11-02 14:47:31",
"active": true
}
How can I get content in that widget?
Thanks.


texts:
For some peculiar reason the upsell's on my product pages all have the same product url as the first upsell.

We are using Varnish for caching and I have added the esi to the upsell block in local.xml but still the issue persists.

Does anyone know why this is happening?

Code:

<?php if(count($this->getItemCollection()->getItems())): ?>

<?php echo $this->__('You may also like...') ?>

    <?php $this->resetItemsIterator() ?>
    <?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
        <?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
            <?php if($_link=$this->getIterableItem()): ?>
            <?php $_product= Mage::getSingleton('catalog/product')->load($_link->getId()) ?>

                <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
                                        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(162,162); ?>" width="162" height="162" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php $_product->getName() ?>"><?php echo $_product->getName() ?>

                <?php if($_product->getShortDescription()): ?>

<?php echo $_product->getShortDescription() ?>

                                <?php endif; ?>

                    <?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
                    <?php if($_product->isSaleable()): ?>
                                                <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>
                    <?php endif; ?>

            <?php endif; ?>
        <?php endfor; ?>
    <?php endfor; ?>

<?php endif ?>


texts: How do I remove recently view products from list view using XML?

texts:
this is my xml code:

    <catalog_category_default>
     <remove name="right.reports.product.viewed" />
    </catalog_category_default>

I am trying to remove the recently viewed products from all category and subcategories pages. How can I do that?


texts: Magento 2 has stopped showing related products on front end product page

texts:
Our related products are not showing on the front end no longer. They did and looked good however it does not work no more.

Can anyone help?


texts: Magento 2.3.1 - Luma Theme - Feature Product Noob Way

texts:
So Magento luma theme has a build-in featured product shown at the home page

How do I put the new product as featured?

In Magento 1 / Wordpress it's as simple as click STAR button at product catalog backend

Is there such a simple method for Magento 2.3.1?


texts:
I get the following when using my controller through a front end route.

  Fatal error: Uncaught TypeError: Argument 1 passed to
  Namespace\Module\Controller\Index\Index::__construct() must be an
  instance of Magento\Framework\App\Action\Context, instance of
  Magento\Framework\ObjectManager\ObjectManager given, called in
  /website-magento-2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
  on line 93 and defined in
  /Projects/Work/website-magento-2/app/code/Namespace/Module/Controller/Index/index.php:45
  Stack trace: #0
  //Projects/Work/website-magento-2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93):
  Namespace\Module\Controller\Index\Index->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))

  #1 /Projects/Work/website-magento-2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88):
  Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Namespace\Module...',
  Array) #2
  /Projects/Work/website-magento-2/vendor/magento/framework/ObjectManager/ObjectManager.
  in
  /Projects/Work/website-magento-2/app/code/Namespace/Module/Controller/Index/index.php
  on line 45

Controller construct

public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        Customer $customer,
        CustomerSession $customerSession,
        Session $catalogSession
    ){
        $this->resultPageFactory = $resultPageFactory;
        $this->context = $context;
        $this->customer = $customer;
        $this->customerSession = $customerSession;
        $this->catalogSession = $catalogSession;

        parent::__construct($context);

    }

I have seen posts about this issue and the resolution is that I delete and regenerate var/di, createCharge, var/cache.   However this isn't working.


texts: I want to build a controller for ckfinder which im using for ckeditor. Because when i call it now, i get "ForbiddenYou don't have permission to access this resource." But i dont know how to tackle the problem on how to build one. I know the basic file structure of a controller.


texts: Need to add a custom link “Kids” in header and open different design/layout/css in Magento 2

texts:
Need to add a custom link "Kids" in header, when click on kids link, then website menus and home page design/layout/css and url should be changed new url would be (www.site.com/kids).
Category page url like : www.site.com/kids/category.phtml product url should be like : www.site.com/product-detail.phtml and in product detail page link kids should not be there.
Note: Single Cart for all products added from default or kids product pages.
I don't want to create a new store for "Kids" because it will change the new order series for kids.
Please suggest any solution or steps to start with.


texts: why my Wishlist showing only one product

texts:
In my Magento store when I add a product into wishlist it will replace the old product and add a new one.
I don't know why this is happening.

I have checked all core files in my project.

can anyone know the solution for this?


texts:
I have done the configuration https://prnt.sc/noflvl

Then try to place an order and found below error messages:
https://prnt.sc/nofznb

https://prnt.sc/nofhpp

What is the issue, I created a new developer account on authorized.net but no luck.

I think the issue is due to the "https", As I am testing it on server which is not having ssl.

How can I test Sandbox here?


texts: Magento 2.3.2 Remove white background created by Image resize

texts:
How can I remove the extra white background added to resized images from Magento?
we have setup 700x700 image size for Product main image in view.xml.
Image resize is working fine for the images higher than 700x700 but when the images are smaller than 700x700, it adds a white background and does not look like the resize image. Instead, it looks like it adds a white background as a canvas.
How do I avoid this white canvas and have the smaller images resize to proper image size?

Thank You


texts: Notice: A non well formed numeric value encountered

texts:
I'm trying to format the DB timestamp to 'm:d:y, something like 07/06/20`. Please change the piece of code below to help achieve it.
    echo $dbh->Record['fulfillmentDate']; Returns 2020-07-02 02:38:38
    $date_string = $dbh->Record['fulfillmentDate'];
    $fulfillment_date = date("m.d.y", $date_string); //Error is around this line.
    echo "Fulfillment Date: ". $fulfillment_date;


texts: how to add and customize items in menu/nav bar in header

texts:
I am customizing the ultimo theme.
In the top menu or the user menu there are five links like:
accounts
wishlist
signin
signup
cart

I want to change these LINKS and also I want to add more links like pages. But i am unable to do so.
I am very new to magento and finding very difficult to customize it.  i am using magento 2.1
P.S i dont know how it is off topic please leave a comment in case of negative voting. Thanks!


texts: Magento 2 - How to add a placeholder in company field of customer address edit form(edit.phtml)?

texts:
I have been trying to add a placeholder in the company field of customer address edit form(edit.phtml) in Magento 2. Any suggestion or advice where should I be looking I looked into the block of 'Magento\Customer\Block\Widget\Company' but couldn't find anything helpful

  app\design\frontend\Company_name\Magento_Customer\templates\address\edit.phtml

getLayout()->createBlock('Magento\Customer\Block\Widget\Company') ?>

<?php if ($_company->isEnabled()): ?>
    <?= $_company->setCompany($block->getAddress()->getCompany())->toHtml() ?>
<?php endif ?>


texts: Need to get Customizable option title & values from array in quote

texts:
From quote I got array of customizable option. How can I retrieve it's title & value

 $quote = $this->_cart->getQuote();
    $cartAllItems = $quote->getAllItems();
    foreach ($cartAllItems as $item) {
        foreach ($item->getOptions() as $option) {

             echo "<pre>";
            print_r(json_decode($option['value']));die;

        }

This is the output but I need value

[options] => stdClass Object
    (
        [1] => Array
            (
                [0] => 2
            )

    )


texts: how can Draw chart in knockout js in magento 2

texts:
I am trying to draw chart by knockout js.

So check but there is complexity to implement with knockout js in Magento 2 to how can I bind to this with new values.

Not Respond Add size chart in magento 2.1


texts: Add To Cart button, Product with custom options that are not required

texts:
I want to change the behavior of the Add to Cart button from the list / grid views. Where this is clicked for a product that has custom options that are required, the customer is taken into the product page to complete the options, and then they add to cart.

I want the same behavior for a product that has custom options that are not required. The add to cart button add the product into the shopping cart.

So my question is, how can I change Add to Cart button in list/grid views so that you are moved into the product page whether the optional are required or not.

I realize that making one or more of the options mandatory would solve this, but the options all need to be non-mandatory for reasons.


texts:
I am checking my website performance in gtmetrix

and I found that Remove query strings from static resources's GRADE are just 34% because of some of image URL content parameters like

Aigner.JPG?1478080241267
DKNY.jpg?1478080241292

this URLs also effect on Serve resources from a consistent URL

I am not able to find out why this is happening and how to remove query string from image URL.

Note
Query string only add on brand URLs others images are perform well.


texts: Magento 2 - How to create admin configuration for a custom theme

texts:
I cannot find a tutorial to create admin configuration for a custom theme.
I need to create admin customization design and colors


texts: Display product attribute in admin sales order view?

texts:
I am using Mangeto 1.9.1

I am trying to display some custom product attributes in the admin sales order view page.
If i have to point it more, i am talking about this page: www.yourmagentostore.com/index.php/admin/sales_order/view/order_id/3/key/271c3dbb00b40c759098c70844b42e58/

So there i found a table which display the name of the purchased product.

I need something simple, i need to display below this name the custom attribute.

Here is the code that i found for this tablle:

    <?php $_items = $this->getItemsCollection() ?>
    <?php $i=0;foreach ($_items as $_item):?>
        <?php if ($_item->getParentItem()) continue; else $i++;?>
        <tbody class="<?php echo $i%2?'even':'odd' ?>">
            <?php echo $this->getItemHtml($_item) ?>
            <?php echo $this->getItemExtraInfoHtml($_item) ?>
        </tbody>
    <?php endforeach; ?>

This code is located: app\design\adminhtml\default\default\template\sales\order\view\items.phtml

This bunch of code is holding the table with the name, price and such of the product. So that's what making me think that i have to add somehow here the code for the custom attribute so i can display it.

The name of the custom attribute is ext_image

As i display the custom variable in the product view page:

<?php
$_product = $this->getProduct();
echo $_product->getExtImage();
?>

When i execute this code in the admin sales order view page it's not displaying the custom attribute.. So guys can you please help me display this custom attribute in this page ?

Thanks!


texts: Magento : Change Recently Viewed Products From List to Grid View

texts: There's a setting in Magento 1.9 to change recently viewed products from grid to list or list to grid view.  I found it once, and to save my life can't find it again.  Can anybody help?


texts: In order to see a page I want the user to subscribe to our newsletter

texts:
I would like to let only subscribed users/guest to see the content of a page.
How can I achieve this? I also want that if is not subscribed to appear the form to subscribe and then to be able to see the page.


texts:
I have a button in cms_page_listing.xml file, I expect opens a modal window with a slide effect, when clicked on it.
what should i do, please help


texts: Modify SQL query to also get number of times ordered

texts:
I am using the following SQL query from http://www.demacmedia.com/magento-commerce/calculating-lifetime-value-of-a-customer-in-magento/ to pull the amount of money each customer has spent with us.  I would also like to see the number of orders that were placed and even the date of first order if that's possible.  How can I modify the SQL query to get this?

SELECT DISTINCT customer_email, customer_firstname, customer_lastname,
SUM(subtotal_invoiced) AS Total
FROM sales_flat_order AS a
GROUP BY customer_email
ORDER BY SUM(subtotal_invoiced) DESC


texts: Continue button not working on checkout magento 1

texts: On my checkout continue button not working in the first step.Although i enter all required values but button not going to next step.


texts: Insert shipping address to an existing order in Magento 2.2

texts:
I am trying to insert billing & shipping address for some existing orders.
We had a product mistakenly set as virtual product and some customers purchased it. Now I need to manually insert their shipping addresses (and maybe billing address) into the order. Is there any plugin to do this or maybe I can update in database?
I tried to create new entry in sales_order_address table but it doesn't work.
Any hint would be appreciated, thank you in advance!


texts: Dynamically add form fields using Ui component on click of Add More button in custom admin module

texts: I have created a module which allows to add items dynamically from admin panel configuration. I have created form using ui component and want to add 3 fields dynamically on click of "Add More" button. I have no idea how to add dynamic fields using ui component.


texts:
We are receiving system errors as follows and these have only just began appearing, I am not sure if coincidence but it seems to have started since we introduced iphone theme design exception in the backend;

  ERR (3): Warning: Missing argument 9 for
  Mage_Catalog_Block_Navigation::_renderCategoryMenuItemHtml(), called
  in /app/code/local/Mage/Catalog/Block/Navigation.php on line 455  and
  defined  in /app/code/local/Mage/Catalog/Block/Navigation.php on line
  228 ERR (3): Notice: Undefined variable: rendermode  in
  app/code/local/Mage/Catalog/Block/Navigation.php on line 294 ERR (3):
  Notice: Undefined variable: rendermode  in
  app/code/local/Mage/Catalog/Block/Navigation.php on line 296

We do have a custom theme local Navigation.php file present and code has been added around the error lines 294 & 296 to display category images as follows (I have bold text lines 294 & 296);

// assemble list item with attributes
    $htmlLi = '
 $attrValue) {
        $htmlLi .= ' ' . $attrName . '="' . str_replace('"', '\"', $attrValue) . '"';
    }
    $htmlLi .= '>';
    $html[] = $htmlLi;
    **if($rendermode == 'image' && $this->getImageUrl($category)){**
       $html[] = 'getImageUrl($category).'" />';
      **}else if($rendermode == 'thumbnail' && $this->getThumbnailUrl($category)){**
       $html[] = 'getCategoryUrl($category).'">getThumbnailUrl($category).'" />';
      }

Is this code causing the errors and how to go about fixing? Thanks so much for any help!


texts: Magento 2 Run/Execute jquery after KnockoutJS has rendered all elements

texts:
I want to add some JS code after KO render all element in page. i have try below code in magento 2.2.2

require(['uiRegistry','domReady!'], function (r) {
        r.get('.test123', function (el) {
            el.append('Add New');
        });

but this is not working.


texts: Needs an Arabic language package that supports Magento 1.9.2.4

texts: I need an Arabic language package  which supports Magento 1.9.2.4. So far unable to find it so please help.


texts: How to Add Custom mass action in Customer grid?

texts: I'm using Magento 2.4.1, i want to sync multiple customers data to another place using mass action in Magento 2 backend customer grid, the problem is I don't know how to add an option in the mass action and executing it ?


texts:
My headache begins with a common URL Rewrite issue. I am running Magento 2.3 and rely heavily on an extension called Firebear Import / Export to handle my suppliers CSV feed imports.

Let's say in this example, I currently have no products and then run the import one by one until all 4 of my suppliers products are in the shop (note that a percentage of products will be duplicated as each supplier are in the same trade) - the import runs smoothly and Magento generates the URLs as it should.

Here lies where I am stuck, the URL paths for the products display as such:

https://www.terabytecomponents.co.uk/catalog/product/view/id/6316/s/samsung-200-s22e200b-led-display-54-6-cm-21-5-full-hd-black/category/10/

I need the URLs to be displayed showing the full category path, yes I have changed all the settings in admin such as

Use Categories Path for Product URLs = Yes

This doesn't make a difference even after a reindex and cache clean. Here's the catch, I purchased an extension that regenerates URLs and when I run it (takes about 20 minutes) the category path shows properly in the URL! Fantastic until i run a product import job, it now throws errors like this:

Some URL paths already exist in the url_rewrite table and not related to Product ID: 5013. Please remove them and execute this command again.

('hp-elitedesk-800-g4-3-2-ghz-8th-gen-intelr-coretm-i7-i7-8700-black-silver-sff-pc-1', 'computing/desktop-computing/hp-elitedesk-800-g4-3-2-ghz-8th-gen-intelr-coretm-i7-i7-8700-black-silver-sff-pc-1');

The import completes but the products that display in these errors will not update, meaning prices and quantity will never change and that's not good.

I am desperate to get the category paths shown but do not use the 3rd party extension as it creates an issue in my product imports.

My questions are:

Why isn't Magento allowing the category path to be shown even though I'm telling it to?
How can i get it to work properly without using 3rd party extensions?


texts: Category tree generating takes too much time

texts:
StackExchange! I've faced big problem with category tree generating process. I run

$flat = Mage::getResourceModel('catalog/category_flat');
$categories = $flat->getCategories($parentCategoryId, 4, false, false, true);

and it takes 4 minutes. As I understand the query is that slow because of left join of core_url_rewrite table (I have 86515 records there).

Has Magento team fixed the issue with catalog URL rewrites in later versions of platform (now I'm working with sites on Magento 1.7 and I know that it need to be upgraded) or I'm doing something wrong?


texts: Automatically login through external file

texts:
Something is wrong in this file, but I don't know what...
note: the ID that goes into load() is correct :-p

include_once('../app/Mage.php');
Mage::app('admin');

$w = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $w->query("SELECT `entity_id` FROM `customer_entity_varchar` WHERE `value`= '".strip_tags($_GET['i'])."' LIMIT 1;");

if(count($result)>0){
    //
    // customer exsists login now
    //
    while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
        try {
            $customer = Mage::getModel('customer/customer')->load($row['entity_id']);
            Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
        } catch(Exception $e) {
            //nothing for now
        }
    }
    header('Location: /checkout/onepage/');
} else {
    header('Location: /checkout/onepage/');
}

UPDATE:
Found this as the answer but... what does it do?

Mage::getSingleton('core/session', array('name'=>'frontend'));


texts: Getting error if xml settings are loaded from cache

texts:
I am getting the captured error log as below

  Warning: simplexml_load_string(): ><useccv>0</useccv><min_order_total/><max_order_total/><sort_order/><min_order_t  in D:\wamp\www\premo_core\lib\Varien\Simplexml\Config.php on line 384

I am not sure which of my changes produced this error because I am getting this error since last one month? So I am unable to find which config file has error.

Edit:

I am trying to debug it by myself and below is my observation.

I am just cleaning the cache folder and refresh the home page on my
browser. At this time I have no parse error in system.log
Without clearing the cache folder again I am refreshing the page. At this time above said error is being captured.

From the above observation I understood that there is a problem while loading the configuration from cache.

In \lib\Varien\Simplexml\config.xml configuration file under loadCache() method I made changes as below

public function loadCache()
    {
        if (!$this->validateCacheChecksum()) {
            return false;
        }

        /*$xmlString = $this->_loadCache($this->getCacheId());
        $xml = simplexml_load_string($xmlString, $this->_elementClass);
        echo '
'; print_r($xml);die;
        if ($xml) {
            $this->_xml = $xml;
            $this->setCacheSaved(true);
            return true;
        }*/

        return false;
    }

Means, I just restricted to load from cache just reading the config file every time. Now I am not getting the error. But loading time increased since every time it read all file.

Also, I referred Warning: simplexml_load_string() [function.simplexml-load-string] and tried trouble shoot.

I got below error

  /core/Mage/Sales/etc/wsdl.xml:2: namespace error : xmlns:typens:
  'urn:{{var wsdl.name}}' is not a valid URI

Can someone suggest now?


texts: I'd like to exclude any users from California or Texas from purchasing our products. How do I accomplish this?


texts:
How to get Product custom options name?

$data = $this->getRequest()->getParams();
    echo "<pre>"; print_r($data);  die;

    Array
    (
        [options] => Array
            (
                [536] => 6535
                [447] => 2985
            )

        [qty] => 1
        [product] => 543

    )

In options array, 536 is option label name & 6535 is value of selected option.
same for [447] is option label name => 2985 is value of selected option.

But i want option array in below format instead of option_id & value of option id.

 [options] => Array
        (
            [color] => red
            [size] => large
        )

Please help.
thanx in advance

Updated:

i have create my own custom controller.

Custom_Inquiry_IndexController extends Mage_Core_Controller_Front_Action
{
     public function indexAction()
    {
         $this->loadLayout(array('default'));
         $data = $this->getRequest()->getParams();
         echo "<pre>"; print_r($data);  die;
         $this->renderLayout();
    }

}


texts: Cannot create bundled product, products are empty

texts:
I have two test products:

When I try to create a bundled product out of them, I do not see any products in the list here:

Any idea why this might be? Are the two test products created incorrectly? Are they meant to be "related" products to this bundled product?


texts: Magento 2. add title attribute on topmenu on frontend

texts: I want to add a title attribute on the topmenu in Magento 2. for example category_name


texts:
I created on magento to admin grid module all working find . currently i have one tab i want remove this tab and form should display as full page

currently my module look like this


texts: Please specify the product's required option error when add to cart using ajax

texts:
I am using Ajax for add to cart a product. But If I am on the configurable product page, then my ajax response to this error. 'Please specify the product's required option'. This is my code for add to cart.

$cart->addProduct($product, array(
'qty' => $qty
));

If I am on the simple product page then that product is adding from ajax without any error.


texts: How to fix validate class not found from basename Magento?

texts:
I've moved my Magento 2.3.2 website from Shared Hosting where I developed it to a VPS. Everything on the Shared Hosting was working fine on checkout but right now, when a customer login and tries to Checkout this error message appears:

 Validate class not found from basename
 Magento\Framework\Validator\EmailAddress

  I've tried and followed this: the Same issue reported.

With what is suggested adding include_path "." to my php.ini file, the result is, the error message no longer is showing but the delivery methods are not showing.

As it looks it feels like this stops the validation process for the address of the customer. Has anyone found a fix for this?

  Edit: I am not using Plesk.


texts: site not opening after closing system backcup in admin panel

texts:
i started to take backup of site using admin panel > system > backup

after Internet got disconnected. Now i am unable to open the frontend and backend of site.

Error:

There has been an error processing your request

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

please help me to find solution.


texts: Magento 1.9 Calendar not displayed on customer registration page

texts:
I am using magento 1.9 for my website. I have enabled Javascript calendar in magento admin, but it is not displayed on customer registration page for Date of Birth field.

How should I enable it?


texts: use rewrite to hide add to cart button magento

texts: I'm learning magento. And i'm finding out about hide add to cart button using rewrite, but i could not find any tutorials on internet. Is there any way to do that? Thanks.


texts: Setting attribute labels programmatically

texts:
I'm trying to set labels for attributes for each language. For example I want to translate Price (in Stores > Attributes > Product > Price > Manage labels) for all the store views.

However, I can't seem to find a way to do this via UpgradeData.php. I don't want to directly inject with an SQL query. Looking for something like this, but it doesn't work:

if (version_compare($context->getVersion(), '0.0.xx') < 0) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $attributeId = $eavSetup->getAttributeId('catalog_product', 'price');
        $options = [
            'values' => [
                'Dutch(NL)' => 'Prijs',
            ],
            'attribute_id' => $attributeId,
        ];
        $eavSetup->addAttributeOption($options);
    }


texts: Magento 1: will the EE code be made available after EOL?

texts:
As most of you know, Magento 1 EOL is coming (November 2018) and I was wondering what's going to be the status of the EE code.

My question : is there a chance Magento will release the EE code publicly after M1 end of life so people can, for example, release LTS patches ?


texts: decorateTable javascript function for what it is used?

texts: In magento on cart page there is a javascript function call decorateTable('shopping-cart-table'). For what is used the function decorateTable?


texts: Magento 1.8 - Add New Category - SQLSTATE[40001]: Serialization failure: 1213 Deadlock

texts:
There is something wrong with the categories... whenever I try to add a new subcategory I get the following error:

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

The catalog_url_rewrite index seems to be corrupt somehow.  It was stuck on processing and locked.  I deleted all lock files under var/locks which freed it back up.

I then set all indexes to manual rather than update on save.  However I am still getting the deadlock error.

Any other ideas?


texts: Magento SUPEE 8788 admin side blank in 1.9.2.4

texts:
I have installed the SUPEE 8788 patch without using SSH. I am using following link

How to install SUPEE-8788 without SSH

Now the admin panel is blank after login. And can't place orders in frontend


texts: Error with language pack using Magento 1.9.x and php 7.0

texts:
Did anyone found a work around to install language package on php 7 and magento 1.9.x?

it throws me this error:

  CONNECT ERROR: Package community/Mage_Locale_es_ES 1.9.0.0: requires
  PHP version >= 5.2.0 and <= 6.0.0 current is: 7.0.4-1~dotdeb+8.1

using http://connect20.magentocommerce.com/community/Mage_Locale_es_ES

the official lang pack:
https://www.magentocommerce.com/magento-connect/magento-official-spanish-translation.html


texts: How to resolve "Model LSD method save() detected in loop" in magento 2?

texts:
I am getting a warning as a
"Model LSD method save() detected in the loop" when I did MEOP2"

The issue is on below the line

  $model->setData($finalData)->save();

Please anyone can help me to resolve this issue

Thank you in advance


texts:
I want to save the discount amount of each applied cart rule in a column. I have created a column in the quote table and I have saved the applied rule names in the field using the sales_quote_save_before event.
I want to save the discount amount too. My required format is Rulename1-1000,Rulename2-2000
How can I do this?


texts: How to fix the Design Configuration grid empty?

texts:
I'm running a Magento 2.3 Cloud and I saw the grid before, but after installing a theme I can't see the default options in my design grid anymore, it's in the Admin panel > Content > Design > Configuration.

How could I fix it?


texts:
Magento version: 1.9.4.1

Trying to come up with a SOAP api GET request v1 or v2 to bring all the orders list.
Have already read the documentation:
https://devdocs.magento.com/guides/m1x/api/soap/sales/salesOrder/sales_order.list.html

Have already created an apiuser and apikey from the System backend SOAP/XML-RPC with admin permissions.

Tried this with no result.
https://www.magentohost.com/api/soap/?wsdl?apiuser=xxx&apiKey=xxxxxxxxxxxxx

Im trying to come up with a working URL so i can then import the order list into a Google Sheet.
Can't use Zapier or Integromat for this.


texts:
I have an xml like this.

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

Now I want to use another module, say Mage_Catalog, how can I declare this in xml.

<depends>
<Mage_Cms>
<Mage_Catalog>
</depends>

Is this the appropriate way or Is magento can accept multiple dependencies like this.


texts: Magento 1.9.1 Email Queue - Order Email Being Sent to Numerous Customers

texts:
I am having issues with the order emails.  This is not the typical issue with emails not sending.  I have a cron job set up properly and all order emails are properly being sent to customers.

BUT... I noticed that one order confirmation email was sent to 3 customers today.

The issue will not be detected if you have confirmed shipment on your prior orders before getting a new order.  However, when a new customer (Customer A) places an order when there are currently pending/processing orders (Customer B, Customer C), the order confirmation email for Customer A is sent to Customers A, B and C.  Since then I have tested numerous times and found that this issue always occurs.

Anytime there are a couple orders processing, a new order confirmation will be sent to the correct customer and old customers as well.

This is problematic since the email automatically sends customer's personal info (email, address, phone number, etc) to other people.  If you have not noticed this but are using Magento 1.9.1, I suggest running multiple test orders using different email addresses and leave them all as processing.

See if the later order results in a confirmation email being sent to all of the various email addresses you used for the test purchase.

All I can find is this Stack exchange but it has not worked for me


texts: Get rating summary in bestseller products

texts:
I created a custom block class for the bestseller products:

<?php

class Company_Bestseller_Block_Bestseller extends Mage_Catalog_Block_Product_Abstract
{
    public function getBestsellerProducts()
    {
        $storeId = (int) Mage::app()->getStore()->getId();

        $date = new Zend_Date();
        $toDate = $date->setDay(1)->getDate()->get('Y-MM-dd');
        $fromDate = $date->subMonth(1)->getDate()->get('Y-MM-dd');

        $collection = Mage::getResourceModel('catalog/product_collection')
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addStoreFilter()
            ->addPriceData()
            ->addTaxPercents()
            ->addUrlRewrite()
            ->setPageSize(5);

        $collection->getSelect()
            ->joinLeft(
                array('aggregation' => $collection->getResource()->getTable('sales/bestsellers_aggregated_monthly')),
                "e.entity_id = aggregation.product_id AND aggregation.store_id={$storeId} AND aggregation.period BETWEEN '{$fromDate}' AND '{$toDate}'",
                array('SUM(aggregation.qty_ordered) AS sold_quantity')
            )
            ->group('e.entity_id')
            ->order(array('sold_quantity DESC', 'e.created_at'));

        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);

        return $collection;
    }
}

Now I try to get the rating summary with the following code in my PHTML block:

<?php foreach ($this->getBestsellerProducts() as $_product): ?>
    <?php if($_product->getRatingSummary()): ?>
        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
    <?php endif; ?>
<?php endif; ?>

Unfortunately the summary stays empty. How I can get this information?


texts: Need to access Stock Qty on a category view

texts:
Using Magento 2.1.7 - Stock fustration

Hi, I need to be able to access on a category view each of the products stock qty.

I need this so I can then display a particular icon against each product dependant on the value.  If 0 show an out of stock icon, else, show an in stock icon which wont be a problem but accessing the stock details from the product collection is baffling me.

Any pointers would be very gratefully received.

Cheers
Jim


texts:
I've setup a Magento 2.1.2 and things seem to be working fine (categories, attribute sets, etc.).

The first test product though I created a simple product from the default attribute set an had:

Enable Product: Yes
Quantity: 100
Stock status: In Stock
Categories: MyTest
Visibility: Catalog,Search
Websites: Main Website

After saving it, it doesn't show in my category.
Then I ran the cronjob, the indexes got updated and nothing shows up.
Then I flushed the cashes, still nothing on the frontend.
I search for the SKU, nothing shows up as well.
I'm wondering whether I'm missing something?


texts: Why Attribute Saving via Admin Side Changes Backend Type to INT

texts:
I saw a serious issue with Select type attributes in Magento.

If backend model of a select attribute is other than INT (for example : varchar, text) etc. then if we edit this attribute via admin side and save, then it's backend type will be changed to INT

This is a serious issue because this will leads to indexing issues, product disappears from categories and search and abnormal sorting issues.

Why Magento behaves like this? How can we overcome this ?

As of now, It seems that, it is better to create All select attribute with a backend model INT


texts: Magento 2 : How to Setup Persistent Shopping cart

texts:
How to enable persistent shopping cart in magento 2.1?

I want to do clear cart item on user sign out from sites. I have already setup from

  Stores -> Configuration -> Customers -> Persistent Shopping Cart

Enable Persistence set to Yes,

Clear Persistence on Sign Out set to Yes

But nothing affect in cart items.

How to do this using persistent shopping cart functionality in magento 2?

Goal: Remove Cart item when customer become logout.


texts: After product order is placed, I want to track the order in my local machine for development purpose. Is there any free extension is available for testing propose.


texts: For setup vue storefront : when Installing the vue-storefront-api locally, it throws error for vue storefront page on Ubuntu

texts:
After installation of vue storefront, when I open page for storefront, display page like something went wrong. And also display console error

  The connection to http://localhost:3000/__webpack_hmr was interrupted
  while the page was loading

And display page as shown in image.


texts: M1 admin issue when click on manage customers

texts:
Anyone facing this issue in M1 ?

I get the following error returned when clicking edit or add new customer within the admin panel. customers–> manage customers –> “edit” or “add new customer”

Fatal error: Uncaught Error: Call to undefined method Zend_CodeGenerator_Php_File::shutdown() in /var/www/vhosts/chroot/www.priceguru.mu/webroot/lib/Zend/Log.php:285 Stack trace: #0 /var/www/vhosts/chroot/www.priceguru.mu/webroot/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php(170): Zend_Log->__destruct() #1 /var/www/vhosts/chroot/www.priceguru.mu/webroot/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php(149): Mage_Eav_Model_Entity_Attribute_Frontend_Abstract->_getInputValidateClass() #2 /var/www/vhosts/chroot/www.priceguru.mu/webroot/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(191): Mage_Eav_Model_Entity_Attribute_Frontend_Abstract->getClass() #3 /var/www/vhosts/chroot/www.priceguru.mu/webroot/app/code/local/EM/Addphone/Block/Adminhtml/Customer/Edit/Tab/Account.php(43): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array) #4 /var/www/vhosts/chroot/www.priceguru.mu/webroot/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.p in /var/www/vhosts/chroot/www.priceguru.mu/webroot/lib/Zend/Log.php on line 285

How do I fix this?

We have not experienced this error before and the code within the files indicated in the error has not changed from prior application versions.

I should also add that when trying to Create a New Order on the backend, the Create New Customer button and links to existing customers do not respond when clicked. Not sure if the errors are related but they started at the same time.

Can anyone help me in this?


texts: Selling Lengths of Fabric in increments of 10cm

texts:
I am trying to build a Magento website that sells fabric. There are a few rules to this one:

The fabric can be one of 4 different widths.
The fabric is sold by length, in increments of 10cm.
The minimum length of fabric is 50cm, the maximum length is 20m.

Can Magento 1.9 handle this? Will I need an extension to be able to sell fabric like this with Magento, and if so, what extension would you recommend?


texts: Calling module's class method from skin/js file

texts:
I'm inside a js file under skin/frontend/base/default/js/ now to instantly update i need data from one of my custom modules controller class.

and i don't have idea on how to fetch data from the method.

as i go to url : example.net/index.php/modulename/controller/method i can see the data being populated. and this is what want to get in my js file.

Thank you !!


texts:
I'm trying to debug magento 2.2.2 with xdebug via PhpStorm. When I'm trying to set points in index.php - it works perfectly, but when I'm going to debug some custom or core files Xdebug is not going through that files but if I using die() in those files it works.

It looks like it using php 5.6 instead of 7.0 for xdebug, but in phpstorm everything looks properly.

I'm using this settings:

http://joxi.ru/12ME989I4YoZG2
http://joxi.ru/gmvnBdBCxVEkjm
http://joxi.ru/Vm6LBMBtx95GGA
http://joxi.ru/GrqZ7E7tNjEXVm
http://joxi.ru/Dr8ZBlBtk16G92

Please, help me to resolve this issue. Thanks


texts: Create dynamic products in cart_product_add_after observer, product "belongs" to other product

texts:
I have a product created in backend that will always have SKU 'EXAMPLE'. I add this product in a cart_product_add_after event observer whenever normally a product gets added to a cart.

This 'EXAMPLE' product should belong to product that got added to the cart, but currently if I add, for example, 5x product A and 3x product B then I got 8x of SKU 'EXAMPLE' in cart.

What I need in that situation is 5x of example product that belongs to product A and 3x of example product that belongs to product B.

Main idea is that the SKU 'EXAMPLE' product should belong to the product that gets added to cart via the "Add to Cart" button. It should be reflected in cart view by splitting them and not having all of them stacked in one quantity.

How cart should look:

5x Product A _________________ 20$ ____ Total 100$
5x Example For Product A ____ 10$ ____ Total 50$
3x Product B _________________ 30$ ____ Total 90$
3x Example For Product B ____ 10$ ____ Total 30$

How cart currently looks:

5x Product A ______ 20$ ____ Total 100$
8x Example _______ 10$ ____ Total 80$
3x Product B ______ 30$ ____ Total 90$

Example Obeserver.php:

class Test_Example_Model_Observer
{
    public function cartProductAddAfter($observer)
    {
        $product = $observer->getEvent()->getQuoteItem(); // get product that gets added to cart
        $exampleQty = $product->getQtyToAdd(); // get quantity of added product

        $exampleProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', 'EXAMPLE'); // get the example product
        $exampleToAdd = $exampleProduct->load($exampleProduct->getId()); // load the example product

        $quote = Mage::getSingleton('checkout/session')->getQuote(); // get quote
        $exampleItem = $quote->addProduct($exampleToAdd, $exampleQty); // add example product to quote matching quantity of the normal product
        $quote->save(); // save quote
    }
}


texts:
I had tried installing Magento with WAMP and I did it all.

But the problem with my magento admin interface it is nothing there

and I think I have this error when it was being installed.

Can any one help me?


texts: How to force reloading of a customer data section?

texts:
I'm using CustomerData library to display private content (Magento docs).

I see that in etc/frontend/sections.xml I can configure which requests would result in requesting the data from the server and storing in browser's local storage.

Is there a way to specifically ask to invalidate the data (the particular section)? For example, I want to request it if a data property is absent or if a data property had been received more than 1 hour ago.

Do I make a dedicated dummy action that does nothing just so I could add it to etc/frontend/sections.xml and a request by AJAX when I need to invalidate the section cache, or is there some better way?

If this is the solution, then why should I bother with the customer data at all? I could just make that AJAX call return the data I need and store it the local storage myself.


texts: Slow website after update to Magento 1.9.3.7

texts:
I've updated Magento 1.9 to the most recent version (1.9.3.7). The category and products pages are loading just as fast as before. However, when adding a product to the cart or going through the payment process, the pages are loading really slow (~ 10 - 15 sec.).

The issues comes from a 'js.js' file. The code below is causing the slow loading times:

function setLocation(url){
    window.location.href = encodeURI(url);
}

Does anybody know why the pages are loading so slow or what I can do to fix it?


texts: Magento login customer programatically without password

texts:
I want to try customer login problematically by using below code.

 $id =1;
 $session = Mage::getSingleton('customer/session');
 $customer = Mage::getModel('customer/customer')->load($id);
 $session->setCustomerAsLoggedIn($customer);

but it doesn't work for me .

do Any one have Idea?

I am using magento 1.9


texts: Magento 1.9.2.0 Paypal Adaptive payment only vendor got payment , Owner not get commision

texts:
I am facing issue Multi-vendor Store.

site using unirgy uMarketplace for multi vendor management.

Site is Using Paypal Adaptive payment.

When order placed Vendor get Payment in their paypal account but Owner does not get Commission Percentage of order.

in Exception log i got error
exception 'Mage_Core_Exception' with message 'Error: You do not have permission to execute this payment implicitly'