texts:
I looking for a Event to be triggered when a user, via adminhtml or API/SOAP, change prices of a product.

I have been check this, unsuccessfully: https://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/

If the event you are looking for does not exist, think about doing overridden the core, at the time the product is safe. What do you think of this idea?

Any idea is welcome, thank you.


texts:
I'm importing a large number of products(15-20k) using a custom module importer that uses Magento's core API.

I would like to improve the speed of the Product Importer.

When I scaled up to 64 GB RAM in AWS, the server was using only 8-10 GB RAM on average. How do I configure PHP/MySQL/Opcache to utilise the memory and CPU available?

So far, I have tested to increase the PHP memory limit, MySql buffer size. Is there a way to analyse and test different configurations?

Note:

  Large imports are one time use.


texts: magento 2 block function not calling my phtml

texts:
Magento 2 Block function not calling. How to call

PHP

<?php

namespace MPS\Allproduct\Block\New\List;

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

    protected function _prepareLayout()
    {
        return parent::_prepareLayout();
    }

    public function myTest(){
        return "Test";
    }
}

XML

<referenceContainer name="content">
            <block class="MPS\Allproduct\Block\New\List" name="allproduct_index_index" template="MPS_Allproduct::allproduct_index_index.phtml"/>
        </referenceContainer>


texts: Don't show Configurable Product Combination when not in Stock

texts:
Is it possible in a configurable Product to hide (or simply not show) certain combinations that are not in stock?

Let's say I have a shirt that has the options color and size.

All shirts are in stock and available except for the shirt that has the color red and the size XL.

When i try to add this combination of the shirt to the cart, the product page reloads and shows the message of the method getSpecifyOptionMessage().

There is no direct hint, that this combination of the product is not available and this could be confusing for the customers, since they will try it again and have no direct information, why they can't add this product to cart.

Is it possible, not to show these options / combinations that are not available? You first select the color and then the not available combinations are not displayed in the drop-down for the size?

Searched a lot for something like this but could not find anything directly related to this situation. Therefore i would be very thankful if somebody could provide any useful information or a solution for this situation.


texts: Magento 2.3.2 redirects to empty cart after successful PayPal payment?

texts:
After I updated from 2.2.3 to 2.3.2 I am being redirected to the empty shopping cart after a successful PayPal payment. The order is created normally I just get the empty cart instead of the success page. The logs contain nothing helpful.

Any ideas where to look? I emptied the cache, recompiled, deployed the content, deleted the /generated folder. Nothing helped.

Thanks!


texts: Magento 1.9 hide nav-bar (top-menu) for new controller in admin page

texts:
I have added the following code in controller page, but still the nav-bar is not hiding..

         $this->loadLayout();
         $this->getLayout()->unsetBlock('header');
         $this->getLayout()->unsetBlock('footer');
         $block = $this->getLayout()->createBlock(
            'Mage_Core_Block_Template',
            'my_block_name_here',
            array('template' => 'ddevs/example_core_block.phtml')
        );

        $this->getLayout()->getBlock('content')->append($block);
        $this->renderLayout();


texts: MaxCDN + Magento Developer> Merge CSS 404 error

texts:
I just setup my store to Use MAX CDN.
The merged CSS files does not load when the setting is ON.
The System > Configuration > Advanced > Developer> Merge CSS Files is set to Yes.

If I Set the Merge CSS Files to No.
All the CSS files load from CDN.

I've tried toggling the settings and Clearing the Cache.
Also setup CORS to set "*"


texts: How to exclude disabled or out of stock products from sitemap.xml in Magento 2.3

texts: How to remove disabled products and out of stock products from sitemap.xml. Currently, all URLs are showing in the sitemap. I am using Magento 2.3


texts: how to redirect to cart page if refreshed on checkout page magento 2

texts:
I want to redirect the user to domainname.com/checkout/cart if user refreshes the site when on domainname.com/checkout.

The reason i want to do this is because whenever a user refreshes the page all the selection like shipping, payment method and credit card details are getting cleared and i have 4 steps checkout process unlike the default which is 2 steps.Also let me know if there is any solution to stop the clearing of selection in checkout process


texts:
I am looking to completely remove any tax calculation from the cart page.  I would like tax calculation to only happen at the end of the process on the final checkout page.  I have looked at the .phtml files in /template/cart/totals.phtml but haven't found a way to edit them to remove the tax.  Ideally I would like the totals to read as following

  Product Order: $xxx  Shipping & Handling: $xx sub-total:
  $xxx

So instead of a "grand total" at the end there is just a sub-total of everything except tax.

Any ideas?
Thanks


texts: How can I get currency_conversion_rate used of the history orders at that time?

texts:
I am showing history orders as per my need but I want to know which table is having the details of the currency_conversion_rate at the time when order is placed, because I need to show all the history order and I know that the currency rate is keep on changing every second, suppose an order is placed 6 months back that time what is the entry in the database table that table name I need to know and the field also. So, that I can use it for myself.
Current currency rate
1.00 US Dollar = 74.099572 Indian Rupees
1 INR = 0.0134954 USD
This multiplier I need.

YEAR    1 USD TO INR
2010    45.73
2011    46.67
2012    53.44
2013    56.57


texts:
i have code
<?php
$filter = 'hompage_feature_2';
$product = $block->getProductCollectionHomepage($filter);
$items = [];
foreach($product as $value){
$items[] = $value;
}
$type = 'widget-new-grid';
?>

    <?php for($i=0;$i<count($product);$i++) : ?>

            <?php
            $imageUrl = $this->helper('Magento\Catalog\Helper\Image')
                ->init($items[$i], 'product_base_image')
                ->constrainOnly(true)
                ->keepAspectRatio(true)
                ->keepTransparency(true)
                ->keepFrame(true)
                ->resize(150, 150)->getUrl();
            ?>
            <a href="<?= $block->getProductUrl($items[$i]); ?>"><?php echo '';  ?>

            <a href="<?= $block->getProductUrl($items[$i]); ?>">
<?php echo $items[$i]['name']; ?>

<?= $block->shortenText($items[$i]['short_description']) ?>

            <?= $block->getProductPriceHtml($items[$i],$type); ?>
            <?= $block->getLayout()->createBlock('Magento\Catalog\Block\Product\ProductList\Item\Container')->setTemplate('Magento_Catalog::product/view/additional_info.phtml')->setProduct($items[$i])->toHtml(); ?>

    <?php endfor ?>

i want to use owlCarousel js to creat slider product but it not working. Please help me!


texts: How to clone a product to a different website

texts:
I need to write some PHP code in order to enable my collection of products to a new website (same Magento installation).

Here is the small code snippet I have written so far:

$_productCollection= Mage::getResourceModel('catalog/product_collection')
->addWebsiteFilter(1);

foreach ($_productCollection as $product) {
    // TODO
}

I'd like to avoid copying all product properties one by one: I am looking for a clone feature instead. Any link to some relevant documentation is also appreciated.


texts: How to add customer grid in custom module

texts: I want to add customer grid in custom module's tab in Magento 2.1 How can I achieve this?


texts: I am looking to combine the 2 checkout steps of Magento 2 into one page. Does anybody know a solution for this?


texts: Magento 1.9 Creating new attribute for categories and getting issue for default value in existing categories

texts:
I have created new attribute (created new module for this) for categories with "Yes / No" drop-down options but during the creations of new category its showing default value (yes) while while checking existing categories its showing "No" in drop-down. So I have to manually go to all categories and update existing categories vaules to Yes.

How I can make drop-down to show "Yes" default for existing categories too.

Please help.

My sql file (mysql4-install-0.0.1.php) during creation of module is below:

<?php
$installer = $this;
$installer->startSetup();
$attribute  = array(
    'type'                       => 'int',
    'label'                      => 'Include in Body Menu',
    'input'                      => 'select',
    'source'                     => 'eav/entity_attribute_source_boolean',
    'default'                    => '1',
    'sort_order'                 => 10,
    'global'                     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'group'                      => 'General Information',
);
$installer->addAttribute('catalog_category', 'inclde_body_menu', $attribute);
$installer->endSetup();
?>


texts: Specialprice & finalprice returns no decimals

texts:
Magento 2 returns regular price differently from special and final price. Expected result:

$product->getPrice(); // 89,95
$product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(); // 89,95
$product->getSpecialPrice(); // 49,95
$product->getPriceInfo()->getPrice('special_price')->getAmount()->getValue(); // 49,95
$product->getFinalPrice(); // 49,95
$product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(); // 49,95

Given result:

$product->getPrice(); // 89,95
$product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(); // 89,95
$product->getSpecialPrice(); // 49
$product->getPriceInfo()->getPrice('special_price')->getAmount()->getValue(); // 49
$product->getFinalPrice(); // 49
$product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(); // 49

Somehow the special and final prices get returned without decimals. I tried al kind of things with different helpers (like the taxhelper etc.), but no success. Why does Magento 2.3 keep returning the special price without decimals?

EDIT: And if this is normal behaviour, what would be the proper way to get the special and final price in my module without currency symbols etc. but including tax?


texts:
How do I display Custom Options Price Total value? I created a Custom Options with price difference of minus 100 dollars, I used negative sing (-)
and then 100 dollar. Cheaper because I have "used or return product" sometimes. Custom Options is set at Title > Condition > input type > check-box > Price -$100. The price on Front end shows in Custom Options area -$100 - how do I go about displaying a price total Value? in this case it would be...

spacial Price $300
Custom Options -$100

Value to display $200

Thank you


texts: Strange issue with Product custome attribute

texts:
From last 5 days, I am facing problem with related to product custom attribute.
I have created some extra attribute for product and "Donation"(Mandatory field) attribute is one of them. It was working fine but from last 5 days I am noticed that Product Id from 1 to 800 were not at all saving this attribute.
New product which are created now are working fine they have attribute donation and value as well.

Only for old product, When I edit them I am not seeing the donation value in text box. I need to enter it again to save it but even though the value is not saving.

Can Any one suggest me what can I do? and Why this is happening.

Note: Some days back we have edited Donation attribute and changed its validation class and made it to accept values from 10 to 100 only.

