texts:
Magento 1.9.x trying to save $customer data => "Uncaught Mage_Customer_Exception: This customer email already exists"

We are looping thru all customers, updating data and saving

Only when saving a customer with an email that already exists: we see the error Uncaught Mage_Customer_Exception: This customer email already exists

Although when I check Magento the email does exist twice, but in different stores. So it should! save the customer, nothing is wrong

Question: how can we prevent this from happening?

We are looping data as follows

$customers = mage::getModel('customer/customer')->getCollection()
    ->addNameToSelect();

$cnt_me = 0;
foreach ($customers as $customer) {
    $data = array();
    $customer_id = $customer->getId();
    $customer_name = $customer->getName();
    $customer_email = $customer->getEmail();
    $orders = Mage::getModel('sales/order')->getCollection()
        ->addFieldToFilter('customer_id', $customer_id)
        ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()));
    foreach ($orders as $order) {
        foreach ($order->getAllItems() as $item)

{

then later we do the following

if ($save) {
    $this->_dataSaveAllowed = true;
    $customer->save();
} else {
    continue;
}


texts: Add internal code to Eav Attribute option?

texts:
I am new to Magento 2.

All my data comes from an external db.
Before importing my products into Magento, I want to prepare the environment.

I am currently trying to set up custom EAV attributes with options that suit these products. I think I found how to manage this.

But there is something which I don't see how to handle.
Each EAV attribute option has a value assigned to it, ok.
But in my case, it's a bit tricky, I also need to set an internal alphanumeric code for each of these options.

I could put it in the value, together with the actual option value, but it would mean the internal code would be reflected in frontend views as well, which is not acceptable.

Could anyone suggest an approach which would help me with this brainshaking issue?

When I retrieve products from the external db, the options for each attribute are actually just the internal code and I will have to retrieve the actual option values from its related code.


texts: rwd home page not responding to local.xml

texts:
I'm using rwd package. I've done everything, created my own package, file structure, disabled cache, etc. When I go to change Madison Island home page from 1 column to 2 columns-left from local.xml, i.e.

<?xml version="1.0" encoding="UTF-8"?>
  <layout version="0.1.0">
     <default>
       <reference name="root">
         <action method="setTemplate">
           <template>page/2columns-left.phtml</template>
         </action>
       </reference>
     <default>
  </layout>

no alteration takes place to layout of home page. I can alter it from CMS -> pages. Any reason for this, have I missed anything in my local.xml? The reason I ask is if in future if I want to do any alteration to store via local.xml it might not be possible.


texts: What is the basic architecture of Magento API?

texts: Even though there are number of articles about magento API, no one clearly provides information about how it works in magento system. Most of them have provided source codes to explain pieces of magento API. Cannot grab a clear idea about what is the basic flow of magento API.


texts: Magento 2 Custom Module Not Accessible In Other Users

texts:
I have simple grid listing custom module in magento 2 admin, but I can not access it in other users then default admin,

Here are my files

acl.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Spaarg_Tables::tables" title="tables" sortOrder="100"/>
 <!--AddMenuAcl-->
            </resource>
        </resources>
    </acl>
</config>

menu.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Spaarg. All rights reserved.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd">
    <menu>
        <add id="Spaarg_Tables::spaarg_tablesgrid_index" title="Tables" module="Spaarg_Tables"  sortOrder="20" dependsOnModule="Spaarg_Tables" action="tables/tablesgrid/index" resource="Spaarg_Tables::spaarg_tablesgrid_index"/>
<!--AddMenu-->
    </menu>
</config>

system.xml

Here is my controller Index.php

<?php
namespace Spaarg\Tables\Controller\Adminhtml\TablesGrid;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;

class Index extends Action
{
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory;

    /**
     * @var \Magento\Backend\Model\View\Result\Page
     */
    protected $resultPage;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        Context $context,
        PageFactory $resultPageFactory
    )
    {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {

        $this->resultPage = $this->resultPageFactory->create();
        $this->resultPage->setActiveMenu('Spaarg_TablesGrid::tables');
        $this->resultPage ->getConfig()->getTitle()->set((__('TablesGrid')));
        return $this->resultPage;
    }

    protected function _isAllowed()
    {
      return $this->_authorization->isAllowed('Spaarg_TablesGrid::tables');
    }

}

It is showing checked in user roles for my modules, I am new to magento, it would be great if someone can suggest a way to handle this.


texts: how to add cutom price via rest api - Magento 2

texts:
I'm following this answer to create guest order. I'm trying to add product to cart with my custom price, but the order will take the actual product price.

  POST /V1/guest-carts/{cartId}/items

Rest URL

http://host/index.php/rest/V1/guest-carts/67435a34ccb029c707adca60303849a2/items

Data

{ "cartItem": { "quote_id": "67435a34ccb029c707adca60303849a2", "sku": "MAR-410303SA046YL", "price": 10 "qty": 1 } }

When I check the order, item price is not 10.

any help would be appreciated.


texts: How do you update/change a product's store/website via Magento's CSV importer?

texts:
Using Magento 1.9.2.

I'd like to be able to re-assign products between stores by uploading a CSV containing product SKUs and store names or IDs.

How can this be done?


texts:
I am learning observers and events, but following a simple event, i am unable to disect the problem, as to me it seems fine, and nothing in system.log as well. Following is my module etc/config.xml

<config>
    <global>
        <models>
            <csv>
                <class>Training_Csv_Model</class>
            </csv>
        </models>

        <events>
            <customer_login>
                <observers>
                    <csv>
                        <type>model</type>
                        <class>csv/observer</class>
                        <method>logCSV</method>
                    </csv>
                </observers>
            </customer_login>
        </events>
    </global>
</config>

while my observer.php file is under Name_space/module_name/Model/Observer.php and has following code

    class Training_Csv_Model_Observer{
        public function logCSV($observer){
        $customer = $observer->getCustomer();
        Mage::log($customer->getName()." has logged in",
                    null,
                    "customer.log");

        }
    }

I am unable to understand why this wouldn't work, as a simple Model would work, meaning my module is working and loading. My knowledge of PHP is limited and i want to know, why this won't work.


texts: Magento 2: 404 for productpage image when click on swatch option

texts:
i have used the swatch option for configurable product and each of this color swatch product image
are different for that associate products.
I have already assign different different image for this associate product base on color swatch

but now when i click on swatch option on product page then image is not change and its showing me 404 error for that image i have check the image in main image folder like ( catalog/product/d/e/dev.jpg)  and its available but it's not available on catalog/product/cache/0da44b14ba7470ad5b3ec133a23947b1/d/e/dev.jpg

I can not run this catalog:products:resize command every time so is there any other solution or any way.

Thanks.


texts: magento 1 price display on PDP with additional cost and select options

texts:
I have different requirement that shows the product price in multiple way.

As per the image product should contain Base price, Installation price and GST. Along with that multiple custom option and price should be updated on selection of each.

What is the best approach to achieve this and is there any extension for this?


texts: Magento 2.2 configurable products always out of stock

texts:
Configurable products are always out of stock but the are not in the catalog.
All assigned simple items are in stock with 100pcs.

I've noticed that if re do the configuration and Apply single quantity to each SKUs then i can see the product is is showing in stock again?

any solution i've almost 2000 products like this


texts:
This code is showing exception even when the condition is not true!!

Please can anyone help where I am wrong

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Fooman_Example>
            <version>0.1.0</version>
        </Fooman_Example>
    </modules>
    <global>
        <models>
            <fooman_example>
                <class>Fooman_Example_Model</class>
            </fooman_example>
        </models>
        <helpers>
            <fooman_example>
                <class>Fooman_Example_Helper</class>
            </fooman_example>
        </helpers>
    </global>
    <frontend>
        <events>
            <catalog_product_type_prepare_full_options>
                <observers>
                    <fooman_example_catalog_product_type_prepare>
                        <class>Fooman_Example_Model_Observer</class>
                        <method>catalogProductTypePrepare</method>
                    </fooman_example_catalog_product_type_prepare>
                </observers>
            </catalog_product_type_prepare_full_options>
            <sales_order_place_before>
                <observers>
                    <fooman_example_order_observer>
                        <type>model</type>
                        <class>Fooman_Example_Model_Observer</class>
                        <method>AddProductSaveBefore</method>
                    </fooman_example_order_observer>
                </observers>
            </sales_order_place_before>
        </events>
    </frontend>
</config>

Observer:

<?php

class Fooman_Example_Model_Observer
{
    public function catalogProductTypePrepare($observer)
    {
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        if ($quote->getItemsCount() >= 1) {
            Mage::throwException('You can only buy one product at a time.');
        }
    }

    public function AddProductSaveBefore($observer)
    {
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        if (Mage::getSingleton('customer/session')->isLoggedIn()) {
            $customerData = Mage::getSingleton('customer/session')->getCustomer();
            $customerId = $customerData->getId();

            $fromDate = date('2016-09-10 00:00:00');
            $toDate = date('2016-09-10 23:59:59');
            $order = Mage::getModel('sales/order')->getCollection()
                ->addFieldToFilter('customer_id', $customerId)
                ->addAttributeToFilter('created_at', array('from' => $fromDate, 'to' => $toDate));
        }

        if ($quote->getItemsCount() >= 1) {
            Mage::throwException('You can only Buy one product at a time. Please Change your Cart Items.');
        }
        if (count($order) >= 1) {
            Mage::throwException('You already ordered today');
        }
    }
}


texts: How to retrieve the filter options in Magento 2 REST API in category list?

texts:
How can we retrieve the filter options in a category with REST API?

In the product category page, I have the filters as below and it depends on each category.

Product Category Filter
Filter by stock
Filter by on stock
Filter by price
Filter by Manufacturer

etc......

So I just want to retrieve this values in REST API. How can we achieve this?


texts: Error while executing migration - Magento 1 to Magento 2

texts:
Migrating (trying to) but there is an error with I don't know what to do.

  [Symfony\Component\Console\Exception\CommandNotFoundException]

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

Any ideas?


texts: Magento 2: Add a Custom Import Sample File to vendor/magento/module-import-export/Files/Sample directoy

texts:
I created a custom import module from two custom models and tables. The imports works fine, and without any error or problem now. But I noticed that next to Entity Type dropdown, appears a "Dowload Sample File".

And, when I click in that (when is selected my custom entity type), the page show me a "There is no sample file for this entity." error.

So, after check the file vendor/magento/module-import-export/Controller/Adminhtml/Import/Download.php it's look like Magento is searching the sample file in the directory:

vendor/magento/module-import-export/Files/Sample

So, the "quick" way of correcting this problem, I suppose, is to add the files of my modules in that directory. However, my question is: is this "right"? My logic tells me that it's not good to touch ANYTHING that's in the vendor folder. But then, what is the other alternative that could apply?, since it seems that with these lines:

fileName = $this->getRequest()->getParam('filename') . '.csv';
$moduleDir = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, self::SAMPLE_FILES_MODULE);
$fileAbsolutePath = $moduleDir . '/Files/Sample/' . $fileName;
$directoryRead = $this->readFactory->create($moduleDir);
$filePath = $directoryRead->getRelativePath($fileAbsolutePath);

Force to search directly in that directory.

Some suggestions?


texts:
I want to send block html in JSON response.

To be specific - I want to add functionality where customers are able to edit their addresses via Ajax requests. So the block class will be \Magento\Customer\Block\Address\Edit instance.

In Magento 1.x it will be just something like that:
$this->getLayout()->createBlock('xxx')->toHtml()

How to achieve similar things in Magento 2 ?

Am I doing it in proper way? Or maybe Magento 2 implements other ways of doing such things?


texts:
Im trying to override the styles for the magento2 blank theme's top navigation. I set my structure same as blank theme has it, Theme->Magento_Theme->web->css->source->_module.less but it seems to be ignoring the override
My goal, I am creating a new theme based off of Blank theme and I want to add as little extra css as possible, so my thought was, I would copy the file from blank and add my css changes to that copy so it would load mine, which has the same code with my new additions.
Ive been successful at overriding the variables in my theme.less file but for some reason, this is not working as expected.
I am clearing cache, deleting my viewed process and static frontend, and running a static content deploy in dev mode.


texts: How to trigger an observer programatically with it's required data from a custom controller file in Magento 2?

texts:
I have create event controller_action_predispatch_checkout_cart_add as given below:

Vendor/Module/etc/frontend/events.xml

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

Vendor/Module/Observer/ProductBeforeAddToCart.php

<?php
namespace Vendor\Module\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class ProductBeforeAddToCart implements ObserverInterface {
 public function __construct(
// dependencies
){
....
}
public function execute(Observer $observer)
{
    $productId = $observer->getRequest()->getParam('product');
    $superAttributes = $observer->getRequest()->getParam('super_attribute');
    // Rest of the code
}
}

Above code works fine if I add product from product details page. Now in one of my custom module, I am adding product to cart programatically. After product is added to cart programatically, above method is not executed automatically. From my custom module I want to call my code written in the above observer with product data. How I can do that?

I mean, How to trigger a observer programatically with it's required data from a custom controller file ?


texts: Magento2 - Track this Shipment navigates to a blank page

texts:
When I add a tracking number to an order and then click "track this shipment" in magento2, a blank page (domain.com/shipping/tracking/popup) pops up saying "Shipment #000000001".
How can I actually make this "track this shipment" work and actually show the tracking?
thanks! :)


