texts:
I cannot find any information regarding category import in magento 2. Installing the merchant-beta version I found: advanced pricing, products and customer import options, but nothing for categories.

I tried ubertheme data migration tool but it seems is not supported to migrate thousands of categories. any reference or help appreciated.

UPDATE:

I tried the magento data migration official release recommended by @Mage2.PRO but the following problem appear when installing.


texts: How to get Custom Swatch images on product list and view page in magento 1.9

texts: i am not able to get assigned image from brand attribute,image showing image that is assigned to attribute value.


texts:
Can Magento handle configurable swatches functionality?
I have two products with different attributes. A product goes through different situations, let me explain it:

First attribute is size with options of 1 2 3 and second attribute is color with options of 4 5 6. My first product is size 1 with color 4 and second product is size 2 with color 5. Can Magento disable other options as I click on size 2 and just show me color 5 only in product page?


texts: Working on Content Security Policies in Magento 2

texts:
I created a custom module(Module_Csp) for Content Security Policy in Magento 2. I create a config.xml file and csp_whitelist.xml file in /etc folder.
I check this module on staging server. But it shows Error 502 Bad Gateway error.
config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <csp>
            <mode>
                <storefront>
                    <report_uri></report_uri>
                    <report_only>1</report_only>
                </storefront>
                <admin>
                    <report_uri></report_uri>
                    <report_only>1</report_only>
                </admin>
            </mode>
        </csp>
    </default>
</config>

csp_whitelist.xml
<?xml version="1.0"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd">
    <policies>
        <policy id="style-src">
            <values>
                <value id="maxcdn" type="host">*.bootstrapcdn.com</value>
            </values>
        </policy>
        <policy id="script-src">
            <values>
                <value id="ajax" type="host">*.cloudflare.com</value>
                <value id="cloudfront" type="host">*.cloudfront.com</value>
                <value id="googletagmanager" type="host">*.googletagmanager.com</value>
                <value id="gstatic" type="host">*.gstatic.com</value>
            </values>
        </policy>
        <policy id="connect-src">
            <values>
                <value id="paypal" type="host">*.paypal.com</value>
                <value id="googleadservices" type="host">*.googleadservices.com</value>
            </values>
        </policy>
        <policy id="font-src">
            <values>
                <value id="maxcdn" type="host">*.bootstrapcdn.com</value>
                <value id="gstatic" type="host">*.gstatic.com</value>
            </values>
        </policy>
    </policies>
</csp_whitelist>

Can any one have any idea for this issue?


texts: Hi i was wondering if it is possible to have interaction between opencart and magento stores. We currently are working on a magento store for our website and our supplier is going over to opencart. Our supplier only uses a in stock and out of stock status and we would like to have their status showing on our website as well. I am just curious if such a thing is possible since this will safe our support staff time.


texts:
Hi Magento developers...

I'm having a bit of trouble with my new module. I created a simple module for people leaving their basket, without buying. I register every item put in the basket nice, with the observers in Magento. I then have a cron job running every minute and checking if a user has been inactive for 20 min. Then it send an email with a reference to a token in the database and here comes my failing bit.

I'm calling something like: www.domain.tld/add-to-basket?token=some_hash

I then retrieve all items from my database, with that token nothing hard here. But when I want to add then to the current guest cart it fails. I have searched the web thin and have come up with this.:

$session = Mage::getModel('checkout/session');
$quote = $session->getQuote();
$quote->setStoreId(1);

foreach($entries as $entry){
    $quantity = $entry->getQuantity();
    $productId = $entry->getProductId();
    $product = Mage::getSingleton('catalog/product')->load($productId);
    $quote->addProduct($product, new Varien_Object(['qty' => $quantity]));
}

$quote->setTotalsCollectedFlag(false);
$quote->collectTotals();
$quote->save();

Info:

I'm using oneStepCheckout
Sometimes it works
No exceptions are thrown (the code is wrapped in a try/catch)
Have been debugging all the way (no errors or mystically values)

Maybe:

I think that the problem is, that the cart has not been initialized properly, when I try to add stuff to it, but I can't seem to find a solution for that.

Hope you can help.

// Ulrik


texts: custom select type customer attribute not showing magento2

texts:
I am trying to create a custom select type of customer attribute for admin only. When I am running my upgradeData script, Its running fine and attribute created in the database, but not showing in admin customer form.

But If I am creating a text field instead of a select field then that showing fine at admin customer form.

Here is my code -

namespace Mynamespace\Mymodule\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;
use Magento\Customer\Model\Customer;
use Magento\Customer\Api\CustomerMetadataInterface;

class UpgradeData implements UpgradeDataInterface
{
    private $eavSetupFactory;
    protected $eavSetup;

    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig,EavSetup $eavSetup)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig       = $eavConfig;
        $this->eavSetup = $eavSetup;
    }

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        if (version_compare($context->getVersion(), '1.0.3', '<')){
            $this->eavSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, 'customer_reseller_id');

            $this->eavSetup->addAttribute(
                CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
                'customer_reseller_id',
                [
                    'type'      => 'int',
                    'label'     => 'Reseller',
                    'input'     => 'select',
                    'backend'   => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                    'source'    => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
                    'required'  => true,
                    'visible'   => true,
                    'user_defined' => true,
                    'position'  => 160,
                    'sort_order'=> 160,
                    'system'    => false
                ]
            );

            $customAttribute = $this->eavConfig->getAttribute(
                CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
                'customer_reseller_id'
            );

            $customAttribute->setData(
                'used_in_forms',
                ['adminhtml_customer']
            );

            $customAttribute->save();
        }
    }
}

Please let me know what I am doing wrong?

Thanks


texts: Magento 2.1 braintree credit card error handling

texts:
In Magento 2, I am using brain-tree credit card payment method on live site. Sometimes it shows error,
unable to place an order, please try after sometimes
but I want to know exact error on front end side about that transaction declined. I want error handling for Braintree credit card payment so that it makes easy to know the reason behind failed payment.


texts:
I am working on a customization of the checkout page in M2, in particular I am trying to add to the 'discount' section of the page. In this part of the page I need to call a third party javascript library once the html template has loaded.

I have looked into knockout lifecycle events, however they are unavailable, because they are 3.5.0, and KO version in M 2.3.1 is 3.4.2.

Now I am looking into adding a custom binding, and hoping to add the call to the third party lib in the init method.

My code looks roughly like this:

/app/code/Company/Module/view/frontend/web/js/view/payment/discount.js

define([
    'jquery',
    'ko',
    'uiComponent',
    'Magento_Checkout/js/model/quote',
    'Magento_SalesRule/js/action/set-coupon-code',
    'Magento_SalesRule/js/action/cancel-coupon',
    'certificateInfo',
    "setCertificateInfo",
    "cancelCertificateInfo",
    'Magento_Checkout/js/model/error-processor',
    'Magento_SalesRule/js/model/payment/discount-messages',
], function ($, ko, Component, quote, setCouponCodeAction, cancelCouponAction, certificateInfo, setCertificateInfo, cancelCertificateInfo,errorProcessor, messageContainer) {

    ko.bindingHandlers.myBinding = {
        init: function(element, valueAccessor, allBindingsAccessor, data, context) {
            // Call third party lib here
        }
    }
});

/app/code/Company/Module/view/frontend/web/template/payment/discount.html

<p data-bind="myBinding: blah">
  <!-- Markup that needs to have 3rd party call to work... -->
</p>

All that is happening is an error on the page

[ERROR] Failed to load the "Company_Module/js/view/payment/discount" component.

Any idea what I am doing wrong with custom binding, or a different way to achieve my goal?


texts: How get row from sales_order_item table by item_id in Magento 2?

texts:
How get specific row from  sales_order_item by giving item_id?
Which collection use to filter row?
Can anyone guide me ? has any direct or indirect way to fetch sales_order_item record from item_id?


texts: How to export products in Magento 2 in XML format

texts: I am trying to export products from Magento in an XML format rather than CSV. I know there are modules that can do this, but I am trying to learn to do things in Magento 2 for myself. Was wondering if there was code I could add to the backend to add XML as an export format?


texts: invalid date when adding product with custom options(datetime) using REST API

texts:
I have a product with a custom option DateTime filed in product options

When I try to place an order using rest API.  My order  array is given below

$order = array (
  'cartItem' =>
  array (
    'sku' => $product_sku,
    'qty' => 1,
    'quote_id' => $cart_id,
    'product_option' =>
    array (
      'extension_attributes' =>
      array (
        'custom_options' =>
        array (
          0 =>
          array (
            'option_id' => '1',
            'option_value' => '2020-10-15 13:00:00',
          )
      ),
    ),
  ),
    ),
);

My cart response is given below

"{"item_id":4,"sku":"Jessica Pant","qty":1,"name":"Jessica Pant","price":169,"product_type":"simple","quote_id":"3","product_option":{"extension_attributes":{"custom_options":[{"option_id":"1","option_value":"2020-10-16 01:00:00"}]}}}"

As you can see i have set custom option value(datetime) as '2020-10-15 13:00:00' in code. But after execute add to cart API code. the date changed to "2020-10-16 01:00:00"

Expected result (*)
"{"item_id":4,"sku":"Jessica Pant","qty":1,"name":"Jessica Pant","price":169,"product_type":"simple","quote_id":"3","product_option":{"extension_attributes":{"custom_options":[{"option_id":"1","option_value":"2020-10-15 13:00:00"}]}}}"
Actual result (*)

"{"item_id":4,"sku":"Jessica Pant","qty":1,"name":"Jessica Pant","price":169,"product_type":"simple","quote_id":"3","product_option":{"extension_attributes":{"custom_options":[{"option_id":"1","option_value":"2020-10-16 01:00:00"}]}}}"
My  Magento ver. 2.3.4-p2


texts:
Having trouble fixing the errors that come up in the console.

js.js shows me this:

Validation.addAllThese([
['validate-custom', ' ', function(v,elm) {
    return elm.validate();
}]

]);

form.js takes me to this piece of code:

this.validator  = new Validation(this.form);

and prototype.js showes me following:

function klass() {
  this.initialize.apply(this, arguments);
}

however when I click on index error it shows me the newsletter subscription form:

var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');

It does look like there is the problem with subscription form and indeed when I remove it error is not showing up, but I'm having trouble fixing it.

My jQuery is the first that loads and then its followed by all other js libs.
Currently I don't have noConflict implemented and not sure if that could be the problem, but I've tried many different ways of adding noConflict and it still didnt solve the issue.

Can someone please advise what could this error be related to?
Thanks in advance guys!


texts:
I have made a little bit of code to show product that are on sale on the cart page but it is not displaying the sale price only the original.

This is the code that im using to show the price.

<?php echo Mage::helper('core')->formatPrice($_product->getPrice());?>

So the question is how can i change it so it shows the sale price if there is one?

Thank you

///////////ADDED////////

<?php
$special_price = Mage::helper('core')->formatPrice($_product->getSpecialPrice());
$norm_price = Mage::helper('core')->formatPrice($_product->getPrice());?>
<?php if ($special_price){
 echo $special_price;
} else {
 echo $norm_price;
} ?>

Thanks again


texts: How to override Magento 2 core files example?

texts: How to override Magento 2 core files explain here.


texts: How to add from & to date filter in magento script?

texts:
Here is what i have tried
 $orderItem = Mage::getModel('sales/order_item')->getCollection();
    $orderItem->getSelect()
        ->joinInner(array('order' => Mage::getSingleton('core/resource')->getTableName('sales/order')), 'order.entity_id = main_table.order_id')
        ->where("order.created_at >= ?" AND "order.created_at <= ?", '2020-08-23' , '2020-08-25');

print_r(array_unique($orderids));

I am not getting proper data using the above code for "from & to" filter,
Any thoughts on this ?


texts:
There are lots of tutorials/manuals/forums for setting up a cron in Magento. I even asked a question (here)  before, which philwinkle answered perfectly.

However there is one thing that I still could not get to know. Can anyone throw some light?

I've set up the order export cron as bellow in etc/config.xml of my module.

Step -1

<crontab>
        <jobs>
            <order_export_observer>
                <schedule><cron_expr>0 0 * * *</cron_expr></schedule>
                <run><model>orderExport/observer::check</model></run>
            </order_export_observer>
            ...
        </jobs>
        ...
</crontab>

With the above settings, this would export a CSV file in the proper format once a night (at midnight) I think.

Step-2

I've created a cron in the Nexcess

1/55 * * * *  /usr/bin/php -f /home/html/www.example.com/html/cron.php

This will run after every 55 mins.

Now the actual Problem:

I had to supply cron expression for both in config.xml and in Nexcess Control Panel with 0 0 * * * and 1/55 * * * * respectively. Which expression Magento will take into account? Only one or both? And how the order export will be scheduled? I hope I have been able to describe the problem.


texts:
I set up a Magento multistore site where I need to have a default home page and then different homepage for each store.

I setup on the main website a base_url like "localhost/site/" and a CMS "home_page" as default page, on other stores I set a base_url as "localhost/site/store1/" and a CMS "home_page_store" but if I try to access "localhost/site/" I'm redirect to "localhost/site/store1/" and then I get a Error 404.

How can I resolve this?


texts: Magento 2 PWA: Direct Links are not working in PWA

texts:
I have created multiple cms pages I have added links in the footer,
but if I open cms pages directly from the url it shows the error, something went wrong.

if I define CMS page identifier in venia-upward.yml file it works but its manual process, but is there any way to automate this?


texts:
Cannot find anything in the internet about that.

Here is whats comming in:

'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/shell/log.php?region=%31&kunyuk=%31&MageShell=%31&xcv=%31&p2=%31&koplak=%31&kehed=%31&getHostUrl=%31&uber=%31&sohai=%31&id=%31&derr=%31&hack=%31&zx=%31&abs=%31&tc=%31&file=%31&config=%31&Mage=%31&f=%31%2e%64%6f%63&install=%31&duar=%31&anjing=%31&get=%31&a=%31&ix=%31&damn=%31&c4=%31&gohack=%31&up=%31&w=%31&system=%31&upl=%31&c2=%31&c0=%31&go=%31',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134',

Causing a Warning:

Warning: Invalid argument supplied for foreach()  in ...src/shell/abstract.php on line 144

Through PHP the query params become to

array(
    'region'     => '1',
    'kunyuk'     => '1',
    'MageShell'  => '1',
    'xcv'        => '1',
    'p2'         => '1',
    'koplak'     => '1',
    'kehed'      => '1',
    'getHostUrl' => '1',
    'uber'       => '1',
    'sohai'      => '1',
    'id'         => '1',
    'derr'       => '1',
    'hack'       => '1',
    'zx'         => '1',
    'abs'        => '1',
    'tc'         => '1',
    'file'       => '1',
    'config'     => '1',
    'Mage'       => '1',
    'f'          => '1.doc',
    'install'    => '1',
    'duar'       => '1',
    'anjing'     => '1',
    'get'        => '1',
    'a'          => '1',
    'ix'         => '1',
    'damn'       => '1',
    'c4'         => '1',
    'gohack'     => '1',
    'up'         => '1',
    'w'          => '1',
    'system'     => '1',
    'upl'        => '1',
    'c2'         => '1',
    'c0'         => '1',
    'go'         => '1',
)

What are "they" trying?

I looked into Magento (1.9) and found the log.php which is using the abstract.php.

Mage added a check:

protected function _validate()
{
    if (isset($_SERVER['REQUEST_METHOD'])) {
        die('This script cannot be run from Browser. This is the shell script.');
    }
}

So actually no execution.

But im sure some extensions bring some scripts that just override this method - like mirasvit did in \Mirasvit_Shell_Asyncindex::_validate:

protected function _validate()
{
}

Great - NOT.

No comment, no code. Nothing. Why?


texts: Magento 2 : Language translations add from admin side

texts: How to handle language translations from the admin side and reflect in frontend. I know how to handle from the frontend, inside app/i18n/Magento/fr_FR.csv, if we add in this file it will reflect on the frontend, shall we handle like this from the admin side, why because the client can handle from backend, instead of giving translate content to us every time.


texts: Are min_price and max_price in catalog_product_index_price accurate for products with tiered pricing?

texts:
It seems like min_price and max_price aren't generally accurate in catalog_product_index_price for simple products using tiered pricing.

I haven't yet drilled into Mage_Catalog_Model_Resource_Product_Indexer_Price_Default to get a better idea of what's going on under the hood, but I've taken a look at the sample data.

Here's a product using tiered pricing:

And the values in catalog_product_index_price for it:

I would think this would be a perfect place for min_price to reflect, well, the minimum possible price for the product.  It does seem that the tier_price column perhaps contains that value though.


texts: How can I add the line item discount per product on an invoice?

texts:
I'm assuming invoice.php is the correct file.  I want to have the discounts as line items instead of the aggregate total near the order totals. Where does this pull from?

protected function _drawHeader(Zend_Pdf_Page $page)
    {
        /* Add table head */
        $this->_setFontRegular($page, 10);
        $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
        $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
        $page->setLineWidth(0.5);
        $page->drawRectangle(25, $this->y, 570, $this->y -15);
        $this->y -= 10;
        $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));

        //columns headers
        $lines[0][] = array(
            'text' => Mage::helper('sales')->__('Products'),
            'feed' => 35
        );

        $lines[0][] = array(
            'text'  => Mage::helper('sales')->__('SKU'),
            'feed'  => 290,
            'align' => 'right'
        );

        $lines[0][] = array(
            'text'  => Mage::helper('sales')->__('Qty'),
            'feed'  => 435,
            'align' => 'right'
        );

        $lines[0][] = array(
            'text'  => Mage::helper('sales')->__('Price'),
            'feed'  => 360,
            'align' => 'right'
        );

        $lines[0][] = array(
            'text'  => Mage::helper('sales')->__('Tax'),
            'feed'  => 495,
            'align' => 'right'
        );

        $lines[0][] = array(
            'text'  => Mage::helper('sales')->__('Subtotal'),
            'feed'  => 565,
            'align' => 'right'
        );

        $lineBlock = array(
            'lines'  => $lines,
            'height' => 5
        );

        $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
        $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
        $this->y -= 20;
    }


texts: Create Custom category Yes/No attribute magento2

texts:
Is it possible to create the custom attribute for a category called is_featuted category as 'Yes/No' attribute?

I am looking for code how to create the custom attribute for category and get all the categories where the attribute value is 'Yes'.

Can we get all the category collection where is_featured is "Yes"?

Here is the code i used in InstallData.php

 <?php

 namespace Vendor\Module\Setup;

 use Magento\Framework\Setup\{
 ModuleContextInterface,
 ModuleDataSetupInterface,
  InstallDataInterface
};

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;

class InstallData implements InstallDataInterface
{
private $eavSetupFactory;

public function __construct(EavSetupFactory $eavSetupFactory) {
    $this->eavSetupFactory = $eavSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'is_featured', [
        'type'     => 'int',
        'label'    => 'Is Home Category',
        'input'    => 'boolean',
        'source'   => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
        'visible'  => true,
        'default'  => '0',
        'required' => false,
        'global'   => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
        'group'    => 'Display Settings',
      ]);
    }
}


texts: How to add block to Magento 2 Luma Theme header?

texts: How can I add a block to the magento 2 luma header like in this image? I'm using M2.2 and app/design/frontend/magento directory is empty (i see that referenced a lot).


texts: Magento2.3.4 - After upgrade Magento2.3.2 to Magento 2.3.4 order email showing wrong format

texts:
I am using php7.1
after upgrade magento2.3.2 to magento 2.3.4 order email showing below