In magento if we edit the product custom attribute properties, Is there any chance of loosing data/value of previous created products?


texts: save custom field from sales_flat_order_item to sales_flat_order

texts:
I have created a set of custom variable in my sales_flat_quote_item and sales_flat_order_item and saved custom field values into sales_flat_quote_item using the observer <checkout_cart_product_add_after> as below,

        <checkout_cart_product_add_after>
            <observers>
                <ucs_catalogorder_checkout_cart_product_add_after>
                    <type>model</type>
                    <class>Ucs_CatalogOrder_Model_Observer</class>
                    <method>checkoutCartProductAddAfter</method>
                </ucs_catalogorder_checkout_cart_product_add_after>
            </observers>
        </checkout_cart_product_add_after>

Then added the same into sales_flat_order_item using below code snippet

    <fieldsets>
       <sales_convert_quote_item>
           <card_wallet_amount>
               <to_order_item>*</to_order_item>
           </card_wallet_amount>
           <card_handling_charges>
               <to_order_item>*</to_order_item>
           </card_handling_charges>
           <user_preferred_delivery_mode>
               <to_order_item>*</to_order_item>
           </user_preferred_delivery_mode>
           <message_title>
               <to_order_item>*</to_order_item>
           </message_title>
           <message_description>
               <to_order_item>*</to_order_item>
           </message_description>
           <card_library_image>
               <to_order_item>*</to_order_item>
           </card_library_image>
           <wrapper_library_image>
               <to_order_item>*</to_order_item>
           </wrapper_library_image>
       </sales_convert_quote_item>
   </fieldsets>

But after completing the payment process the same has not been saved into either sales_flat_order or sales_flat_quote


texts: Magento 2: Using a Flat Catalog is Helpful for Performance?

texts:
We can configure Flat Catalog for Category & Products from Admin -> Stores -> Configuration -> Catalog -> Catalog -> Storefront Tab.

If it improves the performance of Magento, then by default why it's value is No?

Is it required to turn up both (Category & Product) at the same time? Or I can make Category Yes & Product No.

It has the same concept as we have in Magento 1 or it different in Magento 2?

Why and when to use " Flat Catalog"?


texts: Where does images go after user uploads? - Magento 1.7

texts: I'm having an issue with the Upload feature (Magento 1.7) on Magento custom options. I'm not able to find images after customer uploads. It's nowhere to be found when I check Magento backend and my FTP account. I've checked all folders in my /media directory and can't find anything :-( Please help or advise if you can. Thank you


texts: Magento 2 adding html block to sales_order_grid

texts:
I try to add a custom HTML block to the admin order grid just above or below the row with [Create New Order] like here:

http://prntscr.com/nygenr

by overwriting Vendor/Module/view/adminhtml/ui_component/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
    <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
        <settings>
            <block name="OrderSummary" class="Vendor\Module\Block\Adminhtml\Sales\OrderSummary" /></block>
        </settings>
    </listing>

I would like to add something like we already got on Magento 1:

Appreciate with any help. Thank you.


texts: Easiest way to include _custom.less in adminhtml compile

texts:
We are in the process of building our own custom theme. We are being careful to use distinct names for all of our custom style class names.  But I noticed that when we create custom styles, they don't appear in the wysiwig when editing in the back-end.

Is there an easy way to tell the back-end to import our _custom.less from our custom theme (app/design/frontend/Magento/custom/web/css/sources/_customless) without overriding anything else in the existing backend?


texts:
I've added some images to my module eg.

view/base/web/images/some-image.png

Having run bin/magento setup:static-content:deploy I now see these have been published to the pub directory

pub/static/frontend/Magento/luma/en_US/Moxune_Moxune/images/some-image.png

I can access these from the web

https://mage2.local/static/frontend/Magento/luma/en_US/Moxune_Moxune/images/some-image.png

My question

What is the proper way to refer to these files in a .phtml file in my module?

It seems like putting the path from /static forward would be pretty hacky. My guess is there's some way to refer to the module and start off with /images or similar and provide a relative path to the files, but I'm not sure where to look for the answer.


texts: Magento 2 product Categories not loading

texts:
I have this but and I'm not sure if anyone else has it Magento 2.1.7.

Sometimes when adding or editing a product the Categories info isn't being loaded into the field.

Any help would be great thanks


texts: Magento 1.9.4.0 Checkout and cart page broken

texts: I have upgraded my website from 1.9.1.1 to 1.9.4.0. I am facing the issue of cart and checkout page get broken when the customer is logged in. If we disable the compilation or disable system log, both pages working fine.


texts: Magento2 - Refused to apply the style while adding one more website view

texts:
I have two website view with two store view each,

Now I want to add One more website with two store view I did all the configuration and can see the website view but css is missing getting error as Refused to apply style.

I am using weltpixel Pearl Theme

When I looked to the folder I can see only the first two website css is there and can't find the third one which I'm created

  pub/static/version1562780854/frontend/Pearl/weltpixel/en_US/WeltPixel_CustomHeader/css

I am stuck with this, please someone give me solution to this.

Any help would be appreciated.


texts: Magento 2: Error in setup:upgrade in magento 2

texts:
I am getting the following error during setup:upgrade:
 EDIT

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'NEW', query was: CREATE TRIGGER trg_catalog_product_entity_int_after_insert AFTER INSERT ON catalog_product_entity_int FOR EACH ROW

Can anyone please help me to know how to resolve this error.
Thanks in advance.


texts: Magento 2: A non well formed numeric value encountered

texts:
I am getting this error.
A non well formed numeric value encountered in

/Magento_Catalog/templates/product/list.phtml on line 197

using this code on list.phtml

round($productPrice / $areaprsqft, 2);

Does anyone have a solution for this?

Thanks


texts: Magento without shopping cart and affiliate tracking

texts:
I intend to use Magento for my web site , except that I wont be selling any products but will be referring to third party retailers from my web site and will be disabling the shopping cart on my web site , I want the users of my site to be treated as affiliates for my web site , the affiliates on my web site will get paid when they make a purchase on the third party site I refer them to.I myself will be a super affiliate who will be enrolled in an affiliate network .

Is it something that could be achieved using Magento?Are there any Magento extensions for this that allow you to do this?

Thanks.


texts: How do I change Magento's default page template for the product description page?

texts:
How can I change Magento's default page template for product detailed/ single/ description page?

By default, it is always pulling this template,

 frontend\MY_WEBSITENAME\default\template\page/2columns-right.phtml

What about if I want it to pull this layout instead?

2columns-left.phtml

so the path should be,

frontend\MY_WEBSITENAME\default\template\page/2columns-left.phtml

Any ideas?

EDIT:

local.xml,

<?xml version="1.0"?>

<layout>
    <default>
       <remove name="paypal.partner.right.logo"/>
       <remove name="tags_popular"/>
       <remove name="right.permanent.callout"/>
    </default>

    <catalog_category_default translate="label">
     <reference name="root">
         <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
     </reference>
   </catalog_category_default>
</layout>

EDIT 2:

catalog.xml,

change,

<reference name="root">
    <action method="setTemplate"><template>page/2columns-right.phtml</template>    </action>
</reference>

to

<reference name="root">
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>


texts:
I realized I have a lot of products that have quantity above 0 but are not in stock. So I would like to do a search in my database for products that have quantiy > 0 and stock_status 0, this is the code I am using:

UPDATE `cataloginventory_stock_status` SET `stock_status` = replace(stock_status, '0', '1') WHERE qty > '0.0000' AND stock_status = '0'

While this will find all products and change stock_status in the database, the products stock status will not change. I also updated cataloginventory_stock_status_idx but to no avail. Are there other tables I need to set stock status?


texts: How to create backorder programatically magento 2?

texts:
I am using the following code to add products to Quote object which throws an error if the product is out of stock.

/** @var \Magento\Catalog\Model\Product $product */
$product->setTaxClassId($this->getTaxClassId())
        ->setPrice($price)
        ->setSpecialPrice($price)
        ->setTierPrice([])
        ->setBasePrice($baseprice)
        ->setOriginalCustomPrice($price)
        ->setRowTotal($rowTotal)
        ->setBaseRowTotal($rowTotal);
/** @var \Magento\Quote\Model\Quote $quote */
$quote->addProduct($product, (int)$qty);

How do I override the product qty check and create a backorder for each case ?


texts: Magento register for account at checkout

texts: Does anyone know whether it is possible to move the customer registration step to the checkout like in the original Magento 1 checkout? Looking for an extension that will do this for me or advice on how I could achieve this.


texts: Magento to find shopping cart rule match by product programmatically?

texts:
Question Updated

I am being try to find the discount amount which match the shopping cart rule based on product. I replicate the module 'Shopping Cart Price Rule' to another module which i want to create my discount rule under condition tab.My new module does not have coupon code.It has rule information and  condition only.

So Here i want to get discount amount that matches my new module rule based on product details(product id, sku) with out coupon code.

/**
 * Get rules collection for current object state
 *
 * @return Mage_SalesRule_Model_Mysql4_Rule_Collection
 */
protected function _getRules()
{
    $key = $this->getWebsiteId() . '_' . $this->getCustomerGroupId() . '_' . $this->getCouponCode();
    return $this->_rules[$key];
}

Here we dont use $this->getCouponCode() to find the rule match.

Before going to replicated module, i just want to know is it possible in shopping cart price rule module.

My question is , How do i find the discount amount based on product that matches shopping cart price rule with out giving coupon code ?


texts:
I want to migrate from xcart to Magento. What steps should I follow and what can be the challenges which I can face?

If some one has done this please suggest some ideas which can be helpful.


texts: How does product image generation work in Magento?


texts:
I have override the register template in my custom theme. In this form use the validation to validate my fields but the translation of the error messages aren't showed.

I declare the function where I validate my fields by :

require([
        'jquery',
        'mage/translate',
        'mage/mage',
        'mage/validation'
    ], function ($) {
        var dataForm = $('#form-validate');
        ...
        if (dataForm.validation('isValid')) {
           ...
        }
        ...
});

I cleared caches, deploy static content by the language I used, remove js-translation.json to regenerate it (it is well regenerated with all js string content to translate)...

