texts: Selecting products by multiple color swatches?

texts:
Basically what I'm trying to achieve is the ability for a potential customer to select a product based on not one, but two colors by using a color picker, or a swatch of some sort. An example of what I'm after can be found here in the sidebar to the left. I've seen multiple modules offering color pickers & swatches, however they all seem to only support one color, not two (or more). The example in the link I gave places selected colors into the URL.

What I'd really like to know is if there's a extension/plugin that can achieve this (I've search extensively but there's always the odd extension that no-one can find) or if it's going to require me manually adding this feature into Magento. If there is no module, is there any way to achieve what I'm after via a few attributes?

I'm using the latest version of Magento CE (1.7.0.2).

Example scenario:

Bob wants a shirt with black and red colors on it.

He selects black as the primary color.

The search results then show every shirt that has black on it.

He then selects red as the secondary color.

The search results then show every shirt that has black & red on it.

Any answers given will be highly appreciated! I've been racking my brain trying to think of the most efficient way to do this but have drawn blanks.


texts: Magento - Admin manage products grid ajax search returns the whole page

texts:
When I click the search button on the Manage Products page in the admin of my Magento store the ajax call returns the whole page and places it inside the grid area of the initial page and the "Please wait..." modal/image never disappears.

For some reason the search ajax POST request returns a 302 response which is different to another one of my Magento stores that works correctly which returns a 200.

See screenshot below

Any ideas how to fix this?


texts: Is there any free ogone payment module for magento 2.2.5?

texts:
I want a free payment module of ogone for magento 2.2.5 for my project. I spent time on searching the module but no result. If anyone knows is there any free module for ogone  can refer the link or module.
Any kind of support is appreciated ?
Thanks in advance.


texts:
I need to create a custom form inside my site, in particularly inside a CMS page. The form action should send an email with a summary of the data entered.

It would be even better if the data were stored in the database and accessible through the backend but this is not essential.

What is the best way to do this? Should I create a module?


texts: Exclude products which are in more than one category from Cart Price Rules

texts:
I have a problem with Magento 2. We have products in more than one category. Now we would like to create a cart price rule, but we would like to exclude products for which one of the categories is marked.
For example:
We have product X, which is in Categories 'Women Clothing' and 'Sale' and
we have product Y which is only in the category 'Women Clothing'.
We want to create a cart price rule that exclude products which are in 'Sale'.
So for this example product X should be excluded from the discount.
I have tried creating a cart price rule, but as product X is in more than one category the product is not excluded from the discount.
Can somebody help me figure this out please?
Thanks in advance.
Best regards, Niels


texts:
My product data has quotes (as in "This is the best album yet!") in the product description field. This data is not current smart quotes.

Does this have to be converted to smart quotes in order not to choke the import process?


texts:
I have read through a document from an external source, which says magento 2.0 support MsSQL. Is this correct ? Link given below.

https://firebearstudio.com/blog/magento-2.html

However, when i set up magento 2.0 through installation wizard. I don't see an option to choose MsSQL. Also, when i give the MsSQL credentials, it will result me in error as following

SQLSTATE[HY000] [2003] Can't connect to MySQL server

My Question is, will magento 2.0 support MsSQL for the core magento tables. If yes, what's the flow to install ?

Will it work for community edition ? OR is it for enterprise edition ?

Let us know on this please.


texts: Magento extension is not working properly on production server

texts:
I'm trying to install this extension http://www.magentocommerce.com/magento-connect/postcode-nl-postcode-complementation-and-validation.html but it's not working.

I can see the settings in the configuration, I can edit those, I can set the extension as enabled, but except for the settings, it's not working.

Strange thing is that I had no problems on my localhost.

I deleted my cache in Magento and in var/cache, I deleted my sessions, I logged out and loggedin multiple times and still, the extension is not working.

Where do I have to look further? Struggling with it for 5 hours now...
Maybe something with my permissions?


texts:
I am using a plugin to add files for download to a product.

This uses the following to load on a product page:

<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
    <div class="box-collateral <?php echo "box-{$alias}"?>">
        <?php if ($title = $this->getChildData($alias, 'title')):?>

<?php echo $this->escapeHtml($title); ?>

        <?php endif;?>
        <?php echo $html; ?>

endforeach;?>

I need to then be able to load this information on the list.phtml page so that this information appears for the category pages. So I have added this code block to my list.phtml page as well.

I then added the following to my local.xml:

    <layout>
        <catalog_category_default>
            <reference name="product_list">
                <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
                    <action method="addToParentGroup"><group>detailed_info</group></action>
                </block>
            </reference>
        </catalog_category_default>
    </layout>

But the detailed_info is blank for products I know have options. I assume I have missed something!

How do I get this to show on the product pages?


texts: Checkout via authorize.net AcceptJS it will include https://js.authorize.net/v1/Accept.min.js

texts:
When checkout via authorize.net AcceptJS it will include https://js.authorize.net/v1/Accept.min.js, which return 404.
While it should include https://js.authorize.net/v1/Accept.js


texts:
I have a client who is designated owner in Search Console.
We are trying to get him verified, BUT adding code in Magento does not work.
We were trying to add the code via Content -> Configuration -> edit -> HTML HEAD ->  Scripts and Style Sheets.
As an alternative I was going to set up a new Search Console and see what is happening. Tried to verify via Google Analytics, since we have a full access. But this was also unsuccessful.
I also noticed that Google API is not enabled - so where the traffic is recorded through? I do not see GA code in the HEAD.
Are there any deeper locations which I simply can't access? But only developers?
Hope for any kind of help, as I have looked through so many materials about this.


texts: how to make a between clause in addAttributeToFilter?

texts:
how to make a between clause in the code like this? I only know less than and greater than ?

$_productCollection->addAttributeToFilter('attr_code', array('lteq' => $value));

$_productCollection->addAttributeToFilter('attr_code', array('gteq' => $value));


texts: how to change default sort by price to custom attribute like gtin in magento 2

texts: i have already tried to make the chanage of sort by price to custom attribute in admin store configuration but still the products are sorting by price in magento 2


texts: Magento product reviews not working at the front-end

texts:
Somehow I can't add reviews in the front-end of my Magento installation.

Initially I also wasn't able to add them in the back-end as well (404 error), but I resolved it with this tread: https://stackoverflow.com/questions/22846783/magento-admin-screens-add-new-review-button-not-working-and-generates-a-404-erro . So after this fix I can add them in the back-end and they show up in the front-end.

But now 1 problems remains. When I fill out the forms on the front-end and I hit 'Submit review' nothing happens. I hope someone can help me out.


texts: How to display total (sum of column) in magento grid during CSV export

texts: I have made a custom admin grid in which I have fetched two different columns through rendering, However now I want to display the total text (sum of all values) at the bottom while exporting it to CSV, like it is done in the report grids. How can I use and export the total row in a custom grid?


texts: No Homepage CMS or Footer Links on second Magento Store? Multi-Domain

texts:
I recently added a second Magento Store to our base store.

Main Site: Transpartswarehouse.com

Secondary Site: Transdeals4u.com

I believe I have configured everything correctly. Products and categories have all come across correctly.

The issue I am having is: "There was no Home CMS page configured or found."
on the homepage and no footer links in the second store like on the main site.

Edit: If I go to transdeals4u.com/home2 I can view the homepage I am trying to achieve but no footer links...

I have tried several things to remedy this issue to no avail.

I have gone into the Transdeals Store View and set the Default Pages to: 'transdeals' the new homepage I have created for that site.
I have made sure they are the same theme and everything is correctly enabled.
I have cleared my browser and magento cache several times.

Edit:

Also tried following method 2 on this guide (http://www.ecommercegorilla.com/how-to-set-up-multiple-store-fronts-with-magento/) Which did not work.

2nd Edit:

I returned to the site the next day and realized it had changed to a duplicate of transpartswarehouse.com, So I reapplied method two of the previous guide and it worked! I have the homepage there now and it is directed to the correct site, but there are still no footer links???

I am wondering if this issue is being caused by the different URL's of the two sites and somewhere I did not specify or rewrite them like I should have to pull these links from all these pages "Home" (Most importantly), "About Us", "Customer Service", and "Privacy Policy"

Let me know if you have any questions about this problem I will be soon to answer them. I would really appreciate the help. Thank you!

-Will Laskowsky


texts: Magento 1.9 : how to ovrride in lib/Zend folder inside currency.php file

texts: Override Magento root folder In lib/Zend/currency.php file possible or not.


texts: Determine if item has own stock, i.e. is not a compound item and not virtual

texts:
This seems like it should be straightforward but I cannot find a clean solution:

Given an order item, what's the best way to figure out if the item has its own stock?

First I load the stock item:

$stockItem = Mage::getModel('cataloginventory/stock_item')
    ->loadByProduct($orderItem->getProductId());

Unfortunately, I get results for all items, and those from configurable products seem undistinguishable from simple products.

Then I thought of:

checking the product type. This is my least favorite solution because we work a lot with custom product types. I would have to define every single case and change it when new types are added
checking if item is a parent item. Possible but there is only getParentItem() so I'd have to go through all items, collect the parent item ids and remove those items.

For a generic solution it would be great to cover virtual products as well but for my use case it is not relevant. Am I missing something obvious?


texts: Magento keywords usefulness (SEO) when using Apache Solr as search engine

texts:
I am studying implementing Solr as a search engine in a startup Magento store.

Since it's indexing the text in a (desirably) efficient way, the keywords I presume are irrelevant for the store indexing.

Can I bypass keywords at all ? What is the importance of keywords in this setup ? SEO only ?

Thanks for your insight.


texts: Magento 2 module version number not editable

texts:
I have just started exploring Magento 2 structure and code-flow, also module development.

When I created module from an online module generator and tried to change it's "setup_version" & "schema_version" in "module.xml" (doesn't matter if I increase or decrease version, it should be changeable as needed, I guess) and then if I follow all processes of compiling and enabling the module after flushing caches, it generates error as below on running the website:

a:4:{i:0;s:279:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Company1_Module1 schema: current version - 2.0.0, required version - 1.0.0
Company1_Module1 data: current version - 2.0.0, required version - 1.0.0";i:1;s:3447:"#0 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

Below is my module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
  <module name="Company1_Module1" schema_version="1.0.0" setup_version="1.0.0" data_version="1.0.0"/>
</config>

I know "data_version" is not needed but I did it for trial and error checks, still it gives error as above.

Need urgent assistance and guidance.


texts: Multishipping - Ship each item in cart to different set of addresses in the same order

texts:
We want a feature to allow each item in cart to be shipped to multiple addresses in a single order.

Magento does provide multishipping option, but it is applicable to all items in the cart in the same order.

We want to provide an option to customer to add multiple addresses against each item in cart (So that it can be sent as a gift to multiple addresses at once in the same order)

For e.g. if there are 2 items in the cart Item A and Item B, then Item A and Item B should be able to ship to different set of addresses.

Can anyone suggest how this can be achieved or if there are any extensions which can provide the above feature?


texts: Is there a software tool, like SQL Servers "Index Tuning Wizard", that will identify and create new indexes in MySQL?


texts:
My cron job is running but i am still getting these errors in error_log file.

PHP Fatal error: Class 'Magento\Update\Status' not found in /update/cron.php on line 15

and when i am installing any module then i am getting error at readiness check step cron job not set and other php errors while cron job is running.


texts:
I am using sales_order_save_after event.
In observer method, I have written following code:

$order = $observer->getEvent()->getOrder();
$order->setState(Mage_Sales_Model_Order::STATE_NEW, true);

But after order placed, order state is displaying as "processing" only. I have checked that observer method is called.


texts: How to display all wishlist items in wishlist sidebar

texts:
i Want to display all wish-list items in the sidebar?

Currently only last added three items are showing up.

I wanted to display all items in current wishlist selection.

What should I change in this file:

  vendor/magento/module-wishlist/view/frontend/templates/sidebar.phtml


texts:
I listen to this event: catalog_product_load_after and I need to retrieve the products id, I know I can retrieve the products' id with:

$collection = Mage::registry('current_category')
                       ->getProductCollection()
                       ->addAttributeToSelect('id')

But it doesn't look so convenient if the category has a lot of products, since this will run each time you change the page, so I wonder if there is a way to limit the products to be retrieved only to the current page.

Side question: $collection is just an array of numbers or I still need to loop through each element and run $product->getId()?

EDIT
What I need to do is manipulate the "add to cart" button of category and product pages according to some information, as far as I know I can do this only after the html of the page has been created
The information can be retrieved witht the product id, so I wonder if there is a way to limit the number of id that will be checked.
Inside the function I have also this:

if ($block instanceof Mage_Catalog_Block_Product_View) {..}
else if ($block instanceof Mage_Catalog_Block_Category_View){..}

EDIT 2
What I have tried:

$currentPage=Mage::registry('current_category')->getCurPage();
$currentSize=Mage::registry('current_category')->getPageSize();
$collection = Mage::registry('current_category')->getProductCollection()
                                                ->addAttributeToSelect('id')
                                                ->setPageSize($currentSize)
                                                ->setCurPage($currentPage);

Unfortunately $currentPage and $currentSize are empty

EDIT 3
I have tried:

$collection =  $observer->getProduct();;
Mage::log($collection, null, 'mylogfile.log');

but the log file is empty:

2015-05-17T18:22:37+00:00 DEBUG (7):

I have also tried:

$collection = $observer->getEvent()->getCollection()
$collection = $observer->getCollection()

EDIT 4
First I tried:

Mage::log(var_dump($observer), null, 'mylogfile.log');

but it printed the object on the frontend and it was unreadable,then i tried:

Mage::log(var_export(array_keys( $observer->getData() ), TRUE),NULL,'mylogfile.log');

that returned:

array (
  0 => 'event',
  1 => 'block',
  2 => 'transport',
)

Finally:

Mage::log(var_export($observer->debug(), TRUE), null, 'mylogfile.log');

and this is the result:

array (
  'event (Varien_Event)' =>
  array (
    'block (Mage_Catalog_Block_Category_View)' =>
    array (
      'type' => 'catalog/category_view',
      'current_category (Mage_Catalog_Model_Category)' =>
      array (
        'store_id' => '1',
        'entity_id' => '3',
        'entity_type_id' => '3',
        'attribute_set_id' => '3',
        'parent_id' => '2',
        'created_at' => '2014-08-12T08:47:07-04:00',
        'updated_at' => '2015-01-04 18:49:11',
        'path' => '1/2/3',
        'position' => '1',
        'level' => '2',
        'children_count' => '11',
        'name' => 'Dermocosmesi',
        'url_key' => 'test',
        'display_mode' => 'PRODUCTS',
        'url_path' => 'test.html',
        'is_active' => '1',
        'include_in_menu' => '1',
        'is_anchor' => '1',
        'custom_use_parent_settings' => '0',
        'custom_apply_to_products' => '0',
        'path_ids' =>
        array (
          0 => '1',
          1 => '2',
          2 => '3',
        ),
      ),
      'module_name' => 'Mage_Catalog',
    ),
    'transport (Varien_Object)' =>
    array (
      'html' => 'HTML',
    ),
    'name' => 'core_block_abstract_to_html_after',
  ),
  'block (Mage_Catalog_Block_Category_View)' => '*** RECURSION ***',
  'transport (Varien_Object)' => '*** RECURSION ***',
)

Products ids associated with this category: 1,2, but only one product per page is displayed and so only one of those two should be retrieved


texts: addAttributeToFilter not working in magento 2.1

texts:
I need to show product collection, if the attribute filter is set to yes .But it's not working. Here is my code

<?php /*echo "sadsadsa";*/

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$productCollection = $objectManager->get('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');

$collection = $productCollection->create()
        ->addAttributeToSelect('*')
        ->addFieldToFilter('top_selller','1')
        ->setPageSize(3)?>

 <?php foreach ($collection as $product) {
$product_id = $product->getId();
/*echo $product_id;*/?>

<?php   $imageHelper  = $objectManager->get('\Magento\Catalog\Helper \Image');
$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);
$image_url = $imageHelper->init($product, 'product_page_image_small')->setImageFile($product->getFile())->resize(200)->getUrl();?>
<img src="<?php echo $image_url; ?>" />

<?php echo $product->getName();
}?>


texts: It is possible to remove the product qty field?

texts:
I want to remove the 'Qty' field without removing the 'add to cart' button. But the best I've found is:

<referenceBlock name="product.info.addtocart" remove="true" />

Which removes both fields. Any suggestion to avoid this? Thank you.


texts: import configurable products from XML file

texts:
I'm trying to import products to my from XML link :

http://fulyan.com.tr/xml/?R=35116&K=6d2c&Imgs=1&AltUrun=1&TamLink

but it imports configurable product as a simple product. in XML file configurable products comes as -subproducts-
but I couldn't link associated products in Magento to sub-products in XML files.


texts: How To Manually change Order the Status to Processing Before Creating Invoice of the order?

texts:
If customer select bank transfer mode during checkout initial order status pending. I need to change the order status processing by manually before creating an invoice.

  Note: If I set initial status processing by default, supposed online payment cancel status also display like processing, now the
  online status is canceled the order status mode pending, that's why am
  not set initial status processing by default.


texts: Magento 1: after login need to redirect to previous page (before login) instead of dashboard page

texts:
I want to redirect customer after login to previous page rather than account dashboard page.

I set the Below Configuration

Login to admin panel Go to System -> Configuration -> CUSTOMERS -> Customer Configuration -> Login Options Set: Redirect Customers to Account Dashboard after Loggin in = No

Below is the code of core controller (did not modify any core class):

/app/code/core/Mage/Customer/controllers/AccountController.php

protected function _loginPostRedirect()
{
    $session = $this->_getSession();

    if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
        // Set default URL to redirect customer to
        $session->setBeforeAuthUrl($this->_getHelper('customer')->getAccountUrl());
        // Redirect customer to the last page visited after logging in
        if ($session->isLoggedIn()) {
            if (!Mage::getStoreConfigFlag(
                Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
            )) {
                $referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
                if ($referer) {
                    // Rebuild referer URL to handle the case when SID was changed
                    $referer = $this->_getModel('core/url')
                        ->getRebuiltUrl( $this->_getHelper('core')->urlDecodeAndEscape($referer));
                    if ($this->_isUrlInternal($referer)) {
                        $session->setBeforeAuthUrl($referer);
                    }
                }
            } else if ($session->getAfterAuthUrl()) {
                $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
            }
        } else {
            $session->setBeforeAuthUrl( $this->_getHelper('customer')->getLoginUrl());
        }
    } else if ($session->getBeforeAuthUrl() ==  $this->_getHelper('customer')->getLogoutUrl()) {
        $session->setBeforeAuthUrl( $this->_getHelper('customer')->getDashboardUrl());
    } else {
        if (!$session->getAfterAuthUrl()) {
            $session->setAfterAuthUrl($session->getBeforeAuthUrl());
        }
        if ($session->isLoggedIn()) {
            $session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
        }
    }
    $this->_redirectUrl($session->getBeforeAuthUrl(true));
}

Please let me know how can i achieve this in best way.c

site url is medikabazaar.com


texts: Magento2: I want to apply SKU filter in product layered navigation

texts:
I want to add the additional filter on product list page on frontend and product list should be filter by some SKU as well.
I am able to filter using SKU but filter is not working properly.


texts: Template Styles not working for magento custom transactional email template

texts:
I have created a custom transactional email template and added event in my custom module to send email using this transactional template.
When I add Template Styles in template it is working on preview page but not working in emails.

Is there any setting in magento to enable this feature or any other method to apply custom css?


