texts:
I've some code to import some products: if the prodocut is new, I've insert it in the catalog, otherwise, I've to update the product if there are some changes.
Code is the following:

<?php

    include_once('C:/xampp/htdocs/magento/app/Mage.php');

    Mage::app();

    $rootMagento = mage::getBaseDir();
    $files = scandir($rootMagento);
    $count = sizeof($files);
    for ($i =0; $i< $count; $i++) {
        if ($files[$i]=='productData.txt'){
            //$fileAperto = fopen($files[$i], "r");
            $righe = file('productData.txt');
            $countRighe = sizeof($righe);
            for ($ii = 0; $ii < $countRighe; $ii++) {
                list($sku, $name, $description, $shortDescription) = split("[';']", $righe[$ii]);
                if ($sku == '' || $name == '' || $description == ''
                    || $shortDescription == '' ) {
                    mage::log('esportazione non corretta: manca uno dei dati');
                }
                $product_model = mage::getModel('catalog/product');
                $productId = $product_model->getIdBySku($sku);
                if (!$productId){
                    //inserimento
                    $productData = array ('sku' => $sku,
                                          'name' => $name,
                                          'description' => $description,
                                          'short_description' => $shortDescription,
                                          'status' => 1,
                                          'visibility' => 4,
                                          'attribute_set_id' => 10
                                          );

                    $product_model->setData($productData);
                    $qty = 1;
                    try{
                        $productId = $product_model->save()->getId();
                        $product = $product_model->load($productId);
                        $product->setQty($qty);
                        $product->setIsInStock(1); //->isInStock(1)
                        $product->save();

                    }catch(Exception $e){
                        mage::log($e->getMessage());
                    }

                }else{
                    //aggiornamento
                    $product = $product_model->load($productId);
                    $productData = array ('sku' => $sku,
                                          'name' => $name,
                                          'description' => $description,
                                          'short_description' => $shortDescription,
                                          'status' => 1,
                                          'visibility' => 4,
                                          'attribute_set_id' => 10
                                          );
                    $product->setData($productData); // + codice x stock
                    $qty = 1;
                    try{
                        $productId = $product_model->save()->getId();
                        $product = $product_model->load($productId);
                        $product->setQty($qty);
                        $product->setIsInStock(1); //->isInStock(1)
                        $product->save();

                    }catch(Exception $e){
                        mage::log($e->getMessage());
                    }
                }
            }
        }
    }

For the insert it's ok, but for update it doesn't work. Isn't this code correct?


texts:
I tried to change the _theme.xml of a custom theme based on the blank theme like described in this article:
http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css-practice.html

But if I refresh the frontend it doesn't changed. The cache is disabled.

Heres my code:
composer.json

{
"name": "my/blank",
"description": "N/A",
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/theme-frontend-blank": "100.0.*",
    "magento/framework": "100.0.*"
},
"type": "magento2-theme",
"version": "100.0.2",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"autoload": {
    "files": [
        "registration.php"
    ]
}

}

registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/my/blank',
__DIR__

);

theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>My Blank</title>
<parent>Magento/blank</parent>
<media>
    <preview_image>media/preview.jpg</preview_image>
</media>


texts: How to update order grand total via controller in Magento 2.2.2?

texts:
I am trying to update the order's grand total via a controller.

Here is my controller's code:

<?php

namespace Company\Vendor\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;

class Index extends Action
{
    protected $_checkoutSession;

    /**
     * @var \Magento\Quote\Api\CartRepositoryInterface
     */
    protected $_quoteRepository;

    public function __construct(
        Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
    ) {
        parent::__construct($context);
        $this->_checkoutSession = $checkoutSession;
        $this->_quoteRepository = $quoteRepository;
    }

    public function execute()
    {

         $this->_quoteRepository->get($this->_checkoutSession->getQuoteId());

         $quote = $this->_checkoutSession->getQuote();

         $grand_total = $quote->getGrandTotal(); // It contains correct order grand total

         $new_grand_total = $grand_total + 100; // Adding 100 to order total

         $quote->setGrandTotal($new_grand_total);

         $quote->collectTotals();

         $this->_quoteRepository->save($quote);

         echo $quote->getGrandTotal();
    }
}

Above code is not updating the grand total.


texts: Magento 2.3.4 change message text 'sorry no quotes are available for this order at this time'

texts:
My question is identical to this
Magento 2: Sorry, no quotes are available for this order at this time Change Message
but the answer is not correct.

I wish to change the message to something like 'please enter postcode to see rates' I have tried extending Magento_checkout and amending the magento_checkout/web/template/shipping.html file where the message seems to be set and also the cart in magento_checkout/web/template/cart/shipping_rates.html but the standard message stills displays on the frontend.

anyone know how to change it?

Thanks.


texts: exclude country and city, leave only zip code, shopping cart


texts: Magento 2 delete event get product skus using observer

texts:
I need to perform a operation when a product is deleted from admin. So I have created a observer using below code which is working fine.

Vendor/Module/etc/adminhtml/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_delete_after">
        <observer name="test_name" instance="Vendor\Module\Observer\ProductDeleteAfter" />
    </event>
</config>

Vendor\Module\Observer\ProductDeleteAfter.php

<?php

namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class ProductDeleteAfter implements ObserverInterface
{
   /**
     * @var ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_objectManager = $objectManager;
    }

    /**
     * customer register event handler
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $_product = $observer->getProduct();
        $_sku=$_product->getSku();
        die(var_dump($_sku));
    }
}

Here I am getting only last selected product even though when I selected multiple products using checkbox. I want all the selected products Id or sku.


texts: Can I redirect to same domain but different currency?

texts:
I have request like this:

  redirect domainB to domainA --> USD
  redirect domainC to domainA --> EUR

Can I set currency like that? thanks advance!


texts: Use getUrl() in form action in Magento1.9?

texts:
I Want to add some new functionality for magento address book page, I create a Form their, and want to add an action via function like Add New Address Form.

  Step1. : I Create a new function in
   app/code/local/Mage/Customer/Block/Address/Edit.php

public function **getImpAddrURL**()
{
    return Mage::getUrl('customer/address/**importAddr**');
}

  Step2. : Create a New function in Controller app/code/local/Mage/Customer/controllers/AddressController.php

public function importAddrAction()
{
    echo "Hello"; exit;
}

  Step3. : Create a form in Address Book : frontend/theme/mytheme/template/customer/address/book.phtml

<form action="echo $this->getImpAddrURL() ?>">
My Other fields here
</form>

But When I click on submit button I have an URL Like :

http://*******/****/index.php/customer/address/importAddresses/

And 404 Error.

Please Suggest how can I use this.


texts: how to display recently viewed products on homepage in magento 1.9.3.3

texts:
{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}

<?php if ($_products = $this->getRecentlyViewedProducts()): ?>

        <?php echo $this->__('Recently Viewed Products') ?>

        <?php foreach ($_products as $_item): ?>

                <a href="<?php echo $this->getProductUrl($_item) ?>">
                    <img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />

                        <a href="<?php echo $this->getProductUrl($_item) ?>">
                            <?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

        <?php endforeach; ?>

<?php endif; ?>


texts: How to apply tier price with custom option product in Magento 2

texts:
I have a product with more than 5 custom option in Magento and I want to apply tier price rules on a combination of custom option product in the cart.

Ex. I have tier price rules like

Buy 3 for $95.00  each and save 5%
Buy 5 for $90.00  each and save 10%
Buy 10 for $90.00  each and save 10%

and Size is my custom option so
If I add the product with Size 5 with Qty 2 and Size 10 with Qty 1 so my 'Buy 3 for $95.00  each and save 5%' rule is applied to both product.

How can I achieve this in Magento 2?


texts: Magento 2 rest api webapi.xml rules for GET parameters

texts:
http://localhost:8888/rest/all/V1/api/orders/?from=31.05.2020&to=31.06.2020
My webapi xml file is:
<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/api/orders/" method="GET">
        <service class="Lovat\Api\Api\OrdersRepositoryInterface"
                 method="get"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

Is it possible to add from and to parameters to this route?


texts: Magento 2: How to Improve Code In Magento (PHP)?

texts:
I'm new to Magento just, I'm working on an event I call many files through object manager, but I know that's not a good way, I have a chunk of code just need to know how can I improve it.

  CustomerAddress\Attribute\Observer

<?php
namespace CustomerAddress\Attribute\Observer;

use Magento\Framework\Event\ObserverInterface;

class AfterPlaceObserver implements ObserverInterface
{
    protected $addressRepository;

    protected $addressFactory;

    protected $checkoutSession;

    protected $orderFactory;

    protected $jsonHelper;

    public function __construct(
        \Magento\Customer\Api\AddressRepositoryInterface $addressRepository,
        \Magento\Customer\Model\AddressFactory $addressFactory,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Sales\Model\OrderFactory $orderFactory,
        \Magento\Framework\Json\Helper\Data $jsonHelper
    ) {
        $this->addressRepository = $addressRepository;
        $this->addressFactory = $addressFactory;
        $this->checkoutSession = $checkoutSession;
        $this->orderFactory = $orderFactory;
        $this->jsonHelper = $jsonHelper;
    }

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

        $objectManager          = \Magento\Framework\App\ObjectManager::getInstance();
        // $addressRepository      = $objectManager->create('\Magento\Customer\Api\AddressRepositoryInterface');
        // $addressFactory         = $objectManager->create('\Magento\Customer\Model\AddressFactory');
        // $checkoutSession        = $objectManager->create('\Magento\Checkout\Model\Session');
        // $orderFactory           = $objectManager->create('\Magento\Sales\Model\OrderFactory');
        // $jsonHelper             = $objectManager->create('\Magento\Framework\Json\Helper\Data');

        $orderIncrementId       = $checkoutSession->getLastRealOrderId();
        $orderInfo              = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderIncrementId);

        $bssCustomfield         = $orderInfo->getBssCustomfield();
        $jsonBssCustomfield     = $jsonHelper->jsonDecode($bssCustomfield);
        $jsonTaxExemptNumber    = $jsonBssCustomfield['tax_exempt_number']['value'];

        $addressRepository      = $objectManager->create('\Magento\Customer\Api\AddressRepositoryInterface');
        $addressObject          = $addressRepository->getById($orderInfo->getShippingAddress()->getCustomerAddressId());
        $addressObject->setCustomAttribute('customer_tax_exempt_number', $jsonTaxExemptNumber);
        $addressRepository->save($addressObject);
    }

}