My translations are in my theme app/design/frontend/Vendor/themeName/i18n/xx_XX.csv


texts: How to preview front-end of Checkout Sucess Page by order id

texts:
I'm working on a module that styles the checkout success page. It's already done. I want to have a function preview in the back-end of my module that when you enter an order id and click preview, it will display the check out success page of that order in a pop-up or new tab.

Thanks!!


texts:
I have custom module in my magento store that create a form in frontend
I want to find out the form posting variables to where so when i inspecting form  the action shows this:(i am working on localhost)

  http://127.0.0.1/myproject/index.php/marketplace/seller/save/

i cant recognize where it point to??
thanks for your help!!


texts: Magento2: Getting error when add new customer from admin after migration

texts:
I am unable to add new customer in admin or unable to edit customer. i am getting this error.

Uncaught TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Element/UiComponentFactory.php on line 220 and defined in /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Element/UiComponentFactory.php:172 Stack trace: #0 /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Element/UiComponentFactory.php(220): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('unsubscribe', NULL) #1 /opt/lampp/htdocs/letoilemigration/vendor/magento/module-ui/Component/Form/Field.php(84): Magento\Framework\View\Element\UiComponentFactory->create('unsubscribe', 'Null', Array) #2 /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Layout/Generator/UiComponent.php(159): Magento\Ui\Component\Form\Field->prepare() #3 /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Layout/Generator/UiComponent.php( in /opt/lampp/htdocs/letoilemigration/vendor/magento/framework/View/Element/UiComponentFactory.php on line 172

I have removed var and genrated folder also and ran all required command but still getting this error.

Anyone have an idea for that please?


texts:
I have an issue where depending on the SKU it depends on what comes back.

I have 2 products

SKU - AFB
SKU - TUR

If I search for AFB it the search results only show that 1 product. If I search for TUR the results show 200 results and the product with the SKU of TUR is on page 3.

Is there a way to rank the product Higher as it directly matches the SKU

Screenshots of my settings are below


texts: Magento 2 Customer Rest Api Token error for some users [weird problem]

texts:
We have a mobile app for magento 2 which we communicate with magento 2 server using Rest api.

Our intent is to get customer access token by below request

https://magento.host/index.php/rest/V1/integration/customer/token/
Post request
body
{
    "username":"user12@ymail.com",
    "password":"user123"
}
Response
{
    "message": "You did not sign in correctly or your account is temporarily disabled."
}

The issue is not for all users only for a few users.One of which is our demo user account. We can't find any difference between working accounts and nonworking accounts.
Using same credentials we able to login in front end without any issues. The issue is when trying via rest api.


texts: Add programatically a text swatch option attribute

texts:
I can use the method addAttributeOption() from Magento\Eav\Setup\EavSetup to add options to a dropdown attribute, something like this:

$this->getCategorySetup()->addAttributeOption(
    [
        'attribute_id'  => $this->getAttribute($attributeCode)->getAttributeId(),
        'order'         => [0],
        'value'         => [
            [
                0 => $label
            ],
        ],
    ]
);

Now, how can I add an attribute option to a text swatch, including its swatch label?

Using Magento 2.1


texts: Magento .htaccess Response for preflight has invalid HTTP status code 400

texts:
I am doing a rest call from Magento to Angular 2.

I am facing this CORS issue and trying many workarounds but nothing seems to work.
Figured out its server side issue and made the below changes in htaccess of magento as:

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
    Header set Access-Control-Allow-Credentials true

...
</IfModule>

To give a brief, my frontend logic looks like:

export class ProductService {
public _productUrl = 'http://1.2.../Mage_ang2/index.php/rest/V1/customers/1';

constructor(private _http: Http) { }

getProducts(): Observable<IProduct[]>
{

    let headers = new Headers({
    'Content-Type': 'application/json',
    'Authorization':'Bearer ntthnrbj1uam2tuv1ekva7n8jh18mcnkby3'
});

 return this._http.get(this._productUrl,{headers:headers})
    .map(response => {
        return response.json();
    });
}

My broswer still throws the CORS error:

  OPTIONS http://1.2.../Mage_ang2/index.php/rest/V1/customers/1 500 (Internal Server Error)

  XMLHttpRequest cannot load http://1.2.../Mage_ang2/index.php/rest/V1/customers/1. Response for preflight has invalid HTTP status code 400

Below are the checks/fixes i tried:

1) Added the request headers as shown in magento's project folder .htaccess.

2) Changed _productUrl from http to https in frontend logic

3) Did went through Google about Prefetch and CORS issue, found out no errors in apache logs as well.

4) Tried adding this too in htaccess:

  Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS

My browser shows response headers has Access-Control-Allow-Origin:*


texts:
I have a Magento 1.9 and it does not show the button to print order pdf in orders. How I can enable this?

Thanks


texts:
I am using TinyMCE4 in my Magento admin panel. I want to allow <style></style> for my CMS pages and blocks while editing. I am able to add <style> in my CMS pages and Blocks but once the block or page is saved, the <style> tag gets hidden.

I have checked with database that it stores my  tag with other data and my frontend also reflects the stylesheet. When I try to edit a page or static block again, the style tag is not visible to admin.

I have used

inline_styles : 1, // or true
keep_styles : 1, // or true

in my tinymcs4Adapter.js file but still the tags are not showing in editor area.

  NOTE: If I use tinyMCE3 as my editor, <style> tags are displayed
  correctly but I don't want to use it as its deprecated.


texts: error 404 after login to admin, nginx and index.php issue, how to solve

texts:
I did set NGINX for my server, and use DirectAdmin, also I changed nginx.conf for Magento configs, everything is ok but I have a problem with admin area!

I can not login to dashboard, login page appear only when I write in url admin without index.php, example:

http://www.example.com/adminurl/

but when I click on login, then url change to:

http://www.example.com/index.php/adminurl/

and page return 404 error!

How can I solve this issue?

Use NGINX instead of apache and in frontend every link work as well, but all of them working without index.php


texts: Transparent Minicart Issue (Magento 1.9)

texts:
I'm having an issue where when I click or hover over the minicart at the top of the page that it appears transparent, I've got this store set up on a multi-site and don't have this problem with the other sites I have running even though the app and skin folders are basically copy and pasted from store to store,

I haven't been able to find any help regarding this anywhere so any advice would be greatly appreciated,


texts: Magento On First Load Some ESI Blocks Slow

texts: Hi we are using Magento 1.9 with Turpentine Varnish. When varnish serves non cached pages some ESI blocks load very slow. Is there any way to diagnose and fix this issue? One of the suspected ESI blocks is 'global_messages' template which load core/messages block.


texts: Info Block Not Showing in Onepage checkout in Custom Payment Module

texts:
I am using Magento 1.7.0.2.I have created a custom Payment Model.All are working fine but the values entered for the fields in checkout page are not displaying in Info Blocks.I have attached my block and view files.Please check and suggest whether am i doing anything wrong.

My view file(pay.phtml)

<?php $_code = $this->getMethodCode() ?>
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">

        <label for="<?php echo $_code ?>_bank_name" class="required">*<?php echo $this->__('Bank Name#') ?>

            <input type="text" title="<?php echo $this->__('bank_name#') ?>" class="input-text required-entry" id="<?php echo $_code ?>_bank_name" name="payment[bank_name]" value="<?php echo $this->htmlEscape($this->getInfoData('bank_name')) ?>" />

        <label for="<?php echo $_code ?>_routing_number" class="required">*<?php echo $this->__('Routing Number#') ?>

            <input type="text" title="<?php echo $this->__('routing_number#') ?>" class="input-text required-entry validate-digits" id="<?php echo $_code ?>_routing_number" name="payment[routing_number]" value="<?php echo $this->htmlEscape($this->getInfoData('routing_number')) ?>" />

        <label for="<?php echo $_code ?>_account_number" class="required">*<?php echo $this->__('Account Number:') ?>

            <input type="text" title="<?php echo $this->__('Account Number') ?>" class="input-text required-entry validate-digits" id="<?php echo $_code ?>_account_number" name="payment[account_number]" value="<?php echo $this->htmlEscape($this->getInfoData('account_number')) ?>" />

        <label for="<?php echo $_code ?>_name_on_account" class="required">*<?php echo $this->__('Name On Account') ?>

            <input type="text" title="<?php echo $this->__('Name On Account') ?>" class="input-text required-entry" id="<?php echo $_code ?>_name_on_account" name="payment[name_on_account]" value="<?php echo $this->htmlEscape($this->getInfoData('name_on_account')) ?>" />

    <?php echo $this->getMethod()->getConfigData('message'); ?>

Info Block file(Pay.php)

<?php

class Excellence_Pay_Block_Info_Pay extends Mage_Payment_Block_Info
{

    protected function _prepareSpecificInformation($transport = null)
    {
        if (null !== $this->_paymentSpecificInformation)
        {
            return $this->_paymentSpecificInformation;
        }
        $info = $this->getInfo();
        $transport = new Varien_Object();
        $transport = parent::_prepareSpecificInformation($transport);
        $transport->setData(array(
            Mage::helper('payment')->__('Bank Name') => $info->getPayBankName(),
            Mage::helper('payment')->__('Routing Number') => $info->getRoutingNumber()
        ));
        return $transport;
    }

}

Thanks in Advance!


texts: Inserting block with referenceContainer reorders existing elements

texts:
I tried to insert an additional button on the wishlist page, but when I do that for some reason the order of all elements in a certain container gets reversed (that includes <script> elements!). What I did is something like this:

<?xml version="1.0" encoding="UTF-8" ?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="customer.wishlist.buttons">
            <block after="-"
                name="mycompany.blockname"
                class="MyCompany\ModulName\Block\BlockName"
                template="MyCompany_ModulName::template.phtml" />
        </referenceContainer>
    </body>
</page>

The button works alright, but now the Page title is below everything else on the page.

Compare this: https://i.imgur.com/rv0iH74.png

With this: https://i.imgur.com/mqndlHj.png


texts: Adding price groups by sku and the fastest way possible

texts:
UPDATE

My Magento installation was not happy with me trying out all kinds of stuff, so I restarted the server and I got this to work.

