texts: Magento2: How to show billing address at bottom of payment method instead of showing for each payment

texts:
I want to show billing addresses at last of payment step only 1 time instead of showing for each method. Now the billing addresses are in payment method container. I have checked there is code in form template of each payment method.

<div class="payment-method-billing-address">
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>

Which is used to show billing address. I have tried to put it on payment.html without $parent but its not work.


texts: ._lib-popup-button-close-icon is undefined after Upgrading to Magento 2.1.0

texts: After upgrading my magento 2.0.7 to magento 2.1.0 via ssh. I encountered this error.


texts: How to add pagination with limit for collections in Magento 2?

texts:
I have filtered customer collection and showing in account navigation with one new custom link. upon clicking custom link on left nav i need to show collection on right side with pagination.

How this can be done? So far i am able to bring custom link on left nav and after clicking on it getting customer collection. How to add pagination to it with limit ?
Is that can be done. please advice anyone.


texts: remove bundle product with quantity 0 from the cart

texts:
i have a problem in the development of a store and i need help, in the image below on the bundle products page when resetting the quantity of a product it keeps showing up as 1 in the cart. I need that when resetting the input it just stops showing up in the cart. How is it possible to do this?

The previous image is of a bundle product, when I leave the input with zero I want it not to appear in the cart.


texts: Set product name per store view programmatically in Magento 2

texts: How can I set the name of a product in a specific language (store view)?


texts: magento 2.4 Impossible to process constructor argument Parameter #0 [  Magento\Framework\Search\Adapter\Mysql\Mapper $mapper ]

texts:
I am getting below error
Impossible to process constructor argument Parameter #0 [  Magento\Framework\Search\Adapter\Mysql\Mapper $mapper ] of Amasty\Shopby\Model\Search\Adapter\Mysql\AggregationAdapter class
Code as below
namespace Amasty\Shopby\Model\Search\Adapter\Mysql;

use Amasty\Shopby\Model\Adapter\Mysql\Aggregation\GroupDataProviderFactory;
use Magento\Framework\Search\RequestInterface;

class AggregationAdapter
{
    /**
     * @var \Magento\Framework\Search\Adapter\Mysql\Mapper
     */
    private $mapper;

    /**
     * @var \Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory
     */
    private $temporaryStorageFactory;

    /**
     * @var \Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder\Container
     */
    private $aggregationContainer;

    /**
     * @var \Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderContainer
     */
    private $dataProviderContainer;

    public function __construct(
        \Magento\Framework\Search\Adapter\Mysql\Mapper $mapper,
        \Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory $temporaryStorageFactory,
        \Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder\Container $aggregationContainer,
        \Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderContainer $dataProviderContainer
    ) {
        $this->mapper = $mapper;
        $this->temporaryStorageFactory = $temporaryStorageFactory;
        $this->aggregationContainer = $aggregationContainer;
        $this->dataProviderContainer = $dataProviderContainer;
    }

I know this error is due to msql is removed as default search engine, but i need way to fix above issue please help me with it


texts: Composer installed Ecomdev_PhpUnit skips tests due to missing vfsstream

texts:
I'm working with an Enterprise Edition 1.13.1 install (although Community Edition would have the same issue), and we're installing dependencies via composer where they're available.  I've installed Ivan's Ecomdev_PhpUnit extension via composer which has bought in all of the normal phpunit dependencies.  I've also copied phpunit.xml.dist from vendor/ivanchepurnyi/ecomdev_phpunit into my projects root directory.

When I first ran my unit tests, I received the following error:

The test was skipped, since vfsStream component is not installed. Try install submodules required for this functionality

I've subsequently added the following require-dev entry to composer.json and run composer update:

"mikey179/vfsStream": ">=1.2.0",

However, PHPUnit still complains that vfsStream isn't installed.

Looking through the GitHub repository for the Ecomdev_PHPUnit extension it looks like a patch has been merged to allow libvsfstream to be autoloaded when composer is used.  However, this seems like a partial solution as the composer autoloader isn't included anywhere, so the class_exists call still fails.

I can edit /vendor/ivanchepurnyi/ecomdev_phpunit/app/code/community/EcomDev/PHPUnit/bootstrap.php:41 to include the composer autoloader during  the bootstrap (or copy the bootstrap.php to another location in my project and edit that).  Is this the best solution to this problem, or is there a feature in either Composer or Ecomdev_PhpUnit that I'm missing?


texts: How to disable Shipping Price in Magento 2?

texts:
I need to disable the shipping price option and want to add later into the order in the backend. In place of shipping rate, a message as "Shipping will be calculated and informed after placing the order".

How to do it?

We sell heavy materials, so there are lots of factor according to which we decide the shipping charge. There is no fixed rate chart.


texts:
Sorry for my English

I have this code

$productCollection = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSelect('short_description')
        ->addAttributeToFilter('attribute_set_id', array(12, 4))
        ->joinField(
            'qty',
            'cataloginventory/stock_item',
            'qty',
            'product_id=entity_id',
            '{{table}}.stock_id=1',
            'left'
        )
        ->addAttributeToFilter('qty', array("gt" => 0))
        ->setPageSize(100);

how can i get the number of images of this product or just get the product images.  I would like to avoid the situation receiving pictures when the loop is running because it is database load


texts:
I have taken over a webshop and I want to add some new simple products with custom opstions and as a drop down. The previous owner somehow set the default text to something (what is displayed in the drop down before selecting) - Where do I change that default text?

Thanks

See text in drop down - it should say choose size or something
"Ingen gaveindpakning" is not even an option - how do I change that text?

"Ingen gaveindpakning" is not even an option - how do I change that text?


texts: Could someone teach me how to retrieve the option label for current store view? There is a table eav_attribute_option_value where these information are already stored, but I don't know what model I must use.


texts: Forgot password not send any email magento2-gmailsmtpapp.

texts:
I want the system automatically send email to the user (who forgot password and provide the email). I am using Magento 2.1.7.

I have installed https://github.com/magepal/magento2-gmailsmtpapp on my Magento application.

After config my gmail account (enable imap and less secure app) I am able to send test email.

But when I provide email and click reset password, no email send to my account.

How can I config Magento admin to be able to send reset password email to the user(when they forgot password)? I am newbie in magento.


texts:
The calendar in magento backend double his width when I hover over the hour or minute field.

An image show what I mean:

 hover, right the normal version)

Language: german (de_DE)

I have this in different installations. Anyone know how to fix this?


texts:
I have a custom collection to which I add filters. For example, I have this:

$giftColletion = $this->_giftFactory->getCollection();
$giftColletion->addFieldToFilter('store_id', 1);

What filter should I add to $giftColletion so it can return all the records  by field position in ASC order ?


texts: How to add a JQuery library in Magento 1.9

texts:
I was needing to add a Jquery library in magento 1.9, to use on one of my phtml pages, to insert masks in my fields, like cpf, cnpj and etc ...

I have done a lot of research and I have noticed that the subject is very scarce, but very necessary, and I want to share this knowledge with you. There are a lot of details to watch out for, but with a lot of patience it works, I discovered the right and proper method to do this, and I also discovered the fast method if the first method does not work.


texts: PDF File upload in custom mudule in admin in 2.0

texts: How we can upload the PDF file in magento 2,0 from admin module ?


texts: Permission denied error when trying to access magento2 prior to installation on Ubuntu 20.04 / nginx / php 7.4

texts:
What I've done so far,
Installed nginx 1.19.6
Installed php 7.4 and all required extensions in Magento Documentation
Installed and configured MySQL as per documentation, and created magentodb
Installed Elasticsearch 7.x (Success)
Installed Redis-server (Success)
DID NOT install Varnish since the Magento documentation states that it does not support SSL and I can't run my magento store without SSL.
Downloaded Magento 2.4.1 Community edition with sample data
Moved to the chosen root directory @ /var/www/
Created Non-root sudo user, and carefully provided all the necessary permissions.
Usually, I get a magento welcome page like this one:

But this time, i rebuilt my whole droplet making sure i didn't miss any of the details that caused me errors before. This time I'm getting an "Unable to connect" error in my browser, and sending a GET request from terminal is returning the below error.
curl -XGET 'https://mydomain/'
curl: (7) Failed to connect to mydomain port 443: Connection refused

ping to mydomain successfully points to my cloud IP address
PING mydomain (ipv4-xxx-xx-xxx) 56(84) bytes of data.
64 bytes from ipv4-xxx-xx-xxx (ipv4.xxx.xx.xx): icmp_seq=1 ttl=53 time=167 ms

GET Request to my localhost on my server successfully returns the Nginx welcome page:
 curl -XGET 'localhost'
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>

Does anyone have a hint where to go from here?
@samuel-demir
Update: I am running Magento 2.4.1 Community Edition
Nginx Status
Active: active (running) since Fri 2021-01-22 19:26:03 UTC; 15h ago

Nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

PHP7.4-FPM status
Active: active (running) since Fri 2021-01-22 18:49:59 UTC; 16h ago

Didn't install varnish since the Magento Docs state that it doesn't support SSL.
Yes my configuration file is symlinked to /sites-enabled/
This is my /sites-available/* config file
upstream fastcgi_backend {
        server  unix:/run/php/php7.4-fpm.sock;
}

server {
    listen 80;
    listen [::]:80;
    server_name mydomain;
    return 301 https://$server_name$request_uri;
}

server {

        listen 443 ssl;
        server_name mydomain;

        ssl_certificate /etc/letsencrypt/live/mydomain/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/mydomain/privkey.pem;

        set $MAGE_ROOT /var/www/magento2;
        set $MAGE_MODE default;
        include /var/www/magento2/nginx.conf.sample;
}

Also, I have UFW enabled with the following allowed connections
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 443/tcp                    ALLOW IN    Anywhere
[ 2] 22/tcp                     ALLOW IN    Anywhere
[ 3] 443/tcp (v6)               ALLOW IN    Anywhere (v6)
[ 4] 22/tcp (v6)                ALLOW IN    Anywhere (v6)


texts:
When I do $this->getLayer() in a block template, I get a lot of output but I don't understand it.

I'm trying to make my own module for displaying products based on certain queries and want to understand this getLayer() reference.

The code where I saw getLayer() was:

 protected function _getProductCollection()
    {
        if (is_null($this->_productCollection)) {
            $layer = $this->getLayer();
            /* @var $layer Mage_Catalog_Model_Layer */
            if ($this->getShowRootCategory()) {
                $this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
            }

            $origCategory = null;
            if ($this->getCategoryId()) {
             $category2B = $this->getNameInLayout
                //$category = Mage::getModel('catalog/category')->load($this->getCategoryId()); //important
                if ($category->getId()) {
                    $origCategory = $layer->getCurrentCategory();
                    $layer->setCurrentCategory($category);
                    $this->addModelTags($category);
                }
            }
            $this->_productCollection = $layer->getProductCollection();

            $this->prepareSortableFieldsByCategory($layer->getCurrentCategory());

            if ($origCategory) {
                $layer->setCurrentCategory($origCategory);
            }
        }

        return $this->_productCollection;
    }

