texts:
I've been trying to apply this post:

How to add dynamic field in magento collection?

to my own simple scenario.

I have implemented a rewrite of Mage_Catalog_Model_Resource_Product_Collection
to handle a custom sort option in catalog view.

I need to pull two attributes (msrp and special_price) do some math with them to create a 'virtual' field upon which to sort.

class NAMESPACE_MODULE_Model_Resource_Product_Collection
extends Mage_Catalog_Model_Resource_Product_Collection
{

public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
{
if ($attribute == 'rebate' && $storeId != 0) {
        $this->addPriceData();
        $this->addAttributeToFilter(
            array(
                array(
                    'attribute' => 'special_price_type',
                    'value'     => array('1340', '1339')
                )
            )
        );
        $this->addAttributeToSelect(
            array('special_price', 'msrp')
        );

        $this->addExpressionAttributeToSelect(
            'ratio',
            "[pseudocode: ( 1 - (mrsp - special_price))*100 ]"

        ); //select
        $this->getSelect()->order("ratio {$dir}");

        return $this;
    }

Struggling to understand how to manipulate those values in addExpressionAttributeToSelect. Nor am I clear whether those values are even exposed at this point.
I would assume so because of:

   $this->addAttributeToSelect(
            array('special_price', 'msrp')
        );

However dropping a breakpoint there and stepping through the code, I can't find them anywhere in the instantiated object.

Any guidance welcome!


texts:
How to Run Magento 2 using pub/index.php file.

We are going to point the site at pub/index.php for security point of view.

Can any one help us on how to configure this and steps to be taken care.

We found some information here but not working.


texts: Create and update categories programmatically Magento 1.9

texts:
Hy All! I'm searching everywhere but i cant find a solution.

I'm trying to set display mode and cms block during category import..

Here my snippet

private function import_category(){
    global $cl, $_category;

    $categories = $this->base_cat.str_replace('//', '/', rtrim($this->build_cats($this->categoria_corrente['CategoryID'], $this->cat_tree,''),'/')); // these return the full path (/Product/Cat1/Cat2)

    $id = $cl->getIdFromPath($categories); // This return the category id if exists - it works!
    $parent_id = $cl->getIdFromPathParent($categories); // This return the parent category id if exists - it works!
    if($parent_id){
        $parent    = Mage::getModel('catalog/category')->load($parent_id);
        $category = Mage::getModel('catalog/category');
        if($store_id = $this->getStoreByCode($this->store)){ // get store by code works..
            $category->setStoreId($store_id);
            if ($id) {
              $category->load($id);
            }
            // $this refers to my class. this function is inside a bigger class.
            // $this->categoria_corrente is an array with current category data.
            $general['name'] = $this->categoria_corrente['Description'];
            $general['description'] = $this->categoria_corrente['Description'];
            $general['meta_title'] = $this->categoria_corrente['Description'];
            $general['meta_keywords'] = $this->categoria_corrente['Description'];
            $general['meta_description'] = $this->categoria_corrente['Description'];
            $general['display_mode'] = "PAGE"; // this DONT work :(
            $general['landing_page'] = "71";  // this DONT work :( - 71 is the correct static block.
            $general['is_active'] = 1;
            $general['is_anchor'] = 1;
            $general['include_in_menu'] = 0;
            $general['url_key'] = Mage::getModel('catalog/product_url')->formatUrlKey( $this->categoria_corrente['Description'] );
            $general['image'] = "";

            $category->addData($general);
            $category->setDisplayMode('PAGE'); // also this dont work...
            $category->setLandingPage(71);

            try {
                $category->save();
                if($id){
                    echo "
Category updated";
                } else {
                    echo "
New category";
                    $category->move($parent_id, null); // move under parent.. - works..
                    $cl = new NAMESPACE_MODULE_Model_Category_Finder; // i've to reindex all paths in my model..
                }

            }
            catch (Exception $e){
                echo $e->getMessage();
            }
        }
    }
}


texts: How to add more tabs on class product-collateral of product view page

texts:
On the view.phtml 175 line i have:

    <div class="product-collateral toggle-content tabs">
      <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

How do I add my custom tabs and contents to "$detailedInfoGroup"?


texts: Customer Address attribute added in grid in magento 2

texts:
I have added one customer address custom attribute. it is showing in the customer address form as a dropdown field. Now I want to show that as a column in customer address grid in admin with value.
I have added this code:
<column name="addresstype" class="xxx\xxx\Customer\Ui\Component\Listing\Address\Column\Addresstype" sortOrder="95">
        <settings>
            <filter>text</filter>
            <label translate="true">addresstype</label>
            <editor>
                <editorType>text</editorType>
            </editor>
        </settings>
    </column>

The column is added but the value is not showing in this. how to get the value which was set in form? I tried in the following way, but getting an error:
xxx/xxx/Customer/Ui/Component/Listing/Address/Column/Addresstype.php
 public function prepareDataSource(array $dataSource): array
{
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as &$item) {

            if ($item['addresstype'] == 1) {
                $item['addresstype'] = 'Yes';
            } else {
                $item['addresstype'] = 'No';
            }
        }
    }

    return $dataSource;
}

But i ma getting error :
Undefined index: addresstype in /var/www/html/zest-anchor/app/code/Zest/Integration/Customer/Ui/Component/Listing/Address/Column/Addresstype.php on line 75 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: addresstype in /var/www/html/zest-anchor/app/code/Zest/Integration/Customer/Ui/Component/Listing/Address/Column/Addresstype.php on line 75 at /var/www/html/zest-anchor/vendor/magento/framework/App/ErrorHandler.php:61)"} []


texts: how can we display state/region/county code in place of state name in checkout step?

texts: I am not sure from where can I display state/region/county codes in place of the default name of the state in checkout step shipping step.


texts:
I'm trying to migrate and got the following:

[2018-06-17 01:19:50][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started
100% [============================] Remaining Time: 1 sec
[2018-06-17 01:19:53][INFO][mode: data][stage: volume check][step:Customer Attributes Step]: started
100% [============================] Remaining Time: 1 sec
[2018-06-17 01:19:53][INFO][mode: data][stage: data migration][step: Map Step]: started
83% [=======================>----] Remaining Time: 18 secsKilled

How can I fix this error?


texts:
I have been editing product information on a daily basis using the Magento admin panel (Version 1.7.1) and have had no problems. However, all of a sudden while I am in edit mode editing a product, the fields become "uneditable"

What I mean is, I cannot click inside the fields (for example product description) to try to change it.

I am at loss what the problem is. I tried logging out and back in, and nothing works. Yet If I come back in a couple of hours, the system starts to work and I can edit information to my hearts content. Then after a few hours, same thing happens again.

Any ideas/suggestions would be helpful.


texts:
I need to save value into session. I try to do it in index.php. But I can set

$inputMessage = 'Hello World';
Mage::getSingleton('core/session')->setMySessionvar($inputMessage);

only after Mage::run. Otherwise it returns error. It is unacceptable because I want to change content depending MySessionvar value.
What can you advise?


texts: Email are not sending from my magento store

texts:
I am using following code to send email from my magento store but i am not able to sent any email

<?php
echo "start mail";
echo "<br>";
ini_set('memory_limit', '500M');
ini_set('max_execution_time', 0);
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once 'app/Mage.php';
umask(0);
Mage::app();
try {
    $post['name'] = 'vaibhav';
    $post['email'] = 'vaibhavahalpara@gmail.com';
    $post['telephone'] = '123456789';
    $postObject = new Varien_Object();
    $postObject->setData($post);
    $mailTemplate = Mage::getModel('core/email_template');
    $mailTemplate = Mage::getModel('core/email_template');
    $mailTemplate->setDesignConfig(array('area' => 'frontend'))
                    ->setReplyTo('vaibhavahalpara@gmail.com')
                    ->sendTransactional(
                        Mage::getStoreConfig('contacts/email/email_template'),
                        Mage::getStoreConfig('contacts/email/sender_email_identity'),
                        'vaibhavahalpara@gmail.com',
                        null,
                        array('data' => $postObject)
                    );
    if (!$mailTemplate->getSentSuccess()) {
        throw new Exception();
    }
    echo "sent";
} catch (Exception $e) {
    echo "string11465";
    echo $e->getMessage();
}

Php mail script is working

$msg = "First line of text\nSecond line of text";
$msg = wordwrap($msg,70);
mail("vaibhavahalpara@gmail.com","My subject",$msg);

so i debugging code to Zend_Mail_Transport_Sendmail::_sendMail()
following code is not able to send mail but $result is 1

$result = mail(
    $this->recipients,
    $this->_mail->getSubject(),
    $this->body,
    $this->header
);
echo $result;

when i tried to remove $this->header variable email sending working but body is not look good

previously we used Mandrill email this is happen after removing Mandrill module

now we are using amazonses service


texts: How can i login magmi, am copy of the magmi folder into magento root folder, then go to http://www.------.com/magmi/web/magmi.php, they ask username and password


texts:
We added prefix for order number from db, and now because of this orders has same numbers for different store views. How can we have always unique and incremented order number for all store views?

We are using magento 2.4
Thx for the help


texts: Redirect to Magento2 website with session id

texts: We have a small requirement like a punchout payload concept. The user will redirect to Magento 2 website from 3rd party with the session_id. We want to capture that session_id and implement our logic. Could you please let me know in how many ways, we can achieve it? what is the best way to implement.


texts: Require a solution for solving self generated 404s that meets our SEO needs

texts:
Our Setup:

We use Magento Community (v 1.8.1) and use Microsoft Navision to manage our business processes in the backend (product info, stock levels, ordering, warehousing, etc) and the Navconnect plugin to pass changes made in Navision into Magento.

The Problem:

From time to time we have products that require re-packaging, the product stays the same (same name, same description, same price) but in order to differentiate the old and new packaging, we give the new version a new SKU code.

Now currently our process has been to go into NavConnect and create a new product and copy across all of the same content and settings for the existing product while set to disabled. Once we are happy that it is an exact clone of the existing product,  we disable the existing product and enable the new product and push this information into Magento.

However this causing a number of issues:

The old page is now creating a 404 error
The new product page has a new url /productA-1234.html

So not only are we giving visitors a bad experience by providing them with a link that displays a 404 error, but we are also harming our SEO work by changing the urls, which is effectively throwing away any page ranking authority that we' ve built up over time (All the inbound links pointing to this product page - both external + internal)

Now I'm fairly new to using Magento, so first of al I'm wondering if what we are trying to do is even possible. (i.e. Can you replace a products SKU and hope to keep the same URL?)

Secondly, if it is possible, what's the best solution to make sure we keep our url in tact without causing more 404 errors and url with numbers attached to the end?

I hope this makes sense?


texts: Why configurable products calculated twice compared to simple product with my code

texts:
I have a code the gets the Product Name and Weight of the ordered items in the onePage Checkout. My code works if items selected are simple product but if an item ordered is a Configurable Product it compute it twice before proceeding to the next item or next stage of the OnePage Checkout. It's just a simple formula that will calculate the total weight of the items ordered and if it's <=5kg AED20 and adds AED2 for succeeding kg.

                        // retrieve quote items collection
                    $itemsCollection = Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection();

                    // get array of all items what can be display directly
                    $itemsVisible = Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems();

                    // retrieve quote items array
                    $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
                     $weight = 0;
                        foreach($items as $item) {
                        echo '
'.$item->getName().'	';
                        echo ''.(float)number_format($item->getWeight(), 2, '.', '').'kg	';
                        echo ''.$item->getQty().'	';
                        echo ''.(float)number_format($item->getWeight(), 2, '.', '') * $item->getQty().'kg
';
                        // echo 'ID: '.$item->getProductId().'
';
                        // echo 'Sku: '.$item->getSku().'
';
                        // echo 'Price: '.$item->getPrice().'
';
                        $weight += ($item->getWeight() * $item->getQty()) ;
                        }
                    $cod_fee = (($weight - 5) * 2) + 20;
                    $round_cod_fee = ceil($cod_fee / 5) * 5;

                    //TOTAL Weight of the Order
                    if ($round_cod_fee <= 20) {
                        echo '
Total Weight of your order is : ' .$weight.'kg = AED20 Total for the Shipping and Handling (COD)';
                        }
                    else {
                        echo '
Total Weight of your order is : ' .$weight.'kg = AED' . $round_cod_fee . ' Total for the Shipping and Handling (COD)';
                    }

Looking forward to hear from you. Please I need the ninjas/experts help. Thank you!


texts:
Please can you help me with a problem started 1 week ago? every day a customer with chinese name appear on the customer list and our server start to send spam email (fortunately we block automatically the output emails).

please can you help me to find the problem?


texts: Owl carousel is not working in magento 2

texts:
I want to add owl slider in custom theme in magento 2. For that, I added,

  \app\design\frontend\Theme\custom\web\css\owl.carousel.min.css
  \app\design\frontend\Theme\custom\web\js\owl.carousel.js

  \app\design\frontend\Theme\custom\Magento_Theme\requirejs-config.js

/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

var config = {
    map: {
        '*': {
            owlcarouselslider:        'Magento_Theme/js/owl.carousel'
        }
    }
};

\app\design\frontend\Theme\custom\Magento_Catalog\templates\featured2.phtml

1

2

3

4

5

6

7

8

but I am getting this


texts: Error while uploading Image in Custom module

texts:
I have created a custom module in Magento 2.While uploading image I get an error.

  A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

if anybody knows what would be the reason?


texts: how to create two different form to customer registration magento 2

texts: I have to create two registration form to customer. I don't know what to override and how to proceed to do that. I really want your help and thanks in advance


texts: Product in reservation show like out of stock (MAGENTO2 MSI)

texts: I have stock_qty = 2 and salable_qty = 0 because of my products reservations and when I open product page add To Cart exists. Can this product show like out of stock when salable qty is 0 ?


texts: Difference between $product->getResource()->save($product); $product->save();

texts:
Can anyone know what is the difference between use of

$product->getResource()->save($product);
$product->save();


texts: How to create custom Fields that display in Payment Method Section?

texts:
I want to show a custom field that displays in payment section but not as a payment method,
I have searched many extensions but all are using a payment method, but I want that type extension, it has 2 textboxes and checkbox, and when we click on the checkbox and 2 textbox was a display, and also other payment method work with this  extension,
like below image,

I want to create Custom Section in Payment method Section.
Please give me some suggestion, i don't want full code, but i want some idea, how can i do that.


texts:
Something happen with one of the stores. When i try to open the Custom Report for the Orders, and i've got nothing. Like its listing only the column names, but nothing else. like:

2016-01-19T07:36:30Z 2016-01-21T09:36:49Z 14.00 12435 28800 0 0 False False Order # Purchased on Ship to Name G.T. SKU Item Category Season Gender Weight Price Status Shipping Method Payment Method Teacher Location Translate

And this is the reported error log from the Nginx:

2018/01/22 11:45:39 [error] 6855#0: *136455309 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getFrontend() on boolean in www/app/code/local/Netcube/CustomReports/Helper/Data.php:388
Stack trace:
#0 www/app/code/local/Netcube/CustomReports/controllers/Adminhtml/EntityController.php(17): Netcube_CustomReports_Helper_Data->generateOrdersReport('2018-01-19 09:4...', '2018-01-22 09:4...', '0')
#1 www/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Netcube_CustomReports_Adminhtml_EntityController->editAction()
#2 www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#3 www/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 www/ap" while reading response header from upstream, client: 11.22.33.44, server: example.com, request: "POST /index.php/customreports-directory-admin/entity/edit/continue/0/key/c34ddb8351e8e9373a1ef6ae202497f1/ HTTP/1.0", upstream: "fastcgi://unix:/var/tmpfs/php.sock:", host: "www.example.com", referrer: "https://www.example.com/index.php/customreports-directory-admin/entity/edit/key/c34ddb8351e8e9373a1ef6ae202497f1/"

I only markout the name and the ip address. The version of Magento is 1.9.1.1. It was working before, i don't really know what really happen without any touch.


texts: Show date attribute in layered navigation

texts: How to show "date" attribute in Layered Navigation in Frontend?


texts:
I'm newbie to Magento, I'm just testing product price module so by using following code

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

It return me price properly for Simple product but it's not working for Grouped product So I Googled it and found following code snippet

<?php echo $_product->getPrice(); ?>
<?php echo Mage::helper('core')->currency($_product->getPrice(),true,false); ?>
<?php echo $_product->getFinalPrice(); ?>
<?php echo Mage::helper('core')->currency($_product->getFinalPrice(),true,false); ?>
<?php echo Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice(), true); ?>

But all above code return me price as 0 , So can please anybody suggest me what can I do to get price which work for both Simple & Grouped product?


texts: Emails from my custom enquiry form are marked as spam

texts:
All emails from my custom module are marked as spam. Already put the necessary headers but still didnt work.
Anyone can help me to fix this?

Also, I have tried installing different modules for custom form but they're always have errors. Saying they cant find helper data file. argh!

Thanks in advance!


texts: export magento 2 database with different method

texts:
i used Ubuntu OS and now mysql is not work, when i export database using ssh command in local terminal,
i used this command for export DB :

mysqldump -u root -p fastestsample > fastestsample_bkp.sql

host : localhost
username : root
password : password not set

is there any other way to export database from phpmyadmin?
i used xampp in local system,

Please help me on these.


texts: I wish to rewrite some methods in Mage_Catalog_Block_Product_Compare_List. What do I need to add to config.xml and what should my classname be?


texts: How to create a "add to cart link" on a website that uses Magento?

texts:
I want to know how to create a "add to cart link" on a website that uses Magento.
A retailer’s website uses Magento, I want create add to cart urls to post on my instagram people could directly check out.
So far I got to this:
https://domain/checkout/cart/delete/id/product/
Also i found this in the page source code:

  form_key/AGXbCT8XKMhJVixv/uenc/aHR0cHM6Ly93d3cuYWZldy1zdG9yZS5jb20vZGUvY2hlY2tvdXQvY2FydC8,/


texts: Magento 2: Too many arguments for install using the command line

texts:
I'm trying to install Magento 2 on Debian-system from the command line.

And by running:

php magento setup:install --base-url="http://localhost/magento2"
--db-host="localhost" --db-name="magento2_db" --db-user="magento2_user"
--db-password="*password" --admin-user="admin"
--admin-password="*password" admin-firstname="admin"
--admin-lastname="user" --use-sample-data --cleanup-database

I'm getting only:

[RuntimeException]
Too many arguments.

viewed that question Magento 2 command line install (too many arguments) too, but cant help me further...


texts: Themes not working after 1.8 to 1.9 upgrade

texts:
After upgrading Magento 1.8.0.0 to 1.9.2.1 I've found that no themes are working at all. I've copied the exact theme structure from app/design and skin/frontend and then set the package name in Settings > Configuration > Design but no dice. Has anyone else experienced similar problems?

The methods I've used above work on a brand new 1.9.2.1 installation so I know it's not the theme or config causing an issue but I'm struggling to suss out what else could actually be causing it! (I have cleared my cache).

Also - setting the theme as rwd doesn't work either.


texts: Magento 1.9.3 Won't save customer group prices

texts:
I was assigned a Magento 1.9.3 project that would take in products in JSON format, and save customer group prices. However, even though there are no errors, nothing gets saved. The group prices won't show in the admin panel nor in the catalogue as expected.

Why is this? I've looked up every single article or stackexchange cases concerning group prices, but none of these seem to solve my problem.

Currently using the catalog_block_product_list_collection event.

$group_prices = $theProduct->getData('group_price');
if (is_null($group_prices)) {
    $attribute = $theProduct->getResource()->getAttribute('group_price');
    if ($attribute) {
        $attribute->getBackend()->afterLoad($theProduct);
        $group_prices = $theProduct->getData('group_price');
    }
}

if(!is_array($group_prices)){
    $group_prices = array();
    $theProduct->addData(array('group_price' => $group_prices));
    $theProduct->save();
}

$new_price = array(array (
    'website_id'=>Mage_Core_Model_App::ADMIN_STORE_ID,
    'customer_group_id'=>$customerGroupId,
    'price'=> $singleProduct->Price));