$groupProperties[] = [
    'website_id' => '0',
    'cust_group' => $group->getId(),
    'price' => $itemPrice
];

$product->setGroupPrice($groupProperties);
$product->save();

I will test later if the answer provided by Paj has a performance gain.

Original post

I have now searched the whole internet thin and I'm about to go crazy. I can not seem to find any good documentation (please link if you know any good sites)

I have an array with custom price group names, the prices for the user added to this price group and a SKU for finding the product in Magento.

I should probably say, that it's an import from Microsoft Navision, so I don't have the id of the product available, only the SKU.

The array structure:

$prices[$sku][$customGroupName] = $priceForOneItem;

Ex.: $prices['T5329786']['NAV-568245'] = '120.00';

I have tried this:

foreach($prices as $sku => $groupAndPrice){

    $catalog = Mage::getModel('catalog/product');
    $productId = $catalog->getIdBySku($sku);
    $product = Mage::getModel('catalog/product')->load($productId);

    foreach($groupAndPrice as $magentoGroupName => $itemPrice){

        $group = Mage::getModel('customer/group')->load($magentoGroupName, 'customer_group_code');

        $store_id = 0;
        Mage::getSingleton('catalog/product_action')->updateAttributes(
            [$productId],
            [
                'cust_group'    => $group->getId(),
                'price'         => $itemPrice
            ],
            $store_id
        );

    }
}

This sadly doesn't work. I have also tried $product->setGroupPrice() and I can not get that to work either. I'm using Magento 1.9.0 by the way.


texts: Magento 2 .focus() not working in template

texts:
I have this template:

CODE PHTML:

<div>
    Content  // this line is OK
</div>

<script type="text/javascript">
    require(['jquery'],function($){
        $(window).load(function() {
            alert("test"); // this line is OK
            $('input').focus(function(){
                console.log("test");  // this line is NOT OK
            });
        });
    });
</script>

I can't execute the line of code for inputs
I do not receive any error but I do not working.

I tried with setTimeout() but it still doesn't work.

If you run the line in the console in Chrome then everything is fine.

Do you have any idea how I can solve this problem?

Thanks in advance!


texts: How to add custom validation rules in Magento-2

texts:
I have written rule.js file in following path.

app/design/frontend/package/theme/Magento_Ui/web/js/lib/validation/rule.js

add following code in rule.js

"mobiletendigit": [
        function(value) {
            return value.length > 9 &&  value.length < 11
            && value.match(/^(?:(?:\+|0{0,2})91(\s*[\ -]\s*)?|[0]?)?[789]\d{9}|(\d[ -]?){10}\d$/);
        },
        $.mage.__('Please specify a valid 10 digits mobile number')
        ]

add mobiletendigit class to input field.

<input type="text" name="telephone" value="<?php echo $block->escapeHtml($block->getAddress()->getTelephone()) ?>" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" class="input-text required-entry mobiletendigit validate-digits <?php /* @escapeNotVerified */ echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>" id="telephone" data-validate="{required:true, 'mobiletendigit':true}">

add following tag to form.

data-mage-init='{"validation":{}}'


texts: Magento2.3 override issue of skuswitch.js

texts:
Magento2.3 getting below error

Also, following error while adding config product to cart
knockout.js:3381 Uncaught TypeError: Unable to process binding "if: function(){return getConfigurableOptions($parent).length || getCustomOptions($parent).length }"
Message: Unable to process binding "text: function(){return initOptions($parent) }"
Message: Cannot read property '56' of undefined
    at $.<computed>.<computed>.<anonymous> (skuswitch.js:12)
    at $.<computed>.<computed>._reloadPrice (wrapper.js:78)
    at $.<computed>.<computed>._configureElement (configurable.js:270)
    at $.<computed>.<computed>._configureElement (widget.js:100)
    at $.<computed>.<computed>.<anonymous> (configurable.js:229)
    at HTMLSelectElement.proxy (jquery.js:535)
    at Function.each (jquery.js:376)
    at jQuery.fn.init.each (jquery.js:142)
    at $.<computed>.<computed>._configureForValues (configurable.js:225)
    at $.<computed>.<computed>._configureForValues (widget.js:100)

Below is the code for skuswitch.js

var stockMessageFlag = this.options.spConfig.stockmessage[this.simpleProduct];


texts:
I have the code in my REST api:

protected function _create(array $filteredData)
{
    $customerId = $this->getRequest()->getParam('id');
    $customer = Mage::getSingleton('customer/customer')->load($customerId);

    if (!$customer) Mage::log("Customer with '$customerId' id not found",null,'error.log',true);// throw exception

    $requestData = $this->getRequest()->getBodyParams();
    $productId = isset($requestData['id']) ? $requestData['id'] : null;
    /** @var Mage_Catalog_Model_Product $product */
    $product = Mage::getModel('catalog/product')->load($requestData['id']);

    if (!$productId) Mage::log("Product with '$productId' id not found",null,'error.log',true);// throw exception

    /** @var IntegerNet_PamonoWishlist_Model_Wishlist $wishList */
    $wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer, true);
    $wishListItemCollection = $wishList->getItemCollection();
    foreach ($wishListItemCollection as $item)
    {
        if($item->getId() === $productId)
        {
            return 'OK';
        }
    }

    $item = $wishList->addNewItem($product);
    $log = sprintf(
        'Item has "%s" type, it is %sempty, its content is: "%s"',
        gettype($item),
        empty($item) ? '' : 'not ',
        json_encode($item)
    );
    Mage::log($log, null, 'messages.log', true);
    $wishList->save();

    return 'OK';
}

After save, have no items in my wishlist.
I messages.log have:

Item has "object" type, it is not empty, its content is: "{}"


texts: Footer empty, static blocks not showing up

texts:
Good morning,
it seems my footer content has disappeared and I don't know where to.
I want to put the newsletter module in there, but it completely vanished.
here's the code that I added temporarily which is supposed to make it show up.
It's not working. (I found that code off of Google, but most results seem to be 2009 or 2010)

{{block type="newsletter/subscribe" name="footer.newsletter" template="newsletter/subscribe.phtml"}}

for the static block and

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

for the CMS page.
I've checked if the phtml and xml files have their necessary bits of code in them; subscribe.phtml is still "out-of-the-box", and once again, it is there

    <default>
    <reference name="footer">
        <block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" before="-" template="newsletter/subscribe.phtml"/>
    </reference>
</default>

Can you help me figure out how to show the newsletter module (or static blocks in general) in the footer as it is supposed to be, please?
Much appreciated, thanks.


texts: Magento 2 Create order from admin user using rest API

texts:
I want to create orders from admin on behalf of a customer by using REST API. I have created cart and added items by using the below code.

$userData = array("username" => "admin", "password" => "admin123");
$baseUrl = 'http://test.com/';

$ch = curl_init($baseUrl."rest/V1/integration/admin/token");

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Lenght: " . strlen(json_encode($userData))));

$token = curl_exec($ch);

/* Create empty cart for the guest customer  */
$ch =  curl_init($baseUrl."rest/V1/guest-carts/");

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$result = curl_exec($ch);
$cartId = json_decode($result);

How can I assign customer to this cart,assign address and place the order?
Please help me


texts: Programmatically add items to cart and assign to guest user

texts:
I got the code working for creating quote object and quote item object, and I'm able to create quote successfully which I could confirm it by checking the database, I also created cookie named front-end. All I need now is to assign the created quote to the guest user, so that I can let the user checkout as guest, but couldn't assign the cart to the guest user.

Request for items in the cart will be coming from 3rd party site via JSON request which I have decoded and looped through.

Here is the code

session_name("frontend");

session_start();

$cartInfo = $_GET['items'];

require_once '../app/Mage.php';

Mage::init('default');

$session = Mage::getSingleton('customer/session');

Mage::getSingleton('checkout/cart')->getQuote();

foreach ($cartArray as $key=> $value) {
        $productId = $key;
        $productQuantity = $value;
        $productModel = Mage::getSingleton('catalog/product');
        $productObj = $productModel->load($productId);
        if (!$quoteObj) {
            $quoteObj = new Mage_Sales_Model_Quote();
        }

        $store_id = Mage::app()->getStore()->getId();
        $storeObj = $quoteObj->getStore()->load($store_id);
        $quoteObj->setStore($storeObj);

        $quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
        $quoteItem->setQuote($quoteObj);
        $quoteItem->setQty($productQuantity);
        $quoteItem->setStoreId($store_id);

        $quoteObj->addItem($quoteItem);
        $quoteObj->setStoreId($store_id);
        $quoteObj->collectTotals();
        $quoteObj->setCustomerId(null);
        $quoteObj->save();
        $quoteId = $quoteObj->entity_id;
        echo $quoteObj->entity_id.'**
';
        echo $quoteItem->item_id.'---
';
}


texts: multi-store with an sub-directory nginx php-fpm

texts:
I have an EC-2 instance on AWS with NGINX and PHP-FPM running Magento 1.9

The need arose to create a multi store system using a sub directory.

mydomain.com = default store
mydomain.com/teen = teen store

How do I set?


texts: Adding custom fields on checkout and save to database on magento 2.1

texts:
I have added custom fields on checkout page. The fields are displayed properly. But I want to save the custom fields to database too.
I found some guide to do that but no luck.
Can anybody have insight on it? Please help.


texts: Magento 2.2 : New features for Community Edition

texts: I am looking for new features that have been added for Magento 2.2 CE since 2.1.x and whether or how will it change anything major for Magento developers.


texts: In customer edit page from backend in shopping cart tab why all quote display if customer hasn't any item in their cart in Magneto2?

texts:
If customer hasn't any item in their cart, from the backend customer edit page -> shopping cart all the quote display.

what is exactly this?


texts: Magento + HTTP/2, anyone noticed any issues?

texts: Since Apache now properly supports HTTP/2, have any of you already tried running it and noticed any improvements and/or issues for Magento 1.9.x.?


texts: How to determine all blocks and child blocks attached to a handle?

texts: Is there a way to determine which blocks are attached to a handle and/or what child-blocks a block have?


