texts: Magento 2 : Form data not getting saved on Save Customer button click in Admin Customer Edit

texts:
I have created a simple form under a new tab in admin customer edit section. I am trying to save form values after event adminhtml_customer_prepare_save is dispatched. But, inside observer of that event, I am not able to receive values entered in form. I am trying to get post request parameters. But, somehow, none of the values in the form are present in the request.

Form.php

namespace Pranav\ByeUniverse\Block\Adminhtml\Customer\Edit\Tab;

class Form extends \Magento\Backend\Block\Widget\Form
{
    public $prefix;
    protected $storeSystemStoreFactory;
    protected $formFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Store\Model\System\StoreFactory $storeSystemStoreFactory,
        \Magento\Framework\Data\FormFactory $formFactory,
        array $data = []
    ) {
        $this->formFactory = $formFactory;
        $this->storeSystemStoreFactory = $storeSystemStoreFactory;
        parent::__construct($context, $data);
    }

    protected function _prepareForm()
    {
        $form = $this->formFactory->create([
            "data" => [
                'method' => 'post',
                'action' => $this->getUrl('customer/*/save'),
            ]
        ]);
        $this->prefix = '_comment';
        $form->setHtmlIdPrefix($this->prefix);
        $form->setFieldNameSuffix('byeuniverse_comment');

        $fieldset = $form->addFieldset('comment_fieldset',
            array('legend' => __('Add Comment'))
        );

        $fieldset->addField('website_id', 'select', array(
            'name'     => 'website_id',
            'label'    => __('Website'),
            'title'    => __('Website'),
            'values'   => $this->storeSystemStoreFactory->create()->getWebsiteValuesForForm(),
        ));

        $fieldset->addField('comment', 'text', array(
            'name'     => 'comment',
            'label'    => __('Comment'),
            'title'    => __('Comment'),
            'comment'  => __('Comment'),
        ));
        $this->setForm($form);
        return parent::_prepareForm();
    }
}

Observer

namespace Pranav\ByeUniverse\Observer;

use Pranav\ByeUniverse\Helper\Data;

class PrepareCommentSave implements \Magento\Framework\Event\ObserverInterface
{
    private $_commentHelper;

    protected $_logger;

    public function __construct(
        \Pranav\ByeUniverse\Helper\Data $commentHelper,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->_logger = $logger;
        $this->_commentHelper = $commentHelper;
    }

    public function execute(
        \Magento\Framework\Event\Observer $observer
    )
    {
        $this->_logger->debug(Data::DEBUG_KEY . " Customer Prepare Save Event");

        if (!$this->_customerBalanceHelper->isEnabled()) {
            return;
        }

        $customer = $observer->getData('customer');
        $request  = $observer->getData('request');

        if ($data = $request->getPost('byeuniverse_comment')) {
            // Sadly, this is never reached
        }
    }
}

I want form data to be saved when Save Customer button is clicked. How to get values entered in the form on button click. I could use your help. Thanks !


texts: Magento just stops loading layout from time to time - why?

texts:
I have a problem with my Magento 1.9.x store. From time to time it stops loading the CSS files for no clear reason. The log files contain no information.

I looked at the source code and normally my CSS is loaded like this: https://www.example.com/skin/frontend/mytheme/default/css/styles.css

After the crash, the paths to the CSS files look like /frontend/mytheme/default/css/styles.css. So the domain and skin is missing.

Cleaning the var/cache folder solves the problem temporarily.

Any idea what I can try to solve or even debug this?

Thanks a lot for helping :)!


texts:
I'm using https://github.com/avstudnitz/AvS_FastSimpleImport extension to create new simple products programmatically and then assign them to existing configurable product. Problem is I can assign single SKU but can't assign several at once with error "Product with specified super products SKU not found"

<?php

// Trying to assign several simples at once
// either $simples as comma-separated SKU or an array() doesn't work

$assignProducts[] = array(
    'sku' => $configurableProduct->getSku(),
    '_type' => '',
    '_attribute_set' => '',
    '_super_products_sku' => $simples
);

Is the only way to do it is to pass each SKU separately to Mage::getSingleton('fastsimpleimport/import')->processProductImport()?

Anyone faced this task?


texts: Need help understanding magento order state workflow

texts:
1)

When a user first places an order the state will be 'new' which I understand makes the order non visible.

Given this state we can assign statuses like 'new' and 'pending' which I believe makes the order visible.

2)

If the order's payment method is set to 'auth & capture'
or if either 'invoice' or 'ship' is completed for an order but not both then the state will be 'processing`.

For such orders, statuses can be 'shipped' or 'invoiced'.

3.

If both are completed then the state will be completed as will the status.

So my doubt is how magento understand particular state is new or processing or completed ?

is there any event-observer functionality for this?

I mean if user clicks place order button any observer will trigger?

Is there any definition for each state?


texts: Magento 2.3 Elastic Search 5+ Effecting Layered Navigation

texts:
With Elasticsearch built in with Magento 2.3 it's stopped allowing me to choose an option in the layered navigation, if i choose a filter the ajax gif shows but will not display any results.

If i disabled Elasticsearch and switched back to MySQL the filters work fine.

Any idea?


texts: How to get customer informations inside Rest API

texts:
How can I get the customer informations using the Api.php?

I tried to use exactly how I use in another parts of the code but it apparently don't work at the same way (the part that I tried to change has a comment above):

app/code/core/Mage/Sales/Model/Order/Api.php

public function info($orderIncrementId)
{
    $order = $this->_initOrder($orderIncrementId);

    if ($order->getGiftMessageId() > 0) {
        $order->setGiftMessage(
            Mage::getSingleton('giftmessage/message')->load($order->getGiftMessageId())->getMessage()
        );
    }

    $result = $this->_getAttributes($order, 'order');

    $result['shipping_address'] = $this->_getAttributes($order->getShippingAddress(), 'order_address');
    $result['billing_address']  = $this->_getAttributes($order->getBillingAddress(), 'order_address');
    $result['items'] = array();

    foreach ($order->getAllItems() as $item) {
        if ($item->getGiftMessageId() > 0) {
            $item->setGiftMessage(
                Mage::getSingleton('giftmessage/message')->load($item->getGiftMessageId())->getMessage()
            );
        }

        $result['items'][] = $this->_getAttributes($item, 'order_item');
    }

    $result['payment'] = $this->_getAttributes($order->getPayment(), 'order_payment');

    $result['status_history'] = array();

    foreach ($order->getAllStatusHistory() as $history) {
        $result['status_history'][] = $this->_getAttributes($history, 'order_status_history');
    }

    //THIS IS THE PART THAT I TRIED TO CHANGE:

    $customer_id = $order->getCustomerId();
    $customer = Mage::getModel('customer/customer')->load($customer_id);

    $result['customer_taxvat'] = $this->_getAttributes($customer->getCustomAttribute(), 'custom_attribute');

    //

    return $result;
}


texts:
How to Add Customer Attribute in magento 2
and then showing the Attribute in Account Information?
thank you!!


texts: How to get recently viewed product collection in observer Magento 2

texts:
I want to fetch a recently viewed products collection in the observer and by using that collection I want to add my custom product in that collection.

Following Things That I Want To Achieve.

On click of a product when it opens a product detail page that product id should be stored in session->Completed
After that, I want to add those products which are stored in session in recently viewed product collection when the user creates a new account display those products in the recently viewed product widget.->Incomplete

  The main Thing Is that I want to display guest user recently viewed product to a new customer  when the guestuser  creates a new account

Following Is Observer File

<?php
 namespace Namespace\RecentProducts\Session;
 class ProductData
  {

protected $_coreSession;
public function __construct(

    \Magento\Framework\Session\SessionManagerInterface $coreSession

){
    $this->_coreSession = $coreSession;
}

public function setValue($value){
$this->_coreSession->start();
$this->_coreSession->setMessage($value);
}

public function getValue(){
$this->_coreSession->start();
return $this->_coreSession->getMessage();
 }

public function unSetValue(){
$this->_coreSession->start();
return $this->_coreSession->unsMessage();
}

}

?>

Following is my session file where I am calling observers methods

<?php

namespace Namespace\RecentProducts\Observer\Product;

use Magento\Framework\Event\Observer;

use Magento\Framework\Event\ObserverInterface;

class Data implements ObserverInterface

{

public function execute(Observer $observer)

{

    $product = $observer->getProduct();

    $originalName = $product->getName();

    $imgdata = $product->getImage();

    $catid = $product->getCategoryId();

    $entid = $product->getEntityId();

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

/*-------begining of code to set data to session----------*/
$SessionCollection =  $objectManager->get('Magneto\RecentProducts\Session\ProductData');
$value = $SessionCollection->getValue();
$newValue = explode(",",$value);
    if($value)
    {
        if(!in_array($entid,$newValue))
        {
            $newdata = $value.",".$entid;
            $SessionCollection->setValue($newdata);
        }

    }
    else
    {
        $SessionCollection->setValue($entid);

    }

    echo $value;

}

}

Following is events.xml file

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

<event name="catalog_controller_product_view">

    <observer name="RecentProductData" instance="Magneto\RecentProducts\Observer\Product\Data" />

</event>

</config>


texts: programmatically create a custom variable

texts: I followed the trace of a custom variable and I notice that it create entry on core_variable_value and core core_variable as well as in the logging table, I need a custom variable in one of my CMS codes but this needs to be done on the installation so the end user doesn't have to create it, is it possible to do it programatically?


texts: How to uninstall and reinstall a module?

texts:
Anyone know how I can uninstall and then reinstall the module? I believe it has some code that runs on install which I have edited so need to be able to run this again?

Thanks


texts: Magento 2.3.1 Search Bar Error - Unknown column 'search_result.score'

texts:
Relatively new to Magento. Helped a friend migrate a site from M1 to M2. Using Porto Theme.

