texts: Shopping cart price rule not applying when creating order by REST Api

texts:
I'm working with Magento CE 1.7.0.2.
I create order by sending REST Api request (working fine) but when I'm adding coupon code to my XML (or JSON) request, the discount is not applying and the amounts are not re-calculated (mean discount_amount, base_discount_amount, etc).

fyi, my XML request:

<magento_api>
    <store_id>7</store_id>
  <email>test@test.com</email>
    <addresses>
        <billing_address>
            <firstname>John</firstname>
            <lastname>Doe</lastname>
            <city>City</city>
            <region>Region</region>
            <postcode>1111</postcode>
            <country_id>FR</country_id>
            <telephone>123456</telephone>
            <street>Street 1</street>
        </billing_address>
        <shipping_address>
            <firstname>John</firstname>
            <lastname>Doe</lastname>
            <city>City</city>
            <region>Region</region>
            <postcode>1111</postcode>
            <country_id>FR</country_id>
            <telephone>123456</telephone>
            <street>Street 1</street>
        </shipping_address>
    </addresses>
    <items>
    <item>
            <sku>55032</sku>
            <qty_ordered>1</qty_ordered>
        </item>
    </items>
  <coupon_code>promotest</coupon_code>
</magento_api>

What is tested and confirmed:

my shopping cart price rule is correctly applied on frontend & when
creating an order from backend.
my coupon code is correctly added to the quote & sales_flat_order when creating order by REST.

It seems this is the collectTotals() method that is not correctly fired or bypassed the promotion stuff application.

Any help/suggestion will be appreciate.
Thx in advance.

EDIT 1:

After some investigations, it seems a potential problem could be the fact that I'm creating a GUEST order.

After some debugs, when creating guest order by rest, the value of $this->getWebsiteId() is 0 at Mage_SalesRule_Model_Validator::process() method.

When I create a guest order by Magento backend, the websiteId is 1.

I guess the problem is here.
I'm still analysing how to fix. I'll keep this post updated as soon as I get the response.

EDIT 2:

At Mage_SalesRule_Model_Quote_Discount::collect(), the weird thing is $quote->getStoreId() returns 0 when creating order by REST but returns the correct store_id when creating order from admin backend.

public function collect(Mage_Sales_Model_Quote_Address $address)
{
    parent::collect($address);
    $quote = $address->getQuote();
    $store = Mage::app()->getStore($quote->getStoreId());
    $this->_calculator->reset($address);

    $items = $this->_getAddressItems($address);
    if (!count($items)) {
        return $this;
    }

    $eventArgs = array(
        'website_id'        => $store->getWebsiteId(),
        'customer_group_id' => $quote->getCustomerGroupId(),
        'coupon_code'       => $quote->getCouponCode(),
    );

    $this->_calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode());
    $this->_calculator->initTotals($items, $address);

    $address->setDiscountDescription(array());

Important: in the db table sales_flat_quote, the store_id is always saved and correct for the related quote (by both REST & admin processes).

Any idea why?


texts: Magento 2 - Product images from custom block

texts:
I have 2 custom blocks, one is loading a product collection from category ID and another one loading a single product from product ID.

My blocks extends the core Magento product list block (\Magento\Catalog\Block\Product\ListProduct).

My template is also a duplicate of the core template.

When calling $block->getImage($_product, $image); It throws an error.

Unable to resolve the source file for 'frontend/_view/en_GB/Magento_Catalog/images/product/placeholder/.jpg'

I've been debugging this for quite a while and can't get to the bottom of it.

When comparing it to the collection on a category list page everything seems identical. The products are the same and have all the same data (including an image).

Any suggestions would be massively helpful.

Code in the template:

$productImage = $block->getImage($_product, $image);

Code in the block:

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Product;

class Category extends \Magento\Catalog\Block\Product\ListProduct
{
 public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        CategoryRepositoryInterface $categoryRepository,
        \Magento\Framework\Url\Helper\Data $urlHelper,
        array $data = []
    ) {
        parent::__construct(
            $context, $postDataHelper, $layerResolver, $categoryRepository, $urlHelper, $data
        );
    }
}

From further digging it seems to be something to do with a resize function that is called from getImage.  Could this be something to do with xml?


texts:
when you create an order for a customer via the adminhtml you can select from a list of addresses. I am trying to find where in the code i can override or use an observer to modify the list of addresses.

Thanks


texts: Magento 2 : issue in database user privileges

texts:
I have moved my Magento 2 site files to another location and everything is working fine, but at the checkout page while doing the payment it is giving me the error

  SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER
  command denied to user 'muellers_m2user'@'localhost' for table
  'cataloginventory_stock_item', query was: UPDATE
  cataloginventory_stock_item SET qty = CASE product_id WHEN 197
  THEN qty-1 ELSE qty END WHERE (product_id IN (197)) AND (website_id =
  0) this has product ID 197

The user "muellers_m2user" is the old username used in previous Magento 2 location as I have set up another user on a new location and defined in on env.php file.

So can anyone can let me know from where can I remove all the instance of old username in Magento 2?


texts: How to disable redirect from mini cart to editing cart page if the minimum order amount is not reached

texts: I want customers to just get an alert without redirecting. Trying to figure out where redirect is happening. Any suggestions? Magento 2.3.4. Thanks a lot.


texts: Connect with login and password magento 2

texts: I added a new attribute "login" to my customers. I want to allow them to login with a Username and Password instead of using the normal way of using Email and Password.


texts: Mismatch of entities in the document during migrate:data

texts:
I can see successfully migrate all the data except this warning is occuring "Mismatch of entities in the document" for some tables like, catalog_category_entity_text, catalog_category_product_index, catalog_product_entity_text, catalog_product_entity_varchar, url_rewrite.

I can see the M1 table has more column than M2 table. I can see in map.xml that those additional collumns are already ignored by tool. Still it is showing this issue.

How can i solve it? Becasue of this i am not able to see product names and descriptions etc.


texts: on Magento2.1 how to import product with multiple category

texts:
Now i try

Default Category/Main/sub ,
Default Category/Main2/sub2

Default Category/Main/sub is working fine
but in Default Category/Main2/sub2 can't import product

  Error Category Default Category/Main2/sub2 has not been created. URL
  key for specified store already exists.


texts: How to add Show / Hide Editor for custom attribute in magento 2

texts:
I am created product custom attribute(specification) and which is showing perfect. Now I am looking for add the Show / Hide Editor for my custom field.

Any help on this.


texts:
This is occurring whenever I press "Save Customer" in the manage customers area in the Admin panel:

Error:

Fatal error: Class 'Mage' not found in /app/code/core/Mage/Core/Model/Resource/Session.php on line 108

This error has come about after upgrading from Magento 1.7.0.2 to 1.9.1.

I realise this question may be a bit vague but all I'm after is some information on why I may be getting this error. I have done an amount of googling in the hope that this might be a common error, however no luck so far.

Any help in relation to how to track where this error is coming from or anyone with any knowledge on common problems with this sort of thing would be greatly appreciated.


texts:
I've created an attribute called hero_text_background in the catalog_category entity. With this i'm looking to update the frontend_model property to render some HTML for the frontend.

To test the frontend model works, i've updated the frontend_model column with the correct class group id in the eav_attribute table for the attribute. And expected to see the return value for the getValue method i've created in the class.

In my themes catalog/category/view.phtml i'm calling the attribute from the category object ($_category->getHeroTextBackground()) this returns the raw attribute value from the database and not through the "frontend model" class.

Do i have to pass my attribute through a method to get the rendered output? Have I configured my attribute wrong?

UPDATE
Original install script, for development i've updated the is_html_allowed_on_front and backend_model

$installer = Mage::getResourceModel('catalog/setup', 'default_setup');

$installer->startSetup();

$installer->addAttribute(
    $installer->getEntityTypeId(Mage_Catalog_Model_Category::ENTITY),
    'hero_text_background',
    array(
        'type' => 'varchar',
        'label' => 'Hero Text Background',
        'input' => 'select',
        'source' => 'bennoislost_heroheaders/catalog_category_attribute_source_hero',
        'default' => Bennoislost_HeroHeaders_Model_Catalog_Category_Attribute_Source_Hero::HB_DEFAULT,
        'required' => false,
        'sort_order' => 0,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        'group' => 'Display Settings',
    )
);

UPDATE 2

The following snippet indeed call's the correct class:

$_heroTextBackground = Mage::getSingleton('eav/config')
    ->getAttribute(Mage_Catalog_Model_Category::ENTITY, 'hero_text_background')
    ->getFrontend()
    ->getValue($_category);

Is there a nicer way to use this in the template file out of the box?


texts: How to use magento rest api for native mobile app's web service

texts:
THIS IS NOT THE DUPLICATED POST OF  What API does the Magento Mobile Store native app use?
Now i want to develop mobile app for this website. So for webservice i have created a custom module. In this module i have a controller called mobileApi. In this mobileApiController i am writing all webservice function. For an example getAllProducts().
Now, on the other hand i want to use magento rest api for access token and
Access token secret. If the access to rest api is valid then only my custom controller i.e. mobileApiController will return data.
I want the system to work like this,
At the time of App launch mobile app will call a webservice to authenticate the rest api access, and the webservice will return valid access token and
Access token secret.
After that on every webservice call it will first validate the rest api access, If access is valid then serve then serve the data otherwise shows authentication error.
I have developed everything and all is working fine, but the problem is at the time of App Launch, when i call the service to get access token and access token secret, magento system takes me to a page where it asks for authentication.
Screenshot (step 1)