=0A=0A=0A =0A =0A =0A =0A=0A=0A
=0A=0A=0A=0A=0A
=0A   =0A =0A =0A =20=
=0A
=0A =0A =20= 3D"JOTEX"=20==0A =0A =20=    =0A
=0A
=0A <= !-- Begin Content -->=0D=0A=0D=0A=0D=0A =0D=0A =0D=0A
=0D=0A
=0D=0A pradeep singh,=0D=0A
=0D= =0A Thank you for your order from COMPANY.=0D=0A =20= Once your package ships we will send you a tracking number.=0D=0A =20=
=0D=0A
=0D=0A If you have questions about your order, yo= u can email us at test.=0D=0A =0D=0A
=0D=0A
=0D=0A
=0D=0A <= h1 style=3D"font-weight: 300; line-height: 1.1; font-size: 26px; margin-= top: 0; border-bottom: 1px solid #cccccc;
margin-bottom: 10px; padding-b= ottom: 10px;">Your Order
000000118=0A=0D=0A Pla= ced on February 19, 2020 9:03:59 AM GMT+02:00
=0D=0A    =0D=0A
=0D=0A
=0D=0A =20= =0D=0A =0D=0A =20= =0D=0A =20=
=0D=0A
=0D=0A =20= Billing Info
=0D=0A =20= pradeep singh=
=0Atest
=0Anear
=0A=0A=0A=0Abikaner, New York, 94024
=0AJo= rdan
=0AT: 01234567890=0A=0A
=0D=0A =0D=0A =0D=0A  =0D=0A pradeep singh
=0Atest
=0Anear
=0A=0A= =0A=0Abikaner, New York, 94024
=0AJordan
=0AT: 01234567890=0A=0A=0D=0A
=0D=0A =0D= =0A
=0D=0A
=0D=0A Payment Method
=0D=0A = =0A Cash On Delivery
=0A=0A=0D=0A =20= =0D=0A =0D=0A   =0D=0A Shipping Method
=0D=0A Aramex - Overnight (Parcel)
=0D=0A =20= =0D=0A    =0D=0A =20= =0D=0A
=0D=0A
=0D=0A =20= =0A =0A =0A =0A= =0A =0A =0A= =0A
=0A =0A
=0A =20= Items    =0A =0A Qty =0A =20=    =0A Price <= /th>=0A
=0A =0A =20=
=0A TALAN 112 HIGH ANKLE
= =0A
=0A =20= Sizes=0A=0A 40=0A=0A =0A =20=
=0A   1   =0A =0A =0A $ 29.95=0A =0A=0A   =0A
=0A
=0A =20=
=0A =20= Subtotal =0A =0A $ 29.95 =20=    =0A
=0A
=0A Cash on De= livery    =0A =0A =20= $ 2.82 =20=    =0A
=0A
=0A Shipping & Ha= ndling =0A =0A =20= $ 5.38 =0A
=0A
=0A Grand Total=0A =20=   =0A =0A $ 38.15= =0A    =0A
=0A
= =0A
=0A =0D=0A    =0D=0A
=0D=0A
= =0D=0A=0D=0A=0D=0A=0D=0A
=0D=0A
=0D=0A About us


texts: Form is not executed in admin panel form url show too many redirects error i give link in body

texts: link form is not visible and give too many redirects error


texts:
I have a bundle product set-up which has a default selection in the admin section. The bundle product uses the dynamic pricing option and all the prices and tier prices are on the option's products.

How can I get the price information for the bundle product with this default selection?

On further investigation it appears that the index is not finding any bundle products to index.


texts: Magento 2 match header search layout for mobile and desktop

texts:
I'm wondering if there is a way to replace the desktop header search
  element (search input box) with the way it is implemented in mobile
  (show only a search icon, and when you click it the search input field
  appears below), preferably purely through css/js, but editing
  templates works as well.


texts: Is it possible to enable gift messages for virtual products?

texts:
I'm using the one step checkout extension on my Magento store and enabled the gift message option however I noticed that this only works for "shippable" products, if the items are virtual then the gift message doesn't come through in the order page even though it shows in the frontend and let's you fill up the text fields.

I guess there must be a check in the core that skips it if the product can't be shipped, can anyone point me in the right direction?


texts:
I'm not sure how this isn't a topic anywhere and I can't quite figure out how to preload the Blank-Theme-Icons.woff files? Surely someone in the Magento community cares about Pagespeed? They appear to auto load because I have _icons.less in my theme with the following content.
.lib-font-face(
@family-name: @icons__font-name,
@font-path: @icons__font-path,
@font-weight: normal,
@font-style: normal
);
If I remove that content than the Blank-Theme-Icons of course don't load at all and then if I preload the Blank-Theme-Icons files in my default_head_blocks.xml as follows they are set to preload on the page however the icons are still broke.

Hope someone smarter than me can help me in the right direction here.


texts: Bitpay Magento Extension in use anywhere?

texts:
Has anyone in the magento community successfully used the Bitpay extension on a real website accepting bitcoin payments? If so what did you do about the lack of support for magento order status?

https://github.com/bitpay/magento-plugin

We installed this a year ago and quickly discovered a bunch of ToDo's in the code. Seems nothing much has changed and Bitpay doesn't support it.

Wondering if wasting time with Bitpay or if someone got this to work and has positive things to say.


texts:
Magento order view management from Multy Stores.

Hi I have one dought.

My dought is When view orders in the admin back end - Remove pricing if orders are from catalog in the view orders section. Display pricing if order received from shop site.

Here Catalog is one store view and shop is another store vie.


texts: Magento2 Category Registry issue to get Ids

texts:
List item