texts: How to add Additonal charge on COD in magento 2

texts: Hi i am looking to add an extra field here in cod and also i want to charge extra 100 rs/- handling fee but dont know how to achieve this anyone had ever tried this kindly please provide some solution on how to achieve this


texts: Custom router in Magento-2(SCO Friendly URL)

texts:
Anyone knows an alternative way to implement Fancy URL(This won't affect url_rewrite table entries) for Magento 2, as we had for Magento 1 as mentioned here:  http://excellencemagentoblog.com/blog/2011/10/29/simple-url-rewrite-using-magento-xml/

  I need to inject product SKU this way: http://example.com/book/sku/xyz
  I've implemented it in one of my Magento 1 project using Fancy URL concept, but couldn't find an alternative for Magento 2. Your help would be appreciated.


texts: After deleting my table I changed in MySQL query then again is not creating table

texts: I have created table then I deleted it and then after changing in my sql query, my module is not creating table. What to do?


texts: How to know in magento 2, command to get cache information?

texts: What command would we use to get the cache status that is to know which caches are enabled or disabled in Magento 2?


texts:
If you have 2 categories a product needs to be in and the category is over 100 - you get a value that looks like this "100,101"

The problem is excel automatically reads this as a number and you cant change it so when you update the CSV it breaks.

Does anyone know how to solve this issue?


texts: I am looking for Greek language package for version CE 1.9.0.1. Does anyone have an idea where I can get the language packs I need?


texts: Magento 2: wrong permission generate in generated folder

texts:
when i execute setup:upgrade command then some file is generated in generated/ folder.
after i have execute chmod -R 777 /generated command
but when i check in some admin page like : Product grid page then it will showing below error :

Class Magento\Catalog\Model\View\Asset\ImageFactory does not exist

so i need to go into this directory

generated/code/Magento/Catalog/Model/View/Asset

and when i check this folder permission then it will showing 775 so i need to change permission 777 into Asset folder so then it will working fine.

so what is solution to every time update folder permission ?
any idea please share.


texts: Magento multiple order on one checkout or order splitting

texts: Store products are supplied from different vendors. It is required to create multiple order for every vendor based on its products in the cart during one checkout. Is there any extension to achieve this task or should I start to develop custom checkout module. What about hot points for creating such extension vision of experienced developers of Magento? Can you explain me brief checkout flow architecture Magento friendly (as possible as code level)? Thanks much more!


texts: how can i fix the error (#11601: Request for billing address failed) of paypal

texts:
I am using magento 1.9 during the setup of paypal at store i am getting an error
Billing address request is not enabled for merchant (#11601: Request for billing address failed).###
I am stuck on this and i have tried every thing. so please any one can help me in this problem


texts:
How to Override Config.xml  I added New Order status in this location

app/code/core/Mage/Sales/etc/config.xml

it's not good to edit core file

<invoice translate="label">
                        <label>invoice</label>
                        <statuses>
                            <pending default="1"/>
                        </statuses>
                        <visible_on_front>1</visible_on_front>
                    </invoice>


texts: Magento 2.3.1 - PayPal Payments always show as Suspected Fraud Status

texts:
we are facing a strange behavior.

We are working with a Magento 2.3.1 version and the PayPal Module, which is pre-installed.

All works well, customers can pay via PayPal but every order paid via PayPal gets the status "Suspected Fraud".

We only work with 1 basec currency = EUR.

Does anybody maybe have an idea, how to solve this?


texts: Save Config button isn't working in System > Configuration > Catalog

texts:
My recently viewed product is not displaying anything, so I am trying to change my Recently Viewed "Show for current" settings from Website to Store to see if that will make it work.

Problem: When I click Save Config after making changes in System > Configuration > Catalog nothing happens.

The Save Config button works everywhere else within the site. The console in Chrome only shows a warning that doesn't seem to be triggered by the Save Config: event.returnValue is deprecated. Please use the standard event.preventDefault() instead.


texts: Magento 2 Product Images / Add to Cart / Variations not Loading

texts:
I had tried to install a new extension. And in the set up it told me to disable the cache. Which i did.

I installed it and it seemed like everything was ok (loading slow) but the following issues occured.

  Images on Product View Page were not showing
  Configurations on Product View Page were not showing
  Add to cart would hang (run ajax symbol indefinitely)
  Description / More Information text was merged.

I uninstalled the app. Through SSH deleted the files ran setup / compile / cleared cache / reindexed / deployed static content /Re Enabled Cache. All of which completed successfully.

I don't know where to check for errors. If someone can please help.


texts: Get list of modules called at order success page - M2

texts:
Place order is working good but after place order page redirect to cart page.
I have put log in success.phtml file and found that success.phtml file is called.
But I don't know why it's redirect to empty cart page. This issue is occurring some random time.
So i want to know the list of modules called at success page, maybe some custom module creating issue with session.
Can anyone help me to get list of modules called at success page?
File: vendor\magento\module-checkout\Controller\Onepage\Success.php
There is some issue with session : if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid())
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Checkout\Controller\Onepage;

use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;

/**
 * Onepage checkout success controller class
 */
class Success extends \Magento\Checkout\Controller\Onepage implements HttpGetActionInterface
{
    /**
     * Order success action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $session = $this->getOnepage()->getCheckout();
            $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/cart_redirect.log');
            $logger = new \Zend\Log\Logger();
            $logger->addWriter($writer);
            $logger->info("Reached Controller/Onepage/Success.php to redirect on cart. Last placed OrderId: ".$session->getLastOrderId());

        if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
            $logger->info("Before Redirect from Controller/Onepage/Success.php to redirect on cart. Last placed OrderId: ".$session->getLastOrderId());
            return $this->resultRedirectFactory->create()->setPath('checkout/cart');
        }
        $session->clearQuote();
        //@todo: Refactor it to match CQRS
        $resultPage = $this->resultPageFactory->create();
        $this->_eventManager->dispatch(
            'checkout_onepage_controller_success_action',
            [
                'order_ids' => [$session->getLastOrderId()],
                'order' => $session->getLastRealOrder()
            ]
        );
        return $resultPage;
    }
}

Thanks.


texts:
Maganto1.x have code below code  to assign multiple productIds to multiple websites.

Mage::getModel('catalog/product_website')->addProducts($websiteIds, $productIds)

In magento2, How do get same result?


texts: Get current seller id by product id in magento 2 marketplace

texts:
I am trying to get current seller id by product id in magento 2.
I am try this also but its not useful for me.

public function getMy(){

if(Mage::getSingleton('customer/session')->isLoggedIn()) {
         $customerData = Mage::getSingleton('customer/session')->getCustomer();
          $seller_id= $customerData->getId();
     }
        $collection = Mage::getResourceModel('catalog/product_collection');
        $collection->addAttributeToFilter('status',1); //only enabled product
        $collection->addAttributeToSelect('*'); //add product attribute to be fetched
        $collection->getSelect()->order('rand()');
        $collection->getSelect()->limit(5);
        $collection->addAttributeToFilter($seller_id);
        $collection->addStoreFilter();
        return $collection;

    }

I also try this

$collection = $objectManager->create(
                        'Webkul\Marketplace\Model\Product'
                    )
                    ->getCollection()
                    ->addFieldToFilter(
                        'mageproduct_id',
                        $id
                    );

Please help me..


texts: Image changes back after selecting size swatch

texts:
I am experiencing the following issue with swatches;

I have 3 swatches: Colour, Size, Length. I have set up the colour swatch to change to the photo related to it but whenever I select a size/length after that, the image will change back to the initial photo. Is there any way to prevent this, so the image stays the same?

An example can be found here; http://www.neflyx-webshop.com/nieuweshop/index.php/dames/dream/mac-broek-dream-skinny-authentic.html

Thanks!


texts: Fatal error: Uncaught Error: Cannot instantiate abstract class Magento\Framework\Model\ResourceModel\AbstractResource in ....\Dynamic\Developer.php:50

texts:
I have faced below error after upgrade, deploy and compile commands. After logging from magento2 backend in dashboard it's throwing the error. here Developer mode is enabled.

Fatal error: Uncaught Error: Cannot instantiate abstract class
Magento\Framework\Model\ResourceModel\AbstractResource in
vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:50
Stack trace: #0
vendor\magento\framework\ObjectManager\ObjectManager.php(70):
Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#1 vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(167):
Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#2 vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(273):
Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array,
'Magento\Framewo...', NULL, 'resource', 'Arguements\...') #3
vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(236):
Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolv in
vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php
on line 50


texts:
I tried to install MailChimp module for Magento 2.

After I put all the files in the app/code/[vendor]/[module] and I run php bin/magento setup:upgrade, I received this error:

  [ReflectionException]
  Class Mailchimp does not exist

I tried with several version and for all of them, I received the same thing.

I got the extension from https://marketplace.magento.com/. So I think this should work fine.

Does anyone know how can I solve this issue?


texts: magento 2.4 sample-date download problem ,Invalid credentials for 'https://repo.magento.com/packages.json', aborting

texts: 2.4 there is one code generator on my Magento account under token access key, how can i used them with MGID to deploy sample-data for user name and password ??


texts: When overriding a community extension should I use the original namespace or my own?

texts:
We work with a large number of community extensions and frequently override their behavior with small extensions of my own.  So far I've been using a naming convention of app/code/local/{MyCompany}_{OriginalnamespaceModulename} for my overrides, which is useful for clearly putting our modifications in one location.

However, I've also frequently seen where the original namespace and module name are re-used (e.g. the original module is app/code/community/{Namespace}_{Modulename} so the overriding extension is named app/code/local/{Namespace}_{Modulename}.  This seems intuitive; except for when 3rd party extensions want to be installed to the local codepool.  In our case we do have a fair number of 3rd party extensions in local, making it a bit of a goose chase to check if they are a "full" extension or just there for overriding a community extenion.

So what's the best practice?  Is there anything wrong with my format of {MyCompany}_{OriginalnamespaceModulename}?


texts: getPrice() fatal error in magento customs product

texts:
when i tried to get the price attribute for the customs product type fatal error is displaying

$_product->getPrice();

Fatal error: Call to a member function getPrice() on a non-object in /opt/lampp/htdocs/SVE279/app/code/core/Mage/Catalog/Model/Product.php on line 211

when it checked in the core file i found this

public function getPriceModel()
{
return Mage::getSingleton(‘catalog/product_type’)->priceFactory($this->getTypeId());
}

so the problem is with our customs product type any solution or fix for this problem


texts: If SSL is active on front end error on checkout page 'block loading mixed active content'

texts:
If I activate SSL and then on checkout I got error for prototype!

Block loading mixed active content


texts:
I want to change the URL slug of my store wishlist page to saved-items.

  https://themeforest.net/item/cendo-responsive-magento-furniture-theme/12256163

I had successfully changed the contents into wishlist page. But having trouble while changing the URL slug from wishlist to saved-items. I am using magento "Version 2.1.0.1".

I am using Cendo Magento Theme. Can anyone tell me that how i can change it?


texts: Show image configurable product when search by size

texts:
When I search one product and filter by size in the search... the result not show the image of the product. So ¿its mandatory to add image for all size of product?
What can I do so that when an article is searched for its size, the image of the article appears in the result, without having to upload the image of the same article for each size of the article?
Thank you.


texts: Two Magento stores put one of them under maintenace

texts: I have a Magento installation with two domains, domain1.com and domain2.com, domain1.com is the primary domain and I would like to put it under maintenance without affecting domain2.com


texts:
I got a theme installed and it works just fine, except when i try to see a product, every time I get this error that you can see here http://bit.ly/2dqrlIh
My knowledge in PHP are minimum and I don't really know what am I looking for in the phtml file

Thanks in advance for any help you can give me.


texts:
I have 6% and 0% tax zones.

And I have the following settings:

  Stores > settings > configuration > Sales > Tax

  Calculation Settings > Tax Calculation Method Based On > Total

  Calculation Settings > Tax Calculation Based On > Shipping Address

  Calculation Settings > Catalog Prices > Including Tax

  Calculation Settings > Apply Tax On > Original Price Only

Now, I have a perfume product with an original price of 17. Whenever I set my shipping address to trigger 6% tax, it calculates fine:

Original Price: 17
Price: 16.04
Tax Percent: 6%
Tax Amount: 0.96
Total: 17

But whenever I set my shipping address to trigger 0% tax, calculation is not I expected it to be:

Original Price: 17
Price 16.04
Tax Amount 0
Tax Percent 0%
Total 16.04

Here's what I want whenever I trigger 0% tax:

Original Price: 17
Price 17
Tax Amount 0
Tax Percent 0%
Total 17

Is there a way I can do this setting on Magento v2.1.2?


texts: Find Magento 2 API Username to use in Paypal

texts:
I have set up my Magento E-commerce website. I have a Paypal Business account but in the moment when configuring Paypal it says:

Where is Magento 2 can I find or make this username? All I have been able to find are the API settings Paypal gives, which is fine but now I need Paypal to accept my website.


texts: "There has been an error processing your request" after clicking manage categories

texts: I am getting this error when I click on manage categories in admin and when i checked the var/report, I got this. I have already deleted my previous theme "eclipse" but i think it's still messing up with the database. Need help


texts: Cannot switch Magento2 back to production mode

texts:
I am trying to switch a Magento2 app from developer mode to production mode. When I run the console command, I get error: ltrim() expects parameter 1 to be string, object given

Full output below:

$ php bin/magento deploy:mode:set production
Enabled maintenance mode
Static content deployment start
ltrim() expects parameter 1 to be string, object given

How do I suppress this error?

UPDATE 1:

After a while, I am getting the following response:

$ php bin/magento deploy:mode:set production
Enabled maintenance mode
Static content deployment start
Requested languages: en_US
=== frontend -> Magento/blank -> en_US ===
.........................................................................
Successful: 1965 files; errors: 0
---

=== frontend -> Magento/luma -> en_US ===
.........................................................................
Successful: 2038 files; errors: 0
---

=== frontend -> MyVendor/MyTheme -> en_US ===
.........................................................................
Successful: 1971 files; errors: 0
---

=== adminhtml -> Magento/backend -> en_US ===
.........................................................................
Successful: 1843 files; errors: 0
---

=== Minify templates ===
.........................................................................
Successful: 854 files modified
---

New version of deployed files: 1466727090
Static content deployment complete
Start compilation
Command returned non-zero exit code:
`php -f /var/www/html/staging/bin/magento setup:di:compile-multi-tenant 2>&1`

UPDATE 2:

As suggested in comments, I ran setup:di:compile-multi-tenant command and got following response:

$ php -f /var/www/html/staging/bin/magento setup:di:compile-multi-tenant -vvv

  [ReflectionException]
  Class \MyVendor\MyModule\Block\Main does not exist

Exception trace:
 () at /var/www/html/staging/setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php:173
 ReflectionClass->__construct() at /var/www/html/staging/setup/src/Magento/Setup/Module/Di/Code/Scanner/PhpScanner.php:173
 Magento\Setup\Module\Di\Code\Scanner\PhpScanner->collectEntities() at /var/www/html/staging/setup/src/Magento/Setup/Module/Di/Code/Scanner/CompositeScanner.php:40
 Magento\Setup\Module\Di\Code\Scanner\CompositeScanner->collectEntities() at /var/www/html/staging/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php:273
 Magento\Setup\Console\Command\DiCompileMultiTenantCommand->generateCode() at /var/www/html/staging/setup/src/Magento/Setup/Console/Command/DiCompileMultiTenantCommand.php:226
 Magento\Setup\Console\Command\DiCompileMultiTenantCommand->execute() at /var/www/html/staging/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /var/www/html/staging/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/staging/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /var/www/html/staging/vendor/magento/framework/Console/Cli.php:49
 Magento\Framework\Console\Cli->doRun() at /var/www/html/staging/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /var/www/html/staging/bin/magento:25

However, I do not need class \MyVendor\MyModule\Block\Main for MyModule to work. Shall I just put an empty class there?


texts:
I've always been using Apache with MAMP successfully, and now I need to tinker around setting up multi-stores with subdirectories in an Nginx environment.

I'm following pretty much the vanilla configurations using "TCP connection upstream fastcgi_backend". I actually don't understand what this means. Magento provides a snippet of configs like this.

upstream fastcgi_backend {
    server  127.0.0.1:9000;
}
server {
    listen 80;
    server_name mage.dev;
    set $MAGE_ROOT /var/www/magento2;
    include /path/to/magento2/nginx.conf;
}

/path/to/magento2/nginx.conf has:

location ~ (index|get|static|report|404|503)\.php$ {
    fastcgi_pass   fastcgi_backend;
}

However, when I try to access mage.dev, I get a 502 bad gateway response with the following error.

  *7 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream

I'm reading that I need to "start php-fpm", but what does that mean? I have Nginx and MySQL started already. What else do I need to configure? Do I need to install php-fpm installed on my system separately?


texts: Magento 1.9 wysiwyg editor maxlength issue

texts:
In Magento 1.9.2, I have used wysiwyg editor in my module and it  is working fine. But they have Maxlength='300'. I want to increase/remove mexlength.
Please suggest me how can i solve this issue.

$fieldset->addField('description', 'editor', array(
            'label' => Mage::helper('jobboard')->__('Description'),
            'class' => 'required-entry',
            'name' => 'description',
            'style'     => 'width:700px; height:500px;',
            'required' => true,
            'maxlength' => 10000,
            'config'    => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
            'wysiwyg'   => true,
        ));

Thank you


texts: Multi-Store with multi-domain and sub-directory Setup - Symlinks

texts:
We have a multistore setup correctly, however I need to assign correct urls via symlinks.

Default Store: example.co.uk
Language Page: example.com
USA Store: example.com/us/

Under the root .htaccess I have the following:

SetEnvIf Host www\.example\.com/us/ MAGE_RUN_CODE=us_en
SetEnvIf Host www\.example\.com/us/ MAGE_RUN_TYPE=store
SetEnvIf Host ^example\.com/us/ MAGE_RUN_CODE=us_en
SetEnvIf Host ^example\.com/us/ MAGE_RUN_TYPE=store

I have also created a directory '/us/' and within I have index.php and .htaccess.

$compilerConfig = '../includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = '../app/Mage.php';
$maintenanceFile = '../maintenance.flag';
$ip = $_SERVER['REMOTE_ADDR'];

$mageRunCode = 'us';
$mageRunType = 'store';

Mage::run($mageRunCode, $mageRunType);
}

What the website is missing is the content images, css and js, I have seen that this can be achieved via symlinks now how do I go about creating that for .com/us/ folder. Please note that the root dir is:

/home/example/public_html/


texts: Magento 2.3.3 : Triggering error report.php / report.phtml

texts:
I need to test the customization of the pub\errors\default\report.phtml template. I need ways to trigger the report error and land on report.phtml page.
I found other posts where we can trigger 404, 503, 500 but not report error.


texts: Shipping Method list by group at checkout page

texts:
Can anyone help me to show shipping methods by group as it showing at cart page.

Cart Page:

Checkout Page:


texts: Export Files Taking Too much Time Magento 1.9.2.3

texts:
I have installed magento 1.9.2.3. When i am going to export our order as csv its taking too much time and request time out error.

I also increase the limit of following options:

max_execution_time = 18000
max_input_time = 6000
max_input_vars = 10000
memory_limit = 1024M

but it still not export the file.

when i search the order number and try to export it than it export the file.

can someone let me know what is the issue?


texts: Magento 2 Blank Theme: How to reduce the height of Navigation, header and top links?

texts:
I want to reduce the height of the top sections (navigation, logo, search and top links) in the default Magento Blank theme but I cannot figure out how to do this.

I have created _extend.less and _navigation_extend.less in theme/web/css/source

In _extend.less:

@import '_navigation_extend.less';

In _navigation_extend.less I have tried many variations on code, I can get the coloured bar to be smaller with the following but the text remains the same height:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {

.navigation {
    height: 30px;
}

}

The text in the navigation bar still stays at 53px no matter what I do. I think it's linked to the ul but I've tried various versions of the following but I can't get it smaller:

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {

.navigation {
    height: 30px;
}

.ul {
    margin: 0;
}

}

Can anyone help me reduce the depth of these three sections? (I appreciate I haven't shown what I have done so far for the other two sections but help would be appreciated)


texts: which changes do from live server to localhost in magento 2?

texts:
I changed in core_config_data value to "localhost" but it returns  Not Found
The requested URL /magento_store/localhost/ was not found on this server.
also i changed in env file but again i face that problem.please explain which changes i do from transfering live server to localhost


texts: How to create product attribute group programatically in Magento 2 issue?

texts:
I would like to create 3 attribute sets and one attribute group assigned to the attributes sets created via the InstallData.
This is my InstallData content:
<?php
namespace Vendor\ModuleName\Setup;

use Magento\Catalog\Model\Product;
use Magento\Catalog\Setup\CategorySetupFactory;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Eav\Setup\EavSetupFactory;
use Exception;

class InstallData implements InstallDataInterface
{
    private $attributeSetFactory;
    private $categorySetupFactory;
    private $eavSetupFactory;

    public function __construct(
        AttributeSetFactory $attributeSetFactory,
        CategorySetupFactory $categorySetupFactory,
        EavSetupFactory $eavSetupFactory
    ) {
        $this->attributeSetFactory = $attributeSetFactory;
        $this->categorySetupFactory = $categorySetupFactory;
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $this->createAttributeSets($setup, 'Attr Set 1');
        $this->createAttributeSets($setup, 'Attr Set 2');
        $this->createAttributeSets($setup, 'Attr Set 3');

        $this->createAttributeSetGroup('Attr Set 1');
        $this->createAttributeSetGroup('Attr Set 2');
        $this->createAttributeSetGroup('Attr Set 3');
    }

    private function createAttributeSets($setup, $attributeSetName)
    {
        $setup->startSetup();
        $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
        $attributeSet = $this->attributeSetFactory->create();
        $entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY);
        $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId); // Default attribute set Id

        $data = [
            'attribute_set_name' => $attributeSetName, //attribute set name
            'entity_type_id' => $entityTypeId,
            'sort_order' => 50,
        ];
        $attributeSet->setData($data);
        $attributeSet->validate();
        $attributeSet->save();
        $attributeSet->initFromSkeleton($attributeSetId)->save(); // based on default attribute set
    }

    private function createAttributeSetGroup($attributeGroupSet)
    {
        $attributeSet = 'Attributes'; // my attribute group name
        $eavSetup = $this->eavSetupFactory->create();
        $entityTypeId = $eavSetup->getEntityTypeId(Product::ENTITY);
        $attributeSet = $eavSetup->getAttributeSet($entityTypeId, $attributeSet);

        if (isset($attributeSet['attribute_set_id'])) {
            $eavSetup->addAttributeGroup(
                $entityTypeId,
                $attributeSet['attribute_set_id'],
                $attributeGroupSet,
                100
            );
        }
    }
}

By doing a setup upgrade. I have the attribute sets, but the group is missing. I would like to have it displayed, like in the img below:

Please tell me , what I am doing wrong :)  Thank you in advance!


texts: Mass update customer attribute programatically in a single query

texts:
I've created a custom customer attribute via install script.
Now I would like to bulk update this attribute for batches of customers programmatically. Preferably in a single query (using foreach would be inefficient).
If I understand this correctly in case of products there's Magento\Catalog\Model\ResourceModel\ProductAction, but there is no customer equivalent for this.


texts: Magento custom form with module Step By step by step

texts:
I am new in this field...

and I want to learn...

Please help me how to create simple form in Magento 2.0.


texts: How to change home page meta title in magento 2.3?

texts: How to change meta title in magento2.3? I am not able to find the title of the home page.


texts: How to call magento2 SOAP or REST API outside magento2?

texts:
I am using below code to call the API but its showing error:

$request = new SoapClient(
    'http://magento2-dev.local/index.php/soap/? wsdl&services=foggylineSliderSlideRepositoryV1',
    array(
        'soap_version' => SOAP_1_2,
        'stream_context' => stream_context_create(array(
                'http' => array(
                    'header' => 'Authorization: Bearer pk8h93nq9cevaw55bohkjbp0o7kpl4d3'
                )
            )
        )
    )
);
$response = $request->foggylineSliderSlideRepositoryV1GetById(array('slideId' => 1));
var_dump($response);


texts: Show category dropdown selected in admin edit form

texts:
I have added a category selector in my custom admin form using ui component
I want to show the selected category as selected or highlighted in my edit form how can I do that?
the category selector looks as


texts:
I mass import products into my site on a nightly basis (affiliate products). Occasionally the products are duplicated so I want to write a quick SQL Statement to remove the duplicated products.

What I will then do is put the SQL into a PHP script and call it each night after the import so it will remove the duplicated products before I reindex.

I've done some research and found come up with the following script to get all of the product names from the database:

SELECT `value` AS product_nameFROM catalog_product_entity_varchar WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product') AND attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product'))

I have also found this example script to identify duplicates in SQL:

`SELECT name, email, COUNT(*) FROM users GROUP BY name, email HAVING COUNT(*) >` 1

I wondered if someone could help me put this together?

Thanks in advance!
Chris


texts: Images invisible on catalog page upon resizing images in view.xml

texts:
I have changed the size of image in view.xml as

 <?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">

    <media>
        <images module="Magento_Catalog">
            <image id="category_page_grid" type="small_image">
                <width>165</width>
                <height>186</height>
            </image>
            <image id="category_page_list" type="small_image">
                <width>165</width>
                <height>186</height>
            </image>
        </images>
    </media>

in my mobile theme.

After this, I flushed the cache and upgraded it but the resulted as


texts: magento multistore products import from another store

texts: There are two stores in my magento website. One is English and Another is  German. There are categories and products in English Store. I want all those same products to be shown in German with same categories but when I use the English Default Root Category for my German Store, it does not show my theme. So I have created two different root categories but the categories and products for both stores are same. What should I do?


texts: Catalog Price Rule "is one of" Multiple SKU problem - Enterprise 1.13.0.2

texts:
ok a bit of a weird one.

We recently moved from 1.4 CE to Enterprise 1.13.0.2

So we have a bunch of products i.e end of line items in different categories that we want to recude by SKU - seems simple enough and this way worked in CE edition using same data.

So catalog price rule condition

If ANY of these conditions are TRUE
SKU IS ONE OF xxxx, xxxxx, xxxx,

the discount is percentage of original price.

Now the issue seems to be when more than 1 SKU is selected. When it is just 1 sku the discount works and displayed fine.

I have checked the ensure there are no invisible spaces in the SKU as have heard this could cause an issue., have also tried changing ANY to ALL with no improvement.

Any ideas?


texts: Change order status using cron job in command line

texts:
I need to change order status using cron(in my local progect)
I know only this command

php cron.php -m default

Where cron.php in root of magento
What next? Please help me, I have not worked with cron tab yet.


texts: In Custom table always create a new row in magento 2?

texts:
I have created a custom table and update data using model and resource model.
But it always create a new row on hitting ajax how to update row as old data is appear.
I think i want to use Update query instead of insert but not have idea where should i change.
My controller file is
<?php
namespace Tym17\AdminSample\Controller\Index;
use Magento\Framework\App\Action\Context;
use Tym17\AdminSample\Model\ReviewsFactory;
class Index extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
protected $reviews;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    ReviewsFactory $reviews,
    \Magento\Framework\View\Result\PageFactory $pageFactory)
{
    $this->_pageFactory = $pageFactory;
    $this->reviews = $reviews;
    return parent::__construct($context);
}

public function execute()
{

    $data = $this->getRequest()->getParams();
    $reviews = $this->reviews->create();
    $reviews->setData('orderid', $data['order_id']);
    $reviews->setData('status', $data['payment_status']);
    if ($reviews->save()) {
        $this->messageManager->addSuccessMessage(__('You saved review'));
    } else {
        $this->messageManager->addErrorMessage(__('Review was not saved.'));
    }
}

}
My model file path ( app/code/Tym17/AdminSample/Model/ResourceModel/Reviews.php )
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Tym17\AdminSample\Model\ResourceModel;

class Reviews extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
public function _construct()
{
    $this->_init('status', 'id');
}
}


texts: [ERROR]: Record structure does not contain field image | Data Migration

texts:
I'm having issues using the data migration tool ver: 2.2.6.
settings migrate successfully but when i run this command (data)

php bin/magento migrate:data --reset -a -r vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.8/config.xml

I get the following error

ERROR]: Record structure does not contain field image

I have tried to ignore in map-eav.xml but still no use

see my config if it helps


texts: Attach file to transactional email in 1.9.3.4

texts:
Looking to change the 1.9.3.4 email system to allow for adding attachments.

Due to the nature of the attachment (dynamically generated PDF based on a variety of things, from customers/orders/3rd party) I would like to attach the PDF in this function:

queueNewOrderEmail

in this file:

/app/code/local/Mage/Sales/Model/Order.php

The changes to the email system in recent versions make finding info online extremely difficult.

It looks as though I should be creating the Zend attachment function in here:

/app/code/local/Mage/Core/Model/Email/Template.php

However, it looks as though the email queue system will ignore that.

This seems like it should be a quick and easy task, but I'm absolutely stumped at this point.


texts: Magento 2.3.0 disable module output not working

texts:
I tried to disable the module output for reviews (by changing my configuration), I now have the following (removed other configuration settings):

'websites' => [
    'base' => [
        'advanced' => [
            'modules_disable_output' => [
                'Magento_Review' => '1',
            ],
        ],
    ],
],

Which according to the docs should disable the reviews but when looking at the product page the reviews tab is still active?
I tried flushing all caches, executed bin/magento setup:di:compile but obviously I am doing something wrong but I can't seem to find out what I'm missing here.


texts: How to set cron job periodically in magento?

texts:
I have below cron job code. Currently, it is running for every 30 minutes.

<job name="customer_details" instance="my_file_name" method="my_method">
  <schedule>*/30 * * * *</schedule>
</job>

I want my cron job should run daily at 10:30 PM to generate the csv related to customer details based on some criteria.

What should be the value inside <schedule> * * * * * </schedule>


texts: Magento 2 - As Low As Value on List Pages VAT Shown Twice

texts:
On my category pages, for tier priced products the tax is added twice to the add low as price:

This file: /vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml uses the function renderAmountMinimal() from block \Magento\Catalog\Pricing\Render\FinalPriceBox. to return the values:

public function renderAmountMinimal()
{
    $id = $this->getPriceId() ? $this->getPriceId() : 'product-minimal-price-' . $this->getSaleableItem()->getId();

    $amount = $this->minimalPriceCalculator->getAmount($this->getSaleableItem());

    if ($amount === null) {
        return '';
    }

    return $this->renderAmount(
        $amount,
        [
            'display_label'     => __('As low as'),
            'price_id'          => $id,
            'include_container' => false,
            'skip_adjustments' => true
        ]
    );
}

Looking at the object returned in $amount the amount does seem to have added my tax twice before this object is created.

The product pages however show the amounts correctly its just category pages they seem to be wrong for some reason.


texts:
I am using magento 1.7 version for my store. Its worked fine . But from last 2 months its detected malware in site. When ever i browse any link open 4 popup with junk site.
I have externally scanned my site via Foreginx , and they detect malware in my site www.coralconcept.in . I replaced current file system with previous file system which were working fine , but still i face the same scenario. I am attaching the report with this mail. Foreginx suggest me to upgrade the magento version. Will this fix this issue? If so then  how can i update my site magento version without negative impact?

I can not figure out the actual effected files . I never include direct JS / JQUERY files link in magento files. Foreginx also detect malware like onepage checkout , customer accout  etc. pages . Please help me out from this very uncomfortable condition ASAP.

Please see the attached scan report & suggest me what to do.

Thanks in advance


texts: In config.xml file layout file is not working

texts:
I have Config.xml file

<frontend>
        <routers>
            <blog>
                <use>standard</use>
                <args>
                    <module>AW_Blog</module>
                    <frontName>blog</frontName>
                </args>
            </blog>
        </routers>
        <layout>
            <updates>
                <blog module="AW_Blog">
                    <file>aw_blog.xml</file>
                </blog>
            </updates>
        </layout>
        <translate>
            <modules>
                <AW_Blog>
                    <files>
                        <default>AW_Blog.csv</default>
                    </files>
                </AW_Blog>
            </modules>
        </translate>
    </frontend>

In this Layout file not working "aw_blog.xml"

  <layout>
                <updates>
                    <blog module="AW_Blog">
                        <file>aw_blog.xml</file>
                    </blog>
                </updates>
            </layout>

Please check what is issue ?.

Thanks,


texts: Redirect from around plugin in Magento 2

texts: How to redirect from around plugin to another page with an error ?


texts: How to solve the issue "sku needs to be under 64 symbols"?

texts: I'm receiving this error message below, my SKU has more than 64 symbols, but why does it happening?


texts: Magento2 Tax not displaying in Cart Page

texts: I am using Tax rule for some Countries, Tax rate is displaying fine in Checkout page but in Cart page, it is not displaying. I am using Custom Theme.


texts: Can I use URL parameters as a promotion rule condition?

texts:
I'm wondering if anyone has any idea if and how I could use dynamic URL values (such as a tracking parameter) in a promotional rule condition? I've been browsing for an extension but no luck so far.

I'm running Magento Enterprise 1.14.0.1

Example: I have an e-mail campaign for product X and would like to give only people who arrive to the site via e-mail a 20% discount. I have CEX tracking parameter for each e-mail campaign and it's unique.

Is there an extension or some way how I could add CEX = xyz as a promotion rule condition?

I initially thought that's what Magento Enterprise OOTB "URL key contains" condition would do, but then realized it only reads the actual product URL key stored in Magento.

Thanks!


texts:
I want/need to overwrite a core cronjob (app/code/core/Mage/Sitemap/Model/Observer.php).
For some reason cronjobs, which are stored in core_config_data, don't get triggered. So I was thinking to trigger it with my own extension (temporarily). Is this possible?
It looks like Magento doesn't find the module Mage/sitemap and is looking in my own extension for the model/observer. Thank you!

Core config.xml

<crontab>
    <jobs>
        <sitemap_generate>
            <run>
                <model>sitemap/observer::scheduledGenerateSitemaps</model>
            </run>
        </sitemap_generate>
    </jobs>
</crontab>

My_module config.xml

<crontab>
<jobs>
   <sitemap_generate>
      <module_name>
        <schedule>
            <cron_expr>0 3 * * *</cron_expr>
        </schedule>
        <run>
            <model>sitemap/observer::scheduledGenerateSitemaps</model>
        </run>
      </module_name>
   <sitemap_generate>
</jobs>


texts: create invoice module same as Admin side in magneto 2

texts: How to Create an invoice module the same as the Admin side in Magento 2?


texts: Get params from URI (edit admin grid form) exists but returns empty values

texts:
My URI when I click edit on any admin grid rows

  http://localhost/magento_1.11/index.php/admin/index/edit/entitiy_id/2/key/012d8de26b4b3f5718c3d5267cdd6c97dfba9f67ebc2c75774a632c4887d833c/

And in my edit action I am trying to access it with

$id = Mage::app()->getRequest()->getParam('entity_id');

echo $id; // returns empty :(

But it is returning empty values always, what I am doing wrong here?


texts: How to remove special characters in a dropdown menu in product view page?

texts:
I am using a dropdown attribute but it is displaying special characters.

Can you please give me a solution for removing special characters in dropdown menu.

Thank you in advance !


texts:
How to show qty product sold in catalog/product/list.phtml in mageto 2?
Example like link the screenshot below:
http://prntscr.com/rapduu
Anyone hepl me?
Thank you so much!


texts:
How do modify the header to make sure that all the relevant information is display to google?

When i google Magento2 SEO page optimization, all I see is performance related thread nothing related to one page optimization . I would like to do some one page SEO optimization - when I see how google see my page. The first few things google sees as follow:

Skip to Content,

Sign In,

Create an Account, Toggle Nav XXXX, My Cart, Search, Advanced Search, Search, Compare Products.


texts: How to change the getPrice() function to all Entire website

texts:
Actually, We have implement some custom calculation for all type of products,

Now i have edit the
app/code/core/Mage/Catalog/Model/Product/Type/Price.php , Its working on homepage and cart and checkoutpage., but cant change in the search page which means www.magentosite.com/catalogsearch/result/?q=search+product+. How can change in product search list page. please anyone.


texts: Apply configurable product images to ours associated simple products Magento 1.9.x

texts:
I need to apply configurable product images to our simple product associated because I need to use simple products in another store where it will only show simple products and not show configurable products.

I use configurable products just to generate simple products but I don't know which setting inside Magento itself will allow applying these images to our simple products.

So, when I put the simple generated products to appear in the store, they appear without images because only the configurable product receives these images.

Is there a setup or module that applies images to configurable products and associated simple products?

PHP URL Code
https://santosmadeiras.com.br/to.php


texts: How to add menu subitem in magento website?

texts: I want to add menu sub item in the existing parent menu but couldn't get good resource to help me out? can we add sub-item menu through magento admin panel?


texts: Magento 2 product images not showing, 2 different directories

texts:
Magento2 is looking directly in the root folder for media and static files. It is not looking in pub/media folder. Product images are not showing in the front. I installed Magento 2 in a subdirectory and with the installation.

I imported the products with Storemanager Emagicone, images were in import file (in root/media and pub/media because i did not know which to use),

Product images are in the front referring to a wrong path:

/media/catalog/product/cache/1/small_image/400x533/beff4985b56e3afdbeabfc89641a4582/y/o/yorkshire

When I look in FTP, the images are in pub/media/catalog/product. The above-mentioned directory is totally empty.

Moving the files from root/pub/media to root/media solved partially the problem. All basic images show up, but product images are not showing at all.

I already tried:php bin/magento setup:di:compile and php bin/magento setup:static-content:deployand php bin/magento cache:clean and php bin/magento indexer:reindex

The file permissions and user owner are OK, also i deleted all from ROOT > pub > static > EXCEPT .HTACCESS. I also deleted folder in: pub/static
var/cache, var/view_preprocessed/css/frontend/ , ..source/frontend

I also looked in di.xml Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

No symlinks!


texts: How to get selected payment method magento 2

texts:
This is my php file

public function getget(){

    $orderId = $this->getOrderId();

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderId);
     $payment = $order->getPayment();
    $method = $payment->getMethodInstance();
    $methodTitle = $method->getTitle();
    return $methodTitle;
}

I need to get selected payment method by user but this shows payment method from order. I'm beginner.


texts: Product Image misaligned, not displaying correctly

texts:
I wanted to remove the images so I resized the images in Magento luma view.xml as images <width>0</width> and same for height everywhere and true values as all false.

Now it is perfect for me and kept no image in Placeholder image at admin so that default image.jpg of 262x262 is picked every time when the product is clicked and product image displayed.

Now in 2.1.8 which is running on web host server, I overwrite the 262x262 default placeholder image.jpg with another one of same 262x262 but image is not displaying aligned and as perfect as it was on fresh installation..it is showing misaligned, little below the actual placeholder position.

To verify if issue is with web host, I checked with 2.1.7 installed at localhost of local computer and there default placeholder image was showing correct, at the right position and aligned.

I don't know what's going wrong with 2.1.8.

Also I revert the changes in 2.1.8 to default but still placeholder image showing incorrect position even after clearing Magento cache, reindexing and clear browser image.

I haven't change any value in any file other than view.xml.

Please refer the images attached here, need help.

[![Changes done in 2.1.8 view.xml][3]][3]

[![Changes done in 2.1.8 view.xml][4]][4]


texts: Magento Custom options dropdown uses Super Attribute Code instead of Super Attirbute Label

texts:
EDIT: It seems as though magento is passing the Attribute code as the Attribute Label.

I am in the process of rebuilding a website and I am using and inventory system (Linnworks) to push my listings to Magento.

Im fairly familiar with both of these platforms and have never had a problem before.

The problem I am reaching now, is Super Attributes.

The custom options dropdown is tied to an attribute with the CODE : nssbottlesize Attribute nssbottlesize is reflected through admin attribute LABELS as Select a Size.

This attribute label is reflected on the back end when viewing the product, but on the front end the Code is referenced (nssbottlesize) instead of (Select a Size).

I have a hunch that the inventory system i am using is causing some of this issue. But it doesnt make sense to me. The only place on the site or inventory system that says 'nssbottlesize' is the unique back end code for the attribute.

Even if the inventory system submitted this product with the incorrect Label/code, should I not be able to modify this under the associated products tab? The inventory system does not work in real time in this manner to update the attribute name should i change it, so I know that its not me changing it, and the inventory system immediately changing it back.

As the images reflect. The back end looks as it should, and so does the associated products tab, so im at a loss as to why this product label remains incorrect.

Thank you for reading my small book.


texts: catalog_product_save_before event does not fire on $product->save()

texts:
I need to create a custom attribute for products, which value is updated on product save, based on other attribute's value.

So creating an observer for event catalog_product_save_before works fine when saving products manually.

Unfortunately this event doesn't fire when I loop through 100s of products in my shop with:

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

$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $product) {
    $product->save();
}

My test observer function:

public function updateProductDetails($observer) {
   Mage::log('inside the observer');
}

I need either new event that will fire on $product->save() or new method of saving all my products at once, that will fire this event catalog_product_save_before.

I would appreciate your suggestions.


texts:
I am trying to create a customer custom attribute in Magento 2, but it's throwing an error.

  Fatal error: Call to a member function create() on null in
  Custom\Setup\InstallData.php on line 47

For creating customer custom attribute I have written the code below.

<?php
namespace Learning\Custom\Setup;

use Magento\Customer\Setup;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{

    /**
     * Customer setup factory
     *
     * @var CustomerSetupFactory
     */
    private $customerSetupFactory;

    /**
     * @var \Magento\Eav\Model\Entity\Attribute\SetFactory
     */
    protected $attributeSetFactory;

    /**
     * @param Setup\CustomerSetupFactory $customerSetupFactory
     */
    public function __construct(\Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory)
    {
        $this->customerSetupFactory = $customerSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

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

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

        $customerSetup->addAttribute(Customer::ENTITY, 'custom_name', [
            'type' => 'varchar',
            'label' => 'Custom Name',
            'input' => 'text',
            'class' => '',
            'source' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            /*Scope of your attribute */
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'position' =>999,
            'system' => 0,
        ]);

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

        $attribute->save();
    }

}

Could you please suggest where the problem might be?


texts:
I want to truncate the table "index_event" but that does not work.

I get the following error:

Cannot truncate a table referenced in a foreign key constraint (`db_name`.`index_process_event`, CONSTRAINT `FK_INDEX_PROCESS_EVENT_EVENT_ID_INDEX_EVENT_EVENT_ID` FOREIGN KEY (`event_id`) REFERENCES `db_name `.`index_event` (`event_id`))

How can I solve this?


texts:
I have a custom block and when I add it to local.xml it auto renders:

<catalog_product_view>
    <reference name="head">
        <action method="addJs">
            <script>fileuploader/filepop.js</script>
        </action>
    </reference>
    <reference name="content">
        <block type="fileuploader/fileuploader" name="product.attachments" template="fileuploader/desc_attachments.phtml"/>
    </reference>
</catalog_product_view>

This is bad because I actually want it in a very specific spot. I am able to call this block using getBlockHtml in my catalog/product/view.php but then it shows up twice.

How can I get the block to STOP auto rendering?? Below is the code for the block:

class Uni_Fileuploader_Block_Fileuploader extends Mage_Core_Block_Template {

    public function _prepareLayout() {
        return parent::_prepareLayout();
    }

    public function getProductAttachments($productId=0) {
        $attach = array();
        $_helper = Mage::helper('fileuploader');
        $data = Mage::getModel('fileuploader/fileuploader')->getFilesByProductId($productId);
        $totalFiles = $data['totalRecords'];
        if ($totalFiles > 0) {
            $record = $data['items'];
            $i=0;
            foreach ($record as $rec) {
                $i++;
                $file = $_helper->getFilesHtml($rec['uploaded_file'], $rec['title'],$i,true,$rec['content_disp'],true);
                $attach[] = array('title' => $rec['title'], 'file' => $file, 'content' => $rec['file_content']);
            }
        }
        return $attach;
    }

}


texts:
Hi I was wondering if there was a faster way of adding simple products to a configurable product instead of using the "Quick Create" option?

Basically I'm trying to add variation to a shoe with attributes Colour, Width and Size.

Now I have say 8 sizes of colour Black and width 4E. As you see, 2 of the attributes remain the same for 8 simple products and only the size changes.

It's a hassle to add each product one by one using the Quick Create option. Is there a better way of doing this? Like just selecting with sizes you want in a colour and width and then they are automatically added?


texts:
I have noticed in my backend that some products have broken image links. Thus, placeholder gets used on frontend.

I would like to get a list of products that has the placeholder as it's image on the frontend. I have written the following, but it is not working correctly:

    <?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

require_once('app/Mage.php');
Mage::app();

error_reporting(1);
set_time_limit(0);
ini_set('memory_limit', '2048M');

$_products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('visibility', 4)
    ->addAttributeToFilter('status', 1);

foreach($_products as $_product){
    if($_product->getImageUrl()){
        echo($_product->getImageUrl(). $_product->getSku()."
");
    }
}?>

Update of new code I have tried:

    <?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

require_once('app/Mage.php');
Mage::app();

error_reporting(1);
set_time_limit(0);
ini_set('memory_limit', '2048M');

$_products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('visibility', 4)
    ->addAttributeToFilter('status', 1);

foreach($_products as $_product){
    if (!file_exists(Mage::getModel('catalog/product_media_config') ->getMediaUrl( $_product->getImage()))) {
    echo $_product->getSku(). "
";
}
        //echo(Mage::getModel('catalog/product_media_config') ->getMediaUrl( $_product->getImage())."
");

}?>

Still not doing what I need


texts: how to make product list in homepage and sub page look the same?

texts:
so our products look really nice on our category page:
http://www.avfdevelopments.org/ecommerce/index.php/sub.html

but look ghastly on the homepage - how can i get them to look the same?

http://www.avfdevelopments.org/ecommerce/index.php/

Al the product i want on our homepage are latest products from ALL categories.


texts: Product not showing after adding related products in Magento2

texts:
I need to know how the related products functionality works in Magento 2
especially.

For eg: I have a product1 for which I add related products, say product 2,3,4,5

Doubt is:

1) Why is this product1 not visible in frontend search after i add related products to it. (If i remove the related prods added to it, then it is displaying)

2) After adding the related products, the related products 2,3,4,5 should display in the product details page(ie when i click on a product1)
Nothing is showing in details page.