After Login it shows me this page.
Screenshot (step 2)

Then if i authenticate the access then rest api get authenticated and returns access token and access token secret then webservice start serving the data.
But how do I manage this authentication from app? I need to skip these two step (step1 and step2).
I want to call the webservice to get the access token and access token secret at the app launch and right away get the access token and access token secret without these step 1 i.e. login and step 2 authorization.
Thanks in advance.
And my question is different than What API does the Magento Mobile Store native app use?.
I have search a lot about this but didn't find any similar.
So, don't give me any stack overflow/stack exchange link. No body asked this question earlier.


texts: Categories are not in order same as in Admin panel Magento 2

texts:
I am listing children categories of specific category using below code:

$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->loadByAttribute('url_key', 'shop');
$childrenCategories = $category->getAllChildren(true);

This method does not return categories in the same order as in the Admin panel.

I have changed the position of categories in Admin panel by drag and drop then I cleared cache and reindexed too.

Any idea what is wrong here?


texts: Shared controller for frontend and backend actions in Magento

texts:
I am using same controller for front-end and back-end action, everything works fine except setting global messages when redirect back to desired admin page.

I have used standard admin session handler to set messages for admin actions:

$notifierObject = Mage::getSingleton('adminhtml/session');

PS:

Controller being called is of front-end type.
Redirected admin page is an order view page.

Thanks in advance.

EDIT

Customer action : my.testdomain.com/modulename/controllerfrontname/action1 is called when form is submitted.

Similar form is there in admin sales order view page.
Admin form submit action : my.testdomain.com/modulename/controllerfrontname/action1 , as you can see the same action is called.

frontName of admin and frontend routers is the same - modulename.(But I guess, this is not causing any problem)

I am successfully getting redirected back to admin sales order view page, but without any global messages that I have set in $notifierObject of admin session. That's the only problem.


texts: Create new table with upgrade scripts in custom module

texts:
I have created a lot of tables using InstallSchema.php and put some data by InstallData.php in my custom module.

Once i want create a new table, Can i do it with upgrade scripts so i'm not create it manually in phpmyadmin? If using install schema i had to remove my module in setup_module table, and it makes data is reinserted while doing setup upgrade.


texts: how to add credit card details input fields in Checkout Page when creating a new payment method gateway

texts:
I'm trying to create a new payment method for our Magento EE 1.12 installation. I followed this tutorial and gotten as far as making the payment method with its options appear in the admin, and also the payment method's name as an option in the Checkout page. Unfortunately, the tutorial stops there.

I was wondering what file I should create (and where to put it), so that when the user clicks on my payment method's radio button in the Checkout page, it will show textboxes for the credit card number, CVV, and dropdowns for expiry date and card type (VISA, etc). Note that this is for the Checkout page. Once I get to add these textboxes and dropdown, how do I get their values so I can process them in during the authorize() method?

Lastly, is there an official documentation from Magento about creating a new payment method module? I find the Magento documentation too overwhelming for a beginner like myself. Could you point me to some useful references, like the tutorial above, but more complete?


texts: How to get Identity id of the last row inserted in table in Magento 2

texts:
I'm trying to insert a row in a table using following code inside controller.

protected $_objectManager;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\ObjectManagerInterface $objectManager
)
{
    $this->_objectManager = $objectManager;
    parent::__construct($context);
}

public function execute()
{
    $post = $this->getRequest()->getParams();
    $model = $this->_objectManager->create('<<Company Name>>\<<Module Name>>\Model\XYZ');
    $model->setData('name', $post["name"]);
    $model->setData('customer_id', $post["customer_id"]);
    $model->setData('customer_is_guest', $post["customer_is_guest"]);
    $model->setData('testCol', $post["test_col"]);

    $model->save();
}

Above code works and row gets inserted into the table, is there a way to get the id (identity id) of the row inserted above?


texts: Extend customer grid using customer_listing.xml issue

texts:
I'm using magento v2.2.5 and i tried to add new column in magento 2 grid by extending customer_listing.xml like this:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
 <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
   <column name="membership" sortOrder="45">
       <settings>
           <filter>text</filter>
           <label translate="true">Membership</label>
       </settings>
   </column>
  </columns>
</listing>

the column shows up perfectly, but the problem is the filter toolbar above the grid is dissapear, but when i scroll down the filter toolbar shows up, when i click the filter toolbar the filter didnt appear at top of customer grid but at the bottom:


texts: I update 2.0.10 to 2.1.2  (On centos 7 LAMP Server at localhost ) it is working too slowly. What sould I do ? make fast


texts: Magento 2 unknown error on exception.log

texts:
Keep getting below error every 5 minutes in exception log:

  [2018-06-20 04:35:05] main.CRITICAL: Item
  (Magento\Catalog\Model\Product\Interceptor) with the same ID "704"
  already exists. {"exception":"[object] (Exception(code: 0): Item
  (Magento\Catalog\Model\Product\Interceptor) with the same ID
  \"704\" already exists. at
  /vendor/magento/framework/Data/Collection.php:404)"} []


texts: Price Display Decimal Formatting Problems

texts:
I have been working on a site and am having some issues with the pricing display. The currency I am working in is Indonesian Rupiah.

The Indonesia currency that we use would need to display like the following options

Rp89,000
Rp100,000
Rp1,200,000
Rp11,500,000