When I open direct products from the search bar these thumbnails are not working because these not get parent ids. I think its registry issue when I will come from the menu then its work.

 if( $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category'))//get current category
            {
            $catId =  $category->getId();
            $catName =  $category->getName();
            $parent_ids = $category->getParentIds();

            }

            //print_r($parent_ids); exit();
            //$subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
            // print_r($subcategory->getData()); exit();
            //$subcats = $subcategory->getChildrenCategories(); ?>

                 <?php if(in_array('22',$parent_ids)) : ?>

                <img onclick="imagezoomer('<?php echo $imageUrl ?>', '<?php echo $fullimageUrl ?>')" data-id="smallthumbs-<?php echo $_product->getId();?>" width="85" height="85" data-img="<?php //echo $productImagedata; ?>" alt="<?php echo $child->getLabel(); ?>"  src="<?php echo $productImage; ?>"/>
                <?php else : ?>
                 <img data-id="smallthumbs-<?php echo $_product->getId();?>" data-img="<?php //echo $productImagedata; ?>" width="85" height="85" alt="<?php echo $child->getLabel(); ?>"  src="<?php echo $productImage; ?>"/>

                <?php endif; ?>

              <?php endforeach; ?>

              <?php endif; ?>


texts: I want to override InvoiceSender In magento2

texts:
I have to override InvoiceSender.php which path is Magento\Sales\Model\Order\Email\Sender\InvoiceSender

i am not able to overirde its function :

<preference type="module\name\Model\Order\Email\Sender\InvoiceSender" for="Magento\Sales\Model\Order\Email\Sender\InvoiceSender" />


texts: Store Locator Module suitable for mobile

texts:
We have +3000 store locations to show on a map.

The store locator module we are using right now works fine on a desktop view, but when we open it on a phone it's taking between 40 seconds to 2 minutes to load the map and place the markers. We tried customizing it, to avoid placing the markers on the initial load, and show them only on performing a search, but the speed is still a problem.

In this case the issue seems to be with the amount of Javascript code that needs to be executed. Newer phones are getting better response times (under a minute for iPhone 6S), but older ones are taking close to 2 minutes.

Is there any recommendation for a store locator module with a +3000 stores database that works fine on a mobile device?


texts:
Just installed magento 1.9 and have fallen on the first hurdle.
I've created a product and have used suggestions from previous versions to display the product on the homepage but am getting the following message

  Fatal error: Call to a member function getSortedChildren() on a non-object in app/design/frontend/rwd/default/template/catalog/product/list.phtml on line 180

Any help gratefully received.

In the content section of homepage I have...

Our Latest Products

{{block type="catalog/product_list" category_id="3" template="catalog/product/list.phtml"}}


texts: What indexer_update_all_views cron job doing?

texts:
What is the difference between indexer_update_all_views cron job and executing php bin/magento indexer:reindex by myself?

I dont't know why the indexer_update_all_views cron job give me this error:

Could not acquire lock for cron group: index, skipping run


texts: How does Magento2 generate the JavaScript Bundling?

texts:
With the JavaScript Bundling configuration active, Magento2 combine the JS into a series of bundles:

This scripts don't seem generated by RequireJS, so how does Magento know which modules to include for each page and in what order?


texts: Email customer when programmatically creating invoice

texts:
While creating an invoice programmatically, how can I make the system email the invoice to the customer?

$order=Mage::getModel('sales/order')->load($orderid);
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
if (!$invoice->getTotalQty()) {
    Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
}
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$invoice->register();
$transactionSave = Mage::getModel('core/resource_transaction')
                   ->addObject($invoice)
                   ->addObject($invoice->getOrder());
$transactionSave->save();


texts: Add Wistia videos instead of youtube or vimeo videos

texts:
Is it is possible to add videos other than vimeo or youtube ?
If yes, how is it possible to add wistia to integrate in Magento and add videos in products?


texts: How to add invoice pdf as a custom column?

texts:
I want to add custom column in pdf magento how i can add?
And where the location to add custom column?


texts: Unable to sort PLP with Configurable products based on discount (special_price)

texts:
I have configurable products in my PLP and I want to sort with "special_price" attribute.
I edited the special_price attribute from admin and allowed it to be sortable in storefront.
But I am facing issue that it is working only for simple products and not for the Configurable products.
Also I can see an open issue on github similar to this - https://github.com/magento/magento2/issues/15609
Has anyone also ran into the same anytime, if so please help.
Thanks.


texts: Magento 2 top.links loads and then disappears

texts:
I am learning Magento 2 theme and I am playing with layout.
My goals is to move account links (Default welcome msg, Sign In, My account etc etc) into the navbar.

I used Magento Luma as parent theme for my theme and added default.xml layout as the following.

app/design/MyVendor/MyTheme/Magento_Theme/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
    <body>
        <referenceBlock name="header.panel"  remove="true"></referenceBlock>
        <move element="top.links" destination="catalog.topnav" after="-" as="navigation.account.links" ></move>
    </body>
</page>

It works but when the page is loading the links are placed into the nav, after the page stop loading they disappear, any suggestion?

And if i wanted to place the account links inside an icon, how I could accomplish this?


texts: {{config path variable not visible in custom variable

texts:
We have a "{{config path variable" like below and I am seeing the following:

This variable {{config path='web/unsecure/base_url'}} is visible in email templates and in newsletter templates

But not or sometimes in custom variables (HTML)

{{config path='web/unsecure/base_url'}}

With sometimes I mean sometimes. It looks like it has something to do with other variables that are or aren't found in the same template ... Please find some examples below

Question: has anyone experienced something similar before?

Some tests I conducted

TEST 1

Created an empty email template with the following 3 links, where TEST123 contains the same first 3 links:

{{config path='web/unsecure/base_url'}}

{{config path='snh/emailsettings/headerfnt'}}

{{store url''}}

________________________

{{customVar code=TEST123}}

The result is that var 1-2-3 do print, but 4-5-6 do not

TEST 2

Created an empty email template with the following 3 links, where TEST123 contains the same first 3 links:

    {{customVar code=TEST123}

________________________

{{config path='web/unsecure/base_url'}}

    {{config path='snh/emailsettings/headerfnt'}}

    {{store url''}}

The result is that var 1-2-3-4-5-6 do print

Conclusion so far
My conclusion is that apparently there is something to do with the order of variables being found. customvars need to be found and processed BEFORE other variables are found. I am digging through Varien filter & Core Template to find some logic as to why


texts: how to set particular payment method in magento programatically in methods.phtml using getsingleton?

texts:
I am trying to set particular payment method in Magento session programatically in methods.phtml. I know how to retrieve current selected payment method from Magento session using getSingleton. But I am not able to find out how to override the existing selected payment method in the session.
I want to directly update the session variable for payment method. Is there anything like Mage::getSingleton('checkout/session')->setMethod('$method'). I have tried every other solution. If there is any function like this then please help me.


texts: Can I make a core module depend on a custom module?

texts:
I'm tying into the event catalog_block_product_list_collection to add additional sort options onto the collection.  However, the class Mage_Review_Model_Observer is also listening to this event.  The observed function, catalogBlockProductCollectionBeforeToHtml, loads the product collection and prevents me from making additional changes.  Because this observer is inside core, it always fires first.

I would like to make my observer fire before the core observer, and I believe this can be accomplished by making the core module depend on my custom module.  Is this possible?

I'm open to other approaches to solving this as well; there are no other relevant events that I've seen to tie into.


texts: Weird translation bug in theme - "SKU" can't be translated, but is a translateable string

texts:
I found out that there is one specific string in the core magento template base that somehow can't be translated.

In File ./vendor/magento/module-sales/view/frontend/templates/order/items.phtml there is the heading "SKU":

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

If one tries to translate it with inline translations: there is no field to add customized text.

If one tries to translate it with i18n-CSVs: no change at all.

Everything else is translateable, but just not this single piece of string. Why is this and how could one translate this anyway? We are experiencing this Bug with Magento 2.1.11.


texts: How to delete old product image while importing new ones

texts: During an large product import i managed to upload the wrong low-res images, and I need to replace these with new ones. If I re-import only the images, the old images will still be present and visible in the catalog. Is there a way to remove or hide the wrong images during import?


texts: Check if user logged on to admin or not, stops working after installation of Redis Session Cache

texts:
I have this code, found on the Internet, to check if a user is logged on to the admin pages or not.

I recently installed Redis Session Cache successfully, and now these lines of code doesn't work anymore.

Anyone know if it's possible to change this, to get it to work when storing sessions in Redis?

Thanks in advance,

<?php
require $_SERVER['DOCUMENT_ROOT'] . "/app/Mage.php";

function isBackendUserLoggedIn() {
    if (!array_key_exists('adminhtml', $_COOKIE)) return false;

    if(!session_id()) session_start();
    $oldSession = $_SESSION;

    Mage::app();

    $sessionFilePath = Mage::getBaseDir('session') . DS . 'sess_' . $_COOKIE['adminhtml'];
    $sessionContent  = file_get_contents($sessionFilePath);

    session_decode($sessionContent);

    /** @var Mage_Admin_Model_Session $session */
    $session  = Mage::getSingleton('admin/session');
    $loggedIn = $session->isLoggedIn();

    //set old session back to current session
    $_SESSION = $oldSession;

    return $loggedIn;
}

if( isBackendUserLoggedIn() ){
    $logonStat = 'true';
} else {
    die('You must be logged on to access this page!');
}
?>


texts: Is it possible to show tool-tip for Column on Magento grid?

texts:
I have created custom grid in Admin panel to display a question/answers..

For Columns, I am displaying the question id instead of the question text.

And answers are shown in row for each customer.

I want to show a tooltip(question text), when admin hovers on the column (i.e. question id).

Has anyone achieved this before? If so, could you please point me in right direction?

Thank in advance


texts:
After using a lot of time trying to translate Magento strings using translate.csv without any luck, I am now using a plugin called PHPro Translate.

In this, I can search for all strings in my shop and translate them one by one.

However, I can't seem to translate the strings used in e-mail templates. In my items.phtml, I have $this->__('Item in your order') and $this->__('Items in your order') that show up in english, even though my shop is in danish language.

Can someone please help me sort this out so I can translate the strings and get them to show up correctly?

Thanks!


texts: Import new database after category description not showing in magento 2

texts:
Hello I have import new database and category description no showing. Description.phtml no working. But in old Database everything is good.

is that import Database issue?

Where i find error in database ?


texts: Create a PDF with customer/order information for virtual product

texts:
I've setup products as "Virtual Products" because I don't ship anything so thought this would be the best product type.

With that the option to attach downloadable PDF products. On sale of this product, I want to be able to allow for the customer to download several PDF attachments some of which will be generic and other will contain information dynamically populated.

This information will be things such as customer name, address as well as some of the product options such as turnover and employees. This will be populated within a PDF template for them to download as well as being available within the customers account area where they can view the order and re-download these PDFs.

Is this possible to do? If so does anyone have any pointers as to where I could start with this kind of product?

Please note: I'm new to Magento and I am eager to learn, all advice is much appreciated.


texts:
I wanted to listen to the redirection of the home page in magento2. I used the controller_action_predispatch events and checked the full action cms_index_index.

But what I am facing is, The page gets identified the first time, but after that, it's not being identified by the observer.

I have to clean the cache again to make the observer identify it. and even so, it works only the first time.

This page is only for the home page. Every other page is working fine.

Also there is no problem when the cache is disabled. But there is a problem when cache is enabled.


texts:
I am creating a Magento theme where I need to include jQuery.

When I add this <link src="js/jquery-1.7.1.js"/> in head. It is working but Magento javascript functions are not working. How to use the Magento 2 built in jQuery library on a custom theme?


texts: whether Paypal upgradation will affect the magento sites which uses Paypal payment method using API credentials

texts:
Recently, our client got an email from PayPal regarding their service upgrade.

"PayPal service upgrades.

As we have previously communicated to you, PayPal is upgrading the certificate for www.paypal.com to SHA-256. This endpoint is also used by merchants using the Instant Payment Notification (IPN) product.

This upgrade is scheduled for 9/30/2015; however, we may need to change this date on short notice to you to align to the to the industry security standard.

You're receiving this notification because you've been identified as a merchant who has used IPN endpoints within the past year. If you have not made the necessary changes, we urge you to do so right away to avoid a disruption of your service! Because these changes are technical in nature, we advise that you consult with your individuals responsible for your PayPal integration. They will be able to identify what, if any, changes are needed. Please share this email and the hyperlinks below with your technical contact for evaluation.

Testing in the Sandbox is one of the best ways to make sure your integrations work. Sandbox endpoints have been upgraded to accept secure connections by the SHA-256 Certificates.

Full technical details can be found in our Merchant Security System Upgrade Guide. In addition, our 2015-2016 SSL Certificate Change microsite contains a schedule of our service upgrade plan.

Thanks for your patience as we continue to improve our services."

I want to know whether this Paypal upgradation will affect the magento sites which uses Paypal payment method using API credentials


texts:
In a same magento instance. One product has qty option, the other one doesn't. I have no idea why.

This one has qty option

This on has no qty option


texts: Initiating refunds isn't actually refunding $$$: --SOLVED--

texts:
Does order_creditmemo.create API call ( ie: http://www.magentocommerce.com/api/soap/sales/salesOrderCreditMemo/sales_order_creditmemo.create.html do anything in the way of actually refunding?

It doesn't appear to in a way similar to creating a credit memo online manually does. I am not seeing any credits in paypal manager backend nor when I do the order_invoice.info call for invoices that have been credit memo'd I get the following values:

...
    public 'is_used_for_refund' => null
...

SOLUTION: My solution was to override Magento's exiting credit memo API with one that created the online credit memo.
        public 'base_total_refunded' => null
    ...

I really am struggling to figure out how to trigger a refund, via API calls. credit_memo I thought was that right place.


texts:
Is there a way to perform a silent installation of Magento through a bash code?
This is what I have in my bash:

...
...
PRJ_MAGENTO_PUBK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PRJ_MAGENTO_PRVK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
...
MAGENTO_SAMPLEDATA=''
if [ "$WITHSAMPLEDATA" -eq "1" ];
       then
            MAGENTO_SAMPLEDATA='--use-sample-data'
fi
...

cd ~/vhosts/$PRJ_MAGENTO
    php -f ./bin/magento setup:install \
    --base-url=$BASE_URL \
    --use-secure=0 \
    --db-host=127.0.0.1 \
    --db-name=$DB_MAGENTO \
    --db-user=$DB_USER \
    --db-password=$DB_USER_PASSWORD \
    --admin-firstname=$MAGENTO_USER_FISTNAME \
    --admin-lastname=$MAGENTO_USER_LASTNAME \
    --admin-email=$MAGENTO_USER_EMAIL \
    --admin-user=$MAGENTO_USER \
    --admin-password=$MAGENTO_USER_PASSWORD \
    --language=en_US \
    --currency=USD \
    --timezone=America/Chicago \
    --use-rewrites=1 \
    --backend-frontname=admin \
    $MAGENTO_SAMPLEDATA

  Is there a way to pass $PRJ_MAGENTO_PUBK and $PRJ_MAGENTO_PRVK to fill the follow question?


texts: Rearrange the position of subtotal,shipment,tax in pdf invoice magento 2

texts:
I want to rearrange the position of  subtotal,shipment,tax in pdf invoice.

I want to move "tax" before grand total.


texts: Magento 2 : Get cookie just next after set it

texts:
let's say we have executes below magento-2 code at one single request,

namespace namespace\CookieDemo\Model;

/**
 * Class Cookie
 */
class Cookie
{
    /**
     * @var \Magento\Framework\Stdlib\CookieManagerInterface CookieManagerInterface
     */
    private $cookieManager;

    /**
     * @var \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory CookieMetadataFactory
     */
    private $cookieMetadataFactory;

    public function __construct(
        \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
        \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
    ) {
        $this->cookieManager = $cookieManager;
        $this->cookieMetadataFactory = $cookieMetadataFactory;
    }

    /** Set Custom Cookie using Magento 2 */
    public function setCustomCookie()
    {
        $publicCookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata();
        $publicCookieMetadata->setDurationOneYear();
        $publicCookieMetadata->setPath('/');
        $publicCookieMetadata->setHttpOnly(false);

        return $this->cookieManager->setPublicCookie(
            'magento2cookie',
            'Custom_Cookie_Value',
            $publicCookieMetadata
        );
    }

    /** Get Custom Cookie using */
    public function getCustomCookie()
    {
        return $this->cookieManager->getCookie(
            'magento2cookie'
        );
    }
}

Let's say we are calling it anyhow for temp.

$object->setCustomCookie(); // cookie has been set
echo $object->getCustomCookie(); // This will print nothing at first request. what if I want to get value of cookie here?

But whenever we will make another request we will get the value because cookie has been set already.

Please provide solution to save my day. Thanks in advance.


texts: Add custom div before main content in magento2

texts:
I am trying to add my custom div with class and id before the maincontent.

 <main id="maincontent" class="page-main">

can i add the custom div before this line? How this can be done. Please anyone suggest me.


texts: Create Homepage Template with various sections in magento 2

texts:
I'd like to create a custom homepage template with different sections. I already declared the page layout in layouts.xml inside my theme folder

<layout id="start_page">
    <label translate="true">Startseite</label>
</layout>

After this I created a start_page.xml inside the page_layout folder

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<update handle="1column"/>
<referenceContainer name="main.content">
    <block class="Magento\Framework\View\Element\Template" name="start_page" template="Magento_Theme::start_page.phtml"/>
</referenceContainer>

I also created a start_page.phtml inside my templates folder. My sample output works already.

I'm no struggling with the implementation and I want to ask you how the best practice is to create different sections like category cutouts with product teasers or slideshows. I drew the sections for you in the example below

purple: product category with products, the backend user should be able to set the alignment
blue: product category with products; similar to purple but theres a slideshow and a background image possible
red:  product category with products; not similar to purple; product tiles html will be different because of some extra features
green:  page links; the backend user is able to select some normal pages which will be displayed as tiles with a background image

How is it recommended to start the implementation? How can I structure it well? How can the administrator manage?

It would be a big help for me if you could answer me these questions. Thank you in advance.


texts:
I am using Magento and currently for last 3/4 days, I am getting search terms like, Q82019309.com on my website search box.

Does anyone know what this mean and why it is happening?

This domain is china based.


texts: How to install module magento 2 don't need run command line bin/magento setup:upgrade

texts: I need to install module pf magento 2 in hosting. I'm trying to connect host with port 21 using putty but not success. I need one other way, please help me.


texts: Rewrite in custom module to non existing core class model

texts:
I found it is possible to do a rewrite on a core class that does not actually exist....

Usage case example:

I am creating a reCaptcha module that integrates google recaptcha into magento's core captcha system.
In the core captcha you have the ability to state a 'type', as can be seen in the config.xml of Mage_Captcha

<default>
......
<admin>
            <captcha>
                <type>zend</type>   <<<<<<<<<<<<<<< specify a captcha type (model)
                <enable>0</enable>
                linlibertine
                <mode>after_fail</mode>
                <forms>backend_forgotpassword</forms>
                <failed_attempts_login>3</failed_attempts_login>
                <failed_attempts_ip>1000</failed_attempts_ip>
                <timeout>7</timeout>
                <length>4-5</length>
                <symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols>
                <case_sensitive>0</case_sensitive>
                <always_for>
                    <backend_forgotpassword>1</backend_forgotpassword>
                </always_for>
            </captcha>
        </admin>
......
</default>

so in my module I extend the core functionality and added a new type called 'recaptcha'

However, the developer of that core module kinda locked the model location down to exist within the Mage_Captcha namespace, as can be seen in the helper class of that module

/**
     * Get Captcha
     *
     * @param string $formId
     * @return Mage_Captcha_Model_Interface
     */
    public function getCaptcha($formId)
    {
        if (!array_key_exists($formId, $this->_captcha)) {
            $type = $this->getConfigNode('type');
            $this->_captcha[$formId] = Mage::getModel('captcha/' . $type, array('formId' => $formId));
        }
        return $this->_captcha[$formId];
    }

so Mage_Captcha_Model_Recaptcha does not actually exist, which means I cannot use this....BUT, if, I place a rewrite directive in my module for that class/file, to a model class in my module, I can intercept the model instantiation, and successfully instantiate my class.

<captcha>
   <rewrite>
      <recaptcha>MyNamespace_MyModule_Model_Recapthca</recaptcha>
   </rewrite>
</captcha>

Considering how rewrites work, I do think there is not any need for magento's rewrite system to check (or care) that a file exists to rewrite it.

Magento get the rewrite directive, and instantiates the new model class instead of the original (even if it does not exist)

So, is this a bug, or a feature?
Should I not depend on this ability?
It does, however, open up some possibilities on extending some poorly written core functionality (like this captcha system)

EDIT:
I released a module that resulted in this question happening.
The module is a nice drop-in replacement of core captcha with googles reCaptcha

http://www.proxiblue.com.au/blog/magento-recaptcha/

https://github.com/ProxiBlue/recaptcha


texts: How to pass the value and call js function from template.html using knockout js in(in checkout page) Magento 2?

texts:
I have to call and pass value to the js function(showPopup())from the template(when clicking the Verify OTP button). How to achieve this?. But now i am not able to call the js function.

layout file

<item name="telephone" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="elementTmpl" xsi:type="string">Vendor_module/form/element/phone.html</item>
        <item name="tooltip" xsi:type="array">
            <item name="description" xsi:type="string" translate="true">For delivery questions.</item>
        </item>
    </item>
</item>

Vendor_module/view/frontend/web/js/view/form/element/phone.js

define([
    'Magento_Ui/js/form/form'
], function(Component) {
    'use strict';
    return Component.extend({
        defaults: {
            template: 'Vendor_module/form/element/phone',
        },
        initialize: function () {
            this._super();
            // component initialization logic
            return this;
        },

        /**
         * Form submit handler
         *
         * This method can have any name.
         */
        showPopup: function(){
          i need to get my phone number
        }

    });
});

Vendor_module/view/frontend/web/template/form/element/phone.html

    <input class="input-text" type="number" data-bind="
        value: value,
        valueUpdate: 'keyup',
        hasFocus: focused,
        attr: {
            name: inputName,
            placeholder: placeholder,
            'aria-describedby': noticeId,
            id: uid,
            disabled: disabled
        }" />

        <button class="action primary" data-bind="click:showPopup">
            Verify OTP
        </button>


texts: How would I move blocks inside tab in magento2 on product view page. I would like to move inside a given tab the tier price


texts: Changes in phtml not visible in the browser

texts:
When I change a .phtml it is not reflected in the browser until after approximately 24 hours.

I've tried everything, run php bin/magento cache:flush, check the permissions of magento_user.

I'm using Magento 2.2 on Apache tomcat

Has it happened to anyone else?


texts:
I added product sku on to Product list page. Using below code:

<?php echo $_helper->productAttribute($_product, $_product->getSku() , 'sku'); ?>

It was showing the sku like I wanted. But suddenly it disappeared. I checked the code, its there. But it is not showing up on frontend. then I tried

<?php echo $_helper->productAttribute($_product, $_product->getData('sku') , 'sku'); ?>

also didn't work.


texts: Why the emails aren't be sent with Fresh Magento 2 installation?

texts:
I've installed Fresh Magento 2.0.0, but I'm not receiving Email on Registration and on Placing New order.

Is there any setting to start transactional emails?


texts: What are the BEST practices for backing up a LOCAL Magento CE development site using MAMP?

texts:
I apologize in advance at the low level of this question, but I'm very new to Magento and just beginning my career as a developer.

I have successfully built a local development site on Magento CE 1.9.1 using MAMP. I am the sole developer on this small project.

I was wondering what are the best practices for backing up the local site as I continue to add to and improve it?  Not only would I want backups of the site, but in a sense I would also have some version control going on without setting up Git or SVN (which may be a bit of overkill at this time).

A few other quick questions:

If I disable the Apache and MySQL servers would it then be enough to copy the entirety of the MAMP folder and Magento folder to offsite storage periodically?
Do I need to create exports of the database using PHPMyAdmin in addition to step 1?
Should I also create and then download System and Database/Media backups from inside the Magento back-end?
Before backing up the entire Magento store, do I need to disable things such as indexing, the cache, or put the store in maintenance-mode first?  What impact (if any) is there when backing up a database that is possibly in use?
Lastly, I installed the Magento folder inside of the MAMP applications folder (at the direction of a well reviewed Magento development book).  Are there any other files or folders outside of MAMP that I should be backing up?  (The database is located in: Applications\MAMP\db\mysql).

The help is much appreciated!  Hopefully other newbies like myself would find the answers to these questions useful.

P.S. I tried beforehand to find the answers to these questions but there seems to be very little out there regarding the fundamentals of how to do backups using best practices.


texts:
I would like to give new subscribers a $5 coupon for subscribing to the newsletter.
The best way (in my mind) to do this is to create a transactional email template (System > Transactional Emails) and set it to email in lieu of the default Newsletter Subscription Confirmation email.
The $5 coupon will be redeemed in a physical store so it will need to have a scannable barcode instead of a simple promo code which is why it will need to be an image.
I'm asking:
1) Is this possible?
2) Is there a better way of doing this?
3) If this is the best way, how do I embed an image into the email message?
Please let me know your thoughts, I greatly appreciate any help you can give me.

Thank you!


texts: how to get current local translation in helper

texts:
i am trying to get translation from my current locale in admin panelbut alway get the en_Us translation. how to get current locale translation.

$helper=Mage::helper('test');
$helper->__('Shipping address');

for admin translation

<adminhtml>
    <translate>
            <modules>
                <test>
                    <files>
                        <default>test_test.csv</default>
                    </files>
                </test>
            </modules>
    </translate>
<adminhtml>


texts: Showing all Custom Options on Transactional Emails

texts:
I want to show all custom options (even not selected ones) on order emails. And I want to strikeout unselected ones. I think I need to work on /app/design/frontend/XXX/YYY/template/sales/order/items/renderer/default.phtml but I couldn't do it. (My Magento version is 1.9.2.1)

Thanks


texts: Magento2 - Customer Login Area just a blank screen

texts: This morning while trying to log into the Magento2 "My Account or Sign in" area the screen just returns a blank white page. We didn't change anything.


texts: Check if coupon code already exist in magento 2

texts: I try to create a code to generate a lot of coupon code randomly, but the problem is i need to check if the coupon code already exist or not, is there a way to do this?


texts: How to add custom html in product listing page in Magento 2

texts:
I want to add my custom html at product listing page.

Screenshot:

How I do this?


texts: Magento 2 : Add product.info.options.wrapper in custom module

texts:
I want to add product.info.options.wrapper block in my custom module. I see in product view page that custom options render from this block.

So, I need to add this in my module. I tried to using by this code. But, it's not working.

$productData = $layout->createBlock('Magento\Catalog\Block\Product\View', 'product.info.options.wrapper')->setProduct($product)->setTemplate('Magento_Catalog::product/view/options/wrapper.phtml')->toHtml();

How to implement this and render custom options?

Thanks.


texts: How to quickly override/modify core block file?

texts:
I need to modify 1 line of code in:

  Mage/Catalog/Search/Block/Autocomplete.php

$html .=  '
escapeHtml($item['title']).'" class="'.$item['row_class'].'">'
            . ''.$item['num_of_results'].''.$this->escapeHtml($item['title']).'
';

What would be the best approach to do this? Do I need to override the whole controller(Mage/Catalog/Search/controllers/AjaxController.php) that calls this block or is there any simpler way?

It seems to me that creating a module just to override one line is not right.

Thanks :).


texts: Cannot determine the field name./ addAttributeToFilter OR condition

texts:
How in magento i can implement OR condition when getting collection ? Currently my code looks:

->addAttributeToFilter('shipping_method', array("eq" => 'relay1'))

but ALSO i need to get orders with shipping_name relay2 so i trying next code:

->addAttributeToFilter(
    array(
        array('attribute' => 'shipping_method', 'like' => 'relay1%'),
        array('attribute' => 'shipping_method', 'eq' => 'relay2'),
    )
);

but i get this error: Cannot determine the field name.


texts: Observer checkout_submit_all_after not called on magento 2.3.3

texts:
This is my app/code/Nadine/Campaign/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_submit_all_after">
        <observer name="nadine_campaign_saa" instance="Nadine\Campaign\Observer\SubmitAllAfter"/>
    </event>
</config>

This is my observer (app/code/Nadine/Campaign/Observer/SubmitAllAfter.php)
<?php
declare(strict_types=1);

namespace Nadine\Campaign\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;

class SubmitAllAfter implements ObserverInterface
{

    public function execute(EventObserver $observer)
    {
        $handle = fopen('/home/mytest/public_html/staging/var/logghetto.txt', 'a');
        fwrite($handle, "Start my observer SubmitAllAfter alle ore ".date("H:i:s"));
        fwrite($handle,"\n====\n");

        fclose($handle);
        die('test in progress');
    }
}

But, when I send an order, this observer don't works. On /vendor/magento/module-quote/Model/QuoteManagement.php I see that, with this code:
$this->eventManager->dispatch('checkout_submit_all_after', ['order' => $order, 'quote' => $quote]);

the event is correctly invoked.


texts: magento use of getBlock("head")->setCanLoadExtJs(true)

texts:
I am new to magento and came across this code in a controller

$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);