texts: Magento 2 - How to add custom block/template to transactional mail?

texts: In order confirmation email I want to add custom block/template (phtml file). How can I achieve it?


texts: Compilation insists folder isn't writable

texts:
I am attempting to compile Magento and am receiving the following error:

Directory "/home/www/sitename/includes" must be writeable
File "/home/www/sitename/includes/config.php" must be writeable

Thing is, I've made sure both the includes directory and config.php ARE writable. I've chown'd both to the apache user, chgrp'd both to the apache user's group, chmod 755'd them and even chmod 777'd them as a last ditch effort. ls -l shows the following:

drwxrwxrwx.  3 apache apache 4096 May 21 22:16 includes

Fully open to anyone and everyone as far as the OS is concerned, but still Magento tells me the directory isn't writable. Am I missing something obvious?


texts: Magento 2 - How to add Imprint and other links to copyright in footer

texts:
I want to add some new links in the copyright row of the Luma theme footer.

What's the best practice to do that and how can I do it?

I've the following ideas, but I don't know if there are other solutions.

Copy the copyright.phtml of the Luma theme to a custom theme and extend it with html.
Create a new template (phtml file) and paste it into the page via default.xml?

Thanks.

Marco


texts: Cannot use Magento\Payment\Gateway\ConfigInterface as ConfigInterface because the name is already in use in module-payment\Model\Method\Logger.php

texts:
Below error showing in php version 7.0.6 Installation time of magento version 2.2.4

Fatal error: Cannot use Magento\Payment\Gateway\ConfigInterface as ConfigInterface because the name is already in use in C:\xampp\htdocs\m224\vendor\magento\module-payment\Model\Method\Logger.php on line 8


texts: How do I create an events observer that only calls when the REST API dispatches events?

texts:
I just want to call an event observer when the event is dispatched via the REST API. Like if an order is placed from a mobile application, only then the sales_order_save_afterObserver should be called.

How do I write code for the same in events.xml? Or do we have to write somewhere else?


texts:
I want realise a cron job for import product in Magento. The code to insert the product into a php file saved in app/code/local/Test/Import/Model.

I saved config.xml in app/code/local/Test/Import/etc. I added module in app/etc/modules.

config.php contains following code:

<config>
     <modules>
        <Test_Import>
            <version>0.0.1</version>
        </Test_Import>
    </modules>

    <global>
        <models>
            <importcron>
                <class>Test_Import_Model</class>
            </importcron>
        </models>
    </global>
    <crontab>
        <jobs>
            <importcron>
                <schedule>
                    <cron_expr>*/1 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>importcron/observer::importProduct</model>
                </run>
            </importcron>
        </jobs>
    </crontab>
</config>

The folder app/code/local/Test/Import/controllers is empty.

I tried to run this cron job through url 127.0.0.1/magento/Import but the result is '404 PAGE NOT FOUND'.

In Magento panel control this module is not inserted in modules list in System/Configuration/Advanced.

Can you help me, please? Thank you very much!


texts: Magento 2 get product gallery images on product listpage without load model in loop

texts:
I can get gallery images on product-list page using below code:

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->create('Magento\Catalog\Model\Product')->load($_product->getId());
    $images = $product->getMediaGalleryImages();
    foreach($images as $child){ ?>
        <img src="<?php echo $child->getUrl(); ?>" >
<?php } ?>

I know load model in loop is bad practice and it effect to performance.Can anyone please suggest me best way to achieve same function.


texts: Applied Patches but still getting a vulnerable message?

texts:
I've applied the patches to both our dev site and our live site.

We're running on Enterprise Edition 1.12.0.X

so I've downloaded:

PATCH_SUPEE-5345_EE_1.12.0.2_V1-2015-02-10-04-17-49.sh
PATCH_SUPEE-1533_EE_1.12.x_v1-2014-10-03-04-00-32.sh.

I've also double checked to make sure that the patches were applied by going to app/etc and opened the applied.patches.list file in which it showed the patches are applied.

What has me concerned is that when I ran the test through the "Magento Shoplift Bug Tester" site, it states that my dev site is good but my live site is vulnerable???

The patches I've installed are identical and I didn't do anything different when it came to installing the patches to the live site.

I wanted to see if anyone else has or is experiencing this? Am I missing something??

Thanks!


texts: Magento 2.3 EE: How to allocate the Reward Points based on purchases?

texts:
I'm using Magento 2 Enterprise Edition. In this edition, the Reward points feature is available by default. I can use it with price rule as well as for registration, newsletter, etc.
But, I want to allocate the reward points based on the Customer's Purchase.
How can I do that?
Any help will be appreciated!


texts: Magento 2 : All Completed Orders With Customer and Product Details

texts:
I'm planning to execute particular SQL query against magento database and use that result in data-analyzing-tool which requires uploading data to be in following format.

I need to know what are tables I should look into in order to create a SQL query to get above result. I'm using Magento Community Edition, version 2.1.6 which is latest version. Thank you!


texts: Modified getLoadedProductCollection on product listing page shows wrong product count

texts:
I want to filter product collection based on custom attribute on product listing page.

So I have to override _getProductCollection function from \vendor\magento\module-catalog\Block\Product\ListProduct.php in my customm module.

Below is my code:

 protected function _getProductCollection()
 {
    if ($this->_productCollection === null) {
        $layer = $this->getLayer();

        /* @var $layer \Magento\Catalog\Model\Layer */
        if ($this->getShowRootCategory()) {
            $this->setCategoryId($this->_storeManager->getStore()->getRootCategoryId());
        }

        // if this is a product view page
        if ($this->_coreRegistry->registry('product')) {
            // get collection of categories this product is associated with
            $categories = $this->_coreRegistry->registry('product')
                ->getCategoryCollection()->setPage(1, 1)
                ->load();
            // if the product is associated with any category
            if ($categories->count()) {
                // show products from this category
                $this->setCategoryId(current($categories->getIterator()));
            }
        }

        $origCategory = null;
        if ($this->getCategoryId()) {
            try {
                $category = $this->categoryRepository->get($this->getCategoryId());
            } catch (NoSuchEntityException $e) {
                $category = null;
            }

            if ($category) {
                $origCategory = $layer->getCurrentCategory();
                $layer->setCurrentCategory($category);
            }
        }
        $this->_productCollection = $layer->getProductCollection()->addAttributeToFilter('my_attribute_name', array('neq' => NULL));

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

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

    return $this->_productCollection;
}

using this my filtered product shown in front side but it give wrong product count.

can any one help me?


texts: How to redirect my website as country wise in magento2

texts: Hello i have multiple store for my site,like us and uk when some one from US visit my site it will directly redirect to ex:  www.demo.com/us store same for uk how to do in magento2


texts: How to add custom fields to custom shipping method(at onepage checkout)?

texts:
I created previously custom payment methods.For that I added successfully extra fields using following code in my model logic.

protected $_formBlockType = 'newmodule/purchaseorder';
protected $_infoBlockType = 'newmodule/purchaseorderinfo';

But magento didn't provide any logic for creating forms in shipping module.
Please give me some direction to this?


texts: How to show a category's products in shopping cart

texts:
Magento version 2.3

I want to show a particular category in shopping cart page using programming, instead of using backend widget settings.

I have tried to modify the following files with no luck:

Magento_Checkout/layout/checkout_cart_index.xml

<block type="catalog/product_list" category_id="4" template="catalog/product/list.phtml" />

which returns error, it says that block cannot set type attribute

source

Magento_Checkout/templates/cart.phtml

if ($block->getItemsCount()) {
    echo $block->getChildHtml('with-items');
    $this->getLayout()->createBlock('catalog/product_list')
          ->setData('category_id','$YourCategoryId')
          ->setTemplate('catalog/product/list.phtml')->toHtml();
} else {
    echo $block->getChildHtml('no-items');
}

returns error code 500

source


texts:
I want to add a custom attribute to my customer. For now I have this : (on magento 2.2.4)

<?php
namespace My\Module\Setup;

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

class InstallData implements InstallDataInterface
{

private $customerSetupFactory;
private $attributeSetFactory;

public function __construct(\Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory, \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory)
{
    $this->customerSetupFactory = $customerSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;
    $installer->startSetup();

    /** @var CustomerSetup $customerSetup */
    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
    $customerSetup->removeAttribute(\Magento\Customer\Model\Customer::ENTITY, "customer_bonus");

    $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();
    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'customer_bonus', [
        'type' => 'varchar',
        'label' => 'Customer Bonus',
        'input' => 'text',
        'required' => false,
        'visible' => true,
        'user_defined' => true,
        'system' => false,
    ]);

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

    $attribute->save();

    $installer->endSetup();
}

}

But there's nothing on my backend, I want have something like this result : Magento 2 - How to add a custom column in customer grid

And CustomerSetupFactory is not find in PHP Storm. I tried

  php bin/magento setup:di:compile

but nothing change.

Edit : the class is found with setup:di:compile dans after if I do setup:upgrade it's not found anymore.


texts: magento 2 clear previous searched string of ui grid after admin logout

texts: When logging in and logout of magento when you go to search for a customer the previous info is still there - shouldn't this clear after log-out?


texts: Magento 2:How to show Gift Card History in Account Page?

texts:
In Magento 2 Commerce, we cannot see the customer's gift card history in Account page. We can only redeem and see the status of gift card by putting the gift card code.
How can I show the gift card history against customers?
Please guide


texts: Remove "We can't find products matching the selection" category with not products

texts:
How do you remove "We can't find products matching the selection" from categories with not products assigned?

I have set display settings to

Display Mode: Static Blocks Only
Anchor: Yes and also tried No with not results.

Reindexed and Cleared cache with no results

Magento Commerce 2.2.3
Multi Store Set up.


texts: 'invalid blocktype: HM_Deleteorder_Block_Adminhtml_Sales_Order_Grid' in /app/Mage.php:595

