texts: Magento 2: How to enable newly created admin theme & override module?

texts:
I'm using Magento 2 CE Version 2.1.2.

I have followed Magento StackExchange Questions/Answer for this.

Still having issues.

I would like to Override Magento 2: How to override Adminhtml "Shipping & Handling Information" Information Using Magento Admin Theme.

magento\app\design\adminhtml\Vendor\Themename\registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/Vendor/Themename',
    __DIR__
);

magento\app\design\adminhtml\Vendor\Themename\theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>My Theme Tile</title>
    <parent>Magento/backend</parent>
</theme>

magento\app\code\Custom\Backend\registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
        \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Custom_Backend', __DIR__
);

magento\app\code\Custom\Backend\etc\module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Custom_Backend" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Theme"/>
        </sequence>
    </module>
</config>

magento\app\code\Custom\Backend\etc\di.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="adminhtml" xsi:type="string">Magento/backend</item>
            </argument>
        </arguments>
    </type>
</config>

magento\app\design\adminhtml\Vendor\Themename\Magento_Shipping\templates\order\view\info.phtml

echo "hi";
exit;

I have run below commands as well

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

What i'm still missing?

New theme entry shows in theme table

I'm in developer mode.


texts: Only copy essential files from old Magento

texts:
I am taking over the management of a Magento site from developers who made a mess.

I have a clean install of Magento, and would like to only copy the necessary files from the previous installation.
Which folders should I synchronise?


texts: How to apply rule on Total cost in magento 1.7

texts:
I am trying to apply 20% off on total cost of Rs 3000 without any coupon.I have done this in shopping cart rule because I did not get the option of Subtotal in catalog price rule.

Please suggest me some solution.


texts:
I have saved this string into the database. when I trying to decode this string by below sentence this does not working.

\Magento\Framework\Serialize\Serializer\Json $serializer

$this->serializer->unserialize($value);

[{"catagory_title":"lamn leg","catagory_value":"lamn_leg","delete":""},{"catagory_title":"lamn beef","catagory_value":"lamn_beef","delete":""}]


texts: Product not display on frontend before reindexing in magento2

texts:
Product not display after imported successfully at front-end until re indexing.

It's possible to display product at front-side without re indexing in Magento2?


texts: Magento 2.3 Migration - Centos 7 - Nginx - Error code: SSL_ERROR_RX_RECORD_TOO_LONG

texts:
I just migrated my live Magento 1.9 to centos 7 - Nginx localhost, after migrated successfully i am getting the following error,

An error occurred during a connection to 192.168.1.64:8085. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

Not able to change the base URL:


texts: How to get all images of a single product

texts:
how to get all images by using below code. I'm only getting single image

<?php

class Affilnow_Module_Model_Product_Api extends Mage_Api_Model_Resource_Abstract
{
  public function items($attributes)
  {

    $catalog = Mage::getModel('catalog/product')
    ->getCollection()
    ->addStoreFilter(Mage::app()->getStore()->getId());

    $collection = $catalog->addAttributeToSelect("*");
    $tempres = array("helloworld");
    $tempres = json_encode($tempres);
    //var_dump($tempres);
    //echo "<xml>helloworld</xml>";
    //print_r($collection);
    $tempres = json_encode($collection);
    //return $tempres;
    //exit();
    foreach ($collection as $product) {

        $product_id = $product->getId();
        $assoc_variations = array();

        if ($product->isConfigurable()) {

            $assoc_products = $product->getTypeInstance(true)
            ->getConfigurableAttributesAsArray($product);

            foreach ($assoc_products as $assoc_product) {
                $assoc_variations[] = $assoc_product;
            }

        }

      $result[] = array(
        'id'          => $product->getId(),
        'name'        => $product->getName(),
        'stock'       => $product->isInStock(),
        'sku'         => $product->getSku(),
        'weight'      => $product->getWeight(),
        'description' => $product->getDescription(),
        'image'       => $product->getImageUrl(),
        'category'    => $product->getCategoryIds(),
        'price'       => Mage::helper('core') -> currency($product -> getPrice(), true, false),
        'hasOptions'  => $product->isConfigurable(),
        'qty'         => intval($product->getQty()),
        'created at'  => $product->getCreatedAt(),
        'variations'  => $assoc_variations
        'additional_images' =>$product->getMediaGalleryImage()
        );

  }

  return $result;
  }

}


texts: need a category url in product view page

texts: I have a product bag in home->products->men->handbag category path .I want hangbag category url in product detail page


texts:
I have idea we can set product status using following code in magento 1.x.but I’m not able to identify in magento 2.0 beta. i'm spending lot of time to search status.php file. i find following file.but no use.

  magento2/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php

$productid=10;// product id which you want to change status;
    $storeid=1
    Mage::getModel('catalog/product_status')->updateProductStatus($productid, $storeid, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);


texts: What is different between obscure and password Field type in system.xml

texts:
is there any difference between a password and obscure field type in system.xml

<field id="secret" type="obscure" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    Secret
                    <validate>required-entry</validate>
                    <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                </field>
                <field id="passswordsecret" type="password" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    Secret Password
                </field>


texts: Magento 1 : Showing chines text in var/sessoin file

texts: Is there any idea about why some file are showing chines text in var/session ?


texts: Indian states duplicate entries after magento Upgrade

texts:
I had manually inserted Indian states in Magento 2.2.2. I have upgraded to 2.2.6 and I am seeing duplicate entries.

Could this be because 2.2.6 came with Indian states adding to the existing entries and resulting in duplicate?

How can I get rid of this duplicate entries?
Also when I run below sql statement I see only one entry and here is  the screenshot.

  SELECT * FROM directory_country_region WHERE country_id='IN';

But when I run

  SELECT * FROM directory_country_region WHERE default_name='Delhi';

it shows two entries.


texts: Error using a custom collection for a report

texts:
this is a hard question to ask but I am trying to write a reporting module, following:

http://www.summasolutions.net/blogposts/custom-reports-magento.

I got that module to work on my install, but when I try to customize it or other sample reporting modules I always run up against:

  "Fatal error: Call to a member function setPeriod() on a non-object in
  /Volumes/Apache/mage/app/code/core/Mage/Adminhtml/Block/Report/Grid.php
  on line 137"

One thing I know is that when I comment out my model spec in config.xml, and point the grid to a different collection like order_collection it works ok except for understandable mismatch between grid columns.  Can you tell just from that what is wrong?  I can pastebin files if you need it.

<models>
    <reports>
        <class>VMR_Reports_Model</class>
        <resourceModel>reports</resourceModel>
    </reports>
</models>


texts: Cannot translate title set in the layout XML magento 1

texts:
this is my layout xml for the checkout success page:

    <checkout_onepage_success>
        <remove name="checkout.success"/>
        <reference name="head">
            <action method="setData" translate="title"><key>title</key><value>Success Order</value></action>
        </reference>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="cms/block" name="content_text">
                <action method="setBlockId">
                    <block_id>succes-checkout</block_id>
                </action>
            </block>
        </reference>
    </checkout_onepage_success>

I want to translate the word: Success Order. So I went to my theme/locale/de_DE/translate.csv which is set in the locale and I added this:

"Mage_Checkout::Success Order","sdadsa"
"Mage_Page::Success Order","sdadsa"
"Success Order","sdadsa"

None of them is working. I cleared the cache , so its not a cache issue :) Any idea why this is not working ?

Thx :)


texts:
I've installed spanish translation from composer package (mageplaza).
this package, create a file "es_ES.csv" in vendor/mageplaza/mage...spanis/es_ES.csv
I would like to change some words... Now, If I would like to change it, I must go to edit es_ES.csv file in vendor folder... but I think, that it's not correct. So... what it's the correct way in order to change some words that exists in vendor.... es_ES.csv file, but I want to change the translation?
Magento2.3.x
Thanks


texts: Magento 2 UI Grid - How to add tabs in columns control?

texts:
I want to add Tabs in Columns control of my custom extension’s UI Grid to categorize columns.

For Example:


texts: How to add a link in ui form component note?

texts:
Is there a way to add note with link to form ui component. I have try the below code but it doesn't work

<field name="customer_id">
<argument name="data" xsi:type="array">
    <item name="options" xsi:type="object">Company\Module\Model\Config\Source\Customer</item>
    <item name="config" xsi:type="array">
        <item name="label" xsi:type="string" translate="true">Customer</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="dataType" xsi:type="string">number</item>
        <item name="formElement" xsi:type="string">select</item>
        <item name="source" xsi:type="string">customer_id</item>
        <item name="dataScope" xsi:type="string">customer_id</item>
        <item name="notice" xsi:type="string"><![CDATA[Create New Customer]]></item>
        <item name="validation" xsi:type="array">
            <item name="required-entry" xsi:type="boolean">true</item>
        </item>
    </item>
</argument>
</field>

Also I checked the tooltip. But the new customer link doesn't work(It works with ext).

<field name="customer_id">
<argument name="data" xsi:type="array">
    <item name="options" xsi:type="object">Company\Module\Model\Config\Source\Customer</item>
    <item name="config" xsi:type="array">
        <item name="label" xsi:type="string" translate="true">Customer</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="dataType" xsi:type="string">number</item>
        <item name="formElement" xsi:type="string">select</item>
        <item name="source" xsi:type="string">customer_id</item>
        <item name="dataScope" xsi:type="string">customer_id</item>
        <item name="tooltip" xsi:type="array">
            <item name="link" xsi:type="string" translate="true">customer/index/new</item>
            <item name="description" xsi:type="string">Create New Customer</item>
        </item>
        <item name="validation" xsi:type="array">
            <item name="required-entry" xsi:type="boolean">true</item>
        </item>
    </item>