$group_prices = array_merge($group_prices, $new_price);

$currentStore = Mage::app()->getStore()->getId();
try{
    Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
    $size = count($group_prices);

    // First Delete all the group prices of product
    $theProduct->setData('group_price', array());
    $theProduct->save();
    // Again save the old prices and new prices
    $theProduct->setData('group_price', $group_prices);
    $theProduct->save();
} catch(Exception $e) {
    echo $e->getMessage();
}
Mage::app()->getStore()->setId($currentStore);

And yet, no group prices are saved when checking in the admin panel.
Any help is appreciated.


texts: Why are all my images coming out much darker in the front end than they are in the back end?

texts:
Why are all my images, on http://www.theswordshop.co.uk coming out much darker in the front end than they are in the back end?

I'm on Magento 1.7.0.2

I'm also having an issue on a sister website http://theknightshoptrade.com/index.php/ They're both on different installs, with different themes and I don't believe they actually share any extensions

My images are all JPEG, 72dpi, dimensions of 650px x 650px, RGB and 8bits.

Here's an example of what my images look in the backend compared to the front end:

Image in correct colours (as seen in the backend)

Image desaturated (as is in the frontend


texts: Where is the "Set Product as New" attribute saved in the Magento 2.3 EE database?

texts:
I know that Magento 2 EE doesn't utilize the "newsFromDate" and "newsToDate" attributes, but I can't figure out where Magento EE is storing the data for the "Set Product as New" option on the products?
I'm trying to check if a product is new, but I'm unsure what to use to get that data if I can't find it in the database. Any ideas?


texts: Magento 2 - How to check if Redis is working

texts:
In magento 2 I recently configure Redis in app/etc/env.php file.

But I don't know how to check if the configuration is ok and if Redis is working well with magento.

Is there a way to make sure of that ?

Thanks


texts: Magento 2 error - Class 'Vendor\Sales\Model\Order\Email\ScopeInterface' not found in

texts:
use Vendor\Sales\Helper\Data;
use Magento\Framework\DataObject;
use Magento\Framework\Event\ManagerInterface;
use Magento\Payment\Helper\Data as PaymentHelper;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\Order\Address\Renderer;
use Magento\Sales\Model\Order\Email\Container\OrderIdentity;
use Magento\Sales\Model\Order\Email\Container\Template;
use Magento\Sales\Model\Order\Email\Sender;
use Magento\Sales\Model\ResourceModel\Order as OrderResource;
use Magento\Framework\App\Config\ScopeConfigInterface;

class OrderSender extends \Magento\Sales\Model\Order\Email\Sender\OrderSender
{
    const FREE_PICKUP_SHIPPING_METHOD = 'freeshipping_freeshipping';
    const XML_PATH_EMAIL_LA_PICKUP_TEMPLATE      = 'sales_email/order/flatrate32_pickup_template';

    /**
     * @var Data
     */
    protected $helper;

    /**
     * @var PaymentHelper
     */
    protected $paymentHelper;

    /**
     * @var OrderResource
     */
    protected $orderResource;

    /**
     * Global configuration storage.
     *
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $globalConfig;

    /**
     * @var Renderer
     */
    protected $addressRenderer;

    /**
     * Application Event Dispatcher
     *
     * @var ManagerInterface
     */
    protected $eventManager;

    /**
     * @var ScopeConfigInterface
     */
    protected $config;

    /**
     * @param Template $templateContainer
     * @param OrderIdentity $identityContainer
     * @param Order\Email\SenderBuilderFactory $senderBuilderFactory
     * @param \Psr\Log\LoggerInterface $logger
     * @param Renderer $addressRenderer
     * @param PaymentHelper $paymentHelper
     * @param OrderResource $orderResource
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
     * @param ManagerInterface $eventManager
     * @param \Vendor\Segment\Helper\Data $helper
     * @param ScopeConfigInterface $config
     */
    public function __construct(
        Template $templateContainer,
        OrderIdentity $identityContainer,
        \Magento\Sales\Model\Order\Email\SenderBuilderFactory $senderBuilderFactory,
        \Psr\Log\LoggerInterface $logger,
        Renderer $addressRenderer,
        PaymentHelper $paymentHelper,
        OrderResource $orderResource,
        \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig,
        ManagerInterface $eventManager,
        Data $helper,
        ScopeConfigInterface $config
    ) {
        $this->paymentHelper        = $paymentHelper;
        $this->orderResource        = $orderResource;
        $this->globalConfig         = $globalConfig;
        $this->addressRenderer      = $addressRenderer;
        $this->eventManager         = $eventManager;
        $this->identityContainer    = $identityContainer;
        $this->templateContainer    = $templateContainer;
        $this->senderBuilderFactory = $senderBuilderFactory;
        $this->logger               = $logger;
        $this->helper               = $helper;
        $this->config               = $config;
    }

    /**
     * Get config path
     *
     * @return string
     */
    public function getConfig($path, $storeId = null)
    {
        return $this->config->getValue($path, ScopeInterface::SCOPE_STORE); // error appear here
    }


texts: magento 2- website showing: We're sorry, an error has occurred while generating this content

texts:
i haven't opened my website backend since two days and today when i went to frnt page www.xxxxxx.com it showed me a single line content

  We're sorry, an error has occurred while generating this content.

between header & footer content... i've cleared the caches, flushed magento cache but nothing changed any suggestions what should i do?


texts: Fetch scaled product thumbnails through REST API

texts:
In Magento 2 I see that the REST API only provides the path to the originally uploaded images. I would like to be able to use Magento's scaled thumbnails directly in my headless store front.

Ideally I want to modify the API so I get a path to the cached, scaled version of the thumbnail in addition to the original image. If the image is not already scaled, I would like it to happen automatically. I wonder if anyone has done anything like this before?

I don't really understand why this isn't a part of the API. Do people usually download the original image and scale/cache it in the front end system?


texts: I am using magento-1.9.2 version, now I posted different size images (400 x 400)and (750 x 750) like that. How can I show these images in same size in frontend?


texts: Mutiple website with multiple sub domain in Magento 2

texts:
I'm trying to implement multiple website in Magento 2.1.3 For that, I have created an extra website store and store view

My site URL is like www.example.com

My subdomain is www.kw.example.com(where kw is the code of new website).

I have create sub domain in my domain and point this in to a new folder in Magento root folder which contain the index file of new website.
And i have changed the website URL and secure BASE URL as www.kw.example.com
but when i try to access to this URL its redirecting in to www.example.com


texts: Different Customer Rating options for different categories

texts:
Has anyone come across a way to have different customer rating options assigned to different categories/set of products?

I read an old thread from 2009 saying the feature wasn't available yet, is it  available or possible to hard code in CE1.7?

Or possibly an extension to allow me to do it?

Thanks


texts: Order status not translated in order email

texts:
I have a custom template that is sent when my order is updated. The order status is sent in the default language (Portuguese) and not in the order language, can you help me figure this out ?
PS: Every other phrase in the email is correctly translated to the order language... This also happens in the default email template...
{{template config_path="design/email/header_template"}}

{{trans "%name," name=$order_data.customer_name}}

                {{trans
                    "Your order #%increment_id has been updated with a status of %order_status."

                    increment_id=$order.increment_id
                    order_status=$order_data.frontend_status_label
                |raw}}

{{trans 'You can check the status of your order by logging into your account.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}

                {{trans 'If you have questions about your order, you can email us at %store_email' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at %store_phone' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are %store_hours.' store_hours=$store_hours |raw}}
                {{/depend}}

            {{depend comment}}

                        {{var comment|escape|nl2br}}

            {{/depend}}

{{template config_path="design/email/footer_template"}}


texts: Related products are not showing on frontend

texts:
I'running my M1 shop for some years now.
But I never used related products before.

I use a single column template and like to show related products at bottom of product page.

So at a config. product I add some related products, but they don't show anywhere.
So I must be missing some setting.

Could anyone explain me what steps / settings to do in order to get the related products visible in frontend?

John


texts:
I am currently using Magento 1.9 and the Bootstrap boilerplate.

I have already put the banner slider in a static block.

Is there any way to move a static block out of the container to below the menu?

So it fits the screen width wise.

Any help would be appreciated.


texts:
I need to unserialize data before displaying in admin

  [product_id] => a:2:{i:0;s:1:"2";i:1;s:1:"1";}

My admin fieldset code

 $fieldset->addField(
            'product_id',
            'textarea',
            ['name' => 'product_id', 'label' => __('Product Id'), 'title' => __('Product Id')]
        );


texts: Magento2:How to get address when customer checkout

texts:
I'm develop a module for shipping method. I need order's address to calculate freight.

use Magento\Quote\Model\Quote\Address\RateRequest;

$destCountryId = $request->getDestCountryId();
$destState = $request->getDestRegionCode();
$destCity = $request->getDestCity();

If customer not login ,they need to input address like picture

I can use my code to get address.
But if customer have logined and select address.

My code can get country and city ,but can't get State with getDestRegionCode().
What's wrong with my code.Or may be someone can tell me how to get address is right.


texts: Change order categories and attributs filters - Magento2

texts: How to change the order of categories and attributes (alphabetical order) in the filter list ?


texts: How to get this attribute value from custom product attribute in picture?

texts: How to get this attribute value from custom product attribute in picture with product id?


texts: How to override or disable core Plugins in Magento2?

texts:
I am building a marketplace using Magento2. For that reason I need to be able to load the order of the customer using the vendor's customer credentials.

The problem with this is that Magento2 uses a Plugin to verify that only the Customer of this order (or an Admin) can load the order.

In this case I need to either override the Plugin as a whole, or override the protected method isAllowed(). What can I do without modifying the core?

Magento\Sales\Model\ResourceModel\Order\Plugin\Authorization Looks like this:

use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\Exception\NoSuchEntityException;
class Authorization
{
    /**
     * @var UserContextInterface
     */
    protected $userContext;

    /**
     * @param UserContextInterface $userContext
     */
    public function __construct(
        \Magento\Authorization\Model\UserContextInterface $userContext
    ) {
        $this->userContext = $userContext;
    }

    /**
     * Checks if order is allowed
     *
     * @param \Magento\Sales\Model\ResourceModel\Order $subject
     * @param callable $proceed
     * @param \Magento\Framework\Model\AbstractModel $order
     * @param mixed $value
     * @param null|string $field
     * @return \Magento\Sales\Model\Order
     * @throws NoSuchEntityException
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function aroundLoad(
        \Magento\Sales\Model\ResourceModel\Order $subject,
        \Closure $proceed,
        \Magento\Framework\Model\AbstractModel $order,
        $value,
        $field = null
    ) {
        $result = $proceed($order, $value, $field);
        if (!$this->isAllowed($order)) {
            throw NoSuchEntityException::singleField('orderId', $order->getId());
        }
        return $result;
    }

    /**
     * Checks if order is allowed for current customer
     *
     * @param \Magento\Sales\Model\Order $order
     * @return bool
     */
    protected function isAllowed(\Magento\Sales\Model\Order $order)
    {
        return $this->userContext->getUserType() == UserContextInterface::USER_TYPE_CUSTOMER
            ? $order->getCustomerId() == $this->userContext->getUserId()
            : true;
    }
}


texts:
I have installed fresh magento2 version.

The page keeps loading or the session expired ( error ).
And the customer can't log-in/ submit the form.

But this is working perfectly on Mozilla browser.

How to resolve this issue?


texts: Using mage for the friendly category url

texts:
Just started learning how to use the Mage for retrieving info from the database for a Google base feed.  I have been calling the tables directly but I am not able to figure out how to get the "friendly" url.

Direct: /catalog/product/view/id/829/s/double-tier-ventilated-lockers/

Friendly: /gym-lockers/double-tier-ventilated-gym-lockers/double-tier-ventilated-lockers.html

I am using getProductUrl() for the direct url.  I read something where you have to walk through the categories and relate the products to it (addUrlRewrite) for the Friendly URL, but with my limited knowledge it isn't making sense to me.

Question:  How do I pass a ProductModel into a function of some sort and have it return the friendly url?

Thanks for your help


texts: How to create a form using the static blocks in magento?

texts:
I have added the tab using catalog-Manage categories->Add subcategory and added the tab 'as quick service'

Added the form in below path

app/design/frontend/ultimo/default/template/quickservice/form.phtml

and added the cms page with the content

{{block type='core/template' name='quickservice' template="quickservice/form.phtml"}}

But it is showing the empty page when I click on the tab.Please anyone can help me.

form.phtml

 <form action="<?php echo $this->getFormAction(); ?>" id="quickservice" method="post">

                *<?php echo $this->__('Service Type') ?>

                            <select name="servicetype" class="input-text required-entry validate-select" style="width: 150px;" />
                                    <option value=""><?php echo $this->__('--Please Select--')?></option>
                                    <option value="Lab"><?php echo $this->__('Lab')?></option>
                                    <option value="Hospital"><?php echo $this->__('Hospital')?></option>
                                    <option value="Food"><?php echo $this->__('Food')?></option>
                                    <option value="Gym"><?php echo $this->__('Gym')?></option>
                                    <option value="Physio"><?php echo $this->__('Physio')?></option>
                                    <option value="Nurse"><?php echo $this->__('Nurse')?></option>
                            </select>

 </form>


texts: Notify me when this product is in stock on product listing page in magnento 2.2.5

texts: I want to add "Notify me when this product is in stock" on product listing page in magento 2 . by default if product is out of stock this comes in the product detail page. but i want in the product listing page. I am using magento 2.2.5


texts:
When a customer adds a product and goes to the shopping cart, the cart total does not show euro but instead just some random stuff, does anyone know the solution to fix this?

  www.fightgloves.nl


texts: M2 - Method to automatically include module css?

texts:
I am trying to avoid adding a head tag for every module I create. The other method of doing it via design css files would be that they depend on each other then and are no longer separated - that is unacceptable to me.

I have seen a _module.less file, I was hoping this would be automatically included upon less generation?


texts: Magento2: How can I apply shipping cart rules?

texts:
I want add shipping method on subtotal. If subtotal equal or greater $250 Shipping method should be Free and If less $250 Shipping method should be Flat Rate.

Any one help in this?

I have applied shipping cart rules but it is not working.


texts:
My client had deleted all customer accidentally. And unfortunate we don't have any backup.

Any way to recover a customer and their history order?


texts:
I have updated the CSS for our site.

After updating, I ran the below commands:

php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

But the changes are not applied when I check the front-end of our site. So, I ran the below command:

php bin/magento setup:di:compile

I also ran the above said 2 commands after this. Now, I can see the changes in the front-end.

So, In this case, do I need to run compile command whenever I make any changes in CSS.

Your help will be greatly appreciated.


texts: Cart and mini cart are not cleared after check out and Success page

texts:
Both my shopping cart and mini cart are not emptied after checkout and Success page.

Quota lifetime is already set to zero.


texts: Magento 2 module install error "data: current version - none, required version 2.0.0"

texts:
I'm getting the following error when I try to install my extension.

Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Mymodule_Example data: current version - none, required version - 2.0.0

The database entry in setup_module looks like this:

This is my module.xml file:

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

Is there something I'm missing to ensure the data version gets added to the DB? A result of this also means my setup scripts aren't running.


texts: magento category product count not correct compared to admin count

texts:
I have a problem with the product count inside frontend category view.

The amount of products shown here are different then the ones in the backend.
Frontend:

Backend:

I was wondering what the problem could be.

Any help would be appreciated.

Edit:
So I've tried to turn the anchor off as suggested in the comments below
If i change anchor from yes to no the backend still shows 411 items but the frontend suddenly shows only 284 instead of 411. I've looked into this and it seems it looks to if the product is active or not and if product is in stock.

Further searching and debugging, I found out that indeed the anchor is taking the sub-category products that are in stock and active will be shown in the category view.


texts: php Out of Memory error when refreshing report statistics

texts:
I have recently upgraded from Magento CE 1.9.2 to 1.9.3.10.

Since this we get the following error when Reports>Refresh Statistics is used:

  Fatal error: Out of memory (allocated 1808531456) (tried to allocate
  90 bytes) in /home/****/****/lib/Varien/Object.php on line 273

I have tried or can confirm the following:

we are on a dedicated server
php_memory_limit is 2048M set through MultiPHP INI editor in WHM. I have also had the error when setting it equally high in php.ini file and .htaccess
phpinfo.php shows php_memory_limit at 2048M
No error when refreshing statistics on a 1.9.2.4 staging version running on the same server
No error on a fresh install of 1.9.3.10 on the same server (although this has no products or orders)
No error when statistics are refreshed using cron
Error still happens after disabling all extensions in local / community and using standard Magento template
nothing in system.log or exception.log

Any new ideas I can follow up would be really useful.


texts: Magento 2: Exclude classes from generating interceptors

texts:
In Magento 2 (beta9 and above) you can run this command php bin/magento setup:di:compile and all the interceptors, factories and proxies (and maybe others) will be generated in the var/generation folder for all the classes you have in your magento instance.
This is useful for live environments because otherwise the classes mentioned above will be generated at runtime when they are needed and could impact performance.
Is there a way to exclude some classes from this script so the interceptors will not be created when running the command?
As an example: I want for the controller Magento\Backend\Controller\Adminhtml\Dashboard\RefreshStatistics not to have interceptors generated.


texts: I want to separate certain filter values, i know I made a mistake in the code, but where?

texts:
i know I made a mistake in the code, but where?

    <?php $attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes(); ?>
    <?php foreach ($attributes as $attribute): ?>
        <?php if ($attribute->getAttributeCode() == 'my_attribute'): ?>
            <?php $filterBlockName = 'amshopby/catalog_layer_filter_attribute'; ?>
            <?php $result = Mage::app()->getLayout()->createBlock($filterBlockName)->setAttributeModel($attribute)->init(); ?>
            <?php endif; ?>
            <?php foreach($result->getItems() as $option): ?>

               <?php if ($option->getValue() == '1025,1023'): ?>
               <?php echo ('getUrl() . '">'.$option->getLabel().'') ?>

               <?php else: ?>
               <?php if ($option->getValue() == '1025,1024'): ?>
               <?php echo ('getUrl() . '">'.$option->getLabel().'') ?>
    <?php endforeach ?>
    <?php endif; ?>

UPDATED

With this code work perfect, but i need to customize it.

    <?php $attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes();
    foreach ($attributes as $attribute) {
        if ($attribute->getAttributeCode() == 'my_attribute') {
            $filterBlockName = 'amshopby/catalog_layer_filter_attribute';
            $result = Mage::app()->getLayout()->createBlock($filterBlockName)->setAttributeModel($attribute)->init();
            foreach($result->getItems() as $option) {

               if ($option->getValue() == '1025,1023') {
               echo 'getUrl() . '">'.$option->getLabel().'';
               }
               else
               if ($option->getValue() == '1025,1024') {
               echo 'getUrl() . '">'.$option->getLabel().'';
               }

            }
        }
    }
    ?>


texts: Magento2: how to remove edit product link from minicart (2.4.1)

texts:
I have attempted to follow lots of answers on here which cover overriding the minicart via a new extension/module.
I have successfully removed all the edit links from the cart by adding the file:
checkout_cart_index.xml
to this location:
/app/design/frontend/BlackRhino/luma/Magento_Checkout/layout/
Which looks like this:
<?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">
<update handle="checkout_cart_item_renderers"/>
    <body>
    <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.virtual.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.giftcard.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.grouped.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.downloadable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.bundle.actions.edit" remove="true"/>
</body>

Can I do the same for the minicart?
I have tried copying the file from this location:
/vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html
Various locations seem to be suggested:
/app/design/frontend/BlackRhino/luma/Magento_Checkout/web/template/minicart/item/
/app/design/frontend/BlackRhino/Magento_Checkout/web/template/minicart/item
/app/code/BlackRhino/BlackForest/template/minicart/item/
I've tried all of these locations with deploying static content (although its in developer mode) but the pencil prevails.
I don't know if things have changed recently, quite alot of the questions appear to be 3-4 years old in some cases and I wonder if the recent changes now require a slightly different approach?
I have also tried to override this file:
/vendor/magento/module-checkout/view/frontend/requirejs-config.js
by placing one here with an alternative location like this:
var config = {
map: {
    '*': {
        'Magento_Checkout/template/minicart/content.html':
            'BlackRhino_BlackForest/template/minicart/content.html'
    }
}

};
but this answer Magento 2: How to override mini-cart default template html file? doesn't make it clear where the alternative file should be located and again is 5+ years old.
I wonder if someone could put me out my misery and tell me where I have gone wrong and which one of these solutions should work and how I can get it to work please?


texts: Show a loading icon until the page loads on Magento 2.3.6?

texts:
I'm new to Magento 2 site. I'm running a site on 4 GB ram and 1 CPU processor. So the site is loading slow. And users are trying to click before it loads completely. I want to show a loading image when page completely loads. How can I achieve it? and what is the minimum required processor for Magento 2?
Thanks


texts: Magento 2 filter with custom customer attribute in create order select customer grid

texts:
I am working on Magento 2. In Admin -> Sales -> Order create order it is displaying all customer list. I want to filter that list with custom customer attribute. I already created attribute.
Example :
Customer Attribute : Allow to create order -> Yes / No
In create order customer list only those customer should display which attribute value is "Yes".


texts:
I'm trying to log some info in the existing Magento 2 module just to check if the code is running or not.
Following files have been modified to log info.

  Magento\Checkout\Block\Cart\Item\Renderer.php

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Checkout\Block\Cart\Item;
.
.
.
.
use Psr\Log\LoggerInterface;
.
.
.
protected $_logger;

 public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        .
        .
        LoggerInterface $logger,
        array $data = []
    ) {
        .
        .
        .
        $this->logger = $logger;
        parent::__construct($context, $data);
        .
        .
        .

    }
.
.
.
public function getProductOptions()
    {
        /* @var $helper \Magento\Catalog\Helper\Product\Configuration */
        $helper = $this->_productConfig;
        $this->_logger->debug('Product Options');
        return $helper->getCustomOptions($this->getItem());
    }

I'm getting following error.

  Exception #0 (Exception): Recoverable Error: Argument 10 passed to
  Magento\Checkout\Block\Cart\Item\Renderer::__construct() must
  implement interface Psr\Log\LoggerInterface, array given, called in
  /Applications/MAMP/htdocs/magentoce21/vendor/magento/module-bundle/Block/Checkout/Cart/Item/Renderer.php
  on line 65 and defined in
  /Applications/MAMP/htdocs/magentoce21/vendor/magento/module-checkout/Block/Cart/Item/Renderer.php
  on line 120


texts: Magento2: How to add additional product info on left side of product page layout?

texts: Magento2: How to add additional product info on the left side of product page layout? I'm using 2columns-left. I want to add some attributes info like the width & height.


texts: How to clear browser cache when some css and js files changed?

texts:
We have had a serious problem with browser caching. Some of our new features for old users are not working properly due to users browser caching. We are using Magento 1.9 version and have daily several deployments. Also, we are using Cloudflare CDN to cache our static contents.
The question is:
How to clear browser cache after some of our deployment which has changed in CSS or JS files?


texts: Why I'm receiving an error messages Class does not exist when running DI compile?

texts:
Why am I receiving error messages "Class does not exist" when running DI compile?
I removed some modules using the node replace in my composer.json, as you can see below.
 "replace": {
    "amzn/amazon-pay-and-login-magento-2-module": "*",
    "amzn/amazon-pay-and-login-with-amazon-core-module": "*",
    "amzn/amazon-pay-module": "*",
    "amzn/amazon-pay-sdk-php": "*",
    "amzn/login-with-amazon-module": "*",
    "magento/module-braintree": "*",
    "magento/module-braintree-graph-ql": "*",
    "braintree/braintree_php": "*",
    "braintree/braintree": "*",
    "dotmailer/dotmailer-magento2-extension": "*",
    "dotmailer/dotmailer-magento2-extension-package": "*",
    "dotmailer/dotmailer-magento2-extension-enterprise": "*",
    "klarna/m2-payments": "*",
    "klarna/module-core": "*",
    "klarna/module-kp": "*",
    "klarna/module-ordermanagement": "*",
    "vertex/product-magento-module": "*",
    "vertex/module-tax": "*",
    "vertex/sdk": "*",
    "yotpo/magento2-module-yotpo-reviews": "*",
    "yotpo/magento2-module-yotpo-reviews-bundle": "*"
},

I received many issues related with those modules, when I try to run the setup:di:compile I see a message about Vertex class, which is not installed anymore, when I try to run bin/magento I receive an error message about the Authorize.net.

Why is it happening and how could I solve it?


texts: How to solve an issue with pre selected layered navigation?

texts:
I'm using Magento 1.14.3.8, when I navigate through the categories sometimes some layered navigation items shows up selected.

How can I solve it?


texts: Magento 1.9.4 checkout/onepage after login redirect to checkout/cart

texts:
Am using Magento 1.9. When customer login in checkout/onepage page, it redirect to customer/account.
I want to remove this flow.
If customer login in checkout/onepage page redirect to same page I mean checkout/cart page.


texts: Accessing a Site Developed with Magento Community Edition using Mobile Clients

texts:
I intend to develop an e-commerce solution using Magento Community Edition (free version). The solution needs to cater mobile clients (e.g. mobile phone web browsers) as well (i.e. Android phone users will access the site for shopping). In this case, is it be possible to use Magento Community Edition ? Can we develop a customized theme with responsive design features to cater mobile clients ?

Thanks for your feedback!


texts: Layout handle in transactinoal email not using the right theme

texts:
{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

The above block/layout handle in my transactional email is using the base theme when the invoice is created - however strangely when the invoice is resent, it uses the correct theme. Both actions are being carried out in the admin.

I've tried:

{{layout area="frontend" package="foo" theme="bar" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

but have had no luck.


texts: How to set up two types of color swatches

texts:
Does it allow you to have color swatch for selecting product variants and separate one for filtering search results.

We would like to use two types of color swatches on our Magento site.

One on the product details page for selecting product variants i.e. configurable products.
And another on the product listings pages for filtering through the catalog pages.

They need to be different as we have dozens & dozens of different colour variants across all our different brands and rather than show all these colours in the filtered navigation we would like to only show 10 to 15.

Is there a way to configure this in Magento or do you need a custom extension for this?


texts: Magento CatalogSearch Model Problem - Unable to use loadByQueryText();

texts:
I am writing a custom module, and in this module I need to add a search query to the database if it's not there already. I figured out what I need to do:

Load catalogsearch/query model
Check if query exists, if not add it

Here's the code I thought would work:

$querymodel = Mage::getModel('catalogsearch/query');
$querymodel->loadByQueryText('testing 123');

if (!$querymodel->getId()) {
    $querymodel->setIsActive(1);
    $querymodel->setQueryText('testing 123');
    $querymodel->setStoreId(1);
    $querymodel->setIsProcessed(0);
    $querymodel->save();
}

This code is successful in that it adds to the catalogsearch_query table. However the initial check loadByQueryText() or loadByQuery() simply does not return true even when a query exists - so I keep getting the same query added to the db.

I've looked through the model file (Catalogsearch/Model/Query.php) and I'm using the method in the exact same context as the model itself, so I don't know why it doesn't work?

Any help much appreciated!


texts: Quick search - how to use attributes via parameters ?

texts:
I have this working in advanced search :

catalogsearch/advanced/result/?name=vanille&is_bio=1

Every product whose name contains "vanille" and attribute "is_bio" set to true will appear.

Now since I need to search not just in "name" but also other fields like "brands", I have to use quick search and its "q" query (correct me if I'm wrong). But in this case attributes won't have any effect :

catalogsearch/result/?q=vanille&is_bio=1

Will show every products containing "vanille" whatever the value of "is_bio".

Is there anyway to activate params in quick search ?


texts: Unable to deploy, failing on slug prepare/upload

texts:
There is an issue in some of our shared environments where deployment fails intermittently on the "Preparing slugs" step. No other details are in the error log. Has anyone experienced this or can think of possible root causes?

Deploying applications
  Starting deployment
  Preparing slugs
  E: Failed to upload slugs
  E: Command '['ssh', u'2.xxxxxx.ent.magento.cloud', 'sudo /etc/platform/xxxxxx/rebuild_slug.sh /mnt/shared/slugs/xxxxxxxxxxx-mymagento-xxxxxxxxxx']' returned non-zero exit status 255

E: Error: Cannot complete deployment

We have confirmed that we still have usable space left on disk, although maybe it's not enough of a margin. Currently allocated at 15GB. Our diskspace for the shared environments (xx and xx_2):

xxxxxxxx_2@i-02719996b6e941c57:~$ df -h
Filesystem                                        Size  Used Avail Use% Mounted on
udev                                               10M     0   10M   0% /dev
tmpfs                                              13G  480K   13G   1% /run
/dev/xvda1                                         59G   14G   43G  24% /
tmpfs                                              32G   24K   32G   1% /dev/shm
tmpfs                                             5.0M     0  5.0M   0% /run/lock
tmpfs                                              32G     0   32G   0% /sys/fs/cgroup
/dev/xvdi                                          20G   11G  9.2G  54% /data/exports
/dev/xvdj                                          50G   40G  9.1G  82% /data/mysql
xxx.xxx.xxx.xxx:/shared                                20G   11G  9.0G  55% /mnt/shared
/dev/loop0                                        228M  228M     0 100% /app/xxxxxxxx
xxx.xxx.xxx.xxx:/shared/xxxxxxxx/var              20G   11G  9.0G  55% /app/xxxxxxxx/var
xxx.xxx.xxx.xxx:/shared/xxxxxxxx/app/etc          20G   11G  9.0G  55% /app/xxxxxxxx/app/etc
xxx.xxx.xxx.xxx:/shared/xxxxxxxx/pub/media        20G   11G  9.0G  55% /app/xxxxxxxx/pub/media
xxx.xxx.xxx.xxx:/shared/xxxxxxxx/pub/static       20G   11G  9.0G  55% /app/xxxxxxxx/pub/static
/dev/loop1                                        230M  230M     0 100% /app/xxxxxxxx_2
xxx.xxx.xxx.xxx:/shared/xxxxxxxx_2/var          20G   11G  9.0G  55% /app/xxxxxxxx_2/var
xxx.xxx.xxx.xxx:/shared/xxxxxxxx_2/app/etc      20G   11G  9.0G  55% /app/xxxxxxxx_2/app/etc
xxx.xxx.xxx.xxx:/shared/xxxxxxxx_2/pub/media    20G   11G  9.0G  55% /app/xxxxxxxx_2/pub/media
xxx.xxx.xxx.xxx:/shared/xxxxxxxx_2/pub/static   20G   11G  9.0G  55% /app/xxxxxxxx_2/pub/static

FOLLOWUP:
Magento Support identified our slug file as being corrupt. They removed it and then deployment has worked ever since.


texts: Magento 2.2.4 : Missing media/styles.css from Sample Data site

texts:
Everything seems fine apart from the banner section which appears on various pages which looks like...

I can see that some styles are available in the install at <install_dir>/pub/media/styles.css but this file isn't included in the generated markup so it's not calling a 404.


texts:
Recently I upgrade one website from 1.8.1.0 to 1.9.4.0.
Everything working fine into the website accept one issue.

I face strange issue,
The customer who make the payment using "Paypal Express Checkout" are not able to login into the website.

After successfully make the payment for the order, customer register sucessfully.

Now when they try to login with credential, they are not able to login into the website.

There is not any error on page, log file or etc.


texts: Magento 2.4 Custom Product Multiselect Attribute Options not saved

texts:
I have created a Multi-Select Product attribute programmatically but my options are not being saved.
Vendor/CustomProductAttributes/Setup/Patch/Data/AddAllowedCountriesAttribute.php
<?php

namespace Vendor\CustomProductAttributes\Setup\Patch\Data;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Vendor\CustomProductAttributes\Model\Config\Product\Options;

class AddAllowedCountriesAttribute implements DataPatchInterface
{
    /** @var ModuleDataSetupInterface */
    private $moduleDataSetup;

    /** @var EavSetupFactory */
    private $eavSetupFactory;

    /**
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        EavSetupFactory $eavSetupFactory
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function apply()
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);

        $eavSetup->addAttribute('catalog_product', 'sd_allowed_shipping_countries', [
            'type' => 'text',
            'label' => 'Allowed Shipping Countries',
            'input' => 'multiselect',
            'source' => Options::class,
            'user_defined' => 1,
            'is_global' => 1,
            'is_visible_in_grid' => 1,
            'is_filterable_in_grid' => 1,
            'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
            'position' => 2,
            'visible_on_front' => 1,

        ]);
    }

    /**
     * {@inheritdoc}
     */
    public static function getDependencies()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public function getAliases()
    {
        return [];
    }
}

My Vendor/CustomProductAttributes/Model/Config/Product/Options.php looks like that.
<?php

namespace Vendor\CustomProductAttributes\Model\Config\Product;

use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;

class Options extends AbstractSource
{
    protected $optionFactory;
    public function getAllOptions()
    {
        $this->_options = [];
        $this->_options[] = ['label' => 'No restrictions', 'value' => 'No restrictions'];
        $this->_options[] = ['label' => 'Czech Republic', 'value' => 'Czech Republic'];
        $this->_options[] = ['label' => 'Denmark', 'value' => 'Denmark'];
        $this->_options[] = ['label' => 'Finland', 'value' => 'Finland'];
        $this->_options[] = ['label' => 'France', 'value' => 'France'];
        $this->_options[] = ['label' => 'Germany', 'value' => 'Germany'];
    }
}

Can anyone tell me what I can do so the Options will be saved?
Thanks!


texts: XML declaration allowed only at the start of the document\nLine: 1\n

texts:
Api's stopped working suddenly, and it's showing this error.

I have checked the file XML syntax was correct.

Can someone help me?


texts: Can't upload Configurable product via CSV - can't find common element with products erroring?

texts:
I have been staring down this spreadsheet for the last six hours, so any help is greatly appreciated.

I am trying to upload about 2K SKUs of apparel product, I'm uploading via CSV. Of my about 80 products, 60 of them are erroring on me and I can not figure out why.

After some trial and error I discovered that my validation errors disappear if I delete the configurable_variations column, but that doesn't do me any good because I need my simple product associated to the configurable product.

For the life of me, I can not figure out what the erroring out products have in common.

I know that the few products that are working are actually working, because a test upload of the configurable product ST657-master and all associated simple product worked perfectly.

The Data Validation error is as follows:

  Invalid option value in row(s): 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2712, 2713, 2714, 2715, 2718, 2720, 2721, 2722, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2731, 2732, 2739, 2740, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2748, 2749, 2750, 2752, 2753, 2755, 2756, 2760, 2761, 2764, 2768, 2769, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 2779, 2780, 2781, 2784, 2786

And my CSV is here -
(Dropbox Link)


texts: Not able to place order with stripe magento extension on local developement

texts:
My first doubt is will stripe work on local wamp server to test?
I am getting an error in my console that says

  TypeError: can't assign to properties of (new
  String("payment%5Bmethod%5D=foggyline_stripe&payment%5Bcc_type%5D=AE&payment%5Bcc_number%5D=378282246310005&payment%5Bcc_exp_month%5D=7&payment%5Bcc_exp_year%5D=2023&payment%5Bcc_cid%5D=4526")): not an object


texts: Deploying Static Content on M2 doesn't work

texts: I am trying to deploy static content on my production site but I am receiving the error in the screenshot. Why is this occurring?


texts: Count getSingleton Product Collection Without changing it?

texts:
How can i count an productcollection without changing it?

when i do:

$test = Mage::getSingleton('catalog/layer')->getProductCollection()->addFieldToFilter('special_price', 150);

And then call count($test) it replaces my productcollection.

EDIT:

Basicly i want this:

Mage::getSingleton('catalog/layer')->getProductCollection()->addFieldToFilter('special_price', array('gt' => 0))->getSize();

To count how many products has a special price. But when i call this code, it replaces my product collection, so it only shows products with special_price


texts: Combine multiple shipping carrier rates with different shipping methods into one rate

texts:
Looking for a plugin or a way to combine shipping rates for multiple items that ship through multiple carriers into a single rate during checkout. Here's an example of what I'm talking about.

Item 1: ships UPS (Rates are pulled from our UPS account)
Item 2: ships LTL (Rates are pulled from our LTL account)
Item 3: ships Flat Rate (per product)

All are in the same cart looking to be purchased at the same time.

(Currently on Dev. Site) Each individual shipping method is shown to customer and they can only select one option. This means that my store would not capture shipping cost for any of the other items in the cart. Is there a way capture various shipping method rates into a rate for the customer during checkout. If so - additionally, is there a way to give additional options based off a multiplier for rush delivery services?
Thanks for any input on this.


texts: react - server side rendering in magento pwa

texts:
Is there a workaround to adding react as a templating engine?
In my server.js file, I have the following code:
const { createUpwardServer } = require('@magento/upward-js');

createUpwardServer({
    upwardPath: 'spec.yml',
    bindLocal: true,
    logUrl: true,
    port: 8080,
    before: (app) => {
        app.set('view engine', 'jsx')
        app.engine('jsx', require('express-react-views').createEngine());
        console.log(app);
    }
});

And in the spec file i have the following code
 body:
          resolver: template
          engine:
              resolver: inline
              inline: 'jsx'
          template:
            resolver: file
            file:
              resolver: inline
              inline: './templates/hello-world.jsx'
          provide:
              title:
                  resolver: inline
                  inline: 'This is the page title'

Yet I am facing TemplateResolver issue
Error: Template engine 'jsx' unsupported
Can you tell me what is it that I am missing here as well
PS: I already went through this part of the readme and it didn't help


texts:
Does anyone know where I can get SOLR patch for SOLR version 4.4 for Magento Enterprise version 1.12.0.2?

I tried to find the MagentoCommerce.com support system, but there no longer seems to be a support ticket system there.

Thanks in advance and apologies for placing a boring question here!


texts: Magento 2 How to create log of upgrade command?

texts:
I wanted to create logs of upgrade command under var/log folder:

php bin/magento setup:upgrade

Please help me.


texts: Create a Report Showing Email Addresses of Customer Who Ordered a Specific Product

texts:
I'm trying to do something that seems simple but we've been pulling hair out here trying to get it done.

We have a specific product on our store that has been downloaded more than 2,000 times. When we run a report on downloads, we can see the product and the number of downloads.

We sure would like to be able to email all of the people who downloaded that product. There has to be a way to generate a report that tells us everyone who downloaded this product, include the person's email address, and export it to Excel.

Please tell me I'm missing something obvious!!


texts: How to add filter to category products(Show only with special price)

texts:
I'm new to magento(i'm using 1.8 btw), I currently have price and color filters on category page and they are working fine, but I can't find any help for adding a new filter to show only products that currently have a special price.

I don't want a specific page to show all "special price" products, I need this to be done with a filter, on the category page.


texts: i have figured out some weird js minification issue

texts: i have turned on the developer mode and did merge and minify javascript . then setup:di:compile and cache:flush the page is not looking ok but js is minifed and merged as well , when i run setup:static-content:deploy command then the main page become ok as it should look but the js minification and js merging is not working . i am stuck here i dont know what can i do in this . see if anyone facing the same issue i am using magento 2.2.6


texts: Rest api to get product by sku with custom attribute option value in Magento 2.1

texts:
I am using Magento 2.1.6 CE and also am using default rest api's for create mobile app. When I get product by sku I get all the details of the particular product including custom attributes also.

But in custom attributes I have some attributes like color attribute (i.e. dropdown and filterable). I have various options for color attribute like Blue, Green, Red etc

When am requesting /V1/products/{{sku}} it shows custom attributes like following, (it shows option_id instead of option_value).

....
{
   "attribute_code": "color",
   "value": "11"
},
....

But I need this like the following,

....
{
   "attribute_code": "color",
   "value": "Green"
},
....

How can I get this done?

Please suggest me is there any default options available to done this.


texts: Merge-import customers from old DB into new DB

texts:
I want to import a fresh set of data of customers into an existing database on Magento 1.9.

I don't have access to the backend, thus I cannot use the export functionality.

How could I update all existing customers and create those who aren't there currently by email address via SQL?

How would I proceed here?


texts: How to get 2 columns of labels for only 1 attribute in layered navigation menu?

texts:
I am working on the layered navigation menu.
For the attribute color, I would like to get 2 columns of labels.
There is 10 differents colors so, it would be 5 labels/column.

Could anyone help me to figure this out?
The menu I have to implement will look exactly like this one.

Here is a part of "filter.phtml":

<ol class="m-filter-item-list <?php echo $this->getFilterOptions()->getIsReverse() ? 'm-reverse' : '' ?>"
<?php foreach ($this->getItems() as $_item): ?>

    <?php if (!$this->getFilterOptions()->getDisableNoResultOptions() || $_item->getCount() > 0 || $_item->getMSelected()): ?>

      <?php if ( $_item->getMShowSelected() ): ?>
         <a href="<?php echo $_item->getRemoveUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" >
            <input type="checkbox" class="checkbox" value="lien" name="rou" checked="checked" />
            <?php $img = $_item->getValueString(); ?>
    <?php $path = Mage::getDesign()->getSkinBaseDir();
    if (is_file($path . DS . 'images/layer/' . $img . '.png')): ?>
    <img src="<?php echo $this->getSkinUrl('images/layer/' . $img . '.png') ?>" alt="frame shape" />
    <?php endif; ?>
            <?php echo $this->escapeHtml($_item->getLabel()) ?>

Here is the code of the CSS file "style.css" using the current class in
:

.m-filter-item-list a {
   text-decoration: none !important ;
   text-shadow: 0px 0px 1px  #c0c0c0 ;
   color: #c0c0c0 ;
   font-size: 0.86em;}
.m-filter-item-list li {
padding-bottom: 3px; }

Thanks


texts: After Upgrade to Magento2.3.5 Braintree started giving error

texts:
After upgrade from magento2.3.3 to 2.3.5. Braintree has started giving error

code: "PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED"
details: undefined
message: "A linked PayPal Sandbox account is required to use PayPal Checkout
in Sandbox. See
https://developers.braintreepayments.com/guides/paypal/testing-go-
live/#linked-paypal-testing for details on linking your PayPal sandbox with
Braintree."
name: "BraintreeError"
type: "MERCHANT"
__proto__: Error

I am using the same account details with my other site and its working fine but in this Magento version it is giving error.
Does anyone have any solution?


texts:
Generally we get jQuery and prototype.js conflicts in Magento 1.9
Mainly due to jQuery conflicts.
Do you have any suggestion to resolve this?


texts: Multiple stores using multidomain SSL certificate

texts:
I have an issue with child stores in my multi store environment when using the multidomain certificate. Basically, the child stores are pointing to the main website (but keeping the url which causes cross-domain issues).

I'm hoping I have missed a step in the setup of the other stores, but I can't see what.

I am using cPanel & Engintron.


texts:
When upgrading a site from Magento 2.2.6 to 2.3.0, the following error occurs during setup:upgrade

...
Module 'Magento_AdminNotification':
Module 'Magento_Search':
Module 'Magento_Amqp':
Running schema recurring...
Module 'Magento_Config':
Module 'Magento_User':
Module 'Magento_Authorization':
Module 'Magento_Indexer':
Running schema recurring...Constraint "email_order_to_sales_order" references table that does not exist.


texts:
I have set up a Scheduled Backup (Database and Media) which works fine.
However, it's done every day and I now have 72 of them!

I only need to keep the last 7 days worth.
Is there any way of deleting the older backups? And is there a way of automatically limiting the number of backups kept?


texts:
I installed Magento 2.3 successfully on my Ubuntu Maschine and tried to start to make my first own module. I followed this tutorial: https://www.cloudways.com/blog/create-module-in-magento-2/.

But I quickly ran into a problem as the php bin/magento module:status command is not working.

The problem is that

  There are no commands defined in the "module" namespace.

Any Idea how I can save this problem?


texts: Magento 2 - Change order shipping method

texts:
In Magento 2, I try to change the shipping method for orders programmatically.
I did this
$order->setShippingMethod('my_new_method');
$order->save();

The shipping_method attribute is changing as expected, but I also need to recalculate order shipping prices according to the new method.
Do you know how to do it?


texts: How to show order total details after order item details in order summary of magento 2 checkout page


texts:
in magento 2 one of products wasn't visible on front-page. After running command line indexer:reindex product is showing. Why do I need run indexer:reindex ? In system -> index management already settings are "update by schedule", cron is running and in column updated dates are changing. So product should appear automatically?

But... in database in table indexer_state are different dates, and those dates changed when I run indexer:reindex. So whats is this table, why is has different dates than in admin (system -> index management)?

Thanks for any help


texts: Magento 2 Running Ridiculously Slow - Best Fix?

texts:
I need advice on the best way to approach this. The site is loading pages in 30 seconds, sometimes 1 minute. This will kill my traffic if it's rolled live.

Hosting said:

  I ran an strace on one of the pages, which took 23 seconds to load
  completely, and ran an strace on it, which records every single system
  call made by the site during this loading time. There were no specific
  system calls taking more than than a few milliseconds excluding a call
  to the main Magento core bootstrap.php which is normal, and that in
  itself took 1.6 seconds from the total. The rest of the calls as
  mentioned take milliseconds each, but due to the amount of calls,
  188979, the process just takes too long.

We have tried changing PHP version - it didn't work.

  I tried several minor fixes like using a different PHP version, temporarily disabling opcache as there were a fair number of calls to files generated by it, but nothing much changes.

URL:
Staging site - temp URL


texts: Adding a new custom input field in order > invoice magento

texts:
I am trying to add new input field in sales > order > invoice . This would be like my reference number. This custom input field should be show in sales > order >invoice & sales > invoice & when print invoice this custom field need to get showed , New custom grid need to get added , I am currently working with this :

Jquery

Can some one let me know how i need to proceed for this .

Custom field in admin panel should look like this  : http://i.stack.imgur.com/BaEbb.jpg


texts: Creditmemo Grand Total does not include Tax

texts:
I recently updated my Payment Module (MultiSafePay) to version 2.2.1 and this creates a weird error which causes my credit memos to be wrong.
Source: https://www.multisafepay.com/nl_nl/oplossingen/shop-plug-ins/detail/plugins/magento/

The grand total of my credit memos do not include the tax. But the tax is being shown correctly. Thus the subtotal is actually the actual subtotal minus the tax.

To show what I mean, I'll include some print screens of a example order with a total value of 174.20 euros, the subtotal is 151.78 and the tax is 22.42.

Creating an order and invoice goes like a charm.

I create the order, values seem correct

Order is created, looks as expected

I create the invoice, again the numbers seem correct

Jup that invoice looks great1

Now here is where it gets weird, at first the credit memo I am about to create shows all the correct values!

But when the credit memo is created, the total is wrong, it is the subtotal without the tax, however the tax is mentioned on the form.

Normally the grand total is 174.2, but now the grand total suddenly ends up being 174.2 - 22.42 (the tax) = 151.78.

The only solution to this problem is to manually go into the database and manipulate the records in the sales_flat_creditmemo and sales_flat_creditmemo_grid table and manually set the grand_total and base_grand_total to the correct 174.20 value, which is the wrong 151.78 after generation of the credit memo.

Which is a lot of unnecessary work.

My current tax settings are the following:

The credit memo record in the database:

But I don't see how this could have any effect on the problem.

A downgrade isn't much of an option since it had other issues like double invoices and double payment request mails to our customers etc (credit memos worked fine though) and we like to use the new features in the new version.

The module developers are looking into the problem but can't recreate it so I am not sure if it is caused by the module. Is this a known issue in Magento? This bug is costing us a bunch of time and I can't seem to find anything wrong in the module code so I'm basically just bashing my head on the table here. All help or tips are welcome.


texts: Extension fully installed, but maintenance flag not removed

texts:
I've written a new upgrade to an extension and it works just fine on my dev install.

When I package it, there are no problems.

When I try to install it from connect manager I never see the console,but the screen does scroll down to the console area.

If I refresh the connect manager my extension is listed.

All files are properly installed and the DB tables properly updated.

The Maintenance flag is not removed

After deleting the flag file, the extension functions perfectly.

this is all repeatable across multiple installation on different servers, using both CE 1.8 and 1.9.

What might be causing the flag being left and the console not working, and how can I fix it.  Even after several hours consulting google, I'm at a loss.  This is the only thing I know of preventing the release of this extension.

If I need to show any code, please ask for it.  At this point, I don't even know what files might be causing the problem.

first request, the upgrade code from file mysql4-upgrade-0.1.3-0.1.4.php :

    <?php

$installer = $this;
//no database changes for this upgrade

my version 0.1.3 installs just fine, my version 0.1.4 doesn't.


texts: can't find my new attribute with dynamic options

texts:
when i access to stores product my new attribute i found this :

ok this is my code to install the new attribute

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

    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->removeAttribute(\Magento\Catalog\Model\Product::ENTITY,'choix_prix_product');
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'choix_prix_product',/* Custom Attribute Code */
        [
            'type' => 'text',/* Data type in which formate your value save in database*/
            'backend' => '',
            'frontend' => '',
            'label' => 'Choix-Prix de vente', /* lablel of your attribute*/
            'input' => 'select',
            'class' => '',
            'source' => 'Mdweb\ConfigAttribute\Model\Config\Source\Options',
            /* Source of your select type custom attribute options*/
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            /*Scope of your attribute */
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => false,
            'unique' => false
        ]
    );
}

}

and this is the source code :

 public function getAllOptions()
{

    $_product = $this->registry->registry('current_product');

    $_sku = $_product->getSku();
    if (isset($_sku)){

    $var1 = substr($_sku, 0, 1);

    $var2 = substr($_sku, 1, 2);

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('table_prix');

    $fields = array('prix_unitaire');

    $sql = $connection->select()
        ->from($tableName, $fields)
        ->where('code_famille' . '=?', $var1)
        ->where('code_nom_commercial' . '=?', $var2)
        ->join('table_choix',
            'table_choix.choix_id = table_prix.code_choix',
            [
                'designation_choix'
            ]);

    $result = $connection->fetchAll($sql);

    if ($result) {
        $i = 0;
        foreach ($result as $elt) {
            $this->_options[$i] = ['label' => " Choix" . $elt['designation_choix'] . "-" . $elt['prix_unitaire'] . "£", 'value' => " Choix" . $elt['designation_choix'] . "-" . $elt['prix_unitaire'] . "£"];
            $i++;
        }

    }   }else{
        $this->_options = [
            ['label' => __(''), 'value' =>'' ]];

    }

    return  $this->_options;

}

the idea is to create a product then return to this product and make it configurable according to the options of the  new attribute if there is no options so my product is simple
i can see my new product

but when i access the attribute details i find the screenshot that i put in first time
I waited to find my new attribute like others so what's the problem any help please


texts: How to add Javascript code on the head tag, for only success page,

texts:
I hope I explain my self correctly.

I need to include 2 JS.  The first JS code needs to be in all pages of the site.
I could try doing that in 2 ways:

header.phtml
Miscellaneous scripts through magento configuration, design, head.

that would work perfectly fine for the firs script.

<script>/*DO NOT ALTER *** */(function(e){var t="1340",n=document,r,i,s={http:"http://cdn.mplxtms.com/s/MasterTMS.min.js",https:"https://secure-cdn.mplxtms.com/s/MasterTMS.min.js"},o=s[/\w+/.exec(window.location.protocol)[0]];i=n.createElement("script"),i.type="text/javascript",i.async=!0,i.src=o+"#"+t,r=n.getElementsByTagName("script")[0],r.parentNode.insertBefore(i,r),i.readyState?i.onreadystatechange=function(){if(i.readyState==="loaded"||i.readyState==="complete")i.onreadystatechange=null}:i.onload=function(){try{e()}catch(t){}}})(function(){});</script>

However, I am required to do the following on the success page,

http://screencast.com/t/ze0b43gjUyWV

I already know how to generate the script dinamically based on:
https://stackoverflow.com/questions/25219799/how-to-integrate-dinamically-js-code-in-success-page-in-magento

but I dont know how to include that code only on the head tag of success page.


texts: Is it possible to use npm packages in Magento 2?

texts:
I see a post here from 2017 that gives an idea of how it's done, but I would want to use something like this that would allow people to sign their names on forms.
I know how to create html/js uicomponents, and include them in phtml files, but I don't know how to call functions from 3rd party libraries in those components. Any ideas on how this might be done?
Thanks


texts: Custom Product Collection not Getting Filtered by Layered Navigation

texts:
I had Overridden the product List.php Class & here is the code

protected function _getProductCollection()
{
 if (is_null($this->_productCollection)) {

$result = array_unique($productIds);

$collection = Mage::getResourceModel('catalog/product_collection');
$attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
$collection->addAttributeToSelect($attributes);
$collection->addIdFilter($result);
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);

$this->_productCollection = $collection;
}

return $this->_productCollection;
}

working fine, I also had added Layered Navigation as mentioned here and layered navigation appeared as expected.

The only problem is, when I click on any filter in layered navigation, navigation gets updated and filter also get added to url, but product list won't get filtered by the selected filter. Please guide me how can I apply the filters on product collection


texts: Tax collection at source and minimum taxable amount

texts:
I am doing research on the implementation of certain tax rules specific for Argentina.

A little context:

There are basically 2 VAT rules depending on the product type: 21% and 10.5%, they are mutually exclusive
There are several tax rules based on the customer type, and billing province which are completely unrelated with the products and are calculated based on order amount when the order exceeds a minimum taxable amount.

The first ones are pretty straightfoward.

The second ones are tricky. They are called "percepciones" (for all the research I have done, the closest translation is "collection at source") and the idea behind them is that the store acts as the IRS and charges a little extra to the customer which then the customer will deduct from a certain annual or monthly tax.

For example, lets assume a product valued $200.00 (tax excl.) with 21% VAT. The store has to collect a 2% gross revenue at source on orders $100 and up, so the order detail would be:

1 x Product = $200.00
VAT 21% = $42.00
Gross revenue 2% = $4.00
Total charged = $246.00

Of course the 2% rate is variable depending on customer billing address and customer type (companies have different rates and taxes than people).

I guess what's really killing me is the minimum amount which cannot be set up via Magento.

Also, setting aside the minimum amount, the multiple combination of product taxes and customer taxes would lead to having to create a rule for each possible combination.

For example, a customer could be exempt from paying VAT, but not gross revenue tax.

I would really appreciate any ideas you can throw at me about how to approach this, I am in "brainstorming mode" right now.

For the time being I am seriously considering ignoring Magento tax engine altogether and just placing a custom total hardcoding all of this logic (maybe set up some panel in the backend to twitch the parameters)

Thank you


texts: CronTab does not have the correct path to my module

texts:
I'm trying to set up a small cron job example, which I have problems with.

This is my Observer Class with the method I would like to start via cron

class Mynamespace_Mymodule_Model_Observer
{

    public function startJob($observer)
    {
       Mage::log('Hello World');
    }
}

Here's the cron part in my config.xml

<crontab>
    <jobs>
        <mynamespace_start_job>
            <schedule>
                <cron_expr>*/5 * * * *</cron_expr>
            </schedule>
            <run>
                <model>mymodule/observer::startJob</model>
            </run>
        </mynamespace_start_job>
    </jobs>
</crontab>

I'm using the AOE scheduler and I setup cron.

So when I want to test my cron job and run it via AOEscheduler I get the following error message via system.log:

2015-06-04T18:01:15+00:00 ERR (3): Warning: include(Mage/Mymodule/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/html/magento/lib/Varien/Autoload.php on line 94

2015-06-04T18:01:15+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Mymodule/Model/Observer.php' for inclusion (include_path='/var/www/html/magento/app/code/local:/var/www/html/magento/app/code/community:/var/www/html/magento/app/code/core:/var/www/html/magento/lib:.:/usr/share/php:/usr/share/pear')  in /var/www/html/magento/lib/Varien/Autoload.php on line 94

As you can see magento is looking for my module in Mage/ instead of Mynamespace/

How can I change it?


texts: How to pull an image being added to cart dynamically

texts:
<?php
$count = $this->helper('checkout/cart')->getSummaryCount();  //get total items in cart
$total = $count > 0 ?  Mage::helper('core')->currency($this->helper('checkout/cart')->getQuote()->getGrandTotal(), true, false) : '$0.00';
$cartUrl = $count > 0 ? Mage::helper('checkout/cart')->getCartUrl() : "#";
$quote = Mage::getSingleton('checkout/session')->getQuote();
$cartItems = $quote->getAllVisibleItems();
?>
<a href="<?php echo $cartUrl ?>" class="dropdown-toggle" data-toggle="dropdown">Cart (<?php echo $count ?>) <?php echo $total ?>
<?php if(!empty($cartItems)): ?>

<?php foreach ($cartItems as $item): ?>

                    <img src="<?php echo $this->getSkinUrl('images/item-cart.png') ?>" class="img-responsive center-block">

<?php echo $item->getName() ?>

<?php echo $item->getQty(); ?> x <?php echo Mage::helper('core')->currency($item->getPrice(), true, false) ?>

                    <a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $item->getId() )); ?>"><?php echo $this->__('Remove Item') ?>

<?php endforeach; ?>

Order Subtotal

                    <?php echo $total ?>

FREE GROUND SHIPPING on JUICERS & BLENDERS »

                <button class="view-shopping-cart menu-cart-btn">View Shopping Cart</button>
                <button class="checkout-cart menu-cart-btn">Checkout</button>

<?php endif; ?>

This is my code. The problem I am having is that I am trying to pull an image from the product that has been added to cart. Here it is just pulling one specific image on my server. How can I make it dynamic?


texts: How we create admin module without using ui component in magento2

texts: As I am new to Magento2, found some difficulties with ui components, May we create admin module without using uicomponents, Share link if you have any.


texts: I need to change the category line color

texts: please see campsalesau.com and on the left side there is a category menu, I need to change the line color between each category from black to grey, please help.


texts: Catalog New Product List Widget should have similar styles from category view

texts:
I'm using Catalog New Product List Widget to display all products on CMS page.

The output is messed up and they don't have filter, different pagination styles, no sorting options like with category view.

Is there any way I could use the same display like Category view.

I'm using RWD Package.

Thank you


texts: Add after method with plugin on underscore methods

texts:
I try to add plugin after a method that start with underscore like this : "_myMethod".

My plugin work, I can add method after normal method, but I can't add my method after the one with " _ " before name.


texts: How to create customer custom Drop Down attributes in magento 2

texts:
Namespace/Module/setup/installData.php

$customerSetup->addAttribute(Customer::ENTITY,'credit_type',
                [
                    'type' => 'int',
                    'label' => 'Credit Type requested',
                    'input' => 'select',
                    'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
                    'required' => false,
                    'default' => '0',
                    'sort_order' => 167,
                    'system' => false,
                    'position' => 167,
                    'adminhtml_only' => 1,
                    'option' =>
                        array (
                            'values' =>
                                array (
                                    271 => 'Credit Card',
                                    272 => 'Paypal',
                                    273 => 'Master Card',
                                    274 => 'Visa',
                                ),
                        ),
                ]
            );
            $myAttribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'credit_type');
            // more used_in_forms ['adminhtml_checkout','adminhtml_customer','adminhtml_customer_address','customer_account_edit','customer_address_edit','customer_register_address']
            $myAttribute->setData(
                'used_in_forms', ['adminhtml_customer', 'customer_account_create','wholesale_account_create', 'customer_account_edit']);
            $myAttribute->save();

  My template.phtml file code:

       <div class="control">
            <select name="mySelect" id="myselect" title="<?= $block->escapeHtml(__('Requested Credit Type')) ?>" class="validate-select">
                <option disabled selected value> -- Please Select Credit Type Requested -- </option>
                <option value="271">Credit Card</option>
                <option value="272">Open Terms</option>
                <option value="273">Mega / NBA</option>
                <option value="274">Cantrex</option>
            </select>
        </div>

Data doesn't store in backend