texts:
Is there a way to import customer entity_id? I found solution how to export customer entity_id but when I try to import its not working. Still there is same number in ascending order. so 1,2,3,4,5,....

http://dltr.org/blog/magento/146/Magento-How-to-Export-Customer-ID-with-ImportExport-Profile


texts: Magento2 : Products showing "Out-of-Stock" in Frond-End and "In-Stock" in Backend

texts:
I am using Magento version 2.3.x  and when I add a downloadable product, it is showing out-of-stock in the front end. but it is showing in-stock in the back end.

how to fix this,
I have tried my best to fix this...
I have done reindex stock, Flush cache, etc .. but still, have the problem


texts: How to add approximate location from the end user to appear below product name?

texts:
We are developing a Rental based Website with Magento 2.

In the Rental product, there are options for both shipping and pickup.

If the product is pickup, then we want to show the approximate location of store from the end user under the product title as below screenshot.

How can I do that?

Could anyone please help me with this?


texts:
I try to get disabled products by sku. These products are not in flat table, so I can't use collections to find them.

I tried some methods to find products, but it doesn't work Magento 2.3.2:

Using productCollectionFactory :

$collection = $this->productCollectionFactory->create();
$collection->addAttributeToSelect('*');
$collection->addAttributeToFilter('sku', $query);

Using productFactory :

$productCollection = $this->productFactory->create()->getCollection();
$productCollection->addAttributeToSelect('*');
$productCollection->addFieldToFilter('sku', $query);
$productCollection->addAttributeToFilter('status',2);

And using search criteria :

$searchCriteria = $this->searchCriteriaBuilder->addFilter('sku', $query);
$result = $this->productRepository->getList($searchCriteria);
$product = $result->getTotalCount();

Any help ?


texts: Change Price of configurable quote item with observer