</argument>
</field>

Please help.


texts: send invoice email immediately when customer place an order

texts:
i have this problem,

so once we create the order, along with the order email [its not going to customer] i want to send invoice mail also to customer.

because we are not getting order confirmation email if we do payment through paypal standard method. but we get invoice and shipment mails.


texts: Magento 2: Some texts are not translated

texts:
Magento 2.2.6: Some texts are not translated, like Proceed to checkout, Company, Continue Shopping etc.

I am using below string:-

"Proceed to Checkout","ادفع الآن",module,Magento_Checkout
"Proceed to Checkout","ادفع الآن",module,Magento_Customer
"Proceed to Checkout","ادفع الآن",theme,frontend/Magento/blank
"Proceed to Checkout","ادفع الآن",theme,frontend/Magento/luma

"Company","الشركة",module,Magento_Backend
"Company","الشركة",module,Magento_Catalog
"Company","الشركة",module,Magento_Company
"Company","الشركة",module,Magento_Company
"Company","الشركة",module,Magento_Customer
"Company","الشركة",module,Magento_GiftRegistry
"Company","الشركة",module,Magento_Invitation
"Company","الشركة",module,Magento_MultipleWishlist
"Company","الشركة",module,Magento_Paypal
"Company","الشركة",module,Magento_Reports
"Company","الشركة",module,Magento_Sales
"Company","الشركة",module,Magento_User

Even Last name translated properly as below:-

"Last Name","اسم العائلة",module,Magento_Backend
"Last Name","اسم العائلة",module,Magento_Catalog
"Last Name","اسم العائلة",module,Magento_Company
"Last Name","اسم العائلة",module,Magento_Customer
"Last Name","اسم العائلة",module,Magento_GiftRegistry
"Last Name","اسم العائلة",module,Magento_Invitation
"Last Name","اسم العائلة",module,Magento_MultipleWishlist
"Last Name","اسم العائلة",module,Magento_Paypal
"Last Name","اسم العائلة",module,Magento_Reports
"Last Name","اسم العائلة",module,Magento_Sales
"Last Name","اسم العائلة",module,Magento_User

Please let me know how to define the string in translate CSV to translate in other locale.


texts: Magento graphql query is returning error "TypeError: Failed to fetch". I dont understand the issue. Can anyone please help

texts:
Magento graphql query is returning error "TypeError: Failed to fetch".

I am running it in developer mode.

Endpoint -> http://localhost:81/magento/graphql

Magento version 2.3.3

Windows.


texts: Continue button does not work at checkout

texts:
I have a shop that was working normally but now if the person is at checkout and have not register for registering and when it fills the billing information, the button "continue" has no action, and there is no javascript error. The site is http://livraria.senado.gov.br/checkout/onepage/

Does anyone know what can be?

Thank you


texts: Which are the preferable Payment Gateways in India for Magento?

texts: I need a suggestion regarding implementation of payment gateway in magento site which can take payment transaction from India and International also. Please suggest some.


texts: Magento 1.9 : How to fetch image from url?

texts:
I am using core php functions file_get_contents, file_put_contents but I was asked to change it with alternate functions in magento. I am attaching the following code.

$imgUrl         = $picture_url;
$newfilename    = 'sample' . rand(0000,9999) . '.png';
$fullpath       = Mage::getBaseDir('media') . DS . 'import' . DS .$newfilename;
$image_data     = file_get_contents($imgUrl);
$result         = file_put_contents($fullpath,file_get_contents($imgUrl));
$imgName        = $fullpath;

Then $imgName passed in addImageToMediaGallery.


texts: How to generate random password for new customer while creating account in magento?

texts: I dont want my customer to enter password while creating account in magento.When customer creates account password should be auto generated and mail should be sent to that customer .Can anybody help me out plz...


texts: Accessing data in catalog_product_save_before observer

texts:
I created an catalog_product_save_before observer to update some attributes based on other attributes. Specifically, I use m2epro to update my ebay listings. Sometimes I want ebay to show less in stock than I actually have, so I created 2 new attributies, ebay_qty and ebay_max_qty.

In my observer, I have the following code:

$product = $observer->getEvent()->getProduct();
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);

$Qty = $stock->getQty();
$EBayQty = $Qty;
$MaxQty = $product->getEbayMaxQty();

if (($MaxQty > 0) && ($EBayQty > $MaxQty))
    $EBayQty = $MaxQty;

$product->setData('ebay_qty', $EBayQty);

This is grabbing the qty currently in the database. How do I get the new Qty about to be saved?


texts: api/rest/customers is not working. I am Error 403 access denied though its working for products but not for orders.


texts:
I have upgraded Magento from 2.2.5 to 2.3.1 using composer. Everything downloaded. While running setup: upgrade, I got an error like below,

I checked with the previous version there is decimal version changed in 2.3.x. Any idea why this error?

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (vv.#sql-4a2b_1b18, CONSTRAINT
  QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN KEY (quote_id)
  REFERENCES quote (entity_id) ON DELETE CASCADE), query was: ALTER
  TABLE quote_item MODIFY COLUMN discount_amount decimal(20, 4)
  NULL DEFAULT 0 COMMENT "Discount Amount", MODIFY COLUMN
  base_discount_amount decimal(20, 4)  NULL DEFAULT 0 COMMENT "Base
  Discount Amount", MODIFY COLUMN tax_amount decimal(20, 4)  NULL
  DEFAULT 0 COMMENT "Tax Amount", MODIFY COLUMN base_tax_amount
  decimal(20, 4)  NULL DEFAULT 0 COMMENT "Base Tax Amount", MODIFY
  COLUMN row_total decimal(20, 4)  NOT NULL DEFAULT 0 COMMENT "Row
  Total", MODIFY COLUMN base_row_total decimal(20, 4)  NOT NULL
  DEFAULT 0 COMMENT "Base Row Total", MODIFY COLUMN
  row_total_with_discount decimal(20, 4)  NULL DEFAULT 0 COMMENT "Row
  Total With Discount", MODIFY COLUMN base_tax_before_discount
  decimal(20, 4)  NULL  COMMENT "Base Tax Before Discount", MODIFY
  COLUMN tax_before_discount decimal(20, 4)  NULL  COMMENT "Tax Before
  Discount", MODIFY COLUMN price_incl_tax decimal(20, 4)  NULL
  COMMENT "Price Incl Tax", MODIFY COLUMN base_price_incl_tax
  decimal(20, 4)  NULL  COMMENT "Base Price Incl Tax", MODIFY COLUMN
  row_total_incl_tax decimal(20, 4)  NULL  COMMENT "Row Total Incl
  Tax", MODIFY COLUMN base_row_total_incl_tax decimal(20, 4)  NULL
  COMMENT "Base Row Total Incl Tax", MODIFY COLUMN
  discount_tax_compensation_amount decimal(20, 4)  NULL  COMMENT
  "Discount Tax Compensation Amount", MODIFY COLUMN
  base_discount_tax_compensation_amount decimal(20, 4)  NULL  COMMENT
  "Base Discount Tax Compensation Amount", ADD CONSTRAINT
  QUOTE_ITEM_PARENT_ITEM_ID_QUOTE_ITEM_ITEM_ID FOREIGN KEY
  (parent_item_id) REFERENCES quote_item (item_id)  ON DELETE
  CASCADE, ADD CONSTRAINT QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID FOREIGN
  KEY (quote_id) REFERENCES quote (entity_id)  ON DELETE CASCADE,
  ADD CONSTRAINT QUOTE_ITEM_STORE_ID_STORE_STORE_ID FOREIGN KEY
  (store_id) REFERENCES store (store_id)  ON DELETE SET NULL


texts: Getting Issue on Current Customer Details. Its Related to Caching Problem?

texts:
I am Using Magento 1.9.1.0 . Now i Have to take display the current groupid on phtml file. I have used below coding. There was no luck.

Tried Below Coding to display the group id:-

Trial 1

$roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();

Trial 2

$customer_id = Mage::getSingleton('customer/session')->getId();
$customerz = Mage::getModel('customer/customer')->load($customer_id);
$roleID = $customerz->getGroupId();

Trial 3

$session=Mage::getSingleton('customer/session', array('name'=>'frontend') );
$rolx = $session->getCustomer()->getGroupId();

Trial 4

Mage::getSingleton("core/session", array("name" => "frontend"));
$session1 = $session = Mage::getSingleton("customer/session");
$def = $session1->getCustomer()->getGroupId();

I have tried all above codes. What I Observed is :

It is not giving the current user details consistently and not clearing after the customer was logged out.
After Logout Also Showing the last loggedin customer details.

How can I fix this ?


texts:
is there a possibility to tell magento mini search to search only in one category ?
I found couple of tutorials to get it in advanced search as a dropdown - but i want to specify only one category and in mini search


texts: custom product tab not displayed in Magento 2 enterprise edition

texts:
I have created a custom tab in product detail page used the following code in layout file
Vendor/Module/view/frontend/layout/catalog_product_view.xml
<referenceBlock name="product.info.details">
        <block class="Vendor\Module\Block\Product\View\AskQuestion" name="product.question" template="product/view/ask_question.phtml" group="detailed_info">
            <container name="form.additional.info" label="Form Additional Info">
                <block class="Magento\Captcha\Block\Captcha" name="captcha" after="-" >
                    <action method="setFormId">
                        <argument name="formId" xsi:type="string">product_qa</argument>
                    </action>
                    <action method="setImgWidth">
                        <argument name="width" xsi:type="string">230</argument>
                    </action>
                    <action method="setImgHeight">
                        <argument name="width" xsi:type="string">50</argument>
                    </action>
                </block>
            </container>

            <arguments>
                <argument translate="true" name="title" xsi:type="string">Question And Answer</argument>
                <argument name="sort_order" xsi:type="string">20</argument>
            </arguments>
    </referenceBlock>