Am not sure what I have done but once I go over 999,999 the currency displays like this Rp1.500.000,000. Under 999,999 it displays correctly. (this is a sample of one that is displaying in correctly http://www.cellar2door.com/index.php/rosemount-estate-diamond-label-shiraz-2010.html)

Could anyone point me in the right direction as to what I can edit to fix this? The site is nearly finished and this is the only problem I currently have.

Many thanks.


texts:
How to add newsletter subscription in customer grid in admin?

If customer is subscribed newsletter then it should show subscribed/unsubscribed status in column.

I rewrite the module in my local folder


texts: Does the updated_at field in Mangento keep a running log of all time stamps? or does it just replace the time stamp with the most current time stamp each update and/or save? I'd like to see how many times each product was updated.


texts: i have a bug when filter a custom field joined with other table in collection grid admin magento 2

texts:
class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider{
function getData(){
/**  @var  \Magento\Customer\Model\ResourceModel\Customer\Collection $collection */
$collection = $this->getCollection();
$collection->addNameToSelect()
->addFieldToFilter('group_id', ['in' => [1,7]])
->addFieldToFilter('player_number', ['nin' => [null, '']])
->addFieldToSelect('name')
->addAttributeToSelect(['player_number', 'player_nickname'], 'left')
->addAttributeToSelect(['team_id'], 'inner')
->getSelect()->joinLeft(
'sales_order_grid',
'sales_order_grid.customer_id=e.entity_id',
'customer_name'
);
}
}

message error : {"error":"The "customer_name" attribute name is invalid. Reset the name and try again.","errorcode":"0"}

'e' is customer_entity.


texts: How to update customer's custom EAV attribute value programmatically in Magento 2?

texts:
I have created a customer eav attribute using a data patch, now I want to update/save a customer's this attribute value programmatically. How to do it? Please help me to do this. I have tried many methods to update it, but no method works to save this attribute value. I am using Magento 2.3.5 -p1 version.
My script to create this attribute given below:-
<?php

namespace Customer\Customattribute\Setup\Patch\Data;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;

class AddDefaultPhoneNumberAttribute implements DataPatchInterface
{
    const ATTRIBUTE_CODE = 'default_phone_number';

    /**
     * @var ModuleDataSetupInterface
     */
    private $moduleDataSetup;

    /**
     * @var CustomerSetupFactory
     */
    private $customerSetupFactory;

    /**
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param CustomerSetupFactory $customerSetupFactory
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        CustomerSetupFactory $customerSetupFactory
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->customerSetupFactory = $customerSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function apply()
    {
        $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
        $customerSetup->addAttribute(Customer::ENTITY, self::ATTRIBUTE_CODE, [
            'group' => 'General',
            'type' => 'varchar',
            'label' => 'Default Phone Number',
            'input' => 'text',
            'required' => false,
            'sort_order' => 50,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'visible' => true,
            'is_html_allowed_on_front' => true,
            'visible_on_front' => true,
            'used_in_forms' => [
                'adminhtml_customer',
                'customer_acccount_create',
                'customer_account_edit',
            ]
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public static function getDependencies()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public function getAliases()
    {
        return [];
    }
}

Thanks in advance.


texts: Infrastructure setup: How to setup Varnish to work with shared cache in AWS Auto Scaling Group

texts:
What is the best infrastructure setup for M2 with varnish on AWS with Auto Scaling Group
We have the following setup now
Cloudflare -> ELB -> AWS Auto scaling group EC2 (+ RDS database + media on EBS volumen )
Right now we have set maximum instances to 1 instance in the Auto scaling group, because when we set maximum instances higher we have issues, when AWS removes EC2 instances from the AWS auto Scaling Group, then some customers get varnish 503 backend fetch failed error.
How can we fix this, what is the proper setup?
Best regards,
Jesper


texts:
Create product tab that displays custom attribute - Ultimo Theme

I have done this and created a Tab.

I want this tab to display a gallery that I have created with an extension.

{{block type="gallery/show" id="front-page-gallery"}}

I am given this display code.

However all that displays is the code, How do I get it to display the gallery. I tried placing it in a block, and that had the same results.


texts: How to run cron file via browser in magento2

texts:
I have created a logic that look seems fine if I run that via controller file. But I am getting an error while running via cron (checked via log file), using magento2 cron process.

ModuleName/Cron/Myfile.php

Is there any way that I can run this file directly via browser to debug the things?

Please reply ASAP!


texts:
I want to add an icon when I will share my website page. May I get some help?
I am using Magento 2.3.0


texts: Magento 2 Product Form Categories Sort Alphabetically From the Backend

texts:
I want to sort Categories alphabetically of the product form, how can I?

For more clarification please look onto the below picture.

As I checked, by default Magento 2 sort according to the category id(ASC order).

I'm not getting the files so that I can check and modify sorting.


texts:
Deprecated: Method ReflectionParameter::getClass() is deprecated in C:\xampp\htdocs\magento\vendor\magento\framework\Code\Reader\ClassReader.php on line 29
Fatal error: Uncaught Error: Call to undefined function each() in C:\xampp\htdocs\magento\vendor\colinmollenhour\cache-backend-file\File.php:81 Stack trace: #0 C:\xampp\htdocs\magento\vendor\magento\zendframework1\library\Zend\Cache.php(153): Cm_Cache_Backend_File->__construct(Array) #1 C:\xampp\htdocs\magento\vendor\magento\zendframework1\library\Zend\Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true) #2 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Frontend\Factory.php(157): Zend_Cache::factory('Magento\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true) #3 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Frontend\Pool.php(67): Magento\Framework\App\Cache\Frontend\Factory->create(Array) #4 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Frontend\Pool.php(146): Magento\Framework\App\Cache\Frontend\Pool->_initialize() #5 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Type\FrontendPool.php(86): Magento\Framework\App\Cache\Frontend\Pool->get('default') #6 C:\xampp\htdocs\magento\vendor\magento\framework\App\Cache\Type\Config.php(49): Magento\Framework\App\Cache\Type\FrontendPool->get('config') #7 C:\xampp\htdocs\magento\vendor\magento\framework\Cache\Frontend\Decorator\Bare.php(65): Magento\Framework\App\Cache\Type\Config->_getFrontend() #8 C:\xampp\htdocs\magento\vendor\magento\framework\App\ObjectManager\ConfigLoader.php(73): Magento\Framework\Cache\Frontend\Decorator\Bare->load('global::DiConfi...') #9 C:\xampp\htdocs\magento\vendor\magento\framework\App\ObjectManager\Environment\Developer.php(79): Magento\Framework\App\ObjectManager\ConfigLoader->load('global') #10 C:\xampp\htdocs\magento\vendor\magento\framework\App\ObjectManagerFactory.php(187): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Array) #11 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(208): Magento\Framework\App\ObjectManagerFactory->create(Array) #12 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(123): Magento\Framework\App\Bootstrap->__construct(Object(Magento\Framework\App\ObjectManagerFactory), 'C:\xampp\htdocs...', Array) #13 C:\xampp\htdocs\magento\index.php(36): Magento\Framework\App\Bootstrap::create('C:\xampp\htdocs...', Array) #14 {main} thrown in C:\xampp\htdocs\magento\vendor\colinmollenhour\cache-backend-file\File.php on line 81


texts: Can I prevent payment from capturing when set to "Authorize & Capture"

texts:
Is it possible to prevent a payment method that is set to "Authorize & Capture" from capturing until I capture it manually at a later date?

I still want to authorize the payment details but not capture them.

Ideally I would like to know if there is a global solution for multiple payment methods (Authorize.net, SagePay, Stripe, etc...)

Otherwise, would it be possible to overwrite the function capture() of each of the payment methods separately and add an extra check before calling parent::capture() ?


texts: How can i get root category id w.r.t store in header.phtml?


texts:
Go to System ->Configuration

On left hand side select General -> Web and under that you will find the Search Engines Optimization tab

Use Web Server Rewrites => No


texts: On place order button this error comes up "address" is required. Enter and try again. "address" is required. Enter and try again."

texts:
"address" is required. Enter and try again. "address" is required. Enter and try again.
On place order button

Any idea ,what m missing ?


texts: Magento 2: get the current currency code

texts:
In Magento 1, you could retrieve the current currency code by doing:

Mage::app()->getStore()->getCurrentCurrencyCode()

I'm wondering what is the recommended way of doing it in Magento 2. In my case in a block.


texts: Magento 2 best way to achieve a load time of less than 2.5 seconds

texts:
Please elaborate the best methodologies and strategies to achieve a lesser load time in both server side and Magneto side. Tried out various strategies but couldn't achieve a load time of less than 4 seconds consistently. In some cases if I achieve 3.2 seconds or more it is not consistent. Please suggest the techniques you have employed to achieve lesser load time.

Has anyone integrated Google Page Speed Module either in Nginx or Apache? Does it improve the page load time?

Thanks.


texts: dot change automatically for comma into item description

texts:
Help to solve this bug or problem, into description item, the price change automatically

Ex: my price is: $1,999.99

But after few seconds, the price convert comma for dot and dot for a comma:

Ex: my price change for $1.999,99

I don't know where is the problem, I tried to find an answer but i can't find it.

Helpme.


texts: Synchronize magento customer table with another mysql table

texts:
How can I synchronize users between two mysql tables using cron job or any other method
example:
Let's say I have database1.users and magento.customers tables
I need if any user added or updated from database1.users auto added or updated to magento.customers
How can I do that ?


texts:
Duplicate order on Magento v 1.9.2.0., triggered by

When we click checkout button than order repeated 3 times.

how to fix this problem?


texts:
Is there a way to run my existing magento 2 project inside a docker container? I have an existing project that is run inside a vagrant but I'm encountering a lot of issue in the vagrant and we decided to use docker for this. But I don't know how to migrate my existing magento project from vagrant to docker. I have search for various tutorial but all of them teach how to install magento inside a docker so all DB contents and setup are made during this process. But what if I already have my DB and my projects setup. I just want to like COPY Paste my codes inside a docker container.

If anyone of you can show me step by step on what I should consider or do when I want to migrate my magento project to docker. So I was thinking like I need to migrate my DB first to my MYSQL/DB container then copy paste my code to somewhere and modify docker-compose.yml to somewhere... But I don't know how and what. Would appreciate any help please.

Also I would like to use docker-compose.yml here and I'm ok if a Dockerfile will be used together with the docker-compose.yml file


texts:
I'm new to magento 2 and i have a question, how can i override the module module-customer with my own .phtml files?
I tried several searches but i cant find anything, i have tried the following but they didnt work even after i flushed the cached en upgrade from the console.

Magento_Customer\templates
Magento_Customer\view\frontend\templates

I did forgot the capitals.


texts: Dynamic and Distributed Backend and FPC Cache in Magento 2

texts:
I have Magento 2.2 running on a GCE Managed Instance Group. Its not a big site, but I run it on a minimum of 2 instances which gives me some resilliancy, allows me to do zero downtime upgrades, and scales when/if it needs to.

I use Cloud SQL for my backend SQL database and also currently store sessions in the database.

I have a single redis node deployed to provide backend and FPC cache's to all frontends.

Having a single redis node just to provide caching functions across the cluster seems overkill for what I need, and I'm looking to get rid of it.

Am I right in thinking that I must have a "distributed" FPC and Backend cache if I have multiple frontends behind a load balancer. Could I not just run an independant local redis on every frontend server. Each server configured to access their local redis. If a new frontend is launched, it will start of with no cache, but will soon build up a cache of its own. Is this an acceptable approach. I suspect that clearing cache commands would no longer work as it would only clear the cache on the node that is serving the adminhtml pages that triggered the cache clear.

Other option maybe? I see memcached can operate distributed. Will it work dynamically, so if I run a memcached server on each frontend, can they pool dynamically, as the instance group grows and shrinks, and memcached instances are created/destroyed. Thus providing the single memcache "domain" for the frontend cluster, but with no single memcache installation?

Thanks in advance.

Graham


texts: Custom module, overriding functionality in community extension

texts:
So, I am trying to override a Gallery module I've downloaded and add some fields to the admin form, which would help me to include more options to the frontend.

The module I've downloaded is Image Gallery with categories or SAG_Gallery to be precise.

One of the files I am currently interested with is located in /app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php.

So I created a sample module and added it to /etc/modules named AcmeDemo, so now I have /etc/modules/AcmeDemo.xml.

In there I've added the following code:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Acme_Demo>
            <active>true</active>
            <codePool>local</codePool>
            <depend>
                <Sag_Gallery />
            </depend>
        </Acme_Demo>
    </modules>
</config>

I've also created the path, as follows: /app/code/local/Acme/Demo. The module is loaded succesfully as I was able to confirm it by looking at my admin panel in "Advanced" options, it's there.

Then I created few directories to mimic the original path, as follows:

/app/code/local/Acme/Demo/Block/Adminhtml/Category/Edit/Tab

and in there I've created the file Form.php with the following code (it's an example, I'm trying to "kill" the form, to ensure my code works)

class Bogara_Gallery_Block_Adminhtml_Category_Edit_Tab_Form extends Sag_Gallery_Block_Adminhtml_Category_Edit_Tab_Form {

    protected function _prepareForm() {
        exit;
    }

}

I've added the following configuration in /app/code/local/Acme/Demo/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Acme_Demo>
            <version>0.0.1</version>
        </Acme_Demo>
    </modules>
    <global>
        <blocks>
            <acme_demo>
                <class>Acme_Demo_Block</class>
            </acme_demo>
            <adminhtml>
                <rewrite>
                    <category_edit_tab_form>Acme_Demo_Block_Adminhtml_Category_Edit_Tab_Form</category_edit_tab_form>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

which appears to be wrong, since the original Form.php is still being executed. Probably is some silly mistake, or something that I've missed.

Any kind of advice/help will be really appreciated. Thanks.


texts: Success/error Messages not closing after 2.3.5 update

texts:
Thanks for reading.
I've been working on a Magento2 project for the past couple months. Recently we updated from 2.3.0(or 2.3.1, I can't remember) to 2.3.5. Sadly, this caused more bad than good. Custom modules stopped working but after debugging I was able to get most of them working again. One example is the templatevars when creating an email with transportbuilder in a controller, appearently somewhere in the last few updates the 'store' variable in templatevars was deprecated since its already in templateoptions, but this issue was nowhere to be found on the internet which let to extreme frustration. It kept giving me a 'cannot use a scalar value as an array' error in abstracttemplate.php. From now on I will not update Magento again until its really necessary..
However, there is one problem that I haven't been able to fix. Its not about a custom module but rather a part of the Magento Core itself. I'm talking about the success/error messageboxes when, for example, you add an item to the cart. They popup fine, but I can't close them. Both the cross button and the 5 second timer are not working. Lets make one thing clear though; I've been reading other threads with people having the same problem saying that the messagebox stays when going to another page, but this is not the case for me. After I leave the page or refresh, they do disappear.
So I've tried the following things:

Disabling full page cache
Tried the messageboxes on every page, yet I get the same results no matter where I use them, So its not page-related.
Debugging in message.js

So, I've been logging to the console in every function in the message.js file. The function where the 5 sec timer gets activated does not even trigger at all unless I call it in the 'initialize' function myself. Lets look at the function that I'm talking about:
        onHiddenChange: function (isHidden) {
            var self = this;

            // Hide message block if needed
            if (isHidden) {
                setTimeout(function () {
                    $(self.selector).hide('blind', {}, 500);
                }, 5000);
            }
        }

So, just like I said, I called it myself and it does run. However, the boolean 'isHidden' never turns to true, so the timeout never gets activated. So I commented that out aswell, but then my logs do get called, but still, the message never disappears. The timeout works fine but the $(self.selector).hide('blind', {}, 500); doesn't.
I have no clue at this moment.. Hopefully anyone can help me out or atleast push me in the right direction.
Thanks in advance!


texts: I created a module to custom export certain data from my site. The CSV is created in var/export. but when I try to give a link to download this file from server the link gives me 403 forbidden error. I see that the file has 777 permission. What can be the issue?


texts: it's necessary to learn Magento 1 for starting with Magento 2?

texts: Is it necessary to learn Magento 1 for starting with Magento 2? and what are resources can i learn magento from it?


texts: There has been an error processing your request magento 1.9.0.1

texts:
It seems that my website is not working and it showing errors.

Exception printing is disabled by default for security reasons.

Error log record number: 272747104501

Please help me to find the solution

  a:5:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:1654:"#0 /home/lalcointeriors/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
      #1 /home/lalcointeriors/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
      #2 /home/lalcointeriors/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
      #3 /home/lalcointeriors/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
      #4 /home/lalcointeriors/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
      #5 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
      #6 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
      #7 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(141): Mage_Core_Model_Resource->getConnection('core_setup')
      #8 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(234): Mage_Core_Model_Resource_Setup->__construct('core_setup')
      #9 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
      #10 /home/lalcointeriors/public_html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
      #11 /home/lalcointeriors/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
      #12 /home/lalcointeriors/public_html/index.php(92): Mage::run('', 'store')
      #13 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}


texts: Can I enable backorder for b2b cusotmer only in magento 2?

texts:
I have a store with a shared catalog. In which, B2b features are enabled. I want to enable the back-order feature only for the b2b customer. How can I do that?

Any help would be appreciated.


texts: Magento PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

texts:
I'm in the process of updating a Magento site and ran into a error that is causing me to delay pushing this to live.

PHP error:

PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /skin/frontend/default/galadrugstore/css/style.php on line 62

Style.php line 62:

$content = preg_replace('/\$([\w]+)/e','$0',@file_get_contents($stylesheet));

I have tried the following with out any traction, as a last resort I wanted to see if someone could assist before I lose my mine.. lol

$content = preg_replace_callback('/\$([\w]+)', function($match) { return CallFunction($match[0]); }, @file_get_contents($stylesheet));
$content = preg_replace_callback('/\$([\w]+)/', function($match) { return CallFunction($match[0]); }, @file_get_contents($stylesheet));
$content = preg_replace_callback('/\$([\w]+)/', function($match) { return $match[0]; }, @file_get_contents($stylesheet));

I feel I'm really close but something is just not right, any assistance with this issue would be awesome.

Big Thanks in Advance!


texts: Magento 2 - Steps to convert Google Business Client API to custom module

texts: I am getting customer reviews from respective stores using https://github.com/google/google-api-php-client.git and, how to convert into Magento custom module. I want to display this review in my various phtml file. How to covert as a module.


texts: Difference admin save and cli script save?

texts:
Background: Some products option detail (e.g. text field data) is not correctly held through the process... User enters data on the product page and it is missing in the basket page.  A simple fix is to save the product in the admin (no changes)... so am building a script to save all products with product options.

Problem: The script isn't fixing the problem, so it is not performing the same actions as the admin save with the GUI.  Why?

Here is my script:

require __DIR__ . '/app/bootstrap.php';

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$instance = \Magento\Framework\App\ObjectManager::getInstance();

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

$arrProductIDs = [...];

foreach ($arrProductIDs as $iProductID) {
    $product = $objectManager->create('Magento\Catalog\Model\Product')->load($iProductID);
    $product->save();
    echo $iProductID.' saved - ';
}

I have also tried changing some data a little, but no better:

$desc_orig = $product->getDescription();
$product->setDescription($desc_orig.' ');

Can anyone please help me understand fix this so that I can replicate going into the admin and saving all of these products?


texts: How to exclude a field (attribute) to filter on admin catalog search

texts:
We're setting up a M2 and we have about 60K simple products in the catalog. There are plans to include 3 times more products in the catalog but we're struggling with performance issues.
The products have a large description that contains a list of other SKUs and some metadata. When performing a search on the backend using the "Search by keyword" field the performance is really poor and a single search can take up to 5 minutes and not provide relevant results. We're mostly searching by SKU but we'd like to exclude the description field as the results that this field provides are not relevant for our use case.
Looking at the DB queries all items are retrieved and the descriptions appear to be fetched creating a huge overhead.
Thanks for your help.


texts: How to get child products, sorted by configurable attribute value position? (1.9.0.1)

texts:
At the moment I have this:

$allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);

which seems to be pulling the Simple Products in order of Product ID. I initially tried swapping this code out for:

$conf=Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$allProducts =  $conf->getUsedProductCollection()
                                 ->addAttributeToSelect('*')
                                 ->addFilterByRequiredOptions()
                                 ->setOrder('size', 'ASC');

(Size being the only configurable attribute relevant.) But I quickly realised that because this was actually sorting the string value (so numbers came up in the order 120,160,1080,20 which is no good). What I'd like to do is get this ordered by the attribute label's 'position' within that attribute. I've tried changing the 'setOrder' parameter to "position" and "order" without any joy.

Any help would be appreciated :)


texts:
I try to optimize the bundles of magento with the information from devdocs . I try to do it on Magento 2.2.6 but the main issue is that after generating the bundles I get an error from the customer-data regarding

  TypeError: $.cookieStorage is undefined; can't access its "setConf"
  property

Did anyone had this error?

EDIT:
After some more investigation looks like this error comes from jquery/jquery.storageapi.min strange think is that only when trying to do it as suggested on Magento Devdocs https://devdocs.magento.com/guides/v2.3/performance-best-practices/advanced-js-bundling.html


texts:
I had the site configured for shipping with Fedex just fine . . . then we tried implementing a "One Page Checkout" extension, and Fedex stopped working.

I have since turned off the extension, but no luck!   I'm attaching a sample shipping log.  I can see there is an error regarding "stdClass Object", but I have no idea where that would come from.
Please Help!
Title: Fedex Soap Request/Response

Message:

Array
(
    [request] => Array
        (
            [Version] => Array
                (
                    [ServiceId] => crs
                    [Major] => 10
                    [Intermediate] => 0
                    [Minor] => 0
                )

        [ReturnTransitAndCommit] =>
        [RequestedShipment] => Array
            (
                [DropoffType] => REGULAR_PICKUP
                [ShipTimestamp] => 2014-07-11T20:11:26+00:00
                [ServiceType] =>
                [PackagingType] => YOUR_PACKAGING
                [Shipper] => Array
                    (
                        [Address] => Array
                            (
                                [PostalCode] => 77303
                                [CountryCode] => US
                                [Residential] => 1
                            )

                    )

                [Recipient] => Array
                    (
                        [Address] => Array
                            (
                                [PostalCode] => 60044
                                [CountryCode] => US
                                [Residential] => 1
                            )

                    )

                [RateRequestTypes] => LIST
                [PackageDetail] => INDIVIDUAL_PACKAGES
                [RequestedPackageLineItems] => Array
                    (
                        [0] => Array
                            (
                                [GroupPackageCount] => 1
                                [Weight] => Array
                                    (
                                        [Value] => 5
                                        [Units] => LB
                                    )

                                [Dimensions] => Array
                                    (
                                        [Length] => 25
                                        [Width] => 36
                                        [Height] => 5
                                        [Units] => IN
                                    )

                            )

                    )

                [PackageCount] => 1
            )

        [WebAuthenticationDetail] => Array
            (
                [UserCredential] => Array
                    (
                        [Key] => jXXXXXXXXXXXXXXL
                        [Password] => XXXXXXXXX
                    )

            )

        [ClientDetail] => Array
            (
                [AccountNumber] => XXXXXXXXX
                [MeterNumber] => XXXXXXXXX
            )

    )

[result] => stdClass Object
    (
        [HighestSeverity] => ERROR
        [Notifications] => stdClass Object
            (
                [Severity] => ERROR
                [Source] => prof
                [Code] => 1000
                [Message] => Authentication Failed
            )

        [Version] => stdClass Object
            (
                [ServiceId] => crs
                [Major] => 10
                [Intermediate] => 0
                [Minor] => 0
            )s


texts: How to make grid row Ready Only in magento 2 using UI component?

texts: In magento 1 we were using getRowurl() method to make row read only(non-editable) but how we make grid row non-editable in magento 2?


texts: Magento. Different addtocart button functionality based on different product types

texts:
I want to assign certain "addtocart" to certain product type, and this what i have so far, any help will be appreciated.

This is my code so far.

        <?php if (!$this->hasOptions()): //add to cart when no options ?>
            <?php if($_product->isSaleable()): ?>
                    <?php if($_product->getTypeId() == 'simple'): ?>

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

            <?php elseif($_product->getTypeId() == 'bundle'): ?>

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

                <?php endif; ?>
                <?php endif; ?>
            <?php echo $this->getChildHtml('extra_buttons') ?>
        <?php endif; ?>


texts: Magento 2 Optimization Eliminate render-blocking resources on a Merged css and js files

texts:
I am optimizing the Magento 2.2.6 Website.In Google Page Speed test suggestion Eliminate render-blocking resources.

There are following files

  /pub/static/version1555309524/_cache/merged/be8f15a428b74dc06417a25ea03882ab.min.css

  /pub/static/version1555309524/frontend/namespace/theme/en_US/css/styles-l.min.css

  /pub/static/version1555309524/_cache/merged/70a3e0be566bb1f71f67c46f51c014fe.min.js

  /pub/media/styles.css

  https://cdnjs.cloudflare.com/ajax/libs/jquery.perfect-scrollbar/1.4.0/css/perfect-scrollbar.css

How to do that ?

Thanks is Advanced


texts:
I would like to change a Magento website, but before I do that I would like to create a local copy (not online) to make some changes without doing any mistakes, see the results (as a perfect copy of the real website). If in case, I would be satisfied with these changes, I would like to add them to the website in real-time. The company who developed it is no longer in contact with me. Is it possible to create a test version of the website? Someone did it before in an easy way?

I tried to transfer my website from remote to my local server but I found a lot of problems and errors on importing a sql 100MB db on phpmyadmin using the comand line 'mysql -u root -p test < mysqldatabase.sql' on command prompt. There is an easier solution instead to move the Magento website on the local server?


texts: How to add allowed methods list in magento2 shipping using custom extension?

texts:
<each if="!quoteIsVirtual" args="getRegion('customer-email')" render="" />
    <each args="getRegion('address-list')" render="" />
    <each args="getRegion('address-list-additional-addresses')" render="" />

    <if args="!isFormInline">

            <button type="button"
                    class="action action-show-popup"
                    click="showFormPopUp"
                    visible="!isNewAddressAdded()">

            </button>

    </if>

    <each args="getRegion('before-form')" render="" />

    <render if="isFormInline" args="shippingFormTemplate" />

    <each args="getRegion('before-shipping-method-form')" render="" />

        <form id="co-shipping-method-form"
              class="form methods-shipping"
              if="rates().length"
              submit="setShippingInformation"
              novalidate="novalidate">

            <render args="shippingMethodListTemplate"/>

                <each args="getRegion('shippingAdditional')" render="" />

                    <button data-role="opc-continue" type="submit" class="button action continue primary">

                    </button>

        </form>

 0"
             translate="'Sorry, no quotes are available for this order at this time'" />


texts: Magento2: Intercept category moved inside tree

texts:
I am trying to intercept when a category is moved inside the category tree. At the beginning I thought to observe the event catalog_category_tree_move_after with an Observer class but I found that this event has been removed from Magento 2. In the CHANGELOG file it is said to use plugins instead of observers.

I tried to do with plugin with no success:
this is the di.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Category">
        <plugin name="MoveCategoryTree" type="Vendor\Module\Model\Plugin\Category" sortOrder="1" />
    </type>
</config>

this is the Vendor/Module/Model/plugin/Category.php class

namespace Vendor\Module\Model\Plugin;

class Category
{
    public function afterCatalogCategoryTreeMove(\Magento\Catalog\Model\Category $category, $result) {
        echo 'Testing...';
        exit();
    }
}

I tried also to rename the function afterCatalogCategoryTreeMove in afterTreeMove but nothing works also in this way.

is this the correct way to intercept this event?


texts: Override Customer Account Edit on Frontend

texts:
Magento 2 newbie.  I am trying to override the default 'Customer Account Edit' form on the Frontend. I'm not able to get my template to "override", its always loading the default template [/html/public/vendor/magento/module-customer-custom-attributes/view/frontend/templates/customer/form/edit.phtml].  The issue may be with my layout but I'm not certain of the syntax. Using 'Vendor/Module' as an example.

My Layout File:

  /html/public/app/code/Vendor/Module/view/frontend/layout/customer_account_edit.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceContainer name="customer_account">
            <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="Vendor_Module::customer/form/edit.phtml" cacheable="false"></block>
        </referenceContainer>
    </body>
</page>

Does anyone know if I'm using the correct reference container or if that's even the issue I'm facing?


texts:
Is it possible to keep different translate files for different modules?

I have a large file with all translation in:

app/i18n/magento/sv_se/sv_SE.csv

This doesn't work: app/i18n/"vendor_module"/sv_se/sv_SE.csv

Or could I put all files inside my theme directory?


texts:
I can get Shipping Cost from the order, but when I look at the invoices for the order only the first invoice gets the shipping cost.

How do I know if a invoice has a/the shipping cost attached?


texts:
Whenever I want to change the layout of a CMS page with a specific layout (here: new-layout), it changes on all CMS pages.

Vendor/My/Module/view/frontend/layout/default.xml

<?xml version="1.0"?>
    <page layout="new-layout" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceContainer name="page.top">
                <block class="xx\xx\xx" name="test" template="Xx_Xx::test.phtml"/>
            </referenceContainer>
        </body>
    </page>

I've only added one page with 'new-layout', but this block gets added on all CMS pages.


texts: A change made locally to observer in development mode not happening when deployed to production?

texts:
After updating the code I ran the following:

bin/magento setup:static-content:deploy
bin/magento setup:di:compile
bin/magento deploy:mode:set -s production
bin/magento index:reindex
bin/magento cache:flush

The change was made in an Observer

The problem is that no matter what I do, even disabling the module entirely the change does not happen on a dropdown.

Is there more I should be doing for a complete deploy? Maybe Opcache is keeping it?


texts: Tracking error Mage_Freight_Helper_Data on Editing permission roles

texts:
The magento is giving this error when i access index.php/admin/permissions_role/editrole/rid/1/:

Fatal error: Uncaught Error: Class 'Mage_Freight_Helper_Data' not found in ../app/Mage.php:547 Stack trace: #0 ../app/code/core/Mage/Admin/Model/Roles.php(160): Mage::helper('freight') #1 ..app/code/core/Mage/Admin/Model/Roles.php(175): Mage_Admin_Model_Roles->_buildResourcesArray(Object(Varien_Simplexml_Element), 'admin/system/co...', 6, NULL, false, 'freight') #2 app/code/core/Mage/Admin/Model/Roles.php(175): Mage_Admin_Model_Roles->_buildResourcesArray(Object(Varien_Simplexml_Element), 'admin/system/co...', 5, NULL, false, 'adminhtml') #3 /usr/share/nginx/sites/brascool/app/code/core/Mage/Admin/Model/Roles.php(175): Mage_Admin_Model_Roles->_buildResourcesArray(Object(Varien_Simplexml_Element), 'admin/system', 4, NULL, false, 'adminhtml') #4 /usr/share/nginx/sites/brascool/app/code/core/Mage/Admin/Model/Roles.php(175): Mage_Admin_Model_Roles->_buildResourcesArray(Object(Varien_Simplexml_Element), 'admi in app/Mage.php on line 547

I dont remember change anything recently.

How can i track where this Class Mage_Freight_Helper_Data is called to remove?
I tried check in database some rewrite but i cannot found anything.

Configuração errada de tabulação.

#0 app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php(42): Mage_Adminhtml_Block_Widget_Tabs->addTab('account', false)
#1 app/code/core/Mage/Core/Block/Abstract.php(297): Mage_Adminhtml_Block_Permissions_Editroles->_prepareLayout()
#2 app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#3 app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/permi...', 'adminhtml.permi...')
#4 app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/permi...', 'adminhtml.permi...')
#5 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))
#6 app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#7 app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#8 app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#9 app/code/core/Mage/Adminhtml/Controller/Action.php(285): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#10 app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php(44): Mage_Adminhtml_Controller_Action->loadLayout()
#11 app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php(105): Mage_Adminhtml_Permissions_RoleController->_initAction()
#12 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Permissions_RoleController->editRoleAction()
#13 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('editrole')
#14 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#16 app/Mage.php(683): Mage_Core_Model_App->run(Array)
#17 index.php(87): Mage::run('', 'store')
#18 {main}

PS: I tried clear cache and reindex, but without success.


texts:
I'm adding a feature in a custom module that should manage Offer incompatibilities: for a given offer ID, there could be N "incompatibility" rules.

Basically, the model is:

OfferID    IncompatibleOfferID    Active(Y/N)
----------------------------------------------
1          13                     Y
1          22                     Y
2          21                     N

So, for a given rule you can have multiple association between offers.

In the Edit form I would like to have a grid (Widget) to select multiple "child" offers to bind with the "father" offer.

To achieve that, I created:

[Module]/Block/Adminhtml/[MyModule]/Edit/Offer/Grid.php

that is basically a Grid Widget, in fact it has all the grid methods like

public function _prepareCollection()
{
    $items = Mage::getModel('offer/offer')->getCollection();

    $this->setCollection($items);
}

Now I would like to add this grid to the Edit form to select multiple "child" offer at the time.

So, here is my [Module]/Block/Adminhtml/[MyModule]/Edit/Form.php :

    /** @var Varien_Data_Form $form */
    $form = new Varien_Data_Form(array(
        'id' => 'edit_form',
        'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
        'method' => 'post',
        'enctype' => 'multipart/form-data',
    ));

/** ETC ETC **/

$promoFieldset = $form->addFieldset('related_promo', array(
            'legend' => Mage::helper('offer')->__('Promozioni'))
        );

$relatedProdsGrid = $this
    ->getLayout()
     ->createBlock('offer/adminhtml_compatibleoffer_edit_offer_grid')
     ;

   $promoFieldset->addElement($relatedProdsGrid);

The last line is giving me the error, because "addElement" method accept only Varien_Form_Data_Abstract as input. Plus, the grid is not working as it should, (no filter, no pagination, no limit)

Any ideas? Should I choose a different approach?
Thanks


texts:
How can I customize the orders report?
want to add few more columns and want remove few ones? for example something like following?


texts: create coupon code for simple products with custom options

texts: I need to apply coupon code for products with custom options. i tried as below and its not working.....  i checked this , its 2013 post, still default magento dont support this ?  is there any way we can apply coupon code for custom option products ?


texts: When I remove item from checkout page in Magento 1.9, its showing error of form key

texts:
strong text
when I delete one item its working fine but when I remove the second item then its showing error I didn't know why this is happening please anyone help me?

https://madoverprint.com/madover/index.php

Thanks


texts:
I want to resize image without loss quality in magento 2
i used code

 $imageResize = $this->_imageFactory->create();
 $imageResize->open($absolutePath);
 $imageResize->constrainOnly(TRUE);
 $imageResize->keepTransparency(TRUE);
 $imageResize->keepFrame(FALSE);
 $imageResize->keepAspectRatio(TRUE);
 $imageResize->resize($width, $height);
    //destination folder
 $destination = $imageResized;
    //save image
 $imageResize->save($destination);

when i resize it reduce the quality of image as compare to original image.
How can i resize without losing quality?


texts: Updating product price from code not reflect in frontend category page until I save from admin

texts:
We are updating the product prices every 10min using cron. The prices are pulled from a external API.

We are using the following way to update the price,

$this->updateProductAttribute('price', $productId, $price);

Then we are doing reindex for the updated items,

$categoryIndexer->reindexList(array_unique(array_keys($products)));

After the price update, Product detail page showing correct updated price. But the Category page still showing the old price. If I refresh the cache or save the product from admin then category page showing updated price.

Instead of using updateProductAttribute if I save the product from code then category page works.

Whether it advisable to save 100 of products every 10min programmatically?

Or, Do we have any other way to handle the category page cache issue?


texts:
I have installed Magento 2.1 with PHP 7.0.11 on a nginx/PHP-FPM web server. When I go to my Magento Admin URL and login with my credentials, I receive an error -

"
Warning: is_dir(): open_basedir restriction in effect. File(/etc/pki/tls/certs) is not within the allowed path"

This appears to be an issue with Magento 2.1, as I have not come across this on my Magento 2.0 installations with the same server setup.

In order to fix the issue, I added "/etc/pki/tls/certs" to my open_basedir settings.

My questions are:

Is this open_basedir error truly the problem, or is it being caused by
something else?
Is adding "/etc/pki/tls/certs" to my open_basedir    settings a
security risk? It seems like an odd thing to add to    open_basedir.


texts: How to apply shipping charge for guest user in magento 2?

texts: In Magento 2 I have configured shipping charge of 50 INR for below 500 INR purchase and for above 500 INR purchase shipping is free. But I need to customize there is no free shipping for guest user. How can I achieve this?


texts: Apply a discount code that has no value attached

texts:
I would like to set a coupon code whereby when entered, customer will be receiving a free gift (instead of a monetary discount). I can create a discount code with 0 discount value but when applied, the discount code does not appear at checkout. IS there a way around this?
Appreciate your help. Urgent. Thanks!


texts: The purpose of the table cataloginventory_stock

texts:
I see that in the default Magento versions 1.0 to 1.8 (ce) There is a table called cataloginventory_stock that contains only one record.

stock_id    stock_name
1           Default

Related to this, in the Mage_CatalogInventory_Model_Stock_Item model there is this method

public function getStockId()
{
    return 1;
}

with a comment above it @todo multi stock.

I guess someone wanted to implement multi stock functionality and decided not to (like many other "features") but I'm not sure.

So my question is... Is there any other purpose to this table, does it affect other sections of the code or is just there as a starting point for a new feature?


texts:
I have created a custom module for order tracking.

Now when the order is completed the shipment id is generated.

So, How to get the shipment id?

I have my block like this :

<?php
/**
 * Copyright © 2016 Codazon. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Codazon\AjaxCartPro\Block;
class Trackorder extends \Magento\Framework\View\Element\Template
{

    protected $orderRepository;
    protected $_coreRegistry;

    public function __construct(
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
    \Magento\Framework\Registry $coreRegistry,
    \Magento\Framework\View\Element\Template\Context $context,
        array $data = []
    )
    {

         $this->_coreRegistry = $coreRegistry;
         $this->orderRepository = $orderRepository;
         parent::__construct($context, $data);
    }

    public function getOrderStatus()
    {

        $orderId = $this->_coreRegistry->registry('order_id');
        $order = $this->orderRepository->get($orderId);
        $state = $order->getState(); // Print Order State(Complete, Processing, ....)
        return $state;
    }

    public function getShipmentID()
    {
        $orderId = $this->_coreRegistry->registry('order_id');
        $order = $this->orderRepository->get($orderId);
        $shipment = $order->getShipmentsCollection();
        return $shipment;
    }
}

But getShipmentID() this function does not work for me.
How to resolve this problem?

How to get shipment id If order is completed.


texts: Remove Required field on Customer Create Account

texts:
We have a problem with our create a account page. Even when all field are filled in we still get a message: "****" is a required field. The page where we get this error is:

http://oolabooshop.com/customer/account/create/

Does anyone know a solution or a way to remove this requirement.


texts: How to export multistore product data from DB?

texts:
My client wants to have a CSV file containing three columns, the product SKU, website ID (1 = CA, 2 = US) and the final price.

How could I do it?


texts:
I have a MySQL-based queue that has been added by a custom extension and I'd like to know how to configure the CRON to run that queue process.

The Magento documentation has this to say about how to run a Magento 2 Queue using a CRON job:

  After consuming all available messages, the command terminates. You can run the command again manually or with a cron job. … For example, you can append & to the command to run it in the background, return to a prompt, and continue running commands (e.g., bin/magento queue:consumers:start <consumer_name> &).

Based on the documentation, I would think you'd configure a CRON job like this:

* * * * * /var/www/stage/current/bin/magento queue:consumers:start <NAME OF QUEUE> &

However if I run just /var/www/stage/current/bin/magento queue:consumers:start <NAME OF QUEUE> & on the command line, the process runs for a long time (potentially indefinitely?), so I can't see how running that command every minute from the CRON job would work, as you'd have an ever-increasing number of processes running.

What is the recommended way to run a MySQL queue from the command line?


texts: How to make custom customer attribute read only

texts:
I have created a custom customer attribute that shows up on the checkout page. I am trying to make this read only. That is show a value in the text field but not have it be editable. I tried adding the following parameter

 'readonly' => true,
  'value' => 'xxxx'

to my addattribute script. I did not get an error when i ran the script and the attribute was added. I see the field in my checkout form and xxxx shows up correctly but it is not read only, I can still edit the field. Does anyone know how to make the text field not editable?


texts: What is the difference if an url ends with .html

texts:
I wonder why some of my Magento urls end with .html and others do not.

Why should I end my url with .html and how to remove it if I would like to have a simple/clear url for my customers?


texts: Discount to cart if specific product is in cart

texts:
I'm searching about three days for solution now, and i just can't find a way to solve this.

My Scenario:

At 299$ Subtotal I want to give the customer the option to choose from:
1. a free product or
2. a cart discount

The first part of this could be done easily with a plugin -> choose a free product when subtotal is 299$. So i have planed to do the discount as a product, that you can add to cart.

So you have a product called "5% off" and if you add this to cart, you will get 5% off from the whole cart.

Is there any way to solve this?


texts:
I have an Edit.php for backend, at first it was running fine and then after i run upgrade, i got this following error:

  1 exception(s):
      Exception #0 (InvalidArgumentException): Boolean value is expected, supported values: array (
        0 => true,
        1 => 1,
        2 => 'true',
        3 => '1',
        4 => false,
        5 => 0,
        6 => 'false',
        7 => '0',
      )

  Exception #0 (InvalidArgumentException): Boolean value is expected,
  supported values: array (
        0 => true,
        1 => 1,
        2 => 'true',
        3 => '1',
        4 => false,
        5 => 0,
        6 => 'false',
        7 => '0',
      )

  #0
  C:\xampp7\htdocs\magento2\vendor\magento\framework\Data\Argument\Interpreter\Boolean.php(40):
  Magento\Framework\Stdlib\BooleanUtils->toBoolean('required')

  #1 C:\xampp7\htdocs\magento2\vendor\magento\framework\Data\Argument\Interpreter\Composite.php(61):
  Magento\Framework\Data\Argument\Interpreter\Boolean->evaluate(Array)

  #2 C:\xampp7\htdocs\magento2\vendor\magento\framework\Data\Argument\Interpreter\ArrayType.php(43):
  Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(Array)

  #31 C:\xampp7\htdocs\magento2\app\code\Lime\Confirmation\Controller\Adminhtml\Bankdestination\Edit.php(53):
  Lime\Confirmation\Controller\Adminhtml\Bankdestination\Edit\Interceptor->initPage(Object(Magento\Backend\Model\View\Result\Page\Interceptor))

here's my code:

<?php

namespace Lime\Confirmation\Controller\Adminhtml\Bankdestination;

class Edit extends \Lime\Confirmation\Controller\Adminhtml\Bankdestination
{

    protected $resultPageFactory;

    /**
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\Registry $coreRegistry
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\Registry $coreRegistry,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context, $coreRegistry);
    }

    /**
     * Edit action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {

        // 1. Get ID and create model
        $id = $this->getRequest()->getParam('bank_destination_id');
        $model = $this->_objectManager->create('Lime\Confirmation\Model\BankDestination');

        // 2. Initial checking
        if ($id) {
            $model->load($id);
            if (!$model->getId()) {
                $this->messageManager->addError(__('This Bank Destination no longer exists.'));
                /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
                $resultRedirect = $this->resultRedirectFactory->create();
                return $resultRedirect->setPath('*/*/');
            }
        }
        $this->_coreRegistry->register('lime_confirmation_bank_destination', $model);

        // 5. Build edit form
        /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
        $resultPage = $this->resultPageFactory->create();
        //the start of error
        $this->initPage($resultPage)->addBreadcrumb(
            $id ? __('Edit Bank Destination') : __('New Bank Destination'),
            $id ? __('Edit Bank Destination') : __('New Bank Destination')
        );

        $resultPage->getConfig()->getTitle()->prepend(__('Bank Destinations'));
        $resultPage->getConfig()->getTitle()->prepend($model->getId() ? $model->getTitle() : __('New Bank Destination'));
        return $resultPage;
    }
}