Although it's name suggest its used to enable adding of js but I have also seen code in design layout xml file without using the above.

Can anyone tell me why we use this.


texts: How to do onestep checkout for the checkout page?

texts:
How can show all the checkout forms (such as billing address, shipping method, payment method, additional information, and checkout review)  on one page without going through the step by step from 1 to 5?

By Magento checkout default, you have to go through the step of 'Checkout as a Guest or Register' before you can see the form of billing address, and so on. I want to avoid too many clicks on the checkout page, so I want to display all of these forms when you click 'Proceed to checkout' and land on this check out page. Is it possible?

This is done by this website https://www.millesima.co.uk/firecheckout/ and this is the screen shot of its checkout page where you see all the forms are displayed on this single page.

I assume that it is onepage.phtml (frontend\mystore\default\template\checkout/onepage.phtml) that I should edit,

<?php echo $this->__('Checkout') ?>

<?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
<?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
    <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">

            <?php echo $i ?>

<?php echo $_stepInfo['label'] ?>

            <?php echo $this->__('Edit') ?>

        <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
            <?php echo $this->getChildHtml($_stepId) ?>

<?php endforeach ?>

So I replace the code above with,

<?php echo $this->getChildHtml('billing') ?>
<?php echo $this->getChildHtml('shipping') ?>
<?php echo $this->getChildHtml('shippingmethod') ?>
<?php echo $this->getChildHtml('payment') ?>