I have cleared reindex, cache after saving the products, all 1,2,3,4,5 products are in stock, enabled, no logs.

Please suggest.


texts: Magento 1.9.1: Getting problem in work with layout in module development

texts:
I am not so familer with magento so i am trying to develop a simple module on magento 1.9.1 with help of this tutorial http://magentotutorial.net/magento-tutorial-how-to-create-a-simple-module/
but i am facing a problem with display the text in frontend with layout & templates(phtml file)
if i write simple

echo "hello";

in

indexAction() of IndexController.php

it display simple hello text on blank screen without any magento template on url sitename.com/hello

but if write

$this->loadLayout();
$this->renderLayout();

it display my theme layout with any content in content area

here is my codes
app/code/etc/modules/Dinesh_hello.xml

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

app/code/local/Dinesh/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
       <Dinesh_Hello>
           <version>0.1.0</version>
       </Dinesh_Hello>
   </modules>
   <global>
   </global>
   <frontend>
       <routers>
           <dinesh_hello>
               <use>standard</use>
               <args>
                   <module>Dinesh_Hello</module>
                   <frontName>hello</frontName>
               </args>
           </dinesh_hello>
       </routers>
<layout>
           <updates>
               <hello>
                   <file>hello.xml</file>
               </hello>
           </updates>
       </layout>
   </frontend>
   <global>
 <blocks>
           <hello>
               <class>Dinesh_Hello_Block</class>
           </hello>
       </blocks>
   </global>