texts: Does composer dump-autoload -o need to be run after setup:di:compile if composer install --optiomize-autoloader hase been run before

texts:
Every thing is in the title : Does composer dump-autoload -o really need to be run after setup:di:compile as the official document seem to pretend : http://devdocs.magento.com/guides/v2.2/config-guide/prod/prod_perf-optimize.html

But if composer install --optimize-autoloader has been run before, the autoload dump is already done, i don't see relationship with setup:di:compile ?


texts:
Let's say I have products

abc_123_big
abc_123_medium
abc_123_small
cba-321-small
cba-321-medium
cba-321-big

When I search with query abc_123_big, I got abc_123_big. When I search with query abc_123, I got abc_123_big & abc_123_medium & abc_123_small. That's what I want.

But our products have hyphens in SKUs so when I search with query cba-321-big, I got cba-321-small & cba-321-medium & cba-321-big and all others product which have cba or 321 or big in SKUs.

Is it possible to get hyphen to act as like an underscore (to get exact matches) and not as an AND-splitter?


texts: How to remove indexer error? Requested store not found? in Magento 2.2.3

texts:
The following error comes after re-indexing in first two lines

  Requested store is not found

How can I fix this error?


texts: Passing variables to a child html block in Magento 2

texts:
At list.phtml, I am trying to get product object or product id for child template, which it comes from other module. How I can get product id at that phtml file?
In magento 1.x it was possible via following technique. when used it into magento 2.x is throwing error

  Uncaught Error: Call to a member function setData()