But what about the forms for ADDITIONAL INFORMATION and CHECKOUT REVIEW?

Also this line <?php echo $this->getChildHtml('shippingmethod') ?> does not pull the shipping methods that I have configured in Magento's backoffice at all. Any idea why?


texts: Alternate for getting the product id instead of registry()

texts:
Unable to get the registry for current product by selecting the product in magento 2.

Im trying to update the product id of the product which gets deleted from below code during the delete event catalog_product_delete_after:

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$productdel = $objectManager->get('Magento\Framework\Registry')->registry('current_product');
$productid=$productdel->getEntityId();
 ....

I get getEntityId() on null.

I m just selecting the checkbox of the product to be deleted in backend and i guess its not able to get the productid in the current registry.

OTHER CASE:

The above works if i try to update any product attribute.


texts: Magento 2:How to change validation message in checkout page?

texts: I want to just update the text of validation message in checkout page how can I achieve that?


texts: Admin password rotation - Community Edition

texts:
Magento EE has a feature to force admin users to automatically rotate their passwords every X number of days.

Anyone know of an extension that would do the same for a CE site ?


texts:
Looking in this community i found that i can whitelist block in System > Permissions > Blocks.

My problem is that i do not have System > Permissions > Blocks in my admin panel.

I have only System > Permissions > Users and System > Permissions > Roles

Can you give me any advice why i do not see System > Permissions > Blocks ?

Thanks in advance!


texts: I know grand total is calculated on quote, I would like to find out is there a way to create an order object, add items to it and then get it's grand total without just manually adding item prices to get sum. Also this needs to be done without saving the order.


texts: mobile .css deceration, coming out of nowhere?

texts: I just upgrade to 1.9CC, here is the problem. my browser is looking for skin/theme/css/mobile.css I check my local.xml and also page.xml. it is not declare anywhere. I even add <action method="removeItem"><type>skin_css</type><name>css/mobile.css</name></action> to my local.xml it still persist.  the most STRANGE thing is it dose NOT EVEN DECLARE in my HTML source file.  is anyone have the same problem? it really annoy the hell out of me. help?!


texts: How to connect make MS Sql Server Connection in Magento

texts: I need to make connection in magento say a php file where i can make connection to MS SQL Server. can anyone please let me know how can i do this.


texts: Form Key Problems After Changing Domains 1.9.2.1

texts:
After changing domains, from dev.mysite.com to mysite.com I can no longer login to the backend, I am getting below error:

  Invalid Form Key. Please refresh the page.

Also, Customers cannot sign in and products cannot be added to bags.

These are all issues with the form_key, but I have no idea where to even start looking for answers, the system.log only shows:

  Warning: strlen() expects parameter 1 to be string, array given  in app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php on line 93

This Post suggested to double check cookie_domain, and to increase max_input_vars in php.ini but neither of these had any affect. I have also tried using a fresh .htaccess file

Additional info: I have two sites on this Magento installation (everything worked fine before domain change) and the domains simply changed like so:

dev.site1.com -> site1.com

dev.site2.com -> site2.com

And yes I refreshed cache and session data and restarted apache and mysql after every single change.


texts: I want to rewrite phtml file in module-grouped-product

texts:
I am trying to rewrite the phtml file but it's not working my code is :

a main file path is public_html/vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/grouped.phtml

my file path is public_html/app/design/frontend/mytheme/themename/Magento_GroupedProduct /templates/product/view/type/grouped.phtml

I don't know where I am wrong.


texts: Create order programatically without customer

texts: i need to create an order programatically without using customer or ordering as guest, is there a way to do this?


texts: unable to composer update while installing Magento

texts:
magento/product-community-edition 2.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- magento/product-community-edition 2.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for magento/product-community-edition 2.2.3 -> satisfiable by magento/product-community-edition[2.2.3].

getting above error messages while updating composer


texts: How to delete orders in Magento 2.2.1 without any extension?