</config>

app/code/local/Dinesh/controllers/IndexController.php

<?php
class Dinesh_Hello_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
     $this->loadLayout();
     $this->renderLayout();
        //echo "hello";
    }
}

?>

app/code/local/Dinesh/Block/Hello.php

<?php
class Dinesh_Hello_Block_Hello extends Mage_Core_Block_Template
{
  public function methodblock()
     {
         return ‘informations about my block !!’ ;
     }
}
?>

app/design/frontend/default/default/layout/hello.xml

<layout version=”0.1.0″>
    <hello_index_index>
      <reference name=”root”>
<action method=”setTemplate”><template>page/1column.phtml</template></action>
      </reference>
      <reference name=”content”>
 <block type=”hello/hello” name=”hello” template=”hello/hello.phtml”/>
      </reference>
   </hello_index_index>
</layout>

app/design/frontend/default/default/template/hello/hello.phtml

<?php
echo $this->methodblock();
//echo "hello";
?>


texts: How to sort products & categories based on customer group in magento 1.9.3

texts:
I am very new to magento. I need to provide a sort option for products as well as categories  based on customer group in admin panel.

How can I achieve this ?


texts:
I need order totals detail like in screen shot below

I tried below code but it is not working.

    $totals  = $order->getTotals();
    foreach ($totals as $_total) {
       echo $_total->getCode() . ' => ' . $_total->getValue() . '<br />';
    }