texts: Magento2.0.6 Responsive Menu doesn't work, body class still there after "click" to close

texts:
In Luma of Magento2 theres a build in responsive burger-menu included.

We have the problem that once you open the nav, the body class get the classes nav-before-open nav-open, and if you click on it again, those classes are meaned to be removed. But at least nav-open stays where it is, making it hard to work with it.

Is anyone having the same problem? How to solve it?


texts: Can We Assign Multiple Attribute Set To One Product?

texts:
It is possible to assign more than one attribute set for the product one for the color swatches and one for the google map on the main product details page?

I want to do this one on magento 1.9


texts: Data Migration Tool - /app/etc/local.xml not have crypt key!

texts:
I have a problem for magento migration 1.9.2.1 to 2.3.3..

I need the magento 1.9.2.1 encryption key, but my app/etc/local.xml not contain key string! It's just don't have the line! How it is possible?

Have another place the key is stored? Or an option for regenerate this key?4

My local.xml looks like :

    <?xml version="1.0"?>
<config>
    <global>
        <install>
            <date><![CDATA[Wed, 27 Oct 2010 00:48:54 +0000]]></date>
        </install>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[xxxxxx]]></username>
                    <password><![CDATA[xxxxxxx]]></password>
                    <dbname><![CDATA[xxxxx]]></dbname>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>
     </global>
     <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
     </admin>
</config>

Anyone know how I can solve this?

Thx!


texts: I run a wholesale shop and I allow some of my customers credit payment, for those specific customers I want to show them a two line message in invoice. Can we do it by tweaking the files of PDF Printouts in Magento Core?


texts:
I am kinda new in Magento and I have been searching for the query over the internet for the passed few days regarding the "Least selling products" in Magento or a list of products that are not sold or at least have the fewest quantity sold and i have not been that lucky enough to find one.

My first attempt was just to reverse the query from best selling products (sales_flat_order_item) but the problem is that I would only be getting a list products that are sold with the least quantity not the products which were not sold or 0 quantity sold.

Can anyone at least give me some an idea or tips on how to start this one?

Thank you in advance.


texts: Magento 2: Update the Add to Cart button

texts:
I've updated the magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js file and have saved it in the VENDOR/THEME/Magento_Catalog/web/js/ folder. Unfortunately, I don't think I've saved it in the correct folder, as I'm not seeing the updates on the frontend?

Which folder should it be saved to?


texts: Getting the order object in the observer issue

texts:
This is the event that I used: sales_order_save_before and this is my function:

  public function test(Varien_Event_Observer $observer)
    {
        $order = $observer->getEvent()->getOrder;
        var_dump($order->getData('created_at'));  // this is null
        var_dump($order->getIncrementId());  // this is good, i got a value
        var_dump($observer->getEvent()->getData('created_at')); // this is  null
        exit();
    }

When I press the place order button an ajax request is made: /checkout/onepage/saveOrder/form_key/eKIOUrQBzrvNCYdY/

If I do a var dump of order->getData(), it simply takes too long to display the result in the firebug . I waited more then 5 minutes so I stopped.

My question is how do i get the created_at value from the order ?

Thx


texts: How to call Admin Backend Controller via cron job in Magento 2

texts:
I want to automate the import in magento 2.

How can I call

  vendor/magento/module-import-export/Controller/Adminhtml/Import/Validate.php

via cron?


texts: Shipping - price vs destination with more results

texts:
This is my tablerates.csv, for backend;:

"ITA","*","*",0,7
"ITA","*","*",18,4
"ITA","*","*",75,0

For example, if cart's amount is 66,94 euro, shipping cost is 4.

Anyway, It not works fine. I see that this is the query of Carrier/Tablerate model:

SELECT `shipping_tablerate`.* FROM `shipping_tablerate` WHERE (website_id=1) AND ((dest_country_id = "IT" AND dest_region_id = 260 AND dest_zip = 00018) OR (dest_country_id = "IT" AND dest_region_id = 260 AND dest_zip = '') OR (dest_country_id = "IT" AND dest_region_id = 0 AND dest_zip = '') OR (dest_country_id = "IT" AND dest_region_id = 0 AND dest_zip = 00018) OR (dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '')) AND (condition_name = "package_value") AND (condition_value <= 66.94) ORDER BY `dest_country_id` DESC, `dest_region_id` DESC, `dest_zip` DESC LIMIT 1

So, it returns only first record, but this isn't the right record: the query not order by condition_value DESC.
So, it returns only a first,  randomic, row.
Why the Magento's developer set the query so? My csv/my purpose (3 range for every country/province) is wrong?
Thanks!


texts: How to create a native like-button (Not Facebook like button)

texts:
I am not sure if I am looking for the wrong term, or we really do not have any extension or tutorial on how to create a native like-button in Magento.

Is there any way to create a like-button that is native, and users can like products simply by clicking on a "heart" icon (for example) in the product's page and be able to see what products they liked in their profiles?

Please note that I am not looking for a Facebook or any other third-party integration, but a "native" like-button.

Thank you in advance.

Update:

My intention is to create a like-button that coexists with the "Save for later" button. For the "Save" button, I am using the wishlist feature, but I am not able to transform the wishlist into a like feature since it is already being used as a "save-for-later" feature.


texts:
I am new to magento and have no concept of MVC, but i been given a job to work on it, that mean to understand it and implement the specification, now i feel too stressed as i really want to understand the magento "Beast", i have been following Tuts+
Magento Fundamental and i picked up a lot. YEt everything is vague because "Hello World" isn't a cup of tea that goes into real world. I really want more in depth tutorials where i know more of breakdown e.g

I want to know how Model, controllers and view work together to feed data,function to given html element, how does it know how to map data to the fields.
How to make extra menu and link to it.
What is more practical way of using model, controllers, resource etc. besides just a "Hello function".
How do we know which method to apply or what to ask for when we say getABC() etc.

and many more point to make the store with a great functionality.I understand it won't be too quick to get it all down, but I am too much keen to lose my sleep over learning it and making myself proud.I am pretty new to Magento but had a fair knowledge of creating blocks, helpers, controllers etc. I am still fuzzy over example set even by Magento to make a module which just says hello world as explained in "Magento Fundamentals", I want to take a real-life approach to learning Magento e.g displaying users information like a profile, a way to update it, get products which a user order and history etc.
How can I map my values to the right field while creation of a form?  e.g
First name: first name
Last name: last name
Address: address
Etc

Where will they go in, in Blocks, or controllers? How do I make a layout to make a form? I know things like loadLayout and renderLayout that produce layout but how to use the fields in that form or layout map out to the fields I require or even display a custom menu which can perform a different action such as

  Account summary Account history Order history

Etc. Like I said I been following "Magento Fundamentals" by MagentoU and cannot seem to answer these questions.

Edit : Can it be i am don't have understanding of MVC, i follow Treehouse and Lynda for tuts, but no MVC PHP tuts over there. Only ASP.net tuts. I found this link for MVC but only if it is worth it?

Update : After exploring many links, i am still confused over why Model and controllers are used. How can we map information about a customer or a dashboard to user who has logged in, the example provided have examples like getProduct(1), how will magento know which id to look for and use and work against it. So what i mean to say is, what kind of data is stored in
1. models,
2. controllers,
3. I know references is use to get block already defined in xml but a practical real life example would be good.


texts:
I have a site that we recently upgraded from 1.7 to 1.9 however when trying to register as a new customer I get the error message that the passwords must match. I have checked each of the files and its not a form key issue. I have also checked the sessions in Magento Admin and it all looks okay to me.

Any idea of what the issue could be?


texts: How to get products list with details by category_id from rest api of magento 2.0?

texts:
https://www.example.com/index.php/rest/V1/categories/[category_id]/products
it is only returning me a list of SKU.
I need all products with details by categry_id


texts: programmatically get the shipping tax by order increment id

texts:
how can i programmatically get the shipping tax from an order increment_id in magento?

I try this script, but seems not to work.

$order = Mage::getModel('sales/order')->loadByIncrementId("increment_id");
$taxRefunded = $order->getTaxRefunded();

Thanks


texts: I have created a test store to test theme and plugins at and this test store is reside same directory where my live website is present my live website url is  and test store url is https://test.royalcandycompany.com/ all going well untill i open backend but after login it will redirect to the admin panel of my live website https://www.royalcandycompany.com/index.php/admin/dashboard/ to solve this problem i have changed the base url in core config table of database but it is still redirecting to same url. so please any one help me in this problem


texts: How to manually download extensions from Magento installation and install in another

texts: I'm trying to move all the extensions from our main site to our development site. I found the extensions in app/code/community.. can I just copy and paste them in the same file path on the development site and they be installed?


texts: How to get the category ID from the Magento 2 Admin Panel

texts:
Need help to get the Category ID in Magento 2 through the Admin Panel.
- is there a way to get it through URL?
- through inspect the markup of the page.


texts: Checkout: shopping cart price rule is only applied after pressing the 'update cart' button

texts:
I'm running Magento 1.9.2.2. and I've added a shopping cart price rule:

If the customer buys more than one t-shirt, he should get a discount of 10$ per t-shirt. The t-shirt is a configurable product (the linked simple products are f.e. green t-shirt in S, red t-shirt XL,...). Now the customer can either get 2 red t-shirts in S (1 item, quantity 2) or 1 red shirt in S and 1 black t-shirt in XL (2 items, each quantity 1). He should get the discount of 10$ per t-shirt in both cases.

I didn't find a way to check if the customer has 2 or more of those skus in his shopping cart, but I found a way to cheat: As I don't use the weight attribute at all, I gave all those t-shirt products a weight of 1 and checked that in the conditions tab of the price rule:

 If ALL of these conditions are TRUE:

      Total Weight equals or greater than 2

This way I can find out if the customer has more than 2 t-shirts in his shopping cart. Now in the Actions tab of the price rule I apply the rule to the t-shirts:

 If ANY of these conditions are TRUE:

      SKU is one of t-shirt-green-S,t-shirt-green-M,t-shirt-green-L,...

Lo and behold, the customer gets a fixed amount discount of 10 per t-shirt, if he has more than 2 in his shopping cart, which is working fine...