The above code displaying tab in product detail page for existing products.
if any new product created, none of the tabs are displayed.
This issue happening only in enterprise edition(2.4.1). Working perfectly in community edition.
Can anyone please suggest me how to resolve this issue. Thanks in Advance!!


texts:
I am overwriting Mage_Checkout module to local as Myshop_Checkout.I almost did and worked perfect.

And in Mage_Checkout i want to change this code,and i dont like to use secure_url.

1.Mage_Checkout original

<secure_url>
        <wishlist>/wishlist/</wishlist>
</secure_url>

To avoid secure url
I edited in core magento like this,

2.Mage_Checkout edited

<!-- <secure_url>
        <wishlist>/wishlist/</wishlist>
    </secure_url>-->
<wishlist>/wishlist/</wishlist>

From above, core magento use secure i want wishlist as normal http://.


texts: I am facing an error while updating  product price because of extra white space around sku code. Any one know how can I remove that space from all  product sku code.


texts: How to get all product image with its sku using Rest API in Magento 2

texts:
Using this api /rest/V1/products/?searchCriteria=[]

  I get all product details any option to get only product images with
  sku


texts: adding addFieldsToFilter() does INNER JOIN on eav tables, removing all products which don't have that attribute

texts:
This is either a simple fix, or something that magento does natively and I'll have to do a workaround (which I still need to know what it is).

Here is my code:

$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToSelect('type')
    ->addFieldToFilter(
        array(
            array('attribute'=>'type_id','eq'=>'simple'),
        )
    )
    ->addFieldToFilter(
        array(
            array('attribute'=>'student_grades', 'eq'=> ''),
            array('attribute'=>'student_grades', 'eq'=> '68,69'),
        )
    )
    ->addCategoryFilter($category)
    ->load(1);

And it generates this SQL (I have <<bracketed>> the join that is the problem):

SELECT `e`.*,
IF(_table_student_grades.value_id>0, _table_student_grades.value, _table_student_grades_default.value) AS `student_grades`,
`cat_index`.`position` AS `cat_index_position`
FROM `catalog_product_entity` AS `e`
-- problem is here!!
<<INNER JOIN>> `catalog_product_entity_varchar` AS `_table_student_grades_default` ON
    (_table_student_grades_default.entity_id = e.entity_id) AND
    (_table_student_grades_default.attribute_id='177') AND
    _table_student_grades_default.store_id=0
LEFT JOIN `catalog_product_entity_varchar` AS `_table_student_grades` ON
    (_table_student_grades.entity_id = e.entity_id) AND
    (_table_student_grades.attribute_id='177') AND
    (_table_student_grades.store_id='264830')
INNER JOIN `catalog_category_product_index` AS `cat_index` ON
    cat_index.product_id=e.entity_id AND
    cat_index.store_id='264830' AND cat_index.category_id='312798' AND
    cat_index.is_parent=1
WHERE ((e.type_id = 'simple')) AND
    (
    (IF(_table_student_grades.value_id>0, _table_student_grades.value, _table_student_grades_default.value) = '')
    OR
    (IF(_table_student_grades.value_id>0, _table_student_grades.value, _table_student_grades_default.value) = '68,69')
    )

THE PROBLEM
what is happening is the INNER JOIN is excluding products that don't have this attribute at all - and I don't want to add this attribute globally and unnecessarily fill the tables - that's what EAV is supposed to be all about.

How do I force a left join for this attribute?


texts: Create session variable to customer login action

texts:
I am trying to hook a session variable to customer login event with the help of this tutorial http://mattmcalear.net/magento-event-observers-user-login/

I have created the module but it is not showing the custom session variable value in the frontend.
What am I doing wrong?

/app/etc/modules/Designota_Savepasscode.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Designota_Savepasscode>
            <active>true</active>
            <codePool>local</codePool>
        </Designota_Savepasscode>
    </modules>
</config>

/app/code/local/Designota/Savepasscode/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Designota_Savepasscode>
            <version>0.0.1</version>
        </Designota_Savepasscode>
    </modules>
    <global>
        <models>
            <designota_savepasscode>
                <class>Designota_Savepasscode_Model</class>
            </designota_savepasscode>
        </models>
        <events>
            <customer_login>
              <observers>
                  <designota_savepasscode>
                      <class>designota_savepasscode/observer</class>
                      <method>customerLogin</method>
                      <type>singleton</type>
                  </designota_savepasscode>
              </observers>
            </customer_login>
        </events>
    </global>
</config>

/app/code/local/Designota/Savepasscode/Model/Observer.php

<?php
class Designota_Savepasscode_Model_Observer
{
    public function customerLogin(Varien_Event_Observer $observer)
    {
        $session = Mage::getSingleton('customer/session');
        $session->setPasscode($login['passcode']);
    }
}

In the frontend I use the below code for getting the session variable

$session = Mage::getSingleton('customer/session');
if($session) {
    $session->getPasscode();
}


texts:
I have got on one page checkout page---> Fatal error: Call to a member function setConfigObject() on a non-object in public_html/app/code/core/Mage/Paypal/Model/Pro.php on line 135.

Please solve this issue.


texts:
I have created a custom category attribute in my magento installation. It works perfectly on the admin side but I cannot figure out how display it in the front end. I have read and think I need a helper script? here is the code for my attribute.

<?php

require_once "app/Mage.php";

Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));

$installer = new Mage_Sales_Model_Mysql4_Setup;

// change details below:
$attribute  = array(
    'type' => 'text',
    'label'=> 'Front Page CTA Desciption',
    'input' => 'textarea',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);

$installer->addAttribute('catalog_category', 'cta_description', $attribute);

$installer->endSetup(); ?>


texts: How to set default text field value in form Magento 2

texts:
I want to set field value of form field in Magento 2.

Actual Result

Expected Result

I have added required code here which are available in my Form.php

<?php
namespace Magenest\Membership\Block\Adminhtml\Gift\Edit;

class Form extends FormGeneric
{
    protected $_status;
    protected $_systemStore;
    protected $_wysiwygConfig;
    protected $productGift;

    public function __construct(
        Context $context,
        Registry $registry,
        FormFactory $formFactory,
        GroupRepositoryInterface $groupRepository,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        DataObject $objectConverter,
        SystemStore $systemStore,
        Config $wysiwygConfig,
        ProductGift $productGift,
        array $data = []
    ) {
        $this->_systemStore           = $systemStore;
        $this->_groupRepository       = $groupRepository;
        $this->_searchCriteriaBuilder = $searchCriteriaBuilder;
        $this->_objectConverter       = $objectConverter;
        $this->_wysiwygConfig = $wysiwygConfig;
        $this->productGift = $productGift;
        parent::__construct($context, $registry, $formFactory, $data);
    }

    protected function _prepareForm()
    {
        $model = $this->_coreRegistry->registry('membership_gift_edit');
        $data  = $model->getData();
        $form = $this->_formFactory->create();
        $form->setHtmlIdPrefix('page_');

        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Gift')." ".$model->getId()]);

        if ($model->getId()) {
            $fieldset->addField(
                'id',
                'hidden',
                ['name' => 'id']
            );
        }

            $fieldset->addField(
                'customer_id',
                'text',
                [
                    'label'    => __('Customer Id'),
                    'title'    => __('Customer Id'),
                    'name'     => 'customer_id',
                    'required' => true,
                ]
            );

        $form->setUseContainer(true);
        $form->setAction($this->getUrl('membership/gift/save'));
        $form->setMethod('post');
        $form->setUseContainer(true);
        $form->setId('edit_form');
        $form->setValues($model->getData());
        $this->setForm($form);
        return parent::_prepareForm();
    }

}

I have tried as below but didn't get result.

Try 1:

            $fieldset->addField(
                'customer_id',
                'text',
                [
                    'label'    => __('Customer Id'),
                    'title'    => __('Customer Id'),
                    'name'     => 'customer_id',
                    'required' => true,
                ]
            );
$fieldset->setValue('myvalue');

Try 2:

            $fieldset->addField(
                'customer_id',
                'text',
                [
                    'label'    => __('Customer Id'),
                    'title'    => __('Customer Id'),
                    'name'     => 'customer_id',
                    'value' => 'test',

                ]
            );

I also refer below link but still facing an issue.
How to set field value of form field in Magento 2


texts: Override starting price in grouped products listing page on second priority using custom customer attribute if tier pricing not available

texts: Override starting price in grouped products listing page on second priority using custom customer attribute (if tier pricing not available).


texts: Magento 1.9 addAttributeToFilter not filtering result

texts:
I have the following code, where I want it to retrieve a list of simple products from the table sales_flat_order_items

$order = Mage::getModel('sales/order')->load($orderId);
$orderItems = $order->getItemsCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('product_type', array('eq'=>'simple'))
        ->load();

The problem is addAttributeTofilter() is not working, it shows me all items in that table instead of simple products. What did I do wrong?


texts: How to get a product by Id in Magento 2?

texts:
I'm trying to display product details from sales_order_item. How can we display information about the product according to its id?
I have this page:

code for this page, I have:

When we click on Order Detail, it will just get that's one and display data to a new page (Page_Detail).

I have this file in Module\Block\Display.php

And in file .phtml:

Can anyone help? Thanks


texts:
I have create promotion products in my cart page which display product image, names and price however when i add a configuable product in to the list the price is showing £0.00. This is the code i am using to show the price.

<?php
$specialPrice = Mage::helper('core')->formatPrice($_product->getFinalPrice());
$normalPrice = Mage::helper('core')->formatPrice($_product->getPrice());
        if ($normalPrice != $specialPrice){?>

        <?php echo  'Now';
        echo  $specialPrice;?>

        <?php }else{?>

        <?php echo $normalPrice;}?

