texts: Adding custom fields to sales_flat_order

texts:
I've been doing a fair amount of googling, trial and error but I cannot find a solution to the problem.

The ability to change the fields and order of sales_order_grid; and
The ability to display two custom fields on this grid (filterable).

The former (point 1) has been solved, by extending the Mage_Adminhtml_Block_Widget_Grid in my custom module (I know about observers, yet other installed modules were overriding my changes with their observers).

Regardless, the latter is my current problem, below are the two methods that have failed me so far.

Method 1

<?php
/*  @var $this Mage_Sales_Model_Mysql4_Setup  */
$this->startSetup();
$connection = $this->getConnection();

/**
 * Create the payment method dropdown field, because this field _may_ be
 * used for searching we will create an index for it.
 */
$connection->addColumn(
    $this->getTable('sales/order_grid'),
    'x_payment_method',
    "ENUM('PayPal', 'SagePay') DEFAULT NULL"
);
$connection->addKey($this->getTable('sales/order_grid'), 'x_payment_type', 'x_payment_type');

/**
 * Create the order channel field to identify where the order was originally
 * generated from. Also add an index for this field for additional filtering.
 */
$connection->addColumn(
    $this->getTable('sales/order_grid'),
    'x_sale_channel',
    "ENUM('Amazon', 'Play', 'eBay', 'Website') NOT NULL DEFAULT 'Website'"
);
$connection->addKey($this->getTable('sales/order_grid'), 'x_sale_channel','x_sale_channel');

$this->endSetup();

Method 2

By this point I was tired of reading the same 7 articles that didn't help, so I tried to get ONE field working; I also checked the error logs in Magento and found "$this->getTable()" was errornous, thus I removed it.

<?php
/*  @var $this Mage_Sales_Model_Mysql4_Setup  */
$this->startSetup();
$connection = $this->getConnection();

/**
 * Create the payment method dropdown field, because this field _may_ be
 * used for searching we will create an index for it.
 */
$this->addAttribute('sales_flat_order', 'x_test_option', array(
    'label' => 'X Test Option',
    'type' => 'varchar',
    'input' => 'select',
    'visible' => true,
    'required' => false,
    'position' => 1,
    'visible_on_front'  => false,
    'option' => array('value' => array('web', 'test 1', 'test 2')),
    'default' => array('web'),
));

$this->endSetup();

Which makes one beg the question, what is the difference between a column and an attribute? My initial presumption was that, a column is added to an existing core table while an attribute is added to the EAV_* tables and appropriately related.


texts: Magento2 email template inside getting this error

texts:
I am using magento2.3.0.When i fire email in frontend side than getting error in email inside

"CSS inlining error: DOMXPath::query(): Undefined namespace prefix in selector >> .mt-menu .col-1.megamenu > ul > li:nth-child(n+1) << in /var/www/html/vendor/pelago/emogrifier/src/Emogrifier.php"


texts: How to find the scss file we want to modify (Magento1.9)

texts:
I have started to use css files generated from scss files recently.
(I use the default scss structure of magento 1.9)