texts:
I want to change the price of a configurable product I put in my quote. I use the observer sales_quote_add_item but it won't work for configurable products.
I expect the observer method to run twice (for the simple and configurable record that's put in the database) but it's only called once (for the simple product). The record for configurable still has the old prices.

Can anyone tell me how I can change the price for the complete quote-item in such a way that it will also be seen on cart overview, invoices and emails?


texts: Facebook Business Extension throws an error when adding a variant of configurable product

texts:
FacebookBusiness extension was installed without problems a few days ago but no I have tried adding a different colour to my configurable product and keep getting this error.

Notice: Array to string conversion in /var/www/html/app/code/Facebook/BusinessExtension/Model/Feed/ProductFeed.php on line 107

            'main_image' => $this->_fbeHelper->getBaseUrlMedia() . 'catalog/product' . $mainImage,

this is a longer snippet
private function getProductImages(Product $product)
{
    $mainImage = $product->getImage();
    $additionalImages = [];

    foreach ($product->getMediaGalleryImages() as $img) {
        if ($img['file'] === $mainImage) continue;
    }
    return [
        'main_image' => $this->_fbeHelper->getBaseUrlMedia() . 'catalog/product' . $mainImage,
        'additional_images' => array_slice($additionalImages, 0, 10)
    ];
}

Magento 2.3.6


texts: Data migration issue : SQLSTATE[23000]: Integrity constraint violation from maento 1.9 to magento 2.4.1

texts:
I am migrating the data from Magento 1 to magento 2.4.1 by running the following command

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

But it throws the following error and stopped migration
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '137-24' for key 'CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID'
please refer to the attachment


texts: Magento 2: How to override mini-cart default template html file?

texts:
How to override
/var/www/html/magento2/vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html file in our custom theme?


texts:
I try to upload the product image but it give error

{"error":"$_FILES array is empty","errorcode":666}


texts:
Hello When clicking on manage categories and then clicking a sub category.
None of the data is loading up in the forms as seen below

So Checking in network console, I found this error below


texts:
I installed Magento 2 with Softaculous successfully. I only added code to .local host in Magento root for running 3 stores based on the same Magento installation (taking the code out does not make any difference to the issue below).

On 2 of my stores, after adding to cart and clicking "Go to Checkout' the screen only displays the 'logo and the 'order summary' without the 'shipping' step, see
https://babyplus.com.my/checkout
Same for my Contoursbaby (Malaysia) website.

On the third store however it consistently works fine, running the SAME Magento installation: https://babyfair.com.my/checkout

'Checkout with PayPal' works fine on all websites.

I had a well-known Magento extension developer have a look at this, however they could not find the solution.

Some background info: the website runs on shared hosting on Litespeed Server. We had to run php bin/magento setup:static-content:deploy to make images appear.


texts: Magento2 LESS extend/override custom theme

texts:
I have been going through research and tests for whole day and still found answers do not work for my case or I just do not understand how to properly implement them - therefore post here:

I have made a custom theme (not inheriting blank or luma; a standalone theme) in this path: app/design/frontend/CompanyName/default

And there I have css files (I am using grunt LESS) in this directory: web/css

There I have style files structured somewhat like this:

file1.less

dirA/file2.less
dirA/file3.less

dirA/dirB/file4.less

dirC/file5.less

Each style file is @import'ing next file, so all of them are chained together. For example, file1.less has line @import 'dirA/file2.less'; and so on.

I have added absolutely all less files to the dev/tools/grunt/configs/themes.js file, so that grunt know where and how to operate less files and generate css files.

With this theme everything is working just great.

Then I added another theme (which is child theme) in this path: app/design/frontend/CompanyName/newDesign. And it's parent theme is app/design/frontend/CompanyName/default;

Now I want to extend a css file in the child theme to change only one line, for example.

In newDesign theme I would like to extend less file which is located in this path of parent theme: web/css/dirA/file3.less.

How should this be properly handled?

As far as I understood, In child theme I have to create directory: web/css/source.

But what then? There should be only _extend.less file OR there I can make exactly the same folder and file structure as I have in the parent theme? - For example:

app/design/frontend/CompanyName/newDesign/web/css/source/dirA/file3.less
or it should be with _extend.less at the end, like this? -
app/design/frontend/CompanyName/newDesign/web/css/source/dirA/file3_extend.less
or I cannot make it like this at all? .., and I have to use only app/design/frontend/CompanyName/newDesign/web/css/source/_extend.less file?

In any solution that will come up here, I have another question, related to the source folder under web/css: which files from that folder I have to add to the dev/tools/grunt/configs/themes.js file of child theme properties?


texts: use theme colors while writing my template and blocks

texts:
Please take a look at the image below:

For the human eye its pretty clear that this site has a main theme color, which is the bluish color that the title, bars, and links share.

It's very rare to find a website that you can't define its main theme color(s).

Now here's my question: I'm writing an extension that add couple of blocks to the page (some divs, paragraphs, etc) and I want it to use the same color schemes as the general site. for example, a div with background the same as the toolbar, or the title.

How do I do it?

I looked at the css files Magento generated and I see for example that the top toolbar ("YOUR LANGUAGE") get its color from a class called "header-language-background", while the title get the color from a class called "logo", and the button get his color from the css for buttons in general...

So now that I want to use that color too, is there a proper way in Magento / css / something?

Thanks!


texts: Magento2: How to add css file in admin backend for RTL?

texts:
I want to add custom css in backend that only work when user change the Arabic language from admin side.

How can I add css for backend on conditional basis?

Can any one help me on this which would be much appreciated for this.
Please help me on this.


texts: Magento 2: Class 'ObjectManager' not found

texts:
I have a cron to launch to erase a database table,
here is the cron

<?php
    require_once 'Controller/Adminhtml/NewProduct.php';
    $cron=new \Managys\Pricing\Controller\Adminhtml\NewProduct();
    $cronGo = $cron->GetNewproduct();
?>

Class New Product:

class NewProduct
{
public function GetNewproduct(){
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('mp_new_products');
....}

in order to call this cron I have an error


texts: Update products from CSV using import behavior Update only not add new

texts:
Can we update products from CSV but skip new products just update products that already exist. Like I have a CSV which has data with SKUs some already exist some are new but I want to update products not to add new ones when I use import behavior add/update

it updates products but also add new products from new SKUs. Can we make a custom import behavior that just updates only not add new products?


texts: Checkout Process is Stuck and loader never disappears in magento 1.9

texts:
I have created a replica of production environment,but on dev environment checkout process is stuck and loader(shipping,payment and review) never disapears but everything works fine on production environment.I tried almost every solution but nothing worked.I cleared cache and reindex,but issue still persists.
Production URL: https://thesparescompany.com
Dev URL: http://103.86.181.76/thespares/

The code based and DB is same,so ideally there is no code level issue and no console error also.Any guide to resolve the issue would be really helpful.


texts:
automatic generation of dir/files under pub/static not working. When i google about this find that i have to delete that file in which i did change and then run below given command.

php bin/magento setup:static-content:deploy

But there must be another way. because every time i cant run this command when change code in css file. And update css file under pub/static and upload final css file in last under theme and then run content is also not a solution.

i read on stack-overflow about .htaccess file must be under pub/static but that file also not work. it was removed so i add again file under pub/static/.htaccess But it does not work.


texts: How can I show select options in Magento grid

texts:
I have created a module that is using admin Grid.php. I have created three tables to add and retrieve data but I am unable to get the data from one my models to show inside the dropdown select of Grid.php file.

The problem I have is that for some reason I cannot get the data from on table to show in a dropdown select.

Please see code below:

  $this->addColumn("region", array(
            "header" => Mage::helper("modulename")->__("Region"),
            "type" => 'options',
            'options'=> Mage::getModel('modulename/region')->getRegions()
            ));

The above adds a Region column to the grid and gets data from my model

Model/Region.php

 protected function _construct(){

       $this->_init("modulename/region");

    }

    public function getRegions() {

        $regionsArray = array();
        foreach($this->getCollection() as $region){
        $regionsArray[$region->getId()] = $region->getTitle();

        }
        return $regionsArray;

    }

However the following column is what is causing the issue

        $this->addColumn('state', array(
        'header' => Mage::helper('modulename')->__('State'),
        'index' => 'state',
        'type' => 'options',
        'options'=> Mage::getModel('modulename/customerstate')->getState()
        ));

I can't seem to get the data from my model to show inside the options

protected function _construct(){

   $this->_init("modulename/customerstate");

}

public function getStates() {

    $statesArray = array();
    foreach($this->getCollection() as $state){
    $statesArray[$state->getId()] = $state->getState();

    }
    return $statesArray;

}

Customerstate DB Table

+-------+----------+
|  s_id | state    |
+-------+----------+
|     1 | pending  |
|     2 | active   |
+-------+----------+

I have no idea why this is happening and could do with some advice to help solve this as I have been going round in circles for hours - I'm not getting an error just an empty select option on the grid...


texts: Mage 2.1.1 short codes front end rendering

texts:
I'm new to Mage 2 but familiar with M1. This is a M2.1.1 site

I'm attempting to output a static block in the product description by entering short code in the wysiwsyg editor like so:

{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}}

Even entering it in non-wysiwyg mode results in the same output:

{{block class="Magento\Cms\Block\Block" block_id="block_identifier"}}

is outputted rather than the static block.

However, if I use a widget to render the static block, all is ok.

Am I missing something fundamental - do I need to assign permissions to static blocks like in M1? Or is it possible that the template is at fault?

ps - what happened to the add widget/block buttons on the wysiwyg editor??


texts: GetOrderPlaceRedirectUrl Doesn't redirect to the gateway secure page

texts:
I have the following issue, I generate payment module from the website: http://cedcommerce.com/magento-2-module-creator/payment-module

After deploying it and install it on my Magento 2 site, I can see the new payment module in the admin panel and on the checkout page. now I am trying to make a redirect to the secure page of the gateway payment by overriding the method getOrderPlaceRedirectUrl like that:

Now I expect that on the checkout page when I select the new payment I will be redirected to the secure page of the gateway payment, but it didn't happen, I am using Magento 2.1.


texts: Fresh installation, design issue with new products block

texts:
I've installed fresh magento 1.9.1.0 and I have a problem with new products block on homepage. New product images are too large. They should have been 260x260px but they are way larger than that.

I saw that file catalog/product/new.phtml is called but actually the file new.phtml does not exist on server, but on the previous version (1.9.0 i have installed on my local machine) does have that file. Here is a version in development to see what is going on - moodyandgloo.com


texts: Two exact same stores, one with https + varnish and redis for page cache is slower than disk cache?

texts:
PHP, code and server exactly the same.

Site 1:

Varnish cache
HTTPS + SSL termination with nginx
redis for default cache
redis for page cache (same instance)

Average page time is 4281.0983896255

Site 2:

Normal page cache
No HTTPS
No redis (file cache)

Average page time is 2556.9653511047

I know that magento recommends the default cache be on a different redis instance than the one running the page cache.

Would that be the main reason or is it perhaps the Https causing the slow response.

Speed results conducted using wfpc


texts:
I have a Magento website that I want to talk to the system that manages our stock. Developers have already developed that side of the system and they have given me SOAP methods to call, that get stock quantity, create orders, get customer id, etc.

How to I go about getting the Magento site to call these methods? Is there a plugin I can use or do I need to write everything my self, etc?

any assistance on how to use SOAP in Magento would be helpful.


texts: Shipping: UPS - Error 10001 The XML document is not well formed

texts:
I'm trying to setup UPS XML Configuration in Magento.
But the shipping_ups.log always tells me following error:

<Response>
    <TransactionReference>
        <CustomerContext>Rating and Service</CustomerContext>
        <XpciVersion>1.0</XpciVersion>
    </TransactionReference>
    <ResponseStatusCode>0</ResponseStatusCode>
    <ResponseStatusDescription>Failure</ResponseStatusDescription>
    <Error>
        <ErrorSeverity>Hard</ErrorSeverity>
        <ErrorCode>10001</ErrorCode>
        <ErrorDescription>The XML document is not well formed</ErrorDescription>
    </Error>
</Response>

What am I doing wrong?


texts: Execute helper function from Magento extension upgrade script

texts:
I have created and maintain Magento extension (responsive banner slider) but have run into an issue.

I have added functionality based on the HTML5 picture element which will be supported by browsers in the future (the current implementation is a javascript polyfill implementation based on HTML5 specification). The picture element allows to deliver an appropriate image to every user depending on a variety of conditions like screen size, viewport size, screen resolution and thus saves bandwidth/load time on mobile devices. For this I have built functionality that will create smaller sized images for every banner that is uploaded through my extension.

FO user who upgrade from a previous version these smaller images will need to be batch created for all existing banner images. But what I cant seem to find out is how to trigger a helper function that will perform this action and is only run once after the upgrade from the current version to the future version which where this functionality will be implemented. I know how to write upgrade / data scripts but this only allows for database manipulation. Can someone point me in the right direction on how to implement this.


texts:
Product add functionality is working but update functionality is not working.

Please help


texts: redirect htaccess from lowercase letters to uppercase magento using .htaccess

texts:
redirect htaccess lowercase to uppercase after

http://example.com/catalogsearch/result/?q=

From: http://example.com/catalogsearch/result/?q=apple

To: http://example.com/catalogsearch/result/?q=APPLE

thanks


texts: Magento2.3.0 In product edit go to advance pricing there calender icon not proper showing

texts: I am using Magento2.3.0 and go to admin side product edit inside advance pricing  there special price inside calender icon not proper showing please if you have any idea how to resolve it


texts:
<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?> - <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>

It's breaking it down like this

TITLE -

short_desc

Edit:
We've figured out that it has something to do with the Cart2Quote extension we are using. For some reason whenever we try and get the short description it just won't work. It works on our other template files.

Not sure if anyone has had this problem before.


texts: Developing a search function via API SOAP

texts: I'm developing an application for Windows Phone OS that works with Magento SOAP API v2. Basically my app should show all the products and need a search function to search a particular product in the site. As i know there is no method in API call for magento to search for the product. So how can i implement a search ? Any suggestions. I'm beginner to develop and API based app.


texts: How to get parent SKU from associated simple product in Magento 1.9?

texts:
Here is my code, but it is only generating the simple product SKU where I want to get it for the configurable product page also. I used it to restrict a block on a simple and configurable product page.
$_cId = 0;

if(Mage::getSingleton('customer/session')->isLoggedIn()) {
    $customerData = Mage::getSingleton('customer/session')->getCustomer();
    $_cId = $customerData->getId();
}

$orderItems = Mage::getResourceModel('sales/order_item_collection')
    ->addFieldToFilter('sku', $this->getProductInfo()->getSku())
    ->toArray(array('order_id'));

$orderIds = array_unique(array_map(
    function($orderItem) {
        return $orderItem['order_id'];
    },
    $orderItems['items']));

$orderCollection = Mage::getResourceModel('sales/order_collection')
    ->addFieldToFilter('entity_id',   array('in'  => $orderIds))
    ->addFieldToFilter('customer_id', array('eq' => $_cId));
$orderCollection->getSelect()->group('customer_id');

$customerCollection = Mage::getModel('customer/customer')->getCollection()
    ->addFieldToFilter('entity_id', array('in' => $orderCollection->getColumnValues('customer_id')));

foreach ($customerCollection as $customer) {
    // Code
}


texts: Ignore specific path when running setup:di:compile in Magento 2.2.2

texts:
Is there a additional command to add to setup:di:compile command to ignore a specific path compilation?

In Magento 2 this could be done with additional parameter --exclude-pattern, but in Magento 2.2 no more.

  I need to set production mode and there is a module that is
  blocking setup:di:compile. I tried to disable module but did not
  work.


texts: Import bulk Products with mixed categories, types & multiselect attributes

texts:
I have a situation where I need to upload bulk products, the CSV or XLS will contain products that may belong to different categories and may have many product types.Also the product will contain attributes that are multiselect ( eg zip codes here a product can be associated with on eor many zip codes). and suppose a product is already present[can be identify by name or product code] in DB during a import it will update the product multiselect attributes instead of creating a duplicate entries.

Now the question is that what strategy should I approach, with normal magento import functionality is that possible ? And if I go for Magmi or some other tools how I need to go ahead with my CSV or XLS ? Their is no inventory associated with product, its more like virtual.
So is it possible with a single csv or xls to do the import and update ?
Moreover is it possible in magento ?


texts: Migration Magento1.9.4 to Magento 2.3.0 Setting command after error

texts:
When I run migration command

sudo php bin/magento migrate:settings --reset

  vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.4.0/config.xml

after below error showing..

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'principal' for key 'STORE_GROUP_CODE'


texts:
I've been trying to get the banner name in the code below without success.

    <?php $bannersContent =  $this->getBannersContent() ?>

    <?php foreach ($bannersContent as $bannerId => $content): ?>
        <li name="banner-<?php echo $bannerId; ?>" onclick="dataLayer.push({
   'event':'promotionClick',
   'ecommerce': {
     'promoClick': {
       'promotions': [

    {
        'id': '<?php echo $bannerId; ?>',
        'name': '<?php/*  echo $bannerId->getData('name'); */ ?>',
        'creative': '',
        'position': '',

    },

]
    }
  }
});"><?php echo $content?>

    <?php endforeach; ?>