I assume it is showing £0.00 as it is looking for the products price and as it is a grouped product the product itself does not have an actual price as the prices come from the products in the grouped products.

So my question is how can i check if a product is a grouped product and if it is then i need to check for the lowest price and then display that price?

I found some code which checks if a product is a grouped product and if so it grabs in the Associated products so now all i need to do is create a check which checks for the lowest price in the associated products

    <?php if($_product->getTypeId() == "grouped"):
        $associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);

     endif; ?>

If you need more information or i haven't been clear please just let me know.

Thank you in advance


texts: Magento 2.2.3 is not working with PHP 7.1.11

texts:
I have tried to install magento 2.2.3 in php 7.1.11 version. it successfully installed but now issue is admin and front CSS-js are not working.

I have tried so many solutions which are available on net for editing xml file and other removing cache. but its not working.

please help me.


texts:
I'm attempting to do an API post but I get the following error,
405 (Method Not Allowed)
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access.

this is my code:

var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "url + parameters");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Basic: username:pasword");
xhr.setRequestHeader("Accept", "application/json, text/plain, */*'");
xhr.setRequestHeader("Access-Control-Allow-Origin", "Http://127.0.0.1");
xhr.setRequestHeader("Access-Control-Allow-Headers", "Content-Type");
xhr.setRequestHeader("Access-Control-Allow-Methods", "POST,GET");

xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);

Please if anyone could assist.
Thank you


texts: How do I add a Adobe Typekit font to my Magento shop

texts:
I am wondering how I can get my Typekit font working on my Magento site. Normally it works like this.

HTML markup:

<head>
<script src="https://use.typekit.net/oti3nzu.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
</head>

CSS markup:

html, body {
font-family: "niveau-grotesk",sans-serif;
}

So to try this with Magento I added the following to my default_head_blocks.xml inside myVendor/mytheme/Magento_Theme/layout/default_head_blocks.xml

<head>
<link src="https://use.typekit.net/oti3nzu.js"/>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
</head>

I deployed my static content with bin/magento setup:static-content:deploy and if I check the sourcecode of my homepage it shows this line:

<script  type="text/javascript"  src="http://localhost:8888/website/shop/pub/static/frontend/myVendor/mytheme/en_US/https://use.typekit.net/oti3nzu.js"></script>

But it won't load the <script>. I guess I am doing it wrong but also the src to that Typekit javascript should be just "https://use.typekit.net/oti3nzu.js" right? I am stuck.


texts: how to create login and create account page in same page in magento 2

texts: How to create login and register page on the same page and below-attached screen short.


texts: How can i put condition of maintenance mode in index file or Bootstap file in magento 2?

texts:
How can i put condition of maintenance mode in index file or Bootstap
  file in magento 2 ?

I want to check if Maintenance mode i enable or disable conditional base.

How can i check that in Index.php file or Bootstrap.php file in Magento 2 ?


texts:
When somebody adds an item to their cart on my website, there's an observer which adds a few custom options programmatically (mainly because it's much easier and it removes the dependency of having to make sure new products have these fields).

However, when somebody clicks edit on the product I need to make sure these are selected again and it uses a custom block of just HTML right now.

How can I get the values of these options on the product view page when somebody clicks edit? So I can check against the available options and select the ones that the user previously chose.

Thanks.


texts:
After installing varnish, I am unable to get to Web Setup Wizard. The browser spins for a while and then I end up on https://example.com:81/setup with an error that Chrome interprets as: took too long to respond. ERR_CONNECTION_TIMED_OUT which I think means a redirect loop.

My site is Apache and 100% SSL.

My Apache access_log:

127.0.0.1 - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/app/setup/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/ HTTP/1.1" 302 -
[IP] - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/app/setup/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/ HTTP/1.1" 302 -
127.0.0.1 - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/?app=setup HTTP/1.1" 302 -
[IP] - - [31/Dec/2019:20:23:42 +0000] "GET /hdadmin/admin/backendapp/redirect/key/6c049d5d7c7cb9eb0c5a0babee49950449cc73c950d03cb7f74d967563bdf751/?app=setup HTTP/1.1" 302 -

My best guess is that there's something I'm missing in Varnish config that allows access to the setup wizard but I'm not very familiar with varnish setup.


texts:
Magento 1.9.3.7 released which fixes some critical vulnerabilities and http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html#ce19-1936

Here, we are talking about version upgrade issues.

Please share the bugs you are facing while upgrading to Magento 1.9.3.7.


texts:
I'm writing a magento extension and I need to have a phtml template file that is fetched from an external source. It can change remotely.

Currently I'm using http requests to get the file, and then php file access (file_put_contents()) to write it.

However this method sound kinda risky and 'wrong'.
I feel like caching might do some problems and sites that have cluster of servers might not sync those files between them (and maybe other weird behaviors).

So my question is this:

Is there a "magento" why to programatically change phtml files?
If not, do you see any serious dangers / faults with my current implementation?

I know it sound weird to change phtml files but that's what I need to do. Using the block functions just won't cut it (I need a totally different html file that dynamically changes without any firm template I can relay on. I guess I could do the entire phtml is just a call to a block function that returns everything, but that sound silly).

Thanks!


texts: Magento 2.3: Duplicate entire store view to a new one language

texts:
I want to add a new language in my store. It's a language that is really similar to another one already inserted: as example en_GB and en_US.

I'm looking to duplicate it because a big percentage of translations are equal and I don't have to reinsert hundreds of categories and pages translations for the new Store View but just few words.

The default store view is in another language.

What is the best way to do it?


texts: Remove edit item link on magento2 checkout page

texts:
I'm attempting to remove the edit item link on the magento 2 checkout page. I have tried removing the block in checkout_cart_index.xml and checkout_cart_item_renderers.xml using the code below however this does not seem to work. Any help is appreciated.

<referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true" />


texts: Custom email layout handle for custom module

texts:
I have created a custom module, In which I am sending email to customer. email is working fine but I have created a layout handle in layout/test.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <my_name_is_hello>
        <block type="core/template" name="hello"  template="test/sales/items.phtml"></block>
    </my_name_is_hello>
</layout>

This is my content in test/sales/items.phtml

Hello

Now I have called layout handle in my email template file hello.phtml using both method but file is not getting called.

{{layout handle="my_name_is_hello"}}
{{block type='core/template' area='frontend' template='test/sales/items.phtml'}}

Please can anybody suggest me if I am doing something wrong or any solution


texts:
In Customer Account DoB is not saving and giving Error like Please enter a valid date.

For reference please find the attached image.

Thanks in Advance
Somu N


texts: Magento 2.2 HTML; how to change a clickable text into a text with selection boxes?

texts:
I was wondering how to change the following:

Some Text

In a way that I can have a text with a squared box, so that when I click on the box, I am redirected to the same url specified in the  tag. If I click on the text, the box should be selected as well.


texts: Where is the customer ID for Braintree payments stored in Magento 2?

texts:
I am trying to find the Customer ID that is used by the Braintree integration.

I have seen the two tables:

vault_payment_token
vault_payment_token_order_payment_link

Neither include any reference to the Customer ID with Braintree (as far as I can tell the Customer ID in Braintree differs to that of Magento).

I did think perhaps it doesn't store it but then that wouldn't make any sense as how would Magento manage to add new cards in to the vault for that customer on checking out.

Which table would I therefor (hopefully) find a reference to that?


texts: Get product collection only for "parent Products and Catalog Search visibility" products

texts:
I am working on product collection, my requirement is display only parent Products and Catalog Search visibility products only.

$collection = mage::getModel('catalog/product')->getCollection()->joinTable('catalog/product_relation', 'child_id=entity_id', array(
            'parent_id' => 'parent_id'
        ), null, 'left')->addAttributeToFilter(array(
            array(
                'attribute' => 'parent_id',
                'null' => null
            )
        ));
$visibility = array(
                Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
                );

               $collection->addAttributeToFilter('visibility', $visibility);

But this is not giving correct result of product collection.My all products which are present in both cases are not display in my collection.


texts: Editing 2 orders at the same time bug. Is there any patch released for this issue?

texts:
Is there any patch released for this issue?
"when it comes to placing the orders after editing them whereby for instance the editing of 000000002 will result in it's new increment id being 000000001-1." ctto


texts: Magento 2.1.5: Mysql Error when browse Category page which have no products

texts:
When i browse to one category page that do not have any product i receive a report error.