Search Bar seems to work (does auto querying as you type and makes suggestions) until you hit 'Enter' at that point you get the following error:

  {"0":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'search_result.score' in 'order clause', query was: SELECT e., price_index.price, price_index.tax_class_id, price_index.final_price, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS minimal_price, price_index.min_price, price_index.max_price, price_index.tier_price, cat_index.position AS cat_index_position, stock_status_index.stock_status AS is_salable FROM catalog_product_entity AS e\n INNER JOIN catalog_product_index_price AS price_index ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0\n INNER JOIN catalog_category_product_index_store1 AS cat_index ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(3, 4) AND cat_index.category_id=2\n INNER JOIN cataloginventory_stock_status AS stock_status_index ON e.entity_id = stock_status_index.product_id ORDER BY search_result.score desc\n LIMIT 24","1":"#1 Magento\Framework\DB\Statement\Pdo\Mysql->_execute(array()) called at [vendor/magento/zendframework1/library/Zend/Db/Statement.php:303]\n#2 Zend_Db_Statement->execute(array()) called at [vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:480]\n#3 Zend_Db_Adapter_Abstract->query('SELECT e., p...', array()) called at [vendor\/magento\/zendframework1\/library\/Zend\/Db\/Adapter\/Pdo\/Abstract.php:238]\n#4 Zend_Db_Adapter_Pdo_Abstract->query('SELECTe.*,p...', array()) called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:542]\n#5 Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SELECT e.*, `p...', array()) called at [vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:617]\n#6 Magento\Framework\DB\Adapter\Pdo\Mysql->query(&Magento\Framework\DB\Select#0000000027346819000000004114b559#, array()) called at [vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php:737]...

Switched back to Luma theme and still seeing the issue.

Been attempting to track down a solution and have exhausted my limited knowledge. Found the same issue here: Column not found: 1054 Unknown column 'search_result.score' in 'order clause'; but the suggestions there didn't work for me.

It would appear that there is supposed to be a table named search_result and I can't see in the mysql logs where the system has created or attempted to create a temporary table named 'search_result'.

It looks to me like the sql is incorrect in that a relationship to search_result is never established in the query, but maybe that's not needed.

Do any of you magento experts have any idea what I'm dealing with here? Can I change the query?


texts:
I have an element in header.phtml that shows in every page but I want to hide it in specific pages like categories and products.

...

and the php code

<?php if(!Mage::registry('current_category')):?>

<?php endif; ?>

I'm really new to magento so if anyone can help me I'd appreciate it.


texts: Transaction emails not sending - Magento 1.9.2 (i've tried the other solutions from other questions and didn't work)

texts:
my transactional emails are not sending (new inquiry, new order, etc). And i've tried the solutions I could find here but none seems to work.
my sales emails are enabled. i set up cron job at cpanel. but my cron jobs are not running. (i've nothing in var/log/cron)
i've tried commenting out the mail queue, also did not work.
the thing is, it USED to work. before i changed to SSL and before i added in my store email address. i don't know if that's an issue. previously it would send the mail as from "owner@example.com".
also, i'm using a clone script from apptha (airhotels). could that be an issue?

please help, thank you!


texts: Payment Captured, No order processed in Magento

texts:
New Magento 2 Install.
Authorize.net and Paypal having the same issue.

Order is placed on our website
Payment is captured and accepted
The order DOES NOT show up in Magento`s backend.
Customer does not receive any confirmation emails

Making big problems at the moment.  I tested it myself, and after it processed the credit card, I had a brief error that said, "Unique Constraint Violation Found"

Not even sure where to look for this, there's no real supported threads answering this question, can anyone offer guidance?

-Justin


texts: How to create extension in Magento 2.3.3?

texts:
I am familiar with Magento 2 extension development but can anyone explain step by step extension development changes in Magento 2.3.3 by writing a simple "Hello_World" extension.

In Magento 2.3.x no more setup folder available and they just removed installschema and upgradeschema file, So the purpose behind this module development is to get proper knowledge and changelog for Magento2.3.3 extension development.

I am still able to install and use some Magento 2.2.x extension in Magento 2.3.X So I'm not getting the exact mechanism behind this.

Can anyone help me remove my confusion, Any help would be appreciated.

Thanks In Advance.


texts:
I want to get a collection of all the items in cart currently.

How can I do this ? Any suggestions will be appreciated.


texts:
My client wishes to make a simple 2 server magento setup, one for the database and one for the webserver.  Most AMI out there or AWS deployments are much much more complicated (and expensive!) and not really needed yet by us at this time.  Deploy4me had a great solution that was just that for us, but as per my correspondence with them they have since taken it down due to errors in mysql they said it will be up again eventually but it's probably best I deploy manually if time is an issue (which it is).

I have searched far and wide for hours, looking at vagrant, docker, puphpet, puppet, AMI's, and AWS documentation in regards to deployment and magento, blogs for setups by hand, install scripts, blogs about beanstalk on amazon and so on and so on, without finding one simple solution yet for deploying just a LEMP stack with mysql on a separate machine, outside deploy4me, which as I stated is not offering that service at this time.  So, that's why I'm posting here, in hopes anyone here might know of some deployment method with that fairly popular and well recommended setup included.  Which is why I'm somewhat confused as to why finding that setup is so hard.  I do have the knowledge to build it from scratch, but it's time consuming to do right and will cost my client unneeded dev hours.  I could go with a full scaling solution, but I'm guessing he'd be upset at the cost of some of these 5+ server setup solutions and has expressly forbade a single server solution.


texts: How to disable forced redirects in magento

texts: I have enabled it in the Web category under system. I have lost my admin access due to the https problem so I would like to disable the forced redirect. Is there a way to do that using db or shell ?


texts:
I have installed PayPal plus extension from Iways, on magento version 1.9.2.2. Locally works everything fine, on  my dev environment I receive the error

  Provided credentials not valid.
  Webhook creation failed.

I have sandbox account everything is ok. I have checked the client id and the Secret key, no errors. The lib folder from the extension is also there.
I really don't understand why I receive this error that the credentials are not valid.

Anybody any other idea, I will appreciate.


texts: Files and Folders - all new created or changed show dates one hour after system time!

texts:
This is Magento 1.9.2.4. Here is the current situation:

Server time is correctly set up. I can check it from Terminal.
PHP time is correctly set up as timezone. I created a php file for showing the date.
Time for Magento frontend is correctly set up. I can check it in any phtml template.
In Magento database time for Created At and Updated At fields are UTC time

Here is my issue:

In Magento file system all changes to files or folder show a time one hour after system time. I deleted the files in /var/cache then reload the frontend and current system time/Magento is 14:42 and files were created 15:42. "Someone" is adding one hour to every file/folder created or changed. I uploaded a product image again 1 hour after system time.

Does anyone have a solution for this?


texts: How to redirect to Magento2 Customer Login page from 3rd Party Application/External application.....?

texts:
How to redirect to Magento2 Customer Login page from 3rd Party Application/External application. Suppose, when we want to redirect from any application to WordPress site
we write redirect to http://www.wordpress_site.com/wp-login.php

But I want to know, how we can redirect to Magento customer login page because Magento needs referer. which is where I didn’t understand, How can I pass referer from other application.

Example of Magento URL
Get login URL on product page Magento 2


texts:
I have update one my extension to the marketplace.

But I am getting error “Class doesn't exist” error but my class is already there.

My di.xml is below.

<type name="Magento\Framework\View\Result\Layout">
        <plugin name="custom_layout_load" type="<Vendor>\<Module>\Plugin\CustomLayout" />
    </type>

My Plugin CustomLayout.php is below.

<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace <Vendor>\<Module>\Plugin;

use Magento\Framework\View\Result\Layout;
/**
 * Description of SalesFormLayout
 *
 * @author dharmendra
 */
class CustomLayout
{
    const CUSTOM_LAYOUT_HANDLE = 'custome_layout';
    /**
     * @var \Magento\Framework\App\Request\Http
     */
    private $request;

    /**
     * LayoutPlugin constructor.
     * @param \Magento\Framework\App\Request\Http $request
     */
    public function __construct(
        \Magento\Framework\App\Request\Http $request
    ) {
        $this->request = $request;
    }

    /**
     * @param Layout $layout
     * @param $response
     * @return bool
     */
    public function afterAddDefaultHandle(Layout $layout, $response)
    {
        $fullActionName = $this->request->getFullActionName();
        if ($fullActionName == 'layout_action') {
            $layout->addHandle(self::CUSTOM_LAYOUT_HANDLE);
        }
        return $response;
    }
}

Still Marketplace throw error class doesn't exist.
I will stuck with the issue if any one know the solution please give.

Thanks in advance.


texts:
I have created a new page in Magento as

http://istockphp.com/magento/adding-custom-page-to-the-customer-account-dashboard/

It is working fine in my local machine,But it returns an error in my live server when i try to load that page

Parse error: syntax error, unexpected 'Istockphp_Customerpage_Block_C' (T_STRING) in
/home/public_html/app/code/local/Istockphp/Customerpage/Block/Customer.php on line 1


texts: How to Create custom increment id like sales order increment_id for custom module

texts: I want custom increment_id field in custom module. Like sales_flat_order increment_id. Is EAV table format is best solution?


texts: Calling phtml File in CMS Block or In CMS Page in Magento 2


texts:
I'm trying to create a new attribute, but my install script does not run.

etc/config.xml

<modules>
    <Namespace_ShippingPrices>
        <version>0.1.0</version>
    </Namespace_ShippingPrices>
</modules>
<global>
    ...
    <resources>
        <namespace_shippingprices_setup>
            <setup>
               <module>Namespace_ShippingPrices</module>
               <class>Mage_Eav_Model_Entity_Setup</class>
            </setup>
        </namespace_shippingprices_setup>
    </resources>
</global>

sql/namespace_shippingprices_setup/install-0.1.0.php

<?php
/* @var $installer Mage_Eav_Model_Entity_Setup */
$installer = $this;

$entityType = Mage_Catalog_Model_Product::class;
$productGroup = 'Prices';

$attributes = [
    'namespace_shipping_price' => [
        'type' => 'decimal',
        'label' => 'Shipping costs',
    ]
];

foreach ($attributes as $attributeName => $attribute) {
    $createdAttribute = $installer->addAttribute(
        $entityType,
        $attributeName,
        [
            'backend_type' => $attribute['type'],
            'label' => $attribute['label'],
            'group' => $productGroup,
            'user_defined' => true,
            'required' => false,
        ]
    );
}

I can't find anything in logs and also in core_resource the module is not available.


texts: How to get magento 2 custom address entity id

texts:
How to get  entity_id of created custom address after executing of customer_address_save_after event

  private function getEntityId($observer)
  {
        $customerAddress = $observer->getCustomerAddress();
        $entityId = $customerAddress->getCustomer()->getEntityId();
        return $entityId; //entity_id of the customer_entity table
  }

This method returns the  entity_id of the customer_entity table, but I need the entity_id of the customer_address_entity table


texts: can product url be in different language?

texts:
As I understand product title will be translated to product url like this

ex) product title : Asus Monitor -> url : http://yoursite/asus-monitor.html

my problem is that I have a lot of products from Korea that has Korean product name, and it seems Magento 2 doesn't accept foreign chars for product url.

ex) product title : Samsung 모니터 -> url : yoursite/samsung.html
                     (모니터 = monitor)

see the problem here that it just cut off Korean part from the name..

is there way to let Magento 2 accept foreign chars for product urls?


texts:
I've seen multiple types of messages on magento 2. Error messages, success messages and so on. How can I get the total number of messages that magento can provide? It should be sum of messages displayed on each and every scenario.

How can I get that exact amount?


texts: Setting certain property on all products in one go

texts:
I have imported some products into magento but I have problem with having them show up in front end.

How can I set all products at once to belong to main web shop, and how can I set all products that have quantity greater than 0 to be available in the stock?

Something like a bulk update if it exists or if there's some sql query I need to run. I'm new to magento so I'm not exactly sure what I'm supposed to do in such situation when I need to update all products at once.

Thanks!


texts: Magento 1.9 can't add items to shopping cart Form key problem

texts:
I have several Magento stores hosted on bluehost. They had been running well for a couple of months and then suddenly one day the customers just could not add products to the shopping cart any more. The store just shows Shopping Cart is Empty.

After days digging into the code, finally I found out the problem caused by FORM_KEY. The form_key that server side fetches stays the same for one session, but the form_key on front side changes every time I refresh the page. So the form_key passed from front end form is different from the one server uses to validate.

The _validateFormKey() in addAction() function always returns false and the items cannot be added to shopping cart.

I tried to block caching by adding the following meta tags to each page, but it did not solve the problem.

  meta http-equiv="Cache-Control" content="no-cache, no-store,
  must-revalidate"

  meta http-equiv="Pragma" content="no-cache"

  meta http-equiv="Expires" content="0"

Any ideas?


texts:
I am running bin/magento indexer:reindex command for indexing.
In admin panel Systems->Index Management
Updated column shows the updated indexing date for all except ' Product Categories ' and 'Product Price'.

How to resolve this?

Also i want to know how to set up cron for indexing if i choosed 'Update by schedule'


texts:
Is there a way to get a free gift added to the cart when a specific coupon code has been used?
It would be nice if the gift would be a product that is in the catalog, with a unique SKU.

  Possible scenario:

  A buyer uses the code WANTGIFT while in the cart. At the end of the
  checkout he will see an additional product with a cost of 0.00 in
  the checkout summary. After the sell the store will automatically
  reduce the stock of free gift by 1.

Any suggestions if it is possible with Magento 1.5 or does anyone know a good extension that does the job?


texts: Cannot Find Where You Change The Order Block On Email Confirmation

texts:
I'm looking to change "Shipping & Handling" on the email order confirmations. I've looked in the items.phtml and it doesn't mention shipping at all.

Not sure where Magento is pulling this in from?


texts: From where magento 2 set Template Id for order email

texts:
I know already that in Magento 1 Directory app\code\core\Mage\Sales\Model\Order.php have code

// Retrieve corresponding email template id and customer name
    if ($this->getCustomerIsGuest()) {
        $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
        $customerName = $this->getBillingAddress()->getName();
    } else {
        $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
        $customerName = $this->getCustomerName();
    }

But I don't know in Magento 2 where they set Template Id for order email.

Can anyone know From where this code executed in Magento 2?


texts: Compare products in sidebar of category pages not showing when no products

texts: I am working on http://urbantrend.co.in/test/ project. And In sidebar on category pages compare products disappears if there is no product http://urbantrend.co.in/test/index.php/womens.html. If i have some products in compare then that block will appear.


texts: convert {{var customer.getName()}} to customer name

texts:
I am create SMS module and in SMS template i use custom variable such as {{var customer.getName()}} .

How i can convert this variable to same variable for example if user use {{var customer.getName()}} in SMS template when SMS was sent customer see his/here name in SMS


texts: Paypal Express Checkout button not showing

texts:
I have been searching how to use Paypal Express Checkout, but i can't show the Paypal button on my products page or even in the cart page...

As you can see below, i have the following configuration on my admin page:

What else do i need to do for this to properly work?

PS: I already have read the paypal guides and it just confused me more.


texts:
Using Ultimate Followup Email extension for Magento 2 but throws me an error when cron is trying to send out emails:

main.CRITICAL: Error when running a cron job {"exception":"[object] (
RuntimeException(code: 0): Error when running a cron job at /home/*/public_html/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:330,
Error(code: 0): Call to a member function setMessageType() on null at /home/*/public_html/app/code/Magenest/UltimateFollowupEmail/Model/Mail/TransportBuilder.php:142)"} []

This is code from the TransportBuilder.php part around line 142, maybe something isn't working because I'm using PHP 7.3? It says the line with text/html is throwing an error.

/* Prepare message */
protected function prepareMessage()
{
    $this->message->setMessageType('text/html');
    $template = $this->getTemplateChoosed($this->templateId);
    $body = $template->processTemplate();
    $this->message->setBodyHtml($body);

    $this->message->setSubject(html_entity_decode($template->getSubject(), ENT_QUOTES));
    return $this;
}

You can find this module on Github to look further in the code.

[UPDATE]

Fix can be found here. https://github.com/magenest-dev/module-ultimate-follow-up-email/pull/2/commits/4779cf27cf1bfec04d8ac9b02d7a43fbcf625ee4


texts: Show custom message after redirect in M2

texts:
I want to show error message in order view page when user click on Credit Memo  link using before plugin.
I have redirect to order view page as showing in this link when user click on Credit Memo link.
I have create plugin to check custom login before creating credit memo.
Redirect is working good but not able to show any custom message in order view page when it return from plugin's before method.
How can i show custom message in order view page when i return from before plugin?
I have try this :
        $message = 'My custom message';
        $this->messageManager->addError($message);

        //return $this->urlBuilder->getUrl('sales/order/view', ['order_id' => $orderId]);
        //return $this->resultRedirectFactory->create()->setPath('sales/order/view', ['order_id' => $orderId], ['_current' => true]);

        //$resultRedirect = $this->resultRedirectFactory->create();
        //return $resultRedirect->setPath('sales/order/view', ['order_id' => $orderId], ['_current' => false]);

        //$url = $this->url->getUrl('sales/order/view', ['order_id' => $orderId], ['_current' => false]);
        //$this->response->setRedirect($url)->sendResponse();

        //$this->actionFlag->set('', \Magento\Framework\App\ActionInterface::FLAG_NO_DISPATCH, true);

        $url = $this->url->getUrl('sales/order/view', ['order_id' => $orderId]);
        $this->response->setRedirect($url)->sendResponse();
        return;


texts: progress-bar.js:31 Uncaught TypeError: stepNavigator.setHash is not a function magento 2 custom theme

texts:
I am facing one issue due to this error in checkout page means
  shipping rates are not showing properly.

progress-bar.js:31 Uncaught TypeError: stepNavigator.setHash is not a function
        at UiClass.initialize (progress-bar.js:31)
        at UiClass.initialize (wrapper.js:109)
        at new UiClass (class.js:49)
        at Object.initComponent (layout.js:137)
        at fire (jquery.js:3232)
        at Object.fireWith [as resolveWith] (jquery.js:3362)
        at Object.deferred.(/project/checkout/anonymous function) (url/project/pub/static/version1544010067/frontend/project/project/en_GB/jquery.js:3461:37)
        at fire (jquery.js:3232)
        at Object.fireWith [as resolveWith] (jquery.js:3362)
        at Object.deferred.(/project/checkout/anonymous function) [as resolve] (url/project/pub/static/version1544010067/frontend/project/project/en_GB/jquery.js:3461:37)


texts: What URL should I use for monitoring the availability of Magento?

texts:
I'm setting up monitoring of my magento installation and was curious if there's a particular URL / action that I should use for the monitor.

At the moment I'm using /admin/--it's a small, quick, and responds to the maintenance flag.  That makes it meet my criteria, but I was wondering if there is a better option.


texts: How can i give free shipping order above RS.500 for only selected City

texts: I need to give free shipping to the selecetd city if the order above RS.500 also the city is selected city then the free shipping will be applied.


texts: How to create empty block in frontend, just for REST purpose?

texts:
I registered a new action that should receive POST and return JSON encoded data to my javascript, I don't need any blocks such as header, footer, etc, so I tried to do the empty page this way in my layout xml:

    <reference name="root">
        <remove name="head "/>
        ...
    </reference>

I believe there should be some more elegant workaround for this purpose ?

ps.
If I understood correctly, magento REST API is to deal with magento as admin ?

     (Mage::app()->getStore()->isAdmin() === true)

please correct me if i wrong, any good link for creating rest apis like this would be much appreciated.
Thank you!


texts: Magento 2.3 After changing product all categories are unassigned

texts:
I have a problem with Magento 2.3.3. We have a lot of normal products and also use Group and Bundle products.   All products are assign to a category (or multiply categories) and also displayed in frontend.

Our Issue:

After changing a normal product, like the quantity, the product is no longer assigned to the category/categories and will not displayed in frontend.
After looking in the category, this SKU is no longer assigned and we have to assign it again.
After that, the product displayed again and all is fine.

We have to do it with every product change... Is this issue already known? Did someone have the same issue and fixed it?

Hopeful that someone can help.

Thank you.


texts: Meta Description issue only for products

texts:
I have a serious problem with meta tag Description only for a product page. In head.phtml this tag is defined as follows:

<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />

As you can see this is a Magento issue for long time, for product page it should be set to Short Description not Description. Why? Because in my case Description is an  list of items. All tags like ul or li will be formated to <li> and this will be an ugly looking description ruining the page in Google. If I will use Short Description all the other pages will be affected, pages like CMS, Categories which are based on description attribute.

How can I change this meta tag only product page to use Short Description? It should be an if statement but I don't know who to define.


texts: How can I skip queue messages and display action happend message in magento2.3?

texts:
I am doing bulk update attribute from admin side in magento2.

I am not getting message of 'attribute has been updated' something like as.

I am getting below message which is attached in screen shot .


texts: get order id in Observer on sales_order_invoice_save_after

texts:
I want order id in observe function but I am getting null
I am using this code
Observe.php

public function invoiceexport(Varien_Event_Observer $event=null){
    $_helper = Mage::helper('Nino_invoiceexport');
    $importStartDateTime = date('Y-m-d H:i:s');
    $orders = $event->getOrder();
    print_r($orders);
    die;
}

My config.xml is as :

<events>
    <sales_order_invoice_save_after>
         <observers>
             <Nino_invoiceexport_order_invoice_save_after>
                  <type>singleton</type>
                  <class>Nino_InvoiceExport_Model_Observer</class>
                  <method>invoiceexport</method>
              </Nino_invoiceexport_order_invoice_save_after>
          </observers>
     </sales_order_invoice_save_after>
</events>


texts:
i'm trying to create my first magento template and i'm facing problems to load the pagination toolbar.

My last try was using

$object = new Mage_Catalog_Block_Product_List_Toolbar();
echo $object->getPagerHtml();

This hint was taken from

http://magento.stackexchange.com/questions/11528/pagination-on-products-page

But on my catalog/product/list.phtml doesn't show my pagination.
Maybe I'm missing something on XML layout?
PS.: Neither toolbar.phtml loads


texts: Possibilities in local.xml configuration

texts:
I'm rather new to Magento and read in this article that it is possible to configure the base_url values in app/etc/local.xml. Would be nice to have this functionality for running multiple environments, for which Magento doesn't seem to offer a lot of possibilities out of the box (correct me if I'm wrong here, though).

Am I assuming correctly that the values for base_url in local.xml will take precedence over the config values in the database?

What other database config values would you be able to override this way? Not finding a lot of documentation on this...

<config>
    <global>
    <!-- ... -->
    </global>
    <stores>
        <default>
            <web>
                <unsecure>
                    <base_url>http://beispiel.tld/shop/</base_url>
                </unsecure>
        </default>
        <admin>
            <web>
                <unsecure>
                    <base_url>https://beispiel.tld/shop/</base_url>
                </unsecure>
        </admin>
    </stores>
</config>


texts:
I try to debug my magento2 project with xdebug php 7.1 and nginx. I have differents breakpoints in app/code/Extension/Module and doesn't stop in any one.

Just stop if I have the option "Break at the first line" in the index.php but in my breakpoints don't work...

I'm developing locally

My php.ini configuration is the next:

;XDEBUG
zend_extension="/usr/lib/php/20151012/xdebug.so"
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_autostart
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_autostart = 0
xdebug.profiler_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.idekey=PHPSTORM

PHPINFO:

PHPSTORM:


texts: addFieldToFilter() with OR Condition in magento2

texts:
$collectionData = $this->_productCollectionFactory->create()->addAttributeToSelect('*')
    ->addFieldToFilter(['attribute1', 'attribute2'],
        [
            ['in' => $attribute1],
            ['nin' => $attribute2],
        ]);

I want to get collection based on "OR condition" on three attribute for example a product which has color yellow or size small but not manufacture china.


texts: Programatically set visibility to "Not visible individually" for other store views

texts:
When we create / edit product, then we select category and website, for store views whose category is not selected, the visibility should be set to "not visible".

Is it possible by default?


texts:
I'm new to magento and it's really difficult for me to debug codes if something went wrong. What are the best, free tools that we can use to speedup debugging, track the errors, find the exact point of error or source of error?

The errors shown during the setup:di:compile are not much vivid.


texts: Magento 2: How do I load a cart populated by the REST API into the frontend?

texts:
Using the Magento REST API I am able to create and populate a cart on my external site, but I want customers to checkout on the actual Magento site. Right now I'm looking at creating a plugin for Checkout\Controller\Cart\Index. I want it to grab the cart_id from the request parameters and load that cart up to the session. Trouble is, I'm not really sure exactly where to start, and the documentation is lacking.

So far I have the plugin class written as:

class IndexPlugin
{
    public function beforeExecute() {
        $params = $this->getRequest()->getParams();
        if (isset($params['masked_id'])) {
            $quoteIdMask = $this->checkoutSession->quoteIdMaskFactory->create()->load($params['masked_id'], 'masked_id');
            $this->checkoutSession->setQuoteId($quoteIdMask->getQuoteId());
        }
    }
}

With the di.xml looking like:

<?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\Checkout\Controller\Cart\Index">
        <plugin name="restore-cart-by-mask"
            type="{Vendor}\{Module}\Plugin\Checkout\Controller\Cart\Index" sortOrder="10"/>
    </type>
</config>

I know this is a less than secure approach, so any guidance would be extremely appreciated.


texts: Magento 2.2.6 Exception message: A wrong PayPal Express Checkout Token is specified

texts:
I am getting this issue for a few customers in the production site. while trying place order in one step checkout with PayPal express checkout, it's redirecting to the cart page with the exception

  A wrong PayPal Express Checkout Token is specified.

I am not getting this issue for all customers, also I am unable to replicate this issue.

Also, I found in logreport.CRITICAL:

Exception message: A wrong PayPal Express Checkout Token is specified. Trace: #0 /app/yvwkeqc4fanxa/vendor/magento/module-paypal/Controller/Express/AbstractExpress/ReturnAction.php(32): Magento\Paypal\Controller\Express\AbstractExpress->_initToken() #1 /app/yvwkeqc4fanxa/vendor/magento/framework/App/Action/Action.php(107): Magento\Paypal\Controller\Express\AbstractExpress\ReturnAction->execute()

Has anyone have the solution for this issue.


texts: how to setTemplate for top.search in magento2

texts:
How to setTemplate in custom module for search.

Spacename/Modulename/view/frontend/layout/default.xml

 <?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

    <referenceBlock name="topSearch">
    <arguments>
        <argument name="template" xsi:type="string">Spacename_Modulename::form.mini.phtml</argument>
    </arguments>
</referenceBlock>

    </body>
</page>

just want to change his template file. how to do that?

this solution not working for me.


texts: Disabling Review and Photo Gallery from specific products - Magento 2

texts:
I'm looking for how to disable review field and photo gallery from some specific products.

Any suggestion?


texts: Magento 1.9.2 - How works Magento for take the value of the field VAT Number?

texts:
I'm studying the Magento process to pick the value from vat_id field and would like to ask you some questions to which I could not find an answer:

In the function public function getCustomerGroupIdBasedOnVatNumber($customerCountryCode, $vatValidationResult, $store = null) That is present in data.php, where are defined $customerCountryCode and $vatValidationResult? Where is Their origin?
How works Magento for take the value of the field "vat_id"?

Thanks for any help guys


texts: All Items Get Out Of Stock After A Certain Amount Of Time - Can't Figure Out Why?

texts:
I'm working on a website for a client and right before publishing the website, I noticed that all the products went out of stock itself. So I put them all back in stock and everything looked fine, but when I checked back after a few hours all the products were back out of stock.

I tried a few times to re-enter the stock quantities, re-index and clear the cache, but I'm still having this weird issue - everything looks fine until like 2-3 hours later everything goes out of stock.

Any suggestion what could be causing this issue?

Thanks in advance!


texts: Magento 2 - Load product, modify attribute and save it back - not working

texts:
I try to load a product by SKU, then change the weight to 7777 (for testing) and then save the product.
app\code\Company\RalSurcharge\etc\di.xml
<?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\Quote\Api\CartItemRepositoryInterface">
        <plugin name="company_ralsurcharge"
                type="Company\RalSurcharge\Plugin\RalSurcharge"
                sortOrder="10"/>
    </type>
</config>

app\code\Company\RalSurcharge\Plugin\RalSurcharge.php
(The plugin should be triggerd after adding a new product to the cart)
<?php

namespace Company\RalSurcharge\Plugin;

use \Magento\Catalog\Api\ProductRepositoryInterface;

class RalSurcharge
{
    /**
     * @var \Magento\Catalog\Api\ProductRepositoryInterface
     */
    protected $productRepository;

    public function __construct(
        ProductRepositoryInterface $productRepository,
    ) {
        $this->productRepository = $productRepository;
    }

    public function afterSave(CartItemRepositoryInterface $subject, AbstractItem $cartItem)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/zend_debug.log');
        $this->logger = new \Zend\Log\Logger();
        $this->logger->addWriter($writer);
        $this->logger->info("Hello from afterSave plugin");

        $sku = "ral-6005-surcharge";
        $product = $this->productRepository->get($sku);

        $this->logger->info("current weight");
        $this->logger->info($product->getWeight());    // 123

        $product->setWeight(7777);

        $this->logger->info("after setting weight");
        $this->logger->info($product->getWeight());    // 7777

        $product->save();
        ...

Output:
Hello from afterSave plugin
current weight
123
after setting weight
7777

First it looks like it worked and that the setting was changed to 7777,
but if I trigger the code again, then I still get the same output:
Output:
Hello from afterSave plugin
current weight
123
after setting weight
7777

Instead of
Hello from afterSave plugin
current weight
7777
after setting weight
7777


texts: Move house number from street 1 into street 0 for existing address in db - Magento 2.3.5

texts:
At the moment we use the street 1 field for the house number in our Magento 2.3.5 store.
But we want to revert this and only use 1 street field for both the street and house number.
So we need to move all values from the street 1 field after the current values into the street 0 field.
In the database it is not just a new field, its just a new line in the street column. So it seems that we just need to add it to the same line.
How can we easily and safely achieve this? Can we perform this using an sql?


texts: Magento 2: Create multi store view site in nginx

texts:
I am recently struggling creating multi store site for M2.
My problem is that i need to create a website with this structure:

store1.website.com/us/ <- Main website 1 default
store1.website.com/de/ <- Main website 1 store view
store1.website.com/es/ <- Main website 1 store view
store2.website.com/us/ <- Main website 2 default
store2.website.com/de/ <- Main website 2 store view
store2.website.com/es/ <- Main website 2 store view

Tried using store code feature in M2 but it must have a unique code. What features are there to create this kind of structure in M2?


texts: How to pass a variable to a JS widget in Magento 2

texts:
This is my script from my phtml file:

<script type="text/x-magento-init">
    {
        "*": {
            "Vendor_Namespace/js/custom": {
                "ajaxShipmentUrl": "<?php echo $block->getUrl('vendor_namespace/ajax/scanShipment'); ?>"
            }
        }
    }
</script>

I want to get the value of my ajaxShipmentUrl paramater in the custom js file.
This is the content of the custom js file:

define([ 'jquery', 'jquery/ui'],
    function ($) {
        'use strict';
        $.widget('mage.fulfillment', {
            options: {
                // Define variables
            },
            _init: function (config) {
                console.log(config);
                // ... the rest of the script
            },
     // ... the rest of the script

     return $.mage.fulfillment;
});

Is there a way to get the ajaxShipmentUrl  in my _init method  ?

Thank you


texts:
I need to export all the meta_title used for each products, categories and brands.
Magento automatically generates the meta_title when they are not set in the admin meta_title field.

I would like to know where I can find the algorithm that is used for this ?
So I could export these datas, and not empty meta_titles.

Thanks


texts: Show and Hide Product Grid in custom module Magento 2

texts:
I have created a drop down field. When I select 1 option from field I want to show the another field and along with that I want to hide product grid.
Same as when I select 2nd opinion, I want to show product grid and the field should be hide.

I have used js code. That is working fine for fields by getting field name in JS. But I don't know how do I get the Product Grid name in JS file.

Any help please..


texts: Is it possible for a global product to have store dependent custom options?

texts:
I am working on a multisite/store/storeview Magento site where we sell the same products in each substore, but need to have store dependent decoration options for each product. The product in each store must have the same SKU.

Example:

User A is in Store A, and selects product with SKU 12345. User A sees custom options for size, color, and Store A dependent decoration.

User B is in Store B and selects same product with SKU 12345. User B sees same custom options for size and color (custom options template is shared between stores), and then sees Store B dependent decoration options.

What is the best way to get this done?


texts: Magento 2 : Website Search Functionality is not Accurate

texts:
The search functionality is no longer accurate and provide irrelevant products on my Magento2.3 site.

For e.g. when one search for 'shirt' other products appear. How can this be solved so that my search gives appropriate result.


texts: How to use a Magento 1 model to update multiple rows?

texts:
I am processing some records and I need to set a datetime field to the current time for multiple rows. I have all the row IDs. What's the best way to do this with Magento 1? The SQL would be like this:

update
    my_table
set
    processed_on = "2015-09-09 11:11:04"
where
    id in(34, 56, 77, 39)


texts: magento 2 custom calendar instead of core calendar

texts:
I want to create jalaali calendar (persian calendar) instead of magento
core calendar for admin and front pages .

for this purpose I've added these lines to my requirejs-config in my module :

   'map': {
       '*': {
          'mage/calendar' : 'MyNamespace_MyModule/js/persian_calendar',
         'Magento_Ui/js/form/element/date' : 'MyNamespace_MyModule/js/form/element/date_form'

        }
    }

persian date and gregorian date are completely different and they have different years , months and days name . I want to show persian date to user but save date as gregorian format to database .

for sending gregorian date to server I changed onShiftedValueChange
 function , I do this in my custom date_form :

onShiftedValueChange: function (shiftedValue) {
        var value,
            formattedValue,
            formattedValueUTC,
            momentValue;

        // this is very simple code that check if selected date is gregorian date or persian date
        var englishYears = ["2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026",
            "2027", "2028", "2029", "2030", "۲۰۱۸", "۲۰۱۹", "۲۰۲۰", "۲۰۲۱", "۲۰۲۲", "۲۰۲۳", "۲۰۲۴",
            "۲۰۲۵", "۲۰۲۶", "۲۰۲۷", "۲۰۲۸", "۲۰۲۹", "۲۰۳۰"];
        var englishDate = false;
        for (var i = 0; i < 26; i++) {
            if (shiftedValue.indexOf(englishYears[i]) > -1) {
                englishDate = true;
                break;
            }
        }

        if (shiftedValue) {

            // if selected date was persian,I converted it to equivalent gregorian format, for converting dates I used https://github.com/jalaali/moment-jalaali library
            if (!englishDate) {
                shiftedValue = jMoment.from(shiftedValue, 'fa', 'DD/MM/YYYY HH:mm').format(this.pickerDateTimeFormat);
            }

            // the rest codes are for magento itself
            momentValue = moment(shiftedValue, this.pickerDateTimeFormat);
            if (this.options.showsTime) {
                formattedValue = moment(momentValue).format(this.timezoneFormat);
                formattedValueUTC = moment.tz(formattedValue, this.storeTimeZone).tz('UTC');
                value = this.outputDateTimeToISO ?
                    formattedValueUTC.toISOString() :
                    formattedValueUTC.format(this.outputDateTimeFormat);
            } else {
                value = momentValue.format(this.outputDateFormat);
            }
        } else {
            value = '';
        }

        if (value !== this.value()) {
            this.value(value);
        }
    }

by these code equivalent gregorian date was sent to server correctly , but
when I checking the value stored in database it's completely different and invalid , for example I sent this value : 4/14/2019 5:30 am , but magento convert it to : 0010-08-10 05:30:00 !!

I think maybe the format date in my custom date_form is different from format date in magento form php code , cause this problem , because when I changed this.outputDateTimeFormat parameter to for example : "YYYY/DD/MM HH:mm" , stored value was changed and it got valid format value ( for example : "2023-08-10 05:30:00"  ) , but still it has different value from the value has sent and they aren't equivalent.

I don't know where magento check input date and change it to incorrect value .

Does anybody know where magento check date inputes and changing them ?
Or
Does anyone have a completely different idea for this purpose ?


texts: How to override a template file in magento 2

texts:
I want to override final_price.phtml  template file located at /vendor/magento/module-grouped-product/view/base/templates/product/price/
How should i do that?


texts: How to override magento-checkout CustomerData/Cart.php?

texts:
I need some changes in CustomerData/Cart.php to have child products added  to cart displayed in minicart. Can I make this overrides inside my Theme Folder.

I would not like to have my changes smashed on core updates.

This changes reflecting the idea behind this post: Display of "Not visible individually" for a simple product in mini cart in Magento 2


texts: free shipping under £100 and on specific item

texts:
I am looking for some help, I have tried a few different ways but I cant seem to get it to work the way I want it.

I want to set up free shipping for items that are under £100 and for a specific item.

Could someone give me an example of how best to achieve this please.


texts:
I feel like I'm missing something obvious but I have some configurable products already in place and I cannot find a way to re-order the attribute dropdowns on the product details page.

Specifically, at the moment the first dropdown is the car model and the second dropdown is the car manufacturer - I need these the other way round. There are further attributes such as year too which I would like to be able to re-order.

Note, the order of items within the dropdown is not a problem, as this has been addressed elsewhere.

I'm on Magento 2.1.3.


texts: Unable to make a direct download link of downloadable product. Links return 404

texts:
I modified my list.php to get the download link button instead of "add to cart" button when I have a free download file.
I know that in this way I can't get statistic of download but for now this is not a problem.

Here my code:

<?php if(!($_product->getIsVirtual() && $_product->getFinalPrice() == 0)): ?>

<button type="button" title="<?php echo $this->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>

                            <?php else:
                            $_myprodlinks = Mage::getModel('downloadable/link');
                            $_myLinksCollection = $_myprodlinks->getCollection()->addProductToFilter($_product->getId());
                            if (sizeof($_myLinksCollection)>0):
                            foreach ($_myLinksCollection as $_link):
                            $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
                            $_linkpath = $mediaUrl."downloadable/files/links".$_link->getLinkFile();
                            ?>
                                <a href="<?php echo $_linkpath ?>" target="_blank" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('downloadable')->__('Start Download')) ?>"><button type="button" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('downloadable')->__('Start Download')) ?>" class="button btn-cart"><?php echo Mage::helper('core')->quoteEscape(Mage::helper('downloadable')->__('Start Download')) ?></button>
                            <?php
                             endforeach;
                             endif;?>
                        <?php endif;?>

This works fine! I have the button and the link has the right url like this

http://my-site.com/media/downloadable/files/links/a/u/auguri.pdf

Through FTP I have verified the presence of the file, but this link return me a 404 page.
I have read some similar topics and I tried to change the permission of folders and files, but nothing change.
Any suggestion?


texts:
I have my first orders (all sold with PayPal) but in the order view there are no buttons for invoice, ship or reorder. I cant figure out what's wrong. /app/core/ hasn't been changed.

Do you have an idea?

EDIT

I found out that if an order is on "pending payment" all buttons are shown.

EDIT 2

In the sales_flat_order-table is state on 'payment_review',but it has to be processing.


texts: Why Order Api is too slow in Magento-2.1?

texts:
When I show order history using this API

  /rest/V1/orders/mine?searchCriteria[filter_groups][0][filters][0][field]=customer_email&searchCriteria[filter_groups][0][filters][0][value]=abc@gmail.com

It take 20-30 seconds.

How to minimize response time for this API? Please Suggest me.


texts: Get products by customer segments in Magento CE 1.7

texts:
I am creating a special page only for the particular customer group..
So, Regardless of category, i need to get the products those are having exclusive price for that customer group..

I tried with the following but it's not working:

Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('customer_group_id', $groupId);

Any help would be greatly appreciated.


texts: After installing the magento 2.3 backend not work

texts:
After magento2.3 installing it give me error .Can any one help me thank you in advance

Error:
This page isn’t working .redirected you too many times.


texts:
I was going through perfomance improvement in magento 2 checkout page and I found in view source
country Id with huge country list irrespective of your admin configuration Allowed country list
the problem is I literally measured the size of that json object and its nearly 800 kb close to 1 MB

so anybody have idea to optimize this part would be appreciated
Thanks in advance


texts: Magento 2 - The linked products data is invalid. Verify the data and try again. (when related product assigned)

texts:
I am using Magento 2.3.4 and when I try to relate a product I get the message: "The linked products data is invalid. Verify the data and try again."

Any ideas on how to fix this?


texts: How to reduce Magento Product Prices reindexing time for 1M product with 5K customer group?

texts:
I'm working with magento 1.9.2 website for a manufacture company which has over 1M product (each product have 5+ customer grouping price and trier pricing) and 5k+ customer group.

I did all the basic performance measures.

Buyed a dedicated server, now website performs good except the indexes.
while reindexing 'Product Prices' takes one or more days (some times it never stopped) and pricing is not being updated properly in frontend (note: prices updated regularly through api).

So i planned to store the pricing data's to my custom table and i reflected this to frontend.
Even all the products stored all the prices (0.00) in related tables (Magento tables).

This also takes too much time to re-indexing all.

What I tried Previously?

Truncated the price related tables.

TRUNCATE TABLE `catalog_product_index_price`;
TRUNCATE TABLE `catalog_product_index_price_bundle_idx`;
TRUNCATE TABLE `catalog_product_index_price_bundle_opt_idx`;
TRUNCATE TABLE `catalog_product_index_price_bundle_opt_tmp`;
TRUNCATE TABLE `catalog_product_index_price_bundle_sel_idx`;
TRUNCATE TABLE `catalog_product_index_price_bundle_sel_tmp`;
TRUNCATE TABLE `catalog_product_index_price_bundle_tmp`;
TRUNCATE TABLE `catalog_product_index_price_cfg_opt_agr_idx`;
TRUNCATE TABLE `catalog_product_index_price_cfg_opt_agr_tmp`;
TRUNCATE TABLE `catalog_product_index_price_cfg_opt_idx`;
TRUNCATE TABLE `catalog_product_index_price_cfg_opt_tmp`;
TRUNCATE TABLE `catalog_product_index_price_downlod_idx`;
TRUNCATE TABLE `catalog_product_index_price_downlod_tmp`;
TRUNCATE TABLE `catalog_product_index_price_final_idx`;
TRUNCATE TABLE `catalog_product_index_price_final_tmp`;
TRUNCATE TABLE `catalog_product_index_price_idx`;
TRUNCATE TABLE `catalog_product_index_price_opt_agr_idx`;
TRUNCATE TABLE `catalog_product_index_price_opt_agr_tmp`;
TRUNCATE TABLE `catalog_product_index_price_opt_idx`;
TRUNCATE TABLE `catalog_product_index_price_opt_tmp`;
TRUNCATE TABLE `catalog_product_index_price_tmp`;
TRUNCATE TABLE `catalog_product_index_tier_price`;

if i truncated the above table, then the product collection not showing in frontend.

Now what i want to know?

when truncated the above tables why the products not showing?
how to avoid this issues?
where i go to remove the join query to remove the pricing related collections?

I am looking for permananet solutions for avoiding to store prices, customer prices and trier prices in magento db.

Thanks


texts: Speeding up cart to checkout and checkout save actions

texts:
I'm running several Magento CE shops and speed them up with caching, however the cart and checkout still remain slow. Does anyone have experience or tips in speeding up these pages?

Perhaps through optimizing the database?

Some queries were performed when saving an order from checkout do show up in the slow query log on the server and the database does seem to be the bottleneck.


texts: Magento get id value which is given cms block

texts:
I have created one custom banner, I have added banner block in cms home page in that place I have provided banner id.

How to get that banner id in phtml file?

{{block type="simplebanner/simplebanner" name="simplebannercmsblock" template="simplebanner/simplebanner.phtml" banner_id = "1"}}

I need to get banner id in simplebanner.phtml file

my block file having below code

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

public function getSimplebanner() {
    if (!$this->hasData('simplebanner')) {
        $this->setData('simplebanner', Mage::registry('simplebanner'));
    }
    return $this->getData('simplebanner');
}

public function getCollection() {

    $_collection = Mage::getModel('simplebanner/simplebanner')->getCollection()->addFieldToFilter('status', 1);
    return $_collection;
}


texts: numbers coming up with my quick search results? CE 1.7.0.2

texts: When I type in a search item in the search box on my store I keep having numbers coming up next to my quick search results?


texts:
I have a model which returns data to pool interface for section.
Problem is that I'm not able to get product image URL with helper in this model, it always returns placeholder thumbnail URL instead of real image URL.

This is content of my class:

use \Magento\Catalog\Model\CategoryFactory;
use \Magento\Catalog\Helper\Image;

class UpsellProducts
{

    protected $categoryFactory;
    protected $imageHelper;

    public function __construct(
        CategoryFactory $categoryFactory,
        Image $imageHelper
    ) {
        $this->categoryFactory = $categoryFactory;
        $this->imageHelper = $imageHelper;
    }

    public function getCategory($id)
    {
        $category = $this->categoryFactory->create()->load($id);

        return $category;
    }

    public function getProductsCollection($id)
    {
        $r = array();
        $products = $this->getCategory($id)->getProductCollection()->addAttributeToSelect('*')->setPageSize(3);

        $products->getSelect()->orderRand();

        $products->load();

        $image = 'product_small_image';// or 'category_page_list';

        foreach ($products as $product) {
            $r[] = $product->getData();
            $r['image'][] = $this->imageHelper->init($product, $image)->getUrl();
        }

        return $r;
    }

    public function getUpsellProducts()
    {
        //        @TODO category id from BE config
        $t = $this->getProductsCollection(876);

        return $t;
    }
}

I'm using default Image helper and loading 3 random products from category, when I try to get image for this product, I get thumbnail placeholder URL instead of product image.


texts:
I've installed Magento 2.3 on my server. Currently I am trying to activate cron, but unfortunately I always get the same notice when I try to install and run it.

Error during saving of crontab: sh: line 6: crontab: command not found

I've already googled some answers, but it didn't allow me to fix the problem.

I would be really grateful if some of you could help me.


texts: magento 2 configurable product image does not update completely

texts:
I have a configurable product (sub-product A,B and C) with each assigned with different color image gallery.

I expected the image gallery will auto switch according to which color is selected in frontend. But to find that only the first image in a color specified gallery can display.

The rest in the each gallery are ignored. I want to display all images specified for child when they are selected in store front

Does anyone notice about this issue or have any work around for it? thanks.


texts: Magento 2 get specific customer group customers list

texts:
I have created a custom module and want to get specific customer group users to list in the dropdown.

For this I have gone through the admin > Stores > Other Settings > Customer Groups and I have created a customer group named ex. XYZ Customer. Assigned some users to XYZ Customer group.

Now, I want to list all the user who belongs to the XYZ customer group. How I can list all the users in the custom dropdown.

See below is my custom block code:

<?php
namespace Vendor\Mymodule\Block\Adminhtml\Order\View;

class Custom extends \Magento\Backend\Block\Template
{
    protected $customerCollectionFactory;

    public function __construct(
     \Magento\Backend\Block\Template\Context $context,
     \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerCollectionFactory,
      array $data = []
    ){  $this->customerCollectionFactory  = $customerCollectionFactory;

        parent::__construct($context, $data);
    }

    public function getCustomerCollection()
    {
        $collection = $this->customerCollectionFactory->create();
        $collection->addFieldToFilter("group_id","4");
        $options = [];
        //echo '<pre>'; print_r($collection); die;
        foreach ($collection as $driver) {
        $options[] = ['label' => $driver->getFirstname()." ".$driver->getLastname(), 'value' => $driver->getEntityId()];
        }
        //echo '<pre>'; print_r($options); die;
        return $options;

    }
}

Guys help me out this issue. Thanks


texts: Magento: add button on order view page with custom module

texts:
I want to add a button on the Order View page of the Admin.

I created a custom module in app\code\community\CPT\TCS and added subfolders Block, controllers, etc, Helper, Model, sql

This is my CPT_TCS.xml file in app\etc\modules\

CPT_TCS.xml:

<?xml version="1.0"?>
<config>
     <modules>
        <CPT_TCS>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Mage_Adminhtml />
            </depends>
        </CPT_TCS>
     </modules>
</config>

This is my custom module's etc\config.xml:

<?xml version="1.0" ?>
<config>
  <modules>
    <CPT_TCS>
      <version>
        1.0.0
      </version>
    </CPT_TCS>
  </modules>

  <blocks>
    <cpttcs>
      <class>CPT_TCS_Block</class>
    </cpttcs>
    <adminhtml>
      <rewrite>
        <sales_order_view>CPT_TCS_Block_Adminhtml_Sales_Order_View</sales_order_view>
      </rewrite>
    </adminhtml>
  </blocks>
</config>

Now I've added view.php in TCS\Block\Adminhtml\Sales\Order\

<?php
class CPT_TCS_Block_Sales_Order_View extends Mage_Adminhtml_Block_Adminhtml_Sales_Order_View
{

    public function __construct() {

        //parent constructor
        parent::__construct();

        //create URL to our custom action
        $url = Mage::helper("adminhtml")->getUrl(
            "CPT_TCS/order/doSomething",
            array('order_id'=>$this->getOrder()->getId())
        );

        //add the button
        $this->_addButton('cygtest_resubmit', array(
                'label'     => Mage::helper('sales')->__('Send TCS'),
                'onclick'   => 'setLocation(\'' . $url . '\')',
                'class'     => 'go'
        ));

    }

}

The "Send TCS" button is not showing on order view page (this "Send TCS" button should ultimately send data order data on web service).

What can be wrong here?


texts: Redirection issues of cart and wishlist when remove item in magento 1.9?

texts:
I have an issue like, I have multiple items in cart or wishlist but once I remove any item from it, it will redirect to Home Page not on the same page (This issue will occur on my live site).

But On my Local server it is working fine when I remove any item I will redirect me to cart page again not on home Page.

Why this happens?


texts: Show only assigned attribute options in advanced search form Magento 2

texts:
i am trying to change the advanced search form layout. I need the multiselect attributes to be shown as dropdown and only assigned options needed to show in it.
First task sucessfully done by overriding the form.php block, created a new method getAttributeSelectddElement and now instead of multiselect,it will show dropdown.
public function getAttributeSelectddElement($attribute)
    {
        $extra = '';
        $options = $attribute->getSource()->getAllOptions(false);

        $name = $attribute->getAttributeCode();

        if (is_array($options)) {
             array_unshift($options, ['value' => '', 'label' => __($attribute->getFrontendLabel())]);
        }

        return $this->_getSelectBlock()
            ->setName($name)
            ->setId($attribute->getAttributeCode())
            ->setTitle($this->getAttributeLabel($attribute))
            ->setExtraParams($extra)
            ->setValue($this->getAttributeValue($attribute))
            ->setOptions($options)
            ->setClass('multiselect')
            ->getHtml();
    }

Also some html works done, so that advanced search form will look like this. See now its showing as dropdown instead of multiselect.

Now i need to customize the getAllOptions to fetch only the assigned options. By default it will return all created options of a particular attribute. What i need is only those options which are assigned to atleast one product only to be shown.
I have tried it with no success, could anyone got any idea on this. Please advise.


texts: How to save custom image in database table using REST Api in magento 2?

texts:
How to save custom image coming from third party platform to save into magento 2 custom table.

I have just created REST api for my requirements.

I passed image in base_64 encoded string from Thirdparty platform and i got those image base_64 encoded string in magento 2.

But i dont know how to save image from base_64 encoded string into my custom table. what is the procedure for this event.

Any help will be appericiated.

Thanks.


texts: Customer Search by email does not work in REST API

texts:
I have a list of customers that I am trying to pull data for all at once. I build a search filter with the contion_type="like", field="email", and value="gmail.com". i got no result but in admin having customers
   $url = "https://magentourl/";
$accessToken = "token";
$setHeaders = array('Content-Type:application/json', 'Authorization:Bearer ' . $accessToken);
$api = "rest/V1/customers/search";

$json = '
{
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "email",
                        "value": "gmail.com",
                        "condition_type": "like"
                    }
                ]
            }
        ],

    }
}
';
$j = json_decode($json);
$get_params = http_build_query($j);
$customername = "gmail.com";

//$requestUrl = $url.'index.php/rest/V1/customers/search?searchCriteria[filterGroups][0][filters][0][field]=email&searchCriteria[filterGroups][0][filters][0][value]=%&searchCriteria[filterGroups][0][filters][0][condition_type]=like&searchCriteria[page_size]=10';
$requestUrl = $url.'index.php/rest/V1/customers/search?'.$get_params;
echo $requestUrl;
$ch = curl_init($requestUrl);
 curl_setopt($ch, CURLOPT_HTTPHEADER, $setHeaders);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 $result = curl_exec($ch);

//decoding result
 $result= json_decode($result);

//printing result
 echo "<pre>";print_r($result);

if i give full email address it working
can any one tell me email filter gmail.com or any with like.


texts:
We want to hire a developer for our current Magento Go site, which we have to now migrate out of.

We want to give them access such that they do not have control over the shop w logins etc, but yet, can do the coding to the site. Is there a way to give that kind of limited access without giving them control of the account? We don't want them to lock us out.

Thanks so much for your thots.

or, what are the options for access to a Magento go account?


texts: Automatically changing order status to complete for admin orders

texts:
I need a way to set the order status automatically to completed when the order is created in admin and payment method is one of the two possibilities for admin orders. In this case it is unnecessary step to create invoice and shipment.

Already tried this, but could not get it to work:

http://www.atwix.com/magento/auto-invoice-and-custom-order-status-upon-checkout/


texts: Config.php - Order in which modules are listed

texts:
Does the order in which modules are mentioned in app/etc/config.php matter for Magento 2?

I have looked closely at the code, but could not find any logic to the sorting of the modules. I know the config.php file is auto-generated.

Now assume that we manually edit the file (which you shouldn't do normally), does the order in which the modules are placed matter?

There is also a ticket on Github that relates to this, but I cannot tell what the current situation is with regards to the sequence being important or not:

https://github.com/magento/magento2/issues/8479


texts: Magento Place order give undefined alert box

texts:
Recently I have upgrade my Magento store from 1.3 to 1.8. I fixed almost errors. Now am facing a strange issue in the last step of the check out. When I click the place order button I get an undefined alert and nothing happens after that.

Somebody told me to alert transport.responseText on skin/design/frontend/package/theme/js/opcheckout.js to show the errors.

But I can't get any error in this alert. It just contains an html code of the check out page.

Anybody know what is the issue here.


texts: Page link to the navigation bar with changing contents

texts:
I found how to add a page link to the navigation bar, but it seems that I can put static contents in the page like if you want to change it, you have to do it by yourself if the panel admin.

What I want it's, for example, a link "new products" in the navigation bar and the page associated show the last 10 new products added and those products change while new products are add.

Is it possible to do something like that ? And how ?


texts:
We have an online store in Magento 2, and we need to calculate prices according a price table like this.

The product page has two text fields where users type their measures. After they type the height and length we need find out what price is the correct for that measure.

In the image table, the price on green corresponds to any height value between 1.61 and 1.80 and any length value between 1.51 and 1.60

I have to mention that prices in the table are not linear prices, so it's impossible to calculate them in any way.

So... is there any known magento extension to make it work? How would you do it?

Thanks in advance.


texts:
Is there a recommended tool for linting LESS code in Magento2? Interestingly, ESLint Rules are provided for Javascript linting, but when it comes to LESS, all they seem to provide is a coding standard...
I've tried using grunt-eslint, but it seems outdated (last commit was in 2017, and skeptical of its accuracy). There are some errors for example in my tiny starter theme complaining about missing variables, but when I run the LESS compiler it compiles just fine... Not to mention some smaller issues.
So what do folks use when it comes to linting LESS code for M2 projects?


texts: Magento 2 reindex returns No such entity

texts:
I have successfully migrated the catalog from Magento 1.9.2.3 to Magento 2.0.2.
After the migration, I did reindex using the command php bin/magento indexer:reindex.

All is reindexed successfully, except indexes catalog_category_product and catalog_product_category, returning No such entity. in shell and notification Reindex Required in admin.
I've checked var/log/ but no errors.

As a result, products are added to categories in the backend but categories show up empty on the frontend.

What might cause this problem?
How can I debug?


texts: Python requests: Unable to unserialize value. Error: Syntax error

texts:
My situation

I have tried this request on postman and it work perfectly.
I use python requests
I want to get admin token from code below

import requests
import json

url = '<URL host>/rest/V1/integration/admin/token'
headers = {
    'Content-Type': 'application/json',
}
body = {
    "username": "username",
    "password": "p@ssword_contain_special_character"
}

response = requests.post(url, data=body, headers=headers).json()
print(response)
print(response['message'])

error I recieved
Decoding error:
Unable to unserialize value. Error: Syntax error
#0 /var/www/html/vendor/magento/framework/Webapi/Rest/Request/Deserializer/Json.php(64): Magento\Framework\Serialize\Serializer\Json->unserialize('username=wsuser...')
#1 /var/www/html/vendor/magento/framework/Webapi/Rest/Request.php(141): Magento\Framework\Webapi\Rest\Request\Deserializer\Json->deserialize('username=wsuser...')
#2 /var/www/html/vendor/magento/framework/Webapi/Rest/Request.php(199): Magento\Framework\Webapi\Rest\Request->getBodyParams()
#3 /var/www/html/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(97): Magento\Framework\Webapi\Rest\Request->getRequestData()
#4 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()
#5 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->___callParent('resolve', Array)
#6 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->Magento\Framework\Interception\{closure}()
#7 /var/www/html/generated/code/Magento/Webapi/Controller/Rest/InputParamsResolver/Interceptor.php(26): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->___callPlugins('resolve', Array, Array)
#8 /var/www/html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(85): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->resolve()
#9 /var/www/html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))
#10 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#12 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#13 /var/www/html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#14 /var/www/html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#15 /var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#16 /var/www/html/vendor/magento/framework/App/Bootstrap.php(261): Magento\Framework\App\Http\Interceptor->launch()
#17 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#18 {main}


texts: Magento 1.9 - SQL for pulling un-categorized products + Product name

texts:
I am using a simple sql to find out what products still need to be categorized...

the SQL...

  SELECT e.entity_id, e.sku FROM catalog_product_entity AS e LEFT JOIN catalog_category_product AS l ON l.product_id = e.entity_id WHERE l.category_id IS NULL

however im a little dumbfounded on how to add the actual product name...
i tried...

  SELECT e.entity_id, e.sku, e.name FROM catalog_product_entity AS e LEFT JOIN catalog_category_product AS l ON l.product_id = e.entity_id WHERE l.category_id IS NULL

however it failed. saying unknown column on e.name


texts: Capture payment from invoice create and view from admin

texts:
I would like to capture payment from invoice create or view from admin dashboard.

So i have tried calling payment method block that is called when order create from admin area but it always say No payment information required

So how can i show payment method block on invoice create and invoice view to capture payment from online gateway like creditcard etc...

This BLock


texts: What would be the best approach to A/B test guest/sign-in checkout?

texts:
It would be wonderful to be able to get some concrete statistics to prove that providing a guest checkout feature can really help increase conversion.

Does anybody have a good method for A/B testing in Magento that will allow for presenting:

Checkout requiring sign in to pay (to A)
Checkout with ability to pay as guest, with option to sign in (to B)


texts:
In a module, I need to deal with Order Items.

I know how to get items from Order:

$order = $this->_order->load($order_id);
$items = $order->getAllItems();

But I would like to retrieve the item using its ID, something like:

$item = $order->getAllItems()->filterById($item_id);

But it doesn't seem to work.


texts:
I added

  https://www.facebook.com/sharer/sharer.php?u=&t=', 'facebook',
  'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');"
  title="__('Share on Facebook') ?>">Facebook

for product share on facebook. Everything works fine but image not showing.


texts: How to customize top header links in magento 2

texts: Hello guys i am working with magento 2.1.3 and i want to customize the top header links of my magento ecommerce store. Anybody help this poor guy.


texts:
I've developed a new payment module for Magento. It works perfectly on the dev box, but when deployed to "Test" it behaves weirdly.
Basically Magento tries to redirect to "<~>/index.php/admin/mypaymentmodule/processing/redirect/".
What I don't really understand is why "/admin" is added. It doesn't happen in other environments where I tested the module.

Any idea?

Thanks!

[UPDATE]

The wrong redirect happens when the order is placed. This is how it has been implemented:

    public function getOrderPlaceRedirectUrl()
    {
        $goToUrl = Mage::getUrl('s2s/processing/redirect');

        return $goToUrl;
    }

It seems it get redirected twice. The first time it goes to /s2s/processing/redirect. I then receive a 302 (I don't know why) and Magento redirect to /index.php/admin/s2s/processing/redirect...

I've also tried to insert a DIE() in the redirect action of s2s controller, but it never gets there.

I suspect it is requiring admin access for some reason... but why? and why does this happen only on this Test server (not on the dev box!)?

Thanks again for your help!

[UPDATE 2]

I think my issue is somehow similar to this one: http://www.verious.com/qa/action-ajax-call-in-magento-response-302-need-admin-login/

But my controller extens Mage_Core_Controller_Front_Action already....

[UPDATE 3]

I've found out that the Redirect method is invoked.
The issue happens when trying to create a Block, and I don't understand why.

This is the line:
      $this->getResponse()->setBody($this->getLayout()->createBlock($this->_redirectBlockType)->setOrder($order)->toHtml());

I've overridden the Block constructor in order to check if it gets called:
      public function _construct()
    {
        exit("REACHED!");
        parent::_construct();
    }

And I've found out it never gets there. The createBlock fails... why?


texts: Magento 2.2.8 cannot find custom email template : Template file 'back_in_stock.html' is not found

texts:
I'm creating an extension which sends email from command console and / or cron.

https://github.com/DominicWatts/BackInStock/tree/develop

In https://github.com/DominicWatts/BackInStock/blob/develop/Helper/Data.php#L168-L226

I've got this

const XML_PATH_EMAIL_TEMPLATE = 'backinstock/email/template';

    public function sendTransactionalEmail($vars = [])
    {
        $email = $vars['email'] ?? null;
        if (empty($vars) || !$email) {
            return;
        }
        $this->inlineTranslation->suspend();
        try {
            $postObject = new \Magento\Framework\DataObject();
            $postObject->setData($vars);

            $recipient = [
                'firstname' => $this->escaper->escapeHtml($vars['firstname']),
                'email' => $this->escaper->escapeHtml($vars['email']),
            ];

            $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;

            $this->transportBuilder->setTemplateIdentifier(
                $this->scopeConfig->getValue(
                    self::XML_PATH_EMAIL_TEMPLATE,
                    $storeScope
                )
            )->setTemplateOptions(
                [
                    'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
                    'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                ]
            )->setTemplateVars(
                [
                    'firstname' => $vars['firstname'] ?? null,
                    'lastname' => $vars['lastname'] ?? null,
                    'email' => $email,
                    'productname' => $vars['productname'] ?? null,
                    'productlink' => $vars['productlink'] ?? null
                ]
            )->setFrom(
                $this->scopeConfig->getValue(
                    self::XML_PATH_EMAIL_IDENTITY,
                    $storeScope
                )
            )->addTo(
                $recipient['email'],
                $recipient['firstname']
            );

            $transport = $this->transportBuilder->getTransport();
            $transport->sendMessage();
            $this->inlineTranslation->resume();

            return true;
        } catch (Exception $e) {
            $this->logger->critical($e);
        }
        return false;
    }

https://github.com/DominicWatts/BackInStock/blob/develop/etc/email_templates.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="backinstock_email_template" label="Back In Stock" file="back_in_stock.html" type="html" module="Xigne_BackInStock" area="frontend"/>
</config>

Email template is in place

https://github.com/DominicWatts/BackInStock/blob/develop/view/frontend/email/back_in_stock.html

Then with some dummy data in I try and run

php bin/magento xigen:backinstock:check check

2019-07-08 23:15:04 Start Notification Process

  [UnexpectedValueException]
  Template file 'back_in_stock.html' is not found.

xigen:backinstock:check <check>

So that says to me my XML and logic is correct.

Magento is just not seeing my email template.  Trouble is I just can't see what's wrong. Path looks correct.

Tried clearing cache, di compile, setup upgrade.


texts:
how can I fix the following errors in the console

ReferenceError: Itoris is not defined

eferenceError: Varien is not defined

TypeError: this.each is not a function

thanks


texts: Can Magento 2 use manufacturer to require min product?

texts:
I try to create an ecommerce with products of many company.

For the same manufacturer I must sell to groups of 6 pieces of different products.

Is possible it?7

Thanks
Daniele


texts: How to get quote id by customer ? Magento2

texts:
I use this way

$cartId = $this->_cart->getQuote()->getId();

but it works when the customer is logged in.
How can I get it and then when the customer hasn't logged in ?


texts: Manage option value of attribute option disappears

texts:
I have an attribute named as Product_type.
Catalog > Manage attributes > Attribute Name(Product_type) >
Manage Labels/Options >
Manage Options (values of your attribute)
When I choose Use In Layered Navigation to Filterable(with results) in frontend properties,then
in Manage Options (values of your attribute) value of some attributes disappears.Whenever I click on save and continue edit different values disappears each time.I have almost 600 values as attribute option.
PFA


texts:
I try to display list of products with the widget ProductsList, without success.

I have the following code :

$block = $this->_view->getLayout()->createBlock('\Magento\CatalogWidget\Block\Product\ProductsList');
$condition = [
   '1' => [
       'type' => \Magento\CatalogWidget\Model\Rule\Condition\Combine::class,
       'aggregator' => 'all',
       'value' => '1',
       'new_child' => '',
   ],
   '1--1' => [
       'type' => \Magento\CatalogWidget\Model\Rule\Condition\Product::class,
       'attribute' => 'sku',
       'operator' => '==',
       'value' => 'my_sku',
   ]
];
$conditionEncoded = $this->conditionsHelper->encode($condition); // conditionsHelper = \Magento\Widget\Helper\Conditions
$block->setConditions($conditionEncoded);
$block->toHtml();

Currently, I only try to display 1 sku, but at the end, I want to display a list of sku.
However, $block->toHtml(); return empty and I din't get any error.

Then, I try to debug :

$block->toHtml() call protected function _beforeToHtml() in ProductList.php.
In this function, we have $this->setProductCollection($this->createCollection());
In createCollection, I display the $collection->getSelect()->__toString(). This request is good and return my sku.
So why nothing is displaying with ->toHtml() ?

Do you know where can I get a documentation about how to create this $condition ?


texts: What (type of) classes are generated in Magento 2?

texts:
In Magento 2 there are a set of classes that are generated automatically and stored in var/generation and they are used in the core code.
While trying to create a custom module by replicating one of the core modules I saw that also for my module there are some generated classes.
In the generated classes I've seen proxys, interceptors, factories....

Is there a complete list of classes or type of classes that are auto generated?
And as side question...when/where are they generated?


texts:
I want to validate text field to numeric or not in UI form.

<column name="sortorder">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" translate="true" xsi:type="string">SortOrder</item>
            <item name="editor" xsi:type="array">
                <item name="editorType" xsi:type="string">text</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">false</item>
                </item>
            </item>
        </item>
    </argument>
</column>

Can anyone provide list of validation in UI form in

<item name="validation" xsi:type="array">
    <item name="required-entry" xsi:type="boolean">false</item>
</item>


texts:
I have created a cart price rule which contains specfic coupon and percentage of product price discount(10%).

How to checkflow of Magento apply these rule.


texts: How to debug that tax_class_id gets overwritten

texts:
How can we debug or reproduce the following problem:

We noticed that the tax_class_id of almost all products (96%) get reset to 0 so we mass updated the tax class of the products back to normal. The next day it was reset to 0 again. We started monitoring the attribute value with the following query:

select count(*)
from catalog_product_entity_int
where value = 0
  and store_id = 0
  and attribute_id = (select attribute_id from eav_attribute where attribute_code = 'tax_class_id')

Due to the monitoring we figured out that this reset starts at 02:00 AM and continues for 3 hours until almost all products tax class is set to 0.

This behavior occurs on our testing instance as well at the same time but less products are affected (20%).

What we did so far:

Our first thought was that it might be a cronjob that is causing the problem because it occurs every day at the exact same time. So I checked cronjobs running on the server but we only have the Magento cronjobs running and of them no one runs at 02:00 AM.
We thought it might be due to our import via the rest api but we have a rest logging active and this is not affecting it. On the import the correct tax_class_id is pushed to Magento and Magento returns the correct value. As well the import runs later.
We thought maybe someone acquired access to the admin backend or server so we checked our access logs but there are no abnormalities.
I checked the Magento logs but I didn't find anything that could lead to a clue.
I checked our custom modules whether we overwrite the tax_class_id somewhere but we don't.

Is there any way to debug this behavior?


texts: Magento 2.2.4 - Unable to overwrite Core Module Translations files

texts:
Here, I want to overwrite below csv file using the custom theme

(without creating separate modules)

It's should not take data from core CSV file.

vendor/amzn/amazon-pay-and-login-magento-2-module/src/Core/i18n/en_US.csv

Core Translations

  "Back","Back to register or connect an account"

Need To Overwrite

  "Back", "Back"


texts: Magento 2: Sort category page collection by custom attribute

texts:
I need to sort the product collection in category page by a custom attribute inventory_status. The attribute is of type int. I need to add the sort with the existing sorting applied.
For example, if the products are sorted according to Bestseller, then there is already an ORDER BY in the collection query. With this order by, I need to add another order by according to inventory_status
I created a before plugin on load method of Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection but here the custom attribute is not coming in the select query.
public function beforeLoad(\Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $subject, $printQuery = false, $logQuery = false)
{
    // $orderBy = $subject->getSelect()->getPart(\Zend_Db_Select::ORDER);
    $outOfStockOrderBy = array('inventory_status ASC');
    /* reset default product collection filter */
    $subject->getSelect()->order($outOfStockOrderBy);

    return [$printQuery, $logQuery];
}

Edit:
The custom attribute values are coming for each product, but adding the sort order according to the custom attribute is not changing the product results. There is already sorting applied to the products based on bestseller attribute.


texts: Magento 1.9 API - how to get sales of product from orders?

texts:
Trying to get some information about products sales based on SKU.
How can I do it ?

Do I have to pull all data orders then loop it trough or can I ask for sale of specified product directly ?

What I would like to achieve is: how many of SKUXXXX was sold within last month.
Is it possible via API ?
(hope it is)