How can I achieve this?


texts: magento get only product id and qunatity by order id

texts:
I want to get only product id and qty from order id

below is way to get order detail

$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
$items = $order->getAllItems();

but it gives all i want only product id, quantity to minimize load ,

what filter have i to add ?


texts: M2 - Translate password requirements alert

texts:
In Magento 2 on the checkout page, you'll see a notification if you enter a password that not matches the requirements.

You see this: "Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."

How can I translate that message? I've already tried to add the string in the csv translate file, but with no result...

Update:


texts:
I am using the magento soap api v2.  Through the api I can successfully create credit memos and they show up fine in the magento backend.  They aren't showing up in my payment processors sandbox, and I fear that is because they are "offline refunds".

In the magento interface, when you create a credit memo on an order, it's an "offline refund".  You have to create the credit memo on the invoice for the refund to be an "online refund" and actually go through to your processor.

So I headed over to the documentation and saw that there is no argument to pass for the invoice number. You can only create credit memos for an order.  So maybe I missed it and there is a way to make one on an invoice.  Or maybe I can pass another argument through the api to force an online refund?

QUESTION
Is there a way to do online refunds (credit memo) through the api?


texts:
I have a Magento instance and I have enabled Scheduled Backup in System > Configuration > Advanced > System > Scheduled Backup Settings. These are the settings I have:

 Enable Scheduled Backup: Yes
 Backup Type: Database
 Start Time: 1:00 am
 Frequency: Daily
 Maintenance Mode: No