The report says:

  a:4:{i:0;s:2291:"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END, CASE e.entity_id END, cat_index_position ASC, cat_index.position ASC,' at line 5, query was: SELECT 1 AS status, e.entity_id, e.attribute_set_id, e.type_id, e.created_at, e.updated_at, e.sku, cat_index.position AS cat_index_position, e.name, e.short_description, e.price, e.special_price, e.special_from_date, e.special_to_date, e.small_image, e.thumbnail, e.news_from_date, e.news_to_date, e.url_key, e.required_options, e.image_label, e.small_image_label, e.thumbnail_label, e.msrp_display_actual_price_type, e.msrp, e.tax_class_id, e.price_type, e.weight_type, e.price_view, e.links_purchased_separately, e.links_exist, e.width, e.count_products, e.swatch_image, price_index.price, price_index.tax_class_id, price_index.final_price, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS minimal_price, price_index.min_price, price_index.max_price, price_index.tier_price, stock_status_index.stock_status AS is_salable FROM mgyg_catalog_product_flat_1 AS e
   INNER JOIN mgyg_catalog_category_product_index AS cat_index ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id='357'
   INNER JOIN mgyg_catalog_product_index_price AS price_index ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
   LEFT JOIN mgyg_cataloginventory_stock_status AS stock_status_index ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1
   INNER JOIN mgyg_search_tmp_58c98af0dd8588_51220712 AS search_result ON e.entity_id = search_result.entity_id WHERE (e.entity_id IN(NULL)) AND (e.entity_id IN(NULL)) AND (e.entity_id IN(NULL)) ORDER BY CASE e.entity_id END, CASE e.entity_id END, cat_index_position ASC, cat_index.position ASC, CASE e.entity_id END
   LIMIT 39";i:1;s:6726:"

How can i resolve this error?


texts:
I have just been invited to a Magento site. Never recieved an email that I was added as user.
Was able to go to the site and "reset password", but now I get the "You did not sign in correctly or your account is temporarily disabled." error every time.

Even had the person try to add a user with another email. Same story.

What gives? Any suggestions?

Best regards!


texts: How to build in Magento select attribute with image?

texts:
Is there any possible way to create select attribute with image?
For example dropdown list: NEW/SALE/FAV/RATED ... etc and each option with it's own image ?


texts: The each() function is deprecated. Magento 2 , php 7.2

texts:
I have been getting this error since I changed to PHP-7.2

  Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/vedic/vendor/colinmollenhour/cache-backend-file/File.php on line 81

The function is on line 81.

//Don't use parent constructor
while (list($name, $value) = each($options)) {
    $this->setOption($name, $value);
}


texts: What is the difference between \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND and \Magento\ImportExport\Model\Import::BEHAVIOR_ADD_UPDATE in Magento 2?


texts: How to remove website require validation magento on new_action

texts:
How do I remove the validation for 'website required' before saving a new product in Magento? I have a script that auto assigns the website based on logic for on save_before, but the validation fires for new products before my script can run.

I'm looking on how to shut this off.


texts: Custom Block on a Custom Controller Doesn't Render

texts:
I have a custom controller which I'm trying to get a block rendered.

  Company/Module/Controller/Index/Index.php

<?php

namespace Company\Module\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{

    public function execute()
    {
        return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
    }
}

  Company/Module/Block/Hello.php

<?php

namespace Company\Module\Block;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;

class Hello extends Template
{

}

  Company/Module/etc/frontend/routes.xml

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

  Company/Module/view/frontend/layout/testing_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <block name="custom.name" class="Company\Module\Block\Hello" template="testing.phtml"/>
        </referenceContainer>

</page>

  Company/Module/view/frontend/templates/testing.phtml

Hello World

For some reason I don't see
Hello World
 I just see blank / empty content area but the rest of the page is loaded correctly.

I'll really appreciate any help on this.


texts: How to validate Size in Product details page in Magento 1.9.2.4

texts: when i click on add to cart button then no error show without size selection, I want to add some validation on size if customers does not click on size then error will be shown.


texts:
My site is not loading, as I get this error message when type in the URL:

  Fatal error: Call to a member function rewrite() on a non-object in app/code/core/Mage/Core/Controller/Varien/Front.php on line 165

Does any one familiar with what could be wrong here?


texts:
I have a custom column in my  sales_flat_quote_item table named as device_id.
I am working on to create a api where a device id is sent and the cart available items are displayed for guest users.

$deviceId=802;
$quote = Mage::getModel('sales/quote')->load($deviceId);
$cartItems = $quote->getAllVisibleItems();
foreach ($cartItems as $item) {
echo $pid = $item->getProductId();
}

which is not working.Is this not the proper way ?Please help thanks


texts:
I am trying to override phtml file inside theme module. Below is my code

Module.xml

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

Default.xml

<?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">
<body>
    <referenceBlock name="messages">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Theme::messages.phtml</argument>
        </action>
    </referenceBlock>
</body>
</page>

I have placed messages.phtml file in app\code\Netsmartz\Welcomemessage\view\frontend\templates\theme path.

Any idea what could be wrong.


texts:
How can i call Product Qty instead Salable Qty in
            if($product->getTypeId() == 'simple') {
                $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $StockState = $objectManager->create('Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku');
                $qty = $StockState->execute($product->getSku());
                $product->setData('salable_qty', $qty[0]['qty']);
            }

i have deactivate Salable Qty in the trying to decrease product qty when the order is placed and not when it is shipped


texts: How to display the label of the hovered image only?

texts:
I want to display the value of an attribute while hovering over it. Following is the code to display image for that attribute values:

<?php $Technologies = explode(",",$_product->getResource()->getAttribute('technologies')->getFrontend()->getValue($_product)); ?>
    <?php if(count(array_filter($Technologies, 'strlen') ) > 0): ?>

                <?php
                 foreach($Technologies as $key => $value): ?>
                <a href="<?php echo $_product->getProductUrl() ?>">
              <?php echo ""; ?>

         <?php echo $value; ?>

          <?php /*echo $value; */?>

          <?php endforeach; ?>

          <?php endif; ?>

here I wish to display the name of the attribute value only while that particular image is hovered. So I gave the following jquery for that. But it is not working.

When I give style like below all the name of the attribute value are displayed when hovered over any single image.

.technologies:hover .attr-label{
display:block;
}

Kindly help me. Where have I went wrong?


texts:
I have added a customer attribute for customers to select languages that they are fluent in using a multiselect input. I'm trying to get them to display on the frontend but can only get the ID's to display.

Right now I'm using a query in the block to grab the actual labels, but would much prefer if there were an easier way to grab the values instead.

What I'm doing currently:

$langattrA = $customer->getData('customer_languages');

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$attTable = $resource->getTableName('eav_attribute_option_value');

$query = "SELECT value FROM $attTable WHERE option_id in ($langattrA)";
$result = $readConnection->fetchAll($query);

The downfall of this is also that using fetchAll() returns "Array" instead of the actual list of selected languages.

Using print_r($result) is also messy.


texts:
Is Magento playing with me? Products are not showing up on frontpage in the catalog, but at the New Articles they are showing up!

I had similar problems before in previous test databases, but that solved itself by a miracle, but this time i dont know what to do anymore.

I am not a programmer, i am just trying to make a new webpage without big costs.

Is there some code which i have to alter somewhere and how can i do it?
I dont have a direct access at the webserver, so programming the server is not an option, i can up- and download files with FileZilla for files which needs to be altered in de website itself.

I can approach the MySQL and the PHP options.

Please help me out, i tried everything i could manage to do with the websites option, product options and category options.

I am using Magento 1.9.3.1, PHP version 5.5.38, MySQL 5.5.52-cll-lve, Cpanel 60.0 (build 26), Apache 2.4.23.
(Demo-)Site: https://www.deduoffice.nl


texts: Magento 2 - Add Product Edit link grid action but it shows in the Grid total row

texts:
I add the product edit link in grid action by using following code

Path of my grid file: app\code\Vendor\Module\Block\Adminhtml\Abcreport\Grid.php

$this->addColumn('action', array(
                    'header' => __('Action'),
                    'width' => '100',
                    'type' => 'action',
                    'getter' => 'getProductId',
                    'actions' => array(
                        array(
                            'caption' => __('View'),
                            'url' => array('base' => 'catalog/product/edit'),
                            'target'=>'_blank',
                            'field' => 'id'
                        )
                    ),
                    'filter' => false,
                    'sortable' => false,
                    'index' => 'id',
                    'is_system' => true,
                ));

The problem is, edit link shows the grid total row as well, I need to remove the edit link from total row.

Here is the screenshot

I appreciate, if anybody helps


texts: How to extend Sales Statistics grid from Customer > Customer View

texts:
I am trying to add a new column to the grid. Its about the sales.phtml as you can see the XML:

<reference name="left">
            <block type="adminhtml/customer_edit_tabs" name="customer_edit_tabs">
                <block type="adminhtml/customer_edit_tab_view" name="customer_edit_tab_view" template="customer/tab/view.phtml">
                    <block type="adminhtml/customer_edit_tab_view_sales" name="sales" template="customer/tab/view/sales.phtml" before="-" />
                    <block type="adminhtml/customer_edit_tab_view_accordion" name="accordion" />
                </block>
                <action method="addTab"><name>customer_edit_tab_view</name><block>customer_edit_tab_view</block></action>
            </block>
        </reference>

This is my xml:

<adminhtml_customer_edit>
        <reference name="customer_edit_tab_view">
          <block type="adminhtml/customer_edit_tab_view_sales" name="customsales" before="-" template="mymodulename/customer/edit/tab/view/customesales.phtml"/>
        </reference>
</adminhtml_customer_edit>

Is there a way to manage this just from the XML?


texts: How to save custom attribute value in customer entity table using controller

texts:
I want to save value in customer entity table in this table.

I created one custom field & I want to save value in custom field using controller.

But it is not working.

How is it possible?

Controller =>

<?php

namespace Abc\Def\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Customer\Model\Customer;

class Def extends Action
{
    protected $customerCollection;

    public function __construct(Context $context,PageFactory $resultPageFactory,Customer $customerCollection,\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository)
    {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
        $this->customerRepository = $customerRepository;
        $this->customerCollection = $customerCollection;
    }

    public function execute()
    {

        $randomletter = 1
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $customerSession = $objectManager->get('Magento\Customer\Model\Session');
        if($customerSession->isLoggedIn())
        {
            $customer = $this->customerRepository->getById($customerSession->getCustomerId());
            $customer->getCustomAttribute('custom_field');
            $customer->setCustomAttribute('custom_field',$randomletter);
            try
            {
                $customer = $this->customerRepository->save($customer);
            }
            catch (Exception $e)
            {
                return $e->getMessage();
            }
        }
    }
}


texts: Truncate table using resource model in Magento 2

texts:
I have a custom module and i want to add remove every data including the increment id, using resource model in magento 2, i've read the solution in here but this is for magento 1, i'm not sure how to do it in magento 2, for example like this:

$model->getCollection()->truncate();


texts:
I call custom phtml in product.info.details but it's not working.

How I call:

<referenceBlock name="product.info.details">
    <block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/header/test.phtml"/>
</referenceBlock>


texts:
Order saving error: Public hash should be defined

I am go to magento 2 admin panel and sales and go throw places order this error is coming how to slove it?


texts: Upgrade to Magento 2.0.1 Using Composer Readiness Check Fails

texts:
I have a brand new install of Magento 2.0.0 with only the sample data installed.  I had the critical update warning to patch to 2.0.1.  Using the Web Setup Wizard in the dashboard, I get as far as selecting the latest version and all components to update,  but when the readiness check takes place it gives me the following error, all other checks are completed fine.

  Check Component Dependency

  We found conflicting component dependencies. Hide detail

  For additional assistance, see component dependency help .

I followed the guideline link but it is less than helpful!  Here is the code from my composer.json file that it suggests may be wrong.  I have no idea where I am supposed to go next from here.  Any help or advise would be hugely appreciated.

{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.0.0",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"repositories": [
    {
        "type": "composer",
        "url": "https://repo.magento.com/"
    }
],
"require": {
    "magento/product-community-edition": "2.0.0",
    "composer/composer": "@alpha",
    "magento/module-bundle-sample-data": "100.0.*",
    "magento/module-widget-sample-data": "100.0.*",
    "magento/module-theme-sample-data": "100.0.*",
    "magento/module-catalog-sample-data": "100.0.*",
    "magento/module-customer-sample-data": "100.0.*",
    "magento/module-cms-sample-data": "100.0.*",
    "magento/module-catalog-rule-sample-data": "100.0.*",
    "magento/module-sales-rule-sample-data": "100.0.*",
    "magento/module-review-sample-data": "100.0.*",
    "magento/module-tax-sample-data": "100.0.*",
    "magento/module-sales-sample-data": "100.0.*",
    "magento/module-grouped-product-sample-data": "100.0.*",
    "magento/module-downloadable-sample-data": "100.0.*",
    "magento/module-msrp-sample-data": "100.0.*",
    "magento/module-configurable-sample-data": "100.0.*",
    "magento/module-product-links-sample-data": "100.0.*",
    "magento/module-wishlist-sample-data": "100.0.*",
    "magento/module-swatches-sample-data": "100.0.*",
    "magento/sample-data-media": "100.0.*",
    "magento/module-offline-shipping-sample-data": "100.0.*"
},
"require-dev": {
    "phpunit/phpunit": "4.1.0",
    "squizlabs/php_codesniffer": "1.5.3",
    "phpmd/phpmd": "@stable",
    "pdepend/pdepend": "2.0.6",
    "sjparkinson/static-review": "~4.1",
    "fabpot/php-cs-fixer": "~1.2",
    "lusitanian/oauth": "~0.3 <=0.7.0"
},
"config": {
    "use-include-path": true
},
"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"
    },
    "psr-0": {
        "": "app/code/"
    },
    "files": [
        "app/etc/NonComposerComponentRegistration.php"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
        "Magento\\Tools\\": "dev/tools/Magento/Tools/",
        "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
        "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
        "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
    }
},
"minimum-stability": "alpha",
"prefer-stable": true,
"extra": {
    "magento-force": "override"
}

}


