texts:
Here I Want to show exception message like "Request Parameter is not found".
Here is my code.

use Magento\Framework\Exception\StateException;

 protected $order;

public function __construct(
    \Magento\Sales\Api\Data\OrderInterface $order
) {
    $this->order = $order;
  }

public function getorderaddresslist($orderid) {
    try {
    $order = $this->order->load($orderid);
    $shippingAddress = $order->getShippingAddress()->getData();
    $billingAddress = $order->getBillingAddress()->getData();
    $address = array(
            'addresses' => [
            'shippingAddress' => $shippingAddress,
            'billingAddress' => $billingAddress
            ]
        );

      json_encode($address);
     }
    catch(\Exception $e){
       throw new StateException(__('Request Parameter is not matched.'));
    }

How i can show a message if request parameter is not matched.can any help me.


texts: Coupon API not working for guest user in Magento 2 core API

texts:
I Followed below steps,
1. Create cart for guest user
URL:  http://devsite.com/magento2.2/rest/all/V1/guest-carts

   Content-Type: application/json
   Method: POST
   Authorization Bearer Key: yfna0bkjnj3j8jcr42rk7a1f3391yy0c

   Request Parameters: NIL

   Response :
adf748e2e78b4cd4d7d3795a127bed97  (Generates Cart ID in response)

create coupon in backend and also by API
Apply this coupon to cartId

URL:  http://devsite.com/magento2.2/rest/all/V1/guest-carts/adf748e2e78b4cd4d7d3795a127bed97/coupons/782OYX2VOEINUF08

   Content-Type: application/json
   Method: PUT
   Authorization Bearer Key: yfna0bkjnj3j8jcr42rk7a1f3391yy0c

   Request Parameters: NIL

   Response :
{
 "message": "Coupon code is not valid"
}

For check I have applied this coupon in front-end of website as a guest user its work. In API only its not working


texts: Remove all customers where * is * programmatically

texts:
I want to remove all customers that have the following string in their first name: 'http://' (spam customers that have links in their first names).

Is there a good way to remove these programmatically using a setup script in Magento 2?

There must be a better way than to get the filtered customer collection and delete them one by one right?

--------- UPDATE -----------

I am currently using the following method. It works, but it takes quite some time:

/**
 * Remove Customers with links (http:// or https://) in their names
 */
private function removeFakeCustomers()
{
    $this->registry->register('isSecureArea', true);
    $customers = $this->customerFactory->create();
    $customers->addFieldToFilter(
        'firstname',
        [
            ['like' => '%http://%'],
            ['like' => 'http://%'],
            ['like' => '%https://%'],
            ['like' => 'https://%']
        ]
    );

    if (!$customers) {
        return;
    }

    echo 'Start removing fake customers...';

    foreach ($customers as $customer) {
        $customer->delete();
    }

    echo 'Fake Customers removed...';
}


texts: what is customer.form.register.fields.before and why this block add in customer_account_create?

texts:
<reference name="content">
        <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
            <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                <label>Form Fields Before</label>
            </block>
        </block>
</reference>

My qustion is what is customer.form.register.fields.before and why this block add in
    <customer_account_create>
And

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

what this code show in Phtml page.


texts: Payment Failed Emails M 2.3.5 - Not working for us

texts:
We are currently using Magento 2.3.5
From my understanding, payment failed emails are sent when a transaction fails.  By fails I hope that this means it is declined or voided by the payment method.  We need this to alert us when we are being bombarded by bots checking stolen credit card numbers.
I set this up in the backend. I made sure that the "Email Sender" and the "Email Receiver" were valid.  I also added a "Send Payment Failed email copy to" to another email ( also valid).
I then placed a transaction with a credit card that was not valid and with a CVV that was incorrect.  The payment gateway declined the transaction and on the checkout page I saw a red highlighted message that it failed.  No emails were sent.
Do I have it configured incorrectly?
Does it not trigger on declined transactions?  If not, is there a way to get an email when a transaction is declined ?
Thanks in advance


texts: Magento 2.2.0 - Unable to create voucher code

texts:
We have a weird problem with Magento where the client is trying to create a voucher code for customers with her logins, but this does not work. This is the error message she is getting.

We've even tried the same logins as the client and it works for us. She has tried using her 4G connection on her phone to create a voucher code but keeps getting the same problem.

Creating a new account doesn't seem to work either, sending her logins for our own account doesn't work either.

Current exception.log downloaded from the server;

[2018-04-17 10:18:32] main.CRITICAL: Invalid input date format '16/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '16/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-04-17 10:23:00] main.CRITICAL: Invalid input date format '17/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '17/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-04-17 15:07:14] main.CRITICAL: Notice: Undefined offset: 0 in /home/aatuco/public_html/vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 122 {"exception":"[object] (Exception(code: 0): Notice: Undefined offset: 0 in /home/aatuco/public_html/vendor/magento/module-catalog/Model/Category/Link/SaveHandler.php on line 122 at /home/aatuco/public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []
[2018-04-25 16:10:53] main.CRITICAL: Invalid input date format '24/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '24/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-08 10:56:52] main.CRITICAL: Invalid input date format '08/05/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '08/05/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-08 11:04:43] main.CRITICAL: Invalid input date format '08/05/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '08/05/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-21 09:17:59] main.CRITICAL: Invalid input date format '25/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '25/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-21 09:30:18] main.CRITICAL: Invalid input date format '25/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '25/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-21 10:50:03] main.CRITICAL: Invalid input date format '25/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '25/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-21 10:51:26] main.CRITICAL: Invalid input date format '25/04/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '25/04/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []
[2018-05-21 11:25:56] main.CRITICAL: Invalid input date format '21/05/+00201818' {"exception":"[object] (Exception(code: 0): Invalid input date format '21/05/+00201818' at /home/aatuco/public_html/vendor/magento/framework/Stdlib/DateTime/Filter/Date.php:69)"} []

Don't think that shows much in relation to the problem that we are having. I'll get the client to create a voucher code on the LIVE website and see if the log file is updated.

I'm wondering if anyone else has come across this very strange problem?


texts: Which file controls PayPal logo on Shopping Cart

texts:
As a result of the Magento 2 defect outlined here Magento 2: How to remove Paypal Logo from MiniCart & Shopping Cart Page? I have managed to remove the Paypal logo from the minicart by changing the file: vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html

However this didn't help to remove the button from the actual shopping cart page. I've searched high and low to try and find the code that deploys the button for that page but haven't been able.

Can anyone advise which file controls that in Magento 2?

Thank you in advance!

Greg.


texts: Type Error occurred when creating Interceptor after Updating to 2.3.2

texts:
After updating Magento from 2.1.6 to 2.3.2 and PHP from 5.6.30 to 7.2.20, now running into errors on page load.

Have a module called Inquiry, which consists of forms to request things, and there is a custom table called 'inquiry_requests' that contains the things that can be requested.

Before the update, everything worked fine, but after updating getting the following error on page load for one of the forms when I run it in Developer mode. Tried clearing cache, deleting the generated folder, rerunning setup di compile multiple times, but the error continues to persist.

So it appears that it's occurring when we query for the custom table's data through the collection.

Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Component\Inquiry\Model\Resource\Requests\Collection\Interceptor
#1 Magento\Framework\ObjectManager\Factory\Compiled->create('Component\Inq...', array()) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#2 Magento\Framework\ObjectManager\ObjectManager->create('\Component\In...', array()) called at [generated/code/Component/Inquiry/Model/Resource/Requests/CollectionFactory.php:43]
#3 Component\Inquiry\Model\Resource\Requests\CollectionFactory->create() called at [app/code/Component/Inquiry/Helper/Requests.php:25]
#4 Component\Inquiry\Helper\Requests->getRequestsItems(array('...')) called at [app/code/Component/Inquiry/view/frontend/templates/form/requests.phtml:104]

report.CRITICAL: Type Error occurred when creating object: Component\Inquiry\Model\Resource\Requests\Collection\Interceptor, Argument 5 passed to Component\Inquiry\Model\Resource\Requests\Collection\Interceptor::__construct() must implement interface Magento\Framework\DB\Adapter\AdapterInterface or be null, string given, called in /var/www/vhosts/MyWebsite/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116 [] []
report.ERROR: Type Error occurred when creating object: Component\Inquiry\Model\Resource\Requests\Collection\Interceptor [] []

<?php

namespace Component\Inquiry\Model\Resource\Requests;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{
    /**
     * Define model & resource model
     */
    protected function _construct()
    {
        $this->_init(
            'Component\Inquiry\Model\Requests',
            'Component\Inquiry\Model\Resource\Requests'
        );
    }
}

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Component\Inquiry\Model\Resource\Requests\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">inquiry_requests</argument>
            <argument name="resourceModel" xsi:type="string">Component\Inquiry\Model\Resource\Requests</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="requests_list_data_source" xsi:type="string">Component\Inquiry\Model\Resource\Requests\Collection</item>
            </argument>
        </arguments>
    </type>
</config>


texts: Recurring Upgrade Scripts in Magento 2.0, 2.1, or 2.2?

texts:
According to this dev doc (emphasis mine)

  InstallData and InstallSchema scripts, which are executed on a clean (empty) database

  UpgradeData and UpgradeSchema incremental scripts, which supplement an existing Magento database

  Recurring scripts, which are executed each time you install or upgrade Magento

Does anyone know what feature this development document is talking about? As far as I recall, M2 only had InstallData, InstallSchema, UpgradeData and UpgradeSchema classes.


texts: What is expected files size in var/cache/

texts:
Some files in var/cache/ folders are as large as 300Mb is this considered as normal or something is wrong with my Magento? (see screenshot)
Iam running Magento ver. 2.4.0 with up to 2000 products, single customer group.