The problem is that this setup doesn't do anything at all.
Do I have to do something else on the backend? Do I have to setup a cron job on the system?
Where can I check a log or something like that?

Thanks for your help


texts:
I hope I can ask this question correctly.

I am attempting to edit the "1column.phtml" file so that the "side bar left" appears as well.
I have pulled the code from "2columns.phtml" and it works , how ever the alignment is off.

How can I have the "left side bar" appear next to the products, i have a photo showing what I am aiming for.

Thank you in advanced


texts:
I have a query that I'm trying to use in an admin grid. It is summing the values in another table, in a subselect, and then joining on that table:

SELECT
   main_table.*,
   author_debit_amount
FROM   sales_flat_order_item AS main_table
   INNER JOIN sales_flat_order AS order_table
           ON main_table.order_id = order_table.entity_id
   INNER JOIN admin_user AS author
           ON main_table.author_id = author.user_id
   LEFT JOIN (SELECT author_id, SUM(amount) AS author_debit_amount FROM author_debits
               GROUP BY author_debits.author_id) a
           ON main_table.author_id = a.author_id
WHERE  ( order_table.created_at >= '2014-08-01 04:00:00' )
     AND ( order_table.created_at <= '2014-09-01 03:59:59' )
GROUP  BY main_table.author_id;