Previously, when I needed modify web design of sites, I had found target modification(ex. style.css:9011 #content{background:#fff;}) with chrome console. I had tried to change style in browser, and modified that file.

But in SCSS, I can't find target 'scss' file in browser directly.
And so I need to understand the order of importing scss, and I find the target from searching source. ( this way is inefficiency )

Do you have a good idea how to find the modification scss file??


texts: How to disable Varnish via Turpentine for logged in users

texts:
I'm struggling to find a way to completely disable varnish for logged in users using the Turpentine extension.

I have a member based site, non-logged in guests can browse products but not see prices or order. Logged in members of course can.

I'm trying to use Varnish so the large numbers of non-members visiting the site don't impact the performance on the relatively small number of logged in members.

Out of the box once varnish is working properly with Turpentine the problem is that the product information starts to be cached and becomes visible to non-logged in users, or vice versa - a guest view can be shown to a logged in user.

So the question is:

Is there a block level syntax that can be added to local.xml or turpentine_esi.xml that will disable all caching for a logged in user?

Here's what I've tried

Using my themes local.xml at first I tried shifting all the product_list blocks into a private ESI like this

...
<catalog_category_default>
 <reference name="product_list">
    <action method="setEsiOptions">
        <params>
            <access>private</access>
            <scope>page</scope>
            <flush_events>
                <checkout_onepage_controller_success_action/>
                <sales_quote_save_after/>
            </flush_events>
        </params>
    </action>
 </reference>
</catalog_category_default>

However that returns the same "no products found" message to all visitors and even if I had got that working the number of blocks to shift over to private would become huge as I tried to catch every scenario where members only info might appear - even if I managed to find them all I could imagine the varnish caching and flushing could create more load than not having it at all.

Next I tried disabling caching entirely for members - my prefered option anyway

<customer_logged_in>
    <turpentine_cache_flag value="0"/>
</customer_logged_in>

That didn't seem to have any effect at all, I was still getting cached content, and cached content was 'bleeding' between users.


texts: Get an error message "Cannot save the customer." when a new user signs up

texts:
Once user register, they get an error message "Cannot save the customer.". The account actually is made.

I have tried this code and error shows "Cannot save the customer.Decoding failed: Syntax error"

catch (Exception $e) {
            $session->setCustomerFormData($this->getRequest()->getPost());
            //$session->addException($e, $this->__('Cannot save the customer.'));
            $session->addException($e, $this->__('Cannot save the customer.' . $e->getMessage()));
        }


texts: Edit shipping description in "checkout onepage review"

texts:
I want to edit the shipping label in my review order (last step before user confirm the order)

I want in

frontend/theme/mytheme/template/checkout/onepage/review.phtml

and in the files in

frontend/theme/mytheme/template/checkout/onepage/review/

but I dont know where i can edit this.


texts: Salable Quantity is greater than quantity

texts:
My salable quantity is greater than my quantity. How has this happened? I recently updated to Magento 2 and have been trying to get my head around the MSI but still can't figure out how salable quantity is more than quantity in the case of this and some other products. With the result that I am overselling on stock.

Ideally I would work only from simple stock quantity but I when I disable the manage stock option, I then oversell on the front end as there is no stock control.


texts:
I have a problem with loading a new template on payment methods section on checkout, but only on my custom theme. I have created a custom module that adds a new block with template in the above section.

My layout.xml is:

<layout version="0.1.0">
    <checkout_onepage_index>
        <reference name="checkout.onepage.payment">
            <block type="core/text_list" name="checkout.payment.methods.additional" as="methods_additional">
                <block type="core/template" name="cardcadou" template="cardcadou/cardcadou.phtml"/>
            </block>
        </reference>
    </checkout_onepage_index>
</layout>

The problem is that I tested on rwd theme and the template is displayed correctly, but on my custom theme it is not displayed at all.

I've checked if the layout.xml is called by adding this code under the <checkout_onepage_index>:

<reference name="head">
    <action method="addJs">
        <script>test/test.js</script>
    </action>
</reference>

And I looked in my page source and the js file is loaded, so the layout.xml is called.

What am I doing wrong here?


texts: Magento 2 : How to create CCavenue payment method?

texts:
I want to create CCavenue payment method for my Magento 2 store with iFrame Integration Technique. How I have to proceed ?

Is there any ready extension available for this ?


texts: Receiving HTTP 500 Error when saving Configurable Products

texts:
We are receiving an HTTP 500 error anytime we try to save a configurable product with a large number of variations. The error seems to happen anytime we create a product with over 100 variations.
After hitting save, the spinner will pop up as usual, like it is saving the product. After a few seconds the page will just crash and display the 500 error.
I assume this has to do with resources somewhere, but I've gone through and upped the memory limits, etc in both .htaccess and php.ini files and not had any luck getting it to behave differently.
Anybody have any recommendations or suggestions on getting around this issue or tracking down what is actually causing it?


texts: Magento2.3: Products not Updated in Mini cart

texts: Before page loads completely, click on add to cart button then the product is added to cart but the issue is, it is not updated in minicart.


texts: How to implement homepage minicart qty increment and decrement option?

texts: I want to implement the qty increment and decrement option in the mini cart on the homepage.


texts: Where do Zero Subtotal Checkout Invoices get created?

texts:
The basic problem is this: We've enabled the creation of invoices for free (zero subtotal) orders. This works fine, and the invoice is created, except the invoice email isn't sent.

I expected that I just needed to override the method wherever they get created, probably just to add an $invoice->sendEmail(), but I'm having trouble finding where exactly this would be.


texts: Magento 2.3.1 Installation fails - An error occurred during execution; please try again later

texts:
I try to install the latest Magento 2 version which is 2.3.1 - Full Release (ZIP with no Sample Data)

I unchecked any optional extension in the advanced settings during the installation process.

I get http://example.com/setup/index.php/install/start 500 (Internal Server Error) logged into the chrome developer console.

It stucks at exactly 15% on Module 'Magento_InventorySales'.

I get Class 'Zend\\Mvc\\Router\\Http\\RouteMatch' not found in /home/examplede/test2/vendor/zendframework/zend-mvc/src/Router/Http/Segment.php:388

I also tried to download the project via composer, but this made no difference.

Any solutions?

Update:

I get this error

[Fri Mar 29 13:28:18.886195 2019] [lsapi:error] [pid 1993698:tid 47071602472704] [client 80.155.182.27:56585] [host test2.example.de] Backend fatal error: PHP Fatal error:  Uncaught Error: Class 'Zend\\Mvc\\Router\\Http\\RouteMatch' not found in /home/examplede/test2/vendor/zendframework/zend-mvc/src/Router/Http/Segment.php:388\nStack trace:\n#0 /home/examplede/test2/vendor/zendframework/zend-mvc/src/Router/Http/TreeRouteStack.php(319): Zend\\Mvc\\Router\\Http\\Segment->match(Object(Zend\\Http\\PhpEnvironment\\Request), 16, Array)\n#1 /home/examplede/test2/vendor/zendframework/zend-mvc/src/RouteListener.php(45): Zend\\Mvc\\Router\\Http\\TreeRouteStack->match(Object(Zend\\Http\\PhpEnvironment\\Request))\n#2 [internal function]: Zend\\Mvc\\RouteListener->onRoute(Object(Zend\\Mvc\\MvcEvent))\n#3 /home/examplede/test2/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\\Mvc\\MvcEvent))\n#4 /home/examplede/test2/vendor/zendframework/zend-eventmanager/src/EventManager.php(260): Zend\\EventManager\\EventManager->triggerListeners('route', Object(Zend\\Mvc\\MvcEvent), Object(Closure))\n#5 /home/examplede/test2/vendor/zendframework/zend-mvc/src/Application.php(319): Zend\\Even in /home/examplede/test2/vendor/zendframework/zend-mvc/src/Router/Http/Segment.php on line 388\n, referer: https://test2.example.de/setup/


texts: Magento 301 problem - magento is making 2 redirects but I need only 1 - V1.7

texts:
I have an install of Magento V1.7 that has several languages / stores etc.

The structure of the site has been continually changing and as such lots of 301s have been created.

I now have the problem that on some of my category pages there are 2 active 301 redirects in place which our SEO guy is saying is a bad idea.

As an example I have a category for football goals and the original URL was: quickplaysport.com/fr/buts-et-mini-buts

now we have changed it so the french store is on the french domain quickplaysport.fr and the actual category URL has changed from buts-et-mini-buts to cage-but-mini-but-football.

This means that it is doing a 301 redirect from anything at .com/fr/***** to .fr/***** and then doing a second redirect from quickplaysport.fr/buts-et-mini-buts to quickplaysport.fr/cage-but-mini-but-football.

Can anyone tell me how I should be setting up the 301's correctly so it goes from quickplaysport.com/fr/buts-et-mini-buts to quickplaysport.fr/cage-but-mini-but-football. With just the 1 redirect?

Thanks


texts: "Area code not set" error. Still getting this error after a lot of search?

texts:
First of all, I have to tell you that I have spent a lot of time researching and I have done all the solutions I have came across but I'm still getting this error when I run setup:di:compile

The full error is as follows:

Compilation was started.
Interception cache generation... 7/7 [============================] 100% 3 mins 384.0 MiB
Generated code and dependency injection configuration successfully.

  [Magento\Framework\Exception\SessionException]
  Area code not set: Area code must be set before starting a session.

  [Magento\Framework\Exception\LocalizedException]
  Area code is not set

I'm trying to test some functionality and made a quick command line to test it. My entire class is as follows:

<?php
namespace Falak\MyCommands\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CustomerCredit extends Command
{

    protected $transaction;
    protected $appState;

    public function __construct
    (
        \Magestore\Customercredit\Model\Transaction $transaction,
        \Magento\Framework\App\State $appState,
        array $data = []
    )
    {
        $this->appState = $appState;
        $this->transaction = $transaction;
        parent::__construct();
    }

    protected function configure()
    {
        $this->setName('falak:credit')
            ->setDescription('Test Customer Credit');

        parent::configure();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $originalArea = $this->appState->getAreaCode();
        $this->appState->setAreaCode('frontend');
        $output->writeln("Hello World!");
        $this->appState->setAreaCode($originalArea);
    }

}

Notes:

I have tried setting the area code in the constructor directly
I have tried setting it in the configure
I have tried to set it every where at the same time
When I remove all reference to \Magestore\Customercredit\Model\Transaction it compiles without any problems. But I need this reference as I'm trying to call some of the functions in this class

UPDATE: Here is my di.xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="commandTest" xsi:type="object">Falak\MyCommands\Console\CommandTest</item>
                <item name="testCustomerCredit" xsi:type="object">Falak\MyCommands\Console\CustomerCredit</item>
            </argument>
        </arguments>
    </type>
</config>


texts: Does Magento 1 store customer's credit card information in our database

texts:
I have enabled Paypal and Credit Card/ Debit Card payment method option.
I want to know whether customer's credit card information are stored in magento 1 database when they pay using these 2 payment method?


texts: Remove the attribute programmatically in magento2?

texts:
I want delete the existing attribute called Manufacturer. Check if this attribute exists before deleting.

How to do this.

Thanks.


texts: Set Product as New From/To fields are not shown on product settings page

texts:
I can't see the options "Set Product as New From" and "Set Product as New To" option fields on product settings page. I only see a toggle button says "Set Product as New" instead.
I couldn't find any information about this, it seems like nobody faced this issue or this is not an issue actually.
I checked on a clean install of Magento 2 but it's same.
Any help would be appreciated.
Thanks!


texts: How to get product ids of specific category and not in other categories in Magento?

texts:
I want to get product ids of a specific category and product ids not in other categories only in a specific category.

For example,

category ids = 3, 4, 10 and product ids = 10, 12, 14 and category id 3 belong to product id 10 and category id 4 belong to product ids 10, 12, 14 and category id 10 belong to product id 14.

When I filter on category id = 4, it returns product ids 10, 12 and 14, but I want to return only product id 12 because I only want the product id which is not in other categories. In my filter category id 4 returns product ids 10,12 and 14  but  I only want to product id 4 because 10 and 14 belong to other categories which I don't want.
I only want to product id 12 in filter. Which filter I used ?

$catIds = array(4);
$notCatIds = array(3, 10);
$productCollection = Mage::getResourceModel('catalog/product_collection')
    ->setStoreId(0)
    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left')
    ->addAttributeToFilter('category_id', array('in' => $notCatIds))
    ->addAttributeToFilter('category_id', array('in' => $catIds))
    ->addAttributeToFilter('category_id', array('nin' => $notCatIds))
    ->addAttributeToFilter('category_id', array('nin' => array(2)))// 2 is default category id
    ->addAttributeToSelect('*');
$productCollection->getSelect()->group('product_id')->distinct(true);

echo '<pre>';
print_r($productCollection->getData());


texts: After installing fresh version of magento 2.17 styles.css file not found

texts:
After installing Magento 2 CE (version 2.17) fresh version. I found following 404 error of the path on following directory pub/media/styles.css.
I found some solution over the internet and I tried that, but no one is work for me.
Then on the admin panel, Content->Design->Configuration and on the HTML Head section's "Scripts and Style Sheets" field I found following code

<link  rel="stylesheet" type="text/css"  media="all" href="{{MEDIA_URL}}styles.css" />

But on the following directory, no file exists.

Please help me to get rid of this problem.


texts: Add number of active products to category navigation menu in magento 2.1.1

texts:
As the title says could anyone help me with adding the number of active products within a category to the navigation menu. To clarify i want to make it display as follows:

Product(23)

Other Product(13)

And have it do that for all categories.
Anyone got any idea on how to do this in magento 2.1.1


texts: Changing the currency format in index page

texts:
I am trying to set the currency format in My magento store based on the option selected by the customer. When customers click on an option in the header I am redirecting them to a page called check.php with a parameter called curr and I am setting a session variable based on that parameter, like below. And then redirecting them to the home page.

<?php
require_once('app/Mage.php');
        Mage::app();
       Mage::init();
       if($_GET['curr']=='usd') {
      Mage::getSingleton('core/session')->setCountry("USD");
       } else {
      Mage::getSingleton('core/session')->setCountry("INR");
       }
       header('Location: http://localhost/xyz/');
       exit();

once redirected I am checking the session in index.php and converting the currency based on the selection like below

Mage::app();
  Mage::init();
    $currencies = Mage::getSingleton('core/session')->getCountry();
    echo $currencies.'Akshay';
  $access_var = Mage::getSingleton('core/session')->getRefer();
  if(!isset($access_var)) {
      if($currencies === "USD")
    {
       Mage::getSingleton('core/session')->setRefer("access");
       Mage::app()->getStore()->setCurrentCurrencyCode('USD');
       Mage::reset();
} else {
    Mage::getSingleton('core/session')->setRefer("unaccess");
       Mage::app()->getStore()->setCurrentCurrencyCode('INR');
       Mage::reset();
}
}

But magento is throwing an error saying "Mage registry key "controller" already exists"

Can anyone kindly let me know how can I resolve this.


texts:
I'll create one custom table in Magento 1 to store the data.

I want to store emoji in my custom table and display it in the frontend
I'll store data something like  'Hdhdhdhhzhzhzz'
but it displays like Hdhdhdh????????????????hzhzhz

How to solve this?


texts:
Hoping someone can point me in the right direction on how to generate an invoice pdf for an already invoiced order through the rest api.

It looks like in the admin, Magento is creating it on the fly when you press print PDF.

Looking for a way to generate this invoice pdf from the API and save it to the server so that I can send it to another server.

Magento 2.2.5

Thanks,


texts: Magento2 Mobile SSO - OAuth-based authentication

texts:
I have been asked by a mobile dev to provide Magento 2 API to create a single sign-on application for my store.  I have provided this info:

•   curl -X POST "https://example.com/rest/V1/integration/customer/token" -H "Content-Type: application/JSON" -d '{"username":"user@email.com","password": "password"}'

token for above user : "ypilvsgqpfye3wkary6kkqkjpmsscfzxc"
•   curl -X GET "https://example.com/rest/V1/customers/me" -H "Authorization: Bearer ypilvsgqpfye3wkary6kkqkjpmsscfzxc"

customer information.
•   $ curl -X GET "https://example.com/rest/V1/customers/me" -H "Authorization: Bearer ypilvsgqpfye3wkary6kkqkjpmsscfzxc"

is this enough for them to get the information to build the app and get users to log in? OR is there something that I am missing to provide? Any advice is appreciated.


texts: How to set Magento price slider width mannually

texts: I have a price slider in my project. It is working fine. But due to 100% width of the slider as per its container width, it doesn't look good. I don't know how to change width of the slider.


texts: I have a sales script, but if no products return i dont want the title to display

texts:
I have this code which displays 4 products which are on sale, however i want want wrap it in an IF statement basically saying IF there are no products then dont display anything. For example fi there are no products it still shows up the title "These Great Products Are On Sale". I know this seems like a simple task but when you havent really worked with PHP then it is very stressful.

<?php
Mage::getSingleton('core/session', array('name' => 'frontend'));
$_category = Mage::registry('current_category');
            $currentCategoryId= $_category->getId();

$_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection')
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addMinimalPrice()
            ->addCategoryFilter($_category)
            ->addStoreFilter();

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($_productCollection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($_productCollection);

$todayDate = date('m/d/y');
$tomorrow = mktime(0, 0, 0, date('m'), date('d'), date('y'));
$tomorrowDate = date('m/d/y', $tomorrow);

$_productCollection->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
    ->addAttributeToFilter('special_to_date', array('or'=> array(
    0 => array('date' => true, 'from' => $tomorrowDate),
    1 => array('is' => new Zend_Db_Expr('null')))
    ), 'left');

?>

 These Great Products Are On Sale

<?php $_collectionSize = $_productCollection->count() ?>
<?php $i=0; foreach($_productCollection as $_product):?>
<?php if($i++%3==0): ?>

 <?php endif; ?>

                    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>">
                        <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>"
                        width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>"
                        title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />

<a href="<?php echo $_product->getProductUrl() ?>"
                title="<?php echo $this->htmlEscape($_product->getName()) ?>">
                <?php echo $this->htmlEscape($_product->getName()) ?>

                <?php if($_product->getRatingSummary()): ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                <?php endif; ?>

                <?php echo $this->getPriceHtml($_product, true) ?>

        <?php if($i%3==0 || $i==$_collectionSize): ?>

        <?php endif; ?>

    <?php if($this->getIsHomepage() && $i==4) break; ?>

 <?php endforeach ?>

Thank you if you can help.


texts: Issue in Overriding Magento_Contact's form.phtml file

texts:
I want to override the form.phtml file from the magento's core contact module using my custom theme. So i created a folder structure like below,

app/design/frontend/Ziffity/Weight/Magento_Contact/templates/form.phtml

Then i copied the core module's form.phtml into the above folder structure and edited placeholder/label of the form according to my needs.

Core module's folder structure is below

vendor/magento/module-contact/view/frontend/templates/form.phtml

I have cleared browser cache and magento cache using below commands..

sudo rm -Rf var/cache/*
sudo rm -Rf pub/static/*
sudo rm -Rf generated/*
sudo php bin/magento cache:clean

But the changes are not taking effect. I don't know what i am doing wrong here. as i am following all the instructions correctly.

Note: I also believe, i don't need to register my custom theme for overriding .phtml or html templates.

Please guide me, what i am doing wrong here.

Note: Changes i made in form.phtml was very simple ones..


texts: Tax is Only Calculated on Shipping Charge

texts: When sales tax is needed, it is only being calculated on the shipping charge and not on the merchandise total. So I have a >$6,000 item that is only showing a $2.63 tax which is 8.25% of the shipping charge of $31.93. How is this possible and how can I fix it? I have checked all the Configuration>Tax settings and the Sales>Tax Classes and Rates. I can't find it anywhere. Why would you ever charge sales tax on shipping and not on the item total? Any help would be appreciated! Thanks!


texts:
I am trying to add a CSS file in Magento admin section.
Using following code in local.xml, I have added one JS file :

<layout>
    <default>
        <reference name="head">
            <action method="addItem">
                 <type>skin_js</type>
                     <name>my_folder/my_js.js</name>
                 <params/>
            </action>
        </reference>
    </default>
</layout>

But I not able to attach a CSS file in admin section.


texts: Magento2.3.0 How to add custom attachment for pdf in admin side product edit page?

texts:
I am using magneto2.3.0 and I already free plugin use for custom attachment for product edit page but there PDF attached after product not save it.

Issues come in magneto2.3.0 version if anyone tries to this version please reply to me just simple PDF file added in product edit page admin side after saving the product.


texts:
I am working with existing database back up. And getting below error when i try to setup.

This error is coming in ubuntu only

Error:

SELECT `e`.* FROM `catalog_category_entity` AS `e` WHERE (`e`.`entity_type_id` = '3') AND (`e`.`path` REGEXP '^1(/[0-9]+){1,}$') ORDER BY `e`.`path` ASC


texts: I need to get content from JMS topic so Can someone let me know if it is possible to use PHP/JAVA bridge in magento2?


texts: Is there any way to add Bundle product inside Bundle Product?

texts: I want to add Bundle Product as an option of another bundle product. Is there any way?


texts: Magento 2 disable Secret Key on URL's from terminal

texts: Given I don't have GUI access to Magento, is there any command that I can run to be able to disable the secret key add for the URL's from terminal ?


texts: How to Create Magento 2 Multiple Languages?

texts: I want to create my store in multiple Languages. But I can not do it.


texts:
I would like for my customers to have to adhere to certain rules when creating an account/creating a password. These rules are for password security and are as follows:

Greater than 8 characters
Contains Uppercase
Contains Lowercase
Contains Number
Contains a Special Character

Is there a way I can enforce this within Magento so that my customers have greater security on their accounts?


texts: Magento Database Compaibility Between Versions

texts:
I'm looking to upgrade a site from 1.7.0.2 to 1.9.0.1.  From what I understand, once the 1.9 upgrade is run for the first time, it will update the database as necessary.

Temporarily, I would like to be able to switch back and forward between the 1.7 and 1.9 versions, using the same DB.

Will this be possible or will it cause problems?

Thanks


texts:
How can I change the text on my customer's invoice " Surcharge fee " on Magento 2

Thanks!


texts: Magento 2 Call Rest api issue : "\"%fieldName\" is required. Enter and try again.",

texts:
I am trying to call Magento 2 Quote rest api,

 <route url="/V1/carts/mine/coupons/:couponCode" method="PUT">
        <service class="Magento\Quote\Api\CouponManagementInterface" method="set"/>
        <resources>
            <resource ref="self" />
        </resources>
        <data>
            <parameter name="cartId" force="true">%cart_id%</parameter>
        </data>
    </route>

but i get issue like "\"%fieldName\" is required. Enter and try again.",

here is the screenshot.

Can any one help me to resolve this. Thanks


texts: Overriding Porduct Grid Block in Magento 2

texts:
Did following steps to Override the Block file:

1) Created di.xml file in Folder app/code/Rahul/Catalog/etc

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
 <preference for="Magento\Catalog\Block\Adminhtml\Product\Grid" type="Rahul\Catalog\Block\Adminhtml\Product\Grid" />
</config>

2) Created Grid.php Block file in Folder app/code/Rahul/Catalog/Block/Rewrite/Adminhtml/Product

<?php
namespace Rahul\Catalog\Block\Rewrite\Adminhtml\Product;
use Magento\Store\Model\Store;
class Grid extends \Magento\Backend\Block\Widget\Grid\Extended
{
// Do your stuff here
}
?>

3) Cleared the cache and run upgrade command, but not worked

What things I'm missing here ?

Thanks


texts: How can I set attribute option's position when I create it by program?

texts:
I found this article to add new options for a attribute using program perfectly:
http://www.danneh.org/2011/01/getting-value-of-attribute-option-and-adding-a-new-attribute-option-in-magento/

But every attributes will always create with position '0' and I want to sort them because their values are numbers.

Can I set attribute options' position when I create them or update the position after I create them?


texts: How to add additional shipping methods in magento?

texts:
How to additional shipping methods in magento ?

currently there are methods like Flat rate ,Table rates , Free shipping , UPS etc...


texts: Call to undefined method Category_Flat::getProductsPosition Model/Category.php on line 330

texts:
We are seeing an error in cron PHP Fatal error:  Call to undefined method Mage_Catalog_Model_Resource_Category_Flat::getProductsPosition() in app/code/core/Mage/Catalog/Model/Category.php on line 330. Using Magento 1.9.0.1

And I don't understand why this is happening? I was reading this. But does it mean one needs to check the flat category flag before calling this function? And still what is the cause of the error? (we saw it first after SUPEE updates and extension updates)

public function getProductsPosition()
    {
        if (!$this->getId()) {
            return array();
        }

        $array = $this->getData('products_position');
        if (is_null($array)) {
            $array = $this->getResource()->getProductsPosition($this);
            $this->setData('products_position', $array);
        }
        return $array;
    }


texts: Magento 2.3.5: What is the correct technique to update stock?

texts:
I have tried to follow the next solution:
Magento 2: Programmatically Updating Inventory
But in Magento 2.3.5 this solution is deprecated.
\Magento\CatalogInventory\Api\StockRegistryInterface
Currently what is the solution to update stock?
My code:
public function updateProductStockByData(array $data)
{
    $skuArray = $this->getMapWithSkuKey($data);

    try {
        $productIds = $this->getMapWithProductIdKey($skuArray);
        if (count($productIds)) {
            $searchCriteria = $this->getSearchCriteria($productIds);
            $stockItemCollection = $this->stockItemRepository->getList($searchCriteria);
            if ($stockItemCollection->getTotalCount()) {
                /** @var \Magento\CatalogInventory\Model\Stock\Item $stockItem */
                foreach ($stockItemCollection->getItems() as $stockItem) {
                    $newQty = $this->dataDictionaryWithProductIdKey[$stockItem->getProductId()]['STOCK'];
                    $stockItem->setQty($newQty);
                    if ($stockItem->getQty() == 0) {
                        $stockItem->setIsInStock(false);
                    }
                    $this->stockItemRepository->save($stockItem);
                }
            }
        }
    } catch (\Exception $exception) {
        $this->reportManager->reportNewStockException($exception);
    }
}