my custom module layout

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="category.products.list">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">PR_Catalog::product/list.phtml</argument>
            </action>
            <block class="PR\Catalog\Block\Product\Offers" name="category.products.offers" as="offer_list" template="PR_Catalog::product/offers.phtml" />
        </referenceBlock>
    </body>
</page>

custom module list.phtml file

<?php    foreach ($_productCollection as $_product){ ?>

<?php
        $block->getChildBlock("offer_list")->setData("product", $_product);
        echo $block->getChildHtml('offer_list')
?>

<?php } ?>

block class code is

<?php
namespace PR\Catalog\Block\Product;

class Offers extends \Magento\Framework\View\Element\Template
{
    private $product;

    public function setProduct($product)
    {
        $this->product = $product;
    }

    public function getProduct()
    {
        var_dump($this->product);die;
      return $this->product;
    }

}

child block phtml file

<div class="other-offers">
   <?php echo $block->getProduct()->getId(); ?>

</div>


texts: layout xml block="" usage - exam question

texts:
A couple of weeks ago I failed my frontend developer exam by 1 point, Tomorrow I am going to retake.

I have a question which I want to be sure about. In the exam I had some xml snippets and I had to pick the right one. A lot of times I saw snippets containing block="block_name". I never saw this in any layout xml file ever so I thought this is bad code maybe to trick me. This kind of snippet containing block= popped up several times which started to confuse me.