I pretty much understand everything here except the layer. Is this referring to a model? Please help me understand exactly what this code is doing.

Whoops, turns out getLayer was defined later in the PHP file, but I still don't understand its function...

 public function getLayer()
    {
        $layer = Mage::registry('current_layer');
        if ($layer) {
            return $layer;
        }
        return Mage::getSingleton('catalog/layer');
    }


texts:
I am running magento 1.9 and I am trying to make some cookie checks for each api request in the backend.
Thus, to make the checks as the first thing I am trying to find a common class which can work as an interceptor for all api request. So, do we have any such class in magento 1.9 which is called before the control goes to the controllerAction method so that I can do the necessary checks.


texts: Magento 2 email template change table header text

texts:
Hi How can I change the text of the new shipment email template?
I want to change the highlighted text. I knew it is calling this block. Is there any otherway to change it?
{{layout handle="sales_email_order_shipment_track" order=$order  shipment=$shipment lang='en_CA'}}


texts:
down vote favorite

I am working on magento community version , I want to create shipment from backend in magento.

I had already done with custom quote sample and checkout method , I am not getting the solution which method I have to override to generate shipment from our custom API module.


texts: How to properly remove db table prefix in magento2

texts:
I just removed the table prefix ('mg_') from my magento 2.0.2 installation using phpmyadmin. I also updated app/etc/env.php to not include any db table prefix. After that I flushed all caches (php bin/magento cache:clean) and reindexed everything (php bin/magento indexer:reindex). everything works fine, EXCEPT

When I hit the 'Place Order' button at the end of the checkout I get an SQL-error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.mg_sequence_order_1' doesn't exist, query was: INSERT INTO `mg_sequence_order_1` () VALUES ()

Apparently the table prefix is somehow not been removed in this one particular place. Can anyone maybe point me to a way how to proceed?


texts:
I'm writing a new theme for magento 2.

I need to truncate product short description in my template. In version 1 there was a method in core/string helper, so i was able to do something like Mage::helper('core/string')->truncate($string, $length).

In Magento 2 i can't find a way to do that without rewriting a ListProduct class.


texts: How to format date and price in grid ui-component Magento 2

texts:
I want format start date and end date to dd-mm-y, offer price to xxx,xxx.xx

My column

<column name="start_date">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">dateRange</item>
                <item name="dateFormat" xsi:type="string">dd-MM-y</item>
                <item name="sorting" xsi:type="string">asc</item>
                <item name="label" xsi:type="string" translate="true">Start Date</item>
                <item name="sortOrder" xsi:type="number">1</item>
            </item>
        </argument>
    </column>
    <column name="end_date">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">dateRange</item>
                <item name="dateFormat" xsi:type="string">dd-MM-Y</item>
                <item name="sorting" xsi:type="string">asc</item>
                <item name="label" xsi:type="string" translate="true">End Date</item>
                <item name="sortOrder" xsi:type="number">1</item>
            </item>
        </argument>
    </column>
    <column name="offer_price">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">textRange</item>
                <item name="sorting" xsi:type="string">asc</item>
                <item name="label" xsi:type="string" translate="true">Offer Price</item>
                <item name="sortOrder" xsi:type="number">1</item>
            </item>
        </argument>
    </column>

Please help me.


texts: I tried to install Magento2 on My local system but i got this error


texts: Adding a new Country name to the Country Field of Address by changing an existing Country name

texts:
I need to add a new Country name to the Field of Country in address by changing an existing Country name, but i can't find the place that the country names Are Stored.

For example i Need to change the "Tuvala" Option to my desired Country name.
and also i need too change this value in other Localization formats.
how can i do this change?


texts: What does the "exclude" Tag in Magento 2's view.xml file do

texts:
The Magento 2 "blank" theme includes the following tag hierarchy.

<exclude>
    <item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
    <item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item>
    <item type="file">Lib::jquery/jquery.details.js</item>
    <item type="file">Lib::jquery/jquery.details.min.js</item>
    <item type="file">Lib::jquery/jquery.hoverIntent.js</item>
    <item type="file">Lib::jquery/jquery.min.js</item>
    <item type="file">Lib::mage/captcha.js</item>
    <item type="file">Lib::mage/dropdown_old.js</item>
    <item type="file">Lib::mage/list.js</item>
    <item type="file">Lib::mage/loader_old.js</item>
    <item type="file">Lib::mage/webapi.js</item>
    <item type="file">Lib::moment.js</item>
    <item type="file">Lib::requirejs/require.js</item>
    <item type="file">Lib::date-format-normalizer.js</item>
    <item type="file">Lib::legacy-build.min.js</item>
    <item type="directory">Lib::modernizr</item>
    <item type="directory">Lib::tiny_mce</item>
    <item type="directory">Lib::varien</item>
    <item type="directory">Lib::jquery/editableMultiselect</item>
    <item type="directory">Lib::jquery/jstree</item>
    <item type="directory">Lib::jquery/fileUploader</item>
    <item type="directory">Lib::css</item>
    <item type="directory">Lib::lib</item>
    <item type="directory">Lib::extjs</item>
    <item type="directory">Lib::prototype</item>
    <item type="directory">Lib::scriptaculous</item>
    <item type="directory">Lib::mage/requirejs</item>
    <item type="directory">Lib::mage/adminhtml</item>
    <item type="directory">Lib::mage/backend</item>
    <item type="directory">Magento_Swagger::swagger-ui</item>
</exclude>

What is this here for.  i.e. what's being excluded from what?  Where and when does Magento 2 system code access this information?


texts:
I have a magento 1.7 shop and there been some issues with orders which are resolved but I need to restore some orders

I've written the following to try and display the orders

<?php

require_once "app/Mage.php";
umask(0);
Mage::app('admin');
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$order_id = 100001096; //use your own order id
Mage::getModel("sales/order")->loadByIncrementId($order_id); //load order by order id
$ordered_items = $order->getAllItems();
foreach($ordered_items as $item){     //item detail
    echo $item->getItemId(); //product id
    echo $item->getSku();
    echo $item->getQtyOrdered(); //ordered qty of item
    echo $item->getName();     // etc.
 }
?>

However I'm getting

 mod_fcgid: stderr: PHP Fatal error: Call to a member function getModelInstance() on a non-object in /var/www/vhosts/officestationerywarehouse.co.uk/httpdocs/app/Mage.php on line 462

I'm unsure were I'm going wrong with this.

Update:
Just to note for people looking at this to try and find order from quotes. This code doesn't pull quotes only orders.


texts: Certain Products not Showing in Catalog but Not in Search

texts:
My some products not showing in search. I attach the screen shots of the problem.

Please provide a solution. Thanx...!2


texts: Filter collection value from another value from another index

texts:
I create a custom attribute last_sync for customer custom attribute, i need to filter it if this attribute is null OR greater than created_at, right now i'm using code like this:

$collections = Mage::getModel('customer/customer')->getCollection()
        ->addAttributeToSelect('*');

foreach ($collections as $collection)
{
  $result = array();
  $result = $collection->getData();
  if(is_null($result['last_sync']) || ($result['last_sync'] < $result['updated_at']))
  {
     $results[] = $result;
  }
}
return $results;

the problem for the above code is the speed time, because i have to loop through each customer data than filter it


texts:
I am trying to set up a new website which has been migrated from an older site.

This migration carried over the old category structure.

Within the new structure i want to build, I am creating new root categories for different store views. I want to copy some of the categories into multiple store view Root categories.

Is this possible and if so how can i achieve this?

when i click on a sub category, my only options are Save and Delete.

I am trying to do this in Magento 2.2.4


texts: Mirasvit SeoContent conflict with customer address

texts:
I am using magento version 2.2.5. Mirasvit SeoContent extension version 2.0.92.

Problem: When the customer is login, the Customer not able to enter the address. Because magento225/customer/address/new/ or magento225/customer/address/new/edit/ is not opening. When I click on it, it will redirect to the magento225/customer/account page. I spent more than 10 hours to find out the reason.

I disabled all extensions that time address URL is opening and working fine. So I unable to extension one by one. That time I came to know that this Mirasvit SeoContent Extension creates a problem to open customer address URL.

Does anyone know how to solve it?

EDIT :
Both functionality are important. We need SeoContent Extension and also want to save customer address. So Can't disable extension.


texts: How do I change the text color of the Search the entire Store Here text in search box

texts:
I have figured out several places and ways to change the actual text, but can't seem to figure out how to change the color of the text. Any help would be appreciated.

I am pretty new to Magento, I have learned a ton in the last month or so, but I still do not understand how to do a lot of things. I am using Magento 1.9 with a theme called Grayscale Full-width responsive. I know that the text for the search box is located in form.mini.phtml (specific code copied below) - but first I am unclear how to change the color with this format. I tried sticking a #"color code" in but either I am putting it in the wrong place or using the wrong format. Second, I had been hoping there was a way to change it either in styles.css, color.css or local.xml file so that when an update comes along it won't wipe out my changes, since the only place I can find the form.mini.phtml file is under app/design/frontend/base/default/template/catalogsearch/
There is not a similar file in my theme folder, so I am assuming they are defaulting to the base code.

  <script type="text/javascript">//<![CDATA[var searchForm = new
Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__
('Search entire store here...') ?>');searchForm.initAutocomplete('<?php
echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');//]]>

I posted an update to this question in the comment below.


texts: Composer error when try install extension