texts:
Because we've accidently delete a module, we cannot access the adminpage.

Fatal error: Call to a member function setSaveParametersInSession() on boolean in /var/www/html/webshop/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php on line 66

in the logfiles we can find:

exception 'Mage_Core_Exception' with message 'invalid blocktype: HM_Deleteorder_Block_Adminhtml_Sales_Order_Grid' in /var/www/html/webshop/app/Mage.php:595
Stack trace:
#0 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Ongeldig blokty...')
#1 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('adminhtml/sales...', Array)
#2 /var/www/html/webshop/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(66): Mage_Core_Model_Layout->createBlock('adminhtml/sales...', 'sales_order.gri...')
#3 /var/www/html/webshop/app/code/core/Mage/Core/Block/Abstract.php(293): Mage_Adminhtml_Block_Widget_Grid_Container->_prepareLayout()
#4 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout))
#5 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/sales...', 'sales_order.gri...')
#6 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/sales...', 'sales_order.gri...')
#7 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#8 /var/www/html/webshop/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#9 /var/www/html/webshop/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#10 /var/www/html/webshop/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#11 /var/www/html/webshop/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#12 /var/www/html/webshop/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(59): Mage_Adminhtml_Controller_Action->loadLayout()
#13 /var/www/html/webshop/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(94): Mage_Adminhtml_Sales_OrderController->_initAction()
#14 /var/www/html/webshop/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->indexAction()
#15 /var/www/html/webshop/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#16 /var/www/html/webshop/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /var/www/html/webshop/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 /var/www/html/webshop/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /var/www/html/webshop/index.php(87): Mage::run('', 'store')
#20 {main}

we've tried to delete all folder with HM_deleteorder, but all is gone. Still we receive this error.
Tried to reinstall, but cannot find the module in the marketplace.


texts: How to get Customer Login and Logout outside Magento

texts:
Hereby, I working to integrating Header/Footer section outside Magento using this sample code:

$mageFilename = 'app/Mage.php';
echo $mageFilename;
require_once $mageFilename;
#Mage::setIsDeveloperMode(true);
#ini_set('display_errors', 1);
umask(0);
Mage::app()->loadArea('frontend');

$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
echo $headBlock->toHtml() . $headerBlock->toHtml();..

reset of your code

When i get all header/footer content include site Logo and etc.But it doesn't get Login and Logout from that Header section. Here i Sample Headers

  and  sample Header for Magento Website

How to call Login And logout detail outside magento.Kindly advise me any other issues?


texts:
how do i upgrade from magento 1.9.4.0 to 1.9.4.1.

Do i just use the Magento Connect Manager? Do I need to back up my DB as well as exisiting install to be safe?


texts: How to Save custom data from admin->system->configuration magento 1.9

texts:
I am working in magento 1.9 . I have created a custom tab in admin -> configuration . There I created custom fields , I want to save the data from those custom fields on click "save config" button.
Here is my code from system.xml

 <section_two translate="label">
                Carrier
                <frontend_type>text</frontend_type>
                <sort_order>2</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <fields>
                    <carriers>
                        <frontend_model>LtlFreight/adminhtml_system_config_form_carriers</frontend_model>
                        <sort_order>9</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </carriers>
                </fields>
            </section_two>

This my code from .phtml

    <?php

    $counter = 1;
    $storeId  = Mage::app()->getStore()->getStoreId();
    $configValue = Mage::getStoreConfig('LtlFreight/section_two/carriers',$storeId);
    $output_data = array();
    $output_data= json_decode($configValue);

    foreach($output_data as $key=>$config_data){

        foreach($config_data as $k => $data){
            echo "
";
            echo "";
               echo  $counter;
            echo "	";
            echo "";
               echo $data->CarrierName;
            echo "	";
            echo "";
               echo 'CarrierLogoUrl.'"  height="50" width="70">';
            echo "	";
            echo "";
               echo '<input type="checkbox" name="" value="'.$data->CarrierSCAC.'"  class="cerasisQuoteServices" >' ;
            echo "	";
            echo "
";
            $counter++;
            }

        }?>

Here I want to save the values of checkboxes on click "save config" button .
Anybody please tell the procedure .


texts: magento contact us form add multiple email ids

texts:
magento contact us  form how to add multiple email id

please check this error


texts:
I am trying to use nested if statements in my email template, like the following:

{{if subscriber.promo_group}}

You are one of the first {{var subscriber.promo_group}} subscribers.

{{/if}}

{{if subscriber.coupon_code}}

Use code {{htmlescape var=$subscriber.coupon_code}} for {{htmlescape var=$subscriber.discount_amount}} off.

    {{if subscriber.partner_coupon_code}}

Or, code {{var subscriber.partner_coupon_code}} for {{htmlescape var=$subscriber.partner_discount_amount}} off at checkout.

    {{/if}}
{{else}}
    {{if subscriber.partner_coupon_code}}

Use code {{htmlescape var=$subscriber.partner_coupon_code}} for {{htmlescape var=$subscriber.partner_discount_amount}} off at checkout.

    {{/if}}
{{/if}}

When I get my email, though, I get it like this:

You are one of the first 20 subscribers.

Use code XXXXX-QTEALK15 for $35 off.

Or, code XXXXX10OFF for 10% off at checkout.

{{else}}
Use code XXXXX10OFF for 10% off at checkout.

{{/if}}

Is it possible to use nested if statements in the Magento email templates?


texts: I have Manadev ajax layered navigation extension and Aheadworks Ajax cart pro extension. They both work fine when Lesti FPC is disabled. But they seem to have some conflict when FPC is enabled. Ajax cart pro ajax loader is triggered when I select a filter from layered navigation. Any guidance on this?


texts: Which module is responsible for mobile menu in admin panel?

texts:
I need to check from which file the mobile menu comes in the admin panel.
I am searching it but not finding the particular file.

Please help if anyone knows about it .

Thanks,

Sarvagya


texts: Magento Custom Grid Left Join ID Conflict with Custom Table

texts:
I've got the following left join in my _prepareCollection(); method:

$collection->getSelect()->joinLeft(
        array('views_index' => "my_views_table"),
        'views_index.entity_id = main_table.entity_id',
        array('views'=>'count')
);

And then in my _prepareColumns() method I have:

$this->addColumn('views',
        array(
            'header'=> $this->__('Views'),
            'index' => 'views',
            'width' => '5%',
            'filter_index'  => 'views_index.count'
        )
);

When I load this page though, I get an error:

  Item (Namespace_Module_Model_Mymodel) with the same
  id "{ID}" already exist

How is this conflict occurring?

Some background: Magento Custom Grid Redirect Error (On Join Attributes ONLY)

Would appreciate any help

Edit 1 The my_views_table consists of 3 columns, namely:

id (primary key)
entity_id
count


texts: How to get the categories child category list per store in magento2 rest api

texts: I need to retrieve categories and child-category list per store. I have two store have store code grocery and fruit.


texts: Custom payment method with file upload without flash player install

texts: How to create a custom payment method with file upload without flash player install. I already make it works using uploadify but my problem is when I run it in browser with no flash player install, including android and IOS device the upload button not showing.. I googling but no solutions in the results.. Any one can help me on this?


texts: Hide a certain product for a specific customer group or IP

texts: I need to hide a certain product for everyone except not for a specific IP (or customer group). This can't be achieved by Magento default. But I was wondering what is the best approach here? Oberserver? Overwrite core collections? I did some research and found one extension. I'm not sure if there is a better way do to it. Any ideas are very welcome.


texts: HOW TO ADD ALTERNATIVE HTTP HEADERS TO MAGENTO 2

texts:
I wanna add custom header to the response.
l do like this article

but it does not work. I guest it about Magento version. I use Magento 2.3


texts:
Why can I not view my Magento site in any Responsiveness checker?
Can anyone tell me right answer


texts: Flat catalog tables considered a bad practice since M2.1.x and above?

texts:
Magento no longer recommends the use of a flat catalog as a best practice. Continued use of this feature is known to cause performance degradation and other indexing issues. A detailed description and solution is available in the Help Center.
Affected versions include:

Magento Commerce Cloud 2.1.x and above
Magento Commerce (On-Premise) 2.1.x and above
Magento Open Source 2.1.x and above

Source: https://docs.magento.com/m2/ce/user_guide/catalog/catalog-flat.html
Above link referes to another help page: https://support.magento.com/hc/en-us/articles/360034631192

Issue Flat indexers can cause:
Heavy SQL load and site performance issues. Long running and stuck
crons.

Why is this best practice for large catalogs reversed? Is the heavy SQL load and site performance issues new? Or is it a risk which always was present?
Are there any changes on this topic in the codebase since 2.1.x and above?


texts: Upgradeschema.php and UpgradeData.php scenarios

texts:
Points:
1.In my case i created a 'Customer Provident' product using upgradeData.php with version 1.0.3 and module version also 1.0.3 and
it's created successfully.
2.Second time i wrote the code to update the table column using Upgradeschema.php with version 1.0.5 and module version 1.0.5 worked
successfully.
3.Now i deleted the product 'Customer Provident' from magento backend and i want to create same product if we upgrade once.Is this possible
one this time i don't change module.xml version it's as it is 1.0.5 but this product not created

But this time i want to create the product

Is there any way to achieve it,if anyone have idea please guide
me.


texts: Magento 2 : Custom Category Attribute not Showing in Admin

texts:
I am using magento 2.1.3. I have created customer group as a custom attribute while creating category. On my localhost its showing textfield to enter customer group. But on server its not showing text field to enter customer group.

Customer group has been successfully created as an attribute in database in both enviroment i.e localhost and server. Dont know what I am doing wrong. Given full permission to folder also.Please refer the below 2 screens.

I have also clone server database and code in my local enviroment, there its working fine but on server its not.

.com/OgR7C.png


texts:
Magento has this great helper to resize product images but I'd like to resize any image from PHTML template files.