Any ideas about how to do this?


texts: magento admin controller action showing page 404

texts:
I have created module but its controller action not working.
At admin i set form action to my cotroller method action like http://localhost/icebox/index.php/admin/customtab/index But it show page 404.

Please suggest me why admin Controller action not working, Where i did mistake.
Thank you

Here is my Config.xml file script

<?xml version="1.0"?>
<config>
    <modules>
        <Icebox_Mytabs>
            <version>0.1.0</version>
        </Icebox_Mytabs>
    </modules>
    <global>
        <blocks>
            <mytabs>
                <class>Icebox_Mytabs_Block</class>
            </mytabs>
        </blocks>
        <models>
            <mytabs>
                <class>Icebox_Mytabs_Model</class>
            </mytabs>
        </models>
    </global>
    <admin>
         <routers>
            <mytabs>
                <use>admin</use>
                <args>
                    <module>Icebox_Mytabs</module>
                    <frontName>icebox_mytabs</frontName>
                </args>
            </mytabs>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <mytabs>
                    <file>mytabs.xml</file>
                </mytabs>
            </updates>
        </layout>
        <events>
            <catalog_product_save_after>
                <observers>
                    <fishpig_save_product_data>
                        <type>singleton</type>
                        <class>customtab/observer</class>
                        <method>saveProductTabData</method>
                    </fishpig_save_product_data>
                </observers>
            </catalog_product_save_after>
        </events>
    </adminhtml>
</config>


texts: Magento sometimes loading wrong CSS file

texts:
I am using a custom theme for my Magento store with a bunch of custom modules. Everything works correctly 99% of the time, but I notice occasionally in the Server logs that Magento is looking in the wrong place for my CSS file, as if the theme isn't loaded. But when I visit the accused URL, it loads fine.

Log Examples:

[Sun Nov 16 15:18:13 2014] [error] File does not exist: (root)/httpdocs/skin/frontend/base/default/css/suggest.css, referer: http://www.comstarsupply.com/suggest/cart/add/product/7413
[Sun Nov 16 16:07:09 2014] [error] File does not exist: (root)/skin/frontend/base/default/css/magicmile.css

You can visit those URLs and see that everything loads correctly, so I'm not sure how this can be happening. Any thoughts on where I could start to track down the problem?


texts: Magento2 Extensions how to set a module enable activation key

texts:
I have a Extension. How to set a module activation key for customers. if i set a PHP code then someone is commenting that code and run that extension.please provide a best solution.

Thanks in Advance


texts: Security Patch SUPEE-9767 - Possible issues?

texts:
A new security patch is out for Magento 1, addressing 16 APPSEC issues: https://magento.com/security/patches/supee-9767

Seven of the vulnerabilities score 8.0 or higher for CVSSv3 Severity, and they are being exploited in the wild, so this is a critical patch. Sites can apply SUPEE-9767, or update to the new release CE 1.9.3.3 / EE 1.14.3.3.

What are common issues or pitfalls to watch out for when applying SUPEE-9767?

UPDATE 2017-07-12:

Magento has released SUPEE-9767 V2 and CE 1.9.3.4 to address many of the issues from the initial patch. If you applied V1, you should revert and then apply V2. If you haven't patched yet, just apply V2, and most of the issues brought up here will not be relevant.


texts: Remove product images from directory via script

texts: I need to remove all product images (small, thumbnail and base) from directory. What would be a better way to do this?


texts: Magento2 : Display MSRP with MAP disabled?

texts:
In Magento 2, if I set 'enable MAP' to 'No' in Stores > Configuration > Sales > Sales It removes the MSRP field in Advanced Pricing from the product page.

My goal here is to display MSRP on the product page next to the actual price without the need for a popup but it seems like Magento 2 will not allow this by default.

Am I correct?


texts: Magento 2 Issue with JavaScript and CSS Merge

texts:
I have checked my site for speed and it was requesting 258 requests.

I have merged all JavaScript and CSS files and again tested it but still 251 requests are there.

While in view page source I can't find 251 requests. there is only one for CSS and 1 for JS.

So why it's showing on https://gtmetrix.com and other speed test sites.


texts: Admin email notifications when new customer register

texts:
I want that when a new customer is registered on the my magento site, the admin was notified by email of the new customer registration.
Tell us how to do it better?
Thanks


texts: Add default filter to sales_order_grid for order status

texts:
I want to filter the order grid in admin to see only the orders in status "processing" in the grid by default.

This grid is different from the others, I tried solutions from here but no success

add default filter for admin grid magento2
To add default filter to grid in Magento2?

In magento 1 I have done this with an observer on "controller_action_predispatch_adminhtml_sales_order_index"

Do you have any idea on how to do that ?

Thanks you

EDIT 1 : This is the code I used in Magento 1 to do this with the event:

<controller_action_predispatch_adminhtml_sales_order_index>
                <observers>
                    <set_default_filter_sales_order>
                        <type>singleton</type>
                        <class>Gone_PreparedGridFilter_Model_Adminhtml_Sales_Order_Observer</class>
                        <method>setDefaultGridFilter</method>
                    </set_default_filter_sales_order>
                </observers>
            </controller_action_predispatch_adminhtml_sales_order_index>

And in my file :

public function setDefaultGridFilter(Varien_Event_Observer $observer)
        {
            $request = Mage::app()->getFrontController()->getRequest();

            if (! $request->getParam('filter')) {
                    $filter = $this->_getDefaultEncodedFilterString(); //custom function
                    Mage::app()->getFrontController()
                        ->getRequest()
                        ->setParam('filter', $filter);
            }

            return $this;
        }

My goal is to have the grid filtered by the status when you arrived on it but to be able to modify all filter including the status one.

Edit 2

Does anyone have a solution for this, I'm still looking for a solution. I don't want to use the grid view save tool.


texts: Magento2: How to remove .html from product url of category

texts:
I need to remove .html from product url
Eg:
Product url https://www.test.com/category.html/product.html to https://www.test.com/category/product.html

Thanks


texts: Add Javascript File To Head For Create Block

texts:
I need to create a block programatically (for various reasons):

$myblock = Mage::app()->getLayout()->createBlock('namespace_module/path', 'my_block', $params);