texts:
I'm getting this when i'm trying to install an extension.

  Warning: Unsupported declare 'strict_types' in
  /home/SITE_NAME/public_html/vendor/magento/inventory-composer-installer/src/Plugin.php
  on line 6

  Parse error: syntax error, unexpected ':', expecting ';' or '{' in
  /home/SITE_NAME/public_html/vendor/magento/inventory-composer-installer/src/Plugin.php
  on line 55

I have : CentOS Linux release 7.5.1804 (Core); PHP 7.2 (via cPanel) ; Latest magento 2.3.3 CE

php -v
PHP 5.6.40 (cli) (built: Oct 29 2019 08:07:50)

Need Some Help


texts: How to cancel order Programmatically without disabling URL security key

texts:
Here am trying to Cancel a order from a controller using order ID. but order is cancelling only if security key adding to URL disabled from admin configuration. How to cancel order without disabling secure URL Key.
here is my code controller
protected $orderManagement;
public function __construct( \Magento\Sales\Api\OrderManagementInterface $orderManagement)
{
 $this->orderManagement = $orderManagement;
}
 public function execute()
 {
   $orderId = 10;
   if($this->orderManagement->cancel((int)$orderId)){
        $this->messageManager->addSuccess(__("Order Cancellation Success"));
        return $resultRedirect;
   }else{
        $this->messageManager->addError(__("Can't Cancel this Order"));
        return $resultRedirect;
   }
}

Where am doing wrong. Can I get help? Thank you in advance.


texts: Override compare list template in module

texts:
How to override template file

Magento/module-catalog/view/frontend/template/product/compare/list.phtml using module?


texts: How can I edit text displayed in "Estimate Shipping and Tax" module when there are no available shipping methods?

texts:
The way our Magento store is setup, there are instances where the shipping method is hidden/unavailable and the text in the "Estimate Shipping and Tax" module area simply says "No Available Shipping Methods"
I would like to edit this text to be more descriptive and let them know to contact us for other options.

The question is, where is this text located so that I can modify it?

Running Magento 1.9.0.1 CE
Thank you in advance.


texts: How can I upload a video and make it secure that no one else can play that video even if they know the link of the video?

texts:
Teachers will upload video and students will only be able to watch and download it's tutorial if they pay or purchase that product.

It can have multiple attachments like video streaming and PDF to download

My query is...

How can I show attachments which are added to the products after student places successful order?


texts: Magento 2.1 - How override /vendor/magento/module-tax/view/frontend/web/template/checkout/summary/shipping.html

texts:
I want override this:

/vendor/magento/module-tax/view/frontend/web/template/checkout/summary/shipping.html

I use Magento 2.1


texts: Import add and update products with their attributes in a CSV file and cron job Magento2

texts:
I am using Magento 2.3.3 and wants to import products using cron and csv. I have google Sheet which contains all products data and sheet's data changes continuously. So I have to run a cron every day which updates product price, qty and some attributes values.

I've generated csv from sheet and it is being successfully imported manually.

Then I tried to import csv using cron by hitting some import functions existing in module- import-export. But didn't work and everything messed up.

Now I'm trying to import products by directly save them in database.

Is it possible to do that? Or is their another way?


texts: Magento 2 Add 'My Cart','Compare Products','Newsletter' Sidebars in right column

texts:
I have a CMS Page with '2 Column Right' layout.  I want to add 'My Cart','Compare Products','Newsletter' Sidebars in right column.

http://i.prntscr.com/eb303e17180d467dbc80b942cd3076ee.png

How is it possible?


texts: Magento 2 - Why is less so painfull to use compared to css? (css vs. less)

texts:
I started to learn .less but it brings more difficulties than benefits.

In css, I can just edit files in the browsers developer tool after I activated "Enable Local Overrides", and see the result immediately live.

And after I finished my edits, I overwrite the real file with the modified file from the browser. Easy peasy.

But if I use .less, then I first have to figure out in which file the code I need to edit is located, then I have to guess the right values and execute:

rm -rf pub/static/frontend var/view_preprocessed
php bin/magento cache:flush full_page

and then clear the browser cache and reload the site, so I can see the changes...
Thats alot of pain compared to normal CSS.

Am I doing something wrong in my workflow or is it really this complicated and painfull?

Imagine you want to set the margin-left of a button. Then how do I even know in which file this button is located if it just shows styles-l.css in the developer tools? Can I just create a new file main.css and add the css query into it which changes the margin or is this bad ? I wonder when should I use less and when css

I hope someone with much experience with .less can answer what steps he follows, when he wants to change the style of a button, for example. From start to end.


texts:
How to get Custom category attribute No value

      <?php

require_once("app/Mage.php");
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId     = $installer->getEntityTypeId('catalog_category');
$attributeSetId   = $installer->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$installer = new Mage_Sales_Model_Mysql4_Setup;
// change details below:
$attribute  = array(
    'group'                => 'General',
    'type'              => 'int',//can be int, varchar, decimal, text, datetime
    'backend'           => '',
    'frontend_input'    => '',
    'frontend'          => '',
    'label'             => 'Manoj',
    'input'             => 'select', //text, textarea, select, file, image, multilselect
    'default' => array(0),
    'class'             => '',
    'source'            => 'eav/entity_attribute_source_boolean',//this is necessary for select and multilelect, for the rest leave it blank
    'global'             => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
    'visible'           => true,
    'frontend_class'     => '',
    'required'          => false,//or true
    'user_defined'      => true,
    'default'           => '',
    'position'            => 100,//any number will do
);
$installer->addAttribute('catalog_category', 'custom_attribute', $attribute);
$installer->endSetup();

$installer->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'custom_attribute',
    '11'

//last Magento's attribute position in General tab is 10
);

$attributeId = $installer->getAttributeId($entityTypeId, 'custom_attribute');