texts: I tried to delete my order list but could not delete those orders and searched on google. They provide the solutions with the use of an extension but I do not want to use extension. I would like to have a good way of doing it programatically.


texts: Magento2.2 - Send event to Google Analytics in a .phtml file

texts:
I have tried to send an event in .phtml file using

<script>ga('send', 'event', {
    eventCategory: '...',
    eventAction: '...',
    eventLabel: '...'
});</script>

But Browser Console says that ga is undefined, Please help me how can I send an event to Google Analytics.

I will be very thankful to you.


texts: Is it ok if I not use the default magento logo option and display a logo via a static block? I mean I want to leave both the logo fields empty and alt text as well in Design->Header fields.


texts: Searching for SKU without special characters

texts:
The Magento front end search is not very good in my experience. I am having an issue when searching for SKUs.

I have changed the SKU attribute to be searchable, search settings are combined like and full text and all products are catalog,search.

So searching by SKU works if you type in the exact query, or maybe just the first few letters up a special character.

The problem is that a lot of our SKUs were set up with a dash in them. For example
some-sku-123

If I try to search sku123 no results will appear.

Is there a way to ignore dashes when doing the SQL search query or something similar?

Any ideas are appreciated.

This is for Magento 1.9


texts: How to make canonical full/path/with/category/product-url?

texts:
Question again. Sorry, cant find the answer :( Magento 1.9. I have several same pages:

1) domain/category/subcategory/product-page
2) domain/category/product-age
3) domain/product-page

When I use canonical configuration - I get domain/product-page as canonical. But I need FULL url domain/category/subcategory/product-page canonical. Or 404/301 from second and third type to first


texts:
I am creating a custom theme. Now I added a css file, only for checkout page.

css file call by default_head_block.xml at  app/design/frontent/Amit/Customtheme/Magento_Checkout/layout/

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Magento_Checkout::css/checkoutstyle.css" />
    </head>
</page>

Css file checkoutstyle.css location is app/design/frontent/Amit/Customtheme/Magento_Checkout/web/css.

Now when I try to deploy that css file using php  bin/magento setup:static-content:deploy

I get this error:

Compilation from source:
frontend/Magento/blank/en_US/css/styles-l.less
variable @checkout-tooltip-icon__font-size is undefined in file /var/www/html/Amit/var/view_preprocessed/css/frontend/Magento/blank/en_US/css/source/_extends.less in _extends.less on line 1056, column 21
1054|     input {
1055|         .lib-css(margin-right, @indent__s);
1056|         width: calc(~"100% - (@{checkout-tooltip-icon__font-size} + @{indent__s} + @{indent__xs})");
1057|     }
1058| }
1059| >

Note:  Current application mode: developer and system is Ubuntu.

Can any one tell me what is happen?


texts:
Is it possible to set a start/end date for Static Blocks or Widgets somehow?

Or is this only possible with Banners?

I know it would be possible to do this using CMS layout for specific pages or categories, but I am planning on doing a sitewide implementation of a static block/widget and was wondering if there is a possibility to give these a specfic date when they show up/stop showing up.

So basically I would like to create a static block and show Date from Date1 to Date2 and after that date hide it again.


texts: Can't able to set value for nested object param

texts:
Below one is my custom observer object, I need to get/set value of processor

object {
  ["_quality":protected]=> int(10) /* 1st quality param.*/
  ["_processor":protected]=>
    object(Varien_Image) {
      ["_adapter":protected]=>
        object(Varien_Image_Adapter_Gd2) {
          ["_quality":protected]=>int(10) /*2nd quality param.*/
        }
    }
  }

It works:

  var_dump($object->getQuality());

It does not work, it always return null

  var_dump($object->getProcessor());

Any help would be appreciated.


texts: How to set custom Dropdown on Top Menu in Magento 2

texts:
I want to set my custom div on my custom Brands link in Top Menu like

I create my custom link in Top Menu the code is

<?php

namespace Vender\Module\Plugin\Block;

use Magento\Framework\Data\Tree\NodeFactory;

class Topmenu
{
    /**
     * @var NodeFactory
     */
    protected $nodeFactory;

    public function __construct(
        NodeFactory $nodeFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        Data $helper
    )
    {
        $this->nodeFactory = $nodeFactory;
        $this->_storeManager=$storeManager;
        $this->_helper = $helper;
    }

    public function beforeGetHtml(
        \Magento\Theme\Block\Html\Topmenu $subject
    )
    {
        $node = $this->nodeFactory->create(
            [
                'data' => $this->getNodeAsArray(),
                'idField' => 'id',
                'tree' => $subject->getMenu()->getTree()
            ]
        );
        $subject->getMenu()->addChild($node);
    }

    protected function getNodeAsArray()
    {
            return [
                'name' => __('Brands'),
                'id' => 'pmebrands',
                'url' => $this->_storeManager->getStore()
                        ->getBaseUrl().'shop-bybrand.html',
                'has_active' => false,
                'is_active' => false
            ];

    }
}

now the code is showing the link perfectly on top menu
but the problem is how can I set my custom div to show on my custom link Brands mouse hover?


texts: Magento 2 - Add tax_amount to Orders/Invoice grid

texts:
I would like to add the tax_amount to the orders and invoices grids to be able to have them in the export files. I found some documentation and tutorials on telling how to add a custom column, with a new column created in database, but not one showing existing data.

I assume I have to call existing data from sales_order and sales_invoice tables in

  app/code/Vendor/Module/view/adminhtml/ui_component/sales_order_grid.xml

and

  app/code/Vendor/Module/view/adminhtml/ui_component/sales_order_invoice_grid.xml

So I started with a new module.

app/code/Vendor/Module/etc/module.xml :

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="2.0.0">
    <sequence>
            <module name="Module"/>
    </sequence>
    </module>
</config>

app/code/Vendor/Module/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">
    <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid">
        <arguments>
            <argument name="joins" xsi:type="array">
                <item name="sales_order" xsi:type="array">
                    <item name="table" xsi:type="string">sales_order</item>
                    <item name="origin_column" xsi:type="string">entity_id</item>
                    <item name="target_column" xsi:type="string">entity_id</item>
                </item>
            </argument>
            <argument name="columns" xsi:type="array">
                <item name="tax_amount" xsi:type="string">sales_order.tax_amount</item>
            </argument>
        </arguments>
    </virtualType>
</config>

app/code/Vendor/Module/view/adminhtml/ui_component/sales_order_grid.xml :

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="tax_amount">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Tax amount</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

But it does not seem to work, I only have an empty column.

Any help would be appreciated.

I'm working on Magento 2.2.0.


texts:
I am using symbols like these in My Magento pages:

✓ ☳ ▣

For some reason now the symbols are being changed by Magento to these weird characters:

ÃÂÃÂ£ÃÂÃÂÃÂÃÂ
Ã¢ÂÂ

I have read other threads and they indicate it's an encoding issue. Can anyone help with this?


texts: To make deploys more efficient our var/ and media/ directories, local.xml and enterprise.xml files are symlinks to actual files outside the webroot. But as far as I know, the files actually have to exist within the Magento tree itself. Rather than using symlinks, is it possible to move where var/ is actually located using some configuration mechanism, such as in local.xml?


texts: Overriding a message block in Magento theme affects the admin area

texts:
I wanted to provide a different style and markup for the notices. I thought these were found in a template file 'core/messages' but it turns out the output comes from a block Mage_Core_Block_Messages. When I override this block within my own custom module it works fine. But then in the admin area it also adopts this same markup and style.

How can I avoid this?


texts: Please see the below images I'm getting newsletter in every products page please help me in removing this.


texts: Add newly created attribute to existing product in magento 2

texts: I have created a new attribute for products, but i am having around 1000 of product. The thing is i cannot edit each one and add the attribute to it. Is there any way i could add this attribute to all of this product.


texts: How to create an excel file of all products?

texts: I would like to fetch all products and create an excel file with product name & sku and make it downloadable in magneto 1.9. Any one can help me.


texts: how to redirect a page using magento button?

texts:
I am new to magento, using html button I had create a record and redirect the pages also,
when I have create magento button I can't do any operations

what is the difference b/w html and magento buttons?
and how the perform action?

my code is:

<form method="post" action="<?php echo Mage::getUrl('practice/index/new') ?>">

                    First Name

                    <input type="text" id="nom" name="nom" />

                    Last Name

                    <input type="text" id="prenom" name="prenom" />

                    Telephone Number

                    <input type="text" id="telephone" name="telephone" />

                    <input type="submit" value="Save" />

<button type="button" title="<?php echo $this->__('Create a New Record') ?>" class="button btn-cart" onclick="<?php echo Mage::getUrl('practice/index/new');  ?>"><?php echo $this->__('Create a New Record') ?></button>

</form>

see image:

thanks in advance.


texts: Free Shipping on orders over x$ and order is not over x$ it should give them the $x shipping charge option


texts: How to Make Category tree Auto expand the assigned subcategory tree in edit product form?

texts:
I'm using Magento 2.4.1 and have 4 levels category when editing a product in cms it really cumbersome when I need to locate the hierarchy of my product categories because when it first loads it only expands to the second level not expanding to which the category is checked. for example:

what I want is to have like this, it will auto-expand the tree to the location of the subcategory that product is assigned when load the product edit page:


texts:
I want to create a form which have some conditional logic.
I tried hard but did not found any free plugin/module to do this.