texts: Update custom module database - 7 shops same theme, plugins ect but fail at one shop

texts:
I just made an update to my custom module.
My module store some data from a form, to my datatable. and the update should add a new culumn to my table.

It works fine on 6 shops, but fails on the last one.

So my quesstin is, why can it fail on just one shop, when they have the same setup, and how to fix et?

I know to make and update you have to chance the version number in ect/moduls, and in the config.

They have the new version number. but i can se in the core_recorce table, that its not updated why is that?


texts: Custom Sale Product add in order Magento 2?

texts:
In Magento-1 was extension or options to create custom sale product in order.
But in Magento2 there is no extensions or opportunities to do that.
Can anyone guide me for some ideas or some extensions for Magento2?


texts: Help overwritting some model file and block of wishlist

texts:
I'm trying to override some files of wishlist core module. This is my config.xml file:
<?xml version="1.0"?>
<config>
    <modules>
        <Srh_Wishlist>
            <version>0.1.0</version>
        </Srh_Wishlist>
    </modules>
    <frontend>
        <routers>
            <wishlist>
                <use>standard</use>
                <args>
                    <module>Srh_Wishlist</module>
                    <frontName>wishlist</frontName>
                </args>
            </wishlist>
        </routers>
    </frontend>
    <global>
        <rewrite>
            <Srh_wishlist_indexcontroller>
                <from><![CDATA[#^/wishlist/index/#]]></from>
                <!-- Mage_Wishlist_IndexController  -->
                <to>/wishlist/index/</to>
                <!-- Srh_Wishlist_IndexController  -->
            </Srh_wishlist_indexcontroller>
        </rewrite>
        <blocks>
            <wishlist>
                <class>Srh_Wishlist_Model</class>
            </wishlist>
            <wishlist>
                <rewrite>
                    <customer_wishlist>Srh_Wishlist_Block_Customer_Wishlist</customer_wishlist>
                </rewrite>
            </wishlist>
        </blocks>
        <models>
            <wishlist>
                <class>Srh_Wishlist_Model</class>
                <resourceModel>wishlist_mysql4</resourceModel>
            </wishlist>
            <wishlist_resource>
                <rewrite>
                    <item_collection>Srh_Wishlist_Model_Resource_Item_Collection</item_collection>
                </rewrite>
            </wishlist_resource>
            <wishlist>
                <rewrite>
                    <item>Srh_Wishlist_Model_Item</item>
                </rewrite>
            </wishlist>
            <wishlist>
                <rewrite>
                    <wishlist>Srh_Wishlist_Model_Wishlist</wishlist>
                </rewrite>
            </wishlist>
        </models>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <wishlist after="Mage_Adminhtml">Srh_Wishlist</wishlist>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

Apparently it works fine, but in system.log I have next problem:

Warning: include(Srh/Wishlist/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/html/magento/lib/Varien/Autoload.php on line 94
Warning: include(): Failed opening 'Srh/Wishlist/Model/Observer.php' for inclusion (include_path='/var/www/html/magento/app/code/local:/var/www/html/magento/app/code/community:/var/www/html/magento/app/code/core:/var/www/html/magento/lib:.:/usr/share/pear:/usr/share/php') in /var/www/html/magento/lib/Varien/Autoload.php on line 94

And in file exception.log:

exception 'Mage_Core_Exception' with message 'Invalid block type: Srh_Wishlist_Model_Links' in /var/www/html/magento/app/Mage.php:595

I don't want to override Model/Observer.php even Model/Links.php from Wishlist Magento module. Why Magento are throwing this errors? I have something wrong in my config.xml?
Thanks in advance!


texts: Limiting the quantity inside of a Bundle product

texts:
I'm trying to achieve the following thing:

Customer can select from 3 types of bundle: 12 donuts, 24 donuts, 36 donuts

I have 50 different type of donuts to select from.

How to I make sure the client selecting the buddle of 12 donuts can, first not go over 12 donuts and second adjust the quantity for the type of donuts he wants.

Has anyone ever succeeded in doing this?


texts:
we are facing fatal error in cart page as
Fatal error: Call to a member function isVirtual() on a non-object in
:  return $this->getConfig()->isEnabled() && !$this->getProduct()->isVirtual();
full code : app/code/community/WebDevlopers/ProductPageShipping/Block/Estimate/Abstract.php
<?php
abstract class WebDevlopers_ProductPageShipping_Block_Estimate_Abstract extends Mage_Catalog_Block_Product_Abstract
{

    protected $_estimate = null;

    protected $_config = null;

    protected $_session = null;

    protected $_carriers = null;

    public function getEstimate()
    {
        if ($this->_estimate === null) {
            $this->_estimate = Mage::getSingleton('webdevlopers_productpageshipping/estimate');
        }

        return $this->_estimate;
    }

    public function getConfig()
    {
        if ($this->_config === null) {
            $this->_config = Mage::getSingleton('webdevlopers_productpageshipping/config');
        }

        return $this->_config;
    }

    public function getSession()
    {
        if ($this->_session === null) {
            $this->_session = Mage::getSingleton('webdevlopers_productpageshipping/session');
        }

        return $this->_session;
    }

    public function isEnabled()
    {
        return $this->getConfig()->isEnabled() && !$this->getProduct()->isVirtual();
    }
}


texts: In magento 2 how to add custom data in sales order confirmation mail template

texts: In magento 2  how to add custom in data  sales order confirmation mail template


texts: Magento 2 - time picker on backend (xml form)

texts:
I need to to have only time picked in the form. I have a field

<field name="open">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Tuesday</item>
            <item name="formElement" xsi:type="string">date</item>
            <item name="source" xsi:type="string">somesource</item>
            <item name="dataScope" xsi:type="string">open</item>
            <item name="options" xsi:type="array">
                <item name="showsTime" xsi:type="boolean">true</item>
                <item name="timeOnly" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

hours and minuts scroll bars doesnt work properly for me. How to make the datepicked to show only time? Or how to make a field that saves time only


texts: Magento 1.9.2.0 problem with patch SUPEE-11086

texts:
I have been having the below error when I try to patch my Magento store 1.9.2.0

patching file app/code/core/Mage/Cms/etc/config.xml
Hunk #1 FAILED at 190.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Cms/etc/config.xml.rej Could I get some help with this please?
Thanks


texts:
Im following the answer provide by Andrea on How To add JS file in frontend for all pages

However I am recieving the follow error and unsure how to resolve?

require.js:1895 GET http://domain.dev/products/pub/static/version1497347169/frontend/aa/aa-theme/en_US/js/main.js

require.js:166 Uncaught Error: Script error for: js/main
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)

Could anyone please help with getting a custom script added?

Update:

I've tried to include libraries into my require_config.js like:

var config = {
paths: {
        'accessible-menu': "Magento_Theme/js/accessible-menu/accessible-menu",
        'slick': "Magento_Theme/js/slick/slick.min"
    },
shim: {
    'slick': {
        deps: ['jquery']
    },
    'accessible-menu': {
        deps: ['jquery']
    }
}
};

And have added my main scripts file into my default.xml like:

<referenceContainer name="before.body.end">
        <block class="Magento\Framework\View\Element\Text" name="scripts.min.js">
            <arguments>
                <argument name="text" xsi:type="string"><![CDATA[<script type="text/javascript" src="http://domain.dev/app/design/frontend/aa/aa-theme/Magento_Theme/web/js/scripts.min.js"></script>]]></argument>
            </arguments>
        </block>
    </referenceContainer>

Just doesn't seem to be loading the libraries but my scripts.min.js is included?


texts:
I need to extend getPriceHtml method of Mage_Catalog_Block_Products class.

Why?
I need to change template for price only for my custom extension of RSS (Aph_Rss > works fine!). This extension use getPriceHtlmRss($product,true) new method, now I want extend getPriceHtml > getPriceHtmlRss to add inline css into price-last / special-price tag for email-marketing automation in specific template > priceRss.phtml

I've created Aph/Catalog/etc -> config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <product>Aph_Catalog_Block_Product</product>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

Then created Aph/Catalog/Block/Product.php

<?php

include('Mage/Catalog/Block/Product.php');

class Aph_Catalog_Block_Product extends Mage_Catalog_Block_Product
{
    protected $_finalPrice = array();

    public function getPriceHtmlRss($product)
    {
        $this->setTemplate('catalog/product/priceRss.phtml');
        $this->setProduct($product);
        return $this->toHtml();
    }
}

Then created:
app/design/frontend/default/mytheme/template/catalog/product/priceRss.phtml

Last step:
Created file app/etc/modules/Aph_Catalog.xml

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

Visiting http://www.mydomain.tld/rss/catalog/category/cid/193/store_id/2/ -> no price shown. priceRss.phtml not loaded. Why?


texts: How to list unused attributes options by sql query

texts:
I would like to list all attributes options that our products don't use. I prefer to use SQL to do that to learn how to work with it.
Right now I use this query to get the ID of my attributes
select * from eav_attribute where attribute_code = 'color_shoes';

After I list all the attributes options with this query.
select *
from eav_attribute_option eao
join eav_attribute_option_value eaov on eao.option_id = eaov.option_id
where attribute_id = 2294
and eaov.store_id = 1;

It's here where I don't know to fetch all products based on the current list of attributes options.
What is the relation between EAV tables and Catalog products? right now in the 'catalog_product_entity' table, I have an ATTRIBUTE_ID column but there's no product with attribute_id = 2294.
Someone have hint where i need to look for?


texts: Magento 2: Custom Attribute into Product Page

texts:
I am trying to add custom attribute into product page, but for some reason its generating error even after running all imp commands.
<block class="Magento\Catalog\Block\Product\View\Description"
                   name="product.info.my.info"
                   template="Magento_Catalog::product/view/attribute.phtml">
                    <arguments>
                        <argument name="at_call" xsi:type="string">GetMyInfo</argument>
                        <argument name="at_code" xsi:type="string">my_info</argument>
                        <argument name="at_label" xsi:type="string">none</argument>
                        <argument name="add_attribute" xsi:type="string">itemprop="my_info"</argument>
                    </arguments>
                </block>

Do i have to describe the GetMyInfo method some where ?
Here is error generating on product page
 1 exception(s):
 Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Catalog\Model\Product\Interceptor::GetMyInfo

 Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Catalog\Model\Product\Interceptor::GetMyInfo
 <pre>#1 include('/var/www/vhosts/...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
 #2 Magento\Framework\View\TemplateEngine\Php->render(&Magento\Catalog\Block\Product\View\Description#000000004c1cab8400000000466be1bb#, '/var/www/vhosts/...', array()) called at [vendor/magento/framework/View/Element/Template.php:271]
 #3 Magento\Framework\View\Element\Template->fetchView('/var/www/vhosts/...') called at [vendor/magento/framework/View/Element/Template.php:301]
 #4 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
 #5 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1103]
 #6 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:673]
 #7 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:564]


texts: Error when placing order after migration (Order saving error: SQLSTATE[42000]: Syntax

texts:
After migrating our Magento 1 site to Magento 2 we're getting this error when we try place an order

Order saving error: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: INSERT INTO `` () VALUES ()

We've looked around but there seems to be no clear solution to this.


texts:
I just want to change the product id, as i want it to be continuous. I have IDs in the following order 1, 2, ..., 9, 10, 16, 17
 So I want to change 16 and 17 back to 11 and 12 respectively. This discontinuity must be appearing because I had deleted some products. So How to change product ID? by any method

Update: I tried deleting the items on top and registering it again but now it starts from 18 :P


texts:
Tell me how to make a block of reviews on a product page as a separate slider?

I’ve been looking for some examples for a long time but haven’t found it yet, I hope you can help


texts: Magento 2 : Terms and Condition validation not working on checkout page

texts:
I moved terms and condition functionality in checkout order summary block.

But, There are no any validation working before click on place order button.

I also added agreement validation code in my custom module checkout_index_index.xml

  checkout_index_index.xml :

<item name="agreements" xsi:type="array">
    <item name="component" xsi:type="string">Magento_CheckoutAgreements/js/view/checkout-agreements</item>
    <item name="sortOrder" xsi:type="string">100</item>
    <item name="displayArea" xsi:type="string">before-place-order</item>
    <item name="dataScope" xsi:type="string">checkoutAgreements</item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
</item>
<item name="agreements-validator" xsi:type="array">
    <item name="component" xsi:type="string">Magento_CheckoutAgreements/js/view/agreement-validation</item>
</item>

How to do it ?

Please help me.

Thanks.


texts: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row:a foreign key while placing new order from admin panel

texts:
I am getting below error while placing new order from admin panel

SQLSTATE[23000]: Integrity constraint violation: 1452
Cannot add or update a child row:
a foreign key constraint fails (sales_flat_order_item, CONSTRAINT sales_flat_order_item_ibfk_1
FOREIGN KEY (order_id)
REFERENCES sales_flat_order (entity_id))

  This error is generated randomly not all time

I know magento insert in table sales_flat_order_item after order is inserted.(FROM Mage_Sales_Model_Order :: _afterSave() method).

what would be cause for this ?

Magento ver. 1.9.0.1


texts: How can I set 'Minimum Order Amount' for each currency in Magento

texts:
I have different currencies in Magento store and I want to display separate Minimum Order value message in respective currency

Eg: I have Base currency as dollar. In System > Sales I have set minimum Order Amount 1000 and display message as THE MINIMUM VALUE ALLOWED FOR PURCHASE IS $ 1000

Now in Display Currency INR option I want the minimum order amount to be 64000 and Display Message THE MINIMUM VALUE ALLOWED FOR PURCHASE IS ₹ 64000

Can someone guide on this?


texts: How to show custom attribute value as label in magento 2 product listing page

texts:
How to show custom attribute value as label in Magento 2 product listing page.

I am using helper to show custom attribute value in product listing page corner of every image as label. I get the value but first custom attribute value is coming for all that is wrong.

Please check where i am doing mistake - product listing is grid view.

Data Helper page Data.php

namespace Satish\Addaction\Helper;

use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Product as ModelProduct;
use Magento\Store\Model\Store;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;

class Data extends \Magento\Framework\Url\Helper\Data
{

    /**
     * @var TimezoneInterface
     */
    protected $localeDate;

    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\ObjectManagerInterface $objectmanager,
        \Magento\Catalog\Model\ProductFactory $_productloader,

        TimezoneInterface $localeDate
    ) {
        $this->localeDate = $localeDate;
        $this->_objectManager = $objectmanager;
        $this->_productloader = $_productloader;

        parent::__construct($context);
    }

    public function getRecommendedValue($pid)
    {
        $product = $this->_objectManager->get('Magento\Catalog\Model\Product')->load($pid);
        return $product->getFree_test_label();
    }

}

Below is the phtml page

<?php /** @var $block \Magento\Catalog\Block\Product\Image */
$helper = $this->helper('Satish\Addaction\Helper\Data');
 ?>

<span class="product-image-container"
      style="width:<?= /* @escapeNotVerified */ $block->getWidth() ?>px;">
    <span class="product-image-wrapper"
          style="padding-bottom: <?= /* @escapeNotVerified */ ($block->getRatio() * 100) ?>%;">
        <img class="product-image-photo"
            <?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
            src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
            width="<?= /* @escapeNotVerified */ $block->getResizedImageWidth() ?>"
            height="<?= /* @escapeNotVerified */ $block->getResizedImageHeight() ?>"
            alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>"/>

    <?=  $helper->getRecommendedValue($block->getProductId()) ?>


texts: How to select the images as base image thumbnail image in bulk?

texts:
I have imported 7000 products through an Oscommerce website everything is great except that the imported images are not selected as base image , small image and thumbnail image.

I need to inform you that every product have a single image which will act as base image , small image and thumbnail image.

I am not getting how to do that as it's not possible for me to go to every product and mark the image as base image , small image and thumbnail image.

I have created a script and trying to run it is not giving any error but still not solving the issue.

<?php

 require 'app/Mage.php';
 Mage::app();
 $prod_id = 7068 ;
 $_product = Mage::getModel('catalog/product')->load($prod_id);
 $prod_img_col = $_product->getMediaGalleryImages();

 foreach($prod_img_col as $gallery_img) {

  $_product->addImageToMediaGallery(Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product'. $gallery_img['file'], array('image', 'thumbnail', 'small_image'), false, false);

 }

  ?>

I hope anyone knows how to do this.

Thanks,
Sarvagya


texts:
I have issue after upgrade magento 2.2.9 to 2.3.4. Compile command php bin/magento setup:di:compile stops during the process and root file error_log can see

PHP Fatal error:  Declaration of Rokanthemes\OpCheckout\Block\Checkout\AttributeMerger::getDefaultValue($attributeCode) must be compatible with Magento\Checkout\Block\Checkout\AttributeMerger::getDefaultValue

File: AttributeMerger.php

<?php

namespace Rokanthemes\OpCheckout\Block\Checkout;

use Magento\Directory\Helper\Data as DirectoryHelper;
use Magento\Customer\Model\Session;
use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository;
use Magento\Customer\Helper\Address as AddressHelper;
use Rokanthemes\OpCheckout\Helper\Config as OneStepConfig;
use Magento\Directory\Model\ResourceModel\Region\Collection as RegionCollection;

class AttributeMerger extends \Magento\Checkout\Block\Checkout\AttributeMerger
{

    protected $_oneStepConfig;

    protected $_regionCollection;

    protected $_directoryHelper;

    public function __construct(
        AddressHelper $addressHelper,
        Session $customerSession,
        CustomerRepository $customerRepository,
        DirectoryHelper $directoryHelper,
        OneStepConfig $oneStepConfig,
        RegionCollection $regionCollection
    )
    {
        $this->_oneStepConfig = $oneStepConfig;
        $this->_regionCollection = $regionCollection;
        $this->_directoryHelper = $directoryHelper;
        parent::__construct($addressHelper, $customerSession, $customerRepository, $directoryHelper);
    }

    protected function getDefaultValue($attributeCode)
    {
        if ($this->_oneStepConfig->getFullRequest() == 'checkout_index_index') {
            switch ($attributeCode) {
                case 'firstname':
                    if ($this->getCustomer()) {
                        return $this->getCustomer()->getFirstname();
                    }
                    break;
                case 'lastname':
                    if ($this->getCustomer()) {
                        return $this->getCustomer()->getLastname();
                    }
                    break;
            }
            return null;
        } else {
            return parent::getDefaultValue($attributeCode);
        }
    }
}

How fix this issue? Thanks


texts: Magento2.2x How to change backend product grid price column base on store view

texts: Is there any way the price column of the backend product list grid can display local price and currency according to store view?


texts: Remove precision from price of a product

texts:
As I said in the title, I want to remove precision from price ( .00 )

I did these :

In app/code/core/Mage/Directory/Model/Currency.php

in

public function format()

I changed

 return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);

to

 return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);

In /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php

in

public function getEscapedValue()

I changed

 return number_format($value, 2, null, '');

to

 return number_format($value, 0, null, '');

In js/varien/js.js

I changed

var precision = isNaN(format.precision = Math.abs(format.precision)) ? 2 : format.precision;
var requiredPrecision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;

to

var precision = 0;
var requiredPrecision = 0;

And in app/code/core/Mage/Core/Model/Store.php

I changed

public function roundPrice($price)
    {
        return round($price, 2);
    }

to

 public function roundPrice($price)
    {
        return round($price, 0);
    }

Then I cleared the cache, and reindexed Magento (which is i version1.9), But the precision didn't remove, Am I missing something? what should I do?


texts: Unable to add product in cart with custom option via querystring

texts:
I am trying to add products with custom options in cart via query string but it does not worked.

//my redirecting on click here
<?php echo "http://localhost/magento_bnsb_guide/index.php/checkout/cart/add/product/".$_product->getId()."?qty=2&options[3]=1"; ?>')">

i copied this url from source.

http://localhost/magento_bnsb_guide/index.php/checkout/cart/add/product/7?qty=2&options[3]=1


texts:
I have contact lenses product.
User can choose qty for right eye or left eye or both.
So grouped product or bundle product i need to choose.
Basically left and right eye are check boxes.
So product qty ( right eye qty + left eye qty)


texts: Magento 1.9 : Swatch Image is not appearing at frontend

texts:
My swatch option name is

Black - 100% Italian Leather (Italian Leather)

and my image name is

black_-_100%_Italian_Leather_(Italian_Leather).png

I had also try with this name but not work

black---100%-italian-leather-(italian-leather).png

Swatch image is located at media/wysiwyg/swatches folder

can anyone tell me what I am doing wrong?


texts: Add breadcrumb in Checkout page (Magento 1.9)

texts:
How to add "Breadcrumbs" on the Checkout page (magento 1.9)?

Though by default the "Checkout" page does not contain breadcrumbs,

but I want to add those on my "Checkout" page.

I called them in my template with

<?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?>

All added the "Breadcrumb block" in my checkout layout

but still it is not getting displayed


texts: 404error while running cronjob in magento

texts:
I am facing 404 error while running cron from url

http://www.mywebsitesite/cron.php

This shows 404 error . My cron job is not running.

Kindly help to resolve the issue


texts: How to list all products together with their activated/deactivated state using plain SQL?

texts:
I want a list of all products together with a column saying either deactivated or activated for the product. I want to use plain SQL.

I tried for a while but did not find that information. Any ideas?

Thanks!


texts: Retrying failed jobs with the mysql message queue

texts:
We're using magento's message queue with the mysql provider to push new orders to an external system.
The external system is sometimes unreliable and failes, resulting in the queued job failing.
Most of the time, the failures get resolved after a bit of time, so all we should do is retry the job and it should be fine.
Is there a way to automatically retry a failed job with a backoff period in magento or would we need to build that ourselves?
We are looking for a similar solution as the one Laravel provides.


texts: Wrong URL when loading files in magento 1.9

texts:
When I try to load the website on localhost, I get the following URL,

http://localhost/beta/localhostskin/frontend/default/default/css/styles.css

The localhost is getting repeated. Here is my config

 5 | default |        0 | web/unsecure/base_url       | localhost                   |
|         6 | default |        0 | web/secure/base_url         | localhost                   |
|        15 | default |        0 | web/unsecure/base_link_url  | {{unsecure_base_url}}       |
|        16 | default |        0 | web/unsecure/base_skin_url  | {{unsecure_base_url}}skin/  |
|        17 | default |        0 | web/unsecure/base_media_url | {{unsecure_base_url}}media/ |
|        18 | default |        0 | web/unsecure/base_js_url    | {{unsecure_base_url}}js/    |
|        19 | default |        0 | web/secure/base_link_url    | {{secure_base_url}}         |
|        20 | default |        0 | web/secure/base_skin_url    | {{secure_base_url}}skin/    |
|        21 | default |        0 | web/secure/base_media_url   | {{secure_base_url}}media/   |
|        22 | default |        0 | web/secure/base_js_url      | {{secure_base_url}}js/

And for merging

 571 | default |        0 | dev/js/merge_files      | 0     |
|       572 | default |        0 | dev/css/merge_css_files | 0

Can anyone tell me, how to fix this ?


texts: Magento 1.9 : How to add product chooser in custom module form

texts:
I have created a custom module with product multi-select, but I have above 50K products so form taking time to load, so I want to add product chooser in my form, I checked for this and find one post :

Product Chooser in Custom Module

But didn't get how to use in my custom module.

How can I use product chooser in my custom module and save product_id with comma separated?

And similarly, want to add category chooser in a custom module.


texts: Add Customer Group attribute to Sales Order

texts:
I have created a new attribute for Customer Groups called course_id but I need to get the value of this attribute to then become the value for a new attribute for a Sales Order.

Any ideas how I could do this?

I would assume:

Create new Sales Order attribute for Course ID
Get value of Customer Group Course ID to set the value for all new Sales Orders attribute for Course ID

Any help is much appreciated.

EDIT:

This is my current observer, but it doesn't seem to be working correctly. I have added the new new columns in the database (customer group is course_id and sales order is salescourse_id):

<?php
class MyCompany_CustomerGroupCourseID_Model_Observer
{
    /**
     *
     * @param Varien_Event_Observer $observer
     * @return object
     */
    public function setCourseID(Varien_Event_Observer  $observer)
    {
                //get event data
        $event = $observer->getEvent();

                //get order
        $order = $event->getOrder();

        //get current customer group and set course id

         $customerid = Mage::getSingleton('customer/session')->getCustomerGroupId();
        $courseId = Mage::getSingleton('customer/group')->load($customerid)->getData('course_id');

        if (isset($courseId)){

        $order->setSalescourseId($courseId)

        return $this;
        }
    }
}


texts:
VMRReports/AdminHelloWorld/etc/config.xml:

<?xml version="1.0"?>
<config>
    <module>
        <VMRReports_AdminHelloWorld>  <!-- Explain this line so like: Namespace_Modulename_IDunno -->
            <version>1.0</version>
        </VMRReports_AdminHelloWorld>
    </module>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <helloworld before="Mage_Adminhtml">VMRReports_AdminHelloWorld</helloworld>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

HelloWorldController.php:

<?php

class VMRReports_AdminHelloWorld_HelloWorldController extends Mage_Adminhtml_Controller_Action {
    protected $_publicActions = array('index');
    public function IndexAction() {
        echo 'Hello Index! HelloWorld';
//  $this->loadLayout();
//  $this->renderLayout();
    }
}

================================

This shows up in /magento/index.php/admin/HelloWorld/index/

How do I get it to show up in

/magento/index.php/admin/helloworld/index/ ???

And by this I meant, is it possible to use the camel case I am using while forcing the URL to remain all lowercase?


texts:
I need to rewrite how filter looks, but there's no specific template for that the label rendering in Magento core, so what's the best way to edit how it looks?

The code in Catalog/Model/Layer/Filter/Price.php so I need to change the label.

 protected function _renderRangeLabel($fromPrice, $toPrice)
{
    $store      = Mage::app()->getStore();
    $formattedFromPrice  = $store->formatPrice($fromPrice);
    if ($toPrice === '') {
        return Mage::helper('catalog')->__('%s and above', $formattedFromPrice);
    } elseif ($fromPrice == $toPrice && Mage::app()->getStore()->getConfig(self::XML_PATH_ONE_PRICE_INTERVAL)) {
        return $formattedFromPrice;
    } else {
        if ($fromPrice != $toPrice) {
            $toPrice -= .01;
        }
        return Mage::helper('catalog')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice));
    }
}