$installer->run("
INSERT INTO `{$installer->getTable('catalog_category_entity_int')}`
(`entity_type_id`, `attribute_id`, `entity_id`, `value`)
    SELECT '{$entityTypeId}', '{$attributeId}', `entity_id`, '1'
        FROM `{$installer->getTable('catalog_category_entity')}`;
");

//$this->endSetup();

?>

i tried this if i set yes it show 1 but no it shows noyhing

<?php if($_customAttribute = $this->getCurrentCategory()->getCustomAttribute()): ?>
    <?php echo $_helper->categoryAttribute($_category, $_customAttribute, 'custom_attribute') ?>
<?php endif; ?>


texts: Can I edit an Order and keep the payment information?

texts: I have a customer that ordered 5 products, but 2 are out of stock and cannot fulfill the full order. However, when I edit the order (delete it and create a new one) to remove the two SKUs, the credit card information gets removed. Is there a way to keep that so I do not need to call the customer?


texts: Custom attribute of product should not be display at layerd filter, after disabled that custom module

texts:
I have created custom product attribute 'discount' from my custom module.
This attribute displayed at Layered Navigation.
Now, If I disable my custom module from Admin Panel System >> Configuration >> Advanced or from app/etc/modules/modulefile.xml still newly created attribute shows at frontend.

where I can check the condition to hide it from layered filter ?

Custom attribute installation script is here

$installer = $this;
        try{
            $productTypes = array(
                Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
                Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE

            );
            $productTypes = join(',', $productTypes);

            $installer->startSetup();

        $installer->addAttribute('catalog_product', 'discount', array(
            'group'             => 'Prices',
            'type'              => Varien_Db_Ddl_Table::TYPE_VARCHAR,
            'backend'           => '',
            'frontend'          => '',
            'label'             => 'Discount',
            'input'             => 'price',
            'class'             => '',
            'source'            => '',
            'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
            'visible'           => true,
            'required'          => false,
            'user_defined'      => true,
            'default'           => '',
            'searchable'        => false,
            'filterable'        => true,
            'comparable'        => false,
            //'visible_on_front'  => true,
            'unique'            => false,
            'apply_to'          => $productTypes,
            'is_configurable'   => false
        ));

        $installer->endSetup();
        }
        catch(Exception $ex){
            echo $ex->getMessage();
        }


texts: Show thumbnail image via Data Provider in Dynamic Rows in admin form magento 2

texts:
How can I show image thumbnail (edit form) for dynamic rows created by Magento's Row Pattern using Data Provider / Modifier. Like this link:
Magento2 How to add row pattern/dynamic rows to the custom product attribute
My data saved in database as json format like below:
[{"record_id":"0","repairby":"1","note":"good","start_date":"","est_date":"","callback_date":"","hours_worked":"4","image":["Screenshot from 2021-05-17 15-58-43.png","Screenshot from 2021-05-20 13-08-23.png"],"initialize":"true"}]


texts: Magento 2.3 jquery accordion seems blocked

texts:
I am aware of the built in Magento accordion but do not want to use it. I want to use jQuery accordion.
In my theme web/js/custom.js I have the following
define([
"jquery",
'accordion',
],
function($, accordion) {
"use strict";
    $(document).ready(function(){
        $(".accordion").accordion();

The code is called, but it does not work. When I say does not work, I mean the accordion is not enabled on the page.
In the javascript console I can copy and paste the same line of code, jQuery('.accordion').accordion(); and it works perfectly. I believe something in core Magento is blocking the jQuery accordion when the page is loading/ready.
I also added logging statements like console.log($('.accordion').html()) and it prints the html - the exact same html that is present when I run the command from the javascript console.
If I add setTimeout() with 1,000 ms then it creates the accordion correctly.
What the heck is going on here? How can I debug what is causing this behavior? There isn't much more frustrating than an error that doesn't appear to make sense.


texts: Get Customer from Order inside Observer function

texts:
I need to make a custom customer attribute available as email template variable.

I created the following Observer, that executes just fine.

use Magento\Framework\Event\ObserverInterface;

class AddExtraDataToTransport implements ObserverInterface
{
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    $transport = $observer->getEvent()->getTransport();
    $order = $transport->getOrder();

    $transport->addData([
       'test' => 'this is a test',
    ]);
  }
}

How would I get ahold of the order's Customer here?

I tried using $order->getCustomer() which returns null.
I expected it to return the Customer Object.

After reading the code of Order I expected this to work.

\Magento\Sales\Model\Order Line 46:

* @method \Magento\Customer\Model\Customer getCustomer()

Can anyone point me in the right direction?


texts: how to reorder (switch) billing address before shipping address

texts:
on the onepage checkout I need to reorder the billing address before the shipping address.
in fact the logic should be the other way around than it is now.
if the shipping address differs from the billing address you should be able to edit it.
now you can edit the billing address if it differs from the shipping address.
also the billing address should appear on the same "page" as the shipping address. currently step 1 in the magento checkout steps.

how would I do this? maybe there is a plugin for this but I couldn't find one yet.

I attached a screenshot of a german shop doing it like this:

I found the .html template file for the billing form and it seems this is the place where it ends up in the checkout_index_index.xml:

<item name="billing-step" xsi:type="array">
    <item name="component" xsi:type="string">uiComponent</item>
    <item name="sortOrder" xsi:type="string">2</item>
    <item name="children" xsi:type="array">
        <item name="payment" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Checkout/js/view/payment</item>
            <item name="config" xsi:type="array">
                <item name="title" xsi:type="string" translate="true">Payment</item>
            </item>
            <item name="children" xsi:type="array">
                <!-- ... -->
                <!-- merge your payment methods here -->
                <item name="afterMethods" xsi:type="array">
                    <item name="component" xsi:type="string">uiComponent</item>
                    <item name="displayArea" xsi:type="string">afterMethods</item>
                    <item name="children" xsi:type="array">
                        <!-- merge additional data after payment methods here -->

<!-- I think here the billing form ends up -->

                    </item>
                </item>
            </item>
        </item>
    </item>
</item>

But it's not specifically placed here and I can't seem to find another place where it is injected to that place.


texts:
Building a custom module, where i need to make ajax call.  I search on magento project i get

this.getUrl()

Method being used in

  vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js

define(
[
    'Magento_Customer/js/model/customer',
    'Magento_Checkout/js/model/url-builder',
    'mageUtils'
],
function(customer, urlBuilder, utils) {
    "use strict";
    return {
        getUrlForTotalsEstimationForNewAddress: function(quote) {
            var params = (this.getCheckoutMethod() == 'guest') ? {cartId: quote.getQuoteId()} : {};
            var urls = {
                'guest': '/guest-carts/:cartId/totals-information',
                'customer': '/carts/mine/totals-information'
            };
            return this.getUrl(urls, params);
        },

In order to use this.getUrl() in my custom module, i have added mageUtils and url-builder to my widget js file but don't work.

I would like to know where is it defined ? or how can i use that method ?


texts:
I lost a few orders at Magento and I am recreating it manually, but I need to keep the old id.
I do not have enough information to create all the lost orders, because this some orders id need to be skipped, because this I want to manually put the id of them.

I tried the mysql with the command:

update sales_flat_order set increment_id=100000180, entity_id=180 where entity_id=168;

Thanks in advance


texts: I would like to change the mobile breakpoint from 767px to 900px but I can't seem to get it to work eventhough I have been following what is instructed in This. Would really appreciate to have a proper instruction or code sample if possible on how to achieve this. I tried modifying lib/web/mage/menu.js but still no luck


texts: How to apply all valid Shopping Cart Price Rules to quote?

texts:
I am trying to create extension that add coupon code (Ajax) to one page checkout page last step.
See http://www.lelandcope.com/2012/04/how-to-create-an-ajax-coupon-discount-code-box-in-magento/

Following code of CartController customcouponPostAction() which applies coupon code. its works fine

        $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
        $this->_getQuote()->getShippingAddress()->collectShippingRates();
        $this->_getQuote()->setCouponCode(strlen($couponCode) ? $couponCode : '')
            ->collectTotals()
            ->save();

Shipping and handling charges calculation work fine as per table rate but when  another Shopping Cart Price Rule which is free shipping above $15 (See http://www.phpro.be/news/configuring-shopping-cart-price-rules-magento-free-shipping) is also valid then shipping charge not become zero its still same as table rate.

Same scenario works like charm in cart page.

What am I missing?


texts: Products by category are not displayed on the frontend (Magento 2.4.0)

texts: After having made a stormy migration from magento 1.8.1.0 to Magento 2.4.0 in the backend I can see all the categories and their products, however in the frontend when selecting any of the categories in the menu the products are not show, it is as if the category is empty. Please help


texts: Change the Tracking Information Shipment # to Order #

texts:
I'm trying to change the pop-up window when customers track their orders, the pop-up currently shows:

"Shipment #" I would like to change this to the actual order number.

I have tried the following:

<?php echo $this->__('Order #'),$_order->getRealOrderId();?>

But it doesn't load.

The original file is located in:

  default/template/shipping/tracking/popup.phtml

How can I display the Order # instead of the Shipment # on this pop up?


texts: Create a ResourceModel based on 3rd Party API Call from Magento

texts:
I am working on integrating a 3rd Party API into Magento. I'd like to use an Admin Grid with a Data Source that comes from a 3rd party API. So Essentially the Flow work like this...
User Loads into admin page with grid -> grid has data source specified to resource model -> resource model calls 3rd party api to get data -> data is returned to resource model(not sure if its supposed to be resource model or collection or factory in this scenario) -> data is bind through the resource model to the grid.
If there's any additional information needed please let me know. I'm not sure what all information might be helpful.


texts:
My website www.antiqworld.com whenever i am trying to open my website automatically redirect on (https://20.unverf.com/?h=230916016_ee5d07ec7ec_98__def_sub__sub_id_2&cnv=1) this url

please help to resolve this issue asap


texts: Pagination not showing on any page with products

texts:
I'm at a loss as to what to do next, I've reviewed all of the posts on the site and tried every solution, but still I am unable to see pagination of the products, the toolbar is simply not displaying?

Steps taken so far:
1. Upgraded the site from 1.7 to 1.9 (not working on 1.7 either, so thought an upgrade would resolve)
2. Added all appropriate code, based on the solutions on this site, to List.phtml, Catalog.xml
3. Tried recopying the original files from a fresh download.
4. Modified the pagination settings within the admin menu, from grid to list etc and played around with the settings, I get to see more products when amending, but still no toolbar displaying?
5. Added a 3rd party extension called Meanbee infinite scroll, to see if that would override the settings.  But no change at all after enabling in the admin config menu?

The site address is sos-swim.co.uk.

I'm not a web developer and just trying to help out a friend.

Any suggestions would be great to point me in the right direction.

All the best
Alan


texts:
I need to show in my home page a bestseller products list of certain category. To do so, i already created programmatically my own widget that lists bestseller products, but there's no way to drag a widget content with page builder. I know that i can drag a HTML content and insert there my widget, but i wonder if there's a better solution.

What's the best way to achieve it? Is there any way to extend Page Builder so i can add a widget type? Would you recommend any other option?


texts: Magento2.3: Is it possible to create multiple My-account dashboard?

texts:
In my site, we have 3 types of customer groups and want to show the separate My-account dashboard for those customer after they logged-in.

In order to achieve, do we need to create separate dashboards?

Hope you have understood my question.

Any help will be appreciated!


texts: How to create a uploader for multiple files in Stores -> Configuration?

texts:
I want to create dynamic rows where the user can add or remove a row, as well as for each row he can add a title and upload files, he can upload several files for each row, and I want to implement all this in Stores -> Configuration -> Custom TAB
Tell me how best to do this? Or are there any ready-made options for this or similar to this so that I can release it?


texts:
Can I add the search box to a template without xml?

I need to create a dropdown with the search box when I click on a magnifying glass icon.


texts:
For test purposes with magento 2.2 there was form created which task is simply to store some text in database and all these messages should be shown at same page above that form as list.

So the problem is that after saving magento displays the old list without the newly added message and as it turned out the problem in the cache, namely in the full page cache i.e if you reset it then absolutely all the messages will be displayed.

The form was made by absolute analogy with the feedback form from vendor/magento/module-contact. The only solution that I have found is to call $this->cacheTypeList->cleanType('full_page'); after successfully saving to the database (where cacheTypeList is an object with an interference \Magento\Framework\App\Cache\TypeListInterface from the constructor)

And the question arises is it right way and how to act if not? (To clean all cache obviously somehow not really, I suspect that there has to be a method of cleaning of cache only of a specific page)


texts: No Magento Error / Exception on checkDependencies()

texts:
On my Ubuntu server VM, remotly debugged with Xdebug & Netbeans I search for a long time why no product images get viewed. Afte I debug all the processing, I found the mistake. I don't have GD2 installed. No errors where shown in logfiles (display errors enabled, renaming of /errors/local.xml & checking permissions of var/log/).

On lib/Varien/Image/Adapter/Gd2.php / Line 565-572 there is a dependencies check:

public function checkDependencies()
{
    foreach( $this->_requiredExtensions as $value ) {
        if( !extension_loaded($value) ) {
            throw new Exception("Required PHP extension '{$value}' was not loaded.");
        }
    }
}

But I don't see any error in browser or exception log. Anybode know why? With netbeans and xdebug I can't debug what happens with the thrown exception.

Thanks!


texts: Magento 2 : Error occure model class does not extend \Magento\Framework\DataObject

texts:
facing this error

  1 exception(s): Exception #0 (InvalidArgumentException):
  Magik\Helloworld\Model\Image does not extend
  \Magento\Framework\DataObject


texts: When click on place order button payment failed in Magento2 with "Zend_Uri_Http" Error

texts:
I am using pleask server when I click on place order button then below error showing in magento2

I am using mage2pro stripe payment method and paypal.(order going failed)

[2019-02-20 18:00:41] main.CRITICAL: Report ID: webapi-5c6d95c928204; Message: "Zend_Uri_Http" not found {"exception":"[object] (Exception(code: 0): Report ID: webapi-5c6d95c928204; Message: \"Zend_Uri_Http\" not found at /var/www/vhosts/website.com/httpdocs/vendor/magento/framework/Webapi/ErrorProcessor.php:205, Zend_Uri_Exception(code: 0): \"Zend_Uri_Http\" not found at /var/www/vhosts/website.com/httpdocs/vendor/magento/zendframework1/library/Zend/Uri.php:140)"} []

AND

Validate class not found from basename 'NotEmpty'
************************************
File:        vendor/magento/module-customer/Model/Address/AbstractAddress.php
Line:        575
Caller:      Magento\Customer\Model\Address\AbstractAddress::validate
Callee:      Zend_Validate::is
Context:
public function validate()


texts:
I have a question regarding the image caching and although I am not quite sure, if Magento SE is the right place for this kind of question, but I thought it would be interesting for others to know as well. (If you disagree, I would be glad to know what stack exchange would be a better place for it :-) )

In my shop I am using an image that was usually delivered from another server. It is a seal that can change its content about 1-2 times per day.
Unfortunately the other server is not very fast, so I wrote a caching module for it. The module has a cron observer that loads the image once per day and stores it in the media directory.
This is ready and working as expected.

My problem is, that the browser does not show the current version of the image.
As far as I can tell, Magento sets the image expiration per default as "access plus 1 month" in the .htaccess file in the Magento root directory.
This is ok for all images except the one I mentioned.

What is the best way to tell the webserver that this single image has an expiration time of 12 or 24 hours?
I would be fine with a solution, that explicitly uses the filename of my image.


texts:
i have tried to reset password from mysql cli.   myqueri is for that
UPDATE admin_user SET password = CONCAT(SHA2('12345678admin', 256), ':12345678:1') WHERE username = '*****'


texts: Magento get products by website id and store id

texts:
I am working in magento one website multiple stores platform, i successfully created one website with 3 stores and 3 store view. I assigned a category to my default store and products in it, but i getting other products also. Let me know how i can go to correct direction.

$collection = Mage::getModel('catalog/product')->setStoreId($storeId)->getCollection()->addAttributeToSelect('*')->addWebsiteFilter($website_id)->addAttributeToFilter('type_id', array('eq' => 'simple'));
$collection->getSelect()->limit(8);


texts: Magento1.9 : How can I GetWebProducts using Soap Api?

texts:
I have this type of WebService

How can I get products detail using Magento 1.9, kindly explain me in detail that how can I get data using this Webservice. If someone can list down the step how can I achieve this.

Really appreciate for help.


texts:
When i log in magento backend, it looks like attached:

Any suggestion to fix?


texts: Should I build a website magento from scratch for my online store?

texts:
I know Magento is an open-source e-commerce platform written in PHP with other. The software was originally developed by Varien, Inc, a US private company headquartered in Culver City, California, with assistance from volunteers.
My friends tell me, Magento is the best open source for e-commerce in 2018. First, Magento is more reliable at medium and high speed, especially when compared with WordPress. Customers don’t have to take a lot of time for load website, and merchants also don’t have to take a lot of time to administrators their website.

Second, Magento has required less frequent maintenance, although Magento website needs maintenance and upgrade services for business who sell their product online. It must be friendly, should be search engine friendly (SEO) and contain optimized images. Some maintenance services that Magento support merchants: optimizing Magento speed and performance, Magento theme update, Magento E-commerce analytics, Magento debugging and Magento search engine optimization.
Third, Magento is more reliable because no battery is used.
In addition, Magento also has many other advantages for merchants. Their customer can build a website Magento from scratch in the easiest way.
Disadvantage of Magento
Well, everything has two sides of it, besides the positive side also had the negative side, and Magento too. The first disadvantage, it has starting problem due to low cranking speed at staring. Then, it is more expensive compared to battery ignition system. And finally, it may be a possibility of misfire due to leakage because wiring carries very high voltage.
Should choose to build website Magento from scratch or not?
After that information, I still haven't the way I do. If I build my website with Magento, I have to pay the fee to maintain, but I don’t have to take a lot of time to administrate or worry about many problems like security, speed, upgrade,..etc.
So, what should I choose?


texts:
Relatively new to Magento and seeing a lot of this lately in (email) templates:

{{template config_path="design/email/footer"}}
{{depend order.getIsNotVirtual()}}
{{layout handle="sales_email_order_items" order=$order}}
{{inlinecss file="email-inline.css"}}
{{block type='core/template' area='frontend' template='sales/custom_logic.phtml'}}

For example: {{depend order.getIsNotVirtual()}}

Is order a model instance and can you just call every available function as you would in plain PHP code?

I see functions getting called, variables passed around with $, ... But I am missing a global overview / documentation of exactly what is available and what can/should be used where.

Where can I find a good overview of all this functionality?


texts: Magento 2 How to Programmatically Ship an Order

texts:
In Magento 2 how can I programmatically ship a order? I am currently developing a custom XML order import, which sends requests to a SOAP back office service. This service replies with the order entity_id and order. status.

In the mean while I am loading the order by entity_idvia the \Magento\Sales\Api\OrderRepositoryInterface class. I haven't been able to find any method that ships the order.


texts: create block inside transactional emails to solve {{if}} problem

texts:
I'm new to magento. The problem that I have is that I want to modify the template of a transactional email.

It's basically a return that I want the customer to receive a different email if the return is "rejected" or "approved".

I tried to modify the code with an if but realize that it doesn't let me compare strings. Only it says if the variable is TRUE or FALSE

{{if order.delivery_time=="10"}}    is not possible.

I can't touch the code because it has a comment that says that if the Magento version gets updated, the file will be completely overwritten.

So, I thought about creating a block, which I don't have a clear understanding on how to do it.

I think it is something like this...

{{block type="cms/block" block_id="this_block" template="cms/content.phtml"}}

But my question is.... What should I write in the template section? and what about the block id section?

I'm sorry but I'm a begginer.
If you give me a hint, I'll be very grateful.

Thanks.


texts: How to display list.phtml categories product in view.phtml file.

texts:
We have tried to display static block in view.phtml file.
But, does not showing static block content in view.phtml file.
I thinks because i have to showing
categories product display in view.phtml file.

We have added following code in static block (block_footer_items_product_detail_page).

{{block type="catalog/product_list" category_id="193" name="product_list"  count="3" limit="4"  template="catalog/product/list.phtml"}}

And print static block in view.phtml file as below code

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_footer_items_product_detail_page')->toHtml();?>

Does not showing product lists item in product view(detail) page.

I have need to display product lists above static block print category product in view.phtml file.

Simple, I want to list.phtml file product display into footer side in view.phtml file.

Thanks


texts: Magento2: How to generate admin url with secure key from a controller

texts:
I want to know, how can I generate a valid admin url from

A Controller
Anywhnere

so I can make any custom url admin work if I need it in an ajax or whatever. Answer for either 1 or 2 will do the job, bot I think it is better to have both.


texts: How To Display Featured Products In Product Page

texts: I want to display the featured products in the product page at the bottom


texts: Magento 1 issue with adding New Product image?

texts: In magento 1.9.2.0,face an issue with image upload for new product in admin side.browse button working and upload button is working but image is not showing.Please observe link image


texts: Magento 2.2.4. How to place authorize.net seal in middle blocks of pages?

texts:
We have been trying to place the authorize.net seal in particular section of page. But after adding the script generated from authorize.net , by default seal logo goes to the bottom of the page. Any thoughts how to fix the issue?
code we have added on site:
<div class="AuthorizeNetSeal">
    <script type="text/javascript" language="javascript">
        var ANS_customer_id="3b297692-6f60-4c80-b5ba-2baa27845f29";
    </script>
    <script type="text/javascript" language="javascript" src="//verify.authorize.net:443/anetseal/seal.js" ></script>
</div>

Any help much appreciated,
Thanks


texts: Is possible to create REST API with Basic Auth?

texts: I've created REST API in Magento2 but everyone can use it. How can I add basic auth to my API?


texts: hot to add a login box only on home page?

texts:
I'm trying to add a login box only in home page. Of course, it should disappear when a customer is logged in. So I put this layout update in the home page, but it doesn't work:

<customer_logged_out>
    <reference name="header">
        <block type="customer/form_login" name="header_customer_form_mini_login" template="customer/form/toplink-login-custom.phtml"/>
    </reference>
</customer_logged_out>

It works only:

 <reference name="header">
     <block type="customer/form_login" name="header_customer_form_mini_login" template="customer/form/toplink-login-custom.phtml"/>
  </reference>

But, of course, the box is shown when the customer is logged too.


texts: Magento 2: How to auto select and load the first payment method?

texts:
Environment: Magento 2.1.2

We are only using a unique payment method. We use a 2 steps checkout:

Shipping Info
Payment Method

The user needs to check the only option (Braintree). I think that's absurd and would like to know how to auto-select the first option. I found here in SE some Magento 1 solutions but doesn't work in the new Magento branch.

Thanks!


texts: Set minimum product quantity by customer group

texts:
I'm using CE edition of Magento 2.3.5-p1, and I need to restrict the wholesale users and set a minimum quantity per product, I found a extension that does this by category, but I need per product.
Is it possible?
Thanks!
Best regards,
Rui Silva
EDIT:
https://marketplace.magento.com/addify-restrictorderbycustomer.html
I think I can do it with this one, creating rule for each products, but I'll test asap and then add feedback, might help someone who has the same requirements


texts: Magento 2 : Add extra text field in checkout billing address and save it in order

texts:
I want to add one extra text field in checkout billing form and also save that field data in order so I can show that field data in admin order view and also in order email.

I already tried to add in shipping and it works properly but I want to add in billing.

Please help me.


texts: Magento 2 cron job showing success message but code not executed

texts:
I have created a magento 2 module in which I have created a cron job and set cron for every 5 mins. But in cron_schedule table it is showing success message but cron code is not executed. If I hit that code manually using URL then its working fine.
here is the code

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
    <job instance="Hemag\SaleCategory\Helper\Data" method="saleCategory" name="hemag_saleCategory_cron">
        <schedule>*/5 * * * *</schedule>
    </job>
</group>

<?php

namespace Hemag\SaleCategory\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Catalog\Api\CategoryLinkManagementInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;

class Data extends AbstractHelper
{

protected $scopeConfig;

protected $collectionFactory;

protected $LinkManagement;

protected $ProductRepository;

protected $_objectManager;

public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    CollectionFactory $collectionFactory,
    CategoryLinkManagementInterface $LinkManagement,
    \Magento\Framework\ObjectManagerInterface $objectmanager
)
{
    parent::__construct($context);
    $this->scopeConfig = $context->getScopeConfig();
    $this->collectionFactory = $collectionFactory;
    $this->LinkManagement = $LinkManagement;
    $this->_objectManager = $objectmanager;
}

public function saleCategory()
{
    $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
    $isActive = $this->scopeConfig->getValue('saleproducts/general/enable', $storeScope);

    if($isActive){
        $allStores = array('4'=>'1607','5'=>'1609','87'=>'1610');
        foreach($allStores as $sid => $catid){
            $collection = $this->collectionFactory->create();
            $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
            $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
                               ->addFinalPrice()
                               ->getSelect()
                               ->where('price_index.final_price < price_index.price');
            $collection->addStoreFilter($sid);
            $this->updateData($collection,$sid,$catid);
        }
    }
}

public function updateData($collection,$sid,$catid)
{
    foreach($collection as $product){
        $_product = $this->_objectManager->create('Magento\Catalog\Model\Product')->setStoreId($sid)->load($product->getEntityId());
        $oldIds = $_product->getCategoryIds();
        $category_ids = array($catid);
        $newIds = array_merge($oldIds,$category_ids);
        $CategoryLinkRepository = $this->_objectManager->get('\Magento\Catalog\Api\CategoryLinkManagementInterface');
        $CategoryLinkRepository->assignProductToCategories($_product->getSku(), $newIds);
     }
}
}

Please let me know what could be the issue.

Thanks


texts: Overriding a core admin block not working - to add carriers

texts:
I am new to Magento and i'm trying to override Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking
in a module to add extra options for carriers in the shipping and tracking section and i cant figure out why this is not working?

Heres my code:

Module xml: app/etc/modules/Essential_Emailtracking.xml

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

Module config.xml: app/code/local/Essential/Emailtracking/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
 <config>

  <modules>
   <Essential_Emailtracking>
     <version>0.1.0</version>
   </Essential_Emailtracking>
  </modules>

  <global>
   </blocks>
    <adminhtml>
     <rewrite>
      <sales_order_shipment_create_tracking>Essential_Emailtracking_Block_Sales_Order_Shipment_Create_Tracking</sales_order_shipment_create_tracking>
     </rewrite>
    </adminhtml>
   </blocks>
  </global>
 </config>

My Block to override core mage block: app/code/local/Essential/Emailtracking/Block/Sales/Order/Shipment/Create/Tracking.php

<?php

class Essential_Emailtracking_Block_Sales_Order_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Tracking
{
/**
 * Prepares layout of block
 *
 * @return Mage_Adminhtml_Block_Sales_Order_View_Giftmessage
 */
protected function _prepareLayout()
{
    $this->setChild('add_button',
        $this->getLayout()->createBlock('adminhtml/widget_button')
            ->setData(array(
                'label'   => Mage::helper('sales')->__('Add Tracking Number'),
                'class'   => '',
                'onclick' => 'trackingControl.add()'
            ))

    );

}

/**
 * Retrieve shipment model instance
 *
 * @return Mage_Sales_Model_Order_Shipment
 */
public function getShipment()
{
    return Mage::registry('current_shipment');
}

/**
 * Retrieve
 *
 * @return unknown
 */
public function getCarriers()
{
    $carriers = array();
    $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
        $this->getShipment()->getStoreId()
    );
    $carriers['usps2'] = Mage::helper('sales')->__('USPS');
    $carriers['canada_post'] = Mage::helper('sales')->__('Canada Post');
    $carriers['aus_post'] = Mage::helper('sales')->__('Australia Post');
    $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
    foreach ($carrierInstances as $code => $carrier) {
        if ($carrier->isTrackingAvailable()) {
            $carriers[$code] = $carrier->getConfigData('title');
        }
    }
    return $carriers;
  }
}


texts: How to open my wishlist top link in new window?

texts: I wants to open my wishlist  top link in new window excluding my account left nevigation menu. and after open this list also display grand total of all wishlist item. finally export it as a pdf formate. anybody knows answer so please help me.....


texts: Magento 2: How to set multiple session value in an array?

texts:
I know how to set and get session value in magento 2. Here is what I do:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$mysession = $objectManager->create('Magento\Customer\Model\Session');
$mysession->setMyTestValue('testsession');
$mysession->getMyTestValue();

It works fine.

But I want multiple session value in an array; In simple PHP I've achieved this in following way:

**//Set session in  an array**
<?php
   foreach ($_productCollection as $_product):
   $_SESSION ['mytestvalues'] = array ();
   array_push($_SESSION['mytestvalues'], $_product->getEntityId());
   endforeach;
?>

/**/Get session array**
<?php print_r($_SESSION['mytestvalues']); ?>

Same thing I want to achieve in Magento 2. How to achieve this in magento 2?


texts: Access non-https-image-links in fully https secured magento store

texts:
I have a webshop which is fully secured over https.

Since this shop uses the M2E extension and the eBay part of this extension only accepts non-https-links for images, I need to be able to access images with both url variations, http and https.

Anybody has a solution for this?

Any help will be much appreciated


texts: Magento 2 additional data to shipping method

texts:
I'm making new shipping method and I need to add new column to checkout shipping rates. Data would come from custom shipping method settings, for example method description. Or some input field where customer can add info (data probably would be saved in quote and later in order).

Probably the easiest part of all is implement template by using

Magento_Checkout/web/template/shipping.html

It just needs this

Problem is I can't figure out how to add custom data. It's not enough to add this:

public function collectRates(RateRequest $request)
{
    if (!$this->isActive()) return false;

    $method = $this->rateMethodFactory->create();
    $method->setData('carrier', $this->getCarrierCode());
    $method->setData('carrier_title', $this->getConfigData('title'));
    $method->setData('method_title', $this->getConfigData('title'));
    $method->setData('method', $this->getCarrierCode());
    $method->setPrice($this->_price);
    $method->setData('cost', $this->_price);

    // custom
    $method->setData('description', $this->getConfigData('description'));

    $result = $this->rateResultFactory->create();
    $result->append($method);

    return $result;
}

Data for html comes from js rates(), which gets data from API:

<route url="/V1/carts/:cartId/shipping-methods" method="GET">
    <service class="Magento\Quote\Api\ShippingMethodManagementInterface" method="getList"/>
    <resources>
        <resource ref="Magento_Cart::manage" />
    </resources>
</route>

After this there are many steps while something actually gets collected.
I found

  Magento\Quote\Model\Cart\ShippingMethodConverter modelToDataObject()

that looked the most promising but if I try to add my attribute to it, nothing happens.

So my question is, if there actually is a way to add new data to shipping rates? In M1 it was possible. It would be crazy if M2 it wasn't possible.

There are many reasons why this should be possible. For example if I wanted to make pick up in store method with multiple stores drop down or something similar.


texts: Restrict zip codes for Cash on delivery payment method

texts:
we restricted only some zip codes for default COD payment method by adding below code in cashondelivery.php
:

app/code/local/Mage/Payment/Model/Method/Cashondelivery.php

public function isAvailable($quote = null)
{
if ($quote) {

// Here is the list of restricted Zip Codes
$restrictedZips = array(
'641004'
,'641006'
);

$address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();
$customerZip = $address->getPostcode();
if (!in_array($customerZip, $restrictedZips)) {
return false;
}
}

return parent::isAvailable($quote);
}

Now we are using custom COD & we are using following code :

public function isAvailable($quote = null)
    {
        if($quote && $quote->getBaseGrandTotal()<Mage::getStoreConfig('payment/mpcashondelivery/max_order_total') && $quote->getBaseGrandTotal()>Mage::getStoreConfig('payment/mpcashondelivery/max_order_total')) {
            return false;
        }
        $specificcountry = explode(",",Mage::getStoreConfig('payment/mpcashondelivery/specificcountry'));
        if(Mage::getStoreConfig('payment/mpcashondelivery/allowspecific')!=0 ){
            if(!in_array($quote->getBillingAddress()->getCountry(),$specificcountry)){
                return false;
            }
        }
        $cod_charges = Mage::getModel('mpcashondelivery/pricerules')->getAppliedPriceRules();
        if($cod_charges['error']){
            return false;
        }
        return parent::isAvailable($quote);
    }

How to restrict only some zip codes for this custom COD ?


texts: I have updated jQuery & jQuery UI to: jquery-1.9.0.min.js and jquery-ui-1.9.2.min.js

texts:
I have just updated jQuery & jQuery UI to: jquery-1.9.0.min.js and
  jquery-ui-1.9.2.min.js

  And... all my unobtrusive Ajax calls (Ajax.ActionLink, Ajax.BeginForm)
  stopped working properly - they open results in a new page instead of
  updating the existing div.

  And I get this javascript error in Firebug when my page loads:

  The code hasn't changed of course, just updated the jQuery scripts
  using Nuget.

  Anyone experienced the same problem ??


texts: Magento 1.7 stuck showing error report after module install issue

texts:
So I installed a module on my staging environment and all worked fine. However installing it on the live site hit a SQL error in one of the many upgrade files.

So I set the module XML files to false and, same error. Same error code too which I thought was not possible with Magento (I remember error codes being unique always).

Va SSH I've cleared the cache, compiled, disabled compilation, disabled caches, deleted the entire var directory after making a backup even and deleted the module files.

Still the error shows the same error code to the same file, a file that no longer exists, after deleting the var directory, the error file doesn't even exist, its like its stuck thinking it needs to show an error that's not happening (Though when I load the page for a split second I do see a var_dump of something).

The site has a massive database and file structure that restoring the last backup for everything to clear the issue will take about an entire day so I don't want to have to use that last resort.

EDIT

The error in question is

a:5:{i:0;s:228:"Error in file: "/home/runway/public_html/app/code/local/Ebizmarts/SagePaySuite/sql/sagepaysuite_setup/mysql4-upgrade-3.0.11-3.0.13.php" - SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'base_surcharge_amount'";i:1;s:862:"#0 /home/runway/public_html/includes/src/__default.php(7842): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/runway/public_html/includes/src/__default.php(7634): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '3.0.11', '4.1.7')
#2 /home/runway/public_html/includes/src/__default.php(7517): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('3.0.11', '4.1.7')
#3 /home/runway/public_html/includes/src/__default.php(7432): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/runway/public_html/includes/src/__default.php(30269): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/runway/public_html/includes/src/__default.php(30195): Mage_Core_Model_App->_initModules()
#6 /home/runway/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/runway/public_html/index.php(90): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

EDIT 2

Looks like I'm now able to access the entire site bar the homepage which still has the error page stuck on it.


texts: How to disable Redis for Magento on Localhost?

texts:
I can't turn off Redis within my Magento/Wampserver Installation. I have removed all lines referencing Redis in local.xml and it already shows as disabled in cm_redissessions.xml - But, when I visit the site via Wampserver I get a "There has been an error processing your request" page with the following associated error report. How do I disable Redis for a local installation of Magento?

a:4:{i:0;s:44:"Connection to Redis failed after 6 failures.";i:1;s:1809:"#0 C:\wamp\www\mysite\lib\Credis\Client.php(362): Credis_Client->connect()
#1 C:\wamp\www\mysite\lib\Credis\Client.php(362): Credis_Client->connect()
#2 C:\wamp\www\mysite\lib\Credis\Client.php(362): Credis_Client->connect()
#3 C:\wamp\www\mysite\lib\Credis\Client.php(362): Credis_Client->connect()
#4 C:\wamp\www\mysite\lib\Credis\Client.php(362): Credis_Client->connect()
#5 C:\wamp\www\mysite\lib\Credis\Client.php(447): Credis_Client->connect()
#6 C:\wamp\www\mysite\lib\Credis\Client.php(440): Credis_Client->__call('select', Array)
#7 C:\wamp\www\mysite\lib\Cm\Cache\Backend\Redis.php(117): Credis_Client->select(0)
#8 C:\wamp\www\mysite\lib\Zend\Cache.php(153): Cm_Cache_Backend_Redis->__construct(Array)
#9 C:\wamp\www\mysite\lib\Zend\Cache.php(94): Zend_Cache::_makeBackend('Mage_Cache_Back...', Array, true, true)
#10 C:\wamp\www\mysite\app\code\core\Mage\Core\Model\Cache.php(137): Zend_Cache::factory('Varien_Cache_Co...', 'Mage_Cache_Back...', Array, Array, true, true, true)
#11 C:\wamp\www\mysite\app\code\core\Mage\Core\Model\Config.php(1348): Mage_Core_Model_Cache->__construct(Array)
#12 C:\wamp\www\mysite\app\Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
#13 C:\wamp\www\mysite\app\code\core\Mage\Core\Model\App.php(401): Mage::getModel('core/cache', Array)
#14 C:\wamp\www\mysite\app\code\core\Mage\Core\Model\App.php(295): Mage_Core_Model_App->_initCache(Array)
#15 C:\wamp\www\mysite\app\code\core\Mage\Core\Model\App.php(337): Mage_Core_Model_App->baseInit(Array)
#16 C:\wamp\www\mysite\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#17 C:\wamp\www\mysite\index.php(87): Mage::run('', 'store')
#18 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}


texts:
I am working on Magento 2 Theme Modification. Whenever we make chages in theme css less files.
our changes are not reflect directly.

Developer mode is already enabled. To show the changes, we have the following options:

Option 1. clear Static file cache from backend.

Option 2. Remove all files from pub/static/ folder except .htaccess file, So that required files automatically generated.

Option 3. run php bin/magento setup:static-content:deploy command

My question is: Is there any other option so that When I make changes in the theme less css file, It will automatically reflect ?

I tried to search on the web but didn't find any answer. Some people suggested to directly work in pub/static file css and then copy in theme css file. I think this is Not recommended and not as per standard.


texts:
How we can override the backend block for frontend functionality. I am trying to override the following block for my frontend functionality

Magento\Payment\Block\Adminhtml\Transparent\Form

Is there any hint or idea?

Thank you,


texts: How to change Recently Viewed products price position in Magento 2

texts:
How to position change inc.vat and ex.vat in Recently Viewed Products. Please check below screen-short
I want to ex.vat move first and inc.vat move second.

Please Help me.
THANKS.


texts: Return from PayPal Express to One Page checkout

texts:
Having tried out all the Magento PayPal options, Pro (non-hosted) seems to be the cleanest. While it will incur full-on PCI compliance, it's the neatest approach for CC/DC payments. It all progresses through the OnePage checkout nicely. The Pro Hosted solution with an iframe plonked on the order review step just looks unprofessional.

However, when a payment is made with a PayPal account, instead of coming back to the next OnePage step, it's redirected to the multi-page Magento order review page. Not only is this plain messy and inconsistent, it means any steps after Payment are missed (that can be fixed by rearranging steps)!

I've done a lot of searching and can very few people asking about returning to the OnePage review step after paying with a PayPal account. Surely others want their stores to be consistent when using PayPal!?

I found one article that suggested changing the redirect after returning from PayPal to /checkout/onepage, but that just restarts checkout from Step-1! There doesn't seem to be way to tell OnePage which step to continue with?

Has anyone get a solution to allow PayPal checkout with a PP account to come back to the OnePage order review step instead of the multi-page order review?

Thanks.


texts: magento 2 Ui Component Grids displays gone

texts:
I am working on Magento 2.2.6 .Each and every grid(Custom/Builtin) are acting strange the column names are gone and few of the grids are showing blank in action column.

here I'm attaching a screenshot


texts:
I had some issues when updating an module, I revived an error and after looking it up It was recomaneded to do php bin/magento setup:db-declaration:generate-whitelist.  AFter i did this I was able to run decompile.
However now I have issues where I can't seem to go back to a previous version of my database. I get this error now when I try to save changes:
{ Unable to save categories with ID 1. Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.url_key' in 'where clause', query was: SELECT main_table.category_id, store.store_id FROM amasty_blog_categories AS main_table LEFT JOIN amasty_blog_categories_store AS store ON main_table.category_id = store.category_id WHERE (main_table.url_key = :url_key) AND (store.category_id != :category_id) AND (store.store_id IN (:store_id))}
Anyone know why this happening?


texts: Magento 2.1: add attribute to select on product repository

texts:
Using the product repository and having product sku, would be possible to retrieve only 1 product attribute by code?

I tried getCustomAttribute('code') but using Xdebug still I can see all attributes before the function, so it seems to be not effective.

I wonder if there is any difference, in terms of performances, using getAttributeCode() or getCustomAttribute()


texts: Search results page shows all results on first page

texts:
My category grid works fine, page 1 shows products 1-100, page 2 shows 101-200 and so on.

However, on the search results page, all results are listed on the first page, so page 1 shows results 1-289 for example. And the pager information next to the number of pages says "PRODUCTS 1 TO 289 OF 289". The number of pages is calculated and displayed correctly.

When I investigate the collection I can see that something's wrong:

echo $collection->getPageSize(); // 100
echo $collection->getCurPage(); // 1
echo $collection->count(); // 138 -> This should also be set to 100, as the current page is 1 and the page size is 100..

And looking at the query for the collection, I see that it's missing the LIMIT 100 right at the end of the query.

Does anybody know what could be causing this?


texts: I want to show total qty of items instead of number of item in cart


texts:
On Product Save from Magento admin getting the Integrity constraint violation error, Can any one please let me know why this errors coming up.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '23100-1' `for key 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'`

Thanks.


texts: I want some extra fields on magento 2.1.2 api

texts:
What I get :
    http://example.com/index.php/rest/V1/categories/263/products
    [{
        "sku": "20130",
        "position": 1,
        "category_id": "263"
      },
      {
        "sku": "20134",
        "position": 1,
        "category_id": "263"
      },
    ]

What I want :
    http://example.com/index.php/rest/V1/categories/263/products
    [{
        entity_id: "2"
        type_id: "simple"
        sku: "Levis Bagpack"
        description: "Bagpack"
        short_description: "Bagpack"
        meta_keyword: null
        name: "Levis Bagpack"
        meta_title: null
        meta_description: null
        regular_price_with_tax: 45
        regular_price_without_tax: 45
        final_price_with_tax: 45
        final_price_without_tax: 45
        is_saleable: true
        image_url: "http://example.com/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg"
     },
     {
        entity_id: "3"
        type_id: "simple"
        sku: "Levis Bagpack Silver"
        description: "Bagpack Silver"
        short_description: "Bagpack Silver"
        meta_keyword: null
        name: "Levis Bagpack Silver"
        meta_title: null
        meta_description: null
        regular_price_with_tax: 45
        regular_price_without_tax: 45
        final_price_with_tax: 45
        final_price_without_tax: 45
        is_saleable: true
        image_url: "http://example.com/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg"
     }
    ]


texts: Moving Magento 1.9 from one server to another

texts:
We are trying to replicate Magento on a test server, but inspite of following the steps the site redirects to old url

Copied and installed Database and files on the new server
Fixed connections on the local.xml file
Reset the usecured and secured base url from the core_config_data
Cleared all files in var/cache var/session and var/tmp

There is no .htaccess file, and the index.php does not do any redirect.

What could we have missed?


texts: Upgrade script continuously running and giving an error?

texts:
I write an upgrade script to alter on of my modules table.

My script is below
mysql4-upgrade-3.0.8-3.0.9.php

$installer = $this;
/* @var $installer Mage_Eav_Model_Entity_Setup */

$installer->startSetup();
$installer->run("
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_radio_error_type` TINYINT NOT NULL;
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_reason_for_return` VARCHAR( 150 ) NOT NULL;
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_product_activated` VARCHAR( 250 ) NOT NULL;
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_failure_occur` VARCHAR( 250 ) NOT NULL;
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_symptoms_of_failure` VARCHAR( 500 ) NOT NULL;
ALTER TABLE  {$this->getTable('rma_products')} ADD  `rp_feedback` TEXT;
");

$installer->endSetup();

My config file is below

<config>
<modules>
    <MDN_ProductReturn>
        <version>3.0.9</version>
    </MDN_ProductReturn>
</modules>
.......

This runs once and what ever changes i expected is done.But when i refresh the website later site is down and giving me the error

  Ba:5:{i:0;s:242:"Error in file: "C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\community\MDN\ProductReturn\sql\ProductReturn_setup\mysql4-upgrade-3.0.8-3.0.9.php" - SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'rp_radio_error_type'";i:1;s:1108:"

  #0 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\Resource\Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')

  #1 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\Resource\Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '3.0.8', '3.0.10')

  #2 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\Resource\Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('3.0.8', '3.0.10')

  #3 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()

  #4 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()

  #5 C:\xampp\htdocs\Stainless-Safety-Solutions\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Model_App->_initModules()

  #6 C:\xampp\htdocs\Stainless-Safety-Solutions\app\Mage.php(684): Mage_Core_Model_App->run(Array)

  #7 C:\xampp\htdocs\Stainless-Safety-Solutions\index.php(83): Mage::run('', 'store')
   #8 {main}";s:3:"url";s:28:"/Stainless-Safety-Solutions/";s:11:"script_name";s:37:"/Stainless-Safety-Solutions/index.php";s:4:"skin";s:7:"default";}

Why this is running repeatedly?


texts: Making a custom collection support pagination

texts:
I have the following collection. Basically, it returns a collection of customer entities joined with an attribute joined with the number of reward points which are going to expire for this month.

$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'confirmation');
$this->_collection = Mage::getResourceModel('customer/customer_collection');
$this->_collection->getSelect()->joinLeft(array('customer_entity_varchar'=>$this->_collection->getTable('customer_entity_varchar')), 'e.entity_id = customer_entity_varchar.entity_id and customer_entity_varchar.attribute_id = '.$oAttribute->getId(), array('confirmation' => 'value'));
$this->_collection->getSelect()->joinLeft(array('reward'=>$this->_collection->getTable('enterprise_reward/reward')), 'e.entity_id = reward.customer_id', array());
$this->_collection->getSelect()->joinLeft(array('reward_history'=>$this->_collection->getTable('enterprise_reward/reward_history')), "reward_history.reward_id = reward.reward_id and reward_history.points_delta > 0 and (reward_history.expired_at_static BETWEEN '".date('Y-m-01')."' AND '".date('Y-m-t')."')", array('expiring_points' => new Zend_Db_Expr('SUM(reward_history.points_delta - reward_history.points_used)')) );
$this->_collection->getSelect()->group('e.entity_id');

I need this collection to support pagination since I need to feed this collection to a 3rd party module which loads collections by pagination. I've noticed that

$this->_collection = Mage::getResourceModel('customer/customer_collection');

alone does support pagination. So I guess I'm losing the pagination effect with the joins. How can I make my custom collection support pagination?

Thanks!


texts: EmailNotConfirmedException not rendering the anchor '' tag on checkout page

texts:
I am using Magento2.3.5p1 and working to modify the message of email confirmation on checkout page by adding the link to resend confirmation link.
I have overridden the AccountManagement.php model from Magento_Customer and changed code as below :
$value = $this->customerUrl->getEmailConfirmationUrl($login['username']);
if ($customer->getConfirmation() && $this->isConfirmationRequired($customer))
{
  throw new EmailNotConfirmedException(__('This account is not confirmed.'.
 ' Click here to resend confirmation email.'));
}

The result is an error message on the frontend that has the literal text
"This account is not confirmed. Click here  to resend confirmation email."
Which is obviously is NOT a clickable link.
I want it to be a clickable link with message.
Anyone please guide me for the same.


texts: Magento 1.9.4.0 suddenly stops working with PHP 7.2, needed to downgrade to PHP 5.6

texts:
We changed our PHP to 7.2 a week ago. There were no problems but suddenly after a week there was a problem. Users were redirected to the cart after pressing the "Confirm Order" button on Checkout page and the order was not submitted.

I fixed it by changing back to PHP 5.6.

There were no errors in the logfiles, the server error log had no info as well. I just noticed that the form key did not changed?

There werent any code changes too.

Did anyone encountered the same problem and has found a solution?


texts: Add custom block before main content only on the contact page

texts:
i would like to add a static block between the nav menu en the content  so i can give it the full width of the page. This block must only be visible for the contact us page.

System: magento 2.1

Theme: destino

File path: /app/design/frontend/Sm/destino/Magento_Contact/layout/contact_index_index.xml

content of contact_index_index.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="page.wrapper">
    <container name="contact.custom.block" before="main.content">
        <block class="Magento\Cms\Block\Block" name="contact-maps" after="breadcrumbs">
            <arguments>
                <argument name="block_id" xsi:type="string">contact-maps</argument>
            </arguments>
        </block>
    </container>
</referenceContainer>
</body>

See image below:

Thanks


texts: shipping custom attribute: wrong input name

texts:
I am working on a module to add two custom attributes to the shipping address during checkout.
The fields are there but the name of the input is not right.
It's this type:

name="my_attribute"

instead of

name="custom_attributes[my_attribute]"

In other words, the attribute is not correctly placed inside the javascript object.
Any ideas?


texts: Magento 2 - How to use font awesome icons using cdn url?

texts:
I'm new to Magento 2.

I would like to know how to use font awesome icons in my magento 2 project particularly in linking the cdn url to my project where about would I add this link?

Thanks


texts: Magento marketplace that uses site-wide "Credits" instead of currencies (USD, CAD, etc)

texts:
I am planning to build a marketplace using Magento CE.

The marketplace would have all items listed in "Credits", and buyers
have to refill their accounts by buying these "Credits" first,
using their CC/Paypal/Etc.
Buyers can then proceed to checkout items with "Credits" in
their accounts.

I'm wondering if there is an existing plugin/solution that enables such functionality.

Any help would be greatly appreciated!

Thanks!


texts: Customization to get the shopping Cart at the right side of checkout steps?

texts:
I am working on a horizontal checkout and need to get the shopping on its right side.
something like this. Any possible way ?
thanks


texts: How to disable cache for a block in magento 1.9?

texts:
echo $this->getLayout()->createBlock('mpanel/products')
    ->setProductsCount($this->getProductsCount())
    ->setCountPerRow($this->getCountPerRow())
    ->setLoadMore($this->getLoadMore())
    ->setTemplate('mgs/mpanel/products/grid/featured_products.phtml')
    ->toHtml();

How I can disable cache for the above block call.


texts: How does one add a custom field/attribute to the customer addresses?

texts:
This link explains it for the addresses in the checkout.

But in want to add a attribute to the normal customer addresses that are displayed in "My Account"

I have an entry in my di.xml, but this alone doesn't work:

<extension_attributes for="Magento\Customer\Api\Data\AddressInterface">
    <attribute code="company_2" type="string" />
</extension_attributes>


texts: Is there a good way to ignore comment-only changes in Magento version upgrades?

texts:
Since Magento changes the year in the comments of ever single file, does anyone have a recommended or battle-tested way to properly audit the actual changes for each version?

Ideally a solution using Git or even some method via PhpStorm would be ideal.  At the moment the best solution I have is to use DiffMerge and create a custom ruleset to try and ignore PHP comments with the regex (^ *\*)|(^\/\*)|(^\/\/) which isn't ideal or 100% accurate and requires a separate diff process from my normal tools.

As a side question... does anyone know why Magento insists on updating all of the comments in this manner?  It is incredibly frustrating and seemingly unnecessary.  I'm hoping I am just missing some easy solution!  Thanks in advance! :)


texts:
Which class I should inject to get the current customer? What are their differences?

\Magento\Customer\Helper\Session\CurrentCustomer
\Magento\Customer\Model\Session


texts: Magento 2 : How to modify city field html for shipping address on checkout page

texts:
I need to edit the city field HTML of New shipping address form on checkout in Magento 2.

I am not getting the file from where we can change this or add some classes in these fields. Please share some idea to achieve this.


texts: Adding columns to customer grid using observer or overriding the customer grid

texts:
I am facing an issue of adding a column on customer grid and showing values in that column.

Here is the observer code that I have been trying to show the column:-

if ($block->getType() == 'adminhtml/customer_grid') {
          $customer = $observer->getCustomer();
          $collection = Mage::getResourceModel('customer/customer_collection');
        $block->addColumnAfter('mobile', array(
                'header'    => 'Mobile No.',
                'type'      => 'text',
                'index'     => 'mobile',
            ), 'email');
        }

This adds the column but no values are shown under that.


texts:
In magento 2 how can i validate filesize, i added following code in my grid, but its not working. Is there any way to achieve this:-

 $fieldset->addField(
            'uploaded_file', 'file', [
            'name' => 'uploaded_file',
            'label' => __('Attachment'),
            'title' => __('Attachment'),
            'required' => $requireFlag,
            'note' => $displayNotify,
            'value' => $model->getUploadedFile(),
            'validate_class' => 'validate-filesize'
            ]
        );


texts:
I need to insert a form into one tab contained into product page.
you can see an example in this page

I created a static block that contain the form, the action is a cms page.

so, I need to insert a php function that send me the data insert into the form.

How can I do this action?


texts:
I've made a plugin inside of a module, and I need to give CSS style to the echo of PHP.
I don't know if I need to create a new .xml and if I have to do that what should I put there?
What does my plugin is intervene the category view of the products to display a message below the price. Here's some code
My plugin:
<?php
namespace vendname\module\Plugin;
class ProductList
{
    protected $layout;
    public function __construct(
        \vendname\module\Helper\Data $helper,
        \Magento\Framework\View\LayoutInterface $layout
    ) {
        $this->layout = $layout;
        $this->helper = $helper;
    }

    public function aroundGetProductDetailsHtml(
        \Magento\Catalog\Block\Product\ListProduct $subject,
        \Closure $proceed,
        \Magento\Catalog\Model\Product $product
    ) {
        $regularPrice = $product->getPriceInfo()->getPrice('final_price')->getValue();
        $specialPrice = $product->getPriceInfo()->getPrice('special_price')->getValue();
        $cuotas= $this->helper->getCuotas();
        if($specialPrice<$regularPrice & $specialPrice!=0) {
            echo  $cuotas . ' text i want with style' . round($specialPrice / $cuotas,2) ;
        }
        else {
            echo   $cuotas . ' text i want with style' . round($regularPrice / $cuotas,2)  ;
        }
    }
}


texts:
I'm looking for help to achieve the following listing of grouped products (Magento CE 1.7.02)
 The idea is that the user can select (say) 10 Black Small, 6 Black XL, 4 Navy Medium, etc, etc.

An added complication is that the price/cart should update as values are entered into the Qty fields

Any suggestions welcomed.
Thanks, Eddie


texts: Magento2 how to create cart rule & customer segment rule programatically?

texts:
Can any one guide me (or) provide me the steps to create customer segment & cart rule programmatically?
If it is Via command line (or) via setup script (or) custom script executing from root folder.
Thanks in advance.