I searched everywhere but couldn't find an example. Do you guys now any usage for this or is it to trick me?

Example

<action method="insert" block="contactForm"/>

Can someone clarify this? Can block= be used in some xml code or not?


texts: Default block not called if the extension is disabled from advanced

texts: I have overridden onepage block in my extension. However When I disable the extension from advanced system configuration My entire checkout page is not being displayed. So please provide me solution to this.


texts: Magento not showing homepage correctly after installation

texts:
I'm new to Magento so please forgive me if the there are not enough details.

I tried to install Magento and everything was fine.
When I go to the homepage it doesn't show the content correctly. The admin panel is not working either.

I searched for several guides but unfortunately they didn't help.

Magento version: 2.0.7; no demo store

Edit:

The pictures (Magento logo) does not show properly as well as the text is just like a list. Seems like the css part is not being showed

My solution:

I have reinstalled magento instead on apache on Nginx and it worked.


texts: Magento_Payment/translate not included in requirejs config for mixins

texts:
In a custom module, I am trying to implement a mixin for the Magento_Payment/transparent jQuery widget. My module is installed correctly (other parts are working fine), but the mixin isn't loading.

  My_Module/view/frontend/requirejs-config.js

var config = {
    map: {
        '*': {
            my_custom_product: 'My_Module/js/my_custom_product'
        }
    },
    config: {
        mixins: {
            'Magento_Payment/transparent': {
                'My_Module/js/checkout/payment/transparent-mixin': true
            }
        }
    }
};