So finally have a solution that I will create custom form(That will create by myself not magento's custom option form) to do that task. But didn't know How can I add this form values submitted by user when he add that product to cart. And also admin can see the values on the admin panel as well.

I know magento have 'custom option form' associated with product but I m not able to add conditional logic on that form. So How can I submit my form as 'custom option form'.


texts:
I have created new controller, module and route file. route not working, its showing 404 error.

Controller:

<?php

namespace Inchoo\userlogin\Controller\Index;

use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_resultPageFactory;

    public function __construct(Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
    {
        $this->_resultPageFactory = $resultPageFactory;
        parent::__construct($context);

    }

    public function execute()
    {

      try {
          $params = $this->getRequest()->getParams();
          $error = 'false';

          //Get input values.
          $email = $params['email'];
          $password = sha1(sha1($params['password']));

          //Check if values are not empty
          if( !$email ){
            $error = 'true';
            $response['msg'] = "Email is required";
          }
          if( !$password ){
            $error = 'true';
            $response['msg'] = "Password is required";
          }

          //Connect with database with connetion file.
          $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
          ->get('Magento\Framework\App\ResourceConnection');
          $connection= $this->_resources->getConnection();
          if ( $error == 'false') {
            //Check if email and password matched.
            $sql = 'SELECT * FROM `customer_entity` where email="' . $email .'" and password="' . $password .'"';
            $login = $connection->fetchAll($sql);
          }
          //Check if login is successfull or unsuccessfull.
          if ( isset($login) && $error == 'false')
          {
            $response["status"] = 'true';
            $response["data"] = array();
            $response["data"] = $login;
            echo json_encode($response);
          } else {
            $response["data"] = [];
            $response["status"] =  'false';
            $response['msg'] = $response['msg'];
            echo json_encode($response);
          }
        }
        catch (Exception $e){
            echo $e->getMessage();
        }

    }
}

Module:

<?xml version="1.0"?>

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

Route:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="login" frontName="login">
            <module name="login" />
        </route>
    </router>
</config>


texts: Magento 2 styles not showing after choosing luma theme

texts:
I have a fresh new intall of magento 2, which appeared to be working fine till I changed the Theme to Luma. Then the frontend styles disapeared, the info is there, as well as the products, but no styles at all, not even if chose blank theme or no theme at all. Backend is OK.
What I have done so far:

Run again ./magento setup:static-content:deploy
Duble checked that Write Engine is ON
Cleared cache both in Magento admin and using command line
Reindexed via command line
Cleared browser cache
Set directories and files permisions to 755 and 644 respectively
Veryfied the exitence of .htaccess file in the pub/stactic directory
tried to recompile styles only

But just cannot get the styles to come back again.


texts: Get asterisk after placeholder text in All Required field

texts:
I want to add an asterisk mark to placeholder of inputs. Something like this:

<input type="text" name="your-name" placeholder="Naam">

I do not want to add the symbol directly in the placeholder.

Currently trying to add pleaceholder after css but that is not working.

input[type=text]::-webkit-input-placeholder:after {
   content: '*';
   color: red;
}

anyone can help me add an asterisk to the placeholder.


texts:
I am using Magento CE 1.8.1.0. I have a requirement to use ceil on all prices/fees. I am also using product custom options.

It seems that the rounding is not done in a single place. First I modify
app\code\core\Mage\Core\Model\Store.php:

public function roundPrice($price)
{
    return ceil(sprintf('%.2f', $price));
}

public function formatPrice($price, $includeContainer = true)
{
    if ($this->getCurrentCurrency()) {
        $roundedPrice = $this->roundPrice($price);
        return $this->getCurrentCurrency()->format($roundedPrice, array(), $includeContainer);
    }
    return $this->roundPrice($price);
}

But since I am also using catalog price rules, the special price shown in the product page is not being ceil'ed. So I modified the following:
app\design\frontend\base\default\template\customoptions\catalog-product-view-options.phtml:

return Math.ceil(prPrice);
...
return Math.ceil(totalOpPrice);

Since I have product custom options, there are discounts for the product as well as for the options. I realize that the unitPrice (product price + option prices) in the shopping cart is calculated without any rounding. In my test, the unitPrice is $399.2 + $63.2 = $462.4 and in the checkout cart, after the ceiling the unitPrice is shown as $463. However I want the behavior to be that the unitPrice is calculated as: $400 + $64 = $464.

It seems that the row total for each item is calculated without any ceiling. Where should I modify the logic that calculates the row total?

The other question is that it seems that roundPrice is done all over the place. What is the best approach if I just want to change the rounding policy globally?


texts:
My block file path is

app\code\local\Company\Modulename\Block\Product\View\View.php

In this file method name is getId()

Now how to call call this method in controller?


texts: Magento2: Backorder Settings + Backorder Min Qty in catalog grid?

texts:
So we work with backorderd in M2. And are using backorders. So it would seem logical to see/access these values in the product grid.
Question: How can we see the backorder Settings + especially backorder Min Qty in the catalog grid?
Should this not be default?


texts:
In magento2 i want to generate partial invoice of order. It first time invoice is generated but when i try to generate invoice second time for same order than $order->canInvoice() return false.

any once have idea about this issue ?


texts: Magneto2 Adding styles before style-l.css

texts:
I got the answer in this link

it's working only in the home page I needed it to work in each and every page please help me with this


texts: CMS Page content not displaying on Website

texts:
Added a new page under CMS --> Pages
Title: Portfolio
URL Key: portfolio

However on website it does not display.

I checked back-end Catalog --> URL Rewrite Management

Type: System
ID Path: Category/45
Request Path: portfolio1.html
Target Path: Catalog/category/view/id/45
Redirect: No

Please help.


texts: I am trying to send the newsletter to the subscribers in Magento 1 but the newsletter is not sent I applied all the process for sending a newsletter but it doesn't send.


texts: Product image on customer account dashboard

texts:
On our customer account dashboard, we want to display the product image inside the order.
We want to display the image before the product title.

What code do I need to add to the file

app/design/frontend/theme/template/sales/order/items/renderer/default.phtml


texts: Making addToCart and cart page execute synchronously in magento 1.9

texts:
I am a complete newbie in magento, javascript and php

So I am using magento 1 and my checkout page takes around 1 sec and cart page takes around 1.5 sec to load

I want to decrease the time these two pages take to load.

I researched about this but found nothing. So the only option I can think of is to somehow make them run synchronously.

But I am not getting how I can make them synchronous. I researched about this for 4 to 5 hours now but found nothing.

Is there a way to make them run synchronously? Or is there any other way to reduce their execution time by half?


texts: Object DOMDocument should be created. with order custom attribute

texts:
I've followed this link  : https://www.yereone.com/blog/magento-2-how-to-add-new-order-attribute/

to add a custom attribute to my orders.

But when I check at the step before the event I've got this error :

  Object DOMDocument should be created.

How can I fix it ? Can't see any of my orders in backend...


texts: after changing admin language, cannot access admin page

texts:
I have installed language extension and successfully installed on my test store. However, as soon as I have changed the admin language and press save, the admin page crashed, giving 500 error and cannot access at all. Frontend is still accessible.

I have deleted cache, but still not working.

I have contacted the developer, but if anyone has any idea how I could fix this, would be really appreciated.

EDIT:

Error Log:

  PHP Fatal error: Uncaught TypeError: Argument 1 passed to
  iterator_to_array() must implement interface Traversable, null given
  in /vendor/magento/framework/View/Element/Html/Calendar.php:86


texts: Magento2, cleaning cache led to createApplication error

texts: Instead of running cache:clean I removed the folders from var directory, now I get error index.php(38): Magento\Framework\App\Bootstrap->createApplication Even I can not deploy:content anymore :(


texts: Connecting to Magento Rest API by python

texts:
I'm new to Magento API and actually a python programmer, there are some APIs I should connect to them through Rest and I stick to the first step of authentication with OAuth for getting access tokens and this stuff. Can anyone, please, help me through this in a very clear way.
I've got my consumer key and secret and want to connect and use the APIs.


texts:
Is there an issue in recursion when you are using singletons?

private function manageReindexing(){
        $stockIndex = Mage::getSingleton('index/indexer')->getProcessByCode('cataloginventory_stock');
        if($stockIndex->getStatus() != "working"){
            $stockIndex->reindexAll();
            return;
        }
        else{
            Mage::log('still running',null,"log.log");
            sleep(60);
            $this->manageReindexing();
        }
    }

This method appears to run forever although $stockIndex->getStatus() has a status of pending.


texts: Help with Magento 2.3 custom product sort plugin

texts:
I have tried to implement a custom sorting plugin in Magento. Namely, with the options:

Price (Low > High)

Price (High > Low)

Name (A - Z)

Name (Z - A)

Now, I have the plugin installed and working, with code very similar to the examples in similar posts such as Magento 2 How to add custom sort by option.

Sorting by price works brilliantly, however, I'm struggling to get the correct join, in order to get the sorting by Name working. Take the code below in my plugins Toolbar.php

<?php
namespace Vendor\ModuleName\Plugin\Product\ProductList;

class Toolbar
{
    /**
    * Plugin
    *
    * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
    * @param \Closure $proceed
    * @param \Magento\Framework\Data\Collection $collection
    * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
    */
    public function aroundSetCollection(
        \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
        \Closure $proceed,
        $collection
    ) {
        $this->_collection = $collection;
        $currentOrder = $toolbar->getCurrentOrder();
        $currentDirection = $toolbar->getCurrentDirection();
        $result = $proceed($collection);

        if ($currentOrder) {
            switch ($currentOrder) {

            case 'price_desc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price DESC');
            break;

            case 'price_asc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price ASC');
            break;

            case 'name_az':
                $this->_collection
                    ->getSelect()
                    ->order('e.name ASC');
            break;

            case 'name_za':
                $this->_collection
                    ->getSelect()
                    ->order('e.name DESC');
            break;

            default:
                $this->_collection
                    ->setOrder($currentOrder, $currentDirection);
            break;

            }
        }

        return $result;
    }
}

As mentioned, sorting by price works fine, but when trying to sort by name, I get an error something along the lines of,

  there is no column name on e

I understand that I need to perform a more complex join query to get the product name from the product_entity_varchar table but can't for the life of me seem to get it working or fully understand the syntax.

Some help would be much appreciated!


texts: Mergen Guest Cart to Customer cart and Customer Cart to Guest Cart via REST API?

texts:
I am trying to merge/convert a guest cart into a customer cart (vice versa) using the Magento REST API. Right now I am trying to do so by adding the products to the other cart before logging in or out.

Did anyone try to implement this?


texts:
I need to create an observer for the event of store switching. Basically I need to do some stuff when the visitor switches storeviews/stores. Where can I find that event?

I cant identify it in this Cheatsheet