Now I could use the Varien_Image (lib/Varien/Image) class but it doesn't implement caching which is in my opinion required for resizing.

Is there an extension you can recommend for this or any other solution or should I build my own?


texts: Magento 2: edit the cart summary template

texts:
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

On the cart page, I have moved the cart totals below the cart products:

<move element="cart.summary" destination="checkout.cart.items" after="checkout.cart.form"/>

I had wrapped the cart products in a Bootstrap panel:

Now I need to end the panel after the cart totals and all the following elements. So I need to know: What is the .phtml file containing the code below?

<div class="cart-summary">
 // More code here
</div>

Or, alternatively, I just want to move the cart summary so that my page turns into:


texts: problem with import directories for files to be imported

texts:
I have a custom made importer, that uses AvS_FastSimpleImport. Anyway, importing the products and every other attribute is fine. The problem comes with importing the images. If I have the directory hierarchy like that:

project_name/media/import/(the .xml file of the product + the images files)

the images are being imported all fine.
But there's a new requirement the hierarchy to be done the following way:

project_name/media/Import/XML/(the .xml file of the product)
project_name/media/Import/Images/(the images files)

then the images are not being imported. All other configurations in config.xml files and in the back-end are set up correctly, according to the different hierarchy cases, so mis-setting of options is not the problem.

My suspicion is that there is some convention of directory hierarchy which therefore makes the importing not working if the hierarchy is some custom. Is that the case?

Additional info: in the second hierarchy case - there are no folders and files created in the /media/catalog/product where the pictures to be imported should be copied, as it should happen as follows project_name/media/catalog/product/X/Y/XYimagename.jpg


texts: How to migrate email templates only from M1 to Magento 2?

texts:
We have installed migration tool in Magento 2.3.1 EE (composer require Magento/data-migration-tool:2.3.1 ) would like to migrate M1 commerce edition (1.14.3.1) to Magento 2.3.1 EE.

We have migrated customers & orders & products data but we would like to migrate email templates can anyone guide me how to do it step by step?

Is it possible to migrate email templates using the data migration tool?

Thanks


texts:
I want to get the country code of my website user so that I can show and hide some blocks in my code. How may I do that? For example if someone is browsing our website from Australia I should get AU.

I think there must be some code in Magento to know the country's location. If this feature is not out of the box in Magento then what is the purpose of having allow specific countries in almost every configuration? And how does allow specific countries work?


texts: magento 2 How to show Simple product images instead of configurable product images?

texts:
In Default Magento, For configurable product in product detail page product media displays images of configurable product by default,but i want to show simple products images in product media instead of configurable images.

How can i do that?


texts: Magento Commands - Segmentation Fault (Core Dumped)

texts:
I receive the following error when running any of the magento commands in CL? Any ideas on how to resolve?

  Segmentation Fault (Core Dumped)

Thanks


texts: Flat Catalog Product - getSku do not work

texts:
If i activate Flat Catalog Product, than Magento do not view sku on Product and category page with this code:

<?php echo $this->htmlEscape($_product->getSku()); ?>


texts: Print Customer Attribute In Order, Invoice and PDF. Kindly Help me. In Magento 2.3

texts:
I have created a customer attribute process given below:

But I required to get the customer attribute Order, Invoice and PDF Reports like below


texts: How to get and print all possibilities product attributes?

texts: I am beginner in the Magento development and I would like to know what are the attributes of products available for use. Example: getName, getPrice, getSpecialPrice etc.


texts: Magento 2: How to show the custom option in another phtml file

texts:
How can we override this position in custom option to show it in another phtml file.

added this code in checkout_cart_index.xml which override only the form.phtml not override the default.phtml file.

  <?xml version="1.0"?>
  <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<!-- <update handle="checkout_cart_item_renderers"/> -->
<body>
    <referenceContainer name="content">
        <referenceBlock name="checkout.cart.form">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Bespoke_Bespoke::cart/form.phtml</argument>
            </action>
    </referenceBlock>
     <referenceBlock name="checkout.cart.item.renderers.override">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Bespoke_Bespoke::cart/item/default.phtml</argument>
    </action>
</referenceBlock>
    </referenceContainer>
</body>

i am getting error regarding the checkout.cart.item.renderers already has a child with alias 'simple' i have modify that file of checkout_cart_item_renderer.xml

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<!-- <update handle="checkout_item_price_renderers"/> -->
<body>
  <referenceBlock name="checkout.cart.form">
<action method="setOverriddenTemplates">
    <argument xsi:type="array">
        <!-- list override templates -->
        <item name="default" xsi:type="string">Bespoke_Bespoke::cart/item/default.phtml</item>
        <item name="simple" xsi:type="string">Bespoke_Bespoke::cart/item/default.phtml</item>
        <item name="virtual" xsi:type="string">Bespoke_Bespoke::cart/item/default.phtml</item>
    </argument>
  </action>
  </referenceBlock>
</body>
</page>

to override the file we useed etc/di.xml

 <config  xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Checkout\Block\Cart\AbstractCart" type="AGS\Bespoke\Block\Checkout\Cart\AbstractCart"/><preference for="Magento\Catalog\Block\Product\View\Option" type="AGS\Bespoke\Block\Product\View\Option"/>
   <preference for=" Magento\Checkout\Block\Cart" type="AGS\Bespoke\Block\Checkout\Cart"/>
   <preference for="\Magento\Checkout\Block\Cart\Item\Renderer" type="AGS\Bespoke\Block\Checkout\Cart\Item\Renderer"/>
   <virtualType name="AGS\Bespoke\Model\ResourceModel\Bespoke\Bespoke\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
  <arguments><argument name="mainTable" xsi:type="string">ags_bespoke</argument><argument name="resourceModel" xsi:type="string">AGS\Bespoke\Model\ResourceModel\Bespoke</argument>

  </arguments></virtualType><type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
<arguments><argument name="collections" xsi:type="array">
<item name="bespoke_record_bespoke_list_data_source" xsi:type="string">AGS\Bespoke\Model\ResourceModel\Bespoke\Bespoke\Collection</item>


texts: Difference between "Allowed Countries" and "European Union Countries"

texts:
What is the difference between "Allowed Countries" and "European Union Countries"?

In Magento 2:

Admin -> Stores -> Settings -> Configuration > General -> General

In Magento 1:

Admin -> System -> Configuration -> General -> General

From docs.magento.com official website,this is the explanation:

  On the General page, click to expand the Countries Options section.
  Then, do the following:

  a.    Set Default Country to the country where
  your business is located.

  b.    In the Allow Countries list, select each
  country from which you accept orders. By default, all countries in the
  list are selected. To select multiple countries, hold down the Ctrl
  (PC) or Command (Mac) key.

  c.    In the Postal Code is Optional list,
  select each country where you conduct business that does not require a
  ZIP or postal code to be included as part of the street address.

  d.    In
  the European Union Countries list, select each country in the EU where
  you conduct business. By default, all EU countries are selected.

But I still don't fully understand the purpose of the "European Union Countries" list. The same result can be achieved by using the "Allowed Countries" list?

What is the purpose of the "European Union Countries" list?

EDIT:

In addition there is a field with "Top Destinations", can anyone explain what is that for and how it is used?

References:
https://docs.magento.com/m1/ce/user_guide/configuration/countries-options.html


texts: load multiple products with sort order of array of ids given

texts:
I have loaded multiple products in magento with ids.following is my query

$productIds = array(1,5,3,10,6);
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('entity_id', array('in' => $productIds));

now my products are loaded in the sorting order of the product ids which i have in the $productIds. ie product with id 1,3,5,6,10.

but i want products to be loaded in the order of ids present in the $productIds array. ie product with id 1,5,3,10,6


texts: How to get product_id or product_sku (from simple product associated with configurable product ) after the product was added on cart

texts:
Magento 1.7.
I have one configurable product and associated products, also I have some dropdown boxes. After choosing the option from my product, I added it to the cart. I want to now get the product_id or product_sku for the simple product; for configurable products working.

        <checkout_cart_product_add_after>
            <observers>
                <cart_init>
                    <type>singleton</type>
                    <class>ExtraCart_Cart_Model_Observer</class>
                    <method>getProductIdSku</method>
                </cart_init>
            </observers>
        </checkout_cart_product_add_after>

php code :

 public function getProductIdSku(Varien_Event_Observer $observer){
    $product = $observer->getEvent()->getQuoteItem();
    $productSku = $product->getSku();  //for configurable product
    $productQty = $product->getQty();  //for configurable product

    $order = $observer->getEvent();
    $data = $order->getData('sku');  //fr simple product is not working
    $quote = Mage::getSingleton('checkout/session')->getQuote();  //for configurable product

    $sales_quote = Mage::getModel('sales/quote_item_option');...->getId(); getSku();
}


texts: How to integrate magento REST API with third party?

texts:
I was just trying to finding information about REST API. There are some examples at magento resource and some private blogs. All are same!!

As basic info I found if I want to update products through REST API I need to use admin authorization endpoint. (/admin/oauth_authorize) and if I use customer or guest I can just retrieve data.

I tried to create sample code and check and I found when I run code through browser I need to first login admin and then I need to accept access and then I can use API resource.

I don't know why it is asking me to login in admin first. And if I must need to login to access it then how it would work internally between server.

I tried to create sample code using below blog

http://inchoo.net/ecommerce/magento/consuming-magento-rest-zend_oauth_consumer/comment-page-1/#comment-66775

and it is working fine and giving response also.

Actually I am looking for how it will work internally between two servers and how client will call REST API to magento how it would be authenticate and how magento would return response.

Looking for advice.


texts: Magento 2.0.2 Product image upload error

texts:
I got an error like

error":"Unable to create directory
'/var/www/html/pub/media/tmp/catalog/product'.","errorcode" :0

While upload product images. I put 777 permission /var/www/html/pub/media folder. but i got the error. kindly help me.