When I get to the frontend checkout payment screen, I see that Magento_Payment/transparent is loading; however, it's not loading with my mixin. I looked in pub/static/frontend/Package/theme/en_US/requirejs-config.js to verify that my configuration is in fact included, and it is:

  pub/static/frontend/Package/theme/en_US/requirejs-config.js

(function() {
var config = {
    map: {
        '*': {
            my_custom_product: 'My_Module/js/my_custom_product'
        }
    },
    config: {
        mixins: {
            'Magento_Payment/transparent': {
                'My_Module/js/checkout/payment/transparent-mixin': true
            }
        }
    }
};
require.config(config);
})();

Now that I know the config should have my custom mixin included, I turned to debugging the mage/requirejs/mixins.js file. On line 126 I added a breakpoint and specifically waited for Magento_Payment/transparent to be the value of the path variable. When doing that Magento_Payment/transparent isn't listed in the configuration object, and thus my mixin doesn't get loaded.

I know the way this is referenced is within the payment module's iframe template:

<form class="form" id="co-transparent-form" autocomplete="off" action="#" method="post" data-bind="mageInit: {
    'transparent':{
        'controller': getControllerName(),
        'gateway': getCode(),
        'orderSaveUrl':getPlaceOrderUrl(),
        'cgiUrl': getCgiUrl(),
        'dateDelim': getDateDelim(),
        'cardFieldsMap': getCardFieldsMap(),
        'nativeAction': getSaveOrderUrl(),
        'expireYearLength': getExpireYearLength()
    }, 'validation':[]}">
<!-- ko with: getCcFormView() -->
    <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
</form>

Is extending Magento_Payment/transparent possible, or do I need to find another way to add my custom functionality?


texts:
magento theme falling back to default theme even after theme is changed in admin side.
I am trying to change theme from default to blank theme under default package .
I tried clearing all cache and checked System > Configuration > GENERAL > Design > Themes > Layout, it is "blank" and System > Configuration > GENERAL > Design > Package > Current Package Name is "default".


texts: New payment method not showing in order details