texts: Problem with recursive event observer when removing quote items

texts:
I am working on a custom module that adds two products together - a setup product and a unit product (for example a setup charge for custom graphics and then a unit charge for the number of applications of those graphics)

My problem is that when a visitor removes either the setup or the unit product, I need to remove both products.

I am using the event listener: sales_quote_remove_item

my observer method looks something like this:

public function removeCustomizationItems(Varien_Event_Observer $observer) {
    $_product_id = $observer->getQuoteItem()->getProduct()->getId();

    // returns an array of customization product pairs (setup=>id, unit=>id, min_qty=>(int))
    $_target_products = Mage::helper('hq_customization')->getTargetProducts();

    foreach ($_target_products as $_target_product) {
        if ($_product_id == $_target_product['setup'] || $_product_id == $_target_product['unit']) {
            $this->removeItems($_target_product);
        }
    }
}
public function removeItems($_target_product) {
    if (!empty($_target_product['setup'])) $_remove_ids[] = $_target_product['setup'];
    if (!empty($_target_product['unit'])) $_remove_ids[] = $_target_product['unit'];

    $cartHelper = Mage::helper('checkout/cart');
    $items = $cartHelper->getCart()->getItems();

    foreach ($items as $item) {
        $itemId = $item->getItemId();
        $prodId = $item->getProductId();

        if (in_array($prodId, $_remove_ids)) $cartHelper->getCart()->removeItem($itemId)->save();
    }
}