My question is, is it possible to write this query using standard magento collections? i.e., $collection->join(...). The subselect is where I'm stuck:

LEFT JOIN (SELECT author_id, SUM(amount) AS author_debit_amount FROM author_debits
               GROUP BY author_debits.author_id) a
           ON main_table.author_id = a.author_id


texts: Can't override only template on custom module (uppercase problem)

texts:
The problem is I have the vendor name capitalized, and then, don't know why the overrides don't work. Only when you want to change the template but still using default block. For example:

Override the catalog_product_view (single product page - the image)

Folders structure:

app\code\GST
└───Override
    │   registration.php
    │
    ├───etc
    │       module.xml
    │
    └───view
        └───frontend
            ├───layout
            │       catalog_product_view.xml
            │
            └───templates
                └───product
                    └───view
                            gallery.phtml

registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'GST_Override',
__DIR__
);

module.xml

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

catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.media.image" template="GST_Override::product/view/gallery.phtml"/>
    </body>
</page>

gallery.phtml

<p> test </p>

Expected result: No image shown and display 'test'

Actual result: Default magento view

What I've tried:

1) If I use remove attribute on layout:

<referenceBlock name="product.info.media.image" template="GST_Override::product/view/gallery.phtml" remove="true"/>

The image is removed.

2) If I use custom block on layout:

<referenceBlock class="GST\Override\Block\Product\View\Gallery" name="product.info.media.image" template="GST_Override::product/view/gallery.phtml" remove="true"/>

It works.

3) Definately, if I use a 'normal' vendor name like Test it works.

Is this a kind of bug? should I never use all capital leters to name vendor or module? Did I make a mistake? Can you reproduce this error or it's just me?


texts: M2 - How to get active fitters using observer

texts: How to get active filters using observer on product listing page, what is the procedure to get that?


texts:
How to export admin grid only for selected fields in Magento?
I have a field which contains link(pdf download link) in admin grid.
I don't want to export that particular field in Export CSV action.So how can I achieve it ?

I want to remove 'Download PDf' column in export mass action, please see attached snapshot with this comments.


texts: How to force the customer to choose "Yes" in an "Yes/No" attribute?

texts:
I have a customer attribute which ask the customer to agree our Terms of Services with attribute code tos. How can I reject a customer registration when tos is chose No? And, how can I display the error message like You must agree with our TOS?

NOTE: There are no Checkbox on Input Type at Customer Attribute. I'm using Enterprise Edition so I can create customer attributes without coding.


texts:
I added attributes in this way without problems:

$this->startSetup();
$installer = new Mage_Sales_Model_Resource_Setup('core_setup');
$entities = array(
    'quote_item',
);
$options = array(
    'type'     => Varien_Db_Ddl_Table::TYPE_DECIMAL,
    'visible'  => true,
    'required' => false
);
foreach ($entities as $entity) {
    $installer->addAttribute($entity, 'packing', $options);
}
$installer->endSetup();
$this->endSetup();

But when I try to remove the attributes it gives me error: WRONG Entity ID:

$this->startSetup();
$installer = new Mage_Sales_Model_Resource_Setup('core_setup');
$entities = array(
    'quote_item',
);
foreach ($entities as $entity) {
    $installer->removeAttribute($entity, 'packing');
}
$installer->endSetup();
$this->endSetup();


texts: How to surcharge each credit card type, 2% for Visa & Master and 3% for Amex and Discover

texts:
I can do the surcharge for payment method with selecting cc card or others, but when the buyer inserts his credit card number into cc-form, I want that surcharge changes to 2% or 3% depends on credit card type.
Please help me, thanks.


texts: Magento 2.3.2 - Product customisable options reappear by themselves

texts:
I've been experiencing a weird issue in my project where every now and then (once a month-two months), some of our products  (that once had customizable options, yet they were eventually removed) have all the customizable options back, despite no one going and consciously re-adding those options again.
Here are the options for example:

Has anyone ever experienced something like this? What could trigger re-adding old data to products a few months after its removed? We have an extension that logs any changes to products and there's simply nothing regarding this. I'm at a loss.
Appreciate any ideas.


texts: Catalog product / Category redirecting to 404 page, Add To Cart not working

texts:
I got issue on Magento stroefront, there was no products showing on any category page. If I open any product direct and try to item to cart. Then it shows empty cart page. Admin panel working fine.
All the category pages were redirecting to a fixed page i.e. no-route or 404 page. Nothing to browse, all the customers were angry on us.
Do you know what may be the reason?
Magento version 2.3.5 Enterprise Edition.


texts: Fatal error: Uncaught Error: Call to undefined function Magento\Framework\Event\mb_strtolower() in magento 2

texts:
when i run

cli commends I'm getting error