This works fine, but the controller action is skipped over when doing this. I mean, it is, right? Therefore, my XML layout file is ignored, which contains:

file: app/design/frontend/base/default/layout/namespace_module.xml

<layout>
    ...
    <reference name="head">
        <action method="addJs">
            <script>namespace_module/script.min.js</script>
        </action>
    </reference>
    ...
</layout>

I have tried adding the JS file programmatically as follows, but I get nothing at all:

Mage::app()->getLayout()->getBlock('head')->addJs('namespace_module/script.min.js');

I will also need to reference the CSS file. It's late, so this could be a stupid error. Any guidance/advice welcome. Thank you.


texts: Change standard invoice address in checkout

texts:
When customer add a new invoice address in checkout, this new address will be add as new address but ist not the standard for the next order. This is inconvenient, because normaly the invoice address only change after relocation.

How can I change the process, so that the last added invoice address is the standard for the next purchase?


texts:
i am want to run a promotion(with discount coupons) , so i want to create a Shopping Cart Price Rule  which will start in the future dates (admin shouldn't be able to select the old dates in the "from date" field  ,
everything else is working fine other than disabling old dates in the "from date" field calendar


texts: How to add JS messages from custom module?

texts:
How do I add messages using Magento 2 Ui messages to page via javascript from a custom module?

I have found a file in Magento/Ui/view/frontend/web/js/view/messages.js that appears to be responsible for adding messages to the page, in the same manner as the php message manager interface.

Am I mistaken? If not, how can it be used to add errors and success messages like the php version?


texts: How do I create date input field with calendar in Magneto2? [SOLVED]

texts: I want to create a date input field with calendar control where I can change year and month by drop down.


texts: Custom controller action to specific path in magento 1.9

texts:
how to redirect the custom controller path to specific store name

http://testurl.com/testmodule/index/testview/id/123/

to

http://testurl.com/testname

thanks


texts: How to enable ssl on checkout process only instead of whole site

texts:
i have configure ssl in my store but it is enable on whole site which have slightly slow down my site i want to enable https on confidential part of store like checkout process, login, register  and want other pages with http from different source my configuration is like this

still it my checkout not work with https.kindly help thank


texts: how to create custom options file in magento 2

texts:
In my custom module , I just created a custom form using ui- component and added select formelement but don't know how to add custom options?

<formElements>
            <select>
                <settings>
                    <options class="module\module_name\Model\Config\Source\options"/>
                </settings>
            </select>
        </formElements>


texts:
According to this article http://alanstorm.com/magentos_many_404_pages/
there is three 404 pages in Magento:
1 The one dispatched by the apache
2 CMS page
3 Generated via layout XML

If I need to create my own distinct 404 page, that has different design from default Magento 404, the best way is probably 'Adding custom Layout XML Updates to the handles cms_index_noroute and cms_index_defaultnoroute', right?

What I did:

1 New module

2 <frontend>
        <layout>
            <updates>
                <mine_eshop>
                    <file>mine/eshop.xml</file>
                </mine_eshop>
            </updates>
        </layout>
    </frontend>

3

<cms_index_defaultnoroute>
    <remove name="right"/>
    <remove name="left"/>

    <reference name="content">
        <block type="core/template" name="mine_no_route" template="mine/404.phtml"/>
    </reference>
</cms_index_defaultnoroute>

And now I got my custom template right below the default one. And this is inside default Magento page layout.

There was no 404 CMS page configured or found.

New 404

How to display only the custom 404.phtml on the page in case of that error?
They say there is no 'right' way to do it and it is pretty frustrating. What are the best practices of creating a custom error pages?


texts: I have a Magento store with 2 store views on 1 website. I want the default search function to just show items in that 1 store view thats been selected. How can i do this please?


texts:
This event will work before saving the product because i need one observer which will work before product save.
"catalog_product_prepare_save"


texts: Magento 2.2.2 Products Not Showing Category and List Page

texts:
I have a real hard time solving this issue.

The issue is products Not showing on front end Category Pages and Product Listing Pages after import via CSV -

Just shows We can't find products matching the selection.

However, if I go to the product in Admin and then RE-SAVE without Any changes  -  and clear cache that product

will show in front end - on product listing pages and category pages - and shows in Layered Navigation

One thing I noticed is that After resaving the product in Admin - it automatically is adding Color Black to the

product - even if I haven't selected it -

I then tested my import file by adding color Black to the products in the import file to check if they show on

front end  - but this did not fix the issue

In the database table, I also noticed for the resaved products and after it adds Black to the color_value column

and color column  49

I tried to match these settings for the products which were not resaved in admin but again these still did not

show on the front end

I imported over 30000 via CSV - all

1.are showing in Admin

are showing under the correct categories in Admin
Can be seen on the front end by going direct to the product page itself
Tested with making products in stock with qty 10  and out of stock with qty 0 -  both will not show in

product listing/category pages until they have been resaved in admin

Run reindex and cleared all caches

I have set Magento to Display out of Stock Products

The Qty for the products and is_in_stock   values are set correctly after import and also the products are

enabled

I have tried to export the products which I have resaved and show in product listing pages and then match each

attribute for the import -   however after import again the products NOT saved in Admin don't show on the front end

category and product listing pages.

Spent over 4 weeks on this and tried a lot of things and trial and error.

I checked the database table catalog_product_flat_1   and checked all attributes imported and compared the ones

showing on the front end and the ones which are not - and they made them identical however they still will not show

on front end unless the product has been resaved in the admin.

This is the same case when importing via another extension or application for Magento, for example, Firebear - this

the issue is happening whenever or whatever I use a CSV import.

Another issue is that if I resave the products and they then show on the front end - when I update those same

products via CSV import -  the values for example price and qty and is_in_stock   only change in admin and not

in front end - on product listing category pages -    I then have to resave again   and clear cache then the

updated changes are reflected on the front end

I am really stuck on


texts: Delete Magento 2 product custom option programmatically

texts:
I created magento 2 custom option programmatically like this:

    $options[] = [
                        'title' => 'cthulu',
                        'type' => 'field',
                        'is_require' => false,
                        'sort_order' => 2,
                        'price' => 0,
                        'price_type' => 'fixed',
                        'sku' => 'cthulu',
                        'max_characters' => 20,
                    ];

    $options[] = [
                        'title' => 'comment',
                        'type' => 'field',
                        'is_require' => false,
                        'sort_order' => 2,
                        'price' => 0,
                        'price_type' => 'fixed',
                        'sku' => 'comment',
                        'max_characters' => 50,
                    ];

foreach ($options as $option) {
                    $customOption = $this->customOptionFactory->create(['data' => $option]);
                    $customOption->setProductSku($product->getSku());
                    $customOptions[] = $customOption;
                }

                $product->setCanSaveCustomOptions(true)
                ->setOptions($customOptions)
                ->setHasOptions(true)
                ->save();

the custom option save successfully, now i want to delete the custom option programmatically, is there a way to do this?


texts: Coupon Code £5 off / £50 spent, £10 off / £100 spent (but not 10% off)

texts:
I want to make a single code which gives you £5 off per £50 spent...

So if you spend £250, you get £25/off however if you spend £220 then you only get £20 off. (Note that its not 10% off...)

Any thoughts on how to do this would be great

Thanks

Henry


texts: How to create order programmatically in Magento 2?

texts: I have special order form and now I need to create orders without payment. So the payment needs to be skipped. I am not sure what would be the best way to accomplish this part. Should I send my form data as JSON to REST API like how it's doing in the default checkout module and current theme? Or it would be better and easy to have my own controller and model where I can use some factory methods to create orders like what we did in Magento 1.x?


texts: Remove is not allowed error as described in var logs

texts:
Following error in  var/log/system file

or it is appearing in main site .

I have seen these files even in vendor also but issue is still there .

I have removed var/cache , var/generated , var/view_preprocessed

almost i did everything but issue is there .


texts: How to remove some option from admin condition field in magento 2

texts: How to remove some option from the admin condition field in Magento 2


texts: how to remove index.php from all website url

texts:
My website name is wizer.in my website issue is each & every page of our website have index.php extension Like contact us page url is look like

wizer.in/index.php/contact-us.html

Please tell me the process to remove index.php from all urls of Megento website.


texts: Magento Print an individual Customer Group Price List in phpMyAdmin

texts:
I have a few different customer groups setup. Please help to write an SQL script that runs directly in phpMyAdmin for a list of "group price" for a customer group (id = 68 in my case). My desired result are columns: SKU, Name, Group Price

I tried 2 codes below which did not produce my desired result. I'm a web designer :)

SELECT *
  FROM catalog_product_entity_group_price
 WHERE catalog_product_entity_group_price.customer_group_id = '68';

and

   SELECT catalog_product_entity_group_price.*, catalog_product_entity.sku as sku
     FROM catalog_product_entity_group_price
LEFT JOIN catalog_product_entity ON catalog_product_entity.entity_id = catalog_product_entity_group_price.entity_id
 GROUP BY catalog_product_entity_group_price.customer_group_id = 68;


texts: I have a custom grid in admin. I want to add a custom filter in this grid, which doesn't take value from database while filtering but from a particular column radius where data is set dynamically. Basically i want to modify the custom filter to take value from grid rather than from database. How can i achieve this.


texts:
Error : upgrade magento 2.2.6 to magento 2.3.0
To upgrade the website, I used the following blog
https://www.webcreta.com/how-to-upgrade-magento-2-2-x-to-2-3-0/
But when I run the composer update command, I got the following error

I checked all solutions on https://magento.stackexchange.com/ but I can't found any solution.
Please suggest a solution.
Thank you so much.


texts: How to send email in Azure with Magento installation

texts:
We have a Magento 2.4 CE installation in Azure Linux VM but we can't find an email provider that can be used to send all the emails.
We found Send Grid but it requires username and password to send an email and in default installation, there are no such settings availanle except the host and pot.
Please help.


texts:
I have included contact us form in cms page using below code

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

But after doing this, message after submitting the form is coming twice.

How this can be rectified? Any help will be appreciated.


texts: Magento2 Apply catalogrule on final price instead original price

texts:
I have create catalog rule for all products by 50%
if product has original price 100
special(final) price 80
then after apply catalog rule it reduce by 50(100%50).
I want it 40(80%50).


texts:
I need to pass a parameter in the URL line like this:

http://domain.com/website/checkout/onepage/quotation/1

When i try this i have a error page.


texts: Getting error on Module submission on Magento 2

texts:
I have submitted my module in magento 2 marketplace. My module got rejected on technical review and shown below error:

  Environment: Operating System - Centos 7, PHP Version - 5.6.30, Magento Platform - 2.1.5 CE

Command: composer require propellents/testimonials:1.0.0'
Installation issue: Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for magento/magento2ce 2.1.5 -> satisfiable by magento/magento2ce[2.1.5].
- propellents/testimonials 1.0.0 requires magento/framework ~100.0.4 -> satisfiable by magento/framework[100.0.4, 100.0.5, 100.0.6, 100.0.7, 100.0.8, 100.0.9, 100.0.10, 100.0.11, 100.0.12, 100.0.13, 100.0.14, 100.0.15].
- don't install magento/framework 100.0.4|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.5|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.6|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.7|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.8|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.9|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.10|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.11|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.12|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.13|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.14|remove magento/magento2ce 2.1.5
- don't install magento/framework 100.0.15|remove magento/magento2ce 2.1.5
- Installation request for propellents/testimonials 1.0.0 -> satisfiable by propellents/testimonials[1.0.0].

    Installation failed, reverting ./composer.json to its original content.
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] sh
    [DockerOperationsPHP56Magento21CE] Running shell script
    + echo Failure
    Failure

