texts: Magento 2 getSelect with columns only showing one record in admin grid

texts:
I have a collection like below.
protected function _initSelect() {
        $this->addFilterToMap('entity_id', 'main_table.entity_id');
        $this->addFilterToMap('increment_id', 'main_table.increment_id');
        $this->addFilterToMap('created_at', 'main_table.created_at');
        $columns = array(  'total_income_amount' => new \Zend_Db_Expr(
            sprintf('SUM((%s - %s))',
                'main_table.base_subtotal',
                'main_table.base_discount_amount'
            )
        ),
        'total_inc_tax_all' => new \Zend_Db_Expr(
            sprintf('SUM((%s - %s + %s))',
                'main_table.base_subtotal',
                'main_table.base_discount_amount',
                'main_table.tax_invoiced'
            )
        )
        );
        parent::_initSelect();

        $this->getSelect()->columns($columns)
        ->joinLeft(
            ['secondTable' => $this->getTable('sales_order_grid')], //2nd table name by which you want to join mail table
            'main_table.entity_id = secondTable.entity_id', // common column which available in both table
            '*' // '*' define that you want all column of 2nd table. if you want some particular column then you can define as ['column1','column2']
        )->joinLeft(
            ['thirdtable' => $this->getTable('sales_order_address')], //2nd table name by which you want to join mail table
            'main_table.entity_id = thirdtable.entity_id', // common column which available in both table
            '*' // '*' define that you want all column of 2nd table. if you want some particular column then you can define as ['column1','column2']
        );
        //'convert(int, base_subtotal)+convert(int, base_discount_amount) as summed from main_table'
    }

But I get only one record in the admin grid but it is showing multiple pages.

If I remove columns($columns) it is showing all records.


texts: Does Product Meta Title default to Product Name if it is empty?

texts:
In doing a fresh install of the latest Magento CE v1.9.1, I saw that the Product Meta Title no longer defaults to the Product Name. As a result, all the Page Titles are showing up with the URL of the page.

Do you guys know if this is a bug, or was this feature to default the name removed? In my earlier v1.7.1, this was working fine.

In the meantime, we implemented the following function that sets the meta title:

class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstract
{
    /**
     * Default MAP renderer type
     *
     * @var string
     */
    protected $_mapRenderer = 'msrp_item';

/**
 * Add meta information from product to head block
 *
 * @return Mage_Catalog_Block_Product_View
 */
protected function _prepareLayout()
{
    $this->getLayout()->createBlock('catalog/breadcrumbs');
    $headBlock = $this->getLayout()->getBlock('head');
    if ($headBlock) {
        $product = $this->getProduct();
        $title = $product->getMetaTitle();
        if ($title) {
            $headBlock->setTitle($title);
        }
        $keyword = $product->getMetaKeyword();
        $currentCategory = Mage::registry('current_category');
        if ($keyword) {
            $headBlock->setKeywords($keyword);
        } elseif ($currentCategory) {
            $headBlock->setKeywords($product->getName());
        }
        $description = $product->getMetaDescription();
        if ($description) {
            $headBlock->setDescription( ($description) );
        } else {
            $headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255));
        }
        if ($this->helper('catalog/product')->canUseCanonicalTag()) {
            $params = array('_ignore_category' => true);
            $headBlock->addLinkRel('canonical', $product->getUrlModel()->getUrl($product, $params));
        }
    }

    return parent::_prepareLayout();
}


texts: how to move elements in default.xml based on media query in magento 2

texts:
How to move elements in default.xml based on media query in magento 2 ?

I wanted to move logo and links to header.panel when the breakpoint is 768px.


texts: Magento 1 : 'country_of_manufacture' product attribute Doesn't work correctly

texts:
i enable 'country_of_manufacture' product attribute in magento and set country for my products but it doesnt show in filter layer navigation.

attribute setting:

scope: global;
Values Required: no;
Apply To: all products type;
Use In Layered Navigation: filterable(with result);

when i change 'use in layered navigation' to filterable(no result) it show all countries in layer navigation

i use magento 1.9.3.0


texts: Magento 2 Order notification email sent after 3 hours of creating order?

texts: I transferred my website to another hosting company. Now When I create an order, I got the notification email 3 hours later, while it was instant email. What may have changed after the transfer?


texts: Magento 2 - extention attribute not available

texts:
I've implemented extention attribute for Customer Shipping Address. This is "Office" selection on the Checkout page, where customer can choose from.
Once Checkout Page first loads and customer picks an Office, the extention attribute is undefined.
If you then go further to the Payment step, then go back to the shipping step and pick the Office up again, the extention attribute is propely filled with the selected Office value. The extention attribute is 'visible' now.

Please advice me on this. Many thanks!


texts: Why products are not displayed on category page in Magento2.2.0?

texts:
Products are not displayed on the category page.

I completed data migration process and also do clean cache and reindex process.

And also check stock, quantity, visibility and etc.

But still product not display.


texts: How to set default value for an attribute through install script?

texts:
I have created an attributes using an install script for a custom module. One attribute is a drop-down which only has two options as 'yes','no'. The other attribute is a text field. I need to set default values through this script. I tied the following. But didn't work.

$th =  new Mage_Catalog_Model_Resource_Setup();
$th->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'credit', array(
            'group' => 'Prices',
            'type' => 'text',
            'backend' => '',
            'frontend' => '',
            'label' => 'Credit rewards',
            'input' => 'text',
            'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => true,
            'default' => 'kkkkkkkk', // this is default value. but is's not setting
            'searchable' => false,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'visible_in_advanced_search' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => 'simple',
        ) );

Any suggestion will be appreciated. Thanks in advanced.


texts:
I've full backup from hosting and now want to run on my localhost..
but when i run, i see some error like this :

Warning: include(/Applications/MAMP/htdocs/mesindesgalantes/includes/src/Zend_Db_Adapter_Pdo_Mysql.php): failed to open stream: No such file or directory  in /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Autoload.php on line 94

#0 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Autoload.php(94): mageCoreErrorHandler(2, 'include(/Applic...', '/Applications/M...', 94, Array)
#1 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Autoload.php(94): include()
#2 [internal function]: Varien_Autoload->autoload('Zend_Db_Adapter...')
#3 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Db_Adapter_Pdo_Mysql.php(30): spl_autoload_call('Zend_Db_Adapter...')
#4 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Autoload.php(94): include('/Applications/M...')
#5 [internal function]: Varien_Autoload->autoload('Varien_Db_Adapt...')
#6 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Magento_Db_Adapter_Pdo_Mysql.php(34): spl_autoload_call('Varien_Db_Adapt...')
#7 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Varien_Autoload.php(94): include('/Applications/M...')
#8 [internal function]: Varien_Autoload->autoload('Magento_Db_Adap...')
#9 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource.php(175): spl_autoload_call('Magento_Db_Adap...')
#10 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Array)
#11 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource_Db_Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#12 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource_Db_Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#13 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource_Db_Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#14 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Resource_Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#15 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Cache.php(478): Mage_Core_Model_Resource_Cache->getAllOptions()
#16 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Cache.php(520): Mage_Core_Model_Cache->_initOptions()
#17 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_App.php(1202): Mage_Core_Model_Cache->canUse('config')
#18 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Config.php(414): Mage_Core_Model_App->useCache('config')
#19 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#20 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_App.php(424): Mage_Core_Model_Config->loadModulesCache()
#21 /Applications/MAMP/htdocs/mesindesgalantes/includes/src/Mage_Core_Model_App.php(354): Mage_Core_Model_App->_initModules()
#22 /Applications/MAMP/htdocs/mesindesgalantes/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#23 /Applications/MAMP/htdocs/mesindesgalantes/index.php(84): Mage::run('', 'store')
#24 {main}


texts: Cart Rule Minimum Order from Category with quantity multiples

texts:
In my the store there is a category for wines. Customers can choose from any of the wines in this category but should only be able to proceed to checkout with a case quantity of bottles (i.e 6 bottles / 12 bottles ..and so on).

I read somewhere that Magento cannot offer this functionality but want to check here or will I need an extension to achieve this?


texts: How to set Default view page size to 50 for admin Order Grid : Magento 2

texts:
I want to set the Default view per page size to 50 in the admin order view. I tried by saving the view but that is only per user.
I want to set the per page size = 50 for all the users.

Any help will be highly appreciated!!


texts: Magento 1.9 Fatal error: Call to a member function getBackend() on boolean

texts:
I want to make a simple module who show product details without header footer and other block. At first i try to get product info by id. But that say

  Fatal error: Call to a member function getBackend() on boolean in D:\x\htdocs\m1\app\code\core\Mage\Eav\Model\Entity\Abstract.php on line 816

My code

class Abdus_Ajaxproduct_LoadproductController extends Mage_Core_Controller_Front_Action{
public function getbyidAction(){
    $_prdID=$this->getRequest()->getParam('id');
    $_product = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('id',$_prdID);
}}


texts: Is there any way where user can set the custom desired price greater than zero and proceed to cart for any product?

texts:
I am trying something for a social cause website where there are trying to provide a user choice price for a NGO's product which can be any price.
this is for promotional activity where user can set the any price for product.


texts: Can no longer upload images on Magento 1.9 now Flash is no longer supported

texts: Is there any way to still upload images on Magento 1.9 now that flash is not supported on Chrome or any other browsers?


texts:
I got this error when I tried to remove a product from category page

  Something went wrong while saving the category

Currently, I'm working with Magento 2.2.3.

Can anyone please explain about this?


texts: AvS_FastSimpleImport > How to import multiple product rows and images

texts:
Sorry for the probably simple question, but I am new to both Magento and Fast Simple Import.

The plugin works great for single products with single properties and single images. But I ofcoarse want more colors, more images, etc. etc. What is the best way to do this? I searched the trough the docs and Google, but couldn't find a working example (or answer).

This is what I have right now:

$data[] = array(
    // Main product
    'sku' => $randomString,
    '_type' => 'simple',
    '_attribute_set' => 'Default',
    '_product_websites' => 'base',
    '_category' => array(1, 3),

    // Product per row
    'name' => "Wikitest",
    'price' => 0.99,
    'special_price' => 0.90,
    'cost' => 0.50,
    'description' => 'Default',
    'short_description' => 'Default',
    'meta_title' => 'Default',
    'meta_description' => 'Default',
    'meta_keyword' => 'Default',
    'weight' => 11,
    'status' => 1,
    'visibility' => 4,
    'tax_class_id' => 2,
    'qty' => 0,
    'is_in_stock' => 0,
    'enable_googlecheckout' => '1',
    'gift_message_available' => '0',
    'url_key' => strtolower($randomString),

// Images

    // Image 1
    array('_media_image' => 'http://upload.wikimedia.org/wikipedia/meta/6/6d/Wikipedia_wordmark_1x.png',
    '_media_target_filename' => 'wikipedia.jpg',
    'image' => 'wikipedia.jpg',
    'small_image' => 'wikipedia.jpg',
    'thumbnail' => 'wikipedia.jpg')

    // Image 2
    '_media_image' => 'http://upload.wikimedia.org/wikipedia/meta/6/6d/Wikipedia_wordmark_1x.png',
    '_media_target_filename' => 'wikipedia2.jpg',
    'image' => 'wikipedia2.jpg',
    'small_image' => 'wikipedia2.jpg',
    'thumbnail' => 'wikipedia2.jpg',

);

What happens in above example is that I only upload / attach one image to the product. Also, when i add extra colors qty etc it will create multiple products or crash on duplicate SKU.

Second question, I am importing from an XML and CSV feed. Is there some best practise to turn an XML / CSV into an array? I can write something myself, but I guess something is already available. If not, tips are welcome as well.

Thanks all!


texts: How to get CategoryIds and Category name for selected Products in magento2 ?

texts:
I want to get CategoryIds and CategoryName to salected Produts; but in my code; I can give CategoryIds to All Products

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

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

    $collection = $productCollection->create()
        ->addAttributeToSelect('*')
        ->load();

    foreach ($collection as $product) {
          echo 'Name = '.$product->getName().'
';
        foreach ($product->getCategoryIds() as $category_id) {

            echo 'Category =' . $category_id. '
';

        }
    }


texts: Best way to setup magento 2 on virtualbox as shared folder

texts: Being magento newby I ask for advice setting up magento 2 on virtualbox as shared folder. I already have a setup but is impossible to work with because is causing loading gaps.


texts: How to delete order from observer Magento 2

texts:
I'm trying to perform an order alteration when the customer clicked on the "Place Order" button.
What I'm trying to do is, remove a bundled product and add it's child product back to the order as separate products.
For that, I'm using sales_model_service_quote_submit_before event. so I have the access to these objects

$event = $observer->getEvent();
$order = $event->getOrder();
$quote = $event->getQuote();

I have already figured out how to add products to the order, but when I try to delete products, it doesn't get affected.
I tried using

$quote->removeItem();
$quote->deleteItem();

methods, but so far no luck.
TIA


texts: How to add Space between Currency Symbol and Price in Magento 2?

texts:
Product Detail, how to add space after currency in magento 2?

Below is code

  app/design/frontend/Custom/goshop/Magento_Catalog/templates/product/price/amount/default.phtml

<?php /** @var \Magento\Framework\Pricing\Render\Amount $block */ ?>

<span class="price-container <?php /* @escapeNotVerified */ echo $block->getAdjustmentCssClasses() ?>"
        <?php echo $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
    <?php if ($block->getDisplayLabel()): ?>
        <?php /* @escapeNotVerified */ echo $block->getDisplayLabel(); ?>
    <?php endif; ?>
    <span <?php if ($block->getPriceId()): ?> id="<?php echo $id ?><?php /* @escapeNotVerified */ echo $block->getPriceId() ?>"<?php endif;?>
        <?php echo($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
        data-price-amount="<?php /* @escapeNotVerified */ echo $block->getDisplayValue(); ?>"
        data-price-type="<?php /* @escapeNotVerified */ echo $block->getPriceType(); ?>"
        class="price-wrapper <?php /* @escapeNotVerified */ echo $block->getPriceWrapperCss(); ?>"
        <?php echo $block->getSchema() ? ' itemprop="price"' : '' ?>>
        <?php /* @escapeNotVerified */ echo $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>

    <?php if ($block->hasAdjustmentsHtml()): ?>
        <?php echo $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()): ?>
        <meta itemprop="priceCurrency" content="<?php /* @escapeNotVerified */ echo $block->getDisplayCurrencyCode()?>" />
    <?php endif; ?>


texts:
I'm looking at putting together a module which will help resolve conflicting behaviours between a few modules we've got. What I was hoping to be able to do is create a module which could override, say 4 modules, but would still work even if only 3 of those modules were installed.

As I understand it, the only way to control whether a module loads after another is to make it dependent on that module, but obviously that wouldn't work in this case since the modules it was dependent on wouldn't necessarily be installed. So I was wondering if there was a way other than dependency to make sure a module follows another, but rather than the previous module being a requirement it just checks if it's installed and ignores it if not


texts:
i tried get symbol but it just show â‚¬

$currency_symbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();


texts: magento 2.2.3 custom template not loading

texts: I have installed my extension on magento 2.2.3 it is working but one frontend phtml file is not loading. Is there any other way to register custom template in 2.2.3? Also it works fine in 2.1.9 and other files are working fine in 2.2.3.


texts: Magento 2 remove image slider preview from product detail page

texts: I want to remove "slider preview(gallary images)" from product detail page.


texts: How to Import images to a multi store Magento website thorugh CSV file?

texts:
I am running a Magento 1.9.1 website, which is a multi-store website.My need is to import images to each particular store .My stores are Sports,Music and default.
For eg:- my products are sku1 and sku2.
Sku1 have some images in which some of them need to be displayed in Sports store and some of them need to be displayed in Music store also.
We need same thing for the Product Sku2 too.
How to set my CSV for that?Is it possible to do with csv Dataflow import process?

Please help me to find a solution for the same


texts:
I have top menu but i can't put home button in it..

here is code of mu top menu and what i try to do .

<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_menu): ?>

        <?php echo $_menu ?>

Home

<?php endif ?>

Do I need to enter something in

  store url=''


texts: Magento 2.4.1 varnish cart flushed issue

texts:
I am having this major issue which forced me to bypass varnish for magento 2.4.1 instance.
I use varnish 6.4 with Magento default vcl file.
When you add a product in cart and then go to cart or checkout or navigate in site you get No products in your cart.
Cart is always empty.
If varnish is turned down and use magento native FPC all are fine.
Vcl file line which excludes cart and checkout from varnish is this:
# Bypass shopping cart, checkout and search requests
    if (req.url ~ "/checkout" || req.url ~ "/catalogsearch" || req.url ~ "/search" || req.url ~ "/robots.txt") {
        return (pass);
    }

It is magento default but it seems it is ignored.
Any ideas please??
I am having serious issue
Keep in mind that same server setup is used with magento 2.4 and this issue is not there.


texts:
Just updated to 2.3.0 and after deploy in admin section i had the following bug:

How can i solve this?


texts:
When I try to upload logo image I got this error
Attention
File you are trying to upload exceeds maximum file size limit.


texts: JavaScript Bundling Not working in Magento2

texts:
I have refered https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/themes/js-bundling.html
for javascript bundling:

After doing all the step i have check Network in browser and it seems found all the js loaded instead of bundle js.

First time:

After redeploying:


texts: Magento2 : Something about category_form.xml

texts:
I want to add a input only can be put in a url like "http://www.google.com", I do it like this:

    <field name="url">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">string</item>
                <item name="label" xsi:type="string" translate="true">Url</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="required" xsi:type="boolean">false</item>
                <item name="sortOrder" xsi:type="number">50</item>
            </item>
            <item name="validation" xsi:type="array">
                <item name="validate-url" xsi:type="boolean">true</item>
            </item>
        </argument>
    </field>

but the validate does no work, it can be save whatever I put what should I do?


texts: Magento 2.3 adds white stripes while resizing a product image for a frontend product list

texts:
I have installed clean Magento EE2.3 . after I have moved to production mode I got 2 big problems.

1)  when I look on the product page I can see it being resized to a different size with white lines. look at the original image that has been uploaded:

this is cache images:

https://babybeddingdesign.com/pub/media/catalog/product/cache/b3b166914d87ce343d4dc5ec5117b502/d/u/...

this is original images that were upload (just remove cache):

https://babybeddingdesign.com/pub/media/catalog/product/d/u/dumbo_bedding_set.jpg

2) on Magento EE2.3 when a buyer goto checkout without been register Magento gives a message of


texts: Cannot create new user account - Magento 2

texts:
I recently updated my store to Magento 2.1.9 and am unable to create customer accounts. I enter all the information to create a new customer (on the frontend), but when you press the "Create Account" button you're redirected to the same page.

Though only the first one exists in my template, I have already tried adding <?php echo $this->getBlockHtml('formkey') ?> to:

app/design/frontend/[your_custom_theme]/template/customer/form/register.phtml
app/design/frontend/[your_custom_theme]/template/customer/form/resetforgottenpassword.phtml
app/design/frontend/[your_custom_theme]/template/persistent/customer/form/register.phtml
app/design/frontend/[your_custom_theme]/template/persistent/customer/form/login.phtml

I have changed the cookie domain and cleared the cache on many occasions. Besides that I couldn't find many others with the same issue as myself. I feel like it might have something to do with customer attributes because the account creation page has very few fields on it? There is also an issue items not being added to the cart, I don't know if these are related. Any help is appreciated!

Specs:

CentOS 7
php 7.0.6
Magento 2.1.9
Template: TemplateMonster (I feel like this might be relevant for this question)


texts: Get Quote and Quote Items using Magento 2 SOAP API

texts:
I am working with Magento 2 Rest APIs ( For Abundant cart ) and having issue with Quotes, I am able to get all Quotes ( with desired filters, is_active = 1, items_count > 0 )
using API :

  /rest/V1/carts/search

and its items

  /rest/V1/carts/:quoteId/items

Now, issue is in certain quotes it doesn't return any items though when i check quote_item table i could see items are there.

And when i check quote total using :

  /rest/V1/carts/:quoteId/totals

it returns desired results.

