texts: You cannot define a correlation name 'tdv' more than once [] [] , magento 2

texts:
I have create custom admin FORM and use 2 product attributes as field select option
but in getting error.

"You cannot define a correlation name 'tdv' more than once"

If i have use single attribute in Form then it's working fine.
Any idea how can it resolve ?

Here is my code:

static public function getOptionArray3()
        {
            $data_array=array();

            $attributeCode = 'size';
            $entityType = 'catalog_product';

            $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
            $attributeInfo = $objectManager->create(\Magento\Eav\Model\Entity\Attribute::class)
                                           ->loadByCode($entityType, $attributeCode);

            $attributeId = $attributeInfo->getAttributeId();

            $attributeOptionAll = $objectManager->get(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class)
                                    ->setPositionOrder('asc')
                                    ->setAttributeFilter($attributeId)
                                    ->setStoreFilter()
                                    ->load();

            foreach ($attributeOptionAll as $attributeOption) {
                $data_array[$attributeOption->getOptionId()] = $attributeOption->getValue();
            }

            return($data_array);
        }

        static public function getOptionArray6()
        {
            $data_array=array();

            $attributeCode = 'use_the_mattress';
            $entityType = 'catalog_product';

            $objectManager1 =  \Magento\Framework\App\ObjectManager::getInstance();
            $attributeInfo = $objectManager1->create(\Magento\Eav\Model\Entity\Attribute::class)
                                           ->loadByCode($entityType, $attributeCode);

            $attributeId = $attributeInfo->getAttributeId();

            $attributeOptionAll = $objectManager1->get(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class)
                                    ->setPositionOrder('asc')
                                    ->setAttributeFilter($attributeId)
                                    ->setStoreFilter()
                                    ->load();

            foreach ($attributeOptionAll as $attributeOption) {
                $data_array[$attributeOption->getOptionId()] = $attributeOption->getValue();
            }

            return($data_array);
        }


texts: attribute is not displayed as an option when adding a new configurable product

texts: I've added a new attribute. It's setup exactly the same way another attribute is that works fine. It doesn't show up as an option when I add a new configurable product. I've refreshed and cleared the cache.


texts: Show short description under product title on mini cart

texts:
my client want to show short description under mini cart title:

You can see image screenshot:

I used  grep command found it coming from :/vendor/magento/module-checkout/CustomerData/DefaultItem.php

and using html template file from: /Magento_Checkout/web/template/minicart/item/default.html

so i have passed short description from DefaultItem.php to Ajax response show short description and Same changes on html template file default.html also but not reflecting on front.

i have cleared caches, deployed content and tried on private browser but still not working.


texts: How to add custom tabs at product detailed page?

texts: How can i add custom tabs at product detailed page as description tab?


texts: Fedex India Shipping Mehod for India is not working in Magento 2

texts:
I've setup fedex shipping method in Magento 2.

I've checked the origin is set to India.
I've also set the Weight configuration of fedex shipping method more than the product.
but still when I checkout and select Country as India It shows:

"This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us."

but when I select other country it works perfectly fine.

I've checked an answer which mentioned "Update the wsdl files in Magento/Fedex/Carrier.php file" and add in a PurposeOfShipment
but I'm unable to understand how to add it.
Can anyone help me in fixing this issue?

Thank you


texts: How to Show Static CMS block in Magento 2 html file?

texts: I want to Show Static CMS block in Magento 2 html file.


texts:
I've added some code to generate token using card info filled in 2checkout payment method in my customecheckout_index_index handle. The code should generate the token and use it for order placement.