The problem that I am having is that each call to remove a product from the cart fires the sales_quote_remove_item event which creates an infinite loop.

Any suggestions?


texts:
I am trying to patch my site with SUPEE 10570 but I am having the error below

can't find file to patch at input line 1171
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git app/locale/en_US/Mage_Catalog.csv app/locale/en_US/Mage_Catalog.csv
|index bbdc417..fa5167a 100644
|--- app/locale/en_US/Mage_Catalog.csv
|+++ app/locale/en_US/Mage_Catalog.csv

I checked my server an noticed that there is no file called "app/locale/en_US/Mage_Catalog.csv" my previous developer delated

  app/locale/en_US/Mage_Catalog.csv

for whatever reason I don't know. Would I be able to upload a new "app/locale/en_US/Mage_Catalog.csv" file onto the server for the Patch then remove it after or I can just leave the "app/locale/en_US/Mage_Catalog.csv" file after the patch with no issues. Thanks


texts: Magento Security Scanner does not detect SUPEE-8788

texts:
I am trying the Magento Security Scanner in our projects however the scanner fails to detect that SUPEE-8788 is applied. We are using Magento 1.9.3.7 installed via composer with a clean install.

  Your Magento installation is vulnerable to the vulnerabilities
  addressed in SUPEE-8788. /js/mage/adminhtml/uploader/instance.js
  /fustyFlowFactory/ /skin/adminhtml/default/default/boxes.css
  ~background:url(images/blank.gif) repeat;~