texts: Mobile Menu category link is undefined URL can't working in Magento 2

texts:
I'm facing some annoying issues. When I'm on the desktop, no problem with the menu link.

When I'm on responsive, when I go through the menu, I have the right URL but
when I click on category link the item, I'm redirected to a 404 page ( my.domain/undefined) And undefined URL.

If any custom script and tool and module so give me the link
so I sorted this issue fast ASAP.

I used the module but can't work
https://github.com/olegkoval/magento2-regenerate_url_rewrites

If any idea how can I sort this issue please give me
solution ASAP and any custom script for that?

Thank you.


texts:
I am helping a client clone a test server. Per the instructions they were given they have already truncated out some of the junk data created by testing, including orders and invoices, but they did not delete the RMAs. Could someone please tell me which tables I need to clear to delete the RMAs cleanly?

Here are the queries that were used to purge the test data:

DELETE FROM `sales_flat_order`;
DELETE FROM `sales_order_tax`;
DELETE FROM `downloadable_link_purchased`;
DELETE FROM `eav_entity_store` WHERE entity_type_id IN (
    SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_type_code` IN ('order', 'invoice', 'creditmemo', 'shipment')
 );


texts:
Want to have a report to know each customer how many times logged in my Magento 2.3 site.
If customer A comes 3 times in a day it should count just once not 3.
I want to sort them by day, a weak, month too. it just needs for reporting


texts: Fatal error: Undefined class constant 'DEFAULT_SCONFIG_FILENAME' public_html/Maged/Connect.php on line 167

texts:
I try to make a backup with filezilla and i think i have move a folder.

here is the error i get
Fatal error: Undefined class constant 'DEFAULT_SCONFIG_FILENAME' in /home/swell/public_html/Maged/Connect.php on line 167

thanks


texts: Set product stock quantity after uncancelling order

texts:
I have a module to uncancel orders. The problem is that when I uncancel an order, the stock quantity is not decreasing for the amount of items ordered. I have the line of code that set order back to previous state. I am trying to decrease the stock without success. Here is my code.

foreach ( $order->getItemsCollection() as $item ) {
                $item->setQtyCanceled( 0 );
                $item->setTaxCanceled( 0 );
                $item->setHiddenTaxCanceled( 0 );

                $item->getData('qty_ordered');
                $item->getData();
                $stockItem = Mage::getModel('cataloginventory/stock_item');
                $stockItem->assignProduct($item);
                $stockItem->setData('is_in_stock', 1);
                $stockItem->setData('qty', 1);
                $item->setStockItem($stockItem);
                $item->save();
            }

I am getting this error:
 Call to a member function getWebsiteId() on a non-object in \app\code\core\Mage\CatalogInventory\Model\Stock\Status.php on line 208

and the item qty is not set to "1" ( "1" for test purpose)

Does anyone have an idea on how can I achieve this?


texts: Google Tracking & Magento Drop down Navigation

texts:
I'm trying to track click events in our 2 level drop down category navigation menu - located in the header.

All I'm trying to do is add some attributes to the <a href> tags but this is proving to be harder than it sounds. I can't figure out where the $_menu variable referenced in topmenu.phtml is coming from. (any ideas?) I've found 2 solutions to the this problem that only seem OK and don't think either is best practice.

Option 1

Use an observer to intercept and modify the HTML.. This is roughly what the Anowave Tag Manager Module does.

Option 2

Use this example to create a fully custom top menu.. which exactly what's there already with some extra <a href> attributes.

Thoughts

Option 2 requires create pretty redundant code because whatever is there is 99.9% good.. I'm just trying to include an attribute like data-value='category name' etc.

ANSWER NOTES

Both @sander & @denisa posted answers that solved my problem. However, as @denisa mentioned, you need to know if you're using using the newer RWD template or the older template. I was using a newer install of Magento but and Non-RWD template. Once you know this, use either @denisa's answer or @sander's


texts: How to add breadcrumbs on Category and product details

texts:
I have tried to add breadcrumbs on product category page and also on product details page with following codes but it's not working.

1. Add following code to theme default.xml and check page.top is not remove

<referenceContainer name="page.top">
                <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
        </referenceContainer>

2. add fallowing code to catalog_category_view.xml

<referenceBlock name="breadcrumbs">
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Home</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">Home</item>
                    <item name="label" xsi:type="string">Home</item>
                    <item name="link" xsi:type="string">{{baseUrl}}</item>
                </argument>
            </action>
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Register</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">Register</item>
                    <item name="label" xsi:type="string">Register</item>
                </argument>
            </action>
        </referenceBlock>

3. Add following code to list.phtml

<?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?>

All above codes are not working.


texts: Magento 2: Composer install for my own module

texts:
I'm have my own magento 2 module. It's allready uploaded on Gitlab.
What i must do to install this module using composer require?


texts: Which package extension file upload in magentocommerce?

texts:
I have created package extension in magento 1.9. So following three file created.

[My_Extension_Name].xml
[My_Extension_Name]-1.0.0.tgz
package.xml

When I login in my account on magento.com which file I have to upload,only need [My_Extension_Name]-1.0.0.tgz file upload ?


texts: Magento2: How can remove comma from price?

texts:
I know my question may be duplicate of this question but I have tried this and didn't get solution. I have edited core files of price with str replace but after page load it is again showing price with comma.

I have tired with Locale/xml file but price coming from js may be. Anyone have an idea for that please?


texts: Creating an Observer with selectable event?

texts:
I am looking for a way to list in a dropdown all events between when order is created and an order is finished (ie sales_order_shipment_save_after or sales_order_invoice_register) in the Admin panel. When whatever selected event is hit, then fire off whatever is inside my Observer (post to url). I am having an issue though as I understand you need to explicitly provide the event you want to trigger inside of your modules config.xml like so

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Modulename>
            <version>0.1.0</version>
        </Namespace_Modulename>
    </modules>
    <frontend>
        <events>
            <checkout_submit_all_after>
                <observers>
                    <Namespace_Modulename_Customevent>
                        <type>singleton</type>
                        <class>Namespace_Modulename_Model_Observer</class>
                        <method>customFunction</method>
                    </Namespace_Modulename_Customevent>
                </observers>
            </checkout_submit_all_after>
        </events>
    </frontend>
</config>

If this is the case then how would I be able to create a more configurable Event/Observer that would be able to handle admin specified events?


texts: Editing files in pub/static/frontend directory advisable?

texts:
I want to edit CSS file in one of the project, I found using developer tools in Chrome that the file is located in pub folder. Is it advisable to edit it in pub/static/frontend/Company/theme/en_US/css/ directory or it should be somewhere in app/code/ or vendor/ folder? If I change in pub directory, will it get overwritten at any point during static files deployment?

Same with any other files located in pub/static/frontend, is it reliable to change anything in that folder at all?


texts: I'm having a custom module for bulk purchase of products. Also, the customers can request for separate quote for the products they are purchasing. After that the admin will create the quote based on request. The quote details will be sent as mail. I want to attach a pdf with the same quote details in the mail. So how can I attain the same. Help me please.


texts: Magento : How Do I Loop Product Categories and Pull Out X Products From It

texts:
I have been bit of trouble trying to figure this out.

Essentially on homepage I'm trying to to pull 3 products from 4 different categories.

Category 1
- Product 1
- Product 2
- Product 3

Category 2
- Product 1
- Product 2
- Product 3

Category 3
- Product 1
- Product 2
- Product 3

Category 4
- Product 1
- Product 2
- Product 3

I'll be using jquery/css to make a tabbed component like first example here: http://refills.bourbon.io/

I'm having a real difficult time figuring out how to loop through though.


texts: Magento - Add custom table data into Products collection

texts:
I have created a custom table which stores the listId (you can think of it sort of wish list) and product id and created Model and Model resources. What I need is the actual product data based on the product id's who are stored in custom table company_mymodule_shortlist_product . Plus I need to apply the custom filter/sorting on the collection. E.g. I want to filter the product collection base on the create_at filed which is available in my custom table.

Below is the code of Model, Model resource and part of config.xml

config.xml

<models>
    <mymodule>
        <class>Company_MyModule_Model</class>
        <resourceModel>mymodule_resource</resourceModel>
    </mymodule>
    <mymodule_resource>
        <class>Company_MyModule_ModelResource</class>
        <entities>
            <shortlist>

It stores the list name and its id

            </shortlist>
            <shortlist_product>

company_mymodule_shortlist_product

            </shortlist_product>
        </entities>
    </mymodule_resource>
</models>

Model:

class Company_MyModule_Model_Shortlist_Product extends Mage_Core_Model_Abstract
{
public function getAllProductsRelatedToShortListId()
    {
        $collection = Mage::getResourceModel('mymodule/shortlist_product_collection');
        foreach($collection as $collections) {
            $collections;
        }
    }
}

Resource Model:

class Company_MyModule_Model_Resource_Shortlist_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection
{

}

Edit:

After hours of digging I found that I will need to extend the Resource collection of shortlist_product with Mage_Catalog_Model_Resource_Product_Collection which I have done successfully.
But now I do not know how to add the custom table data into the product collection so that I get all the required products data. Infact a proper Magento product collection with all sorting, filtering etc.


texts:
I've created a custom attribute for catalog categories through a installer script. I am pretty sure I had the script ran correctly. Here's my installer script:

$installer = $this;

$entityTypeId     = $installer->getEntityTypeId('catalog_category');

$installer->addAttribute('catalog_category', 'special_description',  array(
    'type'     => 'text',
    'label'    => 'Special Description',
    'input'    => 'text',
    'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => true,
    'default'           => '',
    'group'             =>  'General'
));

I can see the attribute in the Magento Category admin. I can set a value to my attribute and save it.

However, for some reason, I can never get the value in code. This is what I did to get the value of my attribute:

$categoryAttr = Mage::getModel('catalog/category')->load(57)->getData('special_description');

This keeps returning null. I've flushed my cache and reindex the database. But none of these have worked. I can see the value stored in the EAV tables in my database. The attribute is also created in the database. I've spent hours on this but can never understand what's wrong.

How should I get the data of my custom attribute?


texts: Magento 2 Place Order 400 Bad Request Error

texts: I'm Designing Magento 2.2.11 theme and now I'm facing 400 error while click on place order button. kindly please suggest how can i resolve it.


texts: Magento 2 - How to get image of sub categories?

texts:
I need to get an image of subCategory.

$category = $block->getCurrentCategory();
$subcategories = $category->getChildrenCategories();
foreach ($subcategories as $var) {
    print_r($var->getData())
}

I get every data other than category image.

    Array
(
    [entity_id] => 12
    [attribute_set_id] => 3
    [parent_id] => 11
    [created_at] => 2018-06-26 08:26:17
    [updated_at] => 2018-06-26 11:45:37
    [path] => 1/2/11/12
    [position] => 1
    [level] => 3
    [children_count] => 4
    [is_active] => 1
    [request_path] => men/tops-men.html
    [name] => Tops
    [url_key] => tops-men
    [is_anchor] => 1
)

the array conatin this data.


texts: How to add images in bundle product options?

texts:
I'm using Magento 1.4.1.1.

I'm wondering whether there is an easy way to display product images from a bundle product ?

(I'm quite new in Magento, don't hesitate to provide code snippets and tutorial links)

Thank you !


texts: I couldn't find a better tutorial for creating an admin grid which is editable. And the grid column contains dropdown boxes. And there's only one save button for the entire grid. (Means there's no Action column anymore). I'll provide a mock diagram of the grid which I want to generate. Please suggest if found any tutorials or way to achieve this easily. I have created this grid form. But it's not saving data.


texts:
I have been working on integration of a payment gateway with Magento 1.9.4.0 it works perfectly and the orders are being created successfully. However, there is a case when the user tries to login before the checkout step, the order is not being created. I digged down the issue and found that the code stops on the following line:

public function successAction()
{
    $session = $this->getOnepage()->getCheckout();
    if (!$session->getLastSuccessQuoteId()) {
        $this->_redirect('checkout/cart');
        return;
    } ....

After googling i came to know that this issue has been fixed by Magento in the SUPEE 9767 V2 Patch. I checked for that to apply on my site but that is not available for M1.9.4.0 Version. I tried multiple solutions but in vain.The values are not present in the session on which magento decides to create the order and redirect the user to the success page. Can someone recommend best possible solution to the issue?


texts:
This is an open question where can come up with the solution or suggestion or tutorial links.

I tried several tutorials to build a custom magento 2 admin grid with custom tables.But i could not view a admin grid.

It would be great pleasure if any one can come up with the solution.

This question may be asked by some one in past but i did not find any answers as completed.

I could not update the entire task which i tried here by considering the length of the question.

WAITING FOR A EXPERT SUPPORT PLEASE


texts: Importing minor DB changes from local to live server

texts:
I am wondering what's the best way to import minor DB changes from local to live server.

We have local dev environment where we are adding new features to the site and once tested push them to life server.

Files are covered by git, so it's easy part.

Difficult part is that often we change some settings in the database, populate the new tables and redoing it all again on live server is very time consuming.

So last time we took latest dump of the live database, made did using Beyond Compare analyzing what tables were changed by us on local server, and imported only these tables.

It was ok, but there should be better tools for that than Beyond Compare, or better approach.

p.s. Initial database structures are identical, products,  IDs.

The changes are minor - like adding new module, and prepopulating needed details on local.


texts: How to fusion an AND et OR filter/condition in Magento?

texts:
how to fusion this instructions:
$collection->addFieldToFilter('updated_at', ['from' => $from])
           ->addFieldToFilter('updated_at', ['to' => $to])
or
$collection->addFieldToFilter('created_at', ['from' => $from])
           ->addFieldToFilter('created_at', ['to' => $to]);


texts: How to get customer name in invoice using rest api

texts:
I want to get customer name using invoice api. Any options to get customer name from invoice list.
API for invoice list
Method: Get
Url:http://localhost/jaipurnew/rest/all/V1/invoices/1
Response:show order and items details any options show customer name.


texts: I need to remove back to top, This is the html code : Top But however i cannot find this code or element id anywhere in web directory, I tried removing style from css, yet the top text remains, if anyone can help me please let me know


texts: How to add a telephone number in cart gift option form in Magento 2

texts: As per my head line is there any way to add a telephone number in gift option form on the cart page. I have added the image for best explanation.


texts:
Magento2 default magnifier not working , so i am trying to implement my own zoom option in website. I got elevatezoom ref as https://codepen.io/baagii95/pen/zPOeMB

I followed same script in my magento app/design/frontend/Smartwave/Porto/Magento_Catalog/product/view/gallery.phtml

Placed following code. but zoom option is not coming to my image. there is no errors in console as well.

<script type="text/javascript">
require(['jquery','elevatezoom'], function($){
  $(document).ready(function(){
    var img_src=$('.slick-track .slick-current .slick-active img').attr('src');
  $('.slick-track .slick-current .slick-active img').elevateZoom({
      zoomType: "inner",
      scrollZoom: "true",
      cursor: "crosshair"
  });
});
});

</script>

When i tried view.xml settings as below

<var name="magnifier">
            <var name="fullscreenzoom">5</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width">400</var> <!-- Width of magnifier block -->
            <var name="height">400</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
        <var name="mode">inside</var> <!-- Turn on/off magnifier (true/false) -->
        </var>

I am unable to see the zoomed image. please check attached screenshot for ref.


texts:
Is it possible to create a non CMS page?

Basically, I want a static 'coming soon' page in front of my website in the run up to it's launch, but I can't find a way to do this in the backend. It this possible?


texts: Want to add some content to the tab in magento 2 admin view product page

texts: I want to add some text to the admin product view in Magento 2 please help me, someone.check the screeshot where i want to show some info.


texts: Check if customer already confirmed e-mail programmatically

texts:
In backend configuration we can enable email confirmation, so customer need to confirm their email first then he can access their account,How to check if customer already confirmed their account programmatically using customer e-mail?

example:

$customer->getByEmail($email);
$customer->isCustomerAlredyConfirmed();


texts: Magento2: Cart rule not working properly

texts:
I go to Magento 2 Admin > Marketing > Promotions > Cart Price Rules and create a new Rule: Rule1:
Tab Rule Information:

Rule Name: Rule1
Status: Active
Websites: Main Website
Customer Groups: select all
Coupon: No Coupon
Uses per Customer: 0
From: blank
To: blank
Priority: 0
Public in RSS Feed: No

Conditions tab:

If ALL  of these conditions are TRUE :

If an item is FOUND  in the cart with ALL  of these conditions true:

Manufacturer  is  Adidas

Actions Tab:

Apply: percent of product price discount
Discount Amount: 10
Maximum Qty Discount is Applied To: 0
Discount Qty Step (Buy X): 0
Apply to Shipping Amount: No
Discard subsequent rules: No
Free Shipping: No
Apply the rule only to cart items matching the following conditions (leave blank for all items): nothing

Then I have assigned Adidas Manufacturer to "Sneakers" product and Nike to "Test Product5" product.
Add "Sneakers" product to cart and see it showing 10% discount in Order Summary because rule match with the condition.
Then added the "Test Product5" in the cart, which shows a 20% discount in the Order Summary that is wrong because only the "Sneakers" product matched with the condition and "Test Product5" product not matched with the cart rule condition.

The product that matching the rule in the cart individually:-

The product that not matching the rule in the cart individually:-

Please give me an advice. How can make a discount on each item in Magento 2.2.6?


texts: Magento 2.2: Redirect to category page after add to cart

texts:
I am trying to redirect to the product category page, the process enters through the getCategoryUrl function but has never just redirected to the category. I have tried many functions and none is effective.

Any ideas why this may be happening?

if (!$this->_checkoutSession->getNoCartRedirect(true)) {
   if (!$this->cart->getQuote()->getHasError()) {
      $message = __(
      __('You added %1 to your shopping cart.'),
         $product->getName()
       );
       $this->messageManager->addSuccessMessage($message);
    }
    if (key_exists('pg_category_from', $params)) {
        $categoryId = $params['pg_category_from'];
           if ($categoryId) {
               return $this->getCategoryUrl($categoryId);
         }
      }
 return $this->goBack('*/*');
}

private function getCategoryUrl($categoryId)
{
    $category = $this->categoryRepository->get($categoryId);
    $resultRedirect = $this->resultRedirectFactory->create();
    return $resultRedirect->setUrl($category->getUrl());
}


texts:
I want to get the category level in product/list.phtml to check

if (categorylevel == 1)
{
    hide product list
}else
{
    show product list
}

  How can I do that?

Any helps? Thank in advance.


texts: magento 2 how i can override the config save controller adminhtml?

texts:
magento_root\vendor\magento\module-config\Controller\Adminhtml\System\Config\Save.php

how can i override this controller in the magento 2


texts: How can I allow out of stock product to checkout

texts: Is there any solution available by which I can allow customer to checkout out of stock products in magento ?


texts: get attributes needed in shipping module

texts:
I'm using a fastway shipping module : It needs three-four attributes to calculate shipping cost, like height,width,length

Inside the module i can see these values being pulled

        $packageWeight = $request->getPackageWeight();
        $packageheight = $request->getPackageHeight();
        $packagewidth = $request->getPackageWidth();
        $packagelength = $request->getPackageLength();
        $packagedepth = $request->getPackageDepth();

Among the attributes Weight is the system attribute so, i'm able to get that, but those other attributes values are null/zero. I created length,height and width attributes.

So, how can i get those attributes values as i have set some numeric values on those attributes on product.

What i tried is : Mage_Shipping_Model_Shipping::collectRatesByAddress i added below block of code right below$request->setPackageWeight($address->getWeight());

    $request->setPackageHeight($address->getHeight());
    $request->setPackageLength($address->getLength());
    $request->setPackageWidth($address->getWidth());
    $request->setPackageDepth($address->getDepth());

And finally here Mage_Sales_Model_Quote_Item::setProduct() i added this block of code right below ->setWeight($this->getProduct()->getWeight())

            ->setHeight($this->getProduct()->getHeight())
            ->setLength($this->getProduct()->getLength())
            ->setWidth($this->getProduct()->getWidth())
            ->setDepth($this->getProduct()->getDepth())

Reference to this : Question's answer, still not being able to obtain those custom attributes value in the module(shipping module). What i am missing here ?


texts: Existing Customer Import including MD5 hashed password

texts:
I have existing customer data, which includes email addresses and passwords (already MD5 hashed.)

Can I import this data into Magento, whilst keeping the customers' existing passwords?

Will an override of Magento's customer authentication class be required?


texts: Magento 2: Out Of Stock Products are not showing on category Page

texts:
In Store => Configuration => Catalog => Inventory
I have set Display Out of Stock Products To Yes
But still Out of Stock products are not showing on any category Page. On home page out of stock products are showing - But in category page out of stock products are not showing.
is there any help or solution ?
Thanks


texts: difference of "name" and "as" attribute in layout files?

texts:
the docs read:

NAME - Name that can be used to address the block to which this
attribute is assigned. The name must be unique per generated page. If
not specified, an automatic name will be assigned in the format
ANONYMOUS_n
AS - An alias name that serves as identifier in the scope of the
parent element.

They're both unique identifiers. When do I use the name and when the alias?


texts: How to disable auto logout customer function in magento 2

texts:
I have some customers in my Magento2 application, now I try to delete them from backend. When these customers status is "Logged-in", they will auto logout by the system when they refresh the page.

Now I want to disable this function, and move it into checkout module, auto logout when they do checkout. So the problem is, which file should i modify? Is it come from the core-module?


texts: 500 Internal Server Error - after update magento from 2.1.11 to 2.2.2

texts:
I have been updating the magento version from 2.1.11 to 2.2.2 via composer.phar

update magento to 2.2.2 went correctly.

Then I run my store and see  error:
[500] Internal Server Error : Internal server error

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator webmaster@brands.nazwa.pl and inform them of the time the error occured and anything you might have done that may have caused the error.

in log file is:

[2018-01-30 17:54:27] main.CRITICAL: Asymmetric transaction rollback. {"exception":"[object] (Exception(code: 0): Asymmetric transaction rollback. at /home/brandswearxv/ftp/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:316)"} []


texts:
I have a marketplace assign product if same product have more then 1 seller it display that seller's information as well as product information with Add to cart. I am using ajax add to cart

<form action="<?php echo Mage::helper('checkout/cart')->getAddUrl(Mage::registry('current_product')); ?>" method="post" id="product_addtocart_form1_<?php echo $seller->getMpassignproductId(); ?>">

<button id="<?php echo $seller->getMpassignproductId() ?>"  class="button btn-cart customaddtocart" title="<?php echo $this->__('Add to Cart')?>">

    <?php echo $this->__('Add to Bag')?></button>

    <button class="button buy-now" onclick="location.href ='{{config path="web/unsecure/base_url"}}/checkout/cart/add?product=1&qty=1'">
    Buy Now</button>

</form>

Here My Js

if(el.up('form#product_addtocart_form1')){
                    var url =   $('product_addtocart_form1').readAttribute('action');
                    var link = url.replace('checkout','ajaxcart').replace('wishlist/index','ajaxcart/wishlist').replace('https','http');
                    el.onclick = function(){
                        if(productAddToCartForm.submit){
                            var emajcForm = productAddToCartForm;
                            if (('undefined' != typeof productAddToCartFormOld) && productAddToCartFormOld)
                                emajcForm   =   productAddToCartFormOld;
                            if(emajcForm.validator && emajcForm.validator.validate()){
                                jQuery('#product_addtocart_form1').ajaxForm(options);
                                $('product_addtocart_form1').setAttribute("action", link);
                                jQuery('#product_addtocart_form1').submit();
                            }
                        }
                        return false;
                    }
                }

My Problem is how to pass this dynamic id into that ajax

My form id like this way product_addtocart_form1_187
187 is a product id it will change based on product id

How to call please suggest me?


texts: How to tell a Custom Contact Form to use a certain Transactional Template

texts:
I've created a custom_form.phtml file, and I've place it alongside the normal form.phtml.

In a CMS Page, I've then added this block:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/custom_form.phtml"}}

...but now I'd like this form to use a certain Transactional template I made accordingly, named "Custom Transactional", and created under System > Transactional Mails.

How could I relate both the .phtml and the Transactional template with the multiple fields like {{var data.address}} {{var data.country}} {{var data.postcode}}, etc?

Many thanks for any input.


texts: how to fix not generated css file from less while run static deploy command in magento 2?

texts:
Magento Version 2.1.9
Current Mode : production

After switched from developer to production mode, I ran static deploy command but in that, I got following error on CLI

$ php bin/magento setup:static-content:deploy
Requested languages: en_US
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, Sm/market, Magento/backend
=== frontend -> Magento/blank -> en_US ===
=== frontend -> Magento/luma -> en_US ===
=== frontend -> Sm/market -> en_US ===
=== adminhtml -> Magento/backend -> en_US ===

Compilation from source: /home/<yoursite.com>/public_html/vendor/magento/theme-frontend-blank/web/css/email.less
Compilation from source:
frontend/Sm/market/en_US/css/email.less
Unable to get content for 'frontend/Sm/market/en_US/Magento_Bundle/css/source/_email.less'

Compilation from source: /home/<yoursite.com>/public_html/vendor/magento/theme-frontend-blank/web/css/email-inline.less
Compilation from source:
frontend/Sm/market/en_US/css/email-inline.less
Unable to get content for 'frontend/Sm/market/en_US/Magento_Bundle/css/source/_email.less'

and due to this, above mention files not generated on pub/static folder so please suggest me how to fix it in production mode?


texts: Get Attribute of products of the products in cart at onestepcheckout

texts:
I was trying to define some exceptions, and one of them is about the volume of the product.
I've got width-length-height attributes in the products.
And i was trying to get the total of these 3 attributes of all the products at my cart.

So i was trying things like this:

$cart = Mage::getModel('checkout/cart')->getQuote();
        $totalV= 0;

        foreach ($cart->getAllItems() as $item) {

        $prod_W = $item->getAttributeText('dp_width');
        $prod_H = $item->getAttributeText('dp_height');
        $prod_L = $item->getAttributeText('dp_length');
        $totalV += $prod_H + $prod_L +$prod_W;
        }

        ?>

        <input type = "hidden" class = "onestepcheckout-vol-prod" value = "<?php echo $totalV;?>
               " >
        </input>

I tries to using $item->getProduct()->getAttributeText('X'); but it gives me an error.

How could i get these values ?


texts: Sales flat order: ext_customer_id, ext_order_id

texts:
Does anyone know what the purpose is of the order attributes "ext_customer_id" and "ext_order_id"?

  The Magento code appears to introduce these attributes and they appear on each order, but never actually used.

Judging by the name, I suspect they could be used to store the values of IDs from third-party systems (i.e. "ext_" being short for "external").

My aim is that when a new order is made, a customer attribute that I introduced previously to hold a third party ID, is copied into the order object. In this way, it can be output as part of a SOAP call to retrieve the order data, so I don't have to make a separate call to fetch customer information.

Could I, therefore, put my own IDs in these attributes, or would it be more prudent to create a new attribute for this purpose, just to be on the safe side? But if it already exists, why not use it, right?

This is more of a "best practices" question so anything in that regard would be appreciated.


texts:
I want to have some limitation for transaction. One product can only allow purchase 1 per customer per day.
For example: Customer A can buy product A once per day, after payment that customer cannot buy the product anymore.

So it is not only restrict for product A only set for qty maximum to 1, it is also can check for Customer all order can only buy for product A for 1 per day.


texts: Home Page not loading properly in magento

texts: While I am try to load magento home after installation, page not loading properly.


texts: How to Add New Custom Filter on Customer Group

texts:
I am facing issue on adding new filter in customer group from Backend at Magento 2.3
Could you pleas help me on adding new filter to load in customer group page from backend,
Thanks


texts: Always show lowest price for grouped product with tiered pricing on category view

texts:
We have many grouped products that use tiered pricing on the simple products as we sell mostly wholesale. Magento shows a starting at price in the category view but what it shows is the lowest Each price for the simple products. We want to display the lowest tier price of the lowest cost item in the grouped product.

I believe I need to edit the price.phtml file for my template. I have already made a couple changes so everything says "Starting at:" uniformly across the site. Just not sure how to tell it to grab lowest tier price instead of lowest each price.

I have found some others asking for the same thing but I haven't found any response to the question. Hopefully mine will do a little better.


texts: Magento 2 - Uninstallable set of packages when deploying magento-sample-data

texts:
I've followed this Magento DevDocs tutorial to install sample data after installing Magento 2.

But after executing the last command ./bin/magento sampledata:deploy I get the following error:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 8
    - The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 9
    - The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 10
    - The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 11
    - The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 12
    - The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 13
    - The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 14
    - The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 15
    - The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 16
    - The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 17
    - The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 18
    - The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
  Problem 19
    - The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Haven't been able to find a solution and to be honest my knowledge of composer is seriously lacking. Any help would be welcome.


texts: Do not make Customer Default Shipping Address while creating an Order

texts:
When User Go To Checkout Page, And if he has already added the address, I do not want it to be preselected. it always shows unselected.

Like This


texts: Create a custom form in checkout shipping section

texts:
We have created a custom form under a custom shipping method.In that custom form,we have input text fields and select dropdown fields.
for posting these values while clicking place order,i have created extension attributes for it.this is working if i enter the details and select other shipping method but not when i first select and then enter the details and click place order button
I have checked in console and this rest api call rest/default/V1/carts/mine/shipping-information is being made whenever a shipping method selection is changed.
So i need to provide a update button below my custom form so that if i click on that the same rest method will call and so that my values will be posted to observer and in that observer i am saving the details to order tables
Can anyone guide me here in solving the above issue
Thanks!


texts:
I have a question for config url rewrite on .htaccess file.
On my store have two language is English and German.
I setup English with domain main.cocal and German is de.main.local.
so for now I want new setup for ch-de.main.local will be redirect to de.main.local. How I do that?
Many Thanks!


texts: Product is adding again to cart when 'add to cart' button is clicked twice

texts:
I have been working on Magento 1.9.2.4,
I am using an ajax cart extension to adding the product to cart, and its working good. the only problem I am having is once we click add to cart button is adding the product to cart, and if we click the button twice and so on the product keeps adding to the cart or quantity of the item in cart increases on every click on "add to cart" button,

I think it's Magento's default functionality, And I am trying to show a dialogue stating this product is already in the cart'* when the product is already added before in the cart while clicking on the "add to cart" button.

Any ideas for the function are welcomed.


texts:
There are many snippets available to get customer login status in a script. I'm using this:

[root]/tools/testlogin.php

require_once ('../app/Mage.php');
umask(0);
Mage::app();
Mage::getSingleton('core/session', array('name'=>'frontend'));
if ($session = Mage::getSingleton('customer/session', array('name'=>'frontend'))) {
    if ($session->isLoggedIn()) {
        echo 'logged in';
    } else {
        echo 'not logged in!';
    }
} else {
    // not even a session.
    echo 'not logged in';
}

It worked a couple of times earlier, but no matter what I do, I don't get the 'logged in' message anymore. I've logged out & back in at the shop. After logout from the shop, I also noticed the 'not logged in' message appear.

I've tried clearing browser sessions, Magento cache etc. Didn't work.
I've tried calling Mage::app('default');. No luck.

The only way I can make it work, 100% of the time, is by using Opera browser and putting the script not in /tools/ but in the root of the shop. For an isolated test, this is OK, but not for a complete application I'm building.

My cookie settings in Magento backoffice: (all default)
Cookie path: < empty >
Cookie domain: < empty >

If I specify a Cookie path: /
The testlogin script doesn't even work in the root anymore.

I've also set cache headers in my script:

  header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1
  header("Pragma: no-cache"); //HTTP 1.0
  header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past

I'm afraid I've run out of options. Anyone?


texts: How do I get my product details in my magento 1.9 including product reviews etc

texts:
I've been learning magento1 recently, but I don't know much about how magento gets product details

I just want to get some necessary information about the product and some of the properties I defined, I'll change it again. If you can get your help, this will be very good.

Thank you


texts: Shipping methods does not appear for different countries

texts:
I use magento 1.9.0.1 CE

It works correctly in France, and I am trying to make shipping for different countries.

For France we use Extension So Colissimo, and for other countries we have installed Owebia 2.

We have already created the grid of shipping fees for different countries based on the weight of the product in Owebia 2 and it seems that it works, but only for France.

Because in Owebia we have also created shipping fees for France, so when we have country France chosen both appears, So Colissimo and Owebia 2.

If we choose other country like Germnay, Belgium, Italy end so on, all shipping methods disapears, so methods from So Colissimo are removed (and that is OK) and also all the methods for Owebia 2, that should appear for Germany, Italy, Belgium etc.

Normally I have checked in System / Configuration / General /,

Countries options

Allow Countries :

Germany
Italy
Belguim
etc

Are selected, I do not know where else I can check to activate those methods of shipping for other countries than France.

Is there anyone who had the same problem? Or how can I correct it?

Thanks in advance.


texts: How to prevent automatic url- rewiting in Magento 1.9.0.1?

texts:
I am having problem while url-rewriting, I am creating custom url-rewrite in which Requested path is

products/kitchen-cleaner/screen-wipes

Target path is

screen-wipes

but it automatically generate and redirecting on screen-wipes-21.


texts: Dependencies not injected propperly on Magento2?

texts:
I am running my code on dev mode without compiling the code using di:compile and it works well. However when I turn it in production mode and compile it running di:compile then it breaks.

I wonder why that might be?


texts:
I'm trying to create a Module that gets the order data when an order is placed and sends it to a third party using FTP.

I've created an Observer that gets called by the sales_order_place_after event.

My Observer code:

<?php

use Magento\Framework\Event\ObserverInterface;

class Orderobserver implements ObserverInterface
{
    public function __construct(
        \Magento\Quote\Model\QuoteFactory $quoteFactory,
        \Magento\Sales\Model\Order $order,
        \Digitaq\CbFashion\Helper\Data $helper
    )
    {
        $this->_order = $order;
        $this->_helper = $helper;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        $this->_helper->writeShp($order);
    }
}

The observer gets called succesfully and the writeShp method also does, but it's not possible for me to dump the $order variable, as that leads to a redirect to the cart without the order being fulfilled. How can I see this  variable so I know what data I can pull?


texts: Paypal Express Checkout redirects to cart for United States

texts:
I have setup Paypal Express and that works fine if I create an order for Germany (Merchant Country) and some other countries.

But if I select United States in step "2. Billing Information" I get a wrong redirected after step "5. Payment Information". Instead of Paypal I get redirected to /checkout/cart.

In /var/log/exception.log i found:

  exception 'Mage_Core_Exception' with message 'PayPal NVP gateway
  errors: The field Shipping Address State is required (#10729: Shipping
  Address State Empty). Correlation ID: 15fb525b60ff5. Version: 72.0.'
  in htdocs/app/Mage.php:579


texts: Magento 2 : How To Create UNIQUE KEY Field in Custom Tabel

texts:
I want to create custom filed say myname with constraints UNIQUE KEY in custom extension table.

In Magento1 we can define like this :

UNIQUE KEY `myname` (`myname`)

How can I do this in Magento2?


texts: Change Product type From physical Configurable/Simple to Virtual after adding it to basket

texts:
Is it possible that we can change product type in quote.
We dont want to change product type in database but only for specific quote. When user add any configurable product to cart then based on some conditions (we will define them in event) we will flip product type from configurable physical to virtual.


texts:
phpstorm IDE saing that method 'delete' is deprecated. Is there any alternatives?

public function deleteVoucherStatus($entity_id)
    {
        $voucherStatus = $this->voucherStatusModelFactory->create();
        try {
            $voucherStatus->setId($entity_id)->delete();
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }

        return true;


texts: Using QTY in Rule-Based Product Relations

texts:
Using Magento EE 1.14 and would like to be able to use the inventory quantity for rule-based product relations (related, upsell, cross sell). However, I don't see a way to make the quantity available as a criteria in the conditions dropdown.

Anyone have a solution for this?

We allow backorders on all of our products, so I would prefer that recommendations are made based on products that currently have a quantity of 1 or more in stock. Without this capability, I can't think of another way to limit rule-based relations to in-stock items only.


texts: how to set custom template in custom block file in magento 2

texts:
How to set custom template in custom block file. I have created a template which contains paragaraph. I need to set this template in my block file . So What is the syntax to  set template.
I have declared my block(frontend_model) in system.xml file, Now I need to add template in my block using setTemplate() function. Please provide me a correct solution


texts: How can I add "add to cart button" in custom phtml file?

texts:
How can I add "add to cart button" in my custom phtml file in Magento 2 ?

Please describe how default Magento 2 add to cart button working.


texts: Magento error in catalog manage product: Source model not found for attribute

texts:
I am facing error in magento/admin catalog > manage product> and product.

when I am trying to open Product its giving error :

  There has been an error processing your request
  Exception printing is disabled by default for security reasons.
  Error log record number: 1102395163076

I am seeing this error only in Catalog >products.

I checked error report in var>report, this is what it says:

    a:5:{i:0;s:110:"Source model "temando/entity_attribute_source_packaging_mode" not found for attribute "temando_packaging_mode"";i:1;s:3814:"#0 /home/cluster-sites/4157/e/eponaforge.com/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(387): Mage::exception('Mage_Eav', 'Source model "t...')
#1 public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(201): Mage_Eav_Model_Entity_Attribute_Abstract->getSource()
#2 public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(70): Mage_Adminhtml_Block_Widget_Form->_setFieldset(Array, Object(Varien_Data_Form_Element_Fieldset), Array)
#3 /public_html/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm()
#4 /public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml()
#5 /public_html/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml()
#6 /public_html/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout()
#7 /public_html/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#8 /public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs')
#9 /public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', 'product_tabs')
#10 /public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#11 /public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#12 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#13 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#14 /public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(Array, true, true)
#15 /public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(207): Mage_Adminhtml_Controller_Action->loadLayout(Array)
#16 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->newAction()
#17 /public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('new')
#18 /public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /public_html/index.php(87): Mage::run('', 'store')
#22 {main}";s:3:"url";s:92:"/index.php/admin/catalog_product/new/set/4/type/simple/key/4beccee60930382af9537cd1010c4f7a/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts: Include a script after a custom form has been submitted

texts:
My case is the following:

I need to output in the document a google analytics script after a custom contact form has been submitted, i have thought about many things like:

observers.
layout handles
using javascript ( this didn't worked)

How can I achieve this?

More details: After successful send, the controller doues a page redirect to the same url also outputs a success message.


texts: Magento 2 : Broken reference: No element found with ID 'sidebar.additional'

texts:
I got this error while I am open the product page in system.log

  Broken reference: No element found with ID 'sidebar.additional'


texts: How to fix "ThreeDomainSecure is not a function" during PayPal Credit Card Payment?

texts:
We using the standard Magento 2 PayPal integration.
On the production site of our customer, we get an Javascript error "window.paypal.ThreeDomainSecure is not a function", and payment cannot continue.
This happens when trying to place an order with the inline VISA form on the Checkout (not when using an existing paypal account).
It also happens only on production, so we cannot reproduce that locally yet with the sandbox account.
We cannot find this line of code in the Magento code, so we believe the error comes from the components loaded from PayPal
Did anybody see this issue before and knows a solution or how to narrow it down?
Is it likely to be related to the PayPal account or a technical issue?
A bit debugging:

Somhow the module seems to be there? but cannot be accessed

It seems to come all from PayPal? So no Magento issue?
Can it be due to some server config?

window.paypal.ThreeDomainSecure
undefined

EDIT is it maybe related to CSP blocks? Can I even influence that? The checkout.js mentioned is also loaded from PayPal.

EDIT it seems to be related to the PayPal account, as we cannot reproduce it with a sandbox account. There is a PayPal support case open, still we try to rule out issues on our side.


texts: How to show a higher quality image in Magento2 Gallery Fullscreen

texts:
I want to load the product_page_main_image (which is larger) rather than the  product_page_image_medium when you click the Fotorama Gallery. This will give me a higher quality image because it's higher resolution.
I have changed the values in my /Magento_Catalog/templates/product/view/gallery.phtml but it altered the size of the HTML element, not the actual image loaded (which was still the medium version).
Here is my gallery.phtml
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Product media data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\Gallery
 */
?>

            <img src="<?= /* @escapeNotVerified */ $block->getViewFileUrl('images/loader-1.gif') ?>"
                 alt="<?= /* @escapeNotVerified */ __('Loading...') ?>">


texts: Disabling Magento_CatalogStaging creates a staging duplicate query issue for a record that doesn't exist

texts:
I am attempting to disable Catalog Staging without starting over.
I ran this command
bin/magento mo:d Magento_CatalogStaging Magento_CatalogImportExportStaging Magento_BundleStaging Magento_ConfigurableProductStaging Magento_CatalogUrlRewriteStaging Magento_DownloadableStaging Magento_WeeeStaging Magento_CatalogInventoryStaging

However, it creates this query error below which doesn't seem to make sense because the value '0-79-0' means that the first 0 should reference an entity_id but I do not have a row_id or entity_id with the value of 0(obviously).
Integrity constraint violation: 1062 Duplicate entry '0-79-0' for key
'CATALOG_PRODUCT_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID', query was:
ALTER TABLE `catalog_product_entity_datetime`
ADD COLUMN `entity_id` int(10) UNSIGNED NOT NULL DEFAULT 0
COMMENT "Entity ID",
DROP COLUMN `row_id`,
DROP KEY `CATALOG_PRODUCT_ENTITY_DATETIME_ROW_ID_ATTRIBUTE_ID_STORE_ID`,
ADD CONSTRAINT `CAT_PRD_ENTT_DTIME_ENTT_ID_CAT_PRD_ENTT_ENTT_ID`
FOREIGN KEY (`entity_id`)
REFERENCES `catalog_product_entity` (`entity_id`)
ON DELETE CASCADE,
ADD CONSTRAINT `CATALOG_PRODUCT_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID`
UNIQUE KEY (`entity_id`,`attribute_id`,`store_id`)

I have tried to run a query checking for any duplicates in general but I am not getting anything.


texts:
I am upgrading Magento 2.3.3 to Magento ver 2.3.5-p1 through the composer. After composer install and composer update when I try to run bin/magento setup: upgrade I am getting

"An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig)."

error. Please suggest on this.
PHP ver 7.3.18


texts: Magento 2 - Add a Custom Social Plugin to header.phtml

texts:
How to add a custom Social Login to header.phtml and to be displayed on the frontend?

I need to add custom social plugin before the Sign In?
   Anyone help?


texts: How to create Sales rule (Coupon) in magento 2 programmatically

texts:
I created the coupon in function its works perfectly now I want to apply sales rules (apply on specific product) my code is

 public function setCoupon()
{
    // $this->_state->setAreaCode('adminhtml');
    // $this->_state->setAreaCode('frontend');

    // $coupon['name'] = 'Offer_asad17';
    $coupon['name'] = 'Sheikh';
    $coupon['desc'] = 'Discount for vip signup coupon.';
    $coupon['start'] = date('Y-m-d');
    $coupon['end'] = '';
    $coupon['max_redemptions'] = 1;
    $coupon['discount_type'] ='by_fixed';
    $coupon['discount_amount'] = 15;
    $coupon['flag_is_free_shipping'] = 'no';
    $coupon['redemptions'] = 1;
    // $coupon['code'] ='NL017-1234'; //this code will normally be autogenerated but i am hard coding for testing purposes
    $coupon['code'] ='Sheikh-1234'; //this code will normally be autogenerated but i am hard coding for testing purposes

    $this->_rule->setName($coupon['name'])
            ->setDescription($coupon['desc'])
            ->setFromDate($coupon['start'])
            ->setToDate($coupon['end'])
            ->setUsesPerCustomer($coupon['max_redemptions'])
            ->setCustomerGroupIds(array('0','1','2','3',))
            ->setIsActive(1)
            ->setSimpleAction($coupon['discount_type'])
            ->setDiscountAmount($coupon['discount_amount'])
            ->setDiscountQty(1)
            ->setApplyToShipping($coupon['flag_is_free_shipping'])
            ->setTimesUsed($coupon['redemptions'])
            ->setWebsiteIds(array('1'))
            ->setCouponType(2)
             // ->setProductIds(array('1','2','3'))
            // ->setProductIds([1,2,3])
            // ->setProductIds(array(1,2,3))
            //->setProductIds([1,2,3])
            // ->setProductIds('1')
            ->setProductIds(1)
            ->setCouponCode($coupon['code'])
            ->setUsesPerCoupon(NULL);
    $this->_rule->save();
}


texts: Magento "include(Profiler.php): failed to open stream: No such file or directory in Autoload.php"

texts:
I tried moving a project to another server but after I copy all the files and the database and try to access the new server I get the warning:

  include(DOMDocument.php): failed to open stream: No such file or directory  in /home/projectname/public_html/lib/Varien/Autoload.php on line 94

It makes it imposible to access either the frontend or the backend.
The magento version for the project on the old server is 1.8.1.0 and the magento version for the project on the new server is 1.9.2.1.
Maybe someone else encountered this error and can give an advice on where to start.


texts: Please let me know how to create custom slider in magento 2.


texts: Create custom order CSV per order with header record and detail record

texts:
I am working on Magento ver 1.9.2.3, And I want to export a order csv per order in header record and detail record format.

What i have done till now

I have created a custom module which export csv per order on a click through actions in order grid. i am getting all values whichever I need. but all these values lies in a same line.

My main problem is the format of the csv, these header and detail records(of which i have no knowledge) will be used for godrej Navision.

Here Header Record will hold the user data which will be followed by "H" whereas Detail Record will hold the order details per item and followed by "D".

If someone has any idea about these please help me out.

Regards
Lalit


texts: HTTPS and RSS feeds. Why are they only HTTP?

texts:
My checkout page isn't 100% secure, and it's because of my RSS feeds.  When I go to my page with HTTPS, everything loads with HTTPS (css files and stuff),  EXCEPT for RSS feeds. They still load with HTTP.

Is there a way to get Magento to use HTTPS with RSS links?


texts: Magento 2 : Product options date saved less then select date while add to cart

texts:
I have just set the time zone from admin configuration.

Time Zone: Gulf Standard Time (Asia/Muscat)
Time Zone Configuration

I have a product which has an option for the delivery date and once I am selecting any date and trying to add to cart at that time always 1 date is minus from selected date and save value is always less than one from a selected date  see video for more information
Issue Video

This issue faced while we have select Gulf Standard Time (Asia/Muscat) Time zone from admin

Does anyone have an idea how to fix this issue?
Any help appreciated Thanks...


texts: Invalid argument supplied for foreach() in Status.php

texts:
I have Magento 2.3. I created  Status.php in [Banner/Slider/Model/Slider/Source]
but it gives an error
[Invalid argument supplied for foreach() in C:\xampp\htdocs\mag3\app\code\Banner\Slider\Model\Slider\Source\Status.php on line 22]
this is Status.php
<?php

namespace Banner\Slider\Model\Slider\Source;

use Banner\Slider\Model\Slider;
use Magento\Framework\Data\OptionSourceInterface;

class Status implements OptionSourceInterface
{
    protected $status_slider;

    public function __construct(Slider $status_slider)
    {
        $this->status_slider = $status_slider;
    }

    public function toOptionArray()
    {
        $availableOptions = $this->status_slider->getAvailableStatuses();
        $options = [];
        foreach ($availableOptions as $key => $value) {
            $options[] = [
                'label' => $value,
                'value' => $key,
            ];
        }
        return $options;
    }
}


texts: How to find and replace product title using sql query

texts:
I am having a magento store with English and Arabic language store view.
I am having more than 5000 products(both simple & configuable products). All the products starts from Style now i want to modify the text "Style" into "Model"

Same as well as for Arabic language store view.

I want to know, how to find the product title and replace my required text using sql query.


texts: How override name.phtml file for shipment Magento 2.4

texts:
I want to add my cusotm code in Magento_Sales::items/column/name.phtml file
i also created the following XML file
sales_order_creditmemo_new.xml,
sales_order_creditmemo_updateqty.xml,
sales_order_creditmemo_view.xml,
sales_order_invoice_new.xml,
sales_order_invoice_updateqty.xml,
sales_order_invoice_view.xml,
sales_order_view.xml

but it's not work for ship
can anybody help me out?


texts: PayPal Website Payments Pro - Payment Declined

texts:
Setting up PayPal Website Payments Pro on Magento 2, I always see the error "Your payment has been declined. Please try again." when placing a credit card order. There's no exception information in any of the logs.

I suppose something is configured incorrectly with the PayPal settings. The documentation (see the note that outside US this is called PayPal Website Payments Pro) says, under Setting Up PayPal Payments Pro > Step 3 > 1 > b:

  Enter one of the following credentials that you use to log in to your PayPal merchant account

This however seems to be inaccurate because Magento won't allow the payment method to be activated unless ALL 3 fields are filled in.

So, I've entered:

Partner: PayPal
Vendor: My paypal login email address
User: ??

For the user, the documentation says that I should enter:

  The ID of an additional user who is set up on your PayPal account.

There is only one user for this account, so I don't know what to put in this field. I've tried all the following with the same "declined" result:

My PayPal login email
My Merchant account Id

Am I supposed to enter my own user id? If so, how do I find out what it is - there is nothing with a name like that in my PayPal account.


texts: Magento 2 update payment method when price is updated on checkout page

texts:
I want to update the payment methods when product price change greater than zero (0) I am working on a customized project I added the product by default 0 price.

When price is 0 on checkout page payment methods are not shown which is working but when I update price payment methods are not shown.


texts: Admin menu path to: Enable Form Key Validation On Checkout

texts:
After installing patch SUPEE-9767 the "Enable Form Key Validation On Checkout" warning appeared and from the link provided in that warning I was able to enable Form Key Validation.

But, after having some issues in the checkout process I would like to try to disable it and check if everything comes back to normal.

The big problem here is that I cannot find where the option is in the admin menu.

I seem to recall it was in:

System > Configuration > Advanced > Security > Enable Form Key Validation On Checkout

But if it was there, now it has disappeared. Do I recall it wrong or what might be the issue?


texts:
I want to use RabbitMQ with magento 2.3.x in local setup.
If anyone has any good reference link/extension then please provide me.
I referred below links.

https://www.egrovesys.com/blog/rabbitmq-magento2/
https://www.scommerce-mage.com/blog/magento-2-rabbit-mq-implementation.html


texts:
I want to retrieve database value in cart page but it shows 0.
Please review my code.

app/code/Sugarcode/Test/Model/Total/Fee.php

/**
 * Collect grand total address amount
 *
 * @param \Magento\Quote\Model\Quote $quote
 * @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
 * @param \Magento\Quote\Model\Quote\Address\Total $total
 * @return $this
 */
protected $quoteValidator = null;

protected $rewardspointCollectionFactory;

public function __construct(
        \Magento\Quote\Model\QuoteValidator $quoteValidator,
        \Sugarcode\Test\Model\ResourceModel\Fee\CollectionFactory $rewardspointCollectionFactory
        ) {
    $this->quoteValidator = $quoteValidator;
    $this->rewardspointCollectionFactory = $rewardspointCollectionFactory;
}

public function collect(
\Magento\Quote\Model\Quote $quote, \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment, \Magento\Quote\Model\Quote\Address\Total $total
) {
    parent::collect($quote, $shippingAssignment, $total);

    $exist_amount = 0; //$quote->getFee();
    $fee = 10; //Excellence_Fee_Model_Fee::getFee();
    $balance = $fee - $exist_amount;

    $total->setTotalAmount('fee', $balance);
    $total->setBaseTotalAmount('fee', $balance);

    $total->setFee($balance);
    $total->setBaseFee($balance);

    $total->setGrandTotal($total->getGrandTotal() + $balance);
    $total->setBaseGrandTotal($total->getBaseGrandTotal() + $balance);

    return $this;
}

protected function clearValues(Address\Total $total) {
    $total->setTotalAmount('subtotal', 0);
    $total->setBaseTotalAmount('subtotal', 0);
    $total->setTotalAmount('tax', 0);
    $total->setBaseTotalAmount('tax', 0);
    $total->setTotalAmount('discount_tax_compensation', 0);
    $total->setBaseTotalAmount('discount_tax_compensation', 0);
    $total->setTotalAmount('shipping_discount_tax_compensation', 0);
    $total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
    $total->setSubtotalInclTax(0);
    $total->setBaseSubtotalInclTax(0);
}

/**
 * @param \Magento\Quote\Model\Quote $quote
 * @param Address\Total $total
 * @return array|null
 */

/**
 * Assign subtotal amount and label to address object
 *
 * @param \Magento\Quote\Model\Quote $quote
 * @param Address\Total $total
 * @return array
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total) {

    $rewardspointCollection = $this->rewardspointCollectionFactory->create();
    $customerId = $quote->getCustomerId();
    $rewardspointCollection->addFieldToSelect('*')
            ->addFieldToFilter('dukaaniatest_id',$customerId);
    if(count($rewardspointCollection) > 1){
       $firstItem =  $rewardspointCollection->geFirstItem();
       return [
        'code' => 'fee',
        'title' => $firstItem->getData('title'),
        'value' => $firstItem->getData('author')
    ];
    }else{
        return [
        'code' => 'fee',
        'title' => 'Fee',
        'value' => 'title',
    ];
    }

}

/**
 * Get Subtotal label
 *
 * @return \Magento\Framework\Phrase
 */
public function getLabel() {
    return __('Fee');
}

}


texts:
I have canceled the current order like

use Magento\Sales\Model\OrderFactory;
$order = $this->orderFactory->create()->loadByIncrementId($order->getIncrementId());
$order->cancel()->save();

After that, create a new quote and assign the quote item using this link.

https://webkul.com/blog/programmatically-add-more-product-to-an-existing-quote-in-magento-2/

It's working fine. But when the ordered product has 1 qty, it returned the "product is out of stock" message.

How to resolve that.

How to restore the quote for payment failure.

Thanks.


texts:
I am trying to set up the emails for a Magento 2 site.

Part of my email template is:

Dear {{htmlescape var=$customer.name}} ,

Unfortunately, when the email is sent, I get

Dear {{htmlescape var=$customer.name}} ,

Rather than

Dear John Smith ,

Interestingly, it appears to be only the variables with htmlescape in them that are the problem. {{var store.getFrontendName()}}, for example, is correctly processed.

I inserted the code using the "Insert Variable" button so it isn't  a typo


texts: Magento - Invalid callback Error Scheduler after upgrade

texts:
Magento Version: 1.9.3.0
After the recent update, the scheduler cron produces this error:

Error while running "customer_flowpassword"
"customer_flowpassword" messages:
---EXCEPTION---
exception 'Mage_Core_Exception' with message 'Invalid callback: Model for mage_customer/observer::deleteCustomerFlowPassword does not exist' in app/Mage.php:595
Stack trace:
#0 app/code/community/Aoe/Scheduler/Helper/Data.php(298): Mage::throwException('Invalid callbac...')
#1 app/code/community/Aoe/Scheduler/Model/Job.php(143): Aoe_Scheduler_Helper_Data->getCallBack('mage_customer/o...')
#2 app/code/community/Aoe/Scheduler/Model/Schedule.php(192): Aoe_Scheduler_Model_Job->getCallback()
#3 app/code/community/Aoe/Scheduler/controllers/Adminhtml/JobController.php(92): Aoe_Scheduler_Model_Schedule->runNow(false)
#4 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Aoe_Scheduler_Adminhtml_JobController->runNowAction()
#5 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('runNow')
#6 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#8 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 index.php(83): Mage::run('', 'store')
#10 {main}


texts: Problem logging into Backend of Magento 2

texts:
I have the following error what should I do?

  Fatal error: Uncaught Zend_Cache_Exception: cache_dir
  "/home/tradesignletters/public_html/var/page_cache" is not writable in
  /home/tradesignletters/public_html/vendor/magento/zendframework1/library/Zend/Cache.php:209
  Stack trace: #0
  /home/tradesignletters/public_html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180):
  Zend_Cache::throwException('cache_dir "/hom...') #1
  /home/tradesignletters/public_html/vendor/colinmollenhour/cache-backend-file/File.php(87):
  Zend_Cache_Backend_File->setCacheDir('/home/tradesign...') #2
  /home/tradesignletters/public_html/vendor/magento/zendframework1/library/Zend/Cache.php(153):
  Cm_Cache_Backend_File->__construct(Array) #3
  /home/tradesignletters/public_html/vendor/magento/zendframework1/library/Zend/Cache.php(94):
  Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true) #4
  /home/tradesignletters/public_html/vendor/magento/framework/App/Cache/Frontend/Factory.php(154):
  Zend_Cache::factory('Magento\Framewo...', 'Cm_Cache_Backen...',
  Array, Array, true, true, tru in
  /home/tradesignletters/public_html/vendor/magento/zendframework1/library/Zend/Cache.php
  on line 209


texts: Magento 2 Module License: Can I buy once and use modules on multiple instances?

texts:
I'm currently developing with magento2 and want to setup 4 instances of magento2:

Two local dev environments (two developers)
Dedicated Test Server
Production Server

When I buy a module from magento marketplace, can I install it on all four magento systems or do I have to buy the module four times?


texts:
I'm trying to get the stock quantity of my products via graphql, here is my query, but the quantity is obviously not in the schema. Am I wrong? Is there a possibility to get it somehow?
request:

{products(filter: {sku: {like: "024-%"}}) {
    total_count
    items {
    sku, delivery, name
    }
  }
}

response:

{
  "data": {
    "products": {
      "total_count": 101,
      "items": [
        {
          "sku": "024-0010-1-0004",
          "delivery": "0",
          "name": "Zeller Keramik Platzset 43 x 30 cm Hahn & Henne"
        },
       ...
}


texts: disable fedex shipping method before minimum cart amount 50 in magento2

texts:
I want minimum order amount 50. I have to enable free shipping and FedEx.

I have configured as:

System >> configuration >> Sales >> Minimum order amount >> Yes

but default Magento minimum order amount doesn't  work.

How to set minimum order amount 50?

Please give me any solution!


texts: Error if I try to print invoices using fooman email attachment extension

texts:
I am using Magento ver. 1.9.0.1. I have installed Fooman email attachment extension. Now I am trying to print an invoice from orders in admin. But facing following errors:

There has been an error processing your request

ImageType is not JPG

Trace:

#0 /magento/lib/Zend/Pdf/Resource/ImageFactory.php(62): Zend_Pdf_Resource_Image_Jpeg->__construct('/home/magento/...')
#1 /magento/lib/Zend/Pdf/Image.php(124): Zend_Pdf_Resource_ImageFactory::factory('/home/magento/...')
#2 /magento/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php(158): Zend_Pdf_Image::imageWithPath('/home/magento/...')
#3 /magento/app/code/community/Fooman/EmailAttachments/Model/Order/Pdf/Order.php(49): Mage_Sales_Model_Order_Pdf_Abstract->insertLogo(Object(Zend_Pdf_Page), Object(Mage_Core_Model_Store))
#4 /magento/app/code/community/Fooman/EmailAttachments/controllers/Admin/OrderController.php(64): Fooman_EmailAttachments_Model_Order_Pdf_Order->getPdf(Array)
#5 /magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Fooman_EmailAttachments_Admin_OrderController->pdfordersAction()
#6 /magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('pdforders')
#7 /magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 /magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /magento/index.php(87): Mage::run('', 'store')
#11 {main}

I have JPG and JPEG format logo uploaded in sales email admin.

Please help.


texts: How are values for bundle product stored in the database?

texts:
I wanted to know the flow which is being use while saving bundle product.
In database their are two main tables, catalog_product_bundle_option and catalog_product_bundle_option_value, which store data related to options of bundle item of product.

But how does Magento know when to store data in catalog_product_bundle_option and when in catalog_product_bundle_option_value?

It is not like static type of attribute which is used for saving EAV data.


texts: How to set different css files for each store in custom module

texts:
I created a module which is changing some of the behaviours on the bundle product. I also need to create some CSS and I did create a file and attach in a layout by doing this:

<css src="Bachus_BundleContextPros::css/bundle_style.css"/>.

Now the problem is that the store is multi-store with different colour shapes.

My question is how do apply to different versions of my bundle_style.css for each store ?


texts: Magento 2: Very long loading JavaScript on website

texts:
Our site has recently started to load  a very long time. Does anyone know what this may be due to? I think is any issue with JS.

Does anyone know what this may be due to?


texts: Session data showing in wrong customer in Magento 1.7.0.2

texts:
One of my websites built with Magento 1.7.0.2, that's sharing/showing wrong customer session data. If a customer Sign In but sometimes showing he/she didn't Sign In. Even Customer Shopping Cart data showing the wrong products.

Please help. Thanks in advanced.


texts: Magento 2 : How Can I Add Arabic URL to Products and Collections

texts: How can I add Arabic URL to products and collections in my Magento 2 store?


texts: Show javascript alert after product is added to cart in Magento2

texts: I would like to show javascript alert once the product is successfuly added to the cart. How could I achieve it?


texts: I took over a magento site running on nginx. I looked and saw that currently there are ~100 "online" guests, all of them are bingbot. There are a lot of suggestions for how to properly block bots, referers, and user-agents (such as this one), but none of them really explain their code and how it does what they say it does. I am wondering if anyone could suggest code for bot/user-agent/referer blocking in nginx, and explain why that code works.


texts: Magento 1.9 Rounding Issue Tax Calculation

texts:
I have a product priced at £10.82 which gets 20% VAT added to it, leaving the price to be £12.98

This works fine when 1 product is in the cart but when more than 1  (e.g. 7) are added the calculation works like this

£10.82 * 7 = £75.74 (no problem here)
£75.74 * 1.2 = £90.888 (which is rounded to £90.89

When £12.98 * 7 = £90.86 (the correct amount). This is the figure I need to show not £90.89.


texts:
I want to redirect http requests to https on Magento CE 1.8. I followed the steps below, but none of the methods work:

system->web->secure->Use Secure URLs in Frontend "yes"

In my .htaccess file:

## workaround for HTTP authorization

## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
  RewriteCond %{HTTPS} off
 RewriteCond %{HTTP:X-Forwarded-Proto} !https
 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I also tried: Issue redirecting http to https and changed the file app/code/core/Mage/Core/Controller/Varien/Front.php but it still does not work.


texts: Magento 2 : Get value from system configuration in layout XML

texts:
how do I get my module link identifier in the footer from the core config values I set in the admin system configuration

<referenceBlock name="footer_links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="storelocator-policy-link">
            <arguments >
                <argument ifconfig="googlemapsstorelocator/general/enable" name="label" xsi:type="string">Google Maps Store Locator</argument>
                <argument name="path" xsi:type="string">I need this value form the configuration settings</argument>
            </arguments>
        </block>
</referenceBlock>


texts:
I need to update minicart from Homepage to Untill Checkout.

I exactly need to update price to solve Magento 2: Admin price changes are not refreshing minicart immediately till checkout

Which event I need to use?

I already seen

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html
https://webkul.com/blog/update-mini-cart-magento2/


texts: Magento 1 Class Rewrite in Magento 2 with Dependency Injection System

texts:
Poking around Magento 2's core code, it looks like the old class rewrite system has been ripped out and replaced with a new dependency injection system.

Unfortunately, there's no documentation for this new system.

Does anyone have a module configuration sample that would let a user, in Magento 2, "rewrite" the class Mage_Catalog_Model_Product with a new class Packagename_Modulename_Model_Product, using the new dependency injection system?


texts: Unable to update product data via REST API

texts:
I send a HTTP PUT request using this url route /rest/V1/products/{SKU}

JSON:

{
  "product": {
  "name": "Test title",
  "price": 123
  }
}

But nothing is changed on the product.

The response is the same I get when sending a HTTP GET request. So it seems to just ignore that it's an update request.

The product was created by sending a POST request. So POST and GET is working fine.

Any ideas?


texts: Magento 2 - show category tree in left navigation

texts:
Is there a way to get category tree list and limit the depth of it on the Magento 2 main category left sidebar subcategories list? Currently the list goes like this:

Categories:

- Subcategory 1
- Subcategory 2
- Subcategory 3
- Subcategory 4
...

The file which generates this list is within Magento_Catalog/templates/navigation/left.phtml with the following structure:

?>
<?php if (!$block->getCategory()) {
    return;
} ?>
<?php $_categories = $block->getCurrentChildCategories(); ?>
<?php $_count = is_array($_categories) ? count($_categories) : $_categories->count(); ?>
<?php if ($_count): ?>

            <?php /* @escapeNotVerified */ echo __('Shop By') ?>

            <?php /* @escapeNotVerified */ echo __('Shopping Options') ?>

<?php /* @escapeNotVerified */ echo __('Category') ?>

                        <?php foreach ($_categories as $_category): ?>
                            <?php if ($_category->getIsActive()): ?>

                                    <a href="<?php /* @escapeNotVerified */ echo $block->getCategoryUrl($_category) ?>"<?php if ($block->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $block->escapeHtml($_category->getName()) ?>
                                    <?php /* @escapeNotVerified */ echo $_category->getProductCount() ?>

                            <?php endif; ?>
                        <?php endforeach ?>

<?php endif; ?>

I would like to show subcategory tree with depth 2 so it shows lvl2 subcategories also beneath it's parent category:

Categories:

- Subcategory 1
    Subcategory 1.1
    Subcategory 1.2
    Subcategory 1.3

- Subcategory 2
    Subcategory 2.1
    Subcategory 2.2
    Subcategory 2.3

- Subcategory 3
    Subcategory 3.1
    Subcategory 3.2
    Subcategory 3.3
...


texts: Magento2.3.2: Why deleted urls coming again and again

texts:
My website is Depoto

I have some categories, products, Static blocks and cms pages.

I deleted some of the pages and etc.

I was using Magecomp's 404 notifier extension. There I am getting 100's of deleted URLs too.

I checked in url_rewrite table too. But i did not find any deleted urls entry from this table.

For example, https://www.depoto.com/depoto-mining  is not in my website. I deleted so far back. But why its showing in notificatiions?


texts:
I want AWS CloudFront to be implemented in production for a Magento 2 site.

I would like to know what changes are required to change the path of images and audio/ video files, to set up on S3 bucket.

Please note that the site will remain same, its just the media files will be moved to S3 bucket on AWS.