texts: catalog price rules prices in web api for mobile apps

texts:
We have created a catalog price rule for a group of customers. The discounted prices are showing fine on website for these customers.

However, these discounted prices are not showing up when we search products or get category listings via Magento's default api calls.

How can we get these prices? Do we need to customize?

Thanks


texts:
Fatal error: Call to a member function getAttributeText() on string
  in/opt/lampp/htdocs/magento2_new/Sourcecode/app/design/frontend/Emthemes/em0150jewelry/jewelry/Magento_Catalog/templates/product/list.phtml
  on line 539.

This error occured by using a function
           $optionText=$_product->getId()->getAttributeText('Farben');

How can I resolve this in magento 2?


texts: Magento 2 : Getting error like "Only default scope allowed" when click to the theme option at the backend

texts:
Getting error like below :

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Only default scope allowed

Exception #0 (Magento\Framework\Exception\LocalizedException): Only default scope allowed
#0 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Framework/App/Config/ScopePool.php(86): Codazon\ThemeOptions\Model\Config\Reader\DefaultReader->read(0)
#1 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Model/Config/Loader.php(94): Codazon\ThemeOptions\Framework\App\Config\ScopePool->getScope('default', 0)
#2 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Model/Config.php(450): Codazon\ThemeOptions\Model\Config\Loader->getConfigByPathForLoadForm('general_section', 'default', 0, '6', false)
#3 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Model/Config.php(331): Codazon\ThemeOptions\Model\Config->_getConfigForLoadForm(false)
#4 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Block/Adminhtml/Config/Form.php(158): Codazon\ThemeOptions\Model\Config->load()
#5 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Block/Adminhtml/Config/Form.php(171): Codazon\ThemeOptions\Block\Adminhtml\Config\Form->_initObjects()
#6 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/Block/Adminhtml/Config/Form.php(475): Codazon\ThemeOptions\Block\Adminhtml\Config\Form->initForm()
#7 /home/krishsdn/public_html/rabitgo/vendor/magento/framework/View/Element/AbstractBlock.php(666): Codazon\ThemeOptions\Block\Adminhtml\Config\Form->_beforeToHtml()
#8 /home/krishsdn/public_html/rabitgo/vendor/magento/framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()
#9 /home/krishsdn/public_html/rabitgo/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('adminhtml\\confi...')
#10 /home/krishsdn/public_html/rabitgo/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('adminhtml\\confi...')
#11 /home/krishsdn/public_html/rabitgo/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('adminhtml\\confi...')
#12 /home/krishsdn/public_html/rabitgo/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('adminhtml\\confi...', true)
#13 /home/krishsdn/public_html/rabitgo/vendor/magento/framework/View/Element/AbstractBlock.php(507): Magento\Framework\View\Layout\Interceptor->renderElement('adminhtml\\confi...', true)
#14 /home/krishsdn/public_html/rabitgo/app/code/Codazon/ThemeOptions/view/adminhtml/templates/system/config/edit.phtml(22): Magento\Framework\View\Element\AbstractBlock->getChildHtml('form')

If anyone aware about this error please suggest me to solve this.

Thank you in advance.


texts: slow INSERT query in sales_flat_order_grid

texts:
We see in newrelic some peaks if orders are inserted into sales_flat_order_grid. I tried to figure out why, but couldn't find the reason. This peaks appear ~ 1 of 100 orders.

First of all I thought about a database lock, but I couldn't find any hints in the logs.
My second thought was that the database has a high load, but the CPU utilization, connections and write/read latencies are pretty low.

Maybe someone had the same problem and found a solution.

The query looks like this:

INSERT INTO `sales_flat_order_grid` (`entity_id`, `status`, `store_id`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `store_name`, `created_at`, `updated_at`, `billing_name`, `shipping_name`)
SELECT
    `main_table`.`entity_id`,
    `main_table`.`status`,
    `main_table`.`store_id`,
    `main_table`.`customer_id`,
    `main_table`.`base_grand_total`,
    `main_table`.`base_total_paid`,
    `main_table`.`grand_total`,
    `main_table`.`total_paid`,
    `main_table`.`increment_id`,
    `main_table`.`base_currency_code`,
    `main_table`.`order_currency_code`,
    `main_table`.`store_name`,
    `main_table`.`created_at`,
    `main_table`.`updated_at`,
    CONCAT(IFNULL(table_billing_name.firstname, ?), ?, IFNULL(table_billing_name.middlename, ?), ?, IFNULL(table_billing_name.lastname, ?)) AS `billing_name`,
    CONCAT(IFNULL(table_shipping_name.firstname, ?), ?, IFNULL(table_shipping_name.middlename, ?), ?, IFNULL(table_shipping_name.lastname, ?)) AS `shipping_name`
FROM `sales_flat_order` AS `main_table`
 LEFT JOIN `sales_flat_order_payment` AS `table_payment_method` ON `main_table`.`entity_id`=`table_payment_method`.`parent_id`
 LEFT JOIN `sales_flat_order_address` AS `table_billing_name` ON `main_table`.`billing_address_id`=`table_billing_name`.`entity_id`
 LEFT JOIN `sales_flat_order_address` AS `table_shipping_name` ON `main_table`.`shipping_address_id`=`table_shipping_name`.`entity_id`
WHERE (main_table.entity_id IN(?)) ON DUPLICATE KEY UPDATE `entity_id` = VALUES(`entity_id`),
    `status` = VALUES(`status`),
    `store_id` = VALUES(`store_id`),
    `customer_id` = VALUES(`customer_id`),
    `base_grand_total` = VALUES(`base_grand_total`),
    `base_total_paid` = VALUES(`base_total_paid`),
    `grand_total` = VALUES(`grand_total`),
    `total_paid` = VALUES(`total_paid`),
    `increment_id` = VALUES(`increment_id`),
    `base_currency_code` = VALUES(`base_currency_code`),
    `order_currency_code` = VALUES(`order_currency_code`),
    `store_name` = VALUES(`store_name`),
    `created_at` = VALUES(`created_at`),
    `updated_at` = VALUES(`updated_at`),
    `billing_name` = VALUES(`billing_name`),
    `shipping_name` = VALUES(`shipping_name`)

PHP Version: 5.6
Mysql: 5.6.27


texts: Automatic email notification when a product is back in stock

texts:
I have activated the option "Sign up to get notified when this product is back in stock"

Magento 1.9.1 give the possibility to subscibe to a product that is out of stock to let be informed by email when the product is available again.

But Magento don't send email, i think it depends on cronjob.

I also tried with this extions to manage cronjob http://www.magentocommerce.com/magento-connect/aoe-scheduler.html but nothing happens

Can you suggest me how to solve?


texts: Missing pub folder path from static content in magento 2

texts: I deploy my site on centos7 and deploy content as well which is in pub folder.But when i inspect element it shows path like in screenshot attatch without pub folder name.Some files are missing as well from path.Any solution


texts: How to import product excel data list into magento database

texts:
My client has more than 1000 products data having title, price, description, image etc.

We want to import all product list into magento system. We have searched many portal but they are using complex steps.

Can we import it in simple steps. We don't want to enter it one by one. It will consume more hours.


texts: Cannot enable caching with Docker local environment

texts:
I am getting this error

In Serialize.php line 33:

  Unable to unserialize value.

However, I do not believe this is the same issue as mentioned in this thread.

I am using Docker for M2 local dev setup. Repo is fully updated, composer dependencies updated. I can run through setup:upgrade and setup:di:compile.

With caching enabled, I manually flush redis, as metioned in other thread redis-cli flushall. Then I run bin/magento. Presumably the cache is built in redis... Then again I run bin/magento, expecting to see faster performance, however the error is there.

Turns out the unserialze method in /vendor/magento/framework/Serialize/Serializer/Serialize.php is being passed the empty string.

public function unserialize($string)
{
    if (false === $string || null === $string || '' === $string) {
        throw new \InvalidArgumentException('Unable to unserialize value.');
    }
    // ...
}

If I add an early return inside that if block, like return null, the error becomes The search failed because of a search engine misconfiguration., so perhaps search engine config has not made it into redis on first call of bin/magento?

Any ideas what is wrong, or how to address?


texts: X-XSS-Protection header gets set twice - override XssProtection.php

texts:
I use magento 2 (version 2.3) and cloudFlare.

There is an error with  http headers:  X-XSS-Protection header gets set twice because magento add this and then ClouFlare add again.
See this post

It's not possible to remove CloudFlare headers, so I would like to remove magento XSS header.

I found the solution editing /vendor/magento/framework/App/Response/HeaderProvider/XssProtection.php:
I change

const HEADER_ENABLED = '1; mode=block';

to

const HEADER_ENABLED = '0';

But I don't want editing the core file. I would like to override it.
Can you explain me how, please?
Thanks


texts: Magento 2 add new attribute using addAttribute()

texts:
I am currently trying to programatically add a new attribute from the module I have created, but so far without success. I am using the below:

<?php

namespace COMPANY\MODULENAME\Setup;

use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements UpgradeDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if ($context->getVersion() && version_compare($context->getVersion(), '1.0.1') < 0) {

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

            $eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'chat_lat',
                [
                    'type' => 'text',
                    'label' => 'Chart latitude',
                    'input' => 'text',
                    'required' => false,
                    'sort_order' => 1,
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                    'wysiwyg_enabled' => false,
                    'group' => 'Product Details',
                ]
            );

            $eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'chat_lng',
                [
                    'type' => 'text',
                    'label' => 'Chart longitude',
                    'input' => 'text',
                    'required' => false,
                    'sort_order' => 1,
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                    'wysiwyg_enabled' => false,
                    'is_html_allowed_on_front' => false,
                    'group' => 'Product Details',
                ]
            );

        }

        $setup->endSetup();
    }
}

Obviously I have the correct company and module name specified in the namespace - this is just to protect the client. I have also run magento setup:upgrade, which seems to run fine.