I've confirmed that all files that were patched by SUPEE-8788 are equal to the ones in the zip file that you can download from magento.com. As an example, MageReport does not have an error in the same patch and I've read the document that details their detection method.

EDIT 2018-10-29

The issue eventually disappeared. I believe it was a bug in the scanner that was fixed by Magento.


texts: Product Url As catalog/product/view/_ignore_category/1/id/

texts:
Recent day , when i am uploading any product in bulk, its url is generated as catalog/product/view/_ignore_category/1/id/.....

1. Search enginer optimisation is set as below

Use Canonical Link Meta Tag For Categories - Yes

Use Canonical Link Meta Tag For Products - Yes

2. Reindexing and chache refeshed but issue is not resolving.

Kindly help i am using mangento 1.9.0.1.


texts: Magento v1 to v2 Migration with SQLSTATE[HY093] for catalog_product_bundle_option_value

texts:
I've been struggling with the migration of v1.9.2.4 to v2.2.6 for a couple of days now where the settings migrate fine but when it comes to the data I get the following error and no matter what I do it doesn't pass it:

[2018-09-29 18:17:51][DEBUG][mode: data][stage: data migration][step: Map Step][table: catalog_product_bundle_option_value]: migrating
100% [============================] Remaining Time: < 1 sec

  [PDOException]
  SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

Exception trace:
 () at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:169
 PDOStatement->execute() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:169
 Migration\ResourceModel\Adapter\Mysql->insertMultiple() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Adapter/Mysql.php:137
 Migration\ResourceModel\Adapter\Mysql->insertRecords() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Destination.php:52
 Migration\ResourceModel\Destination->saveRecords() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/Step/Map/Data.php:175
 Migration\Step\Map\Data->perform() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php:79
 Migration\Mode\AbstractMode->runStage() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:119
 Migration\Mode\Data->runData() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/Mode/Data.php:69
 Migration\Mode\Data->run() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/data-migration-tool/src/Migration/Console/MigrateDataCommand.php:51
 Migration\Console\MigrateDataCommand->execute() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/symfony/console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/symfony/console/Application.php:843
 Symfony\Component\Console\Application->doRunCommand() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/magento/framework/Console/Cli.php:104
 Magento\Framework\Console\Cli->doRun() at /var/www/vhosts/www.jawikw.com/httpdocs/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/vhosts/www.jawikw.com/httpdocs/bin/magento:23

migrate:data [-r|--reset] [-a|--auto] [--] <config>

Does anyone have any idea on what can be done to solve the issue with catalog_product_bundle_option_value?

Thanks,


texts: Magento 2 creating configuration articles programmatically

texts:
I have some troubles with assigning simple or virtual products to a
  configurable product in Magento 2 programmatically.

  The code I use is already from a Magento.StackExchange issue but it is
  not working for me and am really confused already. Through my testing,
  I use hardcoded variables. Simple products (future variants and
  parent) are created manually. my code just runs the
  createConfigurable() method once. Attribute code 93 is for color and
  193 for size.  The Result is that I get a configurable product
  (parent) but not assigned with the variations.