...but when I open the shopping cart page the rule is not applied immediately. I have to press either the 'update cart' button or change the quantity of an item and press 'update'  - then the discount is shown and applied.

If I create a simple price rule (f.e. 10 $ discount for any item) and go to the shopping cart page, the discount is shown immediately, no need to update the cart.

I know that I probably defeated myself somehow, but I have no idea how :) - so how do I get rid of that 'update cart' problem? Many thanks in advance!


texts: Magento Coupon Codes Not showing up in Report

texts: I have set up various coupon codes in Magento, all work ok. However not all of them show up in the 'Coupon Usage Reports' page. They have all been made exactly the same way. Why is this?


texts:
How to move cart in navigation section.Can any one help me thanks in advance.I try this code but does not work.

<move element="minicart" destination="navigation.sections" />


texts:
How should it look like in the Magento Admin, if I have added some configurable attributes and/or simple products to a configurable?

I am trying to add simples to my configurable programmatically, and do not know how to test it...


texts: Copy custom data from quote to order and order item once order is placed in magento2

texts:
I am building a custom module in magento 2 that have a custom discount. I am trying to copy the discount from quote, quote item to order and order item.
In magento 1, I declare in config.xml like this:

<fieldsets>
    <sales_convert_quote_address>
        <custom_discount_amount><to_order>*</to_order></custome_discount_amount>
        <base_custom_discount_amount><to_order>*</to_order></base_custome_discount_amount>
    </sales_convert_quote_address>
    <sales_convert_quote_item>
        <custome_discount_amount><to_order_item>*</to_order_item></custome_discount_amount>
        <base_custom_discount_amount><to_order_item>*</to_order_item></base_custom_discount_amount>
    </sales_convert_quote_item>
</fieldsets>

and my custom discount amount was copied to tables: sales_flat_order and sales_flat_order_item as expected.

In Magento 2, I created a file name: fieldset.xml with this code:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Object/etc/fieldset.xsd">
<scope id="global">
    <fieldset id="sales_convert_quote_item">
        <field name="custom_discount_amount">
            <aspect name="to_order_item" />
        </field>
        <field name="base_custom_discount_amount">
            <aspect name="to_order_item" />
        </field>
    </fieldset>
      <fieldset id="sales_convert_quote_address">
        <field name="custom_discount_amount">
            <aspect name="to_order" />
        </field>
        <field name="base_custom_discount_amount">
            <aspect name="to_order" />
        </field>
    </fieldset>
</scope>

but there is no success.
What else I need to do in magento 2 to make it works? Can you guys please help me?


texts: Configurable product not showing in frontend Even when it is stock

texts: I have some configurable products. And they are not showing in frontend. In cataloginventory_stock_item table is_in_stock is set to 1. but for some reason after reindexing in cataloginventory_stock_status table stock_status is set to 0 for some of these products. What could be the reason. Is it a bug in magento2 or I m missing something.


texts: mysql 5.5 or 5.6 is better for magento 1.9.1

texts:
Can someone tell me which mysql version provides better performance for magento 1.9.1?

Mysql 5.5 or 5.6? Thanks


texts: Strange Error - Please help understand this

texts:
I am trying to write a direct query in Magento and it is working fine in my local but in the test environment it is giving the following error:

Fatal error: Uncaught exception 'Exception' with message 'Warning: simplexml_load_string(): Entity: line 36: parser error : expected '&gt;' in /var/www/html/lib/Varien/Simplexml/Config.php on line 510' in /var/www/html/app/code/core/Mage/Core/functions.php:245
Stack trace:
#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/var/www/html/l...', 510, Array)
#1 /var/www/html/lib/Varien/Simplexml/Config.php(510): simplexml_load_string('<?xml version="...', 'Mage_Core_Model...')
#2 /var/www/html/lib/Varien/Simplexml/Config.php(498): Varien_Simplexml_Config->loadString('<?xml version="...', 'Mage_Core_Model...')
#3 /var/www/html/app/code/core/Mage/Core/Model/Config.php(277): Varien_Simplexml_Config->loadFile('/var/www/html/a...')
#4 /var/www/html/app/code/core/Mage/Core/Model/App.php(380): Mage_Core_Model_Config->loadBase()
#5 /var/www/html/app/code/core/Mage/Core/Model/App.php(268): Mage_Core_Model_App->_initBaseConfig()
#6 /var/www/html/app/Mage.php(616): Mage_Core_Model_App->init('', 'store', Array)
#7 / in /var/www/html/app/code/core/Mage/Core/functions.php on line 245

I have not touched Magento core files.


texts: Magento 2: "Use Categories Path for Product URLs" configuration does not working correctly

texts:
I have a store with few categories. I want to have only one url for each product - domain.com/product_name.html. I don't want to have products URLs with the category path in them.

I set “Use Categories Path for Product URLs” to "NO", but when I am saving any category it is creating the Catalog URL Rewrites for all the products of that category i.e. one regular url (domain.com/product_name.html) and one for each category path (domain.com/category_path1/product_name.html)

(domain.com/category_path1/category_path2/product_name.html).

Magento Version: 2.1.5


texts: Inline translation tool is not working and i can't enable it

texts:
Can't use inline translation tool in front end of my webpage. Its working fine in backend.
I checked on the frontend if System>Config>Advanced>Developer>Translate Inline>"Enabled for Frontend" is enabled, but it wasn't.
Soo... something is just not working here.

I'm asking you to help me out.


texts: Magento 2.3 - Add attribute group name on compare products page

texts:
We want to implement the attribute group name on the compare product page and separate all attributes based on the attribute group.

We use the following code to show the attribute group name on the specifications section on the product page.

How can we implement this on the product compare page?

CODE;

<?php
namespace AttributeGroup\Module\Block\Product;

class Specification extends \Magento\Catalog\Block\Product\View
{
     /**
      * @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory
      */
     protected $groupCollectionFactory;

     public function __construct(
         \Magento\Catalog\Block\Product\Context $context,
         \Magento\Framework\Url\EncoderInterface $urlEncoder,
         \Magento\Framework\Json\EncoderInterface $jsonEncoder,
         \Magento\Framework\Stdlib\StringUtils $string,
         \Magento\Catalog\Helper\Product $productHelper,
         \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig,
         \Magento\Framework\Locale\FormatInterface $localeFormat,
         \Magento\Customer\Model\Session $customerSession,
         \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
         \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
         \Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory $groupCollectionFactory,
         array $data = []
    ) {
        parent::__construct($context, $urlEncoder, $jsonEncoder, $string,
        $productHelper, $productTypeConfig, $localeFormat, $customerSession,
        $productRepository, $priceCurrency, $data);
        $this->groupCollectionFactory = $groupCollectionFactory;
    }

    public function getAttributeLabels()
     {
    $product = $this->getProduct();

    $attributeSetId = $product->getAttributeSetId();

    $groupCollection = $this->groupCollectionFactory->create()
        ->setAttributeSetFilter($attributeSetId)
        ->setSortOrder()
        ->load();

    $html = '';
    foreach ($groupCollection as $group) {
        $attributes = $product->getAttributes($group->getId(), true);

        $new_html = "";
        foreach ($attributes as $key => $attribute) {
            if($attribute->getIsVisibleOnFront() && $attribute->getFrontend()->getValue($product) !="" && $attribute->getFrontend()->getValue($product) !="Non"){

                $new_html .= '

' . $attribute->getStoreLabel(). '

' . $attribute->getFrontend()->getValue($product) . '

';

            }
        }

        if($new_html!=''){

            $html .= "
";
            $html .= '
' . $group->getData('attribute_group_name').'
';
            $html .= "
";
            $html .= $new_html;
            $html .= "

";
        }

    }

    return $html;
}
}?>


texts: M2: Why My Observer Is Not Firing For API Calls

texts:
I have an observer which is configured in my module

File : app\code\MStack\Exchange\etc\frontend\events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_quote_address_collect_totals_after">
        <observer name="changeTaxTotal" instance="MStack\Exchange\Observer\ChangeTaxTotal"/>
    </event>
</config>

File : app\code\MStack\Exchange\Observer\ChangeTaxTotal.php

<?php
namespace MStack\Exchange\Observer;

use \Magento\Framework\Event\ObserverInterface;
use \Magento\Framework\Event\Observer;

class ChangeTaxTotal implements ObserverInterface
{
    public $additionalTaxAmt = 2;

    public function execute(Observer $observer)
    {
        /** @var Magento\Quote\Model\Quote\Address\Total */
        $total = $observer->getData('total');
        $total->addTotalAmount('tax', $this->additionalTaxAmt);
        return $this;
    }
}

As you can see, I am listening to the event sales_quote_address_collect_totals_after. I am checking this from cart page and obviously this event is firing from there.

I can see that, my event is listening when page loads. But it is not listening for api calls which are asserted by Magento in order to calculate totals (for example, if you try to use : Estimate Shipping and Tax). I can point out the urls which are not firing my observer.

  www.mydomain.com/index.php/rest/default/V1/guest-carts/e192be2e994b1228be16487655004adc/totals-information

So why my observer is not listening for such API request ? How can I change my code so that it will work for API request ?


texts: How to clone directly from Magento Cloud?

texts:
I have a project and I don't have access to the Bitbucket repo but I have master access to the Magento Cloud project.
How could I clone the project to my local environment?


texts: Magento 2.2.2 product images are not loading on product page

texts:
I am using Magento 2.2.2 in which product images loading on all other pages except product page.

After solved bootstrap error


texts: Magento 2 - Get all team members on a page

texts:
I begin in Magento development and I try to do something but I don't know how to start.

I want to display on a "about us" company page all team members of a company, for example in WordPress we have to create a custom post type 'team members', but in Magento how to do that ?

I had the page 'About us' with a layout and a template.

<referenceContainer name="columns.top">
    <referenceBlock name="page.main.title" remove="true" />
</referenceContainer>

<!-- Get wrapper -->
<referenceContainer name="page.wrapper">
    <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
    <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
    <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
</referenceContainer>

