texts: Showing recently viewed prodcuts only if there are any

texts:
I added "Recently viewed products" to the bottom of the product view page by adding this code in to local.xml file:

<!-- Showing Recently Viewed Products on Product View Page -->
<catalog_product_view translate="label">
    <reference name="content">
        <block type="reports/product_viewed" name="right.reports.product.viewed" as="recently_viewed" template="reports/product_viewed.phtml" />
    </reference>
</catalog_product_view>

It works great, however the container for the recently viewed product is always showing even if there are no recently viewed products.

How can I add a condition to the above code in local.xml so that the "Recently viewed product" should show only if any recentley viewed product exist?

Thanks


texts:
Seems like it is complaining about using a deprecated pseudo-event. Also, If I remember correctly console.trace is used for debugging and should not be shown/needed on live site. The JQMIGATE code seems to do this console.trace which adds notifications in the console.

However, It basically restores deprecated features and behaviors so that older code will still run properly on the current jQuery version and later.

In this case, is it safe to disable it?

Could anyone please guide me with this?


texts: Magento 2: How to load the js file in the xml file?

texts:
Magento Version: 2.0.0

There have some javascript files should be loaded into the template. How to load them such as importing the css file in  tag?


texts: Move uploaded images to a folder using custom module

texts:
I am trying to move the uploaded image to a folder by a custom module.

In /var/www/html/magento16f/app/code/local/Custommodule/ReviewRating/controllers/IndexController.php

public function move_uploadedFileAction( ) {
    Mage::log($_FILES);

    $path = Mage::getBaseDir() . '/uploadfolder';
    Mage::log( $path );
    if (!file_exists($path)) {
        mkdir($path, 777, true);
    }
    try {
        $fname = $_FILES['unverified-images']['name'];
        $uploader = new Varien_File_Uploader('unverified-images');
        $uploader->setAllowedExtensions(array('png', 'gif', 'jpeg', 'docx'));
        $uploader->setAllowCreateFolders(true);
        $uploader->setAllowRenameFiles(false);
        $uploader->setFilesDispersion(false);
        $uploader->save($path, $fname);
        Mage::log( $uploader );

    } catch (Exception $e) {
        echo 'Error Message: ' . $e->getMessage();

    }

   $this->_redirectReferer();

  }

In /var/www/html/magento16f/app/design/frontend/base/default/template/reviewrating/signupformhb.phtml