After solving above error now I am getting below error.

Environment: Operating System - Centos 7, PHP Version - 7.0.15, Magento Platform - 2.0.13 CE

Command: deploy:mode:set production
Installation issue: Enabled maintenance mode
Static content deployment start
Requested languages: en_US
Requested areas: adminhtml, frontend
Requested themes: Magento/backend, Magento/blank, Magento/luma
=== adminhtml -> Magento/backend -> en_US ===
=== frontend -> Magento/blank -> en_US ===
=== frontend -> Magento/luma -> en_US ===
......................................................................................................................................................
Successful: 2054 files; errors: 0
---

..
Successful: 1981 files; errors: 0
---

Successful: 1849 files; errors: 0
---

=== Minify templates ===

Successful: 854 files modified
---

New version of deployed files: 1492507317
Static content deployment complete
Start compilation
Command returned non-zero exit code:
`php -f /var/www/html/bin/magento setup:di:compile-multi-tenant 2>&1`
+ '[' ']'
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (indexer:reindex)
[Pipeline] sh

Anyone who can help. I have prepared my module and about to publish it. But not able to rectify this issue. Please help me to solve the issue.


texts: Adding a static block to all pages (left column)

texts:
I somewhat understand how to add static blocks but this issue seems a little different.  Here is the situation, I just had a year make model module installed to my magento installation, and that created two phtml files.  The installers created a CMS page that had the following callout in it to make the page.

{{block type="core/template" template="catalog/product/ymme-search.phtml"}}

Now my issue is that this is suppose to show up in the left column not being a page of it own.  How do I take that same callout and make it a static block and/or add it to the left column, where it is suppose to be?


texts: Delete button on Mini cart popup not working and turning screen black on home page magento 2.2

texts:
I'm having an issue on magento 2.2,

The Delete button on Mini cart popup is not working and turning screen black on home page

strangely when you click the delete icon the screen just darkens and and gets darker every time you press it until its just black,

This image is before you click the delete icon:

here it is after clicking it:

and it gets darker on every press,

This doesn't happen when not on the home page,

in other pages such as the catalog, you can just delete from the cart normally,

anyone know why this is happening and how to fix it?

Thanks in advance,

Gavin


texts:
In Magento 2.3 EE, entity_id is missing in EAV tables, instead row_id is available

  Please explain the difference between row_id and entity_id and the
  removal of entity_id in EAV tables


texts:
I want to extend default "Only x left" message. Can you tell me which file controls it?

At the moment message is visible only when stock is less than qty threshold. I want if stock is more than qty threshold, to show message "More than qty threshold" and if sock is 0 or below 0(I have activated backorder)  to show "Orderable with delivery" message.


texts:
Does Magento Enterprise have any means of using read replicas when using Redis as a back-end cache? If not, any tips on how this could be added?

Magento uses Credis_Client by Colin Mollenhour, who also offers a Client_Cluster class: https://github.com/colinmollenhour/credis/tree/74b2b703da5c58dc07fb97e8954bc63280b469bf However, I don't see this included in Magento by default.


texts: Use a Data Grid Table to assign values to an EAV attribute in admin

texts:
I have a custom attribute for Catalog Categories that represents the IDs of products associated with the category in question (this is a separate requirement from the usual association of products and categories). The values are stored as comma separated values in the db.

How would I go about using a data grid to select the products I want to add to this attribute? Ideally, I want it to be more or less the same experience as adding products to a category, but I need to to update my custom attribute.

I added the below to app/code/company/module/view/adminhtml/ui_component/category.form.xml - but as you'd expect this just updates the native product/category association.

    <fieldset name="associated_products">
    <settings>
        <collapsible>true</collapsible>
        <label translate="true">Associated Products</label>
    </settings>
    <container name="assign_products_container">
        <htmlContent name="html_content">
            <block name="gallery" class="Magento\Catalog\Block\Adminhtml\Category\AssignProducts"/>
        </htmlContent>
    </container>
</fieldset>

This is the kind of thing I'm after:


texts:
After changing Base URL to https & Base Link URL to {{secure_base_url}} in Admin > System > Configuration > Web > Unsecure,  website is stuck in redirect loop !

  This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS message

Now I can't access to the site and admin panel.


texts: how to properly get product base image without heavy lifting requests?

texts:
In magento2, I am using this function to get base image for product, but when products are more than 1k performance is awful.

In this code _galleryHandler is \Magento\Catalog\Model\Product\Gallery\ReadHandler and $_product is product item from collection

protected function _getProductBaseImage($_product)
{

    $this->_galleryReadHandler->execute($_product);
    $imageUrl = $_product->getMediaGalleryImages()->getFirstItem()->getUrl();

    return $imageUrl;
}

What is more efficient way of doing this ?


texts: Paypal: use Magento product ID instead of SKU

texts:
I've recently started using PayPal as an alternative option for customers and I noticed that on the PayPal site that the products SKU is being displayed. For continuity of my website, I would like to display the product ID instead.

I have done searches with grep in /app/code/core/Mage/Paypal to find getSku but cant find anything.

Where does the Magento PayPal module get the product SKU? and How can I replace it with the ID? ($_product->getId()) ?


texts: Cannot call methods on modal prior to initialization; attempted to call method 'openModal'

texts:
This error is generated when i want to show popup when page load in magento2. Here I mentioned code of popup. In popupWidth and popupHeight there are height and width value store.

    require(['jquery','Magento_Ui/js/modal/modal'],function($,modal)
{
        var options =
        {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                slideshowSpeed: 8000,
        };
        var popupWidth = $("#popupWidth").val();
        var popupHeight = $("#popupHeight").val();
        var popup = modal(options, $('#popup-modal'));

        $('#popup-modal').css("display","block");
        $('#popup-modal').modal('openModal');
        $("footer button").remove();
        $(".modal-footer").css("border-top","0");
        $(".modal-popup._inner-scroll .modal-inner-wrap").css("width", popupWidth);
        $(".modal-popup._inner-scroll .modal-inner-wrap").css("height", popupHeight);
        function close()
        {
          $('#popup-modal').modal('closeModal');
        }
});

But it display cannot call methods on modal prior to initialization; attempted to call method 'openModal' this error message.

How to solve it?


texts: I install SSL but still getting some http content on my site

texts:
I install ssl and enable , i also change use secure url:yes for frontend and backend as well. but when I change base_url then site can not load error occur. my magento store on cloudfare. i cleared a cache also, but getting same result. can any one help me?

magento version:1.9.3.4.

If i put below code in .htaccess than magento give 500 Internal Server Error
.htaccess file

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://fashionwithdeals.com/ $1 [L,R=301]

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Afer Select "Full SSL" on cloud fare , getting below error :


texts: Hide Cash On Delivery Payment even when it is enabled

texts:
I am using the defaut payment method called Cash On Delivery Payment.

The method is enabled and it shoud stay like that.

I want just to hide the method from the checkout page.

Where are the files for this payment method, I want to edit them and make this method simply to not appear.

How can I do that ?


texts: catalog_product_collection_load_after - identify the "right" collection

texts:
I want to do some processing on the products list (the products shown when browsing categories etc) before they are rendered.

I tried using the catalog_product_collection_load_after event, but its called on any products collection used, which include things like recently viewed items, related items, etc. and I only want to react on the time its called for the actual main products list.

I tried to filter the events by checking things like block type/name, controller name, page category etc, but they all proved to be insufficient to distinguish between the event on the main product list and other spam.

so my question:

how can I edit the products list before they are shown via events (eg without editing Magento core code / temlates)?
if your answer is "observe the catalog_product_collection_load_after event": how do I know which of the many product collections loaded is the main products grid?

thanks!