texts: Magento Installation Error: SQL max_allowed_packet value

texts:
I am trying to install Magento 2.3.0 CE with Sample data, but the installer fails because my hosting have the max_allowed_packet set to 16M.
In this post of someone with the same problem the issue is solved, setting that variable at 256M.

  https://community.magento.com/t5/Magento-2-x-Technical-Issues/Warning-Error-while-sending-QUERY-packet/td-p/88511

But my hosting refuses to change that setting, arguing that is a system wide parameter in a shared hosting with another customers. And because of this, i am stuck.
Is there any way to install Magento 2.3.0 CE in a SQL server with the max_allowed_packet set to 16M?
I have also read somewhere that the recomended setting for magento is 16M, and i suspect that is the Sample Data is the responsible of this error.
Thank you very much.


texts: Display custom attribute in invoice pdf magento

texts:
I am having custom attribute called FREE OFFER. now i need to display the values of attribute FREE OFFER in invoice PDF.

I displayed the attribute in invoice. but when i click print the output PDF is not displaying the attribute.

   this is the output of the pdf its not showing the FREE OFFER attribute

anyone can help me thanks in advance.


texts: Manage product zoom functionality in Magento 2

texts:
I want to convert Magento magnifier cursor as mouse cursor. Currently Magento roomer has big size.

I want to use some thing like in mentioned URL "http://www.fitatti.com/cami.html".

Please help.


texts: How to activate a new module in magento 1 this module should create a table

texts:
I am trying to activate a new module in Magento 1. Here are my actions step-by-step:

I created a new file in /app/etc/modules, called : Mage_ContactMessage.xml :

I created a new folder in /app/code/core/Mage, called ContactMessage :
with 2 folders : /etc & /sql
The file config.xml in /etc :

The file install-1.6.0.0.php from /sql/contactmessage_setup :

The table is not being created, and I don't understand why. Please help me


texts: Magento 2: Multiple Cart rules not working at a time

texts:
I have two Cart rules, Both rules "discard subsequent rules" set to No.

This cart rule providing 10% discount if someone adding a specific
product with minimum quantity 2, no coupon or no other restrictions
This cart rule providing 5% discount if someone use a specific coupon, can be applied to any products in the cart.

Here both rules working fine while use individually but while use both rules at a time 2nd rule overriding the 1st rule, only applying 5% coupon discount not 10% + 5%, here discount supposed to be 15% of subtotal but I am only getting 5%


texts: Activate downloaded Magento Tempelate in Localhost (xamp server)

texts:
I have downloaded a theme in Magento CMS and now I want to preview this theme in my Localhost xampp server. For that I have installed Magento on my local server.

But I don't know how to preview the downloaded theme in xampp server.

What I have done:
I have copied the app, js, media and skin folders to the folder into the Magento installation directory but nothing made. Please tell me how I can solve this.


texts: Admin Custom Label / Option for dropdown attributes

texts:
I'm having an attribute named color, having values like Dark red, Pale Green, Pink Red etc,.

If i open the same in admin->category->attributes->manage attributes -> color -> Manage options

I can able to see 4 default fields 1. Admin 2. Endlish 3. Position 4. Is Default

Now i'm need to add one more field like Color code to add my color like #5d5d5d

Is there any option in magento to do this ? Or need to add field via db and code those in magento core files ?


texts: Set a new Template of Product type options: Text, Select, Date

texts:
I tried to set a new template of Product options type (text.phtml, select.phtml, date.phtml )but it doesn't work !

Catalog.xml

<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
    <label>Info Column Options Wrapper</label>
    <block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
    <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
        <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
        <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
        <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
        <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
    </block>
    ...
</block>

My xml:

//for a text.phtml
<catalog_product_view>
    <reference name="product.info.options.wrapper">
        <block type="catalog/product_view_options_type_text">
            <action method="setTemplate">
                <template>path/to/new/text.phtml</template>
            </action>
        </block>
    </reference>
</catalog_product_view>


texts:
A client of mine has set in the product catalog adminpage the products per page to 999. But the server is not strong enough to handle the request, due to the ajax call I can't set the dropdown back to a lower value. And the page is loading endless right now.

So my question is where is the value stored of the admin products per page setting (Database, XML) and what is the name/key of the parameter? I want to reset this value.


texts: How to find an a customer based on phone number through API?

texts:
Code Overview

When a user types in a search term php determines whether it's a last name, phone number, or an email. Based on this it will try to find a customer using magento soap api.

what i'm having trouble with is, it doesn't seem like magento soap api has an option to search for a user based on phone number.

Any suggestions for a workaround? I tried programming it by accessing MySQL directly but I feel like there must be a more straightforward solution.

<?php

    $mysql_host =   "localhost";
    $mysql_user =   "root";
    $mysql_pass =   "root";
    $mysql_db  =    "magento";

    $soapUser = "admin";
    $soapPass = "thepassword";
    $soapUrl = 'http://localhost/magento/api/v2_soap/?wsdl=1';

    session_start();

    // regex patterns
    $name_pattern = '/^[a-zA-Z]*$/';
    $phone_pattern = '/^((([0-9]{1})*[- .(]*([0-9]{3})[- .)]*[0-9]{3}[- .]*[0-9]{4})+)*$/';
    $email_pattern = '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$^';

    if ('POST' === $_SERVER['REQUEST_METHOD']) {

        $search_term = $_POST['search_term'];

        // determine what kind of search term it is

        if (preg_match($name_pattern, $search_term)) {
            $client = new SoapClient($soapUrl);
            $session = $client->login($soapUser, $soapPass);

            $complexFilter = array(
                'complex_filter' => array(
                    array(
                        'key' => 'lastname',
                        'value' => array('key' => 'in', 'value' => $search_term)
                    )
                )
            );

            $result = $client->customerCustomerList($session, $complexFilter);

            var_dump ($result); // for now
        }

        elseif (preg_match($phone_pattern, $search_term)) {
        // no soap method - use direct mysql

        }

        elseif (preg_match($email_pattern, $search_term)) {
            $client = new SoapClient($soapUrl);
            $session = $client->login($soapUser, $soapPass);

            $complexFilter = array(
                'complex_filter' => array(
                    array(
                        'key' => 'email',
                        'value' => array('key' => 'in', 'value' => $search_term)
                    )
                )
            );

            $result = $client->customerCustomerList($session, $complexFilter);

            var_dump ($result); // for now
        }

        else {
            echo "you typed in something weird";
        }

    }