Now I'm little confuse how Quotes working and i have below questions :

1 - Why Quote items returned via API are different then the items in Database.

2 - Why some Quotes return items using /rest/V1/carts/search and some quotes doesn't ?

3 - Strange case i have found is , a quote has 4 items 3 items converted to order and 1 item is not converted. however when i see quote totals it gives value of all 4 items.


texts:
The module does not calculate shipping charges if there is only one piece product in the shopping cart.
I have only one rule basket. If the total is 100,000 HUF, I did not count shipping charges.

What could be the solution?

Update:
This was also a problem:

Hellowired Theme checkout process not working on Magento CE 1.8

I did this:

....?php echo $this->getChildHtml('methods')...
To that:

..fieldset id="checkout-payment-method-load">
        getChildHtml('methods')...


texts: How to compare products from two categories

texts:
In my website I have two categories let us assume Boys toys and Girls toys.

So i want to merge them into a single category named Toys.

Boys toys Category has 183 products.

Girls toys category has 283 products.

Now how do I find 100 products programatically which are in both categories.

Is there any way to find out or manually only do it or it will automatically Marge


texts: Select multiple value for layered navigation

texts:
On the category page (frontend) I'd like to select multiple value. For example if I select the color blue, then the filter 'Color' will be removed from the left side of the screen.

I'd like to keep the filter visible even if I select it so that I can select let say another color (or mutliple sizes or brands..), without installing any extension.

Thing is I never worked with layered filter that much before in Magento so I don't know where to start and what to look for.

Could someone point me in the right direction? Thank you.


texts: Magento 2 : How to add country_id column in sales order grid

texts:
I want to add/filter country_id column of shipping address in sales order grid.
I refer below link which is useful to display regoin_id.
By doing same I am able to add country id as a column but when I perform filter on that ambiguous error is generated.

https://www.mageworx.com/blog/how-to-add-column-with-filter-to-magento-2-orders-grid/

Please check below code, I changed for country id :
public function afterGetReport($subject, $collection, $requestName)
{
    if ($requestName !== 'sales_order_grid_data_source') {
        return $collection;
    }

    if ($collection->getMainTable() === $collection->getResource()->getTable('sales_order_grid')) {
        try {
             $orderAddressTableName           = $collection->getResource()->getTable('sales_order_address');
            $directoryCountryRegionTableName = $collection->getResource()->getTable('directory_country_region');
             $collection->getSelect()->joinLeft(
                ['soat' => $orderAddressTableName],
                'soat.parent_id = main_table.entity_id AND soat.address_type = \'shipping\'',
                ['telephone']
            );
            $collection->getSelect()->joinLeft(
                ['dcrt' => $directoryCountryRegionTableName],
                'soat.region_id = dcrt.region_id',
                ['code']
            );

             $collection->getSelect()->joinLeft(
                ['dcrt' => $directoryCountryRegionTableName],
                'soat.country_id = dcrt.country_id',
                ['country_id']
            );
        } catch (\Zend_Db_Select_Exception $selectException) {
            // Do nothing in that case
            $this->logger->log(100, $selectException);
        }
    }

    return $collection;
}

di.xml
   <column name="country_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
                <item name="label" xsi:type="string" translate="true">Country Id</item>
                <item name="sortOrder" xsi:type="number">65</item>
                <item name="align" xsi:type="string">left</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="filter" xsi:type="string">text</item>
            </item>
        </argument>
    </column>


texts: Mage sales order ::loadByIncrementId does not load order

texts:
What could go wrong if i load an order like:

// $val gets its value from controller (content type json utf8)
// json decoded file_get_contents('php://input')
// then a anonymous function gets $val and loads an order:
$val = trim((string)$val);
$order = Mage::getModel('sales/order')->loadByIncrementId($val);

$val is an inrement id like 5000001.

Weird think is: some ids work, some not. But those who dont work exists.

What could go wrong by loading an order by model sales/order ?

EDIT

It was a ZERO WITH SPACE in the order increment id - see http://www.fileformat.info/info/unicode/char/200b/index.htm


texts:
I've tried to install Magento 2 0.42.0-beta11 on Windows 7 machine with Apache. After install homepage doesn't have any styles or images - http://joxi.ru/Vm6ko9ni7oWG2Z.

If i try to open any css or js from page i get Warning!symlink(): Cannot create symlink, error code(1314) - http://joxi.ru/823gozRi5vpJ2O

Previously i had Magento 2 0.42.0-beta7 and there was everything ok. Looks like they changed aproach of css/js generation.

Same issue exist when i open admin panel.

Please assist.


texts: Can I delete rows from catalog_product_entity_decimal

texts:
I have strange problem with Magento. Our price attribute is set as GLOBAL, so product price is same in every store we have. Or at least it should be. Somehow with some products it is not like that. If I try to change price for those "broken products" it chances only at "default" store view but not from others. I cannot change price for other storeview from magento admin. But I can change it directly from table catalog_product_entity_decimal. I found out that for most products there is only single line for attribute_id 75 (=price) in catalog_product_entity_decimal, but for those "broken" products there is line (and price value) for every store.

So can I just delete those additional lines (using Sequel pro) and leave only the original line?


texts: Missing items for custom attributes filter

texts:
The issue is a direct follow up of this one : Product attribute in filter
But I've decided to create a new one as the issue is now more precisely identified.
My issue is that I have created a custom attribute
$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY, 'longueur_tasse_vertuo', [
        'type'  => 'text',
        'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
        'frontend' => '',
        'label' => 'Longueur de tasse Vertuo',
        'input' => 'multiselect',
        'class' => '',
        'source' => 'Cpy\Catalog\Model\Config\Product\CupSizeVertuooption',
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
        'visible' => true,
        'required' => false,
        'group' => '',
        'sort_order' => 203,
        'searchable' => false,
        'filterable' => true,
        'comparable' => false,
        'used_in_product_listing' => true,
        'visible_on_front' => true
    ]
);

But once I want to filter on this attribute, it pops with an empty result on $filter->getItems
But, the attribute by itself is correct as this will return me the correct set of defined values.
$attribute = $this->eavConfig->getAttribute('catalog_product', 'longueur_tasse_vertuo');
$options = $attribute->getSource()->getAllOptions();

That means, somehow somewhere, magento seems to not be able to associate my attribute source options to use them in the filter items.
Do I have a way to alterate the object Magento\Catalog\Model\Layer\Filter\FilterInterface $filter to create the items I need ? If not what can I do to fix this issue ?


texts: How to add custom payment gateway extension in magento2

texts:
Redirect to Payment Gateway and process payment
Return Back to store success page

Any help will be appreciated. I have followed the Inchoo implementing a payment gateway tutorial But no luck.


texts: Magento 1.9.x - i want to add some text to order number?

texts:
I want to add some prefix to order number.

Our website has 6 stores and i wanna classify which store customer purchase the item.

You know, orders in ebay and amazon already have their own prefix to order number like this

But orders proceeded in our own website do not have the prefix, just store_id + number

How can i add some text prefix to order number?
I think by using store_id, i can add them but i don't know how to do.
Thank you.


texts: Product import failing for fields with characters like " or -

texts:
I'm working on importing some products, but when I import them, only about half make it to Catalog > Product.  I'm slowly going through them to figure out why, and I'm noticing that products with descriptions that contain double quotes or hyphens (and maybe other characters, i've only found these two so far that don't work) don't end up getting imported.  There are no errors though.

The file I'm importing is a .csv being saved in Open Office.


texts: Magento 2: Display Payment Method in Custom Sales report grid

texts:
I have created the custom sales report to show required fields on the grid,

Used below code to show payment method,

  Vendor/Module/view/adminhtml/ui_component/salesfinacereport_manage_listing.xml

<column name="payment_method" component="Magento_Ui/js/grid/columns/select">
    <settings>
        <filter>select</filter>
        <options class="Magento\Payment\Ui\Component\Listing\Column\Method\Options"/>
        <dataType>select</dataType>
        <label translate="true">Payment Method</label>
        <visible>true</visible>
    </settings>
</column>

here is my collection file

  Vendor/Module/Model/Resource/Products/Collection.php

protected function _initSelect()
{
    parent::_initSelect();
    $this->getSelect()->joinLeft(
        ['secondTable' => $this->getTable('sales_order')],
        'main_table.order_id = secondTable.entity_id',
        '*'
    )->joinLeft(
    ['thirdTable' => $this->getTable('sales_order_address')],
    'main_table.order_id = thirdTable.parent_id',
    '*'
    )->where('thirdTable.address_type=?', \Magento\Quote\Model\Quote\Address::ADDRESS_TYPE_SHIPPING);

    $this->addFieldToFilter('status', [ 'neq' => 'canceled']);
    return $this;
}

which is not showing the payment method used for the particular order,

Can anyone help me how can we show the payment method used for the order,


texts: Magento 2: How to set Customer Group Price Programatically Through CSV

texts: How to create Customer Group Price programatically using CSV?


texts: Magento 2 programatically add product to cart?

texts: We have a requirement that we wants to add product to cart programmatically in magento2.


texts: Exclude custom options from shipping and tax calculations

texts:
Is there any way to exclude custom options with prices from shipping and tax calculations without the need for a custom module? Just seeing if anyone out there has done this without too much effort.

Thanks,
Mark


texts: Add another Admin Grid View from same block instances

texts:
I currently have an admin grid view per file structure/code as below;

Block/Adminhtml/Things.php

public function __construct()
{
    $this->_controller = 'adminhtml_things';
    $this->_blockGroup = 'things';
    $this->_headerText = Mage::helper('things')->__('Things Grid');
    $this->_addButtonLabel = Mage::helper('things')->__('Create Enhanced News Item');
    parent::__construct();
}

Block/Adminhtml/Things/Grid.php

public function __construct()
{

    //... (Sorts etc)

    $this->setSaveParametersInSession(true);
}