public function createConfigurable(){
    $attributeSetId = 9;
    $parentId = 161;
    $associatedProductIds = array(157,158);//Simple Product ids array
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->create('Magento\Catalog\Model\Product')->load($parentId); // Load Configurable Product
    $attributeModel = $objectManager->create('Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute');
    $position = 0;
    $attributes = array(93,139); // Super Attribute Ids Used To Create Configurable Product(list of supper attribute ids what ever belong to that the attribute set under which the configurable product is)

    foreach ($attributes as $attributeId) {
        $data = array('attribute_id' => $attributeId, 'product_id' => $parentId, 'position' => $position);
        $position++;
        $attributeModel->setData($data);//->save();
    }
    $output->writeln(var_dump($data));
    $product->setTypeId("configurable");
    $product->setAffectConfigurableProductAttributes($attributeSetId);
    $objectManager->create('Magento\ConfigurableProduct\Model\Product\Type\Configurable')->setUsedProductAttributeIds($attributes, $product);
    $product->setNewVariationsAttributeSetId($attributeSetId);
    $product->setAssociatedProductIds($associatedProductIds);// Setting Associated Products
    $product->setCanSaveConfigurableAttributes(true);
    $product->save();
}

  hope someone has ideas to solve this issue!

  thank you


texts: Can i import the bundle products in magento by using csv?

texts:
i want to import the bundle products by using csv in magento.i am import the bundle products by using dataflows its import the bundle products but its not show the bundle items in backend.

headers my csv files:

store   websites    attribute_set   type    category_ids    sku has_options vendor  color   status  tax_class_id    visibility  price   cost    weight      url_key gift_message_available  url_path options_container  description meta_keyword    short_description bundle_options bundle_selections

plz give the correct headers csv.

thanx,
Rama Krishna


texts: How to import 3 tables dump into database using script?

texts: I want to include 3 tables SQL dump into that database, how to add it by using a custom module or script or any best practice.


texts: Difference between system.log and exception.log

texts:
I want to know what is the difference between system.log and exception.log.

I usually see logs on SSH by tail on all /var/log tail -f * but I want to know what part of Magento appears in both files.


texts: Magento 2.3 send an email with PDF Attachment

texts: please help me out of sending an email with a PDF attachment.


texts: how do I call function(Helper) from xml in magento

texts:
i see this post

I want to do the same but with a condition. I want to call an helper function which return a boolean. And in my xml do like :

    <?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="ajax-empty" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="root">
            <block class="Magento\Framework\View\Element\Template" name="customer.account.popin" template="MyVendor_Customer::form/popin_disconnected_content.phtml">
                IF USER IS LOGGED IN
                    <block class="Magento\Framework\View\Element\Messages" name="messages"/>
                    <block class="Magento\Customer\Block\Form\Login\Info" name="customer.account.popin.register" template="Magento_Customer::newcustomer.phtml"/>
                    <block class="Magento\Customer\Block\Form\Login" name="customer.account.popin.login" template="Magento_Customer::form/login.phtml">
                        <block class="Magento\Persistent\Block\Form\Remember" name="remember_me" template="Magento_Persistent::remember_me.phtml" ifconfig="persistent/options/enabled" as="form_additional_info"/>
                    </block>
                END
                IF USER IS NOT LOGGED IN
                    <block class="Magento\Customer\Block\Form\Login\Info" name="customer.account.popin.register" template="Magento_Customer::newcustomer.phtml"/>
                MORE CONTENT WILL BE ADD HERE
                END
            </block>
        </referenceContainer>
    </body>
</page>

How can I do this ?

EDIT : this is like I want to do but it's with observers and I'm too weak with magento 2 config to change it for helpers, can you help me please ?


texts:
I have this working SQL query :

SELECT main_table.* FROM prd_brand AS main_table INNER JOIN catalog_product_entity_int ON main_table.brand_id=catalog_product_entity_int.value group by brand_id order by name asc

And I'm trying to get it work in Magento, so I did this :

        $brandCollection = $brand->getCollection();
        $brandCollection->join('catalog_product_entity_int', 'catalog_product_entity_int.value = main_table.brand_id', '*');
        echo $brandCollection->getSelect();

It generates this SQL query:

SELECT `main_table`.*, `catalog_product_entity_int`.* FROM `prd_brand` AS `main_table` INNER JOIN `catalog_product_entity_int` ON catalog_product_entity_int.value = main_table.brand_id

The problem is that I don't like to select the catalog_product_entity_int but only the main_table (prd_brand) table.

How can I do it ?


texts: Multishipping Redirect/Order Submit Issue

texts:
I'm running into an issue with multishipping not proceeding from overview to success. The site in question has quite a bit of customization, but it is working successfully on my test server... so I'm pretty stumped. Any help would be greatly appreciated. Error logs below. When the user makes it to the overview step and hits submit (to send the order) the site redirects back to the addresses page.

2014-07-20T07:07:26+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Static_Block_Assets_Includes' in /MAGEROOT/app/Mage.php:595
Stack trace:
0 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
1 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('static/assets_i...', Array)
2 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('static/assets_i...', 'assets_includes...')
3 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('static/assets_i...', 'assets_includes...')
4 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Elem ent), Object(Mage_Core_Model_Layout_Element))
5 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Elem ent))
6 /MAGEROOT/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Elem ent))
7 /MAGEROOT/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
8 /MAGEROOT/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
9 /MAGEROOT/app/code/core/Mage/Checkout/controllers/MultishippingController.php(221): Mage_Core_Controller_Varien_Action->loadLayout()
10 /MAGEROOT/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_MultishippingController->addressesAction()
11 /MAGEROOT/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('addresses')
12 /MAGEROOT/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http) )
13 /MAGEROOT/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
14 /MAGEROOT/app/Mage.php(684): Mage_Core_Model_App->run(Array)
15 /MAGEROOT/index.php(87): Mage::run('', 'store')
16 {main}

system.log:

2014-07-20T06:55:52+00:00 ERR (3): Notice: Undefined index: qty in /MAGEROOT/app/code/core/Mage/Checkout/Model/Type/Multishipping.php on line 218


texts: How to enable review form tab only after click on Add your review link or on review count in product details page magento 2?

texts: How to enable review form tab only after click on Add your review link or on review count in product details page magento 2 custom theme?


texts:
can anyone please explain briefly what is the use of update handle, why we are using in layouts in magento2?

Thanks,


texts: Not receiving transactional emails in Magento 1.9.2.2

texts:
I am facing an issue in receiving email. I configured the sales email setting properly in Magento 1.9.2.0 and it was working good. But When I upgraded it to Magento 1.9.2.2 the emails are not being sent. I also checked the Cron, it is also set.

Is there any way to set it from admin panel? Or any way to get emails in my email box?


texts: I have added js using require js but it is not attached

texts:
I have added javascript files in require js but it is not showing in the inspect element that my javascript files are attached and it is not working.
What should I do? I have cleared cache and folders and almost everything deleted.
All cache folders and almost everything but not working.

What should I do in this?
>

My require.js is in code/vendor/module folder

    var config = {
    map: {
       '*': {
           jssor: 'js/jquery-1.11.3.min',
           jssorSlider: 'js/jssor.slider-27.5.0.min'
       }
   },
   shim: {
        slick: {
            deps: ['jquery']
        }
   },
};


texts: Magento Order Status goes back to Processing after marked as Shipped

texts:
I have a strange problem with my Magento 1.6.2 shop.
We have several payment options in use.
The usual SagePay and PayPal options are working fine, and exactly as expected.
The Cheque and Bank Transfer payment options are not, and it is causing disruption to the workflow.

When an order in placed online, it has a status of "Processing". All orders with a status of "Processing" are downloaded via our 3rd party software and entered into Sage200.

Once they are dealt with at our premises, the order is marked as "Shipped" and the order status becomes "Complete" in Magento. Normally...

What seems to be happening with Cheque and Bank Transfer paid orders, is they are marked as Shipped as normal, but they go back to "Processing" Status, which means they are then downloaded to our Sage200 system again!!

Does anyone know why this might be happening please?


texts: Patch 7405 v1.1 Installation error - Already Installed Patch 7405 v1.0

texts:
Installation  error :

How can i solve this  Patch 7405 v1.1 Installation  error?


texts: Magento 2 Rest Api get Thumbnail Image url

texts:
How do we get the url to thumbnail image of of a product through rest API.

/V1/products/{sku}/media
would get us the relative url such as "/m/b/mb01-blue-0.jpg"

and the image url would be baseurl/catalog/product/m/b/mb01-blue-0.jpg

This works fine. But how do we  get the thumbnail which usually resides in the cache folder.


texts: Please, tell me, does EcomDev PHPUnit work with community edition?


texts: How do I move the cart and search box for header

texts:
I want to do this on my site but I can't do it.

I already tried this code but it didn't work

<?xml version="1.0"?>

<body>
    <move element="top.search" destination="panel.wrapper ."/>
    <move element="minicart" destination="header.panel"/>
</body>


texts: How to get output from one observer file to another observer file?

texts: I have two observer file. One event is called for salesrule_validator_process and other observer file is called for sales_quote_collect_totals_after. How to get the result of salesrule_validator_process in sales_quote_collect_totals_after.


texts: Grand total not available in custom totals collector

texts:
I'm trying to add a certain fixed amount to the grand total of an order through a totals collector. But, for some reason, grand_total and base_grand_total are always 0.

I've tried every <before> and <after> combination I could think of, but for some reason grand_total and base_grand_total are always 0.

Am I overlooking something obvious here? Could anybody point me into the right direction? I'm using Magento 1.9.0.1.

Thanks in advance!

config.xml

<!-- ... -->
<sales>
    <quote>
        <totals>
            <discount>
                <class>ipsum/discount_quote</class>
                <after>grand_total</after>
            </discount>
        </totals>
    </quote>
</sales>
<!-- ... -->

Quote.php (all temporary, of course ;-))

<?php
/**
 *
 */
class Lorem_Ipsum_Model_Discount_Quote
    extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    /**
     *
     */
    public function collect(Mage_Sales_Model_Quote_Address $address) {
        if ($address->getAddressType() != 'shipping') {
            return $this;
        }

        var_dump($address->getGrandTotal()); die();

        return $this;
    }

    /**
     *
     */
    public function fetch(Mage_Sales_Model_Quote_Address $address) {
        if ($address->getAddressType() != 'shipping') {
            return $this;
        }

        $address->addTotal(array(
            'code'  => 'lorem_ipsum',
            'title' => 'Lorem Ipsum',
            'value' => 0,
        ));

        return $this;
    }
}