?>
<html>
    <head>
        <title>Find Customer</title>
    </head>

    <body>
        <form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
            <label for="search_term">Search Term:</label>
            <input type="text" name="search_term">
            <input type="submit" value="search">
        </form>

        <?
            /* if something is found it will go here */
        ?>
    </body>
</html>


texts: Magento 2: How to pass object as a argument from phtml

texts: I want to pass object as a argument from phtml file how can I do this? As I've checked we can pass string using $block->setData('var','test') but didn't found for object.


texts: What is the difference between isSalable() and isAvailable()?

texts:
What is the difference between isSalable() and isAvailable() ? Are these functions differ for each product types? Any clarification will be appreciated.
Thanks in advanced.


texts: The image of the product will show when on the actual product page and it is the only product on the page but when on you search the SKU there is no thumbnail picture or when scrolling or browsing on a category page, product photos do not appear.


texts: How to make field to filter optional in magento?

texts:
I have to get some data from order collection and I wrote this piece of code:

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('customer_id', $customerId)
    ->addAttributeToFilter('increment_id', $incrementId)
    ->addAttributeToSelect('*');

The problem is that I want to make a field "increment_id" a optional one. If variable $incrementId will be a null the code:

-addAttributeToFilter('increment_id', $incrementId)

should be not considered.


texts:
I have a variable $ customerProductPrices that contains data like this.

How to format data (price, special_price, price_value, special_price_value) in a variable
That I would get not just a number, but a formatted number with currency.
Tentatively, the variable will contain not only 0 arrays, but more


texts: Magento 2 - Admin ACL Access Control Lists

texts:
I have problem with Admin ACL Access Control Lists.

When I switch to module for url /magento_listingwizard/scanimage/index
everything goes well, but when I use /magento_listingwizard/scanimage/new/ I have a problem with permissions.


texts: Observer on customer_register_success event, not called

texts:
I've created a custom module, that looks like this:

config.xml

<config>
    <modules>
        <Mycode_GroupRegister>
            <version>0.1.0</version>
        </Mycode_GroupRegister>
    </modules>
    <global>
        <models>
            <groupregister>
                <class>Mycode_GroupRegister_Model</class>
            </groupregister>
        </models>
        <events>
            <customer_register_success>
                <observers>
                    <Mycode_GroupRegister_Model_Observer>
                        <type>singleton</type>
                        <class>Mycode_GroupRegister_Model_Observer</class>
                        <method>CustomerRegister</method>
                    </Mycode_GroupRegister_Model_Observer>
                </observers>
            </customer_register_success>
        </events>
    </global>
    <frontend>
        <routers>
            <customer>
                <args>
                    <modules>
                        <Mycode_GroupRegister before="Mage_Customer">Mycode_GroupRegister</Mycode_GroupRegister>
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>
</config>

Observer.php

<?php
Class Mycode_GroupRegister_Model_Observer extends Mage_Core_Model_Abstract
{
    public function CustomerRegister($observer)
    {
        die();
        Mage::log('IN CustomerRegister()', null, 'test_register.log');
        $data = Mage::getSingleton('core/app')->getRequest();
        $customer_type = $data->getParam('customer_type');
        try {
            $customer = $observer->getCustomer();

            if ($customer_type == 'wholesale') {
                $customer->setData('group_id',2);
                $customer->setCustomerActivated(0);
                $customer->save();
            } else {
                $customer->setData('group_id',3);
                $customer->save();
            }
            $customer->save();
        } catch (Exception $e) {
            Mage::log("Mycode_GroupRegister_Model_Observer failed: " . $e->getMessage());
        }
    }
}

It seems that the observer is never called. I have used this extension in another website before and it was working ok. But it's not working on this one.
Could you help me fix it?


texts: Retrieve only selected simple product from configurable product

texts:
I currently have an extension that replaces the old product view page with a custom one, showing several configurable options, as the customer goes through the options it filters down to a simple product and they can purchase it

I currently have 3 links placed at the bottom of the page which are attributes (related to the simple products) but they only refer to the configurable product.

I have changed the following;

<?php if($_product->getPdfLink()){ ?>
<a href="<?php echo $_product->getPdfLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/acrobat_reader_25x25.gif'); ?>" alt="" />
<?php } ?>
<?php if($_product->getPsLink()){ ?>
<a href="<?php echo $_product->getPsLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/photoshop_25x25.gif'); ?>" alt="" />
<?php } ?>
<?php if($_product->getIndesignLink()){ ?>
<a href="<?php echo $_product->getIndesignLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/indesign_25x25.gif'); ?>" alt="" />
<?php } ?>

To the following;

<?php if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){}
endif;
?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getPdfLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/acrobat_reader_25x25.gif'); ?>" alt="" />
<?php } ?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getPsLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/photoshop_25x25.gif'); ?>" alt="" />
<?php } ?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getIndesignLink();  ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/indesign_25x25.gif'); ?>" alt="" />
<?php } ?>

The code works, however it actually refers to all of the simple products related to the selected configurable...

How do I get it so it only shows the attributes related to the filtered simple product

Any help is appreciated!


texts:
In Magento 1.x you could send a transactional email as follows.

$identity = Mage::getStoreConfig('section/group/identity',Mage::app()->getStore());

            $identityName = Mage::getStoreConfig('trans_email/ident_'.$identity.'/name');
            $identityEmail = Mage::getStoreConfig('trans_email/ident_'.$identity.'/email');

            $emailTemplate = Mage::getStoreConfig('section/group/template',Mage::app()->getStore());

            $sender = Array('name' => $identityName,
                            'email' => $identityEmail);

            $store = Mage::app()->getStore();

            $vars = Array('subscriber_email' => $email);

            // Translation
            $translate  = Mage::getSingleton('core/translate');

            // Send email
            try {
            $transactionalEmail = Mage::getModel('core/email_template');
            $transactionalEmail->sendTransactional($emailTemplate,
                                                                     $sender,
                                                                     $email,
                                                                     $vars,
                                                                     $store->getId());

            } catch (Exception $e) {

            }

            // Translate
            $translate->setTranslateInline(true);

            }

How would I go about forming a class to accomplish the same in Magento 2.x? I've tried going over the unit test controllers inside the Magento code sample but I am not seeing how it all ties together.


texts: Outdated codesniffer in MEQP2 composer.json for Magento 2.2?

texts:
How to correctly test against MEQP2 standard?

Normally i use

vendor/bin/phpcs --standard=PSR2

To supress errors a i use this:

//phpcs:ignore

or

//phpcs:disable PSR2

When using MEQP2 standards this will not work since composer requires old "squizlabs/php_codesniffer": "2.6.2" that does not knew new phpcs syntax ...

  Note: Before PHP_CodeSniffer version 3.2.0, use // @codingStandardsIgnoreLine instead of // phpcs:ignore. The @codingStandards syntax is deprecated and will be removed in PHP_CodeSniffer version 4.0.

https://github.com/magento/marketplace-eqp/blob/c82070eca1075569578206430a6ef7975f7eeec1/composer.json#L8

What correct ...?

Use old phpcs ignore syntax and wait for an update or just update MEQP2 to "squizlabs/php_codesniffer": "3.2.2"?


texts: I want to view admin selected product on a specific page

texts:
when the admin select some random products from different category  in back end . in the frontend it should be listed.

Thank you


texts: How extremly Magento 1 perfomance can be Optimized

texts:
I am using magento 1.  My site is developed with porto theme. If i look porto theme demo it has better perfomance than mine.

I ma using Simple Helix shared hosting for my site. Also,  using full page caching module.

Issue is when my site loads it takes 10-15 seconds for home page, 20-25 seconds to load category page and 20-25 seconds for product detail page.

There are only 25 products in mysite and hardly 20 categories. On home page there is 3 sections called Best Seller  and Featured Products  ,  Footer Contains CMS page links etc.

I have Done following tasks to optimize my magento:

Gzip Compression (Htaccess code)
Leverage Browser cache(htaccess code)
Enable Keep Alive
Css Optimization
js Optimization
Images Optimization
Flat Catalog
Magento caching
Full Page Caching

I have done all above techniques to optimize my magento site. Also, did remove some blocks which was taking load  but still it takes 10-15 seconds.

How can i figure out why my magento taking too much time to load?  What tools i need to use to figure out load taking elements?
When site loads first it takes 10-15 second. as i have used Full page caching when second time page will load it will take 2 to 3 seconds.

How can i optimize it to load in 3-4 second when load first time?
What else you recommend?  How can i optimize category page and Product detail page?

Any help would be greatly apprecaited.


texts: I have problem with transactional email -magento 1.9

texts:
Can anyone help me to send transactional email through the custom module and its editable with transactional email in backend template?

I want to send transactional email but it's not working.

I have created below function to send email from transactional email.

        $translate = Mage::getSingleton('core/translate');
        $translate->setTranslateInline(false);
        $receverEmail=Mage::getStoreConfig('ultimo/education_email/education_sendemail');
        $custom_template=Mage::getStoreConfig('customer/account_share/custom_template');
        $custom_identity=Mage::getStoreConfig('customer/account_share/custom_identity');

         Mage::getModel('core/email_template')
        ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
        ->sendTransactional(
            $custom_template,
            array('name' => $fromName,'email' => $fromEmail),
            $receverEmail,
            null,
            array('name' => $params['person-name'],'email' => $params['person-email'],'school_name' => $params['school-name'],'school_address' => $params['school-address']));

        $translate->setTranslateInline(true);


texts: How to get how many times a product was added to cart or Bag from sales_flat_quote_item table?