texts:
I would like to know if it's mandatory to create a module whenever we need to add some functionality to Magento even for one block for example, and what is the best way to organize them locally ? The organization is very important.

Exemple :

I have to add one block, one template to manage some custom view.
I have to add one controller, one block, one template to manage promotions.
I have to add an upgrade script to create some attribute.

Now, as they are a small modules, is it worth creating a module for each, or the better is to group the all in one module "Others" for exemple which we can put all the small additions and this avoids overloading Magento with the modules ? what do you think ?


texts: Magento 2 Add Bundled Product to Cart Programmatically

texts:
I'm trying to figure out how to add a bundled product to cart programmatically in Magento 2 with custom options.

In Magento 1 I could achieve it with the following

$params = array(
    'product' => 14,
    'related_product' => null,
    'bundle_option' => array(
        13 => 23,
        20 => 24,
        14 => 25,
        16 => array(
            0 => 21,
            1 => 12,
        ),
    ),
    'options' => array(
        5 => 'Some Test value to a text field',
    ),
    'qty' => 1,
);

$cart = Mage::getSingleton('checkout/cart');

$product = new Mage_Catalog_Model_Product();
$product->load(14);

$cart->addProduct($product, $params);
$cart->save();

Mage::getSingleton('checkout/session')->setCartWasUpdated(true);


texts:
Do you know if it's possible to add a PayPal button on the popup that appears when we add a product from Quickview?

Quickview :

Popup :

Thanks,


texts: How to get disable products in product collection in magento2.2

texts:
I am trying to get product collection with all enabled/disabled products. It works fine until I upgrade Magento to 2.2. Now It's not fetching disabled products in collection. Here is my code -

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_productCollectionFactory;

    public function __construct(

        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Framework\ObjectManagerInterface $objectmanager,

    ) {
        $this->_objectManager = $objectmanager;
        parent::__construct($context);
        $this->_productCollectionFactory = $productCollectionFactory;
    }

    public function execute()
    {

        $collection = $this->_productCollectionFactory->create()
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('diamond_vendor', array('in'=>$vendor))
                    //->addAttributeToFilter('status', array('in'=>array(1,2)))
                    ->addAttributeToFilter('entity_id', array('nin'=>$notin_ids))
                    ->setPageSize($noOfProducts)
                    ->load();
    }
}

In this I also tried with  -

$collection->getSelect()->where('stock_status_index.stock_status IN(1,0)');

But its not making any effect.

Plz help me in this.

thx.


texts: Magento 2.2.6 Catalog Search indexer process unknown error - Notice: Undefined offset: 53

texts:
I'm currently using Magento 2.2.6.  I've recently encountered the following error while trying to reindex the catalogsearch_fulltext:

  Notice: Undefined offset: 53 in
  vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/Full.php
  on line 384

Does anyone know how to fix this error?

Any help would be much appreciated.


texts:
How to avoid sql injection when running a native sql query with parameter input?

e.g.

$sql = "Select * from eav_attribute where attribute_id = {$attribute_id} ";
$result = $this->_connection->fetchRow($sql);


texts: How to improve magento 2 site performance

texts:
I started working on magento 2 these days.

In  magento 1.9 i used full page cache to optimize the site a bit and follows GTMETRIX reports.

But in Magento 2 i am new can any one used such methods to speed up the Magento 2 store efficiently. Or is there any in built functionality that comes in Magento 2


texts: hide empty attributes from product page attributes tab

texts:
i have this code to hide product attributes which has no value (empty attributes) from frontend:

<?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
    if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>

i have copied this to my groupview.phtml (my alternative attributes file) like this:

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<?php if($_additionalgroup = $this->getAdditionalData()): ?>

<?php echo $this->__('Additional Information') ?>

    <?php $i=0; foreach ($_additionalgroup as $_additional): $i++; ?>

<?php echo $this->__( $_additional['title'] )?>

        <table style="border-radius: 0 0 2px 2px;" class="data-table" id="product-attribute-specs-table-<?php echo $i?>">
            <col width="25%" />
            <col />

            <?php foreach ($_additional['items'] as $_data): ?>
            <?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
    if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>

                    <img src="<?php echo $this->getSkinUrl('images/attributes/'.$_data['code'].'.png')?>" alt="<?php echo $this->htmlEscape($this->__($_data['label'])) ?>" />|<?php echo $this->htmlEscape($this->__($_data['label'])) ?>
                    <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

            <?php endforeach; ?>

    <?php endforeach; ?>

<?php endif;?>

but i get this error:

Parse error: syntax error, unexpected 'endforeach' (T_ENDFOREACH) in /attributes.phtml on line 24


texts:
I am having the same problem on 2.3.1 as described here:

Magento 2.3 Configurable Product drop down price calculated wrong

In that thread a product attribute is mentioned. Does anyone know what attribute that is? It seems to be a general problem as others experience the same thing.


texts: shipping label not generate in magento 2

texts:
i want to genrate the shipping label in magento 2 but unable to generate the shipping label . every time i got this error .
any one know about this please help

There are no shipping labels related to selected orders


texts: text/x-magento-init not getting triggered at all

texts:
Can't get text/x-magento-init to get triggered, I'm simply trying to inject trivial custom JavaScript.
In my phtml template
<script type="text/x-magento-init">
{
    "*": {
        "x/js/y/z": {}
    }
}
</script>

does nothing, it's never executed. Tried a more specific selector, tried data-mage-init, same result.
<script>
    requirejs(['x/js/y/z'], function () {
    })
</script>

works.
x/js/y/z.js content
define([], function () {
    alert("x");
    return {};
});

Any idea? Thanks.


texts: Magento 2 - Where is jquery code of click on place order button in checkout page?

texts: I want to find jquery code and execute order processing when click on place order in checkout page beacuse i logged in and when I select shipping address and switch to payment step and unchecked of same as shipping address in billing and add new billing address and when I click place order button it automatically checked checkobx of 'My billing address as shipping address'.


texts: Add html attribute in checkout street address

texts: I need to add maxLength attribute to street line 1 and 2 in the Magento 2 check out page. How can I do this Magento 2? Can this be done from theme without creating a new module?


texts: Price format custom product price attribute

texts:
I've got this issue, but in Magento 2.1.
I added a "Starting From" price attribute to all products, and want to call that on the category listing. Because Magento2 supports price-type attributes, I thought this would work out of the box.

But when I enter a price of €2,95 it shows 295.000 on the frontend. The aformentioned issue had a solution with price-formatting helper, but I can't seem to find the correct one for Magento 2.1 - anyone any ideas?


texts: How do I exclude special price products from coupon codes?

texts:
How to exclude from discount (shopping cart rules) products with special price?
I want to make discount coupon only for products with normal price.
Is this even possible?


texts:
I've looked through different posts and options but nothing that fits my question.

How can I get the Attribute set ID of the current product on the product detail page?


texts: Assign category programatically to products in Magento 2.3.4

texts:
I want to assign promo category to products which have special price. Should I create a custom module or create a php file in root directory?
I found this solution: How add category programmatically magento 2
Does it still possible in Magento 2.3.4?
Thank you!


texts:
Is it possible that every CMS page has a different layout order? Example, I want on my homepage to have a slider with dome images and below the navigation bar, and below that my logo which I have created. Now, on the other pages i want the navigation bar to be as default, on top of the page with the logo above him. Is this possible to do in magento and how?

Thanks


texts: Multi-Store issues in Magento using Nginx

texts:
I have two stores within a single installation of Magento 1.9, both stores have their own domain name (domain1.com and domain2.com). The problem is that the second store isn't working when the user visits through the second domain (domain2.com). Initially, the homepage will work, but after clicking on a random link, the design from domain1.com is loaded. Then all the href attributes in the source code are from the first domain.

I figured out the following:

If I set the second store as a default (in Manage Stores), the second store is working, but then the first one is not.
Only the homepage of the second store is working.
The second store loads the design from the first store after clicking on a link.
If I change Add Store code to Urls to Yes, everything works fine, but I think this isn't the solution (for SEO reasons for example).

I added the following lines to the .htaccess file in Magento:

SetEnvIf Host www\.domain1\.com MAGE_RUN_CODE=website1
SetEnvIf Host www\.domain1\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^domain1\.com MAGE_RUN_CODE=website1
SetEnvIf Host ^domain1\.com MAGE_RUN_TYPE=website

SetEnvIf Host www\.domain2\.com MAGE_RUN_CODE=website2
SetEnvIf Host www\.domain2\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^domain2\.com MAGE_RUN_CODE=website2
SetEnvIf Host ^domain2\.com MAGE_RUN_TYPE=website

I also tried the RewriteCond/RewriteRule version.

I asked my hosting provider to add the following lines to the Nginx server, but they doesn't seem to be working, because both domains then load the default store.

fastcgi_param MAGE_RUN_CODE website1;
fastcgi_param MAGE_RUN_TYPE website;

fastcgi_param MAGE_RUN_CODE website2;
fastcgi_param MAGE_RUN_TYPE website;

I’ve set Add Store Code to Urls to No and Auto-redirect to Base URL also to No.
I’ve set Use Secure URLs in Frontend to Yes and  Use Secure URLs in Admin also to Yes.

In my settings under Default Config I’ve used the HTTPS version of domain1 as the base URL. The first store has als the HTTPS version as it’s base URL, and the second store has the HTTPS version of domain2. I’ve used the HTTPS version for both stores. This is because otherwise I get other redirect problems. If I use the HTTP version for both domains as it’s unsecure base URL, all pages redirect to https://www.domain.com/ or https://www.domain2.com/

I hope someone can help me. Thank you in advance.


texts: Magento 2: How to show USPS shipping method at first sort order?

texts: How to change the sorting order of the following shipping methods in order to keep the prioritize USPS And UPS