texts: Knockout observable is not accessible inside function

texts:
So I am working with Knockout inside Magento 2.3.4, and I am setting a custom observable value on initialize, and then I am trying to access that observable and change the value inside a function. Every time I try, I keep getting "it is not a function", and it won't let me either retrieve and read the current observable value, or set a new one. When I try to run .isObservable() on it it comes up as false. I have looked through various examples of how to do it and tried all of them and none of them work. Currently my knockout JS form looks like this:
define([
'jquery',
'uiComponent',
'ko'
], function($, Component, ko) {
'use strict';

return Component.extend({
   defaults: {
       template: 'Shmoop_Cms/career-form'
   },
    progressText: ko.observable(false),

    initialize: function() {
       var self = this;

       this._super();

           this.progressText('1 of 15 questions completed');

        return this;
    },

    showNext: function() {
       let dataIndex = parseInt($('.quiz-card.show').attr('data-index')) + 1;
       alert(ko.isObservable(this.progressText));
       alert(this.progressText());

       this.progressText(dataIndex + ' of 15 questions completed');
    }

});

});

I am able to set the progressText value initially inside that initialize function without issue, and it recognizes there that it is an observable. Why does it say it's not an observable inside by "showNext" function?
FYI I have also tried adding "var self = this" inside my function, I have also tried "self.progressText()" instead of "this.progressText()", nothing worked.
Edited to add: I am calling this variable observable in the template and displaying it there, like this:

This correctly displays the text value that I assign in the initialize function, but never updates after the showNext function is called.
Please help.


texts: How to deal with a category which has over 100K products?

texts:
Our site (CE version 2.3.4) is extremely slow on the backend and frontend for a particular category which has over 100K items. What is the best way to split this up so that we can see performance improvements?
Right now when a customer clicks this category all the products in it are shown, 36 per page. We're currently doing all we can for ths smaller performance-enhancing tips a typical Magento 2 store owner would want to add.
Ideally we would like to split the large category up into 10 sub categories with 10k each but would this be possible? Wouldn't the parent category still have 100k products? I'm sure someone here has faced a similar issue?


texts:
When place order its redirects to the shopping cart page in Magento 2
I used an OrderAttributes extension to my store its not working properly, Can’t make an order when the Order attribute extension is installed.
Steps:

Open Admin Panel and verify that the extension is installed
Navigate to Order Attributes and verify that no new attributes were created
Go to Storefront and add a product to your cart
Fill out all the required fields and try to make an order

Actual Result: Can’t make an order when Order attribute extension is installed
Expected Result: Order Attribute extension should not influence the default behavior. Please, see attached file
Error was in the place-order-mixin.js file but I can't fix an issue someone please help me to resolve this issue
I used this module: https://github.com/sd2894/Ecomteck


texts: Remove trailing and first space from sku

texts: I have Magento 2.2.2. Some SKU products contain a trailing space. How to using data patch or MySQL database query which will remove all leading and trailing spaces from SKU products.


texts: How to display previous page after validation (logging in)?

texts:
In my store I create PDF file for each order, that can only be accessed by customer. To validate if user can access order I first check if order was created by:

guest (then \Magento\Sales\Helper\Guest $guestAuthorizationand$guestAuthorization->loadValidOrder($request). False returns resultRedirect Object)
registered user (then \Magento\Sales\Controller\AbstractController\OrderViewAuthorization $loggedAuthorizationand$loggedAuthorization->canView($order). False returns FALSE and I create resultRedirect Object $resultRedirect = $this->_resultRedirectFactory->create();$resultRedirect->setUrl('/customer/account/login');

The problem is once user verifies either by logging in or guest order form I want to redirect him to previous URL (the PDF file). What is the easiest way to achieve this?


texts: Converting Magento .sh patch file to a list of patched files

texts:
What's the easiest way to convert .sh file that lists Magento patch changes to a list of modified files, that can be uploaded via FTP?

I tried to use SSH to apply a patch but for some reason not all files are changed - despite the fact that they appear on a list of changed files. Then I've found ready file packages here but the one for the version 1.9.0.1 seems to contain changes that are not in the .sh file(the package for 1.7.0.2 was fine though).


texts: URL rewrite having query string via htaccess in magento 2

texts:
I have current URL like this:
http://localhost/projectname/industries/index/index/industry/aircraft

(Here industries is the frontend route, index is controller and second index is action
industry is query param name, and aircraft is param value)
I want after rewrite the url will be :
http://localhost/projectname/industries/industry/aircraft

Or
http://localhost/projectname/industries/aircraft


texts:
When managing multiple adminhtml tabs in a browser, idling for too long will result in being logged out. Consider a scenario where you have two tabs open, conveniently labeled tab 1 and tab 2, both currently active in the Magento backend.

After about 10 minutes of idling or so, you return to tab 1 and navigate using the menu. When the page reloads, you have been logged out for being inactive for too long, and you once again log in.

If you switch over to tab 2 now, and try navigate anywhere, instead of being logged out (because you have a new session) you are simply redirected to the dashboard.

Is there any way to prevent the dashboard redirection & continue regular navigation?

In other words, Magento knows that you're using the same browser (otherwise it would have logged you out) but it doesn't quite know how to handle your two different sessions, so it throws you to the dashboard and puts you on the now currently active session.


texts: How to send an email to customers who is having an item in their wishlist

texts: Is there a way to send a reminder email to customers who has added items to their wishlist and forgot.


texts: Magento 2, add color style in Status column in sale order

texts: Using Magento 2.2, Admin Grid. I want to add style to Status column in sale order. How to do this?


texts: Magento 2 : How to Add address attribute in billing address form and convert that value in order address

texts:
I want to create address attribute and convert that attribute to order address.

I want to add address attribute in billing and shipping address of customer.
Also want to display this attribute everywhere like in customer address (add/edit).
Also want to save this value in quote and convert to order address address (billing/shipping).
Show this attribute in shipping / billing form on checkout.

How we can achieve this all functionality ?


texts:
I have created cart with following conditions

I have added one configurable product under category 3. But its not working .. If anything add to configure?


texts: Transferring magento website to sub domain gives 404 error but works fine on main domain

texts:
I have a magento (1.9.2.1) setup on a main domain ( www.mysite.com ) and now I want to transfer it from main domain to subdoamin like (sub.mysite.com).
Changed app/etc/local.xml file details
Cleared cache and session from var folder but no use except the home page nothing is working, gives 404 errors.
I'm using Godaddy Linux Hosting for it and check -
my .htaccess file for sub domain

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^sub.mysite.com$ [NC]
RewriteCond %{HTTP_HOST} !^mysite.com$ [NC]
RewriteRule ^(.*)$ mysite.com/$1 [R=301,L]

RewriteRule ^([0-9]+)/?$ mysite.com

</IfModule>

I'm new to magento I've no knowledge about working with htaccess help me to get it done..


texts: Magento2: Success/Failure messages not auto hiding

texts:
I'm using magento 2.1.1 on php 7 and facing issue that success/failure messages not auto hiding. They always showing on each page at the top.
Any help would be appreciated. Thanks!


texts:
we are trying to send Abandoned cart email , we are getting errors as below :

Fatal error: Call to a member function getAllVisibleItems() on a non-object in
line

<?php foreach($this->getOrder()->getAllVisibleItems() as $item): ?>
<a href="<?php echo $item->getProduct()->getProductUrl() ?>"><?php echo $item->getName() ?>
<?php endforeach ?>

I was working before one month, is any other code conflicting ? no log errors.

please give me some idea how i can solve this....

edit

protected function _getBaseProducts($parent)
    {
        $result = array();

        if ($parent->getOrder()) {
            foreach ($parent->getOrder()->getAllVisibleItems() as $item) {
                $result[] = $item->getProduct();
            }
        }

        if ($parent->getQuote() && count($result) == 0) {
            foreach ($parent->getQuote()->getAllVisibleItems() as $item) {
                $result[] = $item->getProduct();
            }
        }

        if ($parent->getCustomer() && count($result) == 0) {
            $orders = Mage::getModel('sales/order')
                ->getCollection()
                ->addAttributeToFilter('customer_id', $parent->getCustomer()->getId());
            foreach ($orders as $order) {
                foreach ($order->getAllVisibleItems() as $item) {
                    $result[] = $item->getProduct();
                }
            }
        }

        return $result;
    }

block

class Mirasvit_Email_Block_Cross extends Mage_Catalog_Block_Product_List
{
    public function _toHtml()
    {
        $this->setArea('frontend');
        $this->setTemplate('mst_email/cross.phtml');

        return $this->renderView();
    }

    public function getItems()
    {
        return $this->_productCollection;
    }
}


texts:
We are actually upgrade our version magento (1.7 to 1.9) but we have an issue when we try to use this function :

->addFieldToFilter('CHAR_LENGTH(review)', array('gteq' => 20))

This work in magento 1.7 but doesn't in 1.9.
Do you have solution ?
Here the complet request :

$collection = $content_database->getCollection()
        ->addFieldToSelect(array('firstname', 'lastname', 'review_date', 'review', 'rate'))
        ->addFieldToFilter('rate', array('gteq' => $this->_rating))
        ->addFieldToFilter('CHAR_LENGTH(review)', array('gteq' => 20))
        ->addFieldToFilter('store_id', Mage::app()->getStore()->getStoreId())
        ->setOrder("review_date", "desc")
        ->setPageSize($size);

    return $collection;

Here is the error message :

'CHAR_LENGTH(review)' in 'where clause', query was: SELECT COUNT(*) FROM upecom_reviews AS main_table WHERE (rate >= 4) AND (CHAR_LENGTH(review) >= 20) AND (store_id = '1')'

Thank you !


texts: Difference between Mage::getSingleton('core/layout') and $this->getLayout()

texts:
I've been reading some tutorials and some use:

$this->getLayout()

To get the current layout, while others use:

Mage::getSingleton('core/layout');

I was wondering if there's any difference between the two approaches.

The calls are being run from a controller class that extends Mage_Core_Controller_Front_Action.

Thanks


texts:
For the past couple of days I have been attempting to access the $payment object in my new_order email. My objective is to display the credit card type along with the last four digits of card used to purchase the item. I know that once the payment object has been obtained/set to a variable, it comes with a method getCcType(). I have attempted to obtain this through multiple variations, but for whatever reason I cannot access it.

My question would be what file would I need to go to in order to set the payment variable so that it can be accessed within the new order email? The same way I can access and use order, {{var order.created_at | date: "%b %d, %y"}} and {{var order.getIncrementId()}}.

I found teh OrderSender.php file and believe this is the file where my variables are getting set.. such as: order, payment_html, formattedShippingAddress so that they can be used: {{var formattedBillingAddress|raw}} and {{var payment_html|raw}}.

Any help or enlightenment on how I can approach this will be greatly appreciated. I am brand new to magento and php so it feels a little foreign.


texts: Distinct value not show in the below query

texts:
I want to display value based on distinct month but it will not show the distinct month it show the repeat month.

"select DISTINCT {fn MONTHNAME(entrydate)} AS monthname, emirate_name, location, price, bedroom from itf_property where emirate_name='Dubai' and location='Dubai Marina' and bedroom='1' order by id";

It show the result like attached images


texts:
I am canceling credit memo using below code:

foreach ($collection as $creditmemo) {
    if($creditmemo->getState() != 3){
            $order = $creditmemo->getOrder();
            $creditmemo->setState(\Magento\Sales\Model\Order\Creditmemo::STATE_CANCELED);
            foreach ($creditmemo->getAllItems() as $item) {
                $item->cancel();
                $item->save();
            }
            $creditmemo->save();
    }
}

The above code gives the following error:

  We found an invalid quantity to refund item

The cancel() method checks the quantity available for a given item using isQtyAvailable() method which is returning 0.

I also tried the following solution:

foreach ($creditmemo->getAllItems() as $item) {
    // $getQtyReturned = $item->getOrderItem()->getQtyRefunded();
    // $creditmemoQty = $item->getQty();
    // $item->getOrderItem()->setQtyRefunded($getQtyReturned - $creditmemoQty);
    $qty = $item->getQty();
    $item->getOrderItem()->setQtyRefunded($item->getOrderItem()->getQtyRefunded() - $qty);
    $item->getOrderItem()->setTaxRefunded(
        $item->getOrderItem()->getTaxRefunded() -
        $item->getOrderItem()->getBaseTaxAmount() *
        $qty /
        $item->getOrderItem()->getQtyOrdered()
    );
    $item->getOrderItem()->setDiscountTaxCompensationRefunded(
        $item->getOrderItem()->getDiscountTaxCompensationRefunded() -
        $item->getOrderItem()->getDiscountTaxCompensationAmount() *
        $qty /
        $item->getOrderItem()->getQtyOrdered()
    );
    $item->save();
}

The above solution works, but during the creation of a credit memo for the same order again, it gives the subtotal of credit memo as 0.


texts:
I'm currently implementing a multilanguage store in magento enterprise using german and french store views. one of the requirements is that paths are translated. as an example, I'm trying to link the cms page for the ToS in the layout's footer:

defined cms pages:

"AGB" (german, url key: 'page-info-tos', store view 'de')
"CGV" (french, url key: 'page-info-tos', store view 'fr')

defined redirects:

"agb" → "page-info-tos"; store view 'de'; no redirect
"cgv" → "page-info-tos"; store view 'fr'; no redirect
"cgv" → "agb"; store view 'de'; 301-redirect
"agb" → "cgv"; store view 'fr'; 301-redirect

code in footer.phtml:

<a href="<?php echo $this->getUrl('page-info-tos');"><?php echo $this->__('ToS'); ?>

resulting html:

AGB resp CGV

wanted html:

AGB resp CGV

how can I lookup the correct request path for the given cms page url key?


texts: How to change label Firstname into Customer Firstname only on checkout/payment page in magento2.1.7?

texts:
How to change label :
 Firstname to Customer Firstname

only on checkout/payment page for payment method ( ex:paypal, debit/credit card,cash on delivery) in magento2.1.7 ?


texts: Magento 2.3 - Database Backup not working

texts:
I want to backup my database on a daily basis.
i did following setup in my magento admin panel.
https://prnt.sc/odgzhv
But no backups are generated in magento/var/backups folder.
Is there any thing else need to be done?
I monitored for 2 days but no backups are generated.

Any help would be appreciated.

Thanks in advance..!


texts: How to Merge guest quote items to customer quote(if customer log in) by magento 2 rest API

texts:
If any one is add products in cart by guest and after that login then how it will merge guest cart to customer login cart items by Rest API.
if anyone found this solutions, please help me.


texts: What's the difference between _create() and _multiCreate() in the REST API methods?

texts:
I am trying to extend the Magento's REST to have my own set of API.

I looked through the code and figured that there are _create(), _multiCreate(), update(), etc...

What's the difference between these methods in the V1.php file?

_create() and _multiCreate()
_update() and _multiUpdate()
_delete() and _multiDelete()

How can I know when I should use which of the 2 functions, the regular or the mutli one?

I couldn't find much documentation on the different methods used to create REST API in Magento.


texts: PHTML receives no response from the Ajax Controller

texts:
In order to be able to load the product list according to the customers' selection, I tried to use an Ajax query. However, I have the problem that I do not receive the response from my controller. The query works, but I only get the current page as HTML code. Maybe one more important information: Via CMS I call the block as follows: {{block class="VenSum\ModSum\Block\Index" template="VenSum_ModSum::index.phtml"}}

index.phtml:

<script>
    require(['jquery', 'jquery/ui'],function($) {
        $(document).ready(function () {
            var categoryid = 3;
            $.ajax({
                url: myurl,
                type: "POST",
                data: {data: "hi"},
                //dataType: 'json', <- does not work with it
                success: function (msg) {
                    console.log("Works: ");
                    console.log(msg);
                },
                error : function(jqXHR, textStatus, errorThrown)
                {
                    console.log("Error Status: " + jqXHR.status + " ------- " + textStatus + "---------- " + errorThrown);
                }
            }).done(function (msg){
                console.log("Done: ");
                console.log(msg);
            }).fail(function (response){
                console.log("Fail: ");
                console.log(response);
            });
        });
    });
</script>

controller:

<?php

namespace VenSum\ModSum\Controller\Index;

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

class Index extends Action
{
    protected $resultJsonFactory;
    public function __construct(
        Context $context,
        \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
    ) {
        $this->resultJsonFactory = $resultJsonFactory;
        parent::__construct($context);
    }

    public function execute()
    {

        $result = $this->resultJsonFactory->create();
        if ($this->getRequest()->isAjax())
        {
            $test=Array
            (
                'Firstname' => 'What is your firstname',
                'Email' => 'What is your emailId',
                'Lastname' => 'What is your lastname',
                'Country' => 'Your Country'
            );
            return $result->setData($test);
        }
    }
}

I hope you have an idea...


texts: cannot add new field to sales flat table in magento CE 1.9.0.1

texts:
I  wrote module which will  create a new varchar field in sales_flat_order.
For this  we create seutp set but it not working ,where the issue:
app/code/local/Bh/Affiliate/etc/config.xml

<?xml version="1.0" ?>
<config>
    <modules>
        <Bh_Affiliate>
            <version>1.0.0</version>
        </Bh_Affiliate>
    </modules>
    <global>
        <models>
        <affiliate>
            <class>Bh_Affiliate_Model</class>
            <resourceModel>affiliate_resource</resourceModel>
            </affiliate>
             <affiliate_resource>
                <class>Bh_Affiliate_Model_Resource</class>
                </affiliate_resource>
        </models>
            <resources>
             <affiliate_setup>
                  <setup>
                   <module>Bh_Affiliate</module>
                   <class>Mage_Sales_Model_Entity_Setup </class>
                 </setup>
            </affiliate_setup>
            </resources>
    <fieldsets>
          <sales_convert_quote>
                <affiliate_details><to_order>*</to_order></affiliate_details>
            </sales_convert_quote>

            <sales_convert_order>
                <affiliate_details><to_quote>*</to_quote></affiliate_details>
            </sales_convert_order>
        </fieldsets>

    </global>
    <frontend>
        <routers>
            <affiliate>
                <use>standard</use>
                <args>
                    <module>Bh_Affiliate</module>
                    <frontName>affiliate</frontName>
                </args>
            </affiliate>
        </routers>
    </frontend>
</config>

app/code/local/Bh/Affiliate/sql/affiliate_setup/install-1.0.0.php

<?php

$installer = $this;
$installer->startSetup();
$options = array(
    'type'     => Varien_Db_Ddl_Table::TYPE_VARCHAR,
    'visible'  => false,
    'required' => false
);
$installer->addAttribute('order', 'affiliate_details', $options);

$installer->endSetup();
/*
$installer = $this;
$installer->startSetup();
$installer->addAttribute(
    'order',
    'affiliate_details',
    array(
        'type' => 'varchar',
        'grid' => false
    )
);
$installer->endSetup();
*/
/*
$installer = $this;

$installer->getConnection()
    ->addColumn($installer->getTable('sales/order'), 'affiliate_details', array(
        'TYPE'      => Varien_Db_Ddl_Table::TYPE_VARCHAR,
        'LENGTH'    => 255,
        'NULLABLE'  => true,
        'COMMENT'   => 'Affiliate Details'
    ));

*/

app/etc/modules/Bh_Affiliate.xml

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


texts: How to translate Magento validate.js error

texts:
I have a website with 2 stores (English and Spanish). Now I need to translate validation messages in Spanish. Like for example:

  Please enter a valid email address.

Please suggest how I can achieve this?