''''''''''''''''''''''
   <input type="file"  multiple="multiple" name="unverified-images" value="Upload" />

 '''''''''''''''''''''''''

This function calls a js function which trigger some api on sussess of api return i want to move the uploaded images to a folder and then share the link.

In js file i call below function

  function write_review() {
    var form = document.getElementById('hb_writereview_user');
    var url = "http://somewebsite.com?api";
    var params = form.serialize();
    httpRequest (params, url, 'POST', function (response) {
        if(response.error) {
            document.getElementById('hb_show_message_review').innerHTML=response.message;
        } else {
                uploadFileHb(params);

        }
    });
}

In  /var/www/html/magento16f/app/design/frontend/base/default/template/reviewrating/signupformhb.phtml

<script type="text/javascript">
//<![CDATA[

function uploadFileHb( myFileObject ) {
    var xhr = new XMLHttpRequest();

    // Open our connection using the POST method
    xhr.open("POST", "<?php echo $this->getUrl('reviewrating/index/move_uploadedFile') ?>");

    // Send the file
    xhr.send(myFileObject);
}

  I am not getting log (Mage::log) from controller


texts: Change expiration time of password reset link

texts:
So I need to reduce the time after which the password-reset link expires, because right now it is either too long, or doesn't expire at all...

I tried looking up in System/Configuration/Admin... but f.e. in Security (as I saw an example) I don't have Password Lifetimeor Password Change fields. Actually - nothing connected to password.

So any suggestions ?

Update: I found another setting -> Recovery Link Expiration Period (days) in System/Configuration/Admin/Admin User Emails but the minimum is 1 day... and I need something like 2 minutes.

Is it possible to change it somehow through the DB with some query or with an installation script ? I mean - change the whole setting (to be in minutes, for example), but not only the number.


texts: join tables for get payment method of order id

texts:
I need to join 3 tables to get payment method of specific order id
Let me explain my query.

I have to load a custom_id and take saved order id from my table 'custom_data'. Now I want to find which payment method is used for this order id.


texts: Redirect all pages to homepage via .htaccess except backend

texts:
I've been trying to redirect all pages of my Magento website to homepage via .htaccess - except the backend, naturally. Currently, I'm using these rules and everything is working fine so far but I want to access my backend (domain.com/office):

# Redirect the all pages to homepage

RewriteEngine On
RewriteCond %{REQUEST_URI} !/$ [NC]
RewriteCond %{REQUEST_URI} !.(css|fonts|gif|jpe?g?|png|ico) [NC]
RewriteRule ^(.*)$ / [R=302,L]

Can someone help me with this? I've been trying many rules but none of them worked well. With some rules, when I try to access my backend, I'm still redirected to homepage. With other rules, I got a ERR_TOO_MANY_REDIRECTS error message.

Thanks!


texts: How can I disable coupons for a particular order item (or the entire order, if needed)?

texts:
We have an extension which can lower the price on specific items for specific customers (using setCustomPrice() on the quote_item).

When we utilize this extension we would like to disable coupons--ideally just for the item with the custom price; however disabling it for the entire order would be suitable as well.

How would I go about marking a particular order item, or entire order, as invalid for coupons?


texts: Attributes not appearing in grids like "add crosssell products" - data migration caused issue

texts:
I have a magento site that was created by the official data migration, but recently I added 2 attributes post migration.

Today I noticed that the "add related/crossell/upsell" grid displays these two attributes. But none of mine. No combination of configuration options changes that.

So I am puzzled as to why, and how.

Alas these new attributes aren't attributes of particular value there but I would love to have other attributes show in these tables it would help a lot.

The same attributes also end up showing by default in the admin product grid for a brand new user, which I am assuming is related.

I could not see anything in the settings and I have been looking around the code :-

app\code\Magento\Catalog\Controller\Adminhtml\Product\CrosssellGrid.php
app\code\Magento\Catalog\Controller\Adminhtml\Product\Crosssell.php
app\code\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Crosssell.php
app\code\Magento\Catalog\view\adminhtml\layout\catalog_product_crosssellgrid.xml
app\code\Magento\Catalog\view\adminhtml\layout\catalog_product_crosssell.xml

I can't find anything relevant

I am assuming it is another case where Magento Admin has put logic in its admin interface that should be at the code or database defaults level.

Anyone encountered that?


texts: Magento 2 : How to remove & adjust some value from wishlist?

texts:
Remove: I want to remove the quantity text field & I don't want to use CSS to hide qty text field.

Adjust: I want to show Edit & remove the link above the add to cart button. How to do this by move & destination syntax?

Updated 1: Need to move to delete icon above add to cart button (DONE).

Updated 2: How to remove quantity text field. (Done)


texts:
Whenever Add Secret Key to URLs feature is enabled in admin, admin grid is redirecting to dashboard.

When it is disabled it is redirecting to correct URL(same page).

Please suggest how to pass secret key to URL.

return $resultRedirect->setUrl('*/*/index');


texts: Get custom attribute dropdown/multiselect options label and value in Magento 2

texts:
I created customer custom attribute with input multiselect like this:

$code = 'multiselect_test';
$insertData = array(
        "type"     => "text",
        "backend"  => "",
        "label"    => 'Multiselect Input',
        "input"    => 'multiselect',
        "source"   => "",
        "visible"  => true,
        "required" => false,
        "default" => "",
        "frontend" => "",
        "unique"     => false,
        "note"       => ""
      );
       $values = array('Briteny','James');
       $insertData['source'] = 'Magento\Eav\Model\Entity\Attribute\Source\Table';
       $insertData['backend'] = 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend';
       $insertData['option']['values'] = $values;

$customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, $code,  $insertData);
      $attribute   = $customerSetup->getAttribute(\Magento\Customer\Model\Customer::ENTITY, $code);

      $attribute = $customerSetup->getEavConfig()->getAttribute(\Magento\Customer\Model\Customer::ENTITY, $code);
      $used_in_forms[]="adminhtml_customer";
      $used_in_forms[]="checkout_register";
      $used_in_forms[]="customer_account_edit";
      $attribute->setData("used_in_forms", $used_in_forms)
      ->setData("is_used_for_customer_segment", true)
      ->setData("is_system", 0)
      ->setData("is_user_defined", 1)
      ->setData("sort_order", $data['sorting_order']);

    try {
      $attribute->save();
    } catch (Exception $e) {
      $this->_logger->addError($e->getMEssage());
    }

i created a custom input for customer registration form in frontend for that custom attribute like this:

<select multiple name="multiselect_test">
  <option value="0">Britney</option>
  <option value="1">James</option>
</select>

when i looked in backend to edit the customer info in account information the custom attribute input value from frontend was not there, i guess it's because the value for this custom attribute is wrong (not 0 or 1), then i try to insert the value from backend and save it, and the input value save properly, when i try to retrieve the value like this:

$cattrValue = $customer->getCustomAttribute('multiselect_test')->getValue();

i got this result :

39,40

In conclusion  i need to know how to retrieve this multiselect/dropdown custom attribute real value and label information, so i can use it to create custom attribute input for customer registration properly, or use it for other process in backend


texts: Switching attribute code for two attributes

texts:
we have two attributes for color. A multiple select color (for all used colors on a shirt) and a select color main_color for Google shopping.

Now we have some shopping extensions that default to the color attribute. And break because this is a multiple select instead of single value. Now we could just change that. The problem is that these attributes have been populated for all our products.

Question: is there an easy way to switch the attribute code for these two attributes - whilst keeping the values linked?


texts: Why is magento so slow? Wait up to 35 seconds

texts:
Magento gives a very late response. Wait up to 35 seconds.

The server where it is hosted serves other non-Magento sites super fast. What is it about the PHP code that Magento uses that makes it so slow, and what can be done to fix it?
also, I use MaxCDN for media files


texts: After delete a store from magento1.9.1 website showing internal 505 errors?

texts: After delete a  stores views from magento1.9.1  admin my website category and static pages pages showing internal 505 errors


texts: Magento 1.9 multi-select attributes not appearing in layered navigation

texts:
First post!  I have inherited a Magento 1.9.4.5 install with multiple store views.
I have a global attribute (added to all attribute sets) for "Diet and Lifestyle", multi-select with four options (Vegetarian, Vegan, Free From and Organic)
Categories are set to be anchored, and "normal" attributes work perfectly in layered navigation, but the Multi-Select attributes will not pick up any values for filtering.
If I set the attribute to be "Use In Layered Navigation" -> Filterable (no results) I get the attribute showing but the product counts are all zero.
I've checked the database and the values are there in the catalog_product_entity_varchar table:
SET @entity_id = 20795;  -- sku 31889
(SELECT e.attribute_id, e.attribute_code, 'varchar' AS TYPE, v.store_id, v.value FROM catalog_product_entity_varchar v
JOIN eav_attribute e ON e.attribute_id = v.attribute_id WHERE v.entity_id = @entity_id)
UNION
(SELECT e.attribute_id, e.attribute_code, 'datetime' AS TYPE, v.store_id, v.value FROM catalog_product_entity_datetime v
JOIN eav_attribute e ON e.attribute_id = v.attribute_id WHERE v.entity_id = @entity_id)
UNION
(SELECT e.attribute_id, e.attribute_code, 'decimal' AS TYPE, v.store_id, v.value FROM catalog_product_entity_decimal v
JOIN eav_attribute e ON e.attribute_id = v.attribute_id WHERE v.entity_id = @entity_id)
UNION
(SELECT e.attribute_id, e.attribute_code, 'int' AS TYPE, v.store_id, v.value FROM catalog_product_entity_int v
JOIN eav_attribute e ON e.attribute_id = v.attribute_id WHERE v.entity_id = @entity_id)
UNION
(SELECT e.attribute_id, e.attribute_code, 'text' AS TYPE, v.store_id, v.value FROM catalog_product_entity_text v
JOIN eav_attribute e ON e.attribute_id = v.attribute_id WHERE v.entity_id = @entity_id)
 ORDER BY attribute_id;

My attribute (401) gives
401,diet_and_lifestyle,varchar,0,4037,4036,4035,4034

Any help greatly appreciated!


texts: How to remove custom required telephone field in customer account information?

texts:
I am trying to remove the Telephone custom field in customer account information.
I am unsure how it loads the fields and how to remove a required option and field.


texts: as all know Magneto 1 is no longer supported by Magento team  but I want 1.9 for testing an extension which I have to migrate on magneto 2 if anyone know any repo where I can get please provide me if anyone have download setup then please upload on google drive and send me link


texts: Catalog page loads at the middle of the screen when using pagination - M 2.1.15

texts:
When I go to page 2 or 3 it takes me to the lower middle half of the page instead of the top of the next page.
Is there a way to make it go to the top of the next page instead?


texts: Magento2 import update adds new item id into cataloginventory_stock_item

texts: I'm trying to update product urls, but the import functionality in Magento 2 adds new item id into cataloginventory_stock_item table for each updated sku and I have to manually delete each duplicate from the table. Does the import update csv require more than sku and url_key? Could that be the reason?


texts: How to load only the children categories that belong to the current product (magento)

texts:
I want to show  a list of categories a product belongs to, top categories and subcategories.
I figured out how to load the correct topcategories, but when I loop the subcats (children categories) it loads ALL subcats of that topcategory, not the categories that the product falls under.
Example:

Like you can see it loads a ton of subcategories, but only the ones with the red stripe are subcategories that the product falls under.
How can I make sure it only show those under their topcategories?
My code:
$currentCatIds = $_product->getCategoryIds();
  $categoryCollection = Mage::getResourceModel('catalog/category_collection')
 ->addAttributeToSelect('name')
 //  ->addFieldToFilter('level',2)
 ->addAttributeToSelect('url')
 ->addAttributeToFilter('entity_id', $currentCatIds)
 ->addIsActiveFilter();

  $out = "
";
  foreach($categoryCollection as $cat){
      $out .= "
";
      $out .= "getUrl()."'>".$cat->getName()."";
      $out .="
";
      $children = Mage::getModel('catalog/category')
      // ->addAttributeToFilter('entity_id', $cat->getCategoryIds())
      ->load($cat->getId())
      ->getChildrenCategories();
          foreach($children as $child){
              $out .="
getUrl()."'>".$child->getName()."
";
          }
          $out .="
";
      $out .= "
";
  }
  $out .= "
";
  echo $out;

Why are they shown below again? I only want the subcats under the topcategories, not subcats twice.


texts: Magento2 - Customer dashboard is accessible but checkout request to log in

texts:
on Magento 2.4 i'm facing this strange situation: Yesterday i've normally logged in to my store, today i came back to the store and i can access my customer dashboard but when i try to reach checkout page magento show me the authentication popup. It seem like i'm half logged in and half not.
It is the checkout session expired? How can i extend it? I would like to access checkout page avoiding a new log in.
Thanks


texts: Magento : I Need to Create a vhost to Access New Storeview

texts:
I created a website and store, followed all steps including changing base url of default configuration.

How do I access my new website/storeview ?
Do I need to create a vhost in apache, if so what are steps? How do I access it from my PC.
Currently I cant access magento admin panel, this is what I get (mage2 is my magento installation folder in the htdocs)


texts:
I get a weird error. Suddenly alot of inactive products are now visible in the front end without anyone doing changing anything. Do you have any idea how it can happen. We do CRON jobs that do re-index 4 times a day. But I don't see how that can be the reason.

I am using multi stores (english & danish) and the products are set to "inactive" for both store views.


texts: Questions, explanation about Image uploader

texts:
I want to know where can we set the maximum image weight upload in admin ?
Why don't we get the error message when we go past the allowed weight ?

I noticed according to my tests that  the maximum weight of image is : 2 Mo, the image is not uploaded and with an seccess message: You saved the configuration. bellow 2 Mo the image is uploaded.
About dimensions, according to the vendor/magento/framework/File/Uploader.php, The max width and height are :

/**
 * Max Image Width resolution in pixels. For image resizing on client side
 */
const MAX_IMAGE_WIDTH = 1920;

/**
 * Max Image Height resolution in pixels. For image resizing on client side
 */
const MAX_IMAGE_HEIGHT = 1200;

But If I upload an  2560x1440 size, the Image is well uploaded.

system.xml

<field id="1" translate="label" type="image" sortOrder="1" showInDefault="1" showInWebsite="1" >
    <label>Image 1</label>
    <backend_model>Vendor\Name\Model\Config\Backend\Image</backend_model>
    <base_url type="media" scope_info="1">home</base_url>
</field>

Vendor\Name\Model\Config\Backend\Image\Image.php

<?php
namespace Vendor\Name\Model\Config\Backend;

class Image extends \Magento\Config\Model\Config\Backend\Image
{
    /**
     * @var \Magento\Framework\Image\AdapterFactory
     */
    protected $_imageFactory;

    /**
     * The tail part of directory path for uploading
     *
     */
    const UPLOAD_DIR = 'home'; // Folder save image

    /**
     * Return path to directory for upload file
     *
     * @return string
     * @throw \Magento\Framework\Exception\LocalizedException
     */
    protected function _getUploadDir()
    {
        return $this->_mediaDirectory->getAbsolutePath($this->_appendScopeInfo(self::UPLOAD_DIR));
    }

    /**
     * Makes a decision about whether to add info about the scope.
     *
     * @return boolean
     */
    protected function _addWhetherScopeInfo()
    {
        return true;
    }

    /**
     * Getter for allowed extensions of uploaded files.
     *
     * @return string[]
     */
    protected function _getAllowedExtensions()
    {
        return ['jpg', 'jpeg', 'gif', 'png', 'svg'];
    }

}


texts: Magento 1.9.3 CE, Staging & Live Sites behave differently

texts:
Lately, we found our Staging Site and Live Site behave differently in 2 situations:
1).  we found Live Site to have 500 error timeout while Staging Site is normal;
2).  we found update on CSS file in staging site reflected in frontend, while Live Site do not reflect the changes.

how to check the code difference, and how to sync the Staging site code to Live site?

THANKS FOR SHINING SOME LIGHT !  =:>


texts:
Magento2 how can I create custom dynamically routes/URL ?
I need URLs as below
For e.g. https://example/find-a-store/nsw/tuggerah/

Here in URL, nsw & tuggerah will dynamic generate
I used below code but not able to get what I want
public function match(\Magento\Framework\App\RequestInterface $request)
   { //echo "string";die();
       $identifier = trim($request->getPathInfo(), '/');
       if(strpos($identifier, 'customrouter') !== false) {
       $request->setModuleName('findastore')-> //module name
       setControllerName('nsw')-> //controller name
       setActionName('tug')-> //action name
       setParam('param', 3); //custom parameters
       } else {
           return false;
       }
       return $this->actionFactory->create(
           'Magento\Framework\App\Action\Forward',
           ['request' => $request]
       );
   }


texts: Products Disappearing From Search Results

texts:
Magento Version: v2.4.1-p1
Elasticsearch Version: v7.10
Products are disappearing from search results on our site. When reviewing the exception.log we are seeing the following error messages:

main.CRITICAL: {"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"","phase":"fetch","grouped":true,"failed_shards":[],"caused_by":{"type":"aggregation_execution_exception","reason":"Merging/Reducing
the aggregations failed when computing the aggregation
[product_attribute_code] because the field you gave in the
aggregation query existed as two different types in two different
indices"}},"status":500} {"exception":"[object]
(Elasticsearch\Common\Exceptions\ServerErrorResponseException(code:
500):
{"error":{"root_cause":[],"type":"search_phase_execution_exception","reason":"","phase":"fetch","grouped":true,"failed_shards":[],"caused_by":{"type":"aggregation_execution_exception","reason":"Merging/Reducing
the aggregations failed when computing the aggregation
[certification_ltf_dhv_bucket] because the field you gave in the
aggregation query existed as two different types in two different
indices"}},"status":500} at
/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:665)"}
[]

Does anyone know how to resolve this type of issue?


texts: Magento 2: Product placeholder images cause an exception

texts:
When I add a view.xml file to my theme I get the following error:

  Exception #0 (Magento\Framework\View\Asset\File\NotFoundException):
  Unable to resolve the source file for
  'frontend/Holy/mytheme/en_GB/Magento_Catalog/images/product/placeholder/.jpg'
  error message

I can fix it by uploading new product placeholder images on the Magento admin.

Is there another way to avoid this error?
Why is this error occurring in the first place?


texts: instead of Currency convertor, want to set fixed price set to price to Products

texts:
I have Magento 2 setup, having one website and 2 stores. I want 5 different currencies in my store. Instead of using the Magento currency converter, I want to set a fixed price for all different currencies.
i.e.
Product one has 5 currencies attributes (Price_KWD, Price_BHS, Price_US, Price_OMR, Price_AED, Price_QAR). If I change the currency from Price_KWD to Price_BHS, then it will show the value Price_BHS
Product Price_KWD =10
Product Price_BHS=20
On conversion, It should show 20 with a currency symbol.
see URL for reference http://autoone.viewmysitenow.com/


texts: Magento - Display inventory available qty on category page

texts:
How can I can I display the available inventory level on the category page?
I have the code below in the category screenshot below, however the inventory displays 0 in the default.phtml file.

<?php echo 'Qty: '.$_product->getStockItem()->getQty() ?>

Thank you


texts: Magento 2 : Rupee (currency) symbol overlapping on price

texts: Whenever I print the invoice, Rupee symbol gets overlapped with the price. When I copy this price on the text editor, it shows me correct but in pdf, it is overlapping the price. Any help will be appreciated.


texts:
Anyone Can help me, I want to add customer Attribute and i have put my code as below.I have installed it, not getting any error but noting happened.

Customer/Attrib/Setup/InstallData.php

<?php
namespace Customer\Attrib\Setup;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{

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

    /**
     * @var AttributeSetFactory
     */
    private $attributeSetFactory;

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

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        /** @var $attributeSet AttributeSet */
        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(Customer::ENTITY, 'my_measurements', [
            'type' => 'varchar',
            'label' => 'Mymeasurements',
            'input' => 'text',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 1000,
            'position' => 1000,
            'system' => 0,
        ]);

        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'my_measurements')
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['customer_address_edit'],
        ]);

        $attribute->save();

    }
}

Customer/Attrib/registration.php

<?php

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

Customer/Attrib/etc/module.xml

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

Thanks in Advance.


texts: set three page on one controller action URL

texts:
set three url on one controller action.
exp: i have three category url like below
mydomain.test/seller/index/category/suppermarket
mydomain.test/seller/index/category/suppermarket/groceries
mydomain.test/seller/index/category/suppermarket/groceries/rice

how manage these three url?


texts: Magento 2 + FastCGI (Nginx + PHP-FPM) don't work (404)

texts:
I try to use Magento 2.4.1 + FastCGI (Nginx + PHP-FPM), but I get 404 error for every page.
PHP 7.4.15
MySQL 8.0.23
Nginx 1.16.1
Ubuntu 18.04
Nginx conf:
server {
    server_name mysite.com www.mysite.com;
    fastcgi_buffers 128 512k;
    fastcgi_buffer_size 512k;
    proxy_buffer_size 512k;
    proxy_buffers 128 512k;
    proxy_busy_buffers_size 512k;
    fastcgi_connect_timeout 6000;
    fastcgi_send_timeout 6000;
    fastcgi_read_timeout 6000;
    proxy_connect_timeout 6000;
    proxy_send_timeout 6000;
    proxy_read_timeout 6000;
    send_timeout 6000;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/mysite.com/*.conf;
    access_log /var/www/httpd-logs/mysite.com.access.log;
    error_log /var/www/httpd-logs/mysite.com.error.log notice;
    set $root_path /var/www/www-root/data/www/mysite.com;
    root $root_path;
    listen 178.XX.XXX.XX:80;
    listen [2a03:XXXX:XX:XX::]:80;
    gzip on;
    gzip_comp_level 9;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
        location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
            expires max;
        }
    }
    location @php {
        fastcgi_index index.php;
        fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@mysite.com";
        fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri = 404;
        include fastcgi_params;
    }
}

And many errors in web-console:

I am newbee in it. Could you please help me?


texts:
On my second site everything seems to be working fine..except one thing, the product images! On the list and grid view from the category all images are being displayed, not a problem. However, when I'm on the product page, NOTHING!

catalog.xml
Inside catalog_product_view I have this:

<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>

Then on the view.phtml I have:

echo $this->getChildHtml('media');

When I turn on html path hints, there is no hint to any media.phtml yet the file really exists. Furstrating how such a simple thing takes up so much time, hope I'm just overlooking something.

Worth to mention, on the main site, it's all working fine.


texts: How to set promo can be used x times for each day in Magento 2?

texts:
Can i set cart price rule for customer that goes with condition like this:

Each customer can only use this promo x times for each day


texts:
I am trying to setup PWA for my local dev server host name is http://dev-test/

following this details referencing here:https://webkul.com/blog/magento2-3-pwa-studio-setup/

when I run build I get the following error:
sudo yarn run build:dev

yarn run v1.22.0
$ yarn venia run build:dev
$ node ./packages/pwa-buildpack/bin/buildpack load-env ./packages/venia-concept && yarn workspace @magento/venia-concept run build:dev
  ⚠  Default value for CHECKOUT_BRAINTREE_TOKEN has changed in PWA Studio Buildpack v5.0.0, due to
     confusion about whether developers should provide their own Braintree tokens for their own sites. An
     example value is provided instead for development purposes.
     Old value: sandbox_8yrzsvtm_s2bg8fs563crhqzk
     New value: undefined
     This project is using the old default value for CHECKOUT_BRAINTREE_TOKEN. Check to make sure the change
     does not cause regressions.
$ yarn run clean && yarn run validate-queries && webpack --no-progress --env.mode development
$ rimraf dist
$ yarn run download-schema && graphql validate-magento-pwa-queries --project venia
$ graphql get-schema --project venia --insecure
project venia - Schema file was created: lastCachedGraphQLSchema.json
Validating GraphQL queries in venia project...
✔ Locating schema...
✔ Finding queries in files...
✔ Validating project's queries against the schema...

Found some potential issues:

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/GiftCards/giftCardFragments.ee.js
  5:9  error  Cannot query field "applied_gift_cards" on type "Cart". Did you mean "applied_coupons"?  graphql/template-strings

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/GiftCards/giftCardQueries.js
  18:9  error  Cannot query field "giftCardAccount" on type "Query"                                                                          graphql/template-strings
  32:9  error  Cannot query field "applyGiftCardToCart" on type "Mutation". Did you mean "applyCouponToCart"?                                graphql/template-strings
  46:9  error  Cannot query field "removeGiftCardFromCart" on type "Mutation". Did you mean "removeItemFromCart" or "removeCouponFromCart"?  graphql/template-strings

/var/www/mag-pwa/pwa-studio/packages/venia-ui/lib/components/CartPage/PriceSummary/queries/giftCardSummary.ee.js
  6:9  error  Cannot query field "applied_gift_cards" on type "Cart". Did you mean "applied_coupons"?  graphql/template-strings

I am aslo getting some warning but I suposed this should be ok to build and some incompatibilities issue can't be right I am using 2.3.4:

Your versions of PWA and Magento may be incompatible.

This Venia store is from PWA Studio version 5.0.1.
Some components in PWA Studio version 5.0.1 send GraphQL queries that are only compatible with version 2.3.3 - 2.3.4 of Magento 2.

Please refer to the compatibility table in the PWA documentation for more details: https://pwastudio.io/technologies/magento-compatibility/.

Has anyone any idea what could be the issue?


texts:
I am using Custom order status While changing it send a mail. It's working fine

public function shipementorderAction(){
                $id = $this->getRequest()->getParam('id');

                $order = Mage::getModel('sales/order')->load($id);
                $order->setData('state', 'shipement');
                $order->setStatus('shipement');
                $history = $order->addStatusHistoryComment('', false);
                $history->setIsCustomerNotified(false);
                $order->save();

                $order->sendOrderUpdateEmail(true, null);

                $this->_getSession()->addSuccess(
                    $this->__('The order state has been changed.')
                );
                //$this->_redirect('mpshippingmanager/shipping/index');
                Mage::getSingleton('core/session') ->addSuccess('Order Updated Successfully'); $this->_redirectReferer();

                }

I used this to send a mail

**$order->sendOrderUpdateEmail(true, null);**

How to send custom email template(New Template) per status


texts:
I try to short order number from 11 to 6.

In database I select table eav_entity_type

SELECT * FROM `eav_entity_type`

go to table "order" and looking for increment_pad_length

I found that I have to change the record increment_pad_lenght

But here I have value 8 (in magento order ID have 11 digitals).

I change this value to 4 and update magento

php bin/magento setup:upgrade

unfortunately I did not receive any result. Any one know how to do?

EDIT:
after database query

select * from sales_sequence_meta;

I see table sequence_order_1, sequence_order_2, sequence_order_3 etc.

After edit for example sequence_order_1 I cannot see AUTO_INCREMENT record.

EDIT:
After:

mysql: select * from sales_sequence_meta;

ALTER TABLE sequence_order_0 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_1 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_2 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_3 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_4 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_5 AUTO_INCREMENT=7895;
ALTER TABLE sequence_order_6 AUTO_INCREMENT=7895;

my order ID is still the same.

@Rakesh Varma,
In file /vendor/magento/module-sales-sequence/Model/Sequence.php, on line 19 I have:

const DEFAULT_PATTERN  = "%s%'.09d%s";

When I edit file: app/etc/di.xml and adding below line:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\DB\Sequence\SequenceInterface">
        <arguments>
            <argument name="pattern" xsi:type="string">%s%'.06d%s</argument>
        </arguments>
    </type>
</config>

Get error:

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid XML in file /home/brandswearxv/ftp/app/etc/di.xml: XML declaration allowed only at the start of the document Line: 1233 Extra content at the end of the document Line: 1234 in /home/brandswearxv/ftp/vendor/magento/framework/Config/Reader/Filesystem.php:151 Stack trace: #0 /home/brandswearxv/ftp/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator)) #1 /home/brandswearxv/ftp/vendor/magento/framework/App/ObjectManagerFactory.php(282): Magento\Framework\Config\Reader\Filesystem->read('primary') #2 /home/brandswearxv/ftp/vendor/magento/framework/App/ObjectManagerFactory.php(142): Magento\Framework\App\ObjectManagerFactory->_loadPrimaryConfig(Object(Magento\Framework\App\Filesystem\DirectoryList), Object(Magento\Framework\Filesystem\DriverPool), Object(Magento\Framework\ObjectManager\Config\Mapper\Dom), 'developer') #3 /home/brandswearxv/ftp/ve in /home/brandswearxv/ftp/vendor/magento/framework/App/ObjectManagerFactory.php on line 284


texts:
Refused to apply style from <URL> because its MIME type (text/html) is not a supported style sheet MIME type, and strict MIME checking is enabled.

This is what I get when i try to load the page in Magento


texts:
While I am aware of the similar question. My question is more generic, that what would happen to both calls whether I actually create a database column or not.

EDIT

I know addColumn() will add a real table column, but when I'm diving into some core modules, some of them are calling both addColumn() and addAttribute() to the same field.

What is the difference between them?

EDIT 2

Because addAttribute() looks very much EAV related to me, after some research I also find some similar names like addAttributeSet() and addAttributeSetNames().

How are they differ to each other?


texts: Best way to find block names to remove via xml?

texts:
I can see blocks on pages, their classes and structure and guess where they are added and what their name is - what is the best way to do this?

Is this what path hints is made for? Is there any other way even if it requires familiarity?


texts: Data value is appearing instead of data label in grid export

texts:
I have an options array in below format.

array (size=3)
  0 =>
    array (size=2)
      'value' => string 'one' (length=3)
      'label' => string 'Number One' (length=10)
  1 =>
    array (size=2)
      'value' => string 'two' (length=3)
      'label' => string 'Number Two' (length=10)
  2 =>
    array (size=2)
      'value' => string 'three' (length=5)
      'label' => string 'Number Three' (length=12)

In admin grid column data label is appearing, which is correct.
But when I am exporting the same grid the instead of data label, the data value is appearing the exported CSV and XML.
The Attribute is of type select.
Code is ui_component xml is as follows

<column name="mycol" component="Magento_Ui/js/grid/columns/select">
            <settings>
                <options class="Anshu\Mygrid\Model\Mygrid\Source\Myvalue"/>
                <filter>select</filter>
                <dataType>select</dataType>
                <label translate="true">My Value</label>
            </settings>
        </column>

What can be the issue here?


texts: Magento 2: Google Recaptcha is not showing in Login page

texts:
I have enabled the Google Recaptcha in Login and Register via admin panel configuration using the API Site and Secret keys. But the Google Recaptcha is not showing in Login page though its showing in register page without any issues.

So, I have switched the theme to default Luma them and seen that the Google Recaptcha is showing in the Login page as well. I'm clear now the problem is coming from theme level updates but I'm not sure where I need to check.
Please guide.


texts: How to restrict payment methods by store?

texts:
I want to restrict the payment method by store.How to do this?

Eg.

For English version I need 3 payment modules

1.Paypal
2. cod
3.Bank transfer

For Other version I need 1 payment method

1.Paypal

alone

How to achieve this?


texts: How to get the current day orders through REST API?

texts:
I am getting the initial 10 records by the following step --

oauth = OAuth(client_key=CONSUMER_KEY, client_secret=CONSUMER_SECRET, resource_owner_key=TOKEN, resource_owner_secret=SECRET)
h = {'Content-Type': 'application/json', 'Accept': 'application/json'}
r = requests.get(url='0.0.0.0/api/rest/orders', headers=h, auth=oauth)

but I want the present day all records, and this is done in Python.


texts: Having issue with left navigation menu in CMS page

texts:
I am working on magento 1.9 using luxury theme

I am loading left navigation using mega menu inside static block. like this

{{block type="megamenu/vertical" menu_id="3" template="megamenu/vertical.phtml"}}

and calling this static block inside 2columns-left.phtml like this echo $this->getLayout()->createBlock('cms/block')->setBlockId('about-us-1')->toHtml();

for this i am checking which cms page is loading in if condition

$cmsPageUrlKey = Mage::getSingleton('cms/page')->getIdentifier();
if ($cmsPageUrlKey == "corporate-overview" || $cmsPageUrlKey == "history" || $cmsPageUrlKey == "vision-mission" || $cmsPageUrlKey == "awards" || $cmsPageUrlKey == "certifications") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('about-us-1')->toHtml();

} else if ($cmsPageUrlKey == "ffs-policy" || $cmsPageUrlKey == "emergency-service-policy" || $cmsPageUrlKey == "warranty-details" || $cmsPageUrlKey == "spare-key-requirment" || $cmsPageUrlKey == "security-tips" || $cmsPageUrlKey == "lock-care" || $cmsPageUrlKey == "master-key" || $cmsPageUrlKey == "access-control-systems" || $cmsPageUrlKey == "common-key") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('services1')->toHtml();
} else if ($cmsPageUrlKey == "overview" || $cmsPageUrlKey == "join-us") {
    echo $this->getLayout()->createBlock('cms/block')->setBlockId('career-page')->toHtml();
}

This code works but after opening 3-4 cms pages It is loading random menu on each pages.

what will be the issue ?


texts: Magento2 individual URL for each website

texts:
I need to work with a Magento 2 website that haw follow structure -
3 websites (b2a, b2c, b2b), and each website has two languages (danish, english).

So I have confingured my store view like this, so far correct right?

I have in configuration -> web -> baseurl, give each website an individual url, for example, b2c.exmpale.com, b2a.example.com, b2b.example.com.
I have in my apache2 virtual host point all subdomains to Magento2 installation.

but when I visit these subdomains, it just show me a default apache page.

Did i do anything wrong?


texts: why my magento 2 localhost setup in very slow?

texts:
When i run cli cmds it's take to much time

  >php bin/magento s:s:d -f

frontend/Magento/luma/en_US             2918/2918           ===100% %  10 mins
frontend/Solwin/kosmic_child/en_US      3088/3088           == 100% %  44 mins

it's more time and storage


texts: Choose which file to install via Composer based on Magento version

texts:
It would be very convenient to include multiple versions of code in a composer'd module and have composer work out which version to deploy, based on the Magento version of the installation target.

For example, for Magento > 1.7, use the system.xml which includes tooltip, nested group and other modern features but for older versions of Magento, use a stripped-down version of the file which doesn't include those (breaking) declarations.

This approach could work for numerous other files in a standard module structure too.

The options for composer deployment are map, modman or package.xml AFAIK, none of which have any intelligence regarding the target system. The package.xml option is very unlikely to change but map could...

It seems to me that there would be a lot of extension developers that would benefit from the graceful degradation approach. Has anyone found a work-around for this?


texts: How to show/hide shared catalog enabled categories in layered navigation in Magento 2?

texts:
We have enabled the b2b extension.
When we select specific categories on shared catalogs, it hides only on the mega menu, but layered navigation still lists the categories.

  How can we hide it from layered navigations as well?


texts:
In my Magento Sales admin grid i would like to have an email and country so I created a code to make it possible:

    protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join('sales_flat_order_address',
            'main_table.entity_id = sales_flat_order_address.parent_id',
        array('telephone','city','postcode','country_id'))
        ->where("sales_flat_order_address.address_type =  'billing'");
        $collection->getSelect()->joinLeft(
        array('order'=>'sales_flat_order'),
            'order.entity_id = main_table.entity_id',
            array('order.customer_email')
    );
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

and  to display columns:

    $this->addColumn('customer_email', array(
        'header' => $this->helper('sales')->__('Customer Email'),
        'index' => 'customer_email',
        'filter_index' => 'order.customer_email',
    ));

    $this->addColumn('country_id', array(
        'header' => Mage::helper('sales')->__('Country Id'),
        'index' => 'country_id',
        'width' => '25px',
        'align' => 'center',
        'filter_index' => 'sales_flat_order_address.country_id',
    ));

once I added and saved this code  everything seems to work until trying to search order by ID (increment_id)
then Magento throws me an error:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_flat_order.increment_id' in 'order clause', query was: SELECTmain_table.*,sales_flat_order_address.telephone,sales_flat_order_address.city,sales_flat_order_address.postcode,sales_flat_order_address.country_id,order.customer_emailFROMsales_flat_order_gridASmain_table
   INNER JOINsales_flat_order_addressON main_table.entity_id = sales_flat_order_address.parent_id
   LEFT JOINsales_flat_orderASorderON order.entity_id = main_table.entity_id WHERE (sales_flat_order_address.address_type =  'billing') ORDER BY sales_flat_order.increment_id ASC LIMIT 20

so I checked sales_flat_order to make sure there is a column named increment_id and it is there but it does not contain (it seems) correct increment_id but something ... else ... series of numbers anyhow not resembling expected number.

What I've done wrong ... please help.


texts:
On our Magento installation we have created a new shopping cart price rule that gives a 20 EUR discount amount for the whole cart:

After that we have double checked the tax settings to make sure that the following happens:

Discount is applied on the price excluding tax
Tax is calculated after the discount has been applied

When that's was done we added a product to the shopping basket. This product has a price excl tax of 80 EUR. (Including tax: 96.60 EUR):

Our findings:
 - Subtotal = correct

Discount amount = correct
Grand total excl tax = incorrect
Tax = incorrect
Grand total = incorrect

So basically this means that Magento does not take the setting "Apply Customer tax" into consideration? Anyone also came across this problem? Any help on what the correct way would be to fix this?


texts: Select country through Jquery in Origin Address of Shipping Settings

texts:
I am trying to set Country for Origin address using jQuery in Shipping Settings of Sales (Store Configuration).
The issue is, on change of country option using jquery, the ajax to fetch region is not getting called.
I found that the region is bind using prototype.js.
<script>
 require([
    'jquery',
    'uiRegistry'
 ], function ($, uiRegistry) {
    $(function () {
        let bodySelector = $('body');
        let sectionName = 'shipping_origin_';
        let countryIdSelector = bodySelector.find('#' + sectionName + 'country_id');
        let postCodeSelector = bodySelector.find('#' + sectionName + 'postcode');
        postCodeSelector.on('change', function (e) {
            countryIdSelector.val('IN').change();
        });
    });
 });
</script>

Please help.
Thank you.


texts: Magento 2 Authorization.net patch Md5 to SHA giving error

texts:
I am using Magento 2.1.3 EE and i applied patch using

patch -p1 < patchfile.patch which applied patch in 5 files of  vendor/magento/module-authorizenet

I did follow the instruction given by the magento here in this article:
https://support.magento.com/hc/en-us/articles/360024368392

Also, follow sandbox setup using following:
https://support.magento.com/hc/en-us/articles/360000570793-Error-placing-order-with-Authorize-net-Sandbox-account-An-error-occurred-on-the-server-

I have added all details correctly and verified.

Issue is while testing the authorization.net in sandbox in my local giving this error:

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

whilst on staging it says :

Transaction has been declined because response hash validation has been failed in vendor/magento/module-authorizenet/Model/Directpost.php 557

What could be the issue?  What's the fix for this?  Debug mode is on but no clues in logs.  How can i identify error and cause of this issue.

Any help would be appreciated.


texts:
In one of my project I have noticed an issue.
Magento is showing Re-order button even if the it contains the disabled item.
It is not showing the button only considering the last item in the order.

For example :
I have ordered three items P1, P2 and P3. I have added the products in the same order in the cart first P1, then P2 and at last P3.
Now in the My orders section, I am seeing the Reorder button [CORRECT Functionality].
Now if I am disabling the the product P1 or P2 from the admin, I am still seeing the Reorder button. [Incorrect]
But if I am disabling the P3, reorder button is not appearing.
For some unknown reason, till now, Magento is considering only the last item.
If anyone has faced any similar issue, please share your thoughts and help me out in fixing it.


texts: Magento2 Save Shipment Button Missing in admin manage order

texts:
I used the Magento2 version: 2.1.0

In the admin panel when I want to go to generating Shipment I see the details of the order but Save Shipment and Product Details are missing.

And when I checked the system.log I see below error message:

main.CRITICAL: Renderer for type "simple" does not exist.

see the attached screenshot.

If anyone have already solved this issue, please help me to fixed this issue.

Thanks in Advance!


texts: Magento 2 - Accidentally deleted 'admin_passwords' table, no backups

texts:
I accidentally dropped the table 'admin_passwords'.

What is the command that would re-create it?


texts: How to get shipping address of customer in Magento 1

texts:
I want get shipping address of customer by name, city, company, or postcode. How to do it? Please help me.

I tryed this code but it get shipping address of all order.

$addressCollection = Mage::getModel('sales/order_address')->getCollection();
$addressCollection->getSelect()->where("address_type = 'shipping' and lastname like '%$customerName%' and company like '%$customerCompany%' and city like '%$customerCity%' and postcode like '%$customerCode%'");


texts: one page checkout order review show products as my custom block

texts: I have a custom block witch has a list of products which are selected by customer as a single product.Now I want to show this block which replace order review product.


texts: How can I change the position of the order totals (incl. tax / excl. tax) in the tax calculation? As it should show the total including tax below the total excluding tax but at the moment it does not.


texts: Adding Catalog Price Rules To Product Search Criteria API

texts:
I am using the following Magento2 REST API to filter the products using category_id

GET
/rest/V1/products?&searchCriteria[filterGroups][0][filters][0][field]=category_id&searchCriteria[filterGroups][0][filters][0][value]=159&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&customer_id=&searchCriteria[sortOrders][0][field]=position&searchCriteria[sortOrders][0][direction]=ASC&searchCriteria[pageSize]=10&searchCriteria[currentPage]=1

However the Response Of the API does not return the product prices as per the applied catalog rules.
I did follow this https://github.com/magento/magento2/issues/30593 link for the updates but no luck as it mentions that this API is at an admin end point.
Can anyone help me to either customize the API to get the updated prices according to Catalog price rules in this API?
Or
Guide me towards the Correct API I should be using instead of this one??
I am using the : 2.3.5-p2 version of magento however the live site on which the changes are to be made runs on version 2.2.4


texts: How to get Cash On Deliver Payment >> Case On Delivery Fee using $this->scopeConfig->getValue( ) in magento 2?

texts: How can i get the case on delivery fee from cod system config file using scope Config


texts:
getting this
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="https://magentolocal.com/soap/default?services=CustomapiV1">
   <env:Body>
      <ns1:CustomapiV1ProductInventoryUpdateResponse>
         <result>1</result>
      </ns1:CustomapiV1ProductInventoryUpdateResponse>
   <env:Body>
</env:Envelope>

need this
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="https://**{{host}}**/soap/default?services=CustomapiV1">

 Second option
If I can remove the Envelope row
or Need this
<env:Body>
  <ns1:CustomapiV1ProductInventoryUpdateResponse>
     <result>1</result>
  </ns1:CustomapiV1ProductInventoryUpdateResponse>
<env:Body>


texts:
How to get multiple Region/State in Configuration in the same tab.

`<region_id translate="label">
                            <label>Region/State</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>20</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </region_id>`

I have tried above code in two different groups and same field, but for the  first field its showing dropdown at the time entering values and after saving its showing as textbox. Second group field working normally.

Note: both are same country(US) Region/States.

Please help me on how to maintain two Region/State in fields in same tab in system->Configuration


texts: How to upload files & database backup on onedrive/skydrive?

texts:
I want to upload weekly files & database backup zip on onedrive/skydrive
Any extension or code available?


texts: How we can make custom modulle for review and star rating functionality in my custom admin and frontend

texts: How we can make custom module for  review and star rating functionality in my custom admin and frontend.


texts:
I'm trying to update a website that's had about 5 different development agencies on it and it started as a theme. I've added a new module that adds a bunch of blocks to the product.info Reference. I've managed to clear out the remaining junk from other developers that has been placed in there with similar funcitonality.

The block is being called by $this->getChildHtml('product_type_data') along with some other required blocks. so I want to move the block to a new section of the page, It needs to go somewhere where there are no other blocks. It's been so long since I touched Magento that I can't remember how to do this, or the Magento term for creating a new childHtml section where I need it. I know i need to be unsettling the block From it's old location and setting it to the new one, but without a area to put it in I'm kind of stuck.

Module XML

...

<PRODUCT_TYPE_simple>
    <update handle="product.info.simple"/>
    <reference name="product.info">
        <block type="outofstocknotification/view" name="view" as="view"  />
    </reference>
</PRODUCT_TYPE_simple>

...


texts: How do display category icons/images when top-level category is selected?

texts:
I'm looking at catalog/category/view.phtml

So I suppose I should use getChildren, then loop through the children. How will I get from each child category a single product based on a certain sort order for the collection?

I need to limit the db query with a "LIMIT 1" clause or something like that, so that I do not load a bunch of products into PHP.

Suppose my categories are as such:

root_catalog
    |-T-shirts
        |-Long Sleeve
        |-Short Sleeve
    |-Cell Phones
        |-Smart Phones
        |-Dumb Phones

I would like to show one image for each subcategory. I would like to do this by dynamically getting the list of subcategories and getting the image for the 1st product in each subcategory. When you click on that image, you are taken to the subcategory (and, conveniently, you also see the actual product that was used as an example in the navigation image).

I know I may be going about this the wrong way. If so, please advise.

Thanks.


texts: Magento 2: Observer getRequest not working and product added issue

texts:
I have below observer

namespace Custom\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;

class ProductObserver implements ObserverInterface {

    protected $_urlManager;
    protected $_checkoutSession;
    protected $_cart;
    protected $_messageManager;
    protected $_redirect;
    protected $_request;
    protected $_response;
    protected $_responseFactory;
    protected $_resultFactory;
    protected $_scopeConfig;
    protected $_product;

    public function __construct(\Magento\Framework\UrlInterface $urlManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\App\Response\RedirectInterface $redirect, \Magento\Checkout\Model\Cart $cart, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\App\RequestInterface $request, \Magento\Framework\App\ResponseInterface $response, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product $product, \Magento\Framework\App\ResponseFactory $responseFactory, \Magento\Framework\Controller\ResultFactory $resultFactory
    ) {
        $this->_urlManager = $urlManager;
        $this->_checkoutSession = $checkoutSession;
        $this->_redirect = $redirect;
        $this->_cart = $cart;
        $this->_messageManager = $messageManager;
        $this->_request = $request;
        $this->_response = $response;
        $this->_responseFactory = $responseFactory;
        $this->_resultFactory = $resultFactory;
        $this->_scopeConfig = $scopeConfig;
        $this->_product = $product;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {

        //$observer->getRequest()->setParam('product', false); // Not working

        $controller = $observer->getControllerAction();
        $postValues = $this->_request->getPostValue();
        $cartQuote = $this->_cart->getQuote()->getData();
        $cartItemsCount = $this->_cart->getQuote()->getItemsCount();
        $cartItemsAll = $this->_cart->getQuote()->getAllItems();

        $this->_request->setParam('product', false); // Will not add product to Cart
        $this->_response->setRedirect($this->_redirect->getRefererUrl());
        $this->_checkoutSession->setNoCartRedirect(false);
    }
}

It gives error on

  Fatal error: Call to a member function setParam() on null in

If I'm using

$this->_request->setParam('product', false); // Will not add product to Cart

Then also it adds product to the cart. It should not product to the cart right?

As  $observer->getRequest()->setParam('product', false); not working need to use above ones.


texts: Magento 2.3 - How to update Migrated Data?

texts: I already migrated Magento 1 data to Magento 2.3.4, during development we got few orders placed in Magento 1 as well as new customers registered in Magento 1. How to update the migration data i mean how to sync as per date data to Magento 2.3.4? Is any advice for this case?


texts:
I'm going to run profiler for one page in admin area. It opened in popup.
I enabled profiler in system / configuration, uncommented Varien_Profiler::enable(); in index.php

Profiler started working, but it doesn't work for my popup.
Is there any way how to profile in that case? Maybe put info in some log file.


texts: How to get all products previously ordered by a customer?

texts: How can I get all products ordered by the customer, so I can put them in a array ?


texts: Custom CSS file present in head but fails to load

texts:
I have a custom theme that inherits from Magento/blank.
I want to add a custom .css file to this theme. To do so, I've followed the Magento documentation that explains the steps: Include CSS

  Note that my Magento instance is in a developer mode

In my current state, the filesystem path to my custom css file is:

app/design/frontend/<Vendor>/<my-theme>/web/css/custom-style.css

I've created the default_head_blocks.xml file at:

app/design/frontend/<Vendor>/<my-theme>/Magento_Theme/layout/default_head_blocks.xml

With the following content:

<?xml version="1.0"?>
<page
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
    <!-- Custom CSS -->
    <css src="css/custom-style.css" src_type="url" rel="stylesheet" type="text/css" />
  </head>
</page>

  Nothing more here than what the docs says to do

Adding the <css> node to the .xml file is working properly: there is a <link> node in the resulting source code of my page

<link rel="stylesheet" type="text/css" rel="stylesheet" type="text/css" href="css/custom-style.css" />

My issue is that the loading of this file fails with a "(canceled)" Status when checking it in the Chrome Network tab:

Note how the path of my custom file is different than the one for other successfully loaded files.

My file is looked up at

/css/custom-style.css

whereas the standard theme files are looked up at

/pub/static/versionXYZ/frontend/<Vendor>/<my-theme>/en_US/css/<file-name>

I would suppose that this explains why the loading fails (accessing this path directly with the browser yields a 404 Not Found).

What I tried

Removing pub/static/* content (keeping the .htaccess file, of course)
Removing var/view_preprocessed/* content
Cleaning the cache with cache:clean, and flushing it with cache:flush
Running the Grunt exec:<my-theme> task along with the less:<my-theme> task

  I did not run setup:static-content:deploy and I shouldn't have to, since I'm in developer mode

Any help appreciated! Thanks!


texts:
Get Wishlist product in Magento 2 REST API ?
And Add to Wishlist in Magento 2 REST API ?

  Wishlist API is not provided by Magento 2


texts: Generating Transactional Emails for Development purpose

texts:
I am working on a bug, which prevents items go be displayed on order confirmation email. Currently, What I am doing is after making changes, to check I have to place order and create a confirmation email. It is tedious and I am sure there should be some way to generate emails for specific orders all you smart folks may know.

I want to know if there is a way to create order confirmation email for particular order, e.g. A script in which we can specify order number and/ or other requred information and it creates generates an email or even better displays out put of email template on console.

Note: This is not same as the preview option, as preview option only displays static elements.

Thanks in Advance.


texts: How can i edit recently viewed products widget layout?

texts:
I want to edit recently viewed products widget layout and override on my custom theme, but i can't reach to layout template under /vendor/magento/module-catalog/view/frontend/templates/product/widget/viewed/grid.phtml.

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/**
 * @var $block \Magento\Ui\Block\Wrapper
 */
?>

<?= /* @escapeNotVerified */ $block->renderApp([
    'widget_columns' => [
        'displayMode' => 'grid'
    ],
    'image' => [
        'imageCode' => 'recently_viewed_products_grid_content_widget'
    ]
]);

I edited before new products widget layout.
How can i do with same way?

Which file need i to copy under my template folder?


texts: Sorting products based on a custom attribute Magento2

texts:
I have a plugin that adds some custom product sorting, based on a customer attribute, in a way similar to below.

# Vendor\ModuleName\Plugin\Product\ProductList\Toolbar;

case 'capacity_low_to_high':
    $collection->setOrder('capacity', 'ASC');
    break;

case 'name_high_to_low':
    $collection->setOrder('capacity', 'DESC');
break;

However, the sorting is not as expected. When sorting via the custom 'capacity' attribute, the products are being sorted alphanumerically, such as that the result is someting like:

1
11
19
2
3
4
5

Obviously this is not as desired, but I am unsure of the best way to sort the collection based on the numerical value of the attribute. Can anybody point me in the right direction? Ideally, I'm thinking that storing the capacity attribute as an integer would work best, but there doesn't seem to be an obvious way to implement that. Am I missing something? What are my options. Magento 2.3


texts: How to get Product rating code and its value in magento 2

texts:
I have modified review form as popup modal.And I have also created an empty stars rating for the product which does not contain rating yet.But I have created those stars statically. But Now I need to create those stars dynamically in product page. For that I need to get rating code and value in my phtml file. How Do I get rating code and value in my custom block file, Now Need to get only the rating collection

Block file

<?php

namespace XXX\YYY\Block;

class Render extends \Magento\Review\Block\Product\ReviewRenderer
{

    protected $_availableTemplates = [
        self::FULL_VIEW => 'review.phtml',
        self::SHORT_VIEW => 'helper/summary_short.phtml',
    ];

    protected $_reviewFactory;
    protected $_ratingFactory;
    protected $_storeManager;

    /**
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param \Magento\Review\Model\ReviewFactory $reviewFactory
     * @param array $data
     */
    public function __construct(
    \Magento\Framework\View\Element\Template\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, \Magento\Review\Model\ReviewFactory $reviewFactory, array $data = []
    )
    {
        $this->_storeManager = $storeManager;
        $this->_ratingFactory = $ratingFactory;
        $this->_reviewFactory = $reviewFactory;
        parent::__construct($context, $reviewFactory, $data);
    }

    /**
     * Get review summary html
     *
     * @param Product $product
     * @param string $templateType
     * @param bool $displayIfNoReviews
     *
     * @return string
     */
    public function getReviewsSummaryHtml(
    \Magento\Catalog\Model\Product $product, $templateType = self::DEFAULT_VIEW, $displayIfNoReviews = false
    )
    {

        if (!$product->getRatingSummary() && !$displayIfNoReviews) {
            return '';
        }
        // pick template among available

        if (empty($this->_availableTemplates[$templateType])) {

            $templateType = self::DEFAULT_VIEW;
        }

        $this->setTemplate($this->_availableTemplates[$templateType]);

        $this->setDisplayIfEmpty($displayIfNoReviews);

        if (!$product->getRatingSummary()) {
            $this->_reviewFactory->create()->getEntitySummary($product, $this->_storeManager->getStore()->getId());
        }
        $this->setProduct($product);

        return $this->toHtml();
    }
// I have written below code for rating collection but it retuns empty
    public function getRatings()
    {
echo"dhgdfh";
        return $this->_ratingFactory->create()->getResourceCollection()->addEntityFilter(
                        'product'
                )->setPositionOrder()->addRatingPerStoreName(
                        $this->_storeManager->getStore()->getId()
                )->setStoreFilter(
                        $this->_storeManager->getStore()->getId()
                )->setActiveFilter(
                        true
                )->load()->addOptionToItems();
    }

}


texts:
I want to display random products on my homepage.
I have been using this $collection->clear()->getSelect()->order('rand()');.
My aim is the products should be displayed randomly on every page refresh.
But here, this happens only after i clear cache and then refresh my page.
Without cache flush, it displays same products


texts: Is it best to prepare different sizes of pictures for faster loading

texts:
I just batch imported main image files onto Magento.
Is it best to prepare thumbnail size, small size pictures for each item for faster loading?
I am not planning to use different images except for product detail pages, because they will be all the same.

But if it makes the difference in loading speed, I will resize the main pictures (800x800) to small size and upload them.They are mostly under 300KB.

Please advise.


texts: Magento 2 : How to override core js in Extension?

texts:
In magento 1.X we can check my exention is enabled or not in xml via below kind of code.

<action method="removeItem" ifconfig="easylife_switcher/settings/enabled">
      <type>skin_js</type>
      <name>js/configurableswatches/product-media.js</name>
</action>

is there any way in magento 2.0 so that I can check my extension is enabled or not from config.

I was override Magento_Checkout/js/model/shipping-service.js in my custom module using require-config.js. At one point i was face issue on disabling my custom module.

var config = {
map: {
    '*': {
        'Magento_Checkout/js/model/shipping-service' :
              '{namespace}_{modulename}/js/model/shipping-service'
    }
}};

After disabling my custom module i want to call core shipping-service.js instead of mine overridden.


texts: Magento 2 upload image from customer registration page

texts:
I have a requirement in Magento 2 where i need to upload an image from customer registration page and from admin panel. I have created a file type attribute using below code, attribute is created successfully and upload button is coming but i am not getting data saved.

   <?php
namespace W3solver\Callforprice\Setup;

use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;

class UpgradeData implements UpgradeDataInterface {

    protected $customerSetupFactory;
    private $attributeSetFactory;

    public function __construct(
    CustomerSetupFactory $customerSetupFactory, AttributeSetFactory $attributeSetFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    public function upgrade( ModuleDataSetupInterface $setup, ModuleContextInterface $context ) {

        if (version_compare($context->getVersion(), '1.0.4') < 0) {

            $setup->startSetup();
            $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

            $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
            $attributeSetId = $customerEntity->getDefaultAttributeSetId();

            $attributeSet = $this->attributeSetFactory->create();
            $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

            $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'twilio_image', [
                'type' => 'string',
                'label' => 'Twilio Image',
                'input' => 'file',
                "source" => '',
                'required' => false,
                'default' => '0',
                'visible' => true,
                'user_defined' => true,
                'sort_order' => 210,
                'position' => 210,
                'system' => false,
            ]);

            $image = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'twilio_image')
                    ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer', 'customer_account_create', 'customer_account_edit'],
            ]);

            $image->save();
            $setup->endSetup();
        }
    }
}

Can anyone please suggest me the way to do this??


texts: Success message doesn't show in my custom module in magento 2

texts:
I have created custom success message which would be shown after the form submission. I have enabled full page cache is backend now that message is not showing.

So, I changed cachable="false" for that template but not working find the code below,

<body>
    <referenceContainer name="page.messages">
        <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages"/>
    </referenceContainer>
    <referenceContainer name="content" cacheable="false">
        <block class="Customer\Form\Block\Index\Form" name="form_index_form" template="Customer_Form::form_index_form.phtml"/>
    </referenceContainer>
</body>


texts: product import/update error Skip import row, is not valid value "" for field "type"

texts:
I'm getting an error on a field when I try updating products during an product import.

  Skip import row, is not valid value "" for field "type"

I'm using sku to identify the product that I want to update and the other fields are the fields that I want to update

  "sku","meta_title","meta_description","meta_keyword"

  "sku123","some title for meta","a description","keywords go here"

The import contains 312 rows and at the bottom of the import page it says - Processed 100% 312/312 records. But after that it tells me - Imported 199 records.

I don't understand why field 'type' is causing an issue. I checked all of the stores products and they all have a type set. The data contains no special characters. It is saved to csv and formatted in utf-8.


texts: I am newbie. I have created catalogs and added products but nothing is showing on the home page.. 1. it is active. 2.navigation menu yes 3. static block


texts:
I created custom page for getting products . I got all information  but how to get full image path. I am using getImage() it is showing image only how to get full path.

      <a href="<?php echo $this->getBaseUrl().$_item->getUrlKey();?>" title="<?php echo $_item->getName() ?>" class="product-image"><img src="<?php echo $this->getImage();?>" alt="<?php echo $_item->getName() ?>" />


texts: Magento2: How to add pre defined data (installData.php) for Custom Module

texts:
I am working on creation of custom module and it is going to be stuck in a problem where i want to add some predefined data to my custom module while installation, so for that i review pre defined modules and found that there is a file installData.php inside Setup of a custom module

I reviewed module-cms all thing is well set and find out a class included inside vendor\magento\module-cms\Setup\insatallData.php

namespace Magento\Cms\Setup;

use Magento\Cms\Model\Page;
use Magento\Cms\Model\PageFactory;
use Magento\Framework\Module\Setup\Migration;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

use Magento\Cms\Model\PageFactory;

where to find this PageFactory class, because if i am able to find this then in that manner i am able create a Factory class for my own module.

thanks.


texts: Email not sending after upgrading magento version 2.2.4 to 2.3.1

texts:
Currently, using Mandrill for email flows and it's working fine before upgrade the Magento. My previous version is 2.2.4 and upgraded to 2.3.1.

After upgrade, the Magento emails are not getting flow.

When I am debugging the problem than I knew something like

I am getting an error like

  Invalid sender

from_email and from_name not getting is the main error.

Please help me, anybody, if any idea of this bug.

Thank you


texts: Remove required fields from magento admin panel

texts:
My client ask me to remove the required option from some fields in the product form from magento admin panel, because he don't want to fill this fields.

I need to say to magento that the field Short Description is not required, how can i do this?


texts: In Contact form I have a checkbox for subscription to newsletter

texts: The checkbox is checked by default, but I want to uncheck it by default. Can anyone help me over here. As I was new to Magento , I was get the solution for this.


texts:
I am using Magento 1.7.0.2 and just applied this patch. There where two errors

patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
Hunk #1 FAILED at 166.
Hunk #2 succeeded at 177 (offset -10 lines).
1 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Model/Email/Template/Filter.php.rej

and

can't find file to patch at input line 2293
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git app/code/core/Zend/Xml/Security.php app/code/core/Zend/Xml/Security.php
|index a3cdbc8..8b697b9 100644
|--- app/code/core/Zend/Xml/Security.php
|+++ app/code/core/Zend/Xml/Security.php
--------------------------
File to patch:
Skip this patch? [y]

The first one I can fix manually myself but the second is trying to access a file which doesn't even exist?


texts:
I want to delete "trace" from the exception response.

In my code i have something like this:

throw new \Magento\Framework\Exception\LocalizedException(__('You have already bought this item.'));

The response i get:

{"message": "You have already bought this item.",
"trace": "#0 /home/franco/magento2/vendor/magento/framework/Event/Invoker/InvokerDefault.php(73): Padi\\Cart\\Model\\Observer\\SetProduct->execute(Object(Magento\\Framework\\Event\\Observer))\n#1 /home/franco/magento2/vendor/magento/framework/Event/Invoker/InvokerDefault.php(61): Magento\\Framework\\Event\\Invoker\\InvokerDefault->_callObserverMethod(Object(Padi\\Cart\\Model\\Observer\\SetProduct), Object(Magento\\Framework\\Event\\Observer))\n#2 /home/franco/magento2/vendor/magento/framework/Event/Manager.php(66): Magento\\Framework\\Event\\Invoker\\InvokerDefault->dispatch(Array, Object(Magento\\Framework\\Event\\Observer))\n#3 /home/franco/magento2/var/generation/Magento/Framework/Event/Manager/Proxy.php(95): Magento\\Framework\\Event\\Manager->dispatch('sales_quote_ite...', Array)\n#4 /home/franco/magento2/vendor/magento/module-quote/Model/Quote/Item.php(431): Magento\\Framework\\Event\\Manager\\Proxy->dispatch('sales_quote_ite...', Array)\n#5 /home/franco/magento2/vendor/magento/module-quote/Mod"
..}

Thanks!


texts:
I need to upload file to Magento manually (without submitting form) - just set path to file in code and upload it to media directory.

I was thinking if doing it via UploaderFactory like this:

$uploader = $this->uploaderFactory->create(['fileId' => 'datafile']);
$uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);

$imageAdapter = $this->adapterFactory->create();
$uploader->addValidateCallback('catalog_product_image', $imageAdapter, 'validateUploadFile');
$uploader->setAllowRenameFiles(true);
$uploader->setFilesDispersion(true);
$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
$config = $this->config;
$result = $uploader->save($mediaDirectory->getAbsolutePath($config->getBaseTmpMediaPath()));

but it requires $_FILES array.

Is there a way to do it without $_FILES or set it manually?


texts: Magento2 Price including TAX/VAT renderer class

texts: Can anyone let me know which class and method is responsible for rendering tax price in product listing page? pricing without tax coming from Magento\Catalog\Block\Product\ListProduct and method getProductPrice but when I switch to other store which have tax/vat pricing, its not coming from there


texts: Magento 2 - How to re-add footer on checkout page after it's removed by default before

texts:
I'm trying to re-add footer on checkout page after it's has been removed from Magento 2 Blank Theme:

magento/theme-frontend-blank/Magento_Checkout/layout/checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="true"/>
        <referenceContainer name="header.panel" remove="true"/>
        <referenceBlock name="top.search" remove="true"/>
        <referenceBlock name="catalog.compare.link" remove="true"/>
        <referenceBlock name="catalog.topnav" remove="true"/>
        <referenceContainer name="footer-container" remove="true"/>
    </body>
</page>

I'm tried to overide on my theme:
Mystore/mytheme/Magento_Checkout/layout/checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="footer-container" remove="false"/>
    </body>
</page>

But it didn't working, anyone can help?


texts: Adding a custom theme for design changes

texts:
I am completely new to Magento and am having some trouble moving around in the files. I installed the Magento 2.1.7 CE with sample data.

We had a company migrate all products and information from a Shopify store. Now I need to update the design. From what I gathered I need to create a new folder in the app/design/frontend files.

I am not able to create or upload anything. It says I do not have the correct permissions or there is an error. Everything in that folder is set to 777. What am I doing wrong.

I also have seen a lot about running CMD through ssh. I am not able to do any of that either. I get an error about not being able to open the input file. Please help or provide direction. I am using cuteftp for file uploads and the site is on a shared vps server.


texts: Creating a custom product page layout template for a single product

texts:
My goal is to create a new product page layout to be used for specific products.  The products will always be a Grouped item (but not all grouped items) and I want to be able to select the template on the product's "Design" tab.

I have followed numerous tutorials on creating new templates and have done the following:

I have a template module that I added the following to config.xml

<Rig_Template translate="label">
    Rig Template
    <template>page/1column-rigs.phtml</template>
    <layout_handle>cff_rig</layout_handle>
</Rig_Template>

I have duplicated 1column.phtml and view.php to 1column-rigs.phtml and view-rigs.php

At this point, the new template shows up in the dropdown list on the design tab.

This is where I'm not sure what I'm doing. In local.xml I have put the following:

<layout>
    <cff_rig translate="label">
        Rig Template
        <reference name="root">
           <action method="setTemplate"><template>page/1column-rigs.phtml</template></action>
           <action method="setIsHandle"><applied>1</applied></action>
        </reference>

        <reference name="content">
            <block type="catalog/product_view" name="product.info" template="catalog/product/view-rigs.phtml">

           </block>
        </reference>
    </cff_rig>
</layout>

This code was mostly copied from the <catalog_product_view> section of page.xml.

The issue is that while this does show my modified view-rigs.php, it uses that template for all the products not just the one I set to Rig Template in the Design tab.  I feel like the code in the local is completely wrong.

I tried changing <reference name="content"> to <reference name="rigcontent"> and calling <?php echo $this->getChildHtml('rigcontent') ?> in 1column-rigs.php, but that breaks it and the main content of the page is blank.

What am I missing?
Thanks!


texts: Javascript error on product page in magento 2.2.4

texts:
After upgradeing to Magento 2.2.4 there seems to be an error on the product page where the javascript its not working properly (see the screenshot).

I am using Porto.
Any ideas?


texts:
Please check below screenshot showing in admin for configurable products for specific skus.

After page view, the source is giving the following errors.

Fatal error:  Call to a member function getSource() on a non-object in /var/www/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php on line 245


texts: Magento doesn't send autogenerated password

texts:
I've noticed that when I clic on "send auto-generated password" to a customer it sends an email but it doesn't displays the new password, it appears like:

  Dear customer,

  Your new password is:

And doesn't displays the password, is in blank. Anyone knows why this can happen?

In the backend/System/transactional emails I have this:

Your new password is: {{htmlescape var=$password}}

instead of the password (Is the code OK?).

My magento version is 1.7.0.

Thanks.


texts: magento2 show text swatch as dropdown in product listing age

texts:
I want to show dropdown attribute on product listing page but Magento is not providing that functionality so I have created attribute as text swatch now I want to show that attribute as a dropdown on the product listing page.

it is possible to create a dropdown of text swatch?
in list.phtml attribute as displaying through this line

<?= $block->getProductDetailsHtml($_product) ?>

like this i want to create a dropdown


texts: Exception Error-Undefined index: category-node-310

texts:
can any one help on how to fix this ??

Exception #0 (Exception): Notice: Undefined index: category-node-310 in /home/cp376418/public_html/app/code/TemplateMonster/Megamenu/Model/Configurator/Row/Column/Category.php on line 21

<?php namespace TemplateMonster\Megamenu\Model\Configurator\Row\Column;

class Category extends Entity
{
    public $rendererClass = 'Category';
    private $_subCategory;

    public function __construct(array $data = [])
    {
        parent::__construct($data);
    }

    public function getCategory()
    {
        if (!$this->_subCategory) {
            $nodes = $this->getNode()->getAllChildNodes();
            $this->_subCategory = $nodes['category-node-' . $this->getValue()];
        }
        return $this->_subCategory;
    }
}


texts:
I have the following line my configurable.phtml

$_renderers = $this->getChild('attr_renderers')->getSortedChildren()

But this throws the following error:

Call to a member function getChild() on a non-object

When I remove ->getSortedChildren the code works but the default swatches aren't displayed, instead there are dropdowns.

if(!empty($this->getChild('attr_renderers'))):
    $_renderers = $this->getChild('attr_renderers')->getSortedChildren();
endif;

If I use this nothing is displayed, which means that there are no child objects (I believe)

$_renderers = $this->getChild('attr_renderers');
var_dump($_renderers);

This returns bool(false). How can I fix this that the attribute swatches are displayed again?


texts:
I am trying to call an update layout handle in a product design custom layout update by inserting this code

<update handle="my_handle"/>

but nothing appears, if I put the content of that handle it shows up correctly or if I put this code in my xml

<default>
    <update handle="my_handle"/>
</default>

it works fine so my handle should work.
Is there something that loads those handles before calling the product custom design update?


texts: Magento 2 Attempt to load value of nonexistent EAV attribute with CategoryInterface after migration

texts:
after 1.x to 2.3
I am getting error as following in my System.log file.

[2020-02-06 13:29:01] main.WARNING: Attempt to load value of nonexistent EAV attribute '903'
                        for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []

I searched for the value 903 with queries:

SELECT * FROM catalog_category_entity_datetime WHERE attribute_id = 903;
SELECT * FROM catalog_category_entity_decimal WHERE attribute_id = 903;
SELECT * FROM catalog_category_entity_int WHERE attribute_id = 903;
SELECT * FROM catalog_category_entity_text WHERE attribute_id = 903;
SELECT * FROM catalog_category_entity_varchar WHERE attribute_id = 903;

there are no 903 values in the tables above

with the query below I get a result:

SELECT * FROM `catalog_eav_attribute` WHERE `attribute_id` = 903 ORDER BY `attribute_id` ASC

you can help me?

[of the tables on the left in the images only those shown in the image have attribute_id with value 903[enter image description here][1]1


texts:
I made a custom module which is actually a bit extended contact form module. I'm saving form data into database.
Is it save just to call $model->save() with values from POST?
This is how I save data:

$data = $this->getRequest()->getPost('partnercontact')
$model->addData($data); $model->save()

May I suppose that Magento sanitize values before saving it into database or my module is vulnerable to SQL injection attacks?


texts: Magento Not able to locate response class

texts:
I am creating a module to capture response on controller_front_send_response_before event.

In my observer file, I am getting both request and response object but I am not able to locate below class of response object:

  Magento\Framework\App\Response\Http\Interceptor

I am searching in /magento root/vendor/magento/framework/App directory.

Also, When I was trying to log response, I got only headers in log file. How can I get final content that will print on browser?

In onbserver file I have written following code:

  Ktpl\Logresponse\Observer\Response\Capture.php

namespace Ktpl\Logresponse\Observer\Response;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class Capture implements ObserverInterface
{
    private $logger;

    public function __construct(\Psr\Log\LoggerInterface $logger) {
        $this->logger = $logger;
    }

    public function execute(Observer $observer) {
        try {
            $response = $observer->getEvent()->getData('response');
            $this->logger->debug($response);
            $this->logger->debug(get_class($response));
        } catch(\Exception $e) {
            $this->logger->critical($e);
        }
    }
}

Please share if anyone has any idea about this.


texts: Moving Magento 1.9 to a new server causes Base table or view already exists error

texts:
the website was functionnal on the old server, I just copied the files and recreated the database, but I get this error :

a:5:{i:0;s:1610:"Error in file: "/home/encrefrezal2/public_html/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'catalog_product_entity' already exists, query was: CREATE TABLE `catalog_product_entity` (
  `entity_id` int UNSIGNED NOT NULL auto_increment COMMENT 'Entity ID' ,
  `entity_type_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Entity Type ID' ,
  `attribute_set_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Attribute Set ID' ,
  `type_id` varchar(32) NOT NULL default 'simple' COMMENT 'Type ID' ,
  `sku` varchar(64) NULL COMMENT 'SKU' ,
  `has_options` smallint NOT NULL default '0' COMMENT 'Has Options' ,
  `required_options` smallint UNSIGNED NOT NULL default '0' COMMENT 'Required Options' ,
  `created_at` timestamp NULL default NULL COMMENT 'Creation Time' ,
  `updated_at` timestamp NULL default NULL COMMENT 'Update Time' ,
  PRIMARY KEY (`entity_id`),
  INDEX `IDX_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE_ID` (`entity_type_id`),
  INDEX `IDX_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`),
  INDEX `IDX_CATALOG_PRODUCT_ENTITY_SKU` (`sku`),
  CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CAT_PRD_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Catalog Product Table' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci";i:1;s:1014:"#0 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.0.19.1.2')
#2 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.0.19.1.2')
#3 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/encrefrezal2/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/encrefrezal2/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/encrefrezal2/public_html/index.php(83): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I read that it has something to do with core_resource table, can someone tell what to do?


texts: Magento 2 Multistore how to handle logout on same browser

texts:
I'm a Magento 2 newbie. In my site we have 2 store- default and wholesale.

Account Login to default store will be like this - http://example.com/customer/account/login/ and for wholsesale store http://example.com/wholesale/customer/account/login

When I try to login to two store using different account from same browser it will work, but when I try to logout from one store it logging me out from another store also. How I can prevent this. I need to keep logging me in another(wholesale) store even if I logged out from default store.

I need this to work on same browser.

I created a module and tried to override logout action.

This is my code:

<?php

namespace Customvendor\Custommodule\Controller\Customer;

use Magento\Customer\Model\Session;
use Magento\Framework\App\Action\Context;
use \Magento\Framework\Controller\ResultFactory;

class Logout extends \Magento\Framework\App\Action\Action
{
    /**
     * @var Session
     */
    protected $customerSession;

    public function __construct(
        Context $context,
        Session $customerSession
    ) {
        //$this->session = $customerSession;
        parent::__construct($context);
        $this->redirect = $context->getRedirect();
        $this->customerSession = $customerSession;

    }
    public function execute() {
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        $customerId = $this->customerSession->getId();
        if($customerId) {
            //echo $customerId;exit;
            $this->customerSession->logout()
                 ->setBeforeAuthUrl($this->redirect->getRefererUrl())
                 ->setLastCustomerId($customerId);
            $this->messageManager->addSuccess(__('Logout successfully'));
            return $resultRedirect->setPath('customer/account/login/');
        } else {
            $this->messageManager->addSuccess(__('Customer is not logged in'));
            return $resultRedirect->setPath('customer/account/login/');
        }

    }
}

Please help me to fix this issue. Thanks in advance


texts:
Im not able to figure out the block name of swatches or how to move the swatches block inside product listing. Any suggestions?

Thanks,
Stian


texts: Magento 2: Add full name field to checkout billing address

texts:
I need to add a new fied "Full Name" to checkout billing address form. I have already added this to shipping address by following this: Use new field "Full Name" to replace "First Name" and "Last Name" in Checkout
I am trying to add the new field by following this but it is not working: https://webkul.com/blog/add-custom-field-billing-address-form-magento-2/
The full name field is not rendering in the checkout billing address form.


texts: How to import custom options with price is 0 in magento 2

texts:
I am trying to import the custom options with price 0 via backend. But it failed to save the price value with 0 and it throws an error like below.

  Notice: Undefined offset: 6336 in /var/www/html/xx/vendor/magento/module-catalog-import-export/Model/Import/Product/Option.php on line 1474

By referring this link https://github.com/magento/magento2/commit/4c76f9a441a564ade8e904cd99eed0827162ff9c

I have replaced the code as shown in the below image.

Then the option is imported correctly.

Can you tell me is this the right way to edit the core file?

By doing this, will it cause any issue in custom options?

Please guide me in the right way. Thanks in advance.