texts:
Currently i have created my custom payment method.
It's not showing as a payment method in the sales order email.
It showing as a payment method in the PDF and in the order view section .

If i place an order with another payment method it does show it. But i place an order with the new payment method it does not show it anywhere.


texts:
How to show custom messages

 to certain products on checkout page in magento.


texts:
How can we issue individual credits that are all different amounts manually on our clients' accounts?
We have searched in Credit Memo section and can't see how we can manually edit or add a credit to one client, and a different credit to another, and a third credit amount to a third client, etc.


texts:
When a customer places an order through the website is there a way to make it so they automatically get sent an email confirmation of their order?

At the moment I have to manually send them through Magento. Is there a way to make this an automatic process?

Thanks


texts:
Place order issue in payment information in magento 2

Code was shared in github : https://github.com/sd2894/OrderAttribute


texts: How to use magento UI library in custom _module.less file?

texts:
I have created module specific less file in magento according to guide at below location.

  app/code/Modulenamespace/Modulename/view/frontend/web/css/source/_module.less

Now I want to be able use magento 2 default ui library inside _module.less file. So how can I add reference to _lib.less file so that I can use all available mixins and variables inside my _module.less?

I know I can do that in _extend.less but how to in case of _module.less Currently
php bin/magento setup:static-content:deploy -fgives error when using library.

Thanks in advance.

Solution has been found as I had defined my new variable and mixins in _extend.less and _module.less was not able to use those variables and therefore I was getting errors.


texts: Magento 2 the way to pass array in API function

texts:
I'm using my custom API for getting some entities.
I would like to filter items by Id.
Here is the fragment of webapi.xml:

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd">
    <route url="/V1/opencGCApiGcapiapi/list/:products" method="GET">
        <service class="Openc\GCApi\Api\GcapiapiInterface"  method="list"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
        <data>
            <parameter name="products" force="true">products</parameter>
        </data>
    </route>
</routes>

I'm using this PHP code for testing:

$request = new SoapClient($wsdlUrl, ['version' => SOAP_1_2, 'context' =>context]);
$result = $request->opencGCApiGcapiapiV1List(array('products' => array(1,2)));

In my method I've added logging:

public function list($products  = NULL)
{
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info(print_r($products, true));
...

In the log file I get the following record:

2017-11-02T14:50:48+00:00 INFO (6): Array

But I can not get the array contents.

Is it possible to pass arrays into the API's function?


texts:
If searching for a product that has a category, e.g. "Acer", "apple", "hp". It returns a 404 error not found.

This happens because URL rewrites are not on, and so the URL is www.**.com.au/brands/acer instead of www.*.com.au/index.php/brands/acer

Is there any work around to get this working WITHOUT enabling URL rewrites as it is not currently working with my shared hosting provider.

Thanks,
Steve


texts: How to add custom sort by option filter in tool bar in magento2

texts: I want to custom sort by option filter attribute add in tool bar section. Currently Magento 2 provide Position , Product Name , Price And Sorting option to low to high. But i need to change all sorting option Like Price High to Low , Price Low to High.


texts: PayPal integration with a Magento website

texts:
Hi I have a magento store with IP based currency detector, however I use INR as base currency. I integrated PAYPAL but its showing error(#10605). As I read INR is not accepted by Paypal, I don't mind it show up in India, but will the paypal integrated support currencies outside India with different currency as USD? Can anyone guide?

Or does base currency makes all the difference?

Any help how I can find a solution for Paypal integration?
my website is dvibgyor


texts: One Time Password for Frontend user login

texts: Can I configure the Magento frontend user login to incorporate a One Time password via a text message on the registered phone number? If yes what are the areas i need to factor in?


texts: Magento 1.9 : Increase captcha character length

texts:
How to increase captcha character length in magento 1.9?

I do that using System -> Advanced -> Admin -> CAPTCHA -> Number of Symbols

But, there are no any effect in captcha character length.

I want to set captcha character length between 7 to 8.


texts: Exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1293 Incorrect table definition when setup Magento 2.0 (0.1.0-alpha107)

texts:
Today I set up a version of Magento 2.0 (build 0.1.0-alpha107). But the process has stuck at 23% with error:

Exception 'PDOException' with the message 'SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause'.

Here are some pieces of the error log:

Module 'Magento_Sales':
Include

/Applications/MAMP/htdocs/magento/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php
[ERROR] exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause' in /Applications/MAMP/htdocs/magento/setup/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228


texts:
I want to add the confirm box while click save button in magento2 admin form.

How to do that.

Thanks.


texts: How to add new parameters to a core model in Magento2?

texts:
I am trying to develop a Module to support saving card_id for a Gateway handling such functionality. So basically you send the card information in frontend, the gateway returns a token then you call the gateway API in the server and it returns a card_id. A customer can have 'n' cards so I am planning to create a schema table 'cards' which relates to customers the same way as addresses do.

My question is how can I add another array to the customer object. The array should be similar to that of customer_addresses.

I have set my extension_attributes.xml like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
        <attribute code="gateway_card_id" type="text">
            <join reference_table="card_entity"
                reference_field="user_id"
                join_on_field="parent_id"
            >
            <field>group_id</field>
            </join>
        </attribute>
    </extension_attributes>
</config>

The table card_entity already exists too.

The problem is I am not seeing any extension attribute when I call the API /customers/me


texts:
How to filter search work with select option(it still work with text field)

        <field name="job">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magepow\Importexport\Model\Config\Source\JobOptions</item>
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Job Name</item>
                <item name="componentType" xsi:type="string">field</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                <item name="dataScope" xsi:type="string">job</item>
                <item name="filterOptions" xsi:type="boolean">true</item>
                <item name="showCheckbox" xsi:type="boolean">true</item>
                <item name="chipsEnabled" xsi:type="boolean">true</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
                <item name="levelsVisibility" xsi:type="number">0</item>
                <item name="multiple" xsi:type="boolean">0</item>
                <item name="sortOrder" xsi:type="number">2</item>
                <item name="listens" xsi:type="array">
                    <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                </item>
                <item name="required" xsi:type="boolean">0</item>
                <item name="source" xsi:type="string">conditions</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>


texts: How to upload a new version on Magento Commerce

texts:
I hope some one knows more about the issue we are facing.
We have a extension that is uploaded on Magento commerce, and its a  paid version developed by us. Now we have developed a new version with more features and want to upload there. We know that there is a version feature available there on Magentocommerce admin.

We want to know that how the new version will be available for new users as well as is that new version will be available or notified to the old customers who brought previous version?

Is there any option on mangento ecommerce for choosing version so customers can by which one they want?


texts: Fetch category id's through sql in magento 2.3

texts: I want to get the list of category id's with category name through sql. how can i do that?


texts: After migration i got the AbstractModel Not found Error

texts:
Below is the error which i am getting :

  Fatal error: Class 'Magento\Framework\Model\AbstractModel' not found
  in  vendor/magento/framework/Model/AbstractExtensibleModel.php on line
  16

Can one help me to reduce this error thanks in advance.


texts: After Migration from Magento 1.9.1.0 to Magento 2.2.4, Customer Creation Issue

texts:
I have Migrated website Magento 1.9.1.0 to Magento 2.2.4 successfully by Using Magento Data Migration Tool. My Old Magento Website was multi-store/website. Everything is working fine but when I am going to create an account then I am getting below errors

No such entity test with email = test999@mail.com, websiteId = 1

I have tried to some fixes by running below command but this is already updated

SET FOREIGN_KEY_CHECKS=0;
UPDATE store SET store_id = 0 WHERE code='admin';
UPDATE store_group SET group_id = 0 WHERE name='Default';
UPDATE store_website SET website_id = 0 WHERE code='admin';
UPDATE customer_group SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

While I have tried to create account programatically,its creating successfully but email id is not inserting in customer_entity table while it inserting in customer_entity_varchar table.

After migrating data ,website id and store id are same for both Magento and Magento2.I am also able to create product as well as place order is also working.

Is there is any option to check which entity id is missing when save customer?

I have a lot of research but nothing found to resolve this issue. Please help me.


texts: How are pages such as customer account login protected?

texts:
I'm looking through controllers, routes, sections, observers... and I can't find the method for protecting a page from non-logged in customers.

How is this done officially?

I may have found an answer in

vendor/magento/module-customer/etc/frontend/di.xml

If this is the method, could someone explain it to me?


texts: I've successfully installed Magento on WAMP server but I can't access admin panel and store.


texts: I want to add one group like Screenshot in system configuration, How can i add this configuration?


texts: How to add the facebook pixel code script in particular category page?

texts: I am trying to add facebook pixel code in particular category.How can i add that js file in magento please help me.


texts: After installation successful of Magento 2.2.7 invalid template file error is coming

texts:
1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp/htdocs/magento/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'C:/xampp/htdocs/magento/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'
#0 C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\Template.php(300): Magento\Framework\View\Element\Template->fetchView('C:/xampp/htdocs...')
#1 C:\xampp\htdocs\magento\vendor\magento\framework\View\Element\AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml()
#2 C:\xampp\htdocs\magento\vendor\magento\framework\View\Result\Page.php(248): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 C:\xampp\htdocs\magento\vendor\magento\framework\View\Result\Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 C:\xampp\htdocs\magento\generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 C:\xampp\htdocs\magento\vendor\magento\framework\App\Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#6 C:\xampp\htdocs\magento\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#7 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(257): Magento\Framework\App\Http\Interceptor->launch()
#8 C:\xampp\htdocs\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#9 {main}