<!-- Content page -->
<referenceContainer name="content" htmlTag="div" htmlClass="custom-content">
    <block class="Magento\Framework\View\Element\Template" name="about_us_view" template="Magento_Theme::custom/about-us-content.phtml"/>
</referenceContainer>

Can someone help me ?

Thanks


texts: VAT Tax (EU from UK) not displaying on shopping basket

texts:
The VAT Tax breakdown isn't being shown on the shopping basket when a visitor adds a product to it. If they go to checkout, and then back (without doing anything in checkout), it will display the breakdown. Otherwise it just displays a sub total and total (which are exactly the same).

The settings we have configured are:

Tax calculation method based on: Unit Price
Tax Calculation Based On: Shipping Address
Catalog Prices: Excluding Tax
Delivery Prices: Excluding Tax
Apply Customer Tax: After Discount
Apply Discount On Prices: Excluding Tax
Default Country: UK
Default State/Post Code: *

Shopping Cart Display Settings

Prices: Excluding Tax
Sub Total: Excluding Tax
Delivery Amount: Incl. and Excl. Tax
Include Tax in Grand Total: No (Even on yes, this just shows two prices exactly the same, without VAT being added on).

There are several Tax rates set up, one for each applicable country at 20%. The Tax Rule is applied to retail customers and taxable goods; the issue seems to happen when multiple tax rates are selected (if I just select the UK VAT one, prices display as expected, otherwise if I select them all, it only displays ex VAT in everything).

Any ideas? I've followed both magento guides/documentation and other blog posts on doing this, and none of them help resolve the issue unfortunately.


texts:
I've set up a cart rule that applies if:
payment method is Bank Transfer.

It is always applied, except when an order is placed as a guest. Can you help me?

NB: All the user groups present are selected


texts:
I have a 10% discount rule applied on a specific category. Everything works fine, but costumers who buy between 0h00m and 1h00m dont get the discount which is annoying because they are expecting the discount…

I have search the web for this and apparently is because catalog price rules are applied on a daily base, that means they are finished @ midnight everyday and then recalculated at 1.00 am which leaves me with a gap.

After reading this article: http://www.solvingmagento.com/quick-tip-magento-catalog-price-rules-dont-work/

I have tried to change the config.xml(s) to narrow the gap.

<catalogrule_apply_all>
    <schedule>
        <cron_expr>5 0 * * *</cron_expr>
    </schedule>

and

<catalog_product_index_price_reindex_all>
    <schedule>
        <cron_expr>10 0 * * *</cron_expr>
    </schedule>

but i only got the rules to stop working completely…
now, they only restart by manually apply all rules inside promotions>catalog price rules

Any ideas on how to fill this gap?


texts: getting customer details from the event: controller_action_postdispatch_customer_account_createpost

texts:
I want to capture the 'new customer registration details' from the following event:

controller_action_postdispatch_customer_account_createpost

I know that the  returns the customer object.

However, I need to capture the customer details post dispatch.

is there a way to get the customer object from the postdispatch event?


texts:
I need to configure shop where only registered customers can buy and I'm using Magento EE option "Website restrictions". I have landing page, registration page and login page where customers can access but I need one more CMS page (Terms and Conditions) where non registered users can access.

Is there some solution for this? Some code where I can say if this is terms page skip restriction, or something like that...

My last option is to create custom, non magento page for this. Light box isn't option too :(

Hope that question is clear enough, screenshot is attached too.

Thanks in advance.


texts: Errors on Declarative Schema on custom module on 2.3

texts:
My module was implemented and working on Magento 2.2.
We are moving to Magento 2.3, but failed in Declarative Schema.
I follow this. Created db_schema.xml. Following is the example
    <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">

   <table name="options" resource="default" engine="innodb" comment="Option entities">
        <column xsi:type="int" name="option_id" padding="10" unsigned="true" identity="true" nullable="false" comment="Option Id"/>
        <column xsi:type="varchar" name="name" nullable="false" length="255" comment="Option name"/>
        <column xsi:type="varchar" name="value" nullable="false" length="255" comment="Option value"/>
        <column xsi:type="timestamp" name="created" comment="Time of event"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="option_id"/>
        </constraint>
    </table>
</schema>

Then, whatever commands I tried to run returns the same error..
PHP Fatal error:  Uncaught TypeError: Return value of Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable() must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Table, boolean returned in C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php:251
Stack trace:
#0 C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php(148): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 C:\xampp\htdocs\magento23\setup\src\Magento\Setup\Model\DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 C:\ in C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php on line 251

Fatal error: Uncaught TypeError: Return value of Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable() must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Table, boolean returned in C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php:251
Stack trace:
#0 C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php(148): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 C:\xampp\htdocs\magento23\setup\src\Magento\Setup\Model\DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 C:\ in C:\xampp\htdocs\magento23\vendor\magento\framework\Setup\Declaration\Schema\Declaration\SchemaBuilder.php on line 251

Commands which produces the above error:
bin/magento setup:db-declaration:generate-whitelist
bin/magento module:upgrade

I tried to install the module on a fresh installed Magento 2.3
Can anyone please help?


texts: Get sales of products by week wise as week1,week2, week3, week4

texts:
I have a requirement to make a sales report like this:

Product Name         First Week   Second Week  Third Week
   a                      12            6           2
   b                       0            0           4
   c                       0            3           0

For this I made a function which returns sku and sum(qty_ordered) like

   $query = Mage::getResourceModel('sales/order_item_collection');
   $query->getSelect()->reset(Zend_Db_Select::COLUMNS)
    ->columns(array('sku','qty_ordered'))
    ->where(new Zend_Db_Expr('created_at BETWEEN NOW()-INTERVAL 1 WEEK AND NOW()'))
    ->group(array('sku'));

sql query for the above is:

SELECTmain_table.sku,main_table.qty_ordered, SUM(main_table.qty_ordered) ASweek1FROMsales_flat_order_itemASmain_tableWHERE (created_at BETWEEN NOW()-INTERVAL 1 WEEK AND NOW()) GROUP BYsku;

But the above returns for only 1 week. If I change the created_at BETWEEN NOW()-INTERVAL 1 WEEK AND NOW() to created_at BETWEEN NOW()-INTERVAL 2 WEEK AND NOW() then it returns 2 weeks sales.. But I want the result as shown in the above format. So how can I customize this. Help me on this.


texts: Magento 1.9 - Custom options different for each product

texts:
I have a Race-Registration virtual product with 12 custom options (First name, Last name, Dob etc..). Everything works fine exept when I add 2 or more of the products to the cart: in this case Custom options are the same for every product. I would like magento to ask me different data for single product added to the cart.

Already tried Configurable and Bundle products without success

Thanks


texts: Search form to search only products within specific attribute set

texts:
We have two product types in our Magento catalog/store, "default" and "Machine." Wondering if there's a way to set up a search page for each to only perform search in a specific attribute set.  Default search code below. Can I modify this? If so, how? If not, any recommendations to best achieve?

<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">

        <input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" placeholder="Search" class="input-text" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>"/>
        <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><?php echo $this->__('Search') ?></button>

</form>


texts: Magento2.2.5 amazon_sales_order table does not exist?

texts:
I recently upgrated a magento from 2.2.3 to 2.2.5 and now when people place an order I am seeing errors in the system.log that seem to state that there is a table related to amazon_sales_order that the table does not exit? how do I go about creating it along with any other amazon pay related tables? Note i am not even using or have activated the amazon pay method?

 Base table or view not found: 1146 Table 'amazon_sales_order' doesn't exist

looking at my database I see only the below amazon related tables

amazon_customer
amazon_pending_authorization
amazon_pending_authorization
amazon_pending_capture
amazon_pending_refund


texts:
Actually, I want to create different files for every category page (every product listing page).

For that I have:

Created customlist.phtml from list.phtml or copied the code of list.phtml and create
Assign customlist.phtml in admin side (admin → category → Layout
section)

But it is not working:

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

Layout Section Code:

<referenceContainer name="content">
    <referenceBlock name="category.products">
        <block name="product_list" class="Magento\Catalog\Block\Navigation">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
            </action>
        </block>
    </referenceBlock>
</referenceContainer>

How can I create multiple category pages in Magento 2?


texts: Retrieve custom attribute LABEL in cart with config.xml

texts:
I have a custom attribute that i need to display in the shopping cart. The attribute is a Dropdown like so:

Attribute Code : section
Catalog Input Type for Store Owner : Dropdown
Options:
    ID/VALUE = 67 LABEL = warehouse
    ID/VALUE = 69 LABEL = showroom
    ID/VALUE = 70 LABEL = stockroom

To display this i have a custom module with my config.xml like so:

<global>
<sales>
    <quote>
        <item>
            <product_attributes>
                <section/>
            </product_attributes>
        </item>
    </quote>
</sales>

And in the cart i can call:

$_item->getProduct()->getSection();

This returns the ID/VALUE of the attribute (i.e 67) but i want to be able to get the LABEL (i.e warehouse)

I know i can get a label from the id like so:

$_product = Mage::getModel('catalog/product');
$attr = $_product->getResource()->getAttribute("section");
if ($attr->usesSource()) {
    $_label = $attr->getSource()->getOptionText("67");
}

But I want to get the label through my module so i can cutout extra databae queries and having to load the product model again. My cart can have upwards of 20+ items per order so using this last approach can slow it down slightly.


texts: Wrong tax calculation in paypal when discount is given

texts:
I have a problem with the discount calculation in PayPal in combination with Magento. So far I just found other questions related to rounding problems or similar in PayPal and not comparable with my issue.

I use Magento CE 1.9.1.0

The Problem:

PayPal works great when there is no discount. It takes the

net subtotal
net shipping costs
the tax
grand total incl. tax

and everything is fine.

But when the user gets a %-discount, PayPal still calculates the tax based on the subtotal (without subtracting the discount). I hope the following image will clarify the issue.

In short:

discount has to be excl. tax
subtotal has to 'contain' the discount excl. tax
tax has to be calculated after discount substraction

The grand total in PayPal fits, because the tax of the discount effect (2,11€) moved from subtotal to tax.

An Approach:

Tell PayPal to use the discount excl. tax und calculate the tax after the discount has been subtracted from the subtotal.