texts: I would like to get how many times a single product that was added to cart from sales_flat_quote_item table. Please guide me how do it achieve this. Thanks


texts: Product flat data “Cannot initialize indexer processor”

texts:
I tried re-indexing with script reindexing.php file in root Reference:

<?php
 require_once 'app/Mage.php';
 $app = Mage::app('admin');
 umask(0);
 for ($index = 1; $index <= 8; $index++) {
    $process = Mage::getModel('index/process')->load($index);
    $process->reindexAll();
}
?>

And on running this it shows me this error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs' in /home/ccg/public_html/lib/Zend/Db/Statement/Pdo.php:228

I First tried reindexing from backend which doesn't reindex Product Flat Data ? How to fix this issue, how to know the 1118 Row ? and change the row type ?

Also, if i disabled product flat data, does that support for products while importing from CSV File ?


texts: Magento 2: Getting “regionId is a required field.” when I click button "Place Order"

texts:
I am Getting

  regionId is a required field.

when I click button "Place Order" on the checkout page

I tried this solution https://magento.stackexchange.com/a/205232/65951 and it worked but then the state is not being saved after placing an order. I want to save state info too.


texts: Which is the better css framework for a magento 2 custom theme?

texts:
If you have to create a custom theme which is the better css framework for magento 2 and why? Or it is better not to use any of them?

Bootstrap
Foundation
None
Another one

please write the motivations


texts: Standard practice of Magento 2 extension development

texts:
I am developing a Magento 2 extension. When I validate this extension on Magento Market place its giving me some warnings like :

Use of protected class members is discouraged.
Property name \"$_resultJsonFactory\" should not be prefixed with an underscore to indicate visibility

I want to know what could be the best practice to develop any extension in Magento 2 with all standards which allowed in Magento marketplace.


texts: Custom shipping option price is not set in cart page

texts:
I write a custom shipping module.

The problem is if I selected a shipping option, that option price is not set & display as 0 in cart page.

How I resolve this?

Please refer my attached screenshot.


texts: Magento2 Allow svg and pdf file upload via wysiwyg editor

texts:
I know this has been asked before but have not seen any answer for Magento2
I have a Magento2.4 website and I want to when creating a cms page be able to upload and insert into the page a link to a pdf as well as be able to insert a svg based image.
Currently both those file types are blocked.
I created a module I call Customfileuploads
and in the modules etc/di.xml file I have the below however it does not seem to work when I try to then add a svg to the file manager in the admin panel.
 <?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
        <arguments>
            <argument name="extensions" xsi:type="array">
                <item name="allowed" xsi:type="array">
                    <item name="jpg" xsi:type="string">image/jpg</item>
                    <item name="jpeg" xsi:type="string">image/jpeg</item>
                    <item name="png" xsi:type="string">image/png</item>
                    <item name="gif" xsi:type="string">image/gif</item>
                    <item name="svg" xsi:type="string">text/html</item>
                </item>
                <item name="image_allowed" xsi:type="array">
                    <item name="jpg" xsi:type="string">image/jpg</item>
                    <item name="jpeg" xsi:type="string">image/jpeg</item>
                    <item name="png" xsi:type="string">image/png</item>
                    <item name="gif" xsi:type="string">image/gif</item>
                    <item name="svg" xsi:type="string">text/html</item>
                </item>
                <item name="media_allowed" xsi:type="array">
                    <item name="flv" xsi:type="string">video/x-flv</item>
                    <item name="avi" xsi:type="string">video/x-msvideo</item>
                    <item name="mov" xsi:type="string">video/x-sgi-movie</item>
                    <item name="rm" xsi:type="string">application/vnd.rn-realmedia</item>
                    <item name="wmv" xsi:type="string">video/x-ms-wmv</item>
                    <item name="svg" xsi:type="string">text/html</item>
                </item>
            </argument>

        </arguments>
    </type>
</config>


texts: How do we map two SKUs to one option in a configurable product

texts:
We are setting up an ecommerce store with Magento 2,4.
We have a product structure with Configurable product with configurations for Size, Color and Type. The Type comes in A, B and C and the SKU are setup to reflect that.
This is a multi store setup and one of the stores wants to show the Type as "Light" and "Dark" instead of A, B and C . Type A and B from our inventory is mapped to "Light" and C is mapped to "Dark". Since C is mapped directly to "Dark" , it works fine. The issue is with "Light" and A & B.
The Rules are
1 If both A and B are available , we will pick B to show on the front end and process further . “Light” box will be clickable in the store.
3. If only A is available , we will show A in the front end and will process A for the order .“Light” box will be clickable.
4. If only B was available , we will show B in the front end and will process B for the order .“Light” box will be clickable.
5. If both A and B are not available , "Light" will show as not available.
Could you please help with suggestions on possible approach to solve this or plugins that could be used ?


texts: Use CMS blocks inside product attributes

texts:
I want to use CMS blocks inside product attributes, eg in description and short description.

inside product description I've added {{block id="test1"}}.
i have two observer

catalog_product_collection_load_after for collections
catalog_controller_product_view for products

Observer:

public function execute(Observer $observer): void
{
    $product = $observer->getProduct();
    $this->helper->parse($product);
}

Helper:

use Magento\Cms\Model\Template\FilterProvider
...
public function __construct(Context $context, FilterProvider $filterProvider)
{
    $this->filterProvider = $filterProvider;
    parent::__construct($context);
}

public function parse(Product $product): void
{
    # some code to get attribute code and value
    ...
    $attributeValue = $this->insertCmsBlocks($product, $attributeCode, $attributeValue);
    $product->setData($attributeCode, $attributeValue);
}

public function insertCmsBlocks(Product $product, string $attributeCode, string $attributeValue): string
{
    ...
    $attributeValue = $this->filterProvider->getBlockFilter()->filter($attributeValue);
    ...

    return $attributeValue;
}

Category page

This works w/o any problems ...

Product page

Instead of default LUMA theme product page "compare" and "wishlist" block is loaded ...

block_html and full_page is disabled ...
$this->filterProvider->getBlockFilter()->filter($attributeValue) looks ok when debugging

If I comment $this->filterProvider->getBlockFilter()->filter($attributeValue) everthing works ... so, there is no problem with the event, cache or $product->setData() ...

Any ideas whats wrong with this code?


texts: Any recommendations for MagentoSAP B1 Integration tools/ connectors

texts:
We are looking into solutions for Any recommendations for Magento (Community Edition - Ver 1.5.1.0)<>SAP B1 (Version 9) Integration tools/ connectors.

Can anyone suggest/ recommend a solution they have implemented successfully to achieve a really successful/ slick intergration between these two platforms.

We would look to achieve individual customer discounts/ group product discounts based on a 'standard' price list in SAP. We want a solution that is very fast, with little server resource, and without massive data sync if possible.

We want to be able to 'sync'-

Web orders. (inc Backorders if poss)
     Customers (all details to create accounts on Magento and registrations back into SAP as CRM leads)
     Prices (from multiple price lists)
     Individual customer pricing/ discounts/ product group discounts/ special product discounts/ special offers etc
     Stock levels (live)
     Product details/ descriptions/ images - creating products in SAP for Magento
     Administration / management of items/ customers on SAP to enable, disable etc.

If you can give me some possible solutions, and your experiences of these if you use them, that do all or most of the above that will be greatly appreciated.

Cheers in advance.


texts: Magento 2 - "Starting at" does not show lowest price

texts:
This is a group product with tier prices in our shop. As you can see, the lowest possible price is 151,20 €.

But in the category view it shows 167,20 € instead of 151,20 €

How can I fix it?


texts: How do I create an online refund for an order that has not been shipped yet?

texts:
My Google-fu is failing me on this one, however, I want to be able to do a complete refund online for an order that has not been shipped yet.

The gateway (Barclaycard's one) works fine for complete online refunds, and yes I can do an offline refund, however, I would like to be able to refund (make a credit note in Magento parlance) with it coming off the customer's card and without having to make a delivery.

Any ideas? Is there a config setting on a payment gateway that allows for this?


texts: Change order price after selecting payment method

texts:
How can I change the total payment value according to payment methods programmatically?
For eg. A product has price $100 then If someone order this product and choose Check / Money Order the price should be change to $80.


texts: Refund unsettled transactions using Authorize.net

texts:
We're running into an issue with refunding Auth.net transactions that haven't yet settled.

Works:

  New Order in Pending Status > Clicking Void voids the transaction in
  Auth.net and the customer is not charged when the batch settles at the
  end of the day

Works:

  New Order in Pending Status > Order is invoiced, goes into Processing
  status, wait until batch settles in Auth.net > Credit Memo can be
  created as long as the batch has settled at Auth.net

Does not work:

  New Order in Pending Status > Order is invoiced, goes into Processing
  status, needs to be refunded right away > Credit Memo cannot be
  created because the batch hasn't settled at Auth.net

Error: the referenced transaction does not meet criteria for issuing a credit

I'm sure we're not the only ones encountering this issue: http://www.magentocommerce.com/boards/v/viewthread/271135/

We've thought about voiding the transaction from Unsettled Transactions and using the Refund Offline option when creating a credit memo, but it seems this would leave 2 transactions (original charge & refund) in Magento and just the voided transaction in Auth.net reporting.

What are some ways others have worked around this issue?

Update: Looks like "authorization reversal" is available in EE – http://chepri.com/new-enterprise-release-packed-with-features-you-dont-want-to-miss/

  Authorization reversal. This feature allows the release of funds put
  on hold for unsettled orders. This feature is useful when a customer
  decides to cancel an order and contacts the administrator. In this
  case, the administrator will be able to release the amounts on hold
  without the required waiting period. (This feature is not available
  for American Express cards.)