texts: Newbie to Magento 1.9 Website with Questions

texts:
I just took on working on an existing website that is using the 1.9 version of Magento. I am trying to update the "About Us" pages and other pages on the website, but for some reason, when I go to edit the pages, they do not exist in the CMS page manager in the admin side of the website. When I do try to create a new page and link the new URL into the navigation menu area, my changes to not appear and it stays in the original condition.

This website was worked on by a professional developer before. Is it possible that these missing CMS pages are on a different local environment? I just feel stuck trying to edit this website when I can't make changes and important pages are missing... Can anyone help this newbie??


texts: Facets in Magento 2 Rest API for search. Are they available ? how do i make them available?

texts:
How do i make facets available in Magento 2 ?
Currently i do not think it's supported in the Search Rest APIs


texts: Orders not being created with recurring profile products in magento

texts:
I had a customer sign up for a reccurring profile product and they checked out using Paypal as a payment method.

Magento created a Recurring Payment Profile for her to be charged once a month, but it did not create an order.

For orders placed using our other payment methods a recurring payment profile is created as is an order.

Is there something I need to configure further with Paypal/Magento to have the order and profile created? Has anyone else had this issue?


texts: Add Manufacturer in Related product grid in magento 2

texts:
I want to add the manufacturer column in the Product edit form section in the backend in the Related Products, Up-Sells, and Cross-Sells tab.

I have to also add a filter for the manufacturer in the product grid.


texts: Delete, MassDelete, Save events for Product reviews

texts:
I am building an extension related to product reviews in magento 2 but I couldn't find any related article/question to product reviews observers.
I went through different articles which states all/partial events of magento 2. Here are some of the links but they don't contain these events:

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html

https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

Can anyone tell me exact event names for review save, review delete, reviews mass delete for backend and also review save event for frontend?

Thanks in advance!


texts:
I have problem with magento and encoding :( i've created php script which imports products into magento (by php api). Almost everything is fine.... BUT after import i don't have polish characters in product details ;( only some strange characters.... While import script is running i make var_dump on product name and evetything is fine (i have proper polish signs in script output). My local.xml contains:

<initStatements><![CDATA[SET NAMES utf8]]></initStatements>

Database setup is proper too, all database/tables has proper encoding (utf8). After manual product creation on Magento backend i have proper polish chars in product details.

I've checked script encoding and everything is ok (US-ASCII -- is -- a subset of UTF-8)

importProducts.php: text/x-php; charset=us-ascii

Any other ideas?

EDIT:

Ok, I,ve solved the problem! The solution was append

<charset>utf8</charset>

to database configuration in local.xml,


texts:
i add this condition on the Proceed to Checkout button:

<?php if ($this->isPossibleOnepageCheckout() && Mage::getSingleton('customer/session')->isLoggedIn()):?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';"><?php echo $this->__('Proceed to Checkout') ?></button>
<?php else: ?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Proceed to Checkout')) ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo Mage::getUrl('customer/account/login'); ?>';"><?php echo $this->__('Proceed to Checkout') ?></button>
<?php endif?>

So when a user is not login on my store will be redirected to Login / Register page. I made a custom function to redirect the customers after register to checkout page if the was in Shopping Cart else redirect to My Account. But I don't know what is wrong, because now after register I am redirect only to My Account. So I want to redirect customer after registration to the Checkout page if the customer was in the Shopping Cart else to My Account. This is my function:

   public function customerRegistration(Varien_Event_Observer $observer)
   {
      if(Mage::getSingleton('core/session')->getIsFromCart() == 1 || Mage::getSingleton('core/session')->getIsFromCheckout() == 1){
            Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('onestepcheckout/index'));
            Mage::app()->getResponse()->sendResponse();
            exit;
         }
    else
        {
            Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account'));
            Mage::app()->getResponse()->sendResponse();
            exit;
        }
         Mage::getSingleton('core/session')->setIsFromCart('0');
    Mage::getSingleton('core/session')->setIsFromCheckout('0');
   }

and this is my observer in the config.xml

    <customer_register_success>
        <observers>
          <customerredirect>
            <class>customerredirect/observer_customer</class>
            <method>customerRegistration</method>
          </customerredirect>
        </observers>
    </customer_register_success>

Update:

i have found something like this to save the last x Url's in array, maybe someone can tell me how I can adapt this for my code? Thank you

$urlHistory = (array) Mage::getSingleton('core/session')->getMyUrlHistory();
while (is_array($urlHistory) && count($urlHistory) > 3) {
    array_shift($urlHistory);
}
$urlHistory[] = Mage::helper('core/url')->getCurrentUrl();
Mage::getSingleton('core/session')->setMyUrlHistory($urlHistory);

Anyone?


texts: Why my Magento 1.9 admin panel is too slow, Take more than a min after click on any button

texts:
I am facing the problem in my magento website, My magento admin panel is too slow. When I click on any menu tab like orders, add new product etc, it take more than a minute to open that page. And normally its shows these 2 error:

  Error 503 Service Unavailable Service Unavailable Guru Meditation XID: 1386574399 Varnish cache server

and:

  Error 504 timeout

I am not sure how these error are coming, I already uninstall extra extensions Note This is happening for last 5 or 6 days, Before that everything was fine. And my website frontend is also too slow Please advise Thank you


texts: WYSIWYG / TinyMCE Editor keeps removing  tags in CMS blocks in Magento 2

texts:
I'm trying to add a link to each div but whenever I save the block, the  tags gets stripped out.

Any help would be appreciated

Digital CatalogView &amp; Download (PDF)

Rental Locations{{customVar code=no_of_rental_locations}} Locations to Serve You

Credit ApplicationOpen an account today


texts:
Hi I have created a mixin but it gives the error "mixin is not a function".

  Vendor/CustomCustomer/view/base/web/customercustom.js

define([
    'jquery',
    'underscore',
    'uiRegistry',
    'Magento_Ui/js/form/element/select',
    'domReady!'
], function ($,_, uiRegistry, Select) {
    'use strict';
    $(function() {
    return function (Select) {
        return Select.extend({
            initialize: function (value) {
                this._super();
                var customerCompany = uiRegistry.get('index = customer_company');
                var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
                var vessels = uiRegistry.get('index = customer_vessels');
                var customerUsername = uiRegistry.get('index = customer_username');
                var password = uiRegistry.get('index = password');
                var cnfpassword = uiRegistry.get('index = confirm_password');
                if (this.value() != 1) {
                    customerCompany.show();
                    defaultCompany.hide();
                    vessels.show();
                    customerUsername.show();
                    password.show();
                    cnfpassword.show();
                } else {
                    customerCompany.hide();
                    defaultCompany.show();
                    vessels.hide();
                    customerUsername.hide();
                    password.hide();
                    cnfpassword.hide();
                }
                return this;
            },
            onUpdate: function (value) {
                var customerCompany = uiRegistry.get('index = customer_company');
                var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
                var vessels = uiRegistry.get('index = customer_vessels');
                var customerUsername = uiRegistry.get('index = customer_username');
                var password = uiRegistry.get('index = password');
                var cnfpassword = uiRegistry.get('index = confirm_password');
                if (value != 1) {
                    customerCompany.show();
                    defaultCompany.hide();
                    customerUsername.show();
                    password.show();
                    cnfpassword.show();
                } else {
                    customerCompany.hide();
                    defaultCompany.show();
                    customerUsername.hide();
                    password.hide();
                    cnfpassword.hide();
                    vessels.hide();
                }

                return this._super();
            },
        });
    }
});
  });

  Vendor/CustomCustomer/view/base/requirejs-config.js

var config = {
    'config': {
        'mixins': {
            'Magento_Ui/js/form/element/website': {
                'Vendor_CustomCustomer/customercustom': true
            }
        }
    }
};


texts: Magento 2 knockout js dynamic button title in minicart

texts:
I'm trying to add dynamic checkout button title in minicart using knockout js. Button title will be configured in admin configs. I configured in minicart.js But I dont know how to use/call in template file. Below is my code,

Magento2\vendor\xxxx\yyyyy\view\frontend\web\js\minicart.js

 return Component.extend({
            shoppingCartUrl: window.checkout.shoppingCartUrl,
            maxItemsToDisplay: window.checkout.maxItemsToDisplay,
            checkoutNowUrl: window.checkout.shoppingCartUrl+'?checkoutnow=1',
            proceedToCheckoutUrl: window.checkout.checkoutUrl,
            checkoutNowTitle: window.checkoutConfig.payment.ccform.checkoutnowTitle,
            cart: {},

Magento2\vendor\xxxx\yyy\view\frontend\web\template\minicart\content.html

<button
                        id="checkout-now"
                        type="button"
                        class="action primary checkout"
                        data-action="close"
                        data-bind="attr: {href: checkoutNowUrl}"
                        translate="data-bind='attr: {href: checkoutNowTitle}'"
                />

The checkoutNowUrl is rendering properly. The title is rendered from translate="data-bind='attr: {href: checkoutNowTitle}'"; I tried with all possibilities, but nothing is working. Any help will be appreciated


texts: Can't capture via invoice. Gateway error: Credit card number is required. (Authorize.net)

texts:
We had to restore our database from a backup. I export all the sales tables and imported them into the restored database so we didn't lose orders. Yet now I have a problem where when I try to invoice and capture a sale it gives me the error: Gateway error: Credit card number is required.

I can see in the order that the card has a transaction #. I called Authorize and they said all they need is the transaction # and the amount being charged. I looked in app/code/core/Mage/Paygate/Model/Authorizenet.php and I validated that the request is AUTH_CAPTURE.

If anyone can suggest where in the database I should look for issues to resolve this problem, it would be appreciated.