Fatal error: Uncaught Error: Call to undefined function Magento\Framework\Event\mb_strtolower() in /home/project/public_html/vendor/magento/framework/Event/Manager.php:56

phpinfo.php

why this happening
how I can solve this??


texts: Magento 2 - Get only enabled products in a collection

texts:
I try to get a collection of configurable product but disabled product are showing up.here is my code

  $currentStoreId = $this->_storeManager->getStore()->getId();
    $this->_productCollection = $this->_reportCollectionFactory->create()
                    ->addAttributeToSelect('*')
                    ->addViewsCount()
                    ->setStoreId($currentStoreId)
                    ->addStoreFilter($currentStoreId)
                    ->addFilter('type_id','configurable' )

So I tried

 $this->_productCollection->addAttributeToFilter('status', array('eq' => 1) );
 $this->_productCollection->addAttributeToFilter('status', ['in' => $this->_productStatus->getVisibleStatusIds()]);
 $this->_productCollection->addAttributeToFilter(
                            'status', array('eq' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
                        );

But none on them works, It return all product since it seems that status of disabled product is 1 also:

var_dump($_product->getStatus())

return 1 on disabled and enabled product

I tried to refresh cache php bin/magento cache:flush, remove everything  in  var/generation, also reindex php bin/magento indexer:reindex but no luck.

Is it a bug or am I missing something?

Here is my complete class

use Magento\Catalog\Api\CategoryRepositoryInterface;

class ListProduct extends \Magento\Catalog\Block\Product\ListProduct{

    protected $_reportCollectionFactory;
    protected $_typeFilter;

     public function __construct(
        //parent
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        CategoryRepositoryInterface  $categoryRepository,
        \Magento\Framework\Url\Helper\Data $urlHelper,

        \Magento\Reports\Model\ResourceModel\Product\CollectionFactory $reportCollectionFactory,
        \Magento\Catalog\Model\Product\Attribute\Source\Status $productStatus,
        \Magento\Catalog\Model\Product\Visibility $productVisibility,

        array $data = []
    ) {

        $this->_reportCollectionFactory = $reportCollectionFactory;

        parent::__construct(
            $context,
            $postDataHelper,
            $layerResolver,
            $categoryRepository,
            $urlHelper,
            $data
        );
    }

  protected function _getProductCollection($force_reload = false){
        if ($this->_productCollection === null|| $force_reload == true) {

                $currentStoreId = $this->_storeManager->getStore()->getId();

                $this->_productCollection = $this->_reportCollectionFactory->create()

                    ->addAttributeToSelect('*')

                    ->addViewsCount()
                    ->setStoreId($currentStoreId)
                    ->addStoreFilter($currentStoreId)
                    //->addAttributeToFilter('status', array('eq' => 1));
                    //->addAttributeToFilter('status', ['in' => $this->_productStatus->getVisibleStatusIds()])
                    //->setVisibility($this->_productVisibility->getVisibleInSiteIds());
                    ;

                if (!empty($this->_typeFilter)){
                    $this->_productCollection->addFilter('type_id',$this->_typeFilter );
                }

        }
        return $this->_productCollection;
   }

    public function setTypeFilter($typeFilter = []){
        return $this->_typeFilter = $typeFilter;
    }

    public function getFilteredCollection($typeFilter = []){
        $this->setTypeFilter($typeFilter);
        return $this->_getProductCollection(true);
    }

}


texts: Unknown column 'entity_id' in 'OLD' in setup:upgrade after 2.3.2 migration

texts:
Recently I migrate a site to Magento 2.3.2. composer update run fine and without a problem. But, when I run a php bin/magento setup:upgrade it throws this error:

Column not found: 1054 Unknown column 'entity_id' in 'OLD', query was: DELETE FROM catalog_category_entity_text WHERE (row_id = 472) AND (attribute_id = '44') AND (store_id = '0')

The error is thrown I think when it is trying to install Magento_CatalogStaging module:

$ php bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/gnc-2-0.morwi.mx-MIGRATION/generated/code/Composer
/var/www/gnc-2-0.morwi.mx-MIGRATION/generated/code/MSP
/var/www/gnc-2-0.morwi.mx-MIGRATION/generated/code/Magento
/var/www/gnc-2-0.morwi.mx-MIGRATION/generated/code/Symfony
The directory '/var/www/gnc-2-0.morwi.mx-MIGRATION/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
...
Data install/update:
...
Module 'Magento_GroupedProductStaging':
Module 'Magento_DownloadableImportExport':
Module 'Magento_CatalogStaging':
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'OLD', query was: DELETE FROM `catalog_category_entity_text` WHERE (row_id = 472) AND (attribute_id = '44') AND (`store_id` = '0')

But I don't understand that it means. The entity_id column is not present anymore on catalog_category_entity_text, and the query the error shows is not using that column. And I don't what OLD means.

How can I debug and fix this error? Any idea?

Thanks.


texts: Not Visible Individually Still Showing In Search Results

texts:
When we set products visibility to either 'Catalog' or 'Not Visible Individually' they still show up in the search results.

Any ideas what could be causing this?


texts: Magento 2: How to create a configurable product programmatically

texts:
I am new to magento and i have created a simple product programmatically from frontend and my question is how can i create a configurable product and link attributes and price and all, what to do, and how to do that?

please suggest any solution.


texts: How to reset all customers passwords in magento 1.9

texts:
I want to reset or update all customers passwords in magento 1.9
is it possible?


texts: Magento 2.1 - Get a collection including out of stock products

texts:
In a basic block I'm getting the featured products, however I only get the products that are in stock:

public function getProducts()
{
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*')
        ->addAttributeToFilter('featured', '1');

    $collection->getSelect()
        ->limit(8);

    return $collection;
}

How can I get the out of stock products (I guess those which stock_status=0 in cataloginventory_stock_status) as well? without changing "anything" in the backend configuration.


texts: Email not working Magento Community version 1.9.3.8

texts:
My store is developed in  1.9.3.8 and none of the emails working like: Order confirmation email, Contact us mail, new registration mail, forget password mail.

I tried sending through the admin panel but nothing happens, also no update email is being received. Can anyone help me with this problem for Magento 1.9.3.8?

Thanks


texts: Avantlink Order Tracking on Confirmation Page

texts:
I'm trying to get Avantlink's code into my order confirmation page.  The code should look like this when it's done:

<script type="text/javascript">
var _AvantMetrics = _AvantMetrics || [];
_AvantMetrics.push(['order',{ order_id:'[ORDER_ID]', amount:'[ORDER_AMOUNT]', state:'[BILLING_STATE]', country:'[BILLING_COUNTRY]' }]);
_AvantMetrics.push(['item',{ order_id:'[ORDER_ID]', parent_sku:'[ITEM_PARENT_SKU]', variant_sku:'[ITEM_VARIANT_SKU]', price:'[ITEM_PRICE]', qty:'[ITEM_QUANTITY]' }]);
</script>

Using this stack exchange article as a reference for adding success page confirmation: Add tracking code to success.phtml

Trying to put this into the bottom of success.phtml

<script type="text/javascript">
var _AvantMetrics = _AvantMetrics || [];
<?php
$newOrderId = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$newOrder = Mage::getModel('sales/order')->load($newOrderId);
$items = $newOrder->getAllItems();
$currency = Mage::app()->getStore()->getCurrentCurrencyCode();
$billingAddress = $newOrder->getBillingAddress();

echo "_AvantMetrics.push(['order',{ order_id:'{$newOrder->getId()}', amount:'{$newOrder->getGrandTotal()}', state:'{$billingAddress->getRegionId();}', country:'{$billingAddress->getCountry();}' }]);";

foreach ($items as $item){
    echo "_AvantMetrics.push(['item',{ order_id:'{$newOrder->getId()}', parent_sku:'{$item->getSku()}', variant_sku:'{$item->getSku()}', price:'{$item->getPrice()}', qty:'{$item->getQtyOrdered()}' }]);";
} ?>
</script>

But it doesn't work. When I do this, the success page breaks. Where am I going wrong?


texts: The stock item was unable to be saved on freshly installed Magento v2.4.0

texts:
I installed the sample data ok - but when I try to add a new product, or even save changes to an existing product this happens:

In the exception.log I get:
[2020-09-28 10:00:44] main.CRITICAL: The stock item was unable to be saved. Please try again. {"exception":"[object] (Magento\Framework\Exception\CouldNotSaveException(code: 0): The stock item was unable to be saved. Please try again. at /var/www/html/magento/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187, Magento\Framework\Exception\LocalizedException(code: 0): Could not ping search engine: No alive nodes found in your cluster at /var/www/html/magento/vendor/magento/module-elasticsearch/Model/Adapter/Elasticsearch.php:122)"} []
I did install the latest version of elasticsearch and it's up and runnning on localhost.
I can even telnet into it.
I've heard someone say disable MSI - would that help? If so how do I do that please?
Thanks In Advance!


texts: Show fields in register form of checkout onepage when the user is not guest

texts:
I added a custom attribute to customer entity in my Magento store and successfully displayed it in the registration page.
Now I want to display it in the registration form of the onepage checkout. I tried to modifiy the persistent/checkout/onepage/billing.phtml to add my new field but adding it to this file shows the new field also when a user checkouts as guest.

How can I show it only when a new user is registering in checkout onepage?


texts: Magento 2 If ascoited product qty are out stock, so configrabale how to disable?

texts:
We were used Magento 2.3.5 version.
Question: associated product qty are out of stock, so configurable product how to disable or redirect 302 pages?
Thanks in advanced.


texts: Remove Delete product functionality for a specific user role

texts: How to remove delete product functionality for a specific user role? ( The user should only have access to edit the products. ) In default magento community edition i cannot achieve this. Which code should i modify to make this work?