Question:

How do I manage that?

Thanks in advance!

Edit 1:
PayPal Express is in Sandbox mode (if that is important to know)

Edit 2:
Sry, with "PayPal caluclates", I mean the Service PayPal, the Magento extension or the whole payment process related to PayPal ;)

Here are my tax configuration settings:


texts: Magento join query with having collection count mismatch

texts:
I joined a custom table with the customer table applying a GROUP BY and a HAVING statement.

The Code:

$collection = Mage::getModel('customer/customer')->getCollection();
$collection->getSelect()->join(
    array('review' => 'flrating'),
    "e.entity_id = review.reviewed_user_id "
);
$collection->getSelect()->group('review.reviewed_user_id');
$collection->getSelect()->having('AVG(review.avg_rating) >= ?', $min)
    ->having('AVG(review.avg_rating) <= ?', $max);

The Query:

This code is generating the following SQL:

SELECT `e`.*, `review`.* FROM `customer_entity` AS `e`
    INNER JOIN `flrating` AS `review` ON e.entity_id = review.reviewed_user_id
WHERE (`e`.`entity_type_id` = '1') AND (`e`.`group_id` = '5')
GROUP BY `review`.`reviewed_user_id`
HAVING (AVG(review.avg_rating) >= '0') AND (AVG(review.avg_rating) <= '2')

When I do Zend_Debug::dump($collection->getData()) it returns empty.

When I execute the query it shows an empty result, but when I put this query into PhpMyAdmin it shows two records (this is the correct result).

Also see see the below attached screens:


texts:
A link is sent to a customer to complete the payment on payment pending.
So the link redirects the customer to the one page checkout.
Where all the details are filled in through the quote of the order.

Now I have to load directly to the Review Step.

I tried doing through javascript but it doesnot work all the time.

setTimeout(function(){
  billing.save();
  setTimeout(function(){shipping.save();},3000);
  setTimeout(function(){
    shippingMethod.save();
  },5000);
  setTimeout(function(){
       var method=document.getElementById('gwl_method_code').value;
      document.getElementById('p_method_'+method).checked="true";
  },7000);
   setTimeout(function(){payment.save();},7200);

},2000);

Please Help with this


texts: Get sales email set in configuration on template

texts:
In a custom module I'm trying to get store information set on the Admin panel in a template.

I've been able to get it for most by adding get functions such as the below, but can't get the one for the sales email.

public function getPhone()
{
    return $this->_scopeConfig->getValue(
        'general/store_information/phone',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}

public function getSalesEmail()
{
    return $this->_scopeConfig->getValue(
        'general/ident_sales/email',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}

Any idea's what I should do, I think the parameter 'general/ident_sales/email' is wrong.


texts: Error during compilation after upgrade in magento 2.2.3

texts:
Got error during compilation after upgrade in magento 2.2.3

  Interception cache generation... 6/7 [========================>---]  85% 42 secs 342.0 MiBErrors during compilation:
      Magento\Backend\Model\View\Layout\GeneratorPool
          Incompatible argument type: Required type: \Magento\Framework\View\Layout\Condition\ConditionFactory. Actual type: \Magento\Framework\App\Config\ScopeConfigInterface; File:
  /chroot/home/discount/m223/html/vendor/magento/module-backend/Model/View/Layout/GeneratorPool.php

  Total Errors Count: 1

  [Magento\Framework\Validator\Exception]
    Error during compilation

AND also, it's changed Cache folder permission 777 to 775 during compile.


texts:
Currently, we are using Magento 2 with ERP(Oracle for inventory and Logistic) when any stock in/out we are sending through API to Magento for the STOCK update.

Due to the high volume of order, we can’t push all order to ERP on real time so we are running a cron job every 2 Min to push order to ERP and get back STOCK quantity and update on Magento.

In between any inventory update, we are updating in Magento, any cancellation updating Magento.

Due to the time delay, we are facing OVER SALE?

EXAMPLE

[![enter image description here][1]][1]

When the last order will go till that the product will be in stock on web but when order will reach to ERP we get to know stock is 0 so we are getting over SALE

Is there any solution to overcome this?


texts: Flash player Down unable to upload image

texts: in magento admin dashboard i unable to upload image due to flash player down. Please advise the option for adding of product images.


texts: Render particular block instead of complete layout

texts:
If we call the below code in a controller, it renders the complete layout handle related to the controller.

$this->loadLayout();
$this->renderLayout();

But what I want is to render only a particular block from the layout handle.

Lets say if my layout handle has a child block with name "hello", I want to render that particular block. How to do this?

I tried the below code:

    $this->loadLayout();
    $layout = $this->getLayout();
    $block = $layout->getBlock("hello");
    $block->renderLayout(); /* Error: 503 Service Unavailable */


texts:
Is there an extension or any other possibility to implement the german payment service "Sofortüberweisung"?

There does not seem to be any information online.


texts:
There is one specific product on our site that is throwing an error:

Cardinality violation: 1241 Operand should contain 1 column(s), query
was: SELECT `cataloginventory_stock_item`.*, `p`.`type_id` FROM
`cataloginventory_stock_item`
INNER JOIN `catalog_product_entity` AS `p` ON product_id=p.entity_id
WHERE (`cataloginventory_stock_item`.`product_id`='38493', '38494')
AND (stock_id = :stock_id)

This fatal error is occuring from:

$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($value['products']);

The product is a shoe that comes in different sizes and colours.
The error is getting thrown when listing out the sizes on the page.
$value['products'] is an array of the different sizes (hence different product ids).

However the other colours of the same shoe don't throw an error. I am thinking it's some mismatch in the database but I don't know where to start to fix it.

Any help is appreciated.

a:5:{i:0;s:345:"SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s), query was: SELECT `cataloginventory_stock_item`.*, `p`.`type_id` FROM `cataloginventory_stock_item`
 INNER JOIN `catalog_product_entity` AS `p` ON product_id=p.entity_id WHERE (`cataloginventory_stock_item`.`product_id`='38493', '38494') AND (stock_id = :stock_id)";i:1;s:7512:"#0 /usr/share/nginx/calatest/www.website.com/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /usr/share/nginx/calatest/www.website.com/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /usr/share/nginx/calatest/www.website.com/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /usr/share/nginx/calatest/www.website.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array)
#4 /usr/share/nginx/calatest/www.website.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array)
#5 /usr/share/nginx/calatest/www.website.com/lib/Zend/Db/Adapter/Abstract.php(756): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /usr/share/nginx/calatest/www.website.com/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php(57): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select), Array)
#7 /usr/share/nginx/calatest/www.website.com/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php(193): Mage_CatalogInventory_Model_Resource_Stock_Item->loadByProductId(Object(Mage_CatalogInventory_Model_Stock_Item), Array)
#8 /usr/share/nginx/calatest/www.website.com/app/design/frontend/enterprise/ca/template/configurable/product/view/type/options/configurable.phtml(59): Mage_CatalogInventory_Model_Stock_Item->loadByProduct(Array)
#9 /usr/share/nginx/calatest/www.website.com/app/code/core/Mage/Core/Block/Template.php(241): include('/usr/share/ngin...')


texts: Such big error existing in magento 2, why it is not fixed more than 2 years?

texts:
I installed magento CE 2.1.5. Then I found default logo cannot load. Even worse, left side link in admin panel cannot work at not. Then I found the solution in here(https://magento.stackexchange.com/a/124967/52478)

This solution fix my above two problems. I thin many people had the same problem like me. Why magento developers do not fix this such issue?


texts: Magento muliple product having same name

texts:
I have muliple product having same name so their url are  also generated  same.It is also creating problem regarding SEO duplication.
How i fix it?


texts: Add value to hidden field Magento 2 admin

texts:
I am trying to add a hidden field with a value to my Magento 2 admin form.

I used the following code:

$fieldset->addField('order_id', 'hidden', ['name' => 'order_id', 'value' => 'Test']);

However, the code does not set a value. Anybody any idea how to set a value to a hidden field?


texts: I want to show next best volume discount to customer for total amount

texts:
i have two volume discount for total amount in cart

If total amount is greater then 50 and less then 100
If total amount is greater then 101 and less then 200

see images

For example if i have $50 total amount in cart then rule 1 will apply but i want to show a offer message that shop $61 more to get 50% discount

Any Help

Thanks in advance


texts: Magento 2 - Content deploy creating folders instead of file


texts: Magento 2.1.9 - Frontend Account Address book modification

texts:
So I want to add some text under "Additional address entries":

I tried overriding \magento\module-customer\view\frontend\templates\address\book.phtml in my custom theme \Magento_Customer\templates\address\book.phtml like this:

<?php echo $block->escapeHtml(__('Additional Address Entries')) ?>

    <?php if ($_pAddsses = $block->getAdditionalAddresses()): ?>

            <?php foreach ($_pAddsses as $_address): ?>

                    <address>
                        <?php echo $block->getAddressHtml($_address) ?>

                    </address>

                        <a class="action edit" href="<?php echo $block->escapeUrl($block->getUrl('customer/address/edit', ['id' => $_address->getId()])) ?>"><?php echo $block->escapeHtml(__('Edit Address')) ?>
                        <a class="action delete" href="#" role="delete-address" data-address="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($_address->getId()) ?>"><?php echo $block->escapeHtml(__('Delete Address')) ?>

            <?php endforeach; ?>

    <?php else: ?>

<?php echo $block->escapeHtml(__('You have no other address entries in your address book.')) ?>

    <?php endif ?>

<?php echo $block->escapeHtml(__('You must get in contact with your representative in order to do any modification to your personal details.')) ?>

It doesn't appear to have any changes, but not only what I have changed but also if I try to put some die('text') in order to make sure I'm working in the right place.

Of course I run the commands:

php bin/magento cache:flush
php bin/magento setup:upgrade


texts: How to remove google font from default rwd theme?

texts:
I would like to remove following line of code from default magento theme, but I can't find out how:

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Raleway:300,400,500,700,600" />

Is it in some obscure xml file?


texts: How can I link a category to a newly created CMS page

texts: I created a CMS page and I would like to link the page to one of the categories on my nav. How can I do this?