document.observe("dom:loaded", function() {
    if( typeof( document.getElementById('payment_form_twocheckout') ) !== 'undefined' ) {
        TCO.loadPubKey(TcoEnv);

        payment.save = payment.save.wrap(
            function(callOriginal) {
                if( payment.currentMethod === 'twocheckout') {
                    var form = new VarienForm('co-payment-form');
                    if(!form.validator.validate())  {
                        return;
                    } else {
       /// remaining code to get args and generate token

But it is giving console error

  Uncaught ReferenceError: payment is not defined

If I try Payment.prototype.save instead of payment.save, again it says Payment is not defined.


texts: Not able to extend Mage_Cms_IndexController in my custom module, Magento

texts:
I am trying to extend Mage_Cms_IndexController controller but nothing is happening. My code is under app/code/local/Ash/Test  .

code of app/code/local/Ash/Test/etc/config.xml

 <frontend>
    <routers>
        <ash_test>
            <use>standard</use>
            <args>
                <module>Ash_Test</module>
                <frontName>ash_test</frontName>
            </args>
        </ash_test>
        <cms>
            <args>
                <modules>
                    <Ash_Test before="Mage_Cms">
                        Ash_Test_Frontend_Cms
                    </Ash_Test>
                </modules>
            </args>
        </cms>
    </routers>
</frontend>

And controller location in my module is

app/code/local/Ash/Test/controllers/Frontend/Cms/IndexController

and code is

 require_once Mage::getModuleDir('controllers', 'Mage_Cms').DS.'IndexController.php';
class Ash_Test_Frontend_Cms_IndexController extends Mage_Cms_IndexController
{

public function indexAction($coreRoute = null)
    {
        echo __FILE__;

    }
}

I`m not getting what is wrong in it. Please help !


texts: Magento1: Finding all child (simple) products that are not visible individually without parent (configurable) products set/linked

texts:
How can I find all all child (simple) products that are not visible individually without parent (configurable) products set/linked. these products are not logical as they can never be sold.
I am struggling with this query, however it is not for all to use (attribute id may be different) and I am uncertain if the result is the true answer to my question
Select e.entity_id,e.type_id,e.sku,e.created_at,visib.value FROM catalog_product_entity as e LEFT JOIN catalog_product_entity_int AS visib ON (visib.entity_id = e.entity_id) AND (visib.attribute_id = '95') AND (visib.store_id = 0) WHERE (IF(visib.value_id > 0, 1, 0)) AND e.entity_id  not in (SELECT product_id FROM `catalog_product_super_link`) and type_id='simple' and visib.value = 0


texts: How to use JPF or JPEG 200 image formate in Magento 2

texts:
I have been given image files in jpf or JPEG 2000 to upload into a Magento 2.2.4 store. But looks like this is not an image file format which is supported.

Is there any way to make this work?

Thank you!!!


texts: Issue:- Incompability in data issue Source document: eav_attribute_group. Field: attribute_group_name. Error:

texts:
During Magento1.9.3.4 to Magento2.1.8 Migration Getting following issues :-

Incompatibility in data. Source document: eav_attribute_group. Field: attribute_group_name. Error: The product attribute set "Default" does not contain all required attribute group names "General, Prices, Design, Images"

I've attached screenshot.

Note:- Also implement R&D solutions but issue still not resolved.


texts: Magento 2 Equivalent for Mage::getModel('catalog/product')

texts:
I'm using following code:-
Mage::getModel('catalog/product')
Same code I want to use for Magento2, how can I achieve?


texts:
Welcome,

I used magento 1.9.0.1 My main themes is: app/design/frontend/rwd/default/... and it's cool. I can change theme my shop. But When I have product configurable, magento uses other theme. Where it is? I fight 2 days...

In the template configurable doesn't have "product-collateral" and have additional links. All is curves...

catalog.xml

<PRODUCT_TYPE_configurable translate="label" module="catalog">
    Catalog Product View (Configurable)
    <reference name="product.info">
        <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
                Product Extra Info
            </block>
        </block>
        <block type="catalog/product_view_type_configurable" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
    </reference>
    <reference name="product.info.options.wrapper">
        <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
            <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
            <block type="core/text_list" name="product.info.options.configurable.after" as="after" />
        </block>
    </reference>
</PRODUCT_TYPE_configurable>

Where I have search?


texts: I have two store views in my website. I have to translate a text in footer in english and french. How to translate the text used in footer?


texts: Issue in re-indexing catalog_product_flat index in magento

texts:
We have around 200K products on Magento CE 1.8.02, catalog_product_flat indexing is really creating problem for me.

Did try manually indexing, used command line to do that, all are taking lots of time and even some time process is not completed and server crashed.

We are using dedicated server with 4GB RAM and good hardware.

Also I have to do product import on daily bases so my indexing should be very quick.

Please suggest possible solution for Magento CE only for now.


texts: Order update email exception in magento2

texts:
I tried below code to get items from order in email template order_update.html

{{layout handle="sales_email_order_items" order=$order area="frontend"}}

but above one not working for me , so i tried like below,

 {{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Magento_Sales::email/items.phtml' order=$order"}}

This one throws error like below,

exception 'BadMethodCallException' with message 'Missing required argument $debugHintsPath

if anybody have idea means please tell me


texts: The requested URL /pub/ was not found on this server. - Magento .htaccess problem

texts:
I have an problem about magento 2.4.2
Installed magento 2.4.2 using Composer-CLI. But I can't access magento homepage (http://localhost:8888/magento2)
The requested URL /pub/ was not found on this server.

My .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

Changed .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* pub/$0 [L]
DirectoryIndex index.php

If I change the RewriteRule from .* /pub/$0 [L] to .* pub/$0 [L] , i can see magento home page with some errors.
The page you requested was not found, and we have a fine guess why.
If you typed the URL directly, please make sure the spelling is correct.
If you clicked on a link to get here, the link is outdated.

How can solve this problem?


texts: How can I add custom HTML to an extension config page?

texts:
I am trying to add an HTML snippet to my extension's config page.

I believe I need to create a block file and then reference this inside my extension's system.xml file using a <frontend_model> tag, but am unsure what to put in the block file.

If anyone knows how to do this then some basic example code would be appreciated!


texts: magento 2 how to verify newsletter subscription?

texts:
I have a "new customer account" page (magento 2) where there is the checkbox for subscription to newsletter.

How could I verify that this checkbox is linked to dotmailer and that it works?

I search about that but I didn't find anything that seems to be useful.

I have to say that I'm quite new to magento 2.

Thanks.


texts: Magento price display issue (1.9.2) on products with custom options

texts:
I am facing a problem with Magento 1.9.2 which is puzzling. The price displays well on products without custom options (Sample on link)
https://tech-gear.com/kaiser-baas-alpha-drone

On products with custom options it is showing a decimal before the price...its like the website is dividing by 10,000
https://tech-gear.com/shock-doctor-knee-sleeve

Please help


texts: Magento : How to select products by multiple attributes?

texts:
Trying to get products where special_price is set and special_from_date is less than todays date and special_to_date is more than todays date, so:

$currentTime = Mage::getSingleton('core/date')->gmtDate();
$_products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter(
        array(
            array(
                'attribute' => 'promotionactive','promotionactive' => true,
                'and' => array(
                        'attribute' => 'special_from_date','date' => true,'lt' => $currentTime,
                    'and' => array(
                            'attribute' => 'special_to_date','date' => true,'gt' => $currentTime,
                        'and' => array(
                                'special_price' => true)
                        ),
                    )
                )
            )
        )
    ;

Today I simplified it a bit but it still won't get products properly. The filter is set to select only if promotionactive is true but in results I can see all the products regardless if is true or false.

Finally the code is doing it's job:

$currentTime = Mage::getSingleton('core/date')->gmtDate();
$_products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('promotionactive' , true);
$id = $_products->getFirstItem()->getId();
$_product = Mage::getModel('catalog/product')->load($id);
if(($_product['promotionactive'] == True) && (($_product['special_price'])==True) && (strtotime($_product->getSpecialFromDate()) < strtotime($currentTime)) && (strtotime($currentTime) < strtotime($_product->getSpecialToDate()))){
    $milliEnd = strtotime($_product->getSpecialToDate()) * 1000;
    $productUrl = $_product->getUrlInStore();
}else{
    //some code
}

Problem solved, thanks everyone.

If there is any way to make it better please post below ;)


texts: Configurable product - Inventory - Stock Availability status doesn't change when all associated Simple products go out of stock?

texts:
I have an Enterprise site (1.12.0.2) and a Community site (1.7.0) both doing the same thing.

A configurable product (Manage Stock set to Yes) has just one simple product. Somebody orders the last remaining stock item pushing the simple product's Stock Availability Status into "Out of Stock". However, the configurable parent's Stock Availability Status remains "In Stock". Should the parent not go "Out of Stock" when all its children have gone "Out of Stock". I can see no setting for this in System - Config.

I've tried reindexing Stock Status. No joy.

Would somebody please give me the definitive answer? If the answer is No, it never has then is there a quick and easy solution?

I'm trying to get an answer from Magento at the moment (via Enterprise ticket). Not heard back yet.

Many thanks
Tadhg


texts: Error after enabling flat categories and products

texts:
I enabled flat categories and products and then re-indexed the data. I also cleared the cache but I am still getting this error on the product page. Everything works perfect when the FLAT option is disabled. I need the flat option enabled to help my store perform faster.... any suggestions?

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.seller_id' in    'where clause'

Trace:
#0 /var/www/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110):      Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT count(DI...', Array)
#4 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT count(DI...', Array)
#5 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(828): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/html/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array)
#7 /var/www/html/lib/Varien/Data/Collection.php(225): Varien_Data_Collection_Db->getSize()
#8 /var/www/html/lib/Varien/Data/Collection.php(211): Varien_Data_Collection->getLastPageNumber()
#9 /var/www/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1036): Varien_Data_Collection->getCurPage()
#10 /var/www/html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)


texts: After removing category attributes I get errors when reindexing: Undefined offset in Flat.php

texts:
After removing category attributes I get these errors in the log file when I reindex "Category Flat Data":

ERR (3): Notice: Undefined offset: 149  in
[...]\app\code\core\Mage\Catalog\Model\Resource\Category\Flat.php on
line 799
ERR (3): Notice: Undefined offset: 150  in
[...]\app\code\core\Mage\Catalog\Model\Resource\Category\Flat.php on
line 799

Options "Use Flat Catalog Category" and "Use Flat Catalog Product" under System->Config->Catalog are disabled.
It seems that category attributes were removed correctly (after that operation all works without any problems), I did it this way in the setup file:
$setup = $this;
$setup->startSetup();
$setup->removeAttribute('catalog_category', 'my_cat_thumbnail1');
$setup->removeAttribute('catalog_category', 'my_cat_thumbnail2');
$setup->endSetup();

And the setup file was configured this way in the module's config.xml:
<config>
    ...
    <global>
        <resources>
            <mymodule_setup>
                <setup>
                    <module>Example_Mymodule</module>
                    <class>Example_Mymodule_Model_Resource_Eav_Mysql4_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </mymodule_setup>
            <mymodule_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </mymodule_write>
            <mymodule_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </mymodule_read>
        </resources>
    </global>
</config>

I investigated the Flat.php file and the line 799 (marked with a comment in the snippet below) is inside this method:
/**
 * Return attribute values for given entities and store
 *
 * @param array $entityIds
 * @param integer $store_id
 * @return array
 */
protected function _getAttributeValues($entityIds, $store_id)
{
    if (!is_array($entityIds)) {
        $entityIds = array($entityIds);
    }
    $values = array();

    foreach ($entityIds as $entityId) {
        $values[$entityId] = array();
    }
    $attributes = $this->_getAttributes();
    $attributesType = array(
        'varchar',
        'int',
        'decimal',
        'text',
        'datetime'
    );
    foreach ($attributesType as $type) {
        foreach ($this->_getAttributeTypeValues($type, $entityIds, $store_id) as $row) {
            $values[$row['entity_id']][$attributes[$row['attribute_id']]['attribute_code']] = $row['value']; //THIS IS THE LINE
        }
    }
    return $values;
}

On line 799, this part of the code: $row['attribute_id'] returns 149. The same number is in the error message:

Undefined offset: 149...

Number 149 is the value of the attribute_id column in the eav_attribute table in database. So 149 is the ID of the attribute that was already removed. The row with this ID in the eav_attribute table doesn't exist anymore (since this attribute was removed). But somehow Magento still tries to get the data of this attribute for some categories.
So this $row['attribute_id'] returns 149. And when Magento tries to get element 149 from this array: $attributes[$row['attribute_id']] it throws error because there is no attribute with ID 149 in $attributes array.
It looks like attributes were removed from the eav_attribute table, but Magento still stores the data of the removed attributes for some categories. If a category had any data in those removed attributes, that data is still stored in the database.

But shouldn't it be removed since I removed the attributes?
Or did I remove the attributes incorrectly?


texts: Hi there, it seems an error when click on customer id

texts:
Fatal error:Class 'Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion' not found in /home2/sjaved/public_html/dev/umu/app/code/core/Mage/Core/Model/Layout.php on line 491

How to fix it..??


texts: New menu does not appear in admin panel - Magento 2

texts:
I was creating a custom menu to the Admin panel on Magento 2.

The code of menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Formation_Jobs::job_head" title="Jobs" module="Formation_Jobs" sortOrder="100" parent="Magento_Backend::content" resource="Formation_Jobs::job_head" />
        <add id="Formation_Jobs::department" title="Departments" module="Formation_Jobs" sortOrder="10" parent="Formation_Jobs::job_head" action="jobs/department" resource="Formation_Jobs::job" />
        <add id="Formation_Jobs::job" title="Jobs" module="Formation_Jobs" sortOrder="20" parent="Formation_Jobs::job_head" action="jobs/job" resource="Formation_Jobs::job" />
    </menu>
</config>

The structure of my folders (Module work perfectly) :

But the problem is I can't see the custom menu on my Admin Panel

Is there any solution?

PS: I use setup:upgrade and cache:flush && setup:di:compile and still not work

PS 2: I try to make an error on menu.xml ( don't close a tag ) and when I lunch setup:upgrade, I didn't get any error


texts: I added a new page but I cannot get it to show up on the footer part of the page where I have the other information such as policy , privacy and so on. Have created the page successfully but i cannot get it to show up so a customer can click on it to read the information.


texts: Magento2 Amasty free gift item removing on checkout page

texts:
Reviewers please don't Cancel/Close this request for 1 day.
Hi Can anyone facing Amasty free gift product removing on checkout page while applying coupon code?
Here are the steps I have followed

Created 100% discount rule from admin end for one SKU.
Browsed the product in the fronted & added item to cart
Added free gift item to cart
Go to checkout page added address & applied coupon code
Removed coupon code & again applied coupon code
Free gift item is removing from my cart

Could you please advise.
Note: If any one having this issue with Amasty Promo ?
Thanks


texts: How to get magento categories by an array of category ids?

texts:
I have a situation where i have an array of category ids (containing both parent and child categories). now i want to fetch all categories by ids in the array in parent child relation i.e.
if the category is top level (parent) then print it else if the category is child first get and print its parent category and then print the child categories.
Until now i can get all categories from the list but the condition i applied to check if the category has parent category remain always true as all main categories are child of the root (default) category

<?php if ($_categories->getParentId()>0) {
    $_categories= $_categories->getParentCategory();
} ?>


texts: Set visibility on storeview scope for 25k products and 28 storeviews

texts:
I need to change the visibility of 25k products in 28 storeviews.

My first solution works, but is unbearably (10+ minutes for 50- products) slow because of the save()-call. The $brandsToStoreViewIds var is just a mapping of the brand to different storeviews (where it should be visible or not).

Mage::app()->setCurrentStore( Mage_Core_Model_App::ADMIN_STORE_ID );

$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect( 'brand');

foreach( $products as $product ) {
    foreach( $brandsToStoreViewIds as $brand => $storeViewIds ) {
        if( $brand != $product->getAttributeText( 'brand' ) ) {
            foreach( $storeViewIds as $storeViewId ) {
                $product->setStoreId( $storeViewId )->setVisibility( Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE )->save();
            }
        }
    }
}

So i tried to do the same with $product->getResource()->saveAttribute( $product, 'store_id' ):

Mage::app()->setCurrentStore( Mage_Core_Model_App::ADMIN_STORE_ID );

$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect( 'brand');

foreach( $products as $product ) {
    foreach( $brandsToStoreViewIds as $brand => $storeViewIds ) {
        if( $brand != $product->getAttributeText( 'brand' ) ) {
            foreach( $storeViewIds as $storeViewId ) {
                $product->setStoreId( $storeViewId )->setVisibility( Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE );
                $product->getResource()->saveAttribute( $product, 'store_id' );
                $product->getResource()->saveAttribute( $product, 'visibility' );
            }
        }
    }
}

This is supposed to be much faster, but i get the following fatal error:

Fatal error: Call to a member function getBackend() on a non-object in /app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1536

I think i need to prepare/manipulate the collection so that the store_id can be saved, but do not really know how to achieve this.

Maybe there is an even easier way to hide certain products from storeviews and i'm doing it completely wrong?


texts:
I would like the ability to round the grand total of any order to the next whole dollar utilizing a variable tax. The store I'm using is already leveraging a 3rd party tax service, so my thought was to either create a custom tax type or repurpose VAT/WEEE.

I will need to implement my own rounding algorithm as a standard rounding is only partially sufficient:

I will always round up to the next dollar, and never down.
If the total is <=.50 from the next dollar, we will still round up.
If the total is ==.00 we will add a full dollar

Some examples:

Grand total before tax: $3.50
Grand total after round:$4.00

Grand total before tax: $5.02
Grand total after round:$6.00

Grand total before tax: $1.99
Grand total after round:$2.00

Grand total before tax: $10.00
Grand total after round:$11.00

I'm looking for a concrete approach - either repurposing an in-built tax type or rolling my own.


texts: How to set up Category Rules (using Visual Merchandiser?)

texts:
I would like to create a Category that would automatically contain Products of a certain Brand (an attribute). When looking for a solution, I found a lot of info about creating Category Rules.

There is supposed to be a switch called "Match products by rule" in the "Products in category" section, but in my set up (CE 2.2.2) it is simply not there.

As shown here: https://docs.magento.com/m2/ee/user_guide/catalog/category-product-rules.html

Can you please tell me how to display the switch so I can start using Category rules? Is Visual Merchandiser necessary for this? If so, how do I install it?

Alternatively, can you please suggest another solution?


texts: Adding extra product to cart with dropdown in product detail page

texts:
There will be some products that are selectable on my product detail page which you can add cart with a dropdown. I mean there will be 2 products in cart.  Maybe the customer doesnt want to add product on dropdown.

How can I add some products on the dropdown in product detail page?


texts: Magento Go, changing theme CSS to view media storage image?

texts:
How do I reference a media storage image in a CSS in edit custom.css, so that it overrides the template style. Basically I want to change the colours of the menu bar, but they are not changing. So far my code looks like this:

#nav {
background:url("../Headercolourforwebsite.gif") no-repeat scroll 0 0 transparent;
min-height: 33px;
padding: 6px 0 0;
text-align: left;}

The above gif should change the menu from a black gif to a green gif, with the headercolourforwebsite.gif being stored in the root of media storage.

Is there some special technigue that magento go uses as per the inserting of images as seen below:

<img src="{{media url="Headercolourforwebsite.gif"}}" alt="" />

I'd be grateful if anyone could assist me. I do not know how to code properly, so I cannot use Magento Community, since my level of understanding of the technology stack is not adequate.


texts: Deleting/Creating Categories.. new category/products not appearing on webpage

texts: I deleted a category and created another.  The old category with 1 item is still appearing on my webpage and the new category isn't showing up on the webpage nor are any of my products assigned under that category.


texts: Magento getCollection()->getSize() giving wrong value

texts:
custom filter of getLoadedProductCollection() function,

getSize() method does not give correct value

$this->getCollection()->getSize()


texts: Magento: Store Credit Not Showing on Back-end of Customers > Manage Customers

texts:
I'm trying to set up store credit on the back-end of my magento store. However, under:

Customers >> Manage Customers, there should be a section called "Store Credit" on the left hand sidebar. Unfortunately, not showing up on my end.

Thanks in advance for your help.


texts: Hide/Show Product Filters containing div onClick

texts:
I have a website using a product filter system from a company called Manadev and am looking for a way of hiding a div containing options when an option is selected and restoring the div when the option filters are cleared.

I've contacted the developer of the product filter module but they were not very helpful in helping me find a solution.

The dev website is http://www.handcoded.co.uk/toys4cars/bmw-3-series-roof-racks.html

The code that handles the display (also see http://www.handcoded.co.uk/code.txt):

<?php
/**
 * @category    Mana
 * @package     ManaPro_FilterColors
 * @copyright   Copyright (c) http://www.manadev.com
 * @license     http://www.manadev.com/license  Proprietary License
 */
/**
 * Template for showing options for filter as a list of color boxes
 * @author Mana Team
 * Injected instead of standard catalog/layer/filter.phtml in Mana_Filters_Block_Filter_Attribute init() method.
 */
/* @var $this Mana_Filters_Block_Filter */
?>
<?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'before_items', array('block' => $this)) ?>
<ol class="m-filter-colors labels <?php echo $this->getFilterClass() ?> <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>">
    <?php foreach ($this->getItems() as $_item): ?>

    <li <?php echo $this->getListItemClass($_item) ?> >
        <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() || $_item->getMSelected()): ?>
            <a href="#"
            onClick="setLocation('<?php echo $this->urlEscape($_item->getMSelected() ? $_item->getRemoveUrl() : $_item->getReplaceUrl()) ?>');">
                <div class="m-color <?php if ($_item->getMShowSelected()): ?>selected<?php endif; ?> <?php echo $this->getFilterValueClass($_item) ?>"
                     title="<?php echo $this->escapeHtml($_item->getLabel()) ?> (<?php echo $_item->getCount() ?>)">

                <?php echo $this->escapeHtml($_item->getLabel()) ?>

        <?php else: ?>

                <div class="m-color <?php if ($_item->getMShowSelected()): ?>selected<?php endif; ?> <?php echo $this->getFilterValueClass($_item) ?>"
                     title="<?php echo $this->escapeHtml($_item->getLabel()) ?> (<?php echo $_item->getCount() ?>)">

                <?php echo $this->escapeHtml($_item->getLabel()) ?>

        <?php endif; ?>
        <?php if (Mage::getStoreConfigFlag('mana_filters/display/count')) : ?>
        (<?php echo $_item->getCount() ?>)
    <?php endif; ?>

    <?php endforeach ?>

<?php echo Mage::helper('mana_core')->getNamedHtml('mana_filters/markup', 'after_items', array('block' => $this)) ?>

I'm not sure whether a simple javascript show/hide is suitable enough and as this is the first time I have tried to tackle a problem like this any pointers would be welcome.


texts:
I have one issue when I run composer install command.

How to solve this issue.

Thanks.


texts: how to customize the Magento 2, Core API URL

texts:
I want to customize the magento 2 core base API URL.

  For example,

If my magento base url is   http://local.m233ee.com/rest/v1/ . As per my project requirement, i have to change the base URL to http://local.m233ee.com/api/rest/v1/.

eg: change the URL from http://local.m233ee.com/rest/v1/ to http://local.m233ee.com/api/rest/v1/.

Please any support and suggestion will be greatly appreciable.


texts: How to display customer telephone number on sales order grid table ? (Magento 2.2.0)

texts: I want to display my customer telephone number checkbox here, so that I can see it in column section too, please guide how can I do this?


texts: What is the difference between sales shipping and shipping

texts:
Under Reports - Orders.

What is the difference between the 'sales shipping' value and 'shipping' value?

Thanks


texts: M2 Add canonical tag to Advanced Search page

texts:
In my theme I have a folder Magento_AdvancedSearch. How can I add a canonical tag to this page via XML?

Edit: I have made a file catalogsearch_index_index.xml with the code

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Advanced Search - Test</title>
    <link rel="canonical" src="http://www.extenderstore.com.au/catalogsearch/advanced/" src_type="url"/>
</head>
<body>
</body>

But it doesn't work


texts: It is possible to connect Magento to Oracle database. If yes, Then can I know the way how to do that?


texts: Magento 2.3.2 How to add Multiline component field in admin form using ui component

texts:
I want to add a field like Street address in my custom module. same as customer Address Add from back-end form. it will look like below image.

How can I add this kind of field using the UI component?

UPDATE:

I have used the below code to display a multiline component. But it is not displaying a filed label.

<field name="address">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string" translate="true">Magento_Ui/js/form/components/group</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="size" xsi:type="number">2</item>
                    <item name="formElement" xsi:type="string">multiline</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">store</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
                <item name="label" xsi:type="string" translate="true">Street</item>
            </argument>
        </field>

And also I would like to create a field using a new UI-component form method, the above code is an older method.

Any help would be appreciated!


texts: Changeforgotten password page is blank, disabling customer.xml fixes?

texts:
Clicking the password reset link sent in an email leads to the /customer/account/changeforgotten/ page, but it is blank.

Disabling the customer.xml file (renaming it rather) fixes the issue but I don't want to leave it disabled, nor do I want to have an unworking/outdated customer.xml file.

The below is my current code that leaves my login button intact (the replacement code further below does remove the login button), but keeps the changeforgotten page blank:

        Customer Forgot Password Form

    <reference name="head">
        <action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
    </reference>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
        <action method="setHeaderTitle" translate="title" module="customer"><title>Password forgotten</title></action>
    </reference>
    <reference name="content">
        <!--<block type="core/template" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>-->
        <block type="customer/account_forgotpassword" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>
    </reference>
</customer_account_forgotpassword>

I have tried adding the below, but it removes my login button and still leaves the changeforgotten page blank.

    Reset a Password

<reference name="head">
    <action method="setTitle" translate="title" module="customer">
        <title>Reset a Password</title>
    </action>
</reference>
<reference name="root">
    <action method="setTemplate">
        <template>page/1column.phtml</template>
    </action>
    <action method="setHeaderTitle" translate="title" module="customer">
        <title>Reset a Password</title>
    </action>
</reference>
<reference name="content">
    <block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>
</reference>

Besides disabling the customer.xml file, is there a fix? I'm running CE 1.8.1.0, and pretty new to Magento. Thank you.


texts: What could cause a slow user login in the morning which gets outstanding fast after flushing the cache?

texts:
Every morning the user login is pretty slow (sometimes I even get a 504 Bad Gateway). The rest of the page (category pages, product pages, ...) is fast, though. After flushing the cache the user login is fast as well. It stays fast for the next 24hrs. Next morning it is slow again until I flushed the cache.

System>Configuration>Advanced>System>Scheduled Backup Settings
is turned off (no)
Cron.php is running every 5 minutes. Advanced>System>Cron is set to the standard times.
System > Configuration > Advanced > System > Log Cleaning is set to yes
I'm also deleting sessions which are older than 7 days every night. Obviously I considered this to be the issue but I turned it off and the problem was still there the next day
I only have third party extensions from Mirasvit (Spinxh Search) and Amasty (Checkout, customer attributes and shipping restriction).
Theme is Ultimo.
Magento is 1.9.3.8

Any idea what the reason for this strange behavior could be? Any help would be appreciated. Thx


texts: How to add extra fields in Registration Form?

texts: How can I add a paragraph and extra fields in Registration Form?


texts: Magento 2 onestep checkout page cache problem

texts: I'm using Magento 2.4.1.I'm using external site to save order details then passing saved order id by URL to script to create order quote and assign it to customer then redirct to onestep checkout page to place an order. Everyting working fine.However, I have an issue during a daily work.Here is the scenario . When I save order 1 and pass savedOrderId to create a quote , it redirected me to checkout page and load all Order details was saved. For some reason I didn't complete the order and keep checkout tab open then open new tab to place order 2 by the same way I did with order 1.always I get error message " invalid customer address id = " and sometime order 2 emaill address and shipping address form filled with order 1 email and shipping address info. I'm looking for solution for this scenario.


texts: How to hide item from left menu from admin

texts:
Just want to hide 'MagePlaza' from left navigation, which make client confuse.

I am trying to find simple and easy solution.


texts: Get products in the compare list in the current session from outside magento

texts:
I am trying to get the products in the compare list from outside magento, but I am having problems with it.

The intention is to create a small php program that generates this list and can be used for a 3rd party company in their hosted search.

The code seems to be running fine inside a .phtml template. But when ran outside magento the product list either creates an exception (duplicate keys) or brings other products which are not in the list of the current website visitor session.

I am new to magento and php, and I wonder if I am missing something? The code uses nearly the same code than in magento's default template. As the getItemCollection method sometimes returns items from other visitors ID, I wonder if there is something else that needs to be done before calling the method.

<?php
require_once( 'app/Mage.php' );
umask(0);
Mage::app('default');
Mage::getSingleton('core/session', array('name' => 'frontend'));

    header('Content-Type: application/json');

    $_helper = Mage::helper('catalog/product_compare');

    $count = $_helper->getItemCount();

    echo '"compare":{';

    echo '"summary":{"count": ';
    echo $count;
    echo ' },"items": [';

    $total=0;

    if ( $count > 0 ) {

          try {
               $_productCollection = $_helper->getItemCollection();
                        } catch (Exception $e) {
                                    echo 'Caught exception: ',  $e->getMessage(), "\n";
                        }

          foreach ($_productCollection as $_index => $product) {

              $data = $product->getData();
                            print_r($data['visitor_id']);
                            if (true) {
                       if ($total <> 0) echo ',';
                   $total += 1;
                   echo '{ "name": "';
                   $name = $product->getName();
                   echo $name;
                   echo '", "url": "';
                   $url = $product->getProductUrl();
                   echo $url;
                   echo '", "remove_url": "';
                   $remove = $_helper->getRemoveUrl($product);
                   echo $remove;
                   echo '"}';
                                }
              }
  }
echo ']}';
echo '}}';
    echo ')';
?>

If the user is logged in all seems to work fine.

If the user is not logged in there are problems:

If a product is added, removed and added again then getItemCollection throws an exception. This can be cleared by emptying the compare list database for example.
Sometimes more products are in the list than what is supposed to be in the session.

I examined the contents of getItemCollection, and sometimes the items correspond to other sessions (they have different visitor Ids).

Thanks,
Webster


texts: Modify css of progress content in default opc

texts:
I want to modify the css of the checkout progress panel. When the customer completes the steps, his content is shown in the panel. At the moment every entry is plain text on same background. I want to display odd and even tags with different backgrounds.

I can't find no output html in source code. I think the right html file would be billing.hmtl and this the relevant line of code:

<dd class="complete">
    <address><?php echo $this->getBilling()->format('html') ?></address>
</dd>

But where can I change the output of that call?


texts: Trim product name based on manufacturer attribute

texts:
I have a shop with many SKU's. I've recently added the manufacturer name attribute (e.g. Nike) to the catalog/product/list.phtml. As a result I now have duplication as the manufacturer shows before the product name, which also contains the manufacturer name (e.g. Nike Nike Shoes).

I wonder if anyone can advise of a PHP function where by I can trim the 'name' attribute by the 'manufacturer' attribute.

For example, if 'manufacturer' attribute = 'Nike' then remove 'Nike ' from 'name' attribute.

Here's the current code I have in list.phtml:

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


texts:
I have facing problem on search product(s) from my website.

Someone please help me out to know what happens in this error.

When I search for a product in the site search, for example "Dress", the magento does not return the registered dresses, but this screen.

https://imgur.com/a/MGMp6ZE

Showing the category "Female" which is where "Dress" is, but it does not return products.

Does anyone know why this occurs?


texts: Add text block after price for my storeview

texts:
Help me with this task: I for one can deduce storeview inscription: "VAT, plus Shipping" but for another storeview hide this inscription, i need to display in the catalog and in the product page

Thanks


texts: 3D Secure v2 (SCA / PSD2) and how does it effect Magento

texts:
As of the 14th of September PSD2 comes into effect (more info here)

As I understand it this means all transactions have to be 3d secure ( maybe all have to use the new 3D Secure v2).

What does this mean for our magento website checkouts, what changes are needed  (if any)?


texts: very generic question. I am super confused on how to use SASS in Magento 2, I can't seem to find an easy guide on explaining step by step how to do so... any help is appreciated. Thanks!


texts: The requested sku is not assigned to given stock. Product is not displayed

texts:
When I go to product page I get this:
The requested sku is not assigned to given stock.

Also product is not displayed on category page.


texts: Magento 2 How to duplicate category products into another category

texts:
I am working on duplicate category, In my controller file, I am able to duplicate the category but I need to assign the same products to the newly created category from the old one.

i.e.
I have the category name "Abc" has 10 products and 2 of them are In-stock / out of stock / disable, now I duplicate the category with and the new name is "Xyz". I want to assign all 10 products into "Xyz".

How could I achieve this functionality?

class DuplicateCategory extends \Magento\Backend\App\Action {
protected $_categoryFactory;
public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Catalog\Model\CategoryFactory $categoryFactory
) {
    parent::__construct($context);
    $this->_categoryFactory = $categoryFactory;
}

$parentCategoryObj = $this->_categoryFactory->create()->load(2);
$duplicateCategoryObj = $this->_categoryFactory->create()->load(8);
$catagoryObject = $this->_categoryFactory->create();

$categoryName = $duplicateCategoryObj->getName();
$categoryUrlKey = strtolower($this->getCategoryUrlKey($categoryName));

$catagoryObject->setPath($parentCategoryObj->getPath())
    ->setParentId($parentCategory)
    ->setName($duplicateCategoryObj->getName())
    ->setUrlKey($categoryUrlKey)
    ->setStoreId($storeId)
    ->setIsActive(true);
$catagoryObject->save();
}


texts: Magento 2.1.1: Error 500 details no longer display after the upgrade

texts:
After I upgrade my Magento site to Magento 2.1.1, I no longer be able to see the details from any error 500 (it worked fine on 2.1). Instead it becomes just a blank page.

I check on /pub/errors/ folder and looks like there isn't anything change to the local.xml file. I also checked on /var/log folder, it doesn't seem to have anything new either.

Am I missing something here?


texts: Use massaction Button in Admin grid Catalog/category

texts:
I already have a problem.
In the backoffice, in Catalog/category i have created a new tab for Push_Ahead products.

But now, I want some features and it's not work...
I want when a product is not selected, and we make a save that the product is un push ahead.

I have a list with ALL/yes,No and i wanted to display all the product, product push ahead ( yes) and all the product not push ahead(no)
But it's not work.

Here is my code : `

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Mycompany_Tetegondole_Block_Adminhtml_Catalog_Category_Tab_Pushahead extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product {

protected function _prepareCollection()
{
    $collection = Mage::getModel('catalog/category')->load((int) $this->getRequest()->getParam('id', 0))->getProductCollection()
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('price');

    $this->setCollection($collection);
    $this->getCollection()->addAttributeToFilter('push_ahead', true);

    return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
}

protected function _prepareColumns()
{
    if (!$this->getCategory()->getProductsReadonly()) {
        $this->addColumn('is_push', array(
            'header_css_class' => 'a-center',
            'type'      => 'checkbox',
            'name'      => 'is_push',
            'values'    => $this->_getSelectedProducts(),
            'align'     => 'center',
            'index'     => 'entity_id'
        ));
    }
    $this->addColumn('entity_id', array(
        'header'    => Mage::helper('catalog')->__('ID'),
        'sortable'  => true,
        'width'     => '60',
        'index'     => 'entity_id'
    ));
    $this->addColumn('name', array(
        'header'    => Mage::helper('catalog')->__('Name'),
        'index'     => 'name'
    ));
    $this->addColumn('sku', array(
        'header'    => Mage::helper('catalog')->__('SKU'),
        'width'     => '80',
        'index'     => 'sku'
    ));
    $this->addColumn('price', array(
        'header'    => Mage::helper('catalog')->__('Price'),
        'type'  => 'currency',
        'width'     => '1',
        'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
        'index'     => 'price'
    ));

    return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();
}

protected function _addColumnFilterToCollection($column)
{
    // Set custom filter for in category flag
    if ($column->getId() == 'is_push') {
        $productIds = $this->_getSelectedProducts();
        if (empty($productIds)) {
            $productIds = 0;
        }
        if ($column->getFilter()->getValue()) {
            $this->getCollection()->addFieldToFilter('push_ahead', array('in'=>$productIds));
        }
        elseif(!empty($productIds)) {
            $this->getCollection()->addFieldToFilter('push_ahead', array('nin'=>$productIds));
        }
    }
    else {
        return Mage_Adminhtml_Block_Widget_Grid::_addColumnFilterToCollection($column);
    }
    return $this;
}

 protected function _getSelectedProducts()
{
    $products = $this->getRequest()->getPost('push_ahead');
    if (is_null($products)) {
        $products = $this->getCategory()->getProductsPosition();
        return array_keys($products);
    }
    return $products;
}

}
`


texts: What are the ObjectManager Factories differences?

texts:
I see that Magento 2 has 3 factory classes (4 if you count the abstract one).

\Magento\Framework\ObjectManager\Factory\Dynamic\Developer
\Magento\Framework\ObjectManager\Factory\Dynamic\Production
\Magento\Framework\ObjectManager\Factory\Compiled

All of the above extend \Magento\Framework\ObjectManager\Factory\AbstractFactory.
I assumed that when on developer mode, the Developer factory would be used, but sometimes the Compiled one is used and I cannot pinpoint the conditions for this.

Can someone please explain when each factory is used and what are the differences between them?


texts: Magento 2 : Disable Sending email when order status change

texts:
Is their any way we can stop sending email when order status change from backend magento 2  ?
any thoughts appreciated.
Thanks


texts: Issue with magento multi website and different domains

texts:
I have 2 domains I want lunch it with the same Magento
as a multi-website option in Magento.
I add (website,  store, view store ) and associated it with the second domain.
I change my .hatacsses in root Magento(first domain)
like that

#SetEnv MAGE_MODE developer
SetEnvIf Host .*nasseij.com.* MAGE_RUN_CODE=base
SetEnvIf Host .*nasseij.com.* MAGE_RUN_TYPE=website
SetEnvIf Host .*test.nasseij.com.* MAGE_RUN_CODE=sinwadi
SetEnvIf Host .*test.nasseij.com.* MAGE_RUN_TYPE=website

and

#RewriteBase /magento/
RewriteCond %{HTTP_HOST} ^(.*)nasseij\.com
RewriteRule .* – [E=MAGE_RUN_CODE:base]
RewriteCond %{HTTP_HOST} ^(.*)nasseij\.com
RewriteRule .* – [E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(.*)sinwadi\.com
RewriteRule .* – [E=MAGE_RUN_CODE:newsite]
RewriteCond %{HTTP_HOST} ^(.*)sinwadi\.com
RewriteRule .* – [E=MAGE_RUN_TYPE:website]

and change this in the main index of my basic Magento

require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'base';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

and put .hatccses in second domain root but didn't work it gives me that file not found.
I try copy Magento files to second domain root also give me that 500 error a lot of redirects

Do I want to know my mistakes and in the second domain which files have to be?


texts: How can I remove orders from an order collection in Magento 2? Or how to generally remove items from any collection?

texts:
I'm using this code in a block to get a collection of orders in Magento 2:

$orders = $this->orderCollectionFactory->create()
            ->addFieldToSelect('*')
            ->addFieldToFilter('customer_id', $customerId);

And so far it works great, I can loop through the orders and output the order data in the frontend.

However, I want to remove some orders from this collection, for example order with ID of 21. I tried to use removeItemByKey() to accomplish this:

foreach ($orders as $order) {
    if($order->getId() == 21) $orders->removeItemByKey($order->getId());
}

But this doesn't work and the order with ID 21 remains in the order collection.

I've also tried this instead:

foreach ($orders as $order) {
    if($order->getId() == 21) unset($orders->{$order->getId()});
}

Same result, order 21 still in the collection.

Why doesn't this work and how can I remove stuff from the order collection?


texts: Magento: How to call phtml file after registration and redirect to the dashboard page

texts:
I am new to magento,using 1.9.2.4. I have the module of OTP verification and it's working fine. Whenever login, it redirects to dashboard page and ask to  enter verification code.The code in dashboard.phtml is like,

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('test/numberverify.phtml')->toHtml(); ?>

so it was asked in dashboard.pthml, but I want to keep this code after register, then this page will appear and then verify after it will redirect to dashboard.phtml. Which files I need to change and how to do this?

numberverify.phtml

                 <?php

             $isuserVerified =     Mage::helper('test/Data')->isUserVerified(Mage::getSingleton('customer/session')->getId());
          if($isuserVerified == 'false'): ?>

         <?php /*?>

      <?php echo $this->__('*Please verify your mobile with OTP code.'); ?>

    <?php echo $this->__("Please Enter verification codes"); ?>

<input type="text" id="code" name="code" placeholder="Enter verification code" class="verify" />
<input type="button"  id="verify_mobile" value="Verify Mobile" class="button verify" />
<?php if(Mage::helper('test/Data')->canResendOTP())
    { ?>
Resend Code
<?php } ?>


texts: Magento 2: Override file app/lib/web/mage/validation.js

texts:
How to override file app/lib/web/mage/validation.js?

I want to change the System Error Message in this JS file.

Please help


texts: Magento2 : Change Customer name Prefix to Radio button from Dropdown on Checkout page

texts:
I want to change name prefix to radio button in billing and shipping address.
How can I do that possible?
I want to change this in Customer pages also.


texts: Don't allow the customer to login to the account

texts:
How to disallow the customer to login ?
for example:

  when a custom attribute is set to false


texts: How to check observer called from search page?

texts:
I am accessing observer (controller_action_layout_render_before) through this:

  app/code/Vendor/Module/etc/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="controller_action_layout_render_before">
        <observer name="layout_render_before" instance="Vendor\Module\Observer\LayoutRender" />
    </event>
</config>

My observer file

  app/code/Vendor/Module/Observer/LayoutRender.php

<?php
namespace Vendor\Module\Observer;

class LayoutRender implements \Magento\Framework\Event\ObserverInterface
{
    protected $_resultPageFactory;

    public function __construct(\Magento\Framework\View\Result\PageFactory $resultPageFactory) {
        $this->_resultPageFactory = $resultPageFactory;
    }
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $resultPage = $this->_resultPageFactory->create();

        if (//PHP Check here) {
            $pageConfig = $resultPage->getConfig();
             $pageConfig->setPageLayout('1column');
        }
    }
}

My question is, how can I check if this is accessing on search page?


texts: What 'Customer mode' when calling cart_customer.set with SOAP api?

texts:
I'm using the SOAP V1 api and attempting to set the customer. My site does not have a customer login, so I want to set the customer mode as guest. . . exactly as is done in the example in the docs for this call.

I'm using node and MagentoJS to connect to my store; my customer array is:

    var customerArray = [{
        'firstname'     : 'test',
        'lastname'      : 'user',
        'email'         : 'test.user@gmail.com',
        'mode'          : 'guest',
        'entity_id'     : '5'
    }];

The error that I keep getting is:

[Error: XML-RPC fault: Customer's mode is unknown]
  code: 1045,
  faultCode: 1045,
  faultString: 'Customer\'s mode is unknown'

Anyone have any idea what's going on? Do I need to set up the mode elsewhere previously? And the entity_id? If so, where does that happen?


texts: How do I upgrade Magento 2 EE using composer

texts:
I am trying to upgrade Magento 2 EE using composer but I keep getting this message whenever I run composer update/upgarde

- The requested package magento/product-enterprise-edition 2.2.3 exists as magento/product-enterprise-edition[2.1.9] but these are rejected by your constraint.

I have the correct keys to download the latest version using composer but would like to know what this message means so that I can resolve it?

Does anyone know what the message is referring to? Is the constraint based on a dependency in the codebase or the Magento account itself?

Edit: running composer require magento/product-enterprise-edition 2.2.3 --no-update

I get the following response:

  [InvalidArgumentException]
  Could not find a matching version of package magento/product-enterprise-edition. Check the package spelling, your version constraint and that the package is available in a stability which
  matches your minimum-stability (alpha).


texts: Will category discounts double if items are in multiple categories?

texts: If I set up a catalogue discount for 40% off the women's category and 40% off the sale category, will items that live in both the women's and the sale category end up at 80% off? What is the best way to do this without having to rearrange all our items?


texts: Magento Products disappear due to stock 0 But stock Options not available

texts: I have set Stock management Yes for configurable product but have only three options as shown in the screenshot, no option to enter quantity.


texts:
I have a magento store. i did a pagespeed test using "Google PageSpeed Insights" for my home page. In the recommendation google gave me some come cache images to compress. But sonassi image compression script is already running on the base images. so i think that if the base images are compressed there cache versions should also be compressed ...

Can anyone suggest me some solution to resolve this issue?


texts: Creating a custom tab in configuration with text field, and when updating a product "the word" will append with product name. Magento 1.9

texts:
I am creating a small module. In which I have built my own tab in System- Configuration, Name "ZARA" which consists of a textbox. I can enter words in the textbox and save the configuration.

Now my problem is, I want that the module should append the word entered in the configuration to the product name through a so-called observer whenever a product is saved.

for example, I entered "Test" as a test word in the configuration. I then open a product in the backend in product management, which is called "RedShirt". When I save this now, it's called "RedShirtTest". If I save it again, it's called "RedShirtTestTest". Thank you in advance if anybody can clear my issue. I'm totally new to Magento. Please answer regarding Magento 1.9.


texts:
I suddenly started facing this issue. Upon going Catagog > Categories > Manage Categories, the output is something like this & none of the options are clickable:

I cleared the cache, ran reindexing, but nothing worked. None of the tabs on category page are clickable and hence I'm unable to modify any info in the categories. Please help.


texts: Class model missing even it already created

texts:
While install develop tool of Ced i getting this problem
Magento not found class even it created .

registration.php

Manager.php

How to fix it! I have check many time config , paths, registration file


texts: magento 1.8 to set multi stores with single website, is it need to create multiple website

texts:
I am creating multi store in single website in one magento 1.8 installation. I gone through with many tutorials and documents for this. I have doubt that is it necessary to create multiple website also.??

http://www.inventcommerce.com/blogs/90-setting-up-multi-storefronts-on-magento

I want to do it in single main website. Is it possible.? If I did it with multi website and single store for each and all are website are belongs to main website is it similler to my requirement???

Help me


texts: Magento: How to access magento1 developer certification?

texts:
Recently Adobe change the Magento certification name and URL, but I am still not able to find magento2 developer certification New name and How to access that.
Is magento1 certification not valid now?
If no, then how to access M1 certification URL and badges?


texts: Product always goes OUT OF STOCK in magento 2 after inserting through REST API

texts:
I have added product in my Magento 2 Store using REST API but it always goes out of stock like this.

But when i run php bin/magento indexer:reindex the product will come in stock.
Any idea why is this or i have to run indexer re-index after every insertion of product.
Any help is appriciated.


texts: Multiple Products Into one Simple Product

texts:
I would like to be able to create a bundle of products without the option to change quantity or list the items.

For example, if I am selling a knife set with multiple lengths 5", 4", 3" which can all be purchased separately, but I want to group them together and call it a set with 1 knife each without the option to choose a quantity.  Is that possible?

Thanks.


texts: Passwords in sign up email. Bad practice? PCI compliant?

texts:
We use Magento Enterprise (1.12) and I have had several customers email me already complaining that they received their password via email when they signed up for an account. I know this is considered bad practice, but comes with Magento out of the box.

I am going to change it and remove it from the email template, which is easy enough, but I was just curious why Magento does this if it's long been considered bad practice? I know there is little sensitive information stored in a users account, and we do credit card validation, but "Magento Enterprise does it that way, so it must be ok." seems like a poor answer for me to give..

Also, do many Magento developers make this a frequent 'to-do list' fix when building a new Magento site, like removing phone validation?


texts: Magento 2: "Forbidden: PHP engine is disable."

texts:
http://beepitybop.com
http://beepitybop.com/pub/static/frontend/Magento/luma/en_US/requirejs/require.js

No images or js is being loaded, but I doubt it's an issue with the symlinks or permissions like the other questions.
The error message is "Forbidden: PHP engine is disable." which is odd because PHP is indeed enabled on the server, and I'm using the default Magento .htaccess file without modifications. Any help will be appreciated.

I don't have access to php.ini. But I can set variables etc in the htaccess file.

Technology stack:
Hosting: MDDHosting;
PHP Version: 5.6;
Apache Version: 2.2.31


texts:
Magento version is 2.3.2
I use the sales_order_invoice_register event to send the invoice id to the third party API when create the invoice.
 My code in the observer is :

$invoice = $observer->getEvent()->getInvoice();
$orderId = $invoice->getOrderId();`
$invoiceNumber = $invoice->getIncrementId();

I Got the order id but Invoice id I got blank.
Does anyone have an idea how to get invoice id?


texts: Version number in custom module's module.xml and composer.json

texts:
Should the version number in custom module's module.xml and composer.json be the same?

module.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Company_Mymodule" setup_version="1.0.5" />
</config>

composer.json:

{
    "name": "Company\/Mymodule",
    "require": {
        "php": "~5.5.0|~5.6.0"
    },
    "type": "magento2-module",
    "version": "1.0.5",

In core modules I see their different, but I'm not sure what are the consequences.


texts: Magento 2 Best selling block showing products without a price

texts: In the main page of my website I have a block for the Best Selling products, but it's showing the products as it is discounted to 0


texts:
I'm trying to create an automated import system for a client's epos system using Magmi, and as far as I can tell it's correctly generating the data. However, I can't get any bundled products to show in the front end or the search, even if I create one manually.

The bundles are set to be enabled, have visibility set to catalog and search and are marked as in stock in the inventory section. The products in the bundle are all the same, in stock, visible and enabled. I've also made sure the bundle has a category set which is visible in the front end, but nothing I do seems to make any difference to whether it's visible. Is there something I need to do to enable the option of bundled products or something?

Any help is appreciated

EDIT: Forgot to mention, I've also cleared the cash and re-indexed, both through Magento itself and using the command line


texts: magento 2.2 : how to make a ajax add to cart in magento 2.2 site from an external site

texts:
I need to do an add to cart in a Magento2.2 site from an external site using ajax. I am using the following ajax code.

jQuery.ajax({
                url: "http://local.magento.com/test_us_en/checkout/cart/add/",
                type: "POST",
        dataType: 'jsonp',
        data:{
            product: 1,
            form_key:tju8cas1gG61phY6,
            qty:2,
        },
        success: function(data) {
        console.log(data);
         },
         error: function() {
         }
});

please help me.


texts: Magento 2 - Page content is not refresh if cache is enabled

texts: I have developed a custom module the retrieve data from database and displayed in a block. The data is updated in database but the page is not showing the latest data if cached is enabled. If the cache is disabled, everything just works fine. Sometimes, even cannot get the customer ID from session if cache is enabled. How to resolve this issue?


texts: How we can add unique containt for column in magento 2?

texts:
I am having custom table called channel with channel_id,channel_code,channel_name and so on. I want to make channel_code and channel_name unique by using installscript or upgradescript here is my code:

<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of InstallSchema
 *
 * @author Pramod Kharade
 */
namespace Blazeclan\Channels\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface {
    //put your code here
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) {
        $installer = $setup;
        $installer->startSetup();

        // Get tutorial_simplenews table
        $tableName = $installer->getTable('blazeclan_channels');
        // Check if the table already exists
        if ($installer->getConnection()->isTableExists($tableName) != true) {
            // Create tutorial_simplenews table
            $table = $installer->getConnection()
                ->newTable($tableName)
                 ->addColumn(
                    'channel_id',
                    Table::TYPE_INTEGER,
                    null,
                    [
                        'identity' => true,
                        'unsigned' => true,
                        'nullable' => false,
                        'primary' => true
                    ],
                    'Channel ID'
                )
                ->addColumn(
                    'channel_code',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false,'DEFAULT' => null],
                    'Channel Code'
                )
                ->addColumn(
                    'channel_name',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false,'DEFAULT' => null],
                    'Channel Name'
                )
                ->addColumn(
                    'channel_image',
                    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                    255,
                    [],
                    'Channel Image'
                )
                 ->addColumn(
                    'channel_createdby',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false, 'default' => ''],
                    'Channel Created By'
                )
                ->addColumn(
                    'channel_modifiedby',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false, 'default' => ''],
                    'Channel Modified  By'
                )
                ->addColumn(
                    'created_at',
                    Table::TYPE_DATETIME,
                    null,
                    ['nullable' => false],
                    'Created At'
                )
                    ->addColumn(
                    'updated_at',
                    Table::TYPE_DATETIME,
                    null,
                    ['nullable' => false,'default' => Table::TIMESTAMP_INIT_UPDATE],
                    'updated_at At'
                )
                ->addColumn(
                    'status',
                    Table::TYPE_SMALLINT,
                    null,
                    ['nullable' => false, 'default' => '0'],
                    'Status'
                )

                ->setComment('channels Table')
                ->setOption('type', 'InnoDB')
                ->setOption('charset', 'utf8');
            $installer->getConnection()->createTable($table);
        }

        $installer->endSetup();
    }

}

Thanks In advance!


texts: Changing template file checkout success page issue

texts:
This is my layout:

<checkout_onepage_success translate="label">
        <label>One Page Checkout Success</label>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="core/template" name="kryd_checkout_success" template="kryd/success.phtml"/>
        </reference>
    </checkout_onepage_success>

I want to change the core/template to access my block from my custom module. This is my block path:

app/code/community/KRYD/Observer/Block/Checkout/Success.php

This is my block content:

<?php
class KRYD_Observer_Block_Checkout_Success extends Mage_Checkout_Block_Onepage_Success
{

}

This is my block declaration from my config.xml:

<global>
        <blocks>
           <KRYD_Observer>
               <class>KRYD_Observer_Block</class>
           </KRYD_Observer>
        </blocks>
</global>

If i leave the core/template I get the content from my new template file.
These are what I tried:

<block type="observer/checkout_success" name="kryd_checkout_success" template="kryd/success.phtml"/>

or

<block type="kryd_observer/checkout_success" name="kryd_checkout_success" template="kryd/success.phtml"/>

If I leave the kryd_observer , it doesn't load any template. Smth I missed. Can you help me with this ?


texts: Magento 2 how to do minicart ajax update

texts:
Is there any way to update the mini cart with ajax without update button.

I am using Magento 2.1.7 how to do mini cart ajax  update when qty increment(+) and decrement(-) inside the mini cart, as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update

Thanks in advance


texts: Getting the category id does not work in 1.9.2.2?

texts:
I have a static block which looks like this:

{{block type="catalog/navigation" template="catalog/navigation/subcategory_listing.phtml"}}

I am using this block for all my categories in the Display settings tab. Now in the subcategory_listing.phtml I am trying to get the id of the current category, like this:

$catId = $this->getCurrentCategory()->getId();

As it seems, that is being cached, it always returns the id of the category I opened first after cleaning the cache. After that, it always returns the same category id.

Disabling the Blocks HTML output cache makes it work but I hope there is another solution. It worked with Magento 1.8.x.

I also added catalog/navigation to my permission_block table which did not help.

Any ideas how to solve that?


texts: How can i Redirect my sub-domain by new Domain?

texts:
I have a website called xyz.com and added additional store called abc.xyz.com.

Now I have purchased new domain 123.com.

How can I redirect my subdomain as a new domain, like if customer enter 123.com it will be redirected to abc.xyz.com, and URL should be like 123.com not changing to abc.xyz.com in the URL bar?


texts: Magento 2.3.1 CE visual swatch images showing blank

texts:
We have upgraded Magento 2.2.3 CE to Magento 2.3.1 CE recently we have been facing an issue i.e the visual swatch images are not displaying for the configurable product options on the frontend details page. Visual swatch images are showing blank. We did reindex and clear flush cache with no luck. Verified the same scenario on default magento2.3.1 CE on the local instance it's working as expected.
Please note for a simple product level we selected swatch image option settings as well.
We have an attribute called floats_floatline_size with below settings are at the attribute level
Update Product Preview Image: Yes
Use Product Image for Swatch if Possible: Yes
Please find the attached screenshots and review them and suggest.
Admin end attribute:

Configurable product options at admin end:

Frontend configurable product:

Executed command : php bin/magento catalog:images:resize
the catalog/product cache images are generated but not calling in the frontend.

varnish & cloud front cache from magemojo server UI interface but No luck

Not facing this issue on local same instance with same code and modules.

Please review and advise?


texts:
I want to make a custom csv import functionality to a custom table.

I have added the custom table using another module. But my custom import module doesn't seem to work .

I followed this link : Import-XML .

After I chose the file to import , the "please wait" message kept on running forever, my mage version is 2.1.3 and the upload file size is less than 1MB, please help.


texts: require_once app mage php not found in external file

texts:
I am using following code in external file.

<?php
require_once('../app/Mage.php');
//require_once($_SERVER["DOCUMENT_ROOT"] . '/app/Mage.php');

umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
echo $message = Mage::getVersion();
?>

When i am running my custom file from url its working.

Like www.test.com/import/script.php

But the same code not working with cron job.

There is error like PHP Fatal error:  Class 'Mage' not found


texts: Can we hide the code from user - from admin too?

texts:
We are in a process of website development (Website is not Launched yet) and I found that website development company developers are hiding code from admin panel and when we are asking them to tell us where is chat script code they said that it's all over the place and they will extra quote us for remove tracking codes -

Do we need to add chat script all over the place???


texts: how i get the json body in controller in magento 2?

texts:
<?php
 namespace VEndor\Module\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action
    {    protected $resultPageFactory;    public function __construct(
           \Magento\Framework\App\Action\Context $context,
           \Magento\Framework\View\Result\PageFactory $resultPageFactory)
       {
           $this->resultPageFactory = $resultPageFactory;
           parent::__construct($context);
       }    public function execute()    {                                $curl = curl_init();
                                    // Set some options - we are passing in a useragent too here
                                        curl_setopt_array($curl, array(
                                    CURLOPT_RETURNTRANSFER => 1,
                                    CURLOPT_URL => 'http://tgrestcURL.com/?item1=value&item2=value2',
                                    CURLOPT_USERAGENT => 'Codular Sample cURL Request'
                                ));
                                // Send the request & save response to $resp
                                $resp = curl_exec($curl);
                                // Close request to clear up some resources
                                curl_close($curl);
       }
    }


texts: shipment_type / isShipSeparately only for bundle products?

texts:
I am having the following code:

/** @var $item Mage_Sales_Model_Quote_Item */
if($item->isShipSeparately())) ...

This is checking the shipment_type field of the quote item.

Can this shipment_type ever become SHIPMENT_SEPARATELY if no bundle products are involved?


texts: display time of exception message magento 2

texts: i need to be able to increase the standard time the error message displays when customers attempt to check out uncorrectly, currently it happens far to qiuck and customers do not see the error message


texts: Magento 2.2.2 not working after the setup:di:compile

texts:
I'm working in the wamp server in window 10 and run the setup:di:compile in the shell then the site is display blank.

i also try this method - magento 2 not working after the command bin/magento setup:di:compile.

but that also not worked for me.


texts:
I'm using nginx so .htaccess will not work.

I was hoping for it to be cookie based as well.

It's not a page that has to be terribly secure. The people who are visting it would not really even know how to access it if it was just a javascript or jquery password protect like so:

http://jsfiddle.net/LpdQm/16/

How would I add my custom block into this script?

{{block type="cms/block" block_id="mggs"}}


texts: NginX .conf rewrite to remove trailing slash

texts:
We are trying to remove the trailing slash from our URLs (primarily so that duplicate content is not being served).

I know there are many tutorials about how to do this, and I have succeeded in changing the core code so all links are to non-slash URLs. However I am struggling to do the rewrites for anyone who follows a link (or enters one manually) with the trailing slash.

All the tutorials I have read say to change the htaccess file, which after much digging I found out is not being used on our server. So I’m trying to use a rewrite in the DOMAIN.conf file (which is pulled in to the nginx.conf file).

I proposed this to our server hosts;

rewrite ^/(.*)/$ /$1 permanent;

But they said: “That appears to be correct, however we do not support this.” and gave me a link to an online htaccess tester.

Currently our .conf file contains this;

server {  listen <server IP>:80;  server_name www.DOMAIN.co.uk;  root <server root>;

location / {  index index.html index.php;  try_files $uri $uri/ @handler;  expires 30d;
#auth_basic “Restricted”;
#auth_basic_user_file /var/www/htpasswd;  }

location /app/ { deny all; }  location /includes/ { deny all; }  location /lib/ { deny all; }  location /media/downloadable/ { deny all; }  location /pkginfo/ { deny all; }  location /report/config.xml { deny all; }  location /var/ { deny all; }

location /. {  return 404;  }

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

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

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

expires off;  fastcgi_pass <password>;  fastcgi_param HTTPS $fastcgi_https;  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param MAGE_RUN_CODE default;
# fastcgi_param MAGE_RUN_TYPE store;  include fastcgi_params;  }

##
# SEO REWRITES
##  ...............

(edited to remove certain things and shortened to relevant info).

Can anyone help with what the rewrite would need to be?


texts:
I am looking to add a second addtocart.phtml file to a custom product layout

I am overriding the product template fine using the below in the products "custom layout update" field

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

But i am trying to have a second addtocart file now, as i want to change the content of this file for the one layout only

i tried adding this also to the custom layout update

<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart2.phtml" />

But the add to cart button just disappears completely.


texts: Preparing request to BizTalk sever, in array via SOAP

texts:
I have tried to send request to BizTalk server via SOAP connection from Magento e-commerce system.
For sending request, I prepared array, that converted to XML on BizTalk server.
I have a big array, so I show what the array I have prepared, how converted my array on server and which xml I expected after converting.

I need to send xml with this nodes

<UnitPrice>
    <Amount currencyID="PLN">20.0000</Amount>
    <PerQuantity>1</PerQuantity>
</UnitPrice>

I have prepared this array

"UnitPrice" => array(
    "Amount" => "20.0000",
        array("currencyID" => "PLN"),
    "PerQuantity" => "2")

After sending this to server, i see in last request, that my array was converted like here

<ns1:UnitPrice>
    <ns1:Amount currencyID="PLN"/>
    <ns1:PerQuantity>2</ns1:PerQuantity>
</ns1:UnitPrice>

OR

<ns1:UnitPrice>
    <ns1:Amount>20.0000</Amount>
    <ns1:PerQuantity>2</ns1:PerQuantity>
</ns1:UnitPrice>

I have tried to send different arrays, but all the time in node converts either attribute or value.

Please answer who know how prepare array with attributes and values for correct request.


texts: how to change background color of current page number of category listing pagination, magento2

texts: I am using magento2. I want to know how to change background color of currently activated page number category listing pagination using admin panel. Is there any option to set background or I have to set it manual.


texts: Magento 2 grunt:exec removes all static files

texts: Magento 2 grunt exec:theme_name removes all static files, then adds only less files. Yesterday everything was working correctly, today suddenly it's not working. Any ideas how to fix it?


texts: How do I prevent Magento product page from refreshing on submit?

texts: I made a form to calculate the price of a product using php, when the customer types in the required values and hits the submit button the page refreshes and the box in which the price should appear remains empty. any ideas?


texts: Magento 2: Minicart is not updated for certain storeviews when adding product for the first time

texts:
II have multiple websites and storeviews in my Magento 2.2.2 installation.

I have experienced a weird issue, that for some storeviews, when adding a product to the shopping cart for the first time, the mini cart is not updated, and still showing empty cart (see screenshot).

But when I add the product again, then Minicart is updated, but the Quantity besides the minicart is showing 1, even I can see both products - the previous one, and the new one.

All my websites are using the same templates and javascripts / html. It's only the currency and language that are different.

I have tried the solution from this post Mini cart not show product when add product for first time Magento 2.1 but didn't help.

I'm using Magento 2.2.2


texts: Return JSON response instead of JSON String

texts:
I am working on building REST API which will return data of regions. API is working as expected but problem I am facing is, it is returning response with JSON string and not able to parse that. Would like to get JSON response.

webapi.xml

    <route url="/V1/getRegions" method="GET">
        <service class="Vendor\Module\Api\RegionsInterface" method="getRegions"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

Interface

<?php
namespace Vendor\Module\Api;

interface RegionsInterface
{
    /**
     * @return mixed
     */
    public function getRegions();
}

Next I added preference for interface and here is that class.
<?php
declare(strict_types=1);
namespace Vendor\Module\Model;

use Vendor\Module\Api\RegionsInterface;

class Regions implements RegionsInterface
{
    public function getRegions()
    {
        $data = [
            'status' => true,
            'message' => 'We will let you know!'
        ];

        return json_encode($data);

    }
}

When I am triggering API with above code, it returns like this,
"{\"status\":true,\"message\":\"We will let you know!\"}"

I want response to be like,
{"status":true,"message":"We will let you know!"}

Any idea how to achieve this ?


texts: Magento 2, add sku selector to custom widget

texts:
How to add below in my custom widget.xml?

below code does not have possibility of multiple products selection :(

<parameter name="id_path" xsi:type="block" visible="true" required="true" sort_order="10">
                <label translate="true">Product</label>
                <block class="Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser">
                    <data>
                        <item name="button" xsi:type="array">
                            <item name="open" xsi:type="string">Select Product...</item>
                        </item>
                    </data>
                </block>
</parameter>


texts: Magento 2 admin css and js not loading after trying to change admin URL

texts:
To change my admin_url of Magento I did it first with: Store > Advanced Tab > Admin Base URL section

After that the admin CSS and js weren't working and to solve that I tried it with the command in SSH:

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

now still no js and CSS is loading in the admin.  I tried the commands below to solve but there's still no CSS and JS in admin, in frontend everything is working:

php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:static-content:deploy -f  nl_NL

  Removing static files except .htaccess
  Reindexing

Changing the following content:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
To:
Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Can anyone help? Thanks!


texts: Is it possible for Magento 1.x payment plugin to allow the administrator to edit the app/code/../local/etc/config.xml file in the method's settings?

texts: So that the administrator of the Magento 1.x site can change the name of the payment method that comes up on the checkout page. Is it possible to offer such an option?


texts: Notice: Array to string conversion error

texts:
1 exception(s):
Exception #0 (Exception): Notice: Array to string conversion in /var/www/html/sailorplastic/vendor/magento/framework/View/Element/Html/Select.php on line 243

I get above error in Admin log magento2 when i am trying to see mailchimp store configuration setting. I have also done data migration.

How can i debug this error?


texts: Magento2 : How to remove details from shipment print shipping label

texts:
I want to remove description  from pdf file. it is generated from here. please check following path to print shipment file:

From admin menu : Sales->Shipments->click any one shipments view link now go to at shipping and payment method in that click on "print shipping label" button.

After clicked on it pdf file will be generated and in that file i want to remove DESC from file. please check following image.

Thanks in advance


texts: Using magento header and footer files outside magento in simple php file

texts:
I want to use magento header and footer files(custom theme) in my custom php file. How can I get header and footer. php file location is root folder.

I am using this code

require("app/Mage.php");
umask(0);
Mage::app();
ini_set('display_errors', 1);

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

$headerBlock = $layout->createBlock('page/html_header')->setTemplate('page/html/header.phtml');
$currencyBlock = $layout->createBlock('directory/currency')->setTemplate('currency/currency.phtml');
$headerBlock->setChild('currency_selector', $currencyBlock);
echo $headerBlock = $headerBlock->toHtml();


texts: Quote: getOrigOrderId vs. getReservedOrderId

texts:
Considering the class Magento\Quote\Model\Quote: What is the difference between the following two methods:
getOrigOrderId
getReservedOrderId
Thanks

......................................................
Is it right that a quote would have a corresponding order only after placeOrder would be called for the current quote?
Do the methods mentioned above help to fetch the corresponding order for a quote?


texts: How to get product list Magento using rest api

texts: How to get product list in magento using rest API. I need to use it for product sync . How to achieve this


texts: Which EE and CE versions need the SUPEE-3762 patch to prevent DOS attack?

texts:
It has been recently discovered that the SUPEE-3762 patch, released in August 2014 "accidently" fixed a Denial of Service exploit (see: https://www.byte.nl/blog/denial-of-service-flaw-in-magento)

Like many others we had ignored the patch because the original description did not contain this information and it was not labelled as security patch. It seemed to only fix a bug that was irrelevant if you were not using the SOAP API.

Now there is conflicting information about the versions that are affected.

The blog post linked above states

  Only Magento 1.9.0.0 and 1.9.0.1 are affected

The public download page currently offers only a patch for EE 1.14.0.1 (and nothing in the Enterprise download section):

Two days ago, before the patch description has been updated, it was CE 1.6.x - 1.9.x not true, I had confused it with SUPEE-6237.

This leaves me with the questions

Is this still the same patch file? Is this the right patch file for Magento CE ?
Do I need to patch EE 1.14.1 shops?

(for now, I will go with the safe approach and add libxml_disable_entity_loader(false); to all index.php files, but I consider this a temporary fix)


texts: Upgrade script looking for a false table?

texts:
I have a custom module that I need to update adding a couple of columns in one of the tables. The task is very easy but for some reason Magento is adding a prefix on my table name. Let me show you.

My upgrade script is as follows:

$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn(
$installer->getTable('invent_feedbanners/imagen'), 'inicia', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
    ), 'Inicia');

$installer->getConnection()->addColumn(
$installer->getTable('invent_feedbanners/imagen'), 'termina', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
    ), 'Termina');
$installer->endSetup();

When the upgrade runs Magento reports an error like this:
- SQLSTATE[42S02]: Base table or view not found: 1146 Table '255.invent_feedbanners_imagen' doesn't exist"

The name of the table is invent_feedbanners_imagen. Where does the 255 name comes from??. My installation doesnt have any prefix.

This has been breaking my head for the last 5 hours. I'm stuck on this. If somebody could help me I will appreciate it alot.

Kind Regards!


texts: Is there a way to split a customer text attribute in Magento?

texts:
I am trying to find a way to split a customer text attribute in order to display it on the frontend.

I have added a new text field to the customer address and would like to display this value on the frontend in View.phtml file. The problem is that the value is stored as a string depending on customer location for Euro we have €|c and for UK we have £|p stored in this field.

I need to some how split this value for display it in separate places.

I am using jQuery to validate a price form on the frontend. Customers from EU need to have the €|c value displayed and UK customer need to have the £|p displayed from the TextAttribute.

So I need to somehow get the customer attribute to show in the product/view.phtml file THEN split the array()

Here's my code:

    if (x<100) {
        //c OR p Value needs to go here
        validOptions.push( "<?php echo $address->getCurrency(); ?>"+x+"");
    } else {
        var y = x.toString();
        var z = y.split('');
        //£ OR € Value needs to go here
        validOptions.push("<?php echo $address->getCurrency(); ?>"+z[0]+"."+z[1]+""+z[2]+"");
    }
    x++;

Does anyone know how to do this please give me a heads up...


texts: Login as a customer from custom table in magento 1.9?

texts: I want to login with custom field from custom table in magento 1.9, how to manage session,cookies and every default functionality for custom login user.Thank you


texts: issue in placing an order through Amazon pay in magento 2.3.5 version

texts:
When i place an order through amazon pay I got below error of getAmazonOrderReferenceId null.
Fatal error:  Uncaught Error: Call to a member function getAmazonOrderReferenceId() on null in /vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php:106

anyone have an idea about this please let me konw.


texts: Magento New Products Widget Pagination not working

texts:
I am in Magento 1.9 and have added the New Products Widget to my homepage;

{{widget type="catalog/product_widget_new" display_type="new_products" show_pager="1" products_per_page="2" products_count="10" template="catalog/product/widget/new/content/new_grid.phtml"}}

Now even though I have choosen to only show 2 products per page and to display pagination all of the products just display and there is no pagination displayed anywhere?


texts: Magento 2: Disable "Cash on delivery" for downloadable products

texts:
I need to disable the CoD payment method for carts with downloadable products. I started working on a plugin, but got hung up on this - have no idea how to get product types from cart.

Any ideas?


texts: The Javascript translation in Magento 2 is buggy as hell. And I just can't get the cancel button for the minicart dialogue translated. The one when you try to delete a product from the cart. I even tried adding it manually to the js-translation.json but that does not work either. Any tips?