texts: How to reindex programmatically in Magento2

texts:
I want to reindex all indexes in Magento2 from an external file, for this I created a external file as below :

...
    $indexers = $objectManager->get('Magento\Framework\Indexer\ConfigInterface')->getIndexers();
    foreach($indexers as $indexer)
    {
        $actualIndexer = $objectManager->get('Magento\Framework\Indexer\IndexerInterface')->load($indexer['indexer_id']);
        $actualIndexer->reindexAll();
    }

...

When I run it on then only config index reindexed, not all.

I know it is not a good way to reindex but It is my custom module requirement, I want to integrate reindex code in my module save controller, so that when client save form there will be no indexing issue.

How to reindex all indexes?


texts: Is it possible to get the current store view data in a js file. I mean is that info is stored somewhere in the js environment?


texts: How to Call attribute ( attribute code : product_collection) in a CMS block in magento 2.1 CE

texts: Am having attribute called product_collection, want to call this attribute value in cms block and need to display the value in one category. thank you


texts: Magento 2: Background gradient and image

texts:
Magento 2.2.1 custom theme which inherits from Magento/blank.

I am trying to assign a background which has a radial gradient as the bottom layer and an image as the top layer.

Assigning a solid colour and then assigning a background image displays as expected.

_extends.less:

body {
  background: #333;
  .lib-css(background-image, @page__background-image);
  background-repeat: no-repeat;
  background-position: 50% 250px;
  background-size: 40%;
}

The value for background-image is defined in _theme.less as follows:

  @page__background-image: url('@{baseDir}images/background-image.png');

In order to achieve the desired result, I have modified the CSS, like so:

body {
  background: rgb(51,51,51); /* Old browsers */
  .lib-css(background-image, @page__background-image);
  background: @page__background-image,
              -moz-radial-gradient(center, ellipse farthest-corner, rgba(34,34,34,1) 0%, rgba(34,34,34,1) 52%, rgba(17,17,17,1) 100%); /* FF3.6-15 */
  background: @page__background-image,
              -webkit-radial-gradient(center, ellipse farthest-corner, rgba(34,34,34,1) 0%,rgba(34,34,34,1) 52%,rgba(17,17,17,1) 100%); /* Chrome10-25,Safari5.1-6 */
  background: @page__background-image,
              radial-gradient(ellipse at center, rgba(34,34,34,1) 0%,rgba(34,34,34,1) 52%,rgba(17,17,17,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  background-repeat: no-repeat;
  background-position: 50% 250px, 0% 0%;
  background-size: 40%, 100% 100%;
}

Following these changes, the image displays as expected, but the background does not extend to fill the height of the container.

Presumably, this is because it is not being applied via the .lib-css mixin, so the original styles are not being overridden properly, but I'm unsure how to implement this solution.


texts: addFieldToFilter doesn't return the right product for selected attribute values

texts:
I am currently programming a product configurator module for Magento. Everything is working fine so far besides the core functionality: choosing the right product from the database for the selected attributes. My attributes belong to an attribute group from which the form fields for my configurator are generated, the values I use are the admin fields. The shop language is swedish.

The shop contains one configurable product with simple products associated to it. The simple products don't show individually in the shop. Right now not all combinations of my attributes are existing but it should at least return the right product for one combination I know is existing. First it always returned null, right now it returns all products. How can I achieve to have just product be chosen?

First the attributes didn't even show in the query until I activated "Used in Product Listing".

Thanks in advance for any help :)

This is my getProduct method:

public function getProduct($attributes)
{

    Mage::Log($attributes);

    //Get Product Collection
    $collection = Mage::getModel('catalog/product')->getCollection();

    $collectionCount = count($collection);

    Mage::Log($collectionCount);

    //Filter for Selected Product
    $collection->addFieldToFilter('doorconfig_enable',array('eq' => 'Yes'));

    foreach ($attributes as $key => $value)
    {
        $collection->addFieldToFilter($key,array('eq' => $value));
    }

    $selection = $collection->getSelect()->__toString();

    Mage::Log($selection);

    $collectionCount = count($collection);

    Mage::Log($collectionCount);

    $product = $collection->getFirstItem();

    return $product;

}

The $attributes parameter contains the POST data which is correctly submitted:

[doorconfig_color] => 000000
[doorconfig_type] => lines
[doorconfig_size] => 2500x1800
[doorconfig_remote] => no
[doorconfig_digitalkeypad] => No
[doorconfig_extraremotecontrol] => No
[configdoor_addemergencylock] => No
[doorconfig_insideopeningbutton] => No
[doorconfig_window] => No window

"configdoor_addemergencylock" is a typo by my dear collegues, but still read correctly from the database (just if anyone wonders). As I am not good in SQL and not very experienced in Magento, I don't know whether my query is right or wrong:

2013-07-20T09:47:19+00:00 DEBUG (7): SELECT 1 AS `status`, `e`.`entity_id`,
`e`.`type_id`, `e`.`attribute_set_id`, `price_index`.`price`, `price_index`.
`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL,
LEAST(price_index.min_price, price_index.tier_price), price_index.min_price)
AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`,
`price_index`.`tier_price`, `e`.`doorconfig_color`, `e`.`doorconfig_color_value`,
`e`.`doorconfig_type`, `e`.`doorconfig_type_value`, `e`.`doorconfig_size`,
`e`.`doorconfig_size_value`, `e`.`doorconfig_remote`, `e`.`doorconfig_remote_value`,
`e`.`doorconfig_digitalkeypad`, `e`.`doorconfig_digitalkeypad_value`,
`e`.`doorconfig_extraremotecontrol`, `e`.`doorconfig_extraremotecontrol_value`,
`e`.`configdoor_addemergencylock`, `e`.`configdoor_addemergencylock_value`,
`e`.`doorconfig_insideopeningbutton`, `e`.`doorconfig_insideopeningbutton_value`,
`e`.`doorconfig_window`, `e`.`doorconfig_window_value` FROM `catalog_product_flat_1`
AS `e` INNER JOIN `catalog_product_index_price` AS `price_index`
ON price_index.entity_id = e.entity_id AND price_index.website_id = '1'
AND price_index.customer_group_id = 0 WHERE (e.doorconfig_color = '000000')
AND (e.doorconfig_type = 'lines') AND (e.doorconfig_size = '2500x1800')
AND (e.doorconfig_remote = 'no') AND (e.doorconfig_digitalkeypad = 'No')
AND (e.doorconfig_extraremotecontrol = 'No') AND (e.configdoor_addemergencylock = 'No')
AND (e.doorconfig_insideopeningbutton = 'No') AND (e.doorconfig_window = 'No window')


texts: Magento 2 Get Order Data In Order Email Confirmation Template

texts:
I have made a custom template to use in my order confirmation email template.

I want to get the order data in this template so I can create a custom order grid layout.

I'm not sure on how to do this? Can anyone point me in the right direction?


texts:
For some reason Redis seems to be removing breadcrumbs from the product view. As soon as I flush Redis they reappear for a while then disappear again.

Does anyone know of an issue with Redis with regards to breadcrumbs or does anyone know of an affective way to hole punch the breadcrumbs so they aren't cached?


texts: Custom Shopping Cart Price Rule - Most Expensive Product

texts:
I would like to create a shopping cart price rule which

Checks for a pre-defined customer attribute
Applies a price rule to the most expensive product in the cart

What's a good starting place for this?  What events could I observe?  What's the fastest way to implement this?


texts:
I am trying to install Magento 2.3 with PWA studio, but when I am not getting the right steps.

Can you explain for this?

Thanks


texts: How to import Configurable product from csv with custom attributes using php script

texts: I am trying to import a configurable products in magento 2 with custom attributes using a php script. How far I got the php script to create simple product without custom attributes as a newbie i don't know too much about magento 2. If you could help. I shall be very thankful to you.


texts: Reuse same product image for multiple products

texts:
I use for some products the same 'product-image'.

  How do i reuse the same image for multiple products?


texts: Magento 2 - Choose payment method for one checkout programmatically

texts:
Question (+ TL;DR)

Is it possible to choose programmatically specific payment method only for actual checkout process, like - one time choice?

Some context:

I'm developing a plugin for magento related to installments and I want to add a button to product page responsible for choosing a particular payment option. I need to implement a behavior for a button that adds a product to  cart, redirects to cart and if user decides to go through checkout, a particular payment method will be already selected (payment through installments).

What I've done

As there is plenty of information about how to take care of adding product to cart programmatically or redirecting somewhere, unfortunately I haven't managed to find any information about the last thing I need here. Here is source of controller that does mentioned things:

Controller\customcontroller\Index.php, in execute():

$params = array(
    'form_key' => $formKey,
    'product' => $productId,
    'qty' => 1,
);
$this->cart->addProduct($product, $params);
$this->cart->save();

$resultRedirect = $this->resultRedirect->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect->setUrl("/checkout/cart");

return $resultRedirect;


texts: Magento 2 Missing required argument $areaCode of Magento\Framework\App\Area

texts:
I'm using CLI to execute a custom module, that generate a custom sales report.

It has been working nicely, but it suddenly failed with the error Missing required argument $areaCode of Magento\Framework\App\Area for those orders that has status 'closed'.

I have in the executefunction set areacode since very beginning. I'm not sure why all of sudden it gives error.

protected function execute(InputInterface $input, OutputInterface $output)
{
    $this->state->setAreaCode(Area::AREA_ADMINHTML);
    $task = trim($input->getOption(self::TASK_OPTION));
    if(!empty($task)) {
        return $this->processTask($task);
    }

    $this->cronProcessReports->process();
}

how can I fix this?

I'm using Magento2.2.7


texts:
I was trying to create a customer attribute.I made some mistakes in the code so I got error while editing existing customer and adding new customer.Now I remove the whole module,cleaned cache,run setup upgrade but still getting the same error.
I attach it below.Please help me to resolve the error.


texts: How to get product image path by product id in magento 2

texts:
Hello friends i want to fetch image path like var/www/magento/pub/media
i wand to display image in admin grid i am  using rendarar to get image
image path by passing Product id. How this can be achieved ? please explain

thanks
Adarsh Shukla