protected function _prepareCollection()
{
    $collection = Mage::getModel('things/things')->getCollection();

    //Use this in another Grid to filter
    //$collection->addFieldToFilter('customer_id', array('notnull' => true));
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

protected function _prepareColumns()
{

    //... (columns)

   return parent::_prepareColumns();
}

controllers/Adminhtml/Things/ThingsController.php

public function indexAction() {

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

}

public function gridAction() {

    $this->loadLayout();
    $this->getResponse()->setBody($this->getLayout()->createBlock('things/adminhtml_things_grid')->toHtml());

}

layout/things/things.xml

<adminhtml_things_things_index>
    <reference name="content">
        <block type="things/adminhtml_things" name="things" />
    </reference>
</adminhtml_things_things_index>

and all works fine and I have a populated Grid view via adminurl/things_things/index (grid view)

but how do create another Grid View with filtered collection? Do I;

Copy all the  Block & controller files and rename/refactor the namespace (ie Things2) and add the view into the xml layout file or;
Add another view action inside the ThingsController.php & xml layout file as well as creating another Grid block File with the collection filter ie Block/Adminhtml/Things/Grid2.php


texts: Error setting certificate verify locations: CAfile: ”cacert.pem” CApath: none

texts:
I get this error when trying to connect to Magento's Marketplace.
At first, it told me that the problem was with my SSL cert. so I've followed the guide "Local Host Installations using MAMP/XAMPP etc" of this link and it isn't working yet.

https://yikesplugins.com/support/knowledge-base/i-receive-the-error-ssl-certificate-problem-unable-to-get-local-issuer-certificate-why/

Now I get this error:

  error setting certificate verify locations: CAfile: ”C:\MyUrl\xampp\php\cacert.pem” CApath: none


texts: how to Show data in the tab of product detail page?

texts: I have to do same work as detail tab is doing on product detail page . I have added a tab named as technical details on product detail page. Also I have added technical detail section for each product on backend. Now I want to show the data of technical detail in the tab of product detail page. kindly tell me what I have to do ??


texts: Magento 2 Product Detail Page Not Loading

texts:
Magento 2 products details page is not loading in Admin and frontend.

Screenshot here: http://prntscr.com/it1ur3 .

Things I have already done

Grant permissions
Re-index
Compile
Flush cache


texts:
I got a service like this at SAP POST /Services/Magento.asmx/HelloWorld HTTP/1.1

how do i call it at magento 2?


texts: Magento2 - Command-Line - Sending Email Using Block Templates - Error: Missing required argument $debugHintsPath

texts:
When attempting to send emails in Magento 2 from command-line, I encountered the  exception below. While using the very same class to send emails from an frontend or backend controller was working perfectly. The issue was stricly happening using the command line interface.

Exception:

  main.CRITICAL: exception 'BadMethodCallException' with message 'Missing required argument $debugHintsPath of Magento\Developer\Model\TemplateEngine\Plugin\DebugHints.' in /.../.../magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:45

The issue was also only happening when trying to call a block via layout from inside the template. As soon as the block call was removed, the exception stopped showing.

Template File:

  app/code/NameSpace/Module/view/frontend/email/email_notification.html

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

...

<!-- THIS LINE CAUSED THE EXCEPTION TO SHOW UP -->
{{layout handle="sales_email_order_items" order=$order area="frontend"}}

...

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

The email was still sent with the subject line intact but the entire content was not rendered and only the error below was showing in the content section once the email was received.

Error printed inside emails:

  Error filtering template: Missing required argument $debugHintsPath of Magento\Developer\Model\TemplateEngine\Plugin\DebugHints.


texts: Magento2 :How To Use Form Key In Frontend Grid Using Ui Component

texts:
When i try to perform massdelete action from frontend grid using uicomponent than it has throws invalid form key error.
Does anyone know how we can use form key in frontend grid ?


texts: Add Expires headers in magento2 not working

texts: I am using apche 2 in my magento2 installation and for some reasons Add Expires headers not working I have check .htaccess file it has all the required code but still it is not working how to fix


texts: How to set hidden field with value in Admin html - Magento 2?

texts:
I have added a field as per Magento standard structure, hidden field appeared but value is not showing.

$fieldset->addField('entity_type_id', 'hidden',
    array(
      'name'               => 'entity_type_id',
      'value'              => 11
    ));

  NOTE : I have tried 'value' instead of 'values' but not working

Can anyone suggest how can I set the field value in Magento 2 admin form.


texts: How Do I Override Checkout HTML Templates

texts:
I am trying to update the html for the cart that gets displayed in the sidebar on the checkout.

I have copied:

  vendor/magento/module-checkout/view/frontend/web/template/summary

to my theme:

  my_theme/Magento_Checkout/web/template/summary

I have made changes to the html templates within the summary directory however the checkout page seems to be loading the default HTML templates?

How I can override the templates for the checkout?

Thanks


texts: Fatal error: Class 'Varien_Data_Form_Element_Weight' on line 144

texts:
I can't edit or add my products, the following error is being shown:

Fatal error: Class 'Varien_Data_Form_Element_Weight' not found in /home/youvesaved_ps/youvesaved.com/lib/Varien/Data/Form/Abstract.php on line 144

What can I do to fix this issue?


texts:
I have a weird problem I can say. I'm using Magento 1.9.3.6, and SOMETIMES, NOT ALWAYS,  when I want to access the product page, of any product, it gives me an 404 page not found error and if I refreshed the page, goes to the product page without any 404 error. I don't know why is that. This happens only one time/2-3 days for me, but I guess it happens more often, because I have many visits on my website.
What could be the problem?Thank you!


texts: Product changes when switching language on product view

texts:
I'm at the brink of finishing a major project with magento here. However, there's this one really weird bug left I need to fix.
My verdict:

I am on a product view page, currently on the english version
I hover on the language switch button and see, that the link is exactly the same as the current sites link, only with the extra "fromstoreid-tostoreen" appended.
I click on the button to change the language, to Indonesian that is
Now, my store is viewed on Indonesian, BUT, it is a completely different product than that shown on the previous language(english)
When I switch back to english, again, a different product is shown, even different than when I first viewed it on the english store, it kind of redirects me to random products without a pattern

Info: it only happens with products that has numbers in it(the entity_id at the end of the link), but works perfectly for number-less links
I am using magento 1.9.1


texts:
I'm looking to create variants of the same category page to perform AB testing? For example, If I have a category page called /bags, we need to create one more version of the same category page called /bags-v1 (with a different design). Then, I will compare both versions in the AB testing tool and will make the decision.
is there anything available out of the box in Magento to perform the AB testing like the above I mentioned?
Did anyone try this before? If yes, please point me in the right direction.
Thanks.


texts: MySQL keeps hanging (queries stuck on sending data)

texts:
I have the following situation:

About 5 times a week (not related to any specific situation like cache clear, traffic spike) some queries are stuck on sending data (show processlist):

>     SELECT `main_table`.`entity_id`, `main_table`.`level`, `main_table`.`path`, `main_table`.`position`,
> `main_table`.`is_active`, `main_table`.`is_anchor`,
> `main_table`.`name`, `url_rewrite`.`request_path` FROM
> `catalog_category_flat_store_30` AS `main_table`
>      LEFT JOIN `core_url_rewrite` AS `url_rewrite` ON url_rewrite.category_id=main_table.entity_id AND
> url_rewrite.is_system=1 AND url_rewrite.product_id IS NULL AND
> url_rewrite.store_id='30' AND url_rewrite.id_path LIKE 'category/%'
> WHERE (path LIKE '1/2/%') AND (main_table.store_id = '30') AND
> (is_active = '1') AND (include_in_menu = '1') ORDER BY name ASC

second one:

> SELECT `main_table`.`entity_id`, main_table.`name`, main_table.`path`,
> `main_table`.`is_active`, `main_table`.`is_anchor`,
> `main_table`.`manually`, `url_rewrite`.`request_path` FROM
> `catalog_category_flat_store_10` AS `main_table`  LEFT JOIN
> `core_url_rewrite` AS `url_rewrite` ON
> url_rewrite.category_id=main_table.entity_id AND
> url_rewrite.is_system=1 AND url_rewrite.product_id IS NULL AND
> url_rewrite.store_id='10' AND url_rewrite.id_path LIKE 'category/%'
> WHERE (main_table.is_active = '1') AND (main_table.include_in_menu =
> '1') AND (main_table.path like '1/2/1528/1569/%') AND (`level` <= 4)
> ORDER BY `main_table`.`position` ASC

These queries are related to generating the navigation menu. They run without any issues and very fast all the time.

Few times a month some other queries get stuck on seding data or waiting for table lock:

INSERT INTO `catalogsearch_result` SELECT 316598 AS `query_id`, `s`.`product_id`, MATCH (s.data_index) AGAINST ('STRING HERE' IN BOOLEAN MODE) AS `relevance` FROM `catalogsearch_fulltext` AS `s`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = s.product_id WHERE (s.store_id = 38) AND (MATCH (s.data_index) AGAINST ('STRING HERE' IN BOOLEAN MODE)) ON DUPLICATE KEY UPDATE `relevance` = VALUES(`relevance`)

(search related)

Additional info:

core_url_rewrite - 3M records (30 websites, 100k products)
catalog_category_flat_store_* - 2000 records (use flat categories is enabled)

This is running on a setup using vmware on some huge hardware (mysql master has 8 cores allocated and 64Gb of RAM, SSD disks on a SAN storage), mysql was optimized and is monitored continuously.
There were some issues in the past related to I/O (some isssue with the link between the servers and the SAN storage).

We couldn't pinpoint the issue because running on bare metal (no virtualization, same config) this doesn't happen ever, in high stress conditions (running siege + load testing scenarios, no cache).

Anyone else having similar issues?

UPDATE:

reindexAll search was moved to a temporary table (so it doesn't lock the main table used by the production, then renames the tmp table). So, the reindex process doesn't interfere with visitors searching the website.
https://github.com/magendooro/magento-fulltext-reindex kudos to carco


texts: Magento 2. Retrieve information from env.php programmatically

texts:
I wish to read and use information stored in my env.php. Is there an entity that I can use to achieve this?

Any tips are highly appreciated.
Thanks.


texts: Where to save the icon and how to replace the cart?

texts:
I know there are some topics on this subject, but my question is the following, not only do I need to know how to replace the cart icon, but I need to use a png image I have. Where do I save this image in my theme so that I can only reference it in the same way that luma makes reference to its icons?
I wanted to do it by css, I saw that I can change it as follows:
.minicart-wrapper .action.showcart:before {
content: ''; }

Luma:
font-family: 'luma-icons';

But how do I call my image that I need to save my theme? and again, where?


texts: Get all relevant data from the customer/customer table

texts:
I'm creating a backup script in magento, and would like to export all customer data from the table ('customer / customer'). How could I get all the data from this table? I tried to use:

 $user_loaded = Mage::getModel('customer/customer')->load($id)->getData();
 echo $user_loaded. 'test: ';

to see what I would get I just get a test: Array. test: Array. test: Array how could I turn this into the information I need? Example, name, lastname, email etc..

Or would I have to specify every field I need?

$name = $user_loaded->getFirstname();
$lastname = $user_loaded->getLastname();

If I have to do one by one does someone have the data that is needed to pull a complete backup? I do not want to do a dump backup for the fact of changing the tables, I just like to insert data, not change tables..

Would I have how do I pull everything from the table ('customer/customer') to a text file?


texts: How to display correct configured product image in shopping cart

texts:
I'm able to successfully use the color swatch feature that was introduced in CE 1.9.1, but I was wondering how can I display the selected colored product that was added to the shopping cart.

Example:

Shopper clicks on red swatch in product detail view page
Product image is swapped to red colored product
Shopper clicks add to cart button
Product added in shopping cart

Unfortunately since the default configured product image is a different color, that's the product images listed in the shopping cart, not the red product image.

Am I missing a step or this functionality is not currently available?
How can I ensure the correct colored product image is being displayed in the shopping cart?


texts: Magento 2.1: Empty fields when editing migrated product

texts:
I've used Ubertheme's migration tool to migrate around 6,000 products from Magento 1.7 to 2.1.3.

In terms of actual data, everything appears to check out in the database or in certain areas of the admin system.

However, when I edit one of the migrated products, every field in the edit form is blank other than SKU.

It's unusual because on the main product admin page, all of the columns for each product are correctly populated.

Has anybody seen a problem like this before?


texts:
I am using Magento version 2.1.7.
When I install an extension in my magento it doesn't check php version.

Earlier it show that cron hasn't been configured yet error. For that I changed the cron check & updater check as 'success' to skip the checking of cron.
Now it is not checking the php version in my system.

My php version is 7.0.2 & I have set the memory_limit=1024M in php.ini file.

I am using XAMPP for the apache in windows.


texts: Order was free but invoices still show taxes, tax settings?

texts:
I am wondering what the correct tax settings should be in my situation, since I am currently getting some very odd results.

How it should be is that all prices on the site are tax included, and discounts should apply on the prices INCLUDING tax. So if I buy a product of €100 (tax included) en get €50 off the total price should be €50 (tax included).

At the moment I have the current tax configuration, which seem right.

And sure on the site all product prices are correct, they are displayed including tax. I tried a discount code which gives me the product for free and should give me free shipping.

As you can see my total is zero. Shipping is free, and the total in checkout is also zero. So all correct there.

However if I now go to the admin backendm checkout the order, which is still zero

and want to create an invoice for this order, I get this.

All of sudden tax and often also shipping is added to the invoice anyway. Which is the tax on the product.

This makes no sense to me. Are my tax settings wrong or is there something wrong with my Magento installation somewhere?

Edit: The checkout order seems correct too


texts: Why does the Magento cache not auto-flush?

texts: Why is Magento 2.3 smart enough to know that the cache is invalid, but won't just auto-flush?


texts: Payment success but is amount is due in backend order [custom payment module]

texts:
My store redirected to payment site and after payment is success, it send positive respose. and this is my method that handles response.

 public function responseAction() {
         $response = $this->getRequest->getParams(); //captured response
         ............
        if($validated) {
            // Payment was successful, so update the order's state, send order email and move to the success page
            $order = Mage::getModel('sales/order');
            $order->loadByIncrementId($orderId);
            $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');

            $order->sendNewOrderEmail();
            $order->setEmailSent(true);

            $order->save();

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

            Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
        }
        else {
            // There is a problem in the response we got
            $this->cancelAction();
            Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
        }
     .......

Here, all the response parameters are fine and it also redirects me to the success page. But in order it says the payment is due. what do i need to update for my store to recognize at paid.

Suggestion of @R.S

After i invoice the order(via invoice button) it shows all amount is paid and due amount is 0. Why doesn't it show when i first look at order detail ?

I tried to invoice on the response method(reference from above method), but no luck

if($validated) {
            // Payment was successful, so update the order's state, send order email and move to the success page
            $order = Mage::getModel('sales/order');
            $order->loadByIncrementId($orderId);
            $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment. Payment reference id '.$response['refId']);
            $order->addStatusHistoryComment("Payment reference id ".$response['refId'], false);
            $order->sendNewOrderEmail();
            $order->setEmailSent(true);

            $order->save();

            /*Invoice an order*/
            $order=Mage::getModel('sales/order')->load($orderId);
            if($order->canInvoice() and $order->getIncrementId()){
                    $items = array();
                    foreach ($order->getAllItems() as $item) {
                        $items[$item->getId()] = $item->getQtyOrdered();
                    }
                $invoiceId=Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(),$items,null,false,true);
                Mage::getModel('sales/order_invoice_api')->capture($invoiceId);
            }
            $order->save();

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

            Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
        }


texts:
I'm trying to update a field in the database via my database model. All tutorials online about CRUD models seem to just show how to 'CR' and not showing examples of the 'UD'. My code so far:

namespace CompanyName\AdminMenu\Controller\Adminhtml\HomepageBanner;

class UpdatePosition extends \Magento\Framework\App\Action\Action
{
protected $_postFactory;
protected $_httpRequest;
protected $_postResource;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\App\Request\Http $httpRequest,
    \CompanyName\AdminMenu\Model\PostFactory $postFactory,
    \CompanyName\AdminMenu\ResourceModel\Post $postResource
    )
{
    $this->_postFactory = $postFactory;
    $this->_postResource = $postResource;
    $this->_httpRequest = $httpRequest;
    return parent::__construct($context);
}

public function execute()
{
    $post = $this->$postFactory->create();

    $post->load(2, 'slide_position')->setId(22)->save();

    //$this->getConnection()->update('admincontentbanners_homepageslider_post', ['slide_position' => $data], ["slide_id = ?" => $slideID]);
}

}

Any advise would be appreciated..


texts: Magento2.3.3 How to create validation class like 'required-entry' for checkout's existing field

texts:
I want to create new custom rule that will duplicate of 'required-entry' class applied on checkout page.

Actually I need to change the error message for field so I want to create custom 'class' then replace 'required-entry' to custom created class.


texts: Magento 2 - Change format of authentication-popup.html

texts:
I overridden authentication popup of Magento 2 in my custom theme. I discovered that the file that is called for the popup is with the extension .html (authentication-popup.html). This way I can't add php code.

Can I change the format of "authentication-popup.html" to "authentication-popup.phtml"? How?

Thanks


texts: Magento 2. Adjust order of loading javascripts

texts:
I have the following navigation menu, loaded through Javascript like this:

<ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>

Is there a way to make this widget menu to load, in the footer, first than any other javascript? I heard it is possible by using j-query, but not sure how to achieve this.

Thanks for your collaborations


texts: Observer conditional continue with message

texts:
I created an observer in 'controller_action_predispatch_checkout_index_index', in the code i have:

    if (!in_array(false, $example, true)) {

    $this->_messageManager->addSuccess(__('Success message'));

}else if (in_array(false, $example, true)) {

    if(!$this->_customerSession->isLoggedIn()) {

        $this->_messageManager->addError(__('ERROR'));
        $this->_redirect->redirect($controller->getResponse(), 'customer/account/login');
    }

}

in the 'else if' all works great, but in the first condition i can't see the message in the checkout view.
If i put a redirect like:

$this->_redirect->redirect($controller->getResponse(), 'checkout');

It go to an error page with:

"The page www.example.local has redirected you too many times."

error message.

Can anyone say me how can i send a message to the checkout with the less code. (I know i can do an oberver, test all the products again and do the condition to show the message, but i don't to repeat myself)


texts:
im not sure if it is a bug, but something is not working right, basically i have a 10% discount coupon on products, but the calculations is not working right.

Basically it shows the correct price, and the correct discount amount, but than on the "Row Total" instead of showing in my case 27.53 it shows 26.83.

Here is a image of the item ordered.

And than here above is the options that i configure in the coupon rule.


texts: System Configuration not defaulting to General

texts:
When I click on System > Configuration it brings up the Catalin SEO configuration by default instead of the General tab.

I've edited the system.xml file for Catalin SEO to set the sort_order to be higher, but it just moves it further down the sidebar instead of stopping it from being loaded by default.

How can I change this?


texts: Magento import price from 10 CSV to 1000 in magento

texts:
When I import a CSV file and set the price to 5,95(euros)
the products import without a problem except for one.

The price which was 5,95 or 12,95 turned into 595,00 or 1.295,00.

Does anyone have experience with this issue? Did I set some price option incorrectly?


texts: How many Facebook Pixel Code can you have in Magento?

texts:
How many facebook pixel codes can you have in Magento. I so that our marketing seo's put in Magento admin console in section Miscellaneous Scripts that there is more then one Pixel code e.g.

  code ...

  code ...

etc.

Also Pixel code does not work on page. Is it problem that is more than one Pixel code?


texts: Is it possible to mark products out of stock once certain number of orders have been placed for a product. Eg. A product has 1000 qty but I want to make that product out of stock immediately when orders have been placed for 100 products in a week, basically I dont want customers to order more than 100 pieces in a week. I know I can set this manually but I want to keep the site on automation. I am not quite sure where to start from programming point of view.


texts: Add a PayPal Checkout Button to Onepage Checkout page?

texts:
Searched around, but found no true answer. I wish to add a PayPal Express Button, similar to the Cart page, under the "Your Checkout Progress" review steps.
Is this possible please?

Thank you.


texts: Add extra line to head section with url as a variable

texts:
I want for every page an additional line in the head section.
The extra line should look like this: <link rel="alternate" href="https://www.mywebsite.com/us/link.html" hreflang="en-US"> where "link.html" is the variable URL and the rest of the line is fixed.

I have tried to accomplish this by adjusting the default_head_blocks.xml but I am not a programmer and not familiar with the syntax, can somebody show me the way?


texts: Which file in Magento is the point at which the product description is pulled from the DB and sent to the browser

texts: I'm currently working on language translations in Magento and it seems the translate.csv within locale/ doesn't contribute towards replacing product name/description. I need to add this functionality in and to do so I need to identify the location, within the code, that the product name/description is pulled from the DB.


texts: What is the life span of a helper in Magento 1?

texts:
As I understand, helpers are singletons in Magento. I was wondering what the life span of the singleton is in Magento. Is only 1 instantiated for the life of the app (web server process start to finish) or is it per request? Or is it something else?

I have a helper that memoizes some data, and I was wondering how long it would hold on to it. I figured it would be for the life span of the helper.


texts:
when our sales team creates a manual order from magento back-end you can later search for the client under "customer" drop down. However, if an order is placed through our website, you can search for the actual order, but not by the customer.

Please help.


texts: How to configure ElasticSearch that is on a remote host?

texts:
I'm new to ES and just want to set up Magento 2.4 and ES in its simpelst way, just to get a impression.
Magento is on host A, ES on host B. Both on RHEL systems in the same network. I've installed ES and did not configure it, so it runs with its default configuration (which is a 'single node' instance?). On host B I can execute curl -XGET 'localhost:9200/_cat/health?v&pretty' successfully. But if I try that on Host A with curl -XGET 'host_B:9200/_cat/health?v&pretty' I get:
curl: (7) Failed to connect to colop_dev port 9200: Connection refused

And I guess that has something to do with the ES option network.host in /etc/elasticsearch/elasticsearch.yml, which is set to default value _local_, afaik. This does not allow connections from other machines. Is that correct? I tried the value 0.0.0.0, but when I restart ES I get the error
Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: ERROR: [1] bootstrap checks failed
Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
Aug 11 09:19:51 itsrv2493.esrv.local systemd-entrypoint[21543]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/CONFIG
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Aug 11 09:19:51 itsrv2493.esrv.local systemd[1]: Failed to start Elasticsearch.

I think it has something to do with this. I have disabled SELinux and the firewall. I've tried telnet. Without success, though other ports on host B can be accessed normally from host A (e.g. web server).
According to the Recommended configuration in the Installation Guide, I should set up a web server on host B as well. But is it really necessary if port 9200 is not public? If not, how should I configure ES on host B? I'm also wondering about the suggested verification of the ES installation with curl -XGET '<host>:9200/_cat/health?v&pretty': it does not use the port 8080 that is suggested for Apache and nginx. Why?
Update: According to simonthesorcerer's answer, it is possible to have ES on a different machine, without the need of another web server in order to use ES.


texts: Magento 2 : Error 404 not found at magento 2 admin login page

texts:
I have installed magento 2 into my Personal Computer. It working fine over there.

I have installed same copy at another system then frontend is working fine admin is not. (its showing 404 page)

Right now I want to install it into my laptop.

I did following...

I just copy magento2 folder from my PC i.e wamp/www/magento2 and put it at proper destination into laptop i.e wamp/www/magento2
I export magento2 database from PC and import at Laptop localhost.
Update the base_urlinto imported DB.
Deleted contents unders var/ as wel as pub/static/

I tried following...

run php magento setup:upgrade but not useful.


texts:
I'm trying to create a custom module which will have GoogleSheet Import functionality. So I want to call varienImport.postToFrame() this function works when we click on Check Data option in existing Import section.

This is js function which exist in before.phtml file.

So How can I use this function in my custom module


texts: How to get all orders items by product_id?

texts:
I want to get all order items by product_id not by order_id. So Please read carefully and give me a solution.
Thanks in Advance.


texts: When I add product from backend I got this

texts:
I am using Magento 2.2.6

When I add product from backend I got page like shown in below image.

Is it any known issue in Magento 2.2.6 or any cache related issue?


texts:
I use an MG 2.3.4 installation and add the splendidinternet/mage2-locale-de-de component to apply German as used language for the frontend. It works. I also use a simple custom skin, based on Luna.

Now I add a de_DE.csv file in the i18n folder of my skin and change some translation with success:

Shipping, Verpackung und Versand,,

The default translation for Excl. Tax is not good, and I try to change the translation in the same way without any success. I add these strings:

(Excl. Tax),(Zzgl. MwSt.)
"Excl. Tax","Zzgl. MwSt."
Excluding Tax,Zzgl. MwSt.

deploy and flush cache. No change:

I also did a full-text search an all installed file, and I found only the component above. I have no further ideas :-(


texts:
I just notice that when ever I add this codes on the Magento Footer:

$current_id = Mage::registry('current_category')->getId();
echo $current_id;

The Category ID is not changing whenever I change the Category.
It only changes when I clear the cache.

It is possible that the Magento Footer is a Static One?
Cause I won't update unless you clear any cache.


texts: How to refresh total sidebar when change qty by ajax in cart page

texts:
I am changing the qty of items using ajax, when ajax is successful then i want to refresh my sidebar total.

Minicart updates automatically because of sections but the total does not update.

How can i do this?


texts: Can I get my breadcrumbs to display the h1 from the content page?

texts: Im adding breadcrumbs to cms content pages. I would like for the breadcrumbs to pull the h1 from those pages.


texts: How to unsubscribe customers on mass / bulk in Magento 2.3

texts:
We have migrated from M1 to M2, and it appears on M1 we had customers "subscribed" in Magento admin but had subsequently unsubscribed in our email platform. Unfortunately, this had not synced back to Magento 1 and was one way. Therefore when moving to Magento 2, it began to re-subscribe customers that should be unsubscribed.
We have around 30k subscribers that need unsubscribing, which I can find in the newsletter_subscriber table and comparing to our email provider's db.
However changing subscriber_status field in the db from 1 to 3 (subscribe to unsubscribe) does not appear to work, and I suspect a customer save also needs to happen, but not sure how to do this.
Any ideas, either to save all customers pragmatically, or to unsubscribe pragmatically?
I have a list of emails or subscriber_id's and customer id's


texts: Remove popup of registration of customer magento 2

texts: I want to remove this popup but i don't know what to override and i can't debug when i clic create account this popup shows up.


texts: How to insert custom template/block where I want?

texts:
Trying to insert custom template/block into specific place in => product.info.addto

for some reason my block appears either before or after and I can't manage to insert it anywhere else.

<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_product_view>

    <reference name="content">

        <block type="amber_custom/catalog_product_custom" name="linked.product" template="amber/catalog/product/custom.phtml" after="product.reviews"/> <!-- trying inset it after this block but no luck -->

    </reference>

</catalog_product_view>
</layout>

What is the problem, why it won't go there ?

To find out all the block names i'm using "ath" - advanced theme hint , it shows all the names correctly.


texts: How to remove Magento products details from local storage of browser?

texts:
In Magento 2 when we open multiple products it stores data of those products into window.localStorage.product_data_storage locally into the browser, In many of the browser that data get deleted automatically but in some of the browsers it is not getting deleted.

  I do have to say I opened about 200 products before this happened, but
  it is never clear.

When we clear the cache of browser then it is removing that data from browser, but it is simply understood that the end user will not go to clear their cache every time so How we can remove this content from their browser?

Any Help will be appreciated

Thank You!


texts:
Is there any way to make the Negotiable Quote in Enterprise edtion to have steps like that of checkout.
Final Step will submit the negotiable quote instead of orders.


texts: layout handle not working in custom email

texts:
trying to send email programmaticaly with order items grid using {{layout handle="sales_email_order_items" order=$order}} but its not working. {{htmlescape var=$order.getCustomerName()}} show customer name properly.

what is missing?

following is code for email and 29 is id of template in which {{layout handle="sales_email_order_items" order=$order}} is mentioned.

Mage::app()->getLocale()->emulate($storeId);
$SalesOrder = Mage::getModel("sales/order")->load($requestParams['order_id']);
$storeEmail = Mage::getStoreConfig('trans_email/ident_custom1/email');
$storeName =  Mage::getStoreConfig('trans_email/ident_custom1/name');
$recvEmail = $CustomerName;
$recvName =  $email;
$templateId = 29;
//set data to use in array
$edata['comment'] = $ResultData->URL;
$edata['order'] = $SalesOrder;
//Core email sending code
$emailTemplate = Mage::getModel('core/email_template')->
                    addBcc('abc@example.com')->
                    sendTransactional($templateId);
$emailTemplate->getProcessedTemplate($edata);
$emailTemplate->setSenderEmail($storeEmail);
$emailTemplate->setSenderName($storeName);
$emailTemplate->setType('html');
$emailTemplate->send($recvEmail,$recvName,$edata);

Thanks in advance.

Note: If you know any good tutorial on sending email programmatically with ordered item grid. please tell me.


texts: Magento 1.x set thumbnail image same as small image for all products

texts:
I have imported 77K products in magento with custom import script.
All data are imported successfully.

The mistake I did is I forgot to set Thumbnail image for each product.
We have only two images for each product, so I want to set small image value same as thumbnail image.

Is there anyone who can provide me code to update thumbnail for each product at a time?

Screenshot:

I have tried this:

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

Not saving thumbnail :(

Also tried this:

$value=$product->getData('small_image');
if ($value) {
    Mage::getSingleton('catalog/product_action')
            ->updateAttributes(array($product->getId()),
                array(
                    'image'=>$value,
                    'small_image'=>$value,
                    'thumbnail'=>$value,
                    ),
                0);  // 0 specifies the Default
    }

But when I try to update each product in loop Getting this error:
Mage registry key "_singleton/" already exists error


texts: Magento controller action return gateway timeout error

texts:
I have created a controller action in my custom module controller class, there is a loop of all products to do some functionality, but after 5 minutes it return 504 gateway timeout error.

For this I made changes in php.ini and  in .htaccess

// in php.ini
always_populate_raw_post_data = -1
max_execution_time = 259200
memory_limit = 2048M;
post_max_size = 32M;

// in htaccess
php_value memory_limit 3072M
php_value max_execution_time 259200
php_value max_input_time 259200

and phpinfo() also showing updated value for above. but even after this the process return gateway timeout error after 5 minutes.

How to resolve this?
Is there any other parameter to increased execution time which I missed?

OR Is there any method to increase execution time for only my controller action?


texts: Http version redirected to https but appeared as 200 OK

texts:
When I try to call a page in my browser with http:// it goes to the corresponding page with https://, which apparently looks OK. (see http://thailandfightgear.fr/gant-boxe-twins-orange for exemple)

But when i try to check the redirect status of the pages using redirect checker tool (like this one redirectcheck.com) , it return HTTP/1.1 200 OK code instead of 301 redirect.

I don't understand why the robot cannot see the redirect. any clues ?

PS: For the redirect with www to non-www url, it works fine.


texts: How to access custom attribute added to a product?

texts:
I have added a custom attribute "flag" to the product. But when I try to access the data using $product->getData('flag');. Its returning null.

I find some way to load custom attribute in the stackexchange by calling raw attribute function.

But when I checked the product object it contain about 43 attributes, includes name, id, thumbnail, type_id etc., so is there a way to configure magento to collect my custom attribute also when it loads other 43 attributes.


texts: Limit Checkout Order or Add to Cart Limit to allow only 6 type of items

texts:
How can I achieve this functionality in Magento 2.3
Limit Checkout Order or Add to Cart Limit to allow only 6 or any particular number type of items.
These 6 items can have variable Qty value.
Eg:
One Checkout/AddCart Maximum 6 Items:
Item 1 25Qty, Item 2 125Qty, Item 3 Sample, Item 4 50Qty, Item 5 100Qty, Item 5 Sample
can there be prompt that maximum 6 items you can order once customer try to order 7th item?


texts: fedex-Sorry, no quotes are available for this order at this time

texts:
I am putting the fedex credential and enable for checkout.

when click on proceed to checkout i got this error
sorry, no quotes are available for this order at this time.

I put the shipping address

10853 Rose Ave,
Los Angeles,california,US

and after i click on Continue button i got this error .

Why this error is coming ? .. And also  i am able to shipping with other method that is flat rate . Please help me . and what is this error "Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.
"


texts: Magento Enterprise controller override issue

texts:
I am Trying to override magento controller but no luck

Here is my config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Ktpl_Custom>
            <version>0.1.0</version>
        </Ktpl_Custom>
    </modules>
    <frontend>
        <routers>
            <invitation>
                <args>
                    <modules>
                        <Ktpl_Custom before="Enterprise_Invitation">Ktpl_Custom</Ktpl_Custom>
                    </modules>
                </args>
            </invitation>
        </routers>
    </frontend>
    <global>
        <helpers>
            <custom>
                <class>Ktpl_Custom_Helper</class>
            </custom>
        </helpers>
    </global>
</config>

app/etc/module.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Ktpl_Custom>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Enterprise_Invitation/>
            </depends>
        </Ktpl_Custom>
    </modules>
</config>

app/code/local/Ktpl/Custom/controllers/Customer/AccountController.php

require_once(Mage::getModuleDir('controllers','Enterprise_Invitation').DS.'Customer/AccountController.php');

class Ktpl_Custom_Customer_AccountController extends Enterprise_Invitation_Customer_AccountController
{
    protected function _loginPostRedirect()
    {
        echo "string";
        die;

    }
}

If anyone have idea what wrong with this code


texts: How Filter(make custom array) Order Items Collection when view order from front end admin page sales order grid.


texts: Address showing blank in My Account section, One Step Checkout & Transactional Emails

texts:
I have a strange issue happening on our production environment. Where the address is printed out in the template files across the site it is blank. This is happening across the My Account section, One Step Checkout Saved Address and also the Transactional Emails.

We have a development server setup with the exact same code base which does not have the problem.

I have changed the theme to the default on production & also turned off all third party modules but that does not show the address either.

I'm presuming this must be server related or even in the database but I am running out of ideas to debug can anyone suggest anything?

Thanks


texts: change email template before sending email

texts:
Guys am trying to modifying variables used in email templates, like store name, store email for every email.

How can we do this good manner?

Add plugin on \Magento\Framework\Mail\TransportInterface is good approach?

For example . : its in order_new.html

 {{trans "Thank you for your order from %store_name." store_name=$store.getFrontendName()}}

want to change store_name here


texts: How to create this type of popup in magento 2.4.?

texts:
add one button on PDP page like "Add comment"
if click on that button popup should be open with textarea that user can insert comment
user should be logged in then this button should be displayed
if comment has been added then it will be displayed on cart message below product and also, in checkout


texts:
I am trying to understand why Magento keep marking product attributes as "Required Fields" on the product page, when I set its "Values Required" field to NO, in the Admin Panel.

Where else it's supposed to be changed that status?


texts: I have to limit the discount amount. that is, if subtotal above $2000 then i have to give 10% discount, but the maximum discount amount is $100, I don't know how to do this. Please help me to do this.


texts: Show final shipping cost on custom block page magento

texts:
I am at wits end end with this problem. I have a design that I need to add the checkout info on a custom magento page right sidebar (wired) I already have the PHP code that pulls the grand total and the sub total. I need the full shipping cost to show up like this:

If anyone can also give me the code to show the Promo code values that would be killing 3 birds with 1 pebble stone.!

Thanks.


texts: Dynamic text in prototype field validation

texts:
Say I'm adding a custom field validation method like so:

Validation.addAllThese([

['field-required-entry', 'Please enter a value for' + var, function (v) {
    //Add your own validation code here
    console.log(Validation);
    return !Validation.get('IsEmpty').test(v);
}]

]);

Is there any way to make the returned error string dynamic i.e
replace 'var' in that second parameter with the field label value?


texts:
How can I edit the address format? I know that I can add 3 more lines at Stores/Customers/Customers Configuration/Name and Address Options/Number of Lines in a Street Address. Then I can set as 4.

But I would like to split it in other fields like: street, number, neighborhood, reference, etc.

I can't find tutorials for Magento 2.x.

Thanks!


texts: Magento2 Keeping CSS changes after redeployment

texts:
Hi I am new to Magento 2, I was wondering what methods people are using to keep CSS changes after they deploy static content as CSS changes are overwritten every time.

Thanks!


texts: Magento 2.1.12 - all products not showing up categories and search results frontend

texts:
Since this weekend one of our Magento stores stopped displaying products on all category pages and the search results page. We have tried everything from reindexing all products, deleting the var folder, redeploy all content, setup upgrade/compile. But nothing seems to solve the problem. The error log returns nothing and the store is in dev mode. I've also checked both the categories and the products but nothing has changed which could have caused this.

Does anyone know the issue or got a solution to the problem I am facing?


texts: How to use session and pass some value to phtml file to phtml file?

texts:
I want to pass some value in phtml file to another phtml file somewhere else
as an example 1.phtml file like below
<?php

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

?>

and 2.phtml file like below
<?php

$outputMessage = Mage::getSingleton('core/session')->getWelcomeMessage();
echo $this->__($outputMessage);

?>

if I use something like this it will give an error like below

Fatal error: Uncaught Error: Class 'Mage' not found in
C:\xamppp\htdocs\iconmirror\app\code\Codazon\Slideshow\view\frontend\templates\slideshow.phtml:92
Stack trace: #0
C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\TemplateEngine\Php.php(59):
include() #1
C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\Element\Template.php(255):
Magento\Framework\View\TemplateEngine\Php->render(Object(Codazon\Slideshow\Block\Widget\Slideshow),
'C:/xamppp/htdoc...', Array) #2
C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\Element\Template.php(279):
Magento\Framework\View\Element\Template->fetchView('C:/xamppp/htdoc...')
3 C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\Element\AbstractBlock.php(659):
Magento\Framework\View\Element\Template->_toHtml() #4
C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\Layout.php(542):
Magento\Framework\View\Element\AbstractBlock->toHtml() #5
C:\xamppp\htdocs\iconmirror\vendor\magento\framework\View\Layout.php(518):
Magento\Framework\View\Layout->_renderB in
C:\xamppp\htdocs\iconmirror\app\code\Codazon\Slideshow\view\frontend\templates\slideshow.phtml
on line 92

please help me with this im new to magento 2


texts: Magento CSV Product Import Set Parent Category URL Key for use on Catalog list Category page

texts:
-- Update --

I think the issue is in the category list view. It generates the product link to the product, for the page, in a loop.

I have it getting the product categories, and using that to build the URL.

I am thinking I will have to define which one i want to be the parent in an additional attribute, and then check that attribute for the category url-key that I want to use.

Any suggestions on the best way to accomplish this?

-- Update --

I have noticed that the issue seems to be because of the way magento creates it's url-key for a product is based off the highest Category ID of the categories it belongs to.

The largest category ID defines the url-key.

So if I have product1 in category1, category2, and category3; I want the url key of category1 (i.e. site.com/category1/product1), but if category3 has a larger ID than category1, the url key will be site.com/category3/product1, even when you navigate to site.com/category1 the link is to site.com/category3/product1.

I could remove it from additional categories that have a higher ID, but that is not an ideal solution.

Is there anyway to set the full url key? or is there somewhere i can force the preference of a certain category's url-key?

-- Original --

I am attempting to import products and categories via CSV.

I have this process working, and everything imports without throwing an error.

I have my products belonging to anywhere from 1 to 3 categories.

In the import, the url key for most of the products is correct, it just seems to be some random ones that do not get the url key of the first parent (category).

It seemed that initially they all were using the last, so i switched the order to be reversed.

This fixed most all of them, but ones that are set up pretty much the same, and should have the same parent url key, are randomly using one of the other categories as a URL key.

I tried deleting everything (Products and Categories), cleared my cache storage.
Checked that the URL Rewrites were removed, and tried importing again.

I get the same result.

The does not seem to be any ties to visibility, as one which is incorrect is set to 4, and another is 1 (which i would expect 1 to be erroring if either of the two.)

I have most of the categories inactive, I want to roll out additional categories after launch.

I would think it would take preference to the visible categories, but the one i want to to show up in is visible, and it gets placed in an inactive one.

I am not sure what else may cause this.
Or where else to look for the problem. I do not see anything that would indicate why those specific products are different. But each time I import, the same ones fall into the wrong category.

Any help would be greatly appreciated. If someone could at least point me in the right direction.

I can give more specific examples if required, I didn't want to confuse things more than this already is.


texts:
In my view.phtml i have called the estimate shipping price by this:

<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>

But when I clicked to get a Quote for shipping nothing works and the price for shipping is not showing .Can anyone help me please. IF I am doing any wrong or something is not enable in backend


texts: Magento Patch 9767 "Decoding failed: Syntax error"

texts:
I am running EE 1.14.0.1 and PHP 5.6 and got below error on production server only. I cleared the cache and implement the solutions suggested by  @folektoras133 at Security Patch SUPEE-9767 - Possible issues?. nothing worked. Any suggestion ?

a:5:{i:0;s:29:"Decoding failed: Syntax error";i:1;s:1397:"#0 //htdoc/app/code/local/Enterprise/PageCache/Model/Observer.php(178): Zend_Json::decode('a:0:{}')
packet_write_wait: Connection to 52.26.63.162 port 22: Broken pipegeCache/Model/logouter.php(214): Enterprise_PageCache_Model_Observer->_loadDesignExceptions()
Saving session.../htdoc/app/code/local/Enterprise/PageCache/Model/...copying shared history...e_PageCache_Model_Observer->_saveDesignException()
...saving history...truncating history files...core/Mage/Core/Model/App.php(1339...completed._PageCache_Model_Observer->cacheResponse(Object(Varien_Event_Observer))
[Process completed]#4 //htdoc/app/code/core/Mage/Core): Mage_Core_Model_App->_callObserverMethod(Object(Enterprise_PageCache_Model_Observer), 'cacheResponse', Object(Varien_Event_Observer))
#5 //htdoc/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_fron...', Array)
#6 //htdoc/app/code/core/Mage/Core/Controller/Varien/Front.php(182): Mage::dispatchEvent('controller_fron...', Array)
#7 //htdoc/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#8 //htdoc/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 //htdoc/index.php(90): Mage::run('', 'store')
#10 {main}";s:3:"url";s:161:"/product_page?utm_source=google_shopping&gclid=CjwKEAjwgtTJBRDRmd6ZtLrGyxwSJAA7Fy-hBnSgpddfHXC9mP9HkKPPk3WbbtZfbd7voy-K2NSd5BoC0eLw_wcB";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}


texts:
Data is not fetching get customer id null.?
Please review my code.
Here's my code:

/**
 * Collect grand total address amount
 *
 * @param \Magento\Quote\Model\Quote $quote
 * @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
 * @param \Magento\Quote\Model\Quote\Address\Total $total
 * @return $this
 */
protected $quoteValidator = null;

protected $rewardspointCollectionFactory;

public function __construct(
        \Magento\Quote\Model\QuoteValidator $quoteValidator,
        \Sugarcode\Test\Model\ResourceModel\Fee\CollectionFactory $rewardspointCollectionFactory
        ) {
    $this->quoteValidator = $quoteValidator;
    $this->rewardspointCollectionFactory = $rewardspointCollectionFactory;
}

public function collect(
\Magento\Quote\Model\Quote $quote, \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment, \Magento\Quote\Model\Quote\Address\Total $total
) {
    parent::collect($quote, $shippingAssignment, $total);

    $exist_amount = 0; //$quote->getFee();
    $fee = 10; //Excellence_Fee_Model_Fee::getFee();
    $balance = $fee - $exist_amount;

    $total->setTotalAmount('fee', $balance);
    $total->setBaseTotalAmount('fee', $balance);

    $total->setFee($balance);
    $total->setBaseFee($balance);

    $total->setGrandTotal($total->getGrandTotal() + $balance);
    $total->setBaseGrandTotal($total->getBaseGrandTotal() + $balance);

    return $this;
}

protected function clearValues(Address\Total $total) {
    $total->setTotalAmount('subtotal', 0);
    $total->setBaseTotalAmount('subtotal', 0);
    $total->setTotalAmount('tax', 0);
    $total->setBaseTotalAmount('tax', 0);
    $total->setTotalAmount('discount_tax_compensation', 0);
    $total->setBaseTotalAmount('discount_tax_compensation', 0);
    $total->setTotalAmount('shipping_discount_tax_compensation', 0);
    $total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
    $total->setSubtotalInclTax(0);
    $total->setBaseSubtotalInclTax(0);
}

/**
 * @param \Magento\Quote\Model\Quote $quote
 * @param Address\Total $total
 * @return array|null
 */

/**
 * Assign subtotal amount and label to address object
 *
 * @param \Magento\Quote\Model\Quote $quote
 * @param Address\Total $total
 * @return array
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total) {

    $rewardspointCollection = $this->rewardspointCollectionFactory->create();
    $customerId = $quote->getCustomerId();

    $rewardspointCollection->addFieldToSelect('*')
            ->addFieldToFilter('dukaaniatest_id',$customerId);
    if(count($rewardspointCollection) > 0){
       $firstItem =  $rewardspointCollection->geFirstItem();

       return [
        'code' => 'fee',
        'title' => $firstItem->getData('title'),
        'value' => $firstItem->getData('author')
    ];
    }else{
        return [
        'code' => 'fee',
        'title' => 'Fee',
        'value' => '0',
    ];
    }

}

/**
 * Get Subtotal label
 *
 * @return \Magento\Framework\Phrase
 */
public function getLabel() {
    return __('Fee');
}

}


texts: Add Category tree, if not exists programmatically

texts:
Ive been through several answers before succumbing to ask a question. I will list what i tried and why i think this is a bit of a special case, and not a duplicate.

Am reading a .csv file from my customer. Each product has 3 fields for the category (among other fields, sku, name, weight etc).

[ParentCategoryType] => CLOTHING
[ParentCategory] => SHIRTS
[Category] => SHIRTS CASUAL
[Gender] => MEN

What I want is to create the category if it does not exist, in the tree.
I.e. The current item's tree is

Men/Clothing/Shirts/Shirts Casual

but there is also a similar category starting with Women/Clothing/Shirts/Shirts Casual

I would like to check if given the current tree, there is such a category and if not add it. I realize maybe this will need to be recursive, so it can add the categories in between. For example maybe Men/Clothing/Shirts doesn't exist, and needs to add Shirts, and then Shirts Casual

I tried:

This answer here , which causes error 500
This answer here, which kinda works (it adds a category so if i recurse my list maybe ill manage) BUT this seems messy and maybe does stuff it doesn't need.
and many other similar, others being very vague and others outdated.

tl;dr

Given the string Men/Clothing/Shirts/Shirts Casual

I want to create the tree accordingly, so when given Men/Clothing/Pants, only pants should be created, and when given Women/Clothing/Shirts/Shirts Casual, another tree with root Women is created


texts: Magento 2 : How can I properly calculate FPT/WEEE on configurable products?

texts:
I already made a ticket for this on the official repository (https://github.com/magento/magento2/issues/4774), but their response was they would not implement it anytime soon. So that's why I ask my question here:

How can I calculate the FPT properly on configurable products?

Currently, in Magento 2(.0.7), when you apply FPT to a configurable product, the FPT on it's child-products is not taken into account. For example: say you got a refrigerator with a WEEE Tax of $1, and it comes in various sizes which makes the WEEE Tax of it's simple products $2, $3 and $4 respectively, it's not taken into account. Whatever you pick, Magento will take the WEEE of $1 of the configurable product.

Now I'm trying to alter this behaviour but without any luck. I tried events/observers on the add to cart events to manipulate the FPT, but without success. I tried to write a plugin that wraps itself around \Magento\Weee\Model\Tax::getProductWeeeAttributes, and this kind of works, but as soon as you add 2 configurable products that are the same ID, I just can't get the calculation right anymore.

Does anyone have any ideas/thoughts that can point me in the right direction?

Edit: In the meanwhile I figured it out, so I wrote an article about it.


texts: Magento1.9 : How to add Captcha to custom form

texts:
I have created a cms page named "custom" ad this page has content {{block type="core/template"  template="my/custom.phtml"}}. And in custom.phtml created a custom form with custom validation and custom controller action for submission.

Now I want to add captcha to this form.

For this I have added below xml script to cms xml field :

<reference name="content">
    <!-- Code Start For Display Captcha -->
    <block type="captcha/captcha" name="captcha">
            <reference name="head">
                <action method="addJs"><file>mage/captcha.js</file></action>
            </reference>
            <action method="setFormId"><formId>form-validate</formId></action>
            <action method="setImgWidth"><width>230</width></action>
            <action method="setImgHeight"><width>50</width></action>
    </block>
    <!-- Code End For Display Captcha -->

</reference>

And <?php echo $this->getChildHtml('captcha'); ?> on custom.phtml file.

But captcha not appearing on page.

How to resolve it?


texts:
I got this file:

  /magento/vendor/magento/module-backend/view/adminhtml/templates/widget/button.phtml

I have put it there:

  /magento/app/design/adminhtml/UV/bgn_medienshop_2017_admin/Module_Backend/templates/widget/button.phml

Now it should always take the .phml in my design but it doesn't. Did I place it at the wrong position?


texts: Is enabling Magento 1.7 compilation worthwhile?

texts:
I'm trying to speed up my Magento 1.7 installation until we can migrate it over to 2.3. One of the recommendations I've seen is to enable Magento Compilation i.e here. However, on SO I saw that it isn't recommended anymore. SO
So should I use it or not?


texts: How can I disable customer registration via website. But the admin is capable of inserting new users via the admin panel?


texts: Undefined variable: Blocks/product/product.phtml issue

texts:
I have a problem with Magento 1.9.2.4, I can't figure out how to fix it:

  2017-07-13T18: 37: 13 + 00: 00 ERR (3): Notice: Undefined variable:
  _link in /var/www/html/xxxxxxx.it/app/design/frontend/intenso/petmuffin/template/aw_autorelated/
  Blocks/product/product.phtml on line 55

Thank's


texts: how to add bundle products in cart without specify options

texts: I created the bundle product and have two options but i want customer can add bundle products without specify options. Is that possible?