texts: I have many problems in magento 2.3.2 version

texts:
before I have configured the version 2.3.1 and I upgrade it to 2.3.2 version, but now have this problem, when I click the option view in orders, in the developer mode, it throws me attached message.

When I change to production mode, it ignores the Exception but the information in order doesn't appear correctly.


texts: Update Product Attribute based on Stock Levels [Magento 1.9]

texts:
I am trying to have two out of my Product Attributes updated once the Stock Level reaches 0, or goes above 0.

Would this be possible ?

Thanks


texts: Magento 2 - Override Swatches renderer.phtml

texts:
I would like to override file :

app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml

In my own theme :

app/design/frontend/[VendorName]/[theme]/Magento_Swatches/templates/product/layered/renderer.phtml

It does not work. Is it a path problem?
Do I copy it in the right place?

I followed this instruction but I think something is wrong for file I want to override :
Magento 2 - Override base view file

Thank you in advance for your support.

I'm on Magento 2.3.1

Best regards,
Florian


texts: Magento 2: Set product dropdown attribute

texts:
I want to set a value to a dropdown attribute.

I try to use $product->setSize("M") but it is set to null.

Do I need to create the option of dropdown attribute ?


texts:
Can anyone explain me what does the below coding mean?

$html = array();
$combineClasses = array();

    $combineClasses[] = 'level' . $level;
    if ($this->_isCurrentCategory($category)) {
        $combineClasses[] = 'active';
    } else {
        $combineClasses[] = $this->isCategoryActive($category) ? 'parent' : 'inactive';
    }
    $levelClass[] = implode('-', $combineClasses);

    if ($category->hasChildren()) {
        $levelClass[] = 'has-children';
    }

    $levelClass = array_merge($levelClass, $combineClasses);

    $levelClass[] = $this->_getClassNameFromCategoryName($category);


texts:
Today I finally was able to migrate magento.

Now, I wanted to check out the admin dashboard and for some readon, URI is being duplicated:

https://server.com/storename/admin/admin/index/index/key/22bc84d074958907a7499f...

I already tried:

  bin/magento --backend-frontname=admin

But the result is the same.

The rest of the store (so far) seems to be working without problems.


texts: Collection with custom data not filtering

texts:
Hi guys i have a collection in which i add custom data to. I am then trying to filter the collection by one of the original fields but it doesn't seem to work.

Here is my collection building code:

$collection = $this->getCollection();
$collection->getSelect()->join(
    'sales_flat_order',
    'sales_flat_order.entity_id = main_table.magento_order_entity_id',
    array('increment_id')
);

foreach($collection->getItems() as $item){
    $status = $this->getState($item->getId());
    $item->addData(array('response_state' => $status));
 }

return $collection;

This builds the collection successfully but when i try to use addFieldToFilter() to the collection it doesn't filter at all.

Here is the filter code:

->addFieldToFilter('is_successful', array('eq' => $value));

Anyone know why and how i can get this to work? Cheers


texts:
We have a business requirement wherein, a collections of products will use "shipping method A" and a "payment method A". While a certain other collection of products will follow "shipping method B" and "payment method B".

In order to prevent buyer from adding products from both the collection to a cart together, we are evaluating creating a new website (or a store).  This would be to ensure that products from both the stores do not show together.

Other than shipping and payment, the list of extensions for the second shop are also very different from the first shop.

What would be the best option for achieving this functionality ? Should we set up a new website or just a new store for this ?


texts: Adding a nav item via XML puts it in the UL but not the correct css classes. How can I add css in my xml?

texts:
<block class="Magento\Framework\View\Element\Html\Link\Current" name="nav.sitehome">
<arguments>
<argument name="label" xsi:type="string">Link Name</argument>
<argument name="path" xsi:type="string">link url</argument>
</arguments>
</block>

I successfully added a url to my top nav but no of the sequential css came with it. How can I add the correct classes so they end up inline with the other items?


texts: Magento2: How to change the content in the block

texts:
I can not find any way to change the text in this block when logging in.

does anyone know how I can change this content?


texts: How to show images on frontend for custom module?

texts:
I have a form in my custom module with all the fields saved in the database table,
now I have a created an image upload form in the next section of the tab which saves the data in the different table from the above mention table.

I have successfully uploaded the image from the backend, and now I want to show those images in frontend.

I have searched the internet for quite a long time but I didn't get how can I show those images.

I showed all the content of the first table on frontend but I have no idea how to do that for the images. Please someone help me with this.

EDIT

Here is my controller save function

public function saveAction()
   {
     if ($this->getRequest()->getPost())
     {
       try {
             $postData = $this->getRequest()->getPost();
     $articleModel = Mage::getModel('blog/article');
     $imgFilename = NULL;

    if($_FILES['image']['name'] != '')
      {
                try {
                     $uploader = new Varien_File_Uploader('image');
                     $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
                     $uploader->setAllowRenameFiles(false);
                     $uploader->setFilesDispersion(false);
         $uploader->setAllowCreateFolders(true);
                     // Set media as the upload dir
                     //$media_path  = Mage::getBaseDir('media') . DS;
         $media_path = Mage::getBaseDir('media') . DS . 'blog' . DS;
                     $imgFilename = $media_path . $postData['image'];
                     // Upload the image

                     $uploader->save($media_path, $_FILES['image']['name']);
                    }
                 catch (Exception $e)
        {
                     Mage::log($e);
                     $this->_redirectError(502);
                    }
        $data['image'] = $_FILES['image']['name'];
              }
     else
      {
        if(isset($data['image']['delete']) && $data['image']['delete'] == 1)
         $data['image'] = '';
        else
        unset($data['image']);
      }
        $imageModel=Mage::getModel('blog/image');

                if( $this->getRequest()->getParam('id') <= 0 )
                  $articleModel->setCreatedTime(
                  Mage::getSingleton('core/date')
                        ->gmtDate());
                  $articleModel
                  ->addData($postData)
                  ->setUpdatedTime(
                         Mage::getSingleton('core/date')
                         ->gmtDate())
                  ->setId($this->getRequest()->getParam('id'))
                  ->save();
          $lastid = $articleModel->getId();
        $imageModel->setArticleId($lastid)->setImage($data['image'])->save();

                Mage::getSingleton('adminhtml/session')
                           ->addSuccess('successfully saved');
                Mage::getSingleton('adminhtml/session')
                            ->setarticleData(false);
                $this->_redirect('*/*/');
            if ($this->getRequest()->getParam('back')) {
    $this->_redirect('*/*/edit',array('id' => $articleModel->getId()));
        return;
    }
          }
    catch (Exception $e)
    {
             Mage::getSingleton('adminhtml/session')
                              ->addError($e->getMessage());
             Mage::getSingleton('adminhtml/session')
                ->setarticleData($this->getRequest()
                                ->getPost());
             $this->_redirect('*/*/edit',
                        array('id' => $this->getRequest()
                                            ->getParam('id')));
             return;
            }
          }
          $this->_redirect('*/*/');
        }


texts: Magento 2 get contact-us-info url in admin static block/page?

texts:
how to contact-us-info url add in cms static block in admin

Screen shot:


texts: Magento 2 : make a multiple step register form

texts:
I want to make a multiple-step register form in Magento 2. How can I do it?

Any helps? Thank in advance.


texts: What is Magento Functional Testing Framework (MTFT)

texts:
With the new release of Magento version 2.2.2 in release notes they have mentioned a new feature as Magento Functional Testing Framework (MTFT). What is this framework do exactly?

Is this a option/replacement of phpunit test? Or is this something else? Has any one tried this?


texts:
I'm trying to pass a message from view to layout by using a model.
This does not work when using _redirect();
I know there is a magento core functionality, but I'd like to understand why my custom solution does not work.

$status = Mage::getSingleton('custom/statusobject');
$status ->setMessage('Error:' + $message);

//$status ->getMessage(); Works fine

$this->_redirect('*/*/');

public function indexAction()
{
   $status = Mage::getSingleton('custom/statusobject');
   $status ->getMessage(); // does not exists
}

**** EDIT ****
This does also not work for session

in controller

Mage::getSingleton('core/session')->setError('ERROR');
session_write_close();
$this->_redirectUrl('*/*/');
return;

In my block

$statusobject = Mage::getSingleton('core/session');
$message =$statusobject->getMessages()->getItems();

print_r($message); // empty array

I dont know why my messages are lost after redirect


texts:
I want to create a cronjob that runs jpegoptim and optipng everyday, to optimize images in my Magento install.
I want to run this on my CentOS 7 install.

Therefore I edit /etc/crontab with the following:

0 13 * * * root lockrun -Q -L .lockjpegoptim -- find /media -iname *.jpg -exec jpegoptim --max=90 --strip-all --all-progressive -p {} \; > /dev/null
0 13 * * * root lockrun -Q -L .lockoptipng -- find /media -iname *.png -exec optipng -o7 -preserve {} \; > /dev/null

I want to be sure that this is correct, will this run right?
Is there a way to check if the cron run succesfully?


texts: How to cancel automatically pending order with in 7 days in Magento 1.8.1?

texts: How can I auto cancel pending orders if they are not processed within 7 days?


texts: Magento2:cannot remove 'generated/.htaccess': Permission denied

texts:
From this user  on fresh installation impossible run any command in terminal.
[user@s1 public_html]$ bin/magento c:f
Class Magento\Framework\App\ResourceConnection\Proxy does not exist
[user@s1 public_html]$

When I try delete example generated folder Permission denied:
[user@s1 public_html]$ [fsgroup@s1 public_html]$ rm -rf generated
[user@s1 public_html]$ rm: cannot remove 'generated/.htaccess': Permission denied

When I try add privileges to files/folders:
chown -R www-data:www-data /var/www/magento2/
chmod 777 -R var
chmod 777 -R generated
chmod 777 -R app/etc

also return this user not have  privileges to use this command. How to solve issue and how to give privileges to user?


texts: Fastest way to load category and save programmatically in Magento 2

texts:
I want to load all collection in Magento 2 and save one by one programmatically. is there any faster way to do so.

I tried below code for one category

use Magento\Framework\App\Bootstrap;
include('app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->create('Magento\Catalog\Model\CategoryFactory')->create()->setStoreId(0)->load(17);
$category->save();


texts:
I need to insert some records in custom table as a transaction in product save after observer and do some actions if not all inserted see code below:

//Read rows from uploaded csv file in $sql_str_arr
$conn->beginTransaction();
$sqlStatment = "INSERT INTO `My_Table` (`serial`, `pin`, `product_id`) VALUES "
.implode(',', $sql_str_arr).';';

try{
 $ret = $conn->rawQuery($sqlStatment);
  $conn->commit();
  $qty += count($sql_str_arr);
}
catch(Exception $e)
  $conn->rollback();
  $qty = 0;
}
//Update stock and remove the file

It gives error

  PHP Fatal error:  Uncaught Exception: User Error: Some transactions
  have not been committed or rolled back

What is the error here and How to make it work or even handle the exception log.

Thanks in advance.


texts: Fatal error: Maximum function nesting level of '1000' reached, aborting!

texts:
I get this error on every page if I disable a product while it's in a cart. Only way to fix it is to clear browser cache and cookies.

I know there are already a lot of answers about this saying to increase xdebug.max_nesting_level in php.ini, but I don't have anything xdebug related in php.ini.

vagrant@penn:~$ php -v
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

What should I do?


texts: Purpose of Includes directory in Magento, Shell Directory, Api.php and get.php

texts:
i'm new in Magento, please let me know what is basic purpose on Include directory in Magento and how it's work? and also i want to know about Shell directory, Api php file in root directory of magento and get php file also in root directory. Can anyone explain it's confusing me.

Thanks


texts: Magento 2 how to pass query string to checkout js files

texts:
I'm using magento 2. I need to add some string query in the checkout all .js files.

  ex -
  http://127.0.0.1/Magento-CE-2.1.6/pub/static/version1498714113/frontend/Magento/luma/en_US/Magento_Checkout/js/view/shipping-information.js?ver1.0

i need to add ?ver1.0 last string in the above url


texts: Multi Store RewriteBase Problem (Magento 2.3)

texts:
I am trying to set up a Magento 2.3 CE multi store installation. Most things are working fine:

Default website and magento admin are available on https://a.b.info (/admin_sdgshgd).

I created another website + store view + store and set the base urls to  https://c.b.info. Apache 2 config has been updated and seems to be working fine.

Now to the problem:

The default website (a.b.info) is referencing styles and js with /pub/static/*, so I had to set the RewriteBase to /public/static/ in the .htaccess file in the static folder.

The new website (c.b.info) is using /static/ (without /pub) - so this store works if I change RewriteBase to /static/.

That means, I can have either default and admin, or the new store working correctly, but not both.

I have no clue why the urls are with or without pub on the one hand and I have no idea either, how I could make both sites run correctly while they have different paths.

Here are the vhost configs:

  <VirtualHost *:443>
    ServerName a.b.info
    ServerAdmin info@b.info
    DocumentRoot /var/www/vhosts/b/httpdocs

    ErrorLog ${APACHE_LOG_DIR}/error-magento.log
    CustomLog ${APACHE_LOG_DIR}/access-magento.log combined

    RewriteEngine On

    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/b/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/b/privkey.pem
  </VirtualHost>

<VirtualHost *:443>
   ServerName          c.b.info
   DocumentRoot        /var/www/vhosts/b/httpdocs

   ErrorLog ${APACHE_LOG_DIR}/error-c.log
   CustomLog ${APACHE_LOG_DIR}/access-c.log combined

   RewriteEngine On

   SetEnv MAGE_RUN_CODE "postelhq"
   SetEnv MAGE_RUN_TYPE "website"
   SSLCertificateFile /etc/letsencrypt/live/b/fullchain.pem
   SSLCertificateKeyFile /etc/letsencrypt/live/b/privkey.pem
   Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

And that's the .htaccess excerpt:

<IfModule mod_rewrite.c>
    RewriteEngine On

    ## you can put here your pub/static folder path relative to web root
    RewriteBase /pub/static/  # works with a.b.info
    #Rewritebase /static/ # works with c.b.info

    # Remove signature of the static files that is used to overcome the browser cache
    RewriteRule ^version.+?/(.+)$ $1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule .* ../static.php?resource=$0 [L]
    # Detects if moxieplayer request with uri params and redirects to uri without params
    <Files moxieplayer.swf>
        RewriteCond %{QUERY_STRING} !^$
        RewriteRule ^(.*)$ %{REQUEST_URI}? [R=301,L]
    </Files>

</IfModule>

Any ideas what could have gone wrong?
Thanks,
OG


texts:
I am trying to create few radio buttons for my form and I want the images to render exactly as in the image below.

I did below code but it does not render them from the standard magento form:

$fieldset->addField('country', 'radio', array(
            'label' => Mage::helper('countrymodule')->__('region'),
            'name' => 'status',
            'values' => array(
                array(
                    'value' => 1,
                    'label' => Mage::helper('countrymodule')->__('scotland')
                ),

                array(
                    'value' => 2,
                    'label' => Mage::helper('countrymodule')->__('ireland')
                )
            )
        ));


texts: Update available shipping methods & recalulate tax

texts:
In continuation of my post Add items to cart by link post the other day:
When posting the customer's zip code and getting back the available shipping options, the tax rate is not updated.

Code to update zip code in cart:

include_once 'app/Mage.php';
Mage::app();
Mage::getSingleton('core/session', array('name' => 'frontend'));

$session = Mage::getSingleton('customer/session');

// Change to your postcode / country.
$zipcode = $_POST["ZIPCODENEW"];
$country = 'US';
$shipstate = $_POST["STATE"];

// Update the cart's quote.
$cart = Mage::getSingleton('checkout/cart');
$address = $cart->getQuote()->getShippingAddress();

$address->setCountryId($country)
        ->setPostcode($zipcode)
        ->setRegionId($shipstate)
        ->setCollectShippingRates(true);

$cart->save();

This works as intended, and can be verified with magento's cart page that shipping options were returned. These shipping methods are also available via the method described here.

What this does not do is recalculate tax. If I go to the magento shopping cart and put in a zip code to get the available shipping rates, and use a zip code that falls under a tax rule then tax is automatically recalculated.

Now here's the rub: If I update the totals of an item from my cart (after tax has been applied by the Magento checkout), then the tax total is correctly updated. Additionally, if I get tax from the magento shopping cart, then have my cart change the zip to a non-tax zone (using the above code), the tax is correctly removed.


texts:
I'm creating an e-commerce website and installed a shipping method calling Frenet (a famous shipping method in Brazil), described in this module (https://github.com/FrenetGatewaydeFretes/frenet-magento2).
It worked! But yesterday, all shipping methods stopped showing up at checkout, even the title doesn't appear. Just disappeared.
For solution to this problem, I checked these shipping codes on backend:
Store > Configuration > General > General Store > Configuration > Sale > Shipping methods
And those paths are corectly configured.
Can anybody help me?
The follow link contains the images of my checkout configuration:
https://drive.google.com/drive/folders/1LPJ6YyGS9f5IvIdFDLbrXHiHpYhRAoFu?usp=sharing


texts: Incorrect Shipping charge when Discount Coupon applied

texts:
Preconditions

Magento Version: Magento 2.1.5
We are using table rate method for shipping, below are the value range:

Rate $6.99 for orders up to $12.99
Rate $5.99 for orders above $13 and up to $25.98
Rate $4.99 for orders above $26 and up to $35.98
Free shipping above $35 (using sales rule)

When the subtotal is $19.98, we have shipping rate as $5.99, that is correct. On applying a discount of $9, the amount will be reduced to $10.98 and now the shipping rate should be changed as $6.99(as $10.98 is below $12.99 - 1st rate) but still we could see the shipping rate as $5.99 (second rate).
We did some analysis and found, shipping amount is calculating before applying discount(subtotal) and not for the amount after applying discount(SubtotalWithDiscount).

Steps to reproduce

Add a few products to cart and make the subtotal to reach around $19.
apply discount code 'TEST', this will give -$9.99 as discount amount

Expected result

As per the table rate method for shipping provided above, As the subtotal is less than $10, the shipping amount should be $6.99

Actual result

But the shipping amount calculated is $5.99
We did some analysis and found, shipping amount is calculating before applying discount(subtotal) and not for the amount after applying discount(SubtotalWithDiscount).

Is any other facing the same issue, if so please provide us the solution.


texts: Data migration Tool sales rule actions and condition serialized

texts:
I'm using Magento Data migration tool to migrate Magento 1.9.3 to Magento 2.3.4, everything went fine until I check the log error when I went to checkout page, I found out that in sales_rule table there is a Magento 1 class in Actions Serialized and Conditions Serialized there is a class from my custom extension that has not been converted:

...,{"type":"vendor_module\/rule_condition_product_onsales_onsales",...

I tried to convert it by using Data Migration Tool class-map.xml but still no luck

<rename>
 <from>vendor_module/rule_condition_product_onsales_onsales</from>
 <to>Vendor\Module\Model\Rule\Condition\Product\Onsales\Onsales</to>
</rename>


texts: Magento 2, Dynamic add or refresh block in sale order page

texts: Using Magento 2, Sale-Order, Block info + history. How to refresh block in sale order page after summit comment successful. In image below I need refresh "block comment preview" after block comment reload or comment has been submitted success.


texts: Magento2 Observer Calling Multiple Times

texts: In magento2 i am using almost 20 modules of thirdparty. I have one observer for sales_order_save_after which is calling by different modules. But when i print the log or when i checked my database the same file is calling 5 times. In database as well it is inserting multiple records. How can i restrict the observer execution?


texts:
I have recently setup a new international store with english product titles, whereas my product titles are originally in danish. Now I need to regenerate all URLs for this store view, to use the english title instead of the old danish ones that are currently.

I order to do this, I guess I have to remove all existing URLs from this store and let magento create new ones. But what is the easiest way of doing this for around 2k products?

Thanks!


texts: XML Sitemap and RSS / Atom feeds extension

texts:
could someone recommend me a Magento extension which would be capable of generating both - XML Sitemaps and RSS (or Atom) feeds and fully comply with recently published Google's best practices for XML Sitemaps and RSS/Atom feeds:

http://googlewebmastercentral.blogspot.com/2014/10/best-practices-for-xml-sitemaps-rssatom.html

Additionally, the extension should have options of splitting generated XML sitemaps, pinging search engines and would respect canonical versions only (meaning that only those should be included in generated files). These are the main requirements, at this moment.

I'd consider all options as my own attempts to find such extension (or even combination of several) weren't successful.

Thanks in advance!


texts: Magento 2 get hidden image programmatically

texts:
I have a custom module for exporting links of my product images.

With this code:

public function getImageAttributes()
    {
        $attributes = [
            'thumbnail' => 'Thumbnail',
            'image' => 'Base Image',
            'small_image' => 'Small Image',
        ];

        return $this->customizeArray($attributes, ExportProduct::PREFIX_IMAGE_ATTRIBUTE);
    }

I have the option to choose which image(thumb or base or small) to call

And with this code:

public function getGalleryAttributes()
    {
        $attributes = [
            'image_1' => 'Image 1',
            'image_2' => 'Image 2',
            'image_3' => 'Image 3',
            'image_4' => 'Image 4',
            'image_5' => 'Image 5',
        ];

        return $this->customizeArray($attributes, ExportProduct::PREFIX_GALLERY_ATTRIBUTE);
    }

I have set another option if I want to take links by images place(slot 1,2 etc.)

I want to do the same but with hidden images of my products.

To call the link of the hidden image only

Any help please?


texts:
I have created rule 50% discount. When buying product it does apply discount on the price but it does not showing that discount amount on checkout.
I tried to do my research and I found that I need this in my code:

  /vendor/magento/module-sales-rule/view/frontend/layout/checkout_cart_index.xml

<item name="discount" xsi:type="array">
   <item name="component"     xsi:type="string">Magento_SalesRule/js/view/cart/totals/discount</item>
   <item name="config" xsi:type="array">
    <item name="title" xsi:type="string" translate="true">Discount</item>
   </item>
</item>

And I do have this in my code. Please, help me print out the discount amount from the catalog price rule as I am obligated to show the discount in my order and invoice email and pdf. Right now the discount amount is showing 0%, but it is set to be 50%.

Please help.


texts:
I need to change the price format in product page, i already try to do this

# vendor/magento/zendframework1/library/Zend/Locale/Data/vi.xml
<symbols numbersystem="latn">
 <decimal>.</decimal>
 <group>,</group>
</symbols>

# vendor/magento/framework/Pricing/PriceCurrencyInterface.php
const DEFAULT_PRECISION = 0

# vendor/magento/module-directory/Model/Currency.php
return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);

# vendor/magento/module-sales/Model/Order.php
public function formatPrice($price, $addBrackets = false)
{
    return $this->formatPricePrecision($price, 0, $addBrackets);
}

And this work for most of my site. like category page & order & cart & checkout
but it wont work with product page.

can u help me with that please ?


texts: Ubuntu 18.04, xampp : php shell command using base php version instead of xampp php version 7

texts:
on base ubuntu Iusing php5.6
on xampp using php7 for M2
when run command

php bin/magento setup:upgrade

giving error:

Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html

How to point to xampp php


texts: Remove left nav from single category page

texts:
I am looking to remove the left hand navigation from the top level category pages. I attempted the following xml in layout updates within the category section of admin panel but unfortunately it had no effect.

         <remove name="catalog.leftnav"/>

Here's the catalog.xml reference that I believe calls this nav - I've even tried commenting out the xml but the nav still displays.

              <label>Catalog Category (Anchor)</label>
    <reference name="left_first">
        <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
            <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
        </block>
    </reference>

Can anyone help please?


texts: Is there a way not to loose input form data on php redirect

texts:
I have a webpage with a form when I submit that page I go into a controller...he check the data sent $data = $this->getRequest()->getPostValue();
And if one of the data isn't what I am expecting, i'm redirecting on the same url page with an error message.
$this->messageManager->addError($errorMessage);
return $resultRedirect->setUrl($this->_redirect->getRefererUrl());

This works fine.
But doing this, i'm loosing all the datas registered previously by the user (cause it's like if I was opening the url for the first time obviously).
I'm looking for a way to keep that data in the html so may be there is a different kind of redirect possible ?
To resume : Is it possible from php server side to reload a url  by keeping the input values.


texts: Backend user role not working - Magento 2.1.9

texts:
We can access System>User Role without further problems:

but when we get into any option, either the "Add new Role" or the users "Administrators" or "Dealer" we get this blank form:

instead of the one it should appear:

We get this error on the logs:

Notice: Undefined index: rolename in /vendor/magento/module-user/Controller/Adminhtml/User/Role/SaveRole.php on line 213

This is the function of the line 213:

The line 213 is the 1rst one inside the function: $this->_getSession()->setData(self::ROLE_EDIT_FORM_DATA_SESSION_KEY, ['rolename' => $data['rolename']]);

protected function saveDataToSessionAndRedirect($role, $data, $resultRedirect)
    {
        $this->_getSession()->setData(self::ROLE_EDIT_FORM_DATA_SESSION_KEY, ['rolename' => $data['rolename']]);
        $this->_getSession()->setData(self::IN_ROLE_USER_FORM_DATA_SESSION_KEY, $data['in_role_user']);
        $this->_getSession()->setData(self::IN_ROLE_OLD_USER_FORM_DATA_SESSION_KEY, $data['in_role_user_old']);
        if ($data['all']) {
            $this->_getSession()->setData(self::RESOURCE_ALL_FORM_DATA_SESSION_KEY, $data['all']);
        } else {
            $resource = isset($data['resource']) ? $data['resource'] : [];
            $this->_getSession()->setData(self::RESOURCE_FORM_DATA_SESSION_KEY, $resource);
        }
        $arguments = $role->getId() ? ['rid' => $role->getId()] : [];
        return $resultRedirect->setPath('*/*/editrole', $arguments);
    }

I have run these commands:

rm -rf pub/static/*;
php bin/magento setup:upgrade;
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy;
php bin/magento setup:static-content:deploy es_ES;


texts: Magento2.3.1 IN porto theme product image on detail page not loading

texts:
In magneto2.3.1 - I have used porto theme I notice some images not generated cache inside, I apply all commands on my live site, but not getting any error and also I apply image resize command php bin/magento catalog:images:resize but some images showing but rest of not loading on detail page in console getting image below error :

Failed to load resource: the server responded with a status of 404 ()  pub/media/catalog/product/cache/9d08971813a040f8f96067a40f75c615/p/m/pm0003_5.jpg

if anyone know regarding this type of issue facing reply me


texts:
i have a cms page the url = "home, and the content have the following home contains the following code:

{{block type="irecommend/view" name="product_list_home3" category_id_new="533" template="my/irecommend/home_view.phtml" }}

but the phtml not displaying, anyone know what is the problem?


texts:
I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.

The theme purchased is called Porto and resides in

/app/design/frontend/Smartwave/porto

So I created a directory

/app/design/frontend/Smartwave/porto_child

I then created a theme.xml file with the below contents

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Proto Child</title> <!-- your theme's name -->
    <parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
    <media>
        <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
    </media>
</theme>

I then created a registration.php file

  <?php
      /**
        * Copyright © 2015 Magento. All rights reserved.
        * See COPYING.txt for license details.
        */
       \Magento\Framework\Component\ComponentRegistrar::register(
          \Magento\Framework\Component\ComponentRegistrar::THEME,
          'frontend/Smartwave/porto_child',
          __DIR__
        );

I also created a directory called media and put a preview.jpg in there
now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says

 a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."

  When I SFTP to the directory I see the file!

When I run (on the command line)

mage setup:upgrade

I get a message that says

[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.

Also When i run
 sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child

[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto


texts: Need to apply following patch of total amount including tax in magento 2.2.5

texts:
I am facing issue in cart price rule. I have set the total amount condition as >= 25, but it gets applied for total in cart excl tax & not incl tax.

While debugging I came across following link

https://github.com/magento/magento2/issues/12396

I am using magento ver 2.2.5 (Enterprise)

How can I apply following patch in my magento & then set condition?

The above issue is in new release of 2.2.9 but how can I apply it in my magento 2.2.5


texts: How can I create custom csv from products

texts:
I want to create custom export csv with products information in everyday.

Heads:

1. identifier;manufacturer;name;category;product_url;price;net_price;image_url;description;delivery_cost
2. ABC123;Example Manufact;Example Name;Animal > Anima sub category > Animals;http://example.com/example/example/example-name.html;180;141.73;http://example.com/media/catalog/product/e/g/egb_0356-1_2.jpg; lrem ipsum;990
3. ETC

I think I need a new module and setup a cronjob. Im a beginner, but I can do the instructions. So, how can I create a script runs every day? Please help me with link or codes and instructions.


texts: Magento 1.7: product images showing in localhost but not in server

texts:
After uploading my Magento 1.7 store from localhost to server, some images are not showing in the frontend nor in the backend.

I checked the  property both in localhost and in the server, but they are not the same and I don't understand why, because the code that generates them is the same.

The template I am using is media.phtml under app/design/frontend/default/default/template/design/catalog/product/view/media.phtml , and this is the code generating the image:

    <a href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" rel="grupo">
        <?php
                $_img = 'helper('catalog/image')->init($_product, 'image')->resize(330).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
                echo $_helper->productAttribute($_product, $_img, 'image');
        ?>

But I get the following paths (example):

In localhost (works fine): /media/catalog/product/cache/1/image/330x/9df78eab33525d08d6e5fb8d27136e95/p/l/plancha-de-metacrilato-transparente-cristal-transparencia.jpg
In server (different path without my image): /media/catalog/product/cache/1/image/330x/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg

So as you can see, the two paths are not the same.

Why the piece of code $this->helper('catalog/image')->init($_product, 'image') doesn't return the same in localhost than in the server?

Any help is much appreciated.


texts:
Hi I have a php script that starts like this:

<?php

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

How do I call app/Mage.php from a directory other than root??
i.e I have my script in public_html/shell but app is in public_html/


texts: Magento 2 add Geo Coordinates in Shipping page

texts:
I want to add custom fields (Latitude and Longitude) in Shipping Address page.
I want to add Google Maps in Shipping Page to get Latitude and Longitude values.
I am using Webkul Google Maps Pin Address but it is not functioning properly.
I also request you to share API for saving the geo-coordinates received from Mobile APP.
Please provide me the code required to acheive the required result.


texts: Magento 2 - Full width for a section in product view page

texts:
I add a new block in Product View page:

<referenceContainer name="content">
     <container name="containertwo" as="containertwo" label="ontainer"  htmlTag="container" htmlClass="my-container" after="-">
        <block class="Magento\Cms\Block\Block" name="why-choose" after="-">
            <arguments>
                <argument name="block_id" xsi:type="string">why-choose</argument>
            </arguments>
        </block>
    </container>
</referenceContainer>

Is there any way to made this full width, I mean to be on the entire window not in the page-wrapper?

I try this is CSS but is not work:

.my-container {
    width: 100%;
    max-width: 100%;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    min-height: 100vh;
    background: #666;
}


texts: Hot to add buy now button on product page which will take the customer to checkout page of that product only

texts:
I'm new to Magento. I want to add the buy now button along with the Add to cart button on the product page. I have searched for that, I found this solution :

<button type="button" title="<?php echo $this->__('Check out') ?>" class="button btn-cart" onclick="setcheckoutLocation('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo Mage::getUrl('checkout/onepage') ?>')"><?php echo $this->__('Buy Now') ?></button>

But it add the product to cart and then redirects to onepage and in the checkout process, all the products that are in the cart are added.

Is There any way that the product which we have selected for buy now will only be added to the checkout process regardless of products in the cart. Thanks in advance.


texts: How to get Product details in magento observer (Order Save)

texts:
i am trying to get all the product in a order. i have the order details in my observer but i don't know how to get the product details from it. i have the following coding in my observer

public function getProducts($observer){
 $order = $observer->getEvent()->getOrder();
 $data = $order->getData();
 $dumpFile = fopen('observer_working.txt', 'w+'); // file is creating
 fwrite($dumpFile, 'Sample text');
 return $this;
}

As you can see i am creating a txt file when order is placed. and it is working. and i have the order details also. but i am unable get the product id from it.

i need following data from the order details

1) Order id.

2) array of product id which is available in the order. (only product id is enough)

please help me to get those data.


texts: Magento2 Product Page 404 Error Caused by URL Rewrite Not Working As it Should

texts:
We have a 404 issue on all product pages. Category pages showing fine as they should. Having imported circa 4000 products directly into our Magento2 store database and uploading images directly to the media folder, I realise we have omitted the correct steps for Magento2 in that we have not used the inbuilt import function. Thus the URL rewrite function has not ran.
When we create a new product manually from the Magento admin, the same issue occurs though. We have a 404 error in the frontend for the URL that is created. We can see the URL's are creating in the catalog_url_rewrite_product_category and url_rewrite tables.
We have re-ran below list of queries on command line to try to rectify:
php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy en_US en_GB

php bin/magento setup:upgrade

php bin/magento cache:clean

php bin/magento cache:flush

And reset permissions as per below guide:
Magento 2 folder/file permissions
We are running the latest version of Magento 2.1.6 having upgraded recently to see if this solves the issue.
My feeling is that there is something corrupt in the database, but unsure how to debug further. And/or it's a permission issue as our cron is not running currently too which is another issue we are looking to fix today.
Any help and guidance would be greatly appreciated. Thanks.


texts: Unable to locate block in the layout files

texts:
I need to change some layouts on the product detail page.
So I tried to locate some blocks in the layout files.
Using the template path hints fo example I know about a block with the template catalog/product/view/customize.phtml
But searching the project with PHP Storm for the term customize.phtml just returns cache files.
For example in the cache there's this line:
<block class="Magento\Catalog\Block\Product\View" name="customize.button" as="customize_button" template="Magento_Bundle::catalog/product/view/customize.phtml" after="product.info.price"/>

But i thought there had to be be a layout xml adding this block somewhere.
Just not able to find it using the PHP Storm Search.
Where is this being added to the layout?


texts: Magento 2 optimisation : SQL Seem's ok but its slow

texts:
I have a performance issue with my magento 2 store.

I am using varnish, wish I believe works fine.

Each not cached page take ~~ 3.5 sec up to 5 sec.
(category page, home, product)

Here is my Hardware :

8 cores, 16b ram (Amd opteron)

/dev/sda:
 Timing cached reads:   6710 MB in  2.00 seconds = 3358.52 MB/sec
 Timing buffered disk reads: 326 MB in  3.00 seconds = 108.63 MB/sec

I guess (because I am not 100% sure it's not SSD).

Ofc, I did severals times :

setup:di:compile... static content deploy, mode production

I tried to switch to dev mode then enabled "custom" profiler to see what's going on.
So far, I see 300/querys for a category page, in 300ms.

I believe it's an ok timing.

But if query's take 300ms, why the page takes 4sec to load ?!

What I am missing ?


texts:
I simply want to get the CMS page id from a random url.

So i have a page with the url "Foo/Bar", and I can get the page id for that page using :

$pageId = $this->_request->getParam('page_id', $this->_request->getParam('id', false));

But now i want to have the page_id of "Foo". but ofcourse that is not requested so I can't use the getParam method.

What method should I use to get the page ID from a page where I only know the url of?


texts: Display out of stock options of configurable product

texts:
Greetings to all developers!

I need your help! I am following this tutorial to display out of stock options of my configurable product. What we want to achieve is even when certain sizes of a product are sold out, we want to show that these options are available, but are currently out of stock(and therefore greyed out). By default Magento does not display these options at all. By following the above mentioned tutorial, I am able to show these options, but the problem is I think this bit of code:

  // disable out of stock options
   if(this.getOptionLabel(options[i], options[i].price).indexOf('stock') !== -1) {
      $(element.options[index]).addClassName('disabled');
      element.options[index].disabled = true;
   }
   // END: disable out of stock options

 in the file js/varien/configurable.js

Because out of stock options are not disabled.
Any idea what could be wrong?

BTW I tried to open debugger on my mozilla browser and look into configurable.js, I set up some break points, but execution of the javascript does not stop at my break points, any idea why?

Any help would be much appreciated. Thank you!


texts: Configurable Dynamic Images: Using Multiple Attributes

texts:
I'm using CE 1.9.1 with the rwd theme and am enjoying the power of switching images by clicking on the color swatches. I'm attempting to do something different though.

I have a product available in multiple colors. Aside from that, some colors also come in a striped pattern. (Not all colors come in striped.)

The default product image should show a collection of all the child products. There would be two sets of swatches. Colored, and Text with "solid" and "striped" as choices. When swatch blue is clicked the blue solid image should display and when striped is then clicked, the blue striped image should show. I cannot get this to work.

When I label the images for all the solid as the color name i.e. blue, black, red, They all display as soon as the color swatch is clicked. However, what can I do to get the striped versions to work?

I tried setting an image for the blue striped simple product but this does nothing. If I label this image striped then it will display when the striped swatch is clicked - provided no color swatch was clicked. Once a color swatch is clicked and its solid color is displayed, a click on striped will not change the image. When solid gets clicked though, there is a reaction. The image reverts to the product default.

What is recommended for configurable product images using multiple attributes?

EDIT: The real scenario involves more attributes than just colors. Say size, or even handle type will require different product images.


texts: How to override magento2 product tierprice?

texts:
I want to override magento2 product tier price calcualtion logic for price type 'Percentage'. I would like to calculate the percentage amount in my own way.
Please let me know which file I have to override inorder to achieve this.

Thank you


texts:
The documentation mentions the sort order is always from lowest to highest, except when around plugins are used, then

The around plugin’s method affects the flow of all plugins that are executed after it.

Affects them how? If you have multiple plugins and all of them include around plugins, the order of execution is in fact from highest to lowest for the after plugins. I did an example similar to the ones in the documentation, with a callable included:

PLUGIN1
PLUGIN2
PLUGIN3
PLUGIN4
PLUGIN5
PLUGIN6

sortOrder
10
20
30
40
50
60

before
beforeDispatch()
beforeDispatch()
beforeDispatch()
beforeDispatch()
beforeDispatch()
beforeDispatch()

around

aroundDispatch()

aroundDispatch()
aroundDispatch()

after
afterDispatch()
afterDispatch()
afterDispatch()
afterDispatch()
afterDispatch()
afterDispatch()

Where the execution is: before 122345566 => callback => after 665345212. I'm curious about the 665345 part. It seems that after plugins are executed from highest to lowest if there is also an around plugin, otherwise lowest to highest. Could you explain this behaviour?


texts: Can't apply patch SUPEE-6788 on Magento 1.7.0.2

texts:
I'm trying to apply the SUPEE-6788 patch on Magento v 1.7.0.2
Here is a list of the current patches on the system:

2015-04-28 13:33:57 UTC | SUPEE-5345 | EE_1.12.0.2 | v1 | 2d36f61cf684ed26286b6d10307fcb99dd47ff02 | Thu Feb 5 19:39:01 2015 +0200 | v1.12.0.2..HEAD
2015-04-28 13:34:41 UTC | SUPEE-1533 | EE_1.12 | v1 | _ | n/a | SUPEE-1533_EE_1.12_v1.patch
2015-06-29 09:18:59 UTC | SUPEE-5994 | CE_1.6.0.0 | v1 | _ | n/a | SUPEE-5994_CE_1.6.0.0_v1.patch
2016-04-17 22:32:10 UTC | SUPEE-6285 | CE_1.7.0.2 | v1 | 84749c91e14543e1f96af30e86efdf29f4562c98 | Tue Jun 23 09:48:07 2015 +0300 | c6e6cee8eb..84749c91e1

As you can see I believe I have all the required security patches installed (which were released prior to this one)

However, when I try to do a dry-run, I get the folllowing:
(partial dump)

The next patch would create the file app/code/core/Mage/Admin/Model/Block.php,

which already exists!  Assume -R? [n]

Apply anyway? [n]

Skipping patch.
1 out of 1 hunk ignored

The next patch would create the file app/code/core/Mage/Admin/Model/Resource/Block.php,

which already exists!  Assume -R? [n]

Apply anyway? [n]

Skipping patch.

1 out of 1 hunk ignored
The next patch would create the file app/code/core/Mage/Admin/Model/Resource/Block/Collection.php,

which already exists!  Assume -R? [n]

Apply anyway? [n]

Skipping patch.
1 out of 1 hunk ignored

The next patch would create the file app/code/core/Mage/Admin/Model/Resource/Variable.php,

which already exists!  Assume -R? [n]

Apply anyway? [n]

And so on.

It seems very odd to me.

Can someone assist?


texts: Problem with error Message on Customer Registration

texts:
I have a Magento 2 problem with the registration form. The problem only occurs on my test/production servers (jelastic setup, centos), not on my vagrant machine running an ubuntu server.

Problem is, if a user tries to register using an existing email address and submits the registration form, magento redirects back to the form (POST createPost/ -> create/), but does not load an error message. If the user reloads the same page (GET -> create/) the queued error messages appear. It seems that Magentos quirky javascript refuses to make the call to
"/customer/section/load/?sections=&update_section_id=false&_=..."

if the request was sent by POST. Like already mentioned this only happens on the online servers. Not sure what I can do to fix this or even debug the whole thing.

---Edit---
So far I've figured out it has something to do with the cookie "private_content_version". Unfortunately it is pretty hard to find out where this cookie is set and why Magento is refusing to do so. If the cookie is there, the error messages appear.


texts: How to get product collection with manufacturer attribute filter outside of Magento2?

texts:
I am newbie in Magento 2 I try to get product collection with attribute filter 'Manufacturer'.
I try to implement with below code but not get result-set as per manufacturer filter:-

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

$collection = $productCollectionFactory->create();
$collection->addAttributeToSelect('*');
$collection->getManufacturerName($manufacturer,['eq'=> $manufacturer]);
$collection->setCurPage(9);
$collection->setPageSize(100);


texts:
I am looking for a FTP avoiding solution to easily upload a file (like a PDF) to a CMS page.

I did find a module for this but $48 for such an easy task is quite a lot.

Isn't there a better way?

Basically you only need to add a uplodify button and past the link into the CMS editor. Maybe someone has extended the editor before and can give me a hint how to do that?


texts: Magento 1.9 URL rewrite reverts default system URL after re-indexing

texts:
I have a problem in Magento 1.9. I have created catalogs and rewrite it to display custom page and product. The rewrites are successful however after re-indexing the default system URL were shown.

These are my steps in URL re-writing:

a. Delete old system URL.

b. Create new URL re-write by selecting custom in the drop-down box.

c. Fill out necessary fields and save.

d. Refresh Magento cache.

The problem is that when I try to re-index, the system URL reverts back.
My question is why is it that the old system URL reverts back? and how can i fix this.


texts: Magento : High resolution product image are not displaying on product detail page

texts:
Some product image are not showing on product page. It works fine with low resolution. I don't know what is problem. I have set media folder permission, as well as resize and setQuality function also set but no luck with this.

It's working on my another server but on live it's return blank page. Working resolution are below please check.

It's working fine for 1160px width and 624px height on live but when I upload image with 2331*1247 dimensions, it's not working.


texts: Internal Server Error (500) estimate-shipping-methods

texts:
Im using Magento 2 with Vagrant and I made a custom theme. Everything works fine except When I add a product to cart and go to Shipping (1st step in checkout) the page loads but when Shipping method tries to load I get error:

  POST http://shop.local/rest/default/V1/guest-carts/ea67f279a751134f7cc2082409178ac7/estimate-shipping-methods 500 (Internal Server Error)

And in response I get:

"message": "Each getter must have description with @return annotation. See Magento\\Quote\\Api\\Data\\AddressInterface::getStreet()",
"trace": "
    #0 /var/www/shop/vendor/magento/framework/Webapi/ServiceInputProcessor.php(161): Magento\\Framework\\Reflection\\TypeProcessor->getGetterReturnType(Object(Zend\\Code\\Reflection\\MethodReflection))\n
    #1 /var/www/shop/vendor/magento/framework/Webapi/ServiceInputProcessor.php(322): Magento\\Framework\\Webapi\\ServiceInputProcessor->_createFromArray('Magento\\\\Quote\\\\A...', Array)\n
    #2 /var/www/shop/vendor/magento/framework/Webapi/ServiceInputProcessor.php(119): Magento\\Framework\\Webapi\\ServiceInputProcessor->convertValue(Array, 'Magento\\\\Quote\\\\A...')\n
    #3 /var/www/shop/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(101): Magento\\Framework\\Webapi\\ServiceInputProcessor->process('Magento\\\\Quote\\\\A...', 'estimateByExten...', Array)\n
    #4 /var/www/shop/vendor/magento/module-webapi/Controller/Rest.php(299): Magento\\Webapi\\Controller\\Rest\\InputParamsResolver->resolve()\n
    #5 /var/www/shop/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n
    #6 /var/www/shop/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n
    #7 /var/www/shop/vendor/magento/framework/App/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n
    #8 /var/www/shop/vendor/magento/framework/App/Bootstrap.php(258): Magento\\Framework\\App\\Http->launch()\n
    #9 /var/www/shop/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n
    #10 {main}"

NOTE: Sometimes it is AddressInterface::getRegionId()

I went to check the annotations and they are there. I tried to google this problem and found out that Zend Opcache can cause this problem but I already had it disabled. I have PHP version 7.0.6

I also tried to remove Shipping methods same thing (using only Free shipping, rest are disabled).

What else could it be? What am I missing?


texts: Magento trying to get rid on horizontal line on topmenu of default theme

texts: I've spent hours trying to get rid of this line just above the navigation topmenu (Please see screenshot circle in red). I was just wondering if anyone know what I need to do to get rid of this line. Thanks


texts:
I wanted to see if anyone has successfully integrated Magento 2 with a 3rd party CMS yet? If so, was the process easier or more difficult than M1 (taking into account M2's integration API)?

UPDATE:
I found this talk by Alan Kent for integrations: https://www.youtube.com/watch?v=EzFCjglEWsM This is a great general introduction for introductions. But I'd still like to hear from someone who's successfully completed a CMS integration with Magento 2, even if it's WP.


texts:
I need the breadcrumbs to hyperlink the current page i'm in..

For example

Home >> Category >> Product

usually, all parent categories hyperlinked. i wish to have product hyperlinked as well.

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Mage
 * @package     Mage_Page
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Html page block
 *
 * @category   Mage
 * @package    Mage_Page
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Page_Block_Html_Breadcrumbs extends Mage_Core_Block_Template
{
    /**
     * Array of breadcrumbs
     *
     * array(
     *  [$index] => array(
     *                  ['label']
     *                  ['title']
     *                  ['link']
     *                  ['first']
     *                  ['last']
     *              )
     * )
     *
     * @var array
     */
    protected $_crumbs = null;

    function __construct()
    {
        parent::__construct();
        $this->setTemplate('page/html/breadcrumbs.phtml');
    }

    function addCrumb($crumbName, $crumbInfo, $after = false)
    {
        $this->_prepareArray($crumbInfo, array('label', 'title', 'link', 'first', 'last', 'readonly'));
        if ((!isset($this->_crumbs[$crumbName])) || (!$this->_crumbs[$crumbName]['readonly'])) {
           $this->_crumbs[$crumbName] = $crumbInfo;
        }
        return $this;
    }

    protected function _toHtml() {

   $cat_id = "";

   if (Mage::registry('current_product')) {
      $product_id = Mage::registry('current_product')->getId();
      $obj = Mage::getModel('catalog/product');
      $_product = $obj->load($product_id); // Enter your Product Id in $product_id

      if ($product_id) {
         $categoryIds = $_product->getCategoryIds();
         $cat_id = $categoryIds[0];
      }

      $category = Mage::getModel('catalog/category')->load($cat_id);
      $cat_name = $category->getName();
      $cat_url =  $this->getBaseUrl().$category->getUrlPath();
   }

   if (is_array($this->_crumbs)) {
      reset($this->_crumbs);
      $this->_crumbs[key($this->_crumbs)]['first'] = true;
      end($this->_crumbs);
      $this->_crumbs[key($this->_crumbs)]['last'] = true;
   }

   if($cat_id) {
      $this->_crumbs['category'.$cat_id] = array('label'=>$cat_name, 'title'=>'', 'link'=>$cat_url,'first'=>'','last'=>'','readonly'=>'');
      ksort($this->_crumbs);
      $home = $this->_crumbs['home'];
      unset($this->_crumbs['home']);
      array_unshift($this->_crumbs,$home);
   }

   $this->assign('crumbs', $this->_crumbs);
   return parent::_toHtml();
}
}

Thanks


texts: Invalid characters showing in order invoice PDF magento 2.1.9

texts: Invalid characters are showing while converting order to PDF invoice which will affect in print too.


texts: Why cacheable="false" is not recommended on marketplace?

texts:
I have developed a custom module,

If my cache enables dynamic data pages are not on updating every request so I have added cacheable="false" now everything is working perfectly.
XML file : view/frontend/layout/routerid_controller_action.xml

But When I upload the extension on marketplace they are giving cacheable="false" error.

As per Magento's default documentation, if you add cacheble=false in some blocks full page cache mechanism not works. but my point is I have an entirely new page which almost has all the dynamic data then how they are telling for this error.

Also, I have checked the core modules 'module-sales','module-customer' they are also using cacheable="false" in their XML(s)?

I have also tried isScopePrivate=true but it's no longer supports
https://github.com/magento/magento2/issues/3202#issuecomment-253496851

So Please let me know if there is an alternate solution.


texts:
I've observed a strange behavior whereby a customer managed to place three orders in quick succession which had the same order numbers.
Each order was based on the same quote_id which in turn represents the correct reserve_order_id value. The orders were placed at these times:

2014-12-15 16:41:11
2014-12-15 16:43:10
2014-12-15 16:46:39

The first order had the order confirmation email sent to the customer, but the second and third orders did not.
How did each order have the same order number even though the sales_flat_quote table seemingly correctly set the value for reserve_order_id?
P.S. I've noticed this same issue pop up about 2 - 3 times a month, so very rarely (upwards of 800 orders are placed monthly).
Edit 1: As soon as a customer clicks the Place Order button during checkout on our website, the button vanishes & the following loading symbol is displayed:

As such this cannot be as a result of the customer repeatedly hitting the Submit Order button.


texts: Magento 2 - Add foreign key with Existing table using db_schema.xml

texts:
I try to add 2 foreign key to my table using db_schema.xml

<table name="test_table" engine="innodb" resource="default" >
    <column xsi:type="smallint" name="entity_id" identity="true" nullable="false" unsigned="false"/>
    <column xsi:type="smallint" name="id_test" unsigned="false" nullable="false" identity="false"/>
    <column xsi:type="smallint" name="id_user" unsigned="false" nullable="false" identity="false"/>
    <column xsi:type="varchar" name="title" length="255" unsigned="false" nullable="false" identity="false"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="entity_id" />
    </constraint>

    <constraint xsi:type="foreign" referenceId="TEST_TEST_ID_" table="test_table" column="id_test" referenceTable="second_test_table" referenceColumn="entity_id" onDelete="CASCADE"/>
    <constraint xsi:type="foreign" referenceId="TEST_USER" table="test_table" column="id_user" referenceTable="admin_user" referenceColumn="user_id" onDelete="CASCADE"/>
</table>

but always I get this error: " (errno: 150 "Foreign key constraint is incorrectly formed" "

After a lot of try I found that the error is the user_id foreign key, and the error message is :

  Column definition "id_user" and reference column definition "user_id"
  are different in tables "test_table" and "admin_user"


texts: How to display link to Product reviews on category list page

texts:
How can you display links to Product reviews on category list page?  So I have something like this:

I'm working with the new Magento rwd theme and I have the stars appearing fine on the listing page.  I've tried adding the reviews link in template/catalog/product/list.phtml with:

<?php if($_product->getRatingSummary()): ?>
    <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
    <?php if ($this->getReviewsCount()): ?>
        <a href="<?php echo $this->getReviewsUrl() ?>"><?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?>hello
    <?php endif; ?>
<?php endif; ?>

But it is not displaying anything & there are definitly reviews for the products.


texts: How to get Slideshow in category using Custom Layout Update

texts:
I have used this code in Custom Layout Update of specific category

<reference name="content">
        <block type="dynamicslideshow/list" name="dynamicslideshow.list.default">
            <action method="setConfig"></action>
        </block>
</reference>

But It is showing at the end of All Products like this http://prntscr.com/auk8zt

Can anyone help in this?


texts: SOLVED - Magento 2 - Unable to login to admin (no error message) stuck at login screen

texts:
This is not a question but rather an answer to a problem that is pretty old but recurring. I remember struggling on this back in the days when I was setting up Magento 1.9 and it occurred again this time around on Magento 2.1.4. I totally forgot about how I fixed it back then, so this time around I'm documenting my answer here in case someone needs it too.

Problem Statement

Basically, you were setting up your Magento 2.1 store, fulfilled all the server requirements, added SSL, setup your Website, Store and Store View and filled up the store configuration only to realise that suddenly you can't login to the admin panel anymore. There are no errors, nothing in the browser console, neither any problem with the browser Chrome / Firefox. You clear the sessions and cache to no avail too. You found answers that keep pointing back to sessions and cache settings, but you did follow the documentation, and it still doesn't work.


texts: Magento 1.4.1.1 Theme switched 500 (Internal Server Error) in /checkout/cart

texts:
so a couple of days ago i bought a responsive theme for an old website that wanted to go mobile, running 1.4.1.1. It's all working as intended, the theme new responsive theme is only active when on mobile devices, and i can navigate through the page like before. However when i try to add a product to the shopping cart i get the /checkout/cart/ 500 (Internal Server Error). When trying to simply go to a products page i get

  There has been an error processing your request
  Exception printing is disabled by default for security reasons.

The following was in var/report:

a:5:{i:0;s:66:"Invalid method Mage_Catalog_Model_Product::isAvailable(Array
(
)
)";i:1;s:3469:"#0 app/design/frontend/rwd/glamour/template/catalog/product/view.phtml(81): Varien_Object->__call('isAvailable', Array)
#1 app/design/frontend/rwd/glamour/template/catalog/product/view.phtml(81): Mage_Catalog_Model_Product->isAvailable()
#2 app/code/core/Mage/Core/Block/Template.php(212): include('/var/www/efi-es...')
#3 app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/rwd/gl...')
#4 app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#5 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#6 app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Text_List->_toHtml()
#8 app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#9 app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#10 app/design/frontend/rwd/glamour/template/page/1column-view.phtml(23): Mage_Core_Block_Abstract->getChildHtml('content')
#11 app/code/core/Mage/Core/Block/Template.php(212): include('/var/www/efi-es...')
#12 app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/rwd/gl...')
#13 app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#14 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#15 app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#16 app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#17 app/code/core/Mage/Catalog/controllers/ProductController.php(153): Mage_Core_Controller_Varien_Action->renderLayout()
#18 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#19 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(258): Mage_Core_Controller_Varien_Action->dispatch('view')
#20 app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 app/code/core/Mage/Core/Controller/Varien/Front.php(177): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#22 app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#23 app/Mage.php(596): Mage_Core_Model_App->run(Array)
#24 index.php(78): Mage::run('', 'store')
#25 {main}";s:3:"url";s:27:"/las-til-pahaengsmotor.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I tried increasing php_value memory_limit to 512mb in .htaccess, tried copying php.ini.sample to a php.ini file, i tried magento-cleanup and magento-check. Nothing gave me anything except magento-check was confused about my servers phpmyadmin version. I cleared caches a million times and so far, i got nothing.


texts: Magento 2.1 move currency symbol for rich snippets

texts:
All M2 themes I have tested do not have proper structured data/rich snippets.  The currency symbol is in the price span, and gets a warning:

An example: link to snippet
Problem code cleaned up a bit:

    $54.00
    <meta itemprop="priceCurrency" content="USD" />

Error: price   $54.00 (The property $54.00 is not a valid price specification. Find out more about http://schema.org/price.)

If the $ is taken out of $54.00 like this it validates fine:

$
54.00
<meta itemprop="priceCurrency" content="USD" />

But I cannot find which files are creating the price code and which code to change.  What is the best way to validate the structured data?


texts: magento 2 : Place order using REST API and stripe payment method

texts:
We are working on mobile which use magento 2 REST API. In which we are facing issue while try to place order using Stripe payment method. For stripe we are using magenest stripe extension.

REST API call for guest user is :
https://example.com/index.php/rest/V1/guest-carts/aHdNbZDggtknHuhZWwEfQvvHQz8JVZnb/order

Parameter is :

{
  "paymentMethod": {
       "additional_data":{
           "number": "4111111111111111",
           "exp_month": "10",
           "exp_year": "30",
           "cvv": "123",
         }
    "method": "magenest_stripe"
  }
}

Result

{
    "massage" : "No such token: false"
}

So please help us to fix this issue.


texts: Create invoice and shipment in magento via cron based on store view and order age

texts:
I am looking for help setting up a cron job that will look at all orders in all store views that have a status of "pending" created in the past X minutes and create an invoice and a shipment for those orders.

I would like to create the invoice but not create the shipment for one store view, creating the invoice and shipment for all of the others.

I hope this is clear. I have searched and found some examples, but none that apply to this situation.

EDIT:

I have started with this, but it doesn't seem to work yet. Just trying to get all orders that exist as 'pending', create an invoice, and create a shipment:

try {

    $orders = Mage::getModel('sales/order')->getCollection()
        ->addFieldToFilter(
            'status',
            array(
                'nin' => array('complete', 'canceled', 'processing', 'holded', 'fraud'),
                'in' => 'pending',
            )
        )
        ->addAttributeToSelect('*');
}
catch (Mage_Core_Exception $e) {
}

try {

    foreach ($orders as $eachorder) {

        $order = Mage::getModel("sales/order")->load($eachorder->getId());
        if (!$order->canInvoice()) {
            Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
        }
        $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
        if (!$invoice->getTotalQty()) {
            Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
        }
        $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
        $invoice->register();
        $transactionSave = Mage::getModel('core/resource_transaction')
            ->addObject($invoice)
            ->addObject($invoice->getOrder());
        $transactionSave->save();

        $shipment = $order->prepareShipment();

        if ($shipment) {
            $shipment->register();
            $order->setIsInProcess(true);

            $transaction_save = Mage::getModel('core/resource_transaction')
                ->addObject($shipment)
                ->addObject($shipment->getOrder())
                ->save();
        } else {
            throw new Exception("Cant get shipment");
        }

        $order->setState(Mage_Sales_Model_Order::STATE_COMPLETE);
        $order->save();
    }

}
catch (Mage_Core_Exception $e) {

}


texts: Magento 2: Load customer group by customer group name?

texts:
How to load customer group by customer group name in Magento 2?

I am using below code in M1:

$companyClass = 'General';
$groupObj = Mage::getModel('customer/group')->load($companyClass, 'customer_group_code');
echo '<pre>'; print_r($groupObj->getData()); echo '</pre>';

How to get this on Magento 2?


texts: Magento 2.3.2 CE Inconsistent stock status. "In Stock" when OOS and vice versa

texts:
I am having some odd inconsistencies with Magento 2.3.2 when it comes to "Quantity_and_Stock_Status".
I would like to add this to my layered navigation so customers can filter out the OOS but it is misreporting some items as OOS when they are in stock and vice versa.

As you can see from this image, the highlighted item is OOS but is showing as 'In Stock'. I have checked the product details, and it is marked as OOS, so I don't why the stock status is this way. You can also see five items at the bottom that are in stock, but stock status says they aren't. All product details are correct an marked as 'In Stock'. Does anybody know why this may be happening?
I am running in Production, and have reindexed several times.
Any pointers would be appreciated. TIA.


texts: Change breakpoint accordion vs. tabs product data

texts:
I'm struggling with my product tabs. I've that many tabs, that the tabs are wrapped to a new line. For this reason, I would like the breakpoint to change to an accordion from screen__m to screen__l.

I've tried many, many things already, I think it has to do with calling .lib-data-tabs() and .lib-data-accordion() in the correct media selector. But whatever I do, the default Magento breakpoint seems to 'win'.

The strange thing is when I open my site on an iPad it defaults to 'tabs view' in portrait mode. When I do so on Safari, and scale to viewport width < 768px and then back to iPad view, it seems to stay in accordion mode. Leading me to believe that 'both' tabs and accordion styles_l and styles_m are valid, but it simply is the styles_l version that is loaded last, and thus ending up with tabs instead of accordion.

It would seem so easy to fix the breakpoint to 1024 instead of 768, but I'm pulling my hairs out.

Can anyone help?

thx,
Rene


texts:
I sell clothes on my store, I am looking for a way to be able to select multiple options.

For example my client decides to buy a T-Shirt. I would like to display the T-Shirt with the options Red, Green, Blue and then Small Large X-Large. So the client can purchase the product without having to add the products one by one. The client can then just input how many of each and then add to cart.

Anybody know of a module that could achieve this?


texts: Get list of configurable and simple products alongwith some of its attribute values via direct DB query

texts: Get list of configurable and simple products alongwith some of its attribute values like brand-name via direct query to DB


texts: Creating dummy customer in magento 1.9.0.1

texts:
I have very severe issue. In customer module, I can see many dummy entries. on front end we don't have any provision to create customer.

How these customers are created?

Which patch should I apply to prevent it.?


texts: magento 2 - How to create a custom "admin" block and display it on an existing Admin page?

texts:
I need to create a custom "admin" block and display it on any admin "product edit" page in Magento 2.1.x.

But I also want to be able to display it on any admin page, if I need.

Which block classes do I have to extend ? What is the folder structure for admin blocks ?

Any help would be appreciated!


texts: Magento 2 pass php session variable to minicart & hide proceed to checkout

texts:
I would like to pass a PHP session variable flag to mini cart-mixin.js dynamically. I followed the below steps mentioned here using the Config Provider concept I am able to pass variable to only cart page hence for remaining pages the condition is not satisfied facing an issue can any once advise?

Note: I would like to hide proceed to checkout button on cart page.

app/code/Test/Demo/view/frontend/requirejs-config.js

var config = {
    map: {
    '*': {
    'Magento_Checkout/template/minicart/content.html':
    'Test_Demo/template/minicart/content.html'
    }
},
config: {
    mixins: {
    'Magento_Checkout/js/view/minicart': {
    'Test_Demo/js/view/minicart-mixin': true
    }
  }
}

};

app/code/Test/Demo/view/frontend/web/js/view/minicart-mixin.js

define([
    'uiComponent',
    'Magento_Customer/js/customer-data',
    'jquery',
    'ko',
    'underscore',
    'sidebar',
    'mage/translate',
    'mage/dropdown'
], function (Component, customerData, $, ko, _) {
    'use strict';

    var mixin = {
        isButtonEnable: function () {
            console.log("isButtonEnable calling");

            /*You can add your condition here based on your requirements.*/
            //console.log(window.checkoutConfig.session_VIEUserData);
            if(window.checkoutConfig.session_VIEUserData){
                return true; //hide button
            }else {
                return false;  //show button
            }
        }
    };

    return function (target) {
        return target.extend(mixin);
    };
});

app/code/Test/Demo/etc/frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <type name="Magento\Checkout\Model\CompositeConfigProvider">
       <arguments>
           <argument name="configProviders" xsi:type="array">
               <item name="additional_provider" xsi:type="object">Test\Demo\Model\AdditionalConfigProvider</item>
           </argument>
       </arguments>
   </type>
</config>

app/code/Test/Demo/Model/AdditionalConfigProvider.php

<?php
namespace Test\Demo\Model;
use Magento\Framework\Session\SessionManager;

class AdditionalConfigProvider implements \Magento\Checkout\Model\ConfigProviderInterface
{
    /**
     * @var SessionManager
    */
    private $coreSession;

    /**
     * @param SessionManager $sessionManager
     */
    public function __construct(
        SessionManager $sessionManager
    ) {
        $this->coreSession = $sessionManager;
    }

   public function getConfig()
   {
      //$this->coreSession->setVIErequestData(1);  // Set Session Data
      //$this->coreSession->unsVIErequestData();   // Unset Session Data
      //$this->coreSession->getVIErequestData();

      if($this->coreSession->getVIErequestData()){
            $output['session_VIEUserData'] = true;
        } else {
            $output['session_VIEUserData'] = false;
       }
       return $output;
   }
}


texts: Magento 1.9 Modifying Admin Customer Grid

texts:
I am trying to add a column for "trained_in" on the customer admin page inside my magento site.

I have the following code

    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addNameToSelect()
        ->addAttributeToSelect('trained_in')
        ->addAttributeToSelect('*')
        ->addAttributeToSelect('created_at')
        ->addAttributeToSelect('group_id')
        ->joinAttribute('trained_in','')
        ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
        ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
        ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
        ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
        ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');

    $this->setCollection($collection);
    //code from Mage_Adminhtml_Block_Widget_Grid::_prepareCollection()
    //since calling parent::_prepareCollection will render the code above useless
    //and you cannot call in php parent::parent::_prepareCollection()
    if ($this->getCollection()) {

        $this->_preparePage();

        $columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort);
        $dir      = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
        $filter   = $this->getParam($this->getVarNameFilter(), null);

        if (is_null($filter)) {
            $filter = $this->_defaultFilter;
        }

        if (is_string($filter)) {
            $data = $this->helper('adminhtml')->prepareFilterString($filter);
            $this->_setFilterValues($data);
        }
        else if ($filter && is_array($filter)) {
            $this->_setFilterValues($filter);
        }
        else if(0 !== sizeof($this->_defaultFilter)) {
            $this->_setFilterValues($this->_defaultFilter);
        }

        if (isset($this->_columns[$columnId]) && $this->_columns[$columnId]->getIndex()) {
            $dir = (strtolower($dir)=='desc') ? 'desc' : 'asc';
            $this->_columns[$columnId]->setDir($dir);
            $this->_setCollectionOrder($this->_columns[$columnId]);
        }

        if (!$this->_isExport) {
            $this->getCollection()->load();
            $this->_afterLoadCollection();
        }
    }

    return $this;
}

/**
 * override the _prepareColumns method to add a new column after the 'email' column
 * if you want the new column on a different position just change the 3rd parameter
 * of the addColumnAfter method to the id of your desired column
 */
protected function _prepareColumns(){
    $this->addColumnAfter('trained_in', array(
        'header'    => Mage::helper('customer')->__('Trained In'),
        'index'     => 'trained_in'
    ),'name');
    return parent::_prepareColumns();
}

}

However on the front end the column is showing as empty next to each customer but when i dump out the collection it shows ['trained_in'] => 6? A little context :

Trained in was added as a custom attribute inside of magento, and it is also a multiple select field i wish to display.


texts:
I normally use Magmi (CE 1.9.1.0) without issues except on a recent import of new product I'm having trouble with titles not updating.

The weird thing is they show up right in the admin grid, but on the frontend and when clicking on the product (within admin) the titles are incorrect. Of course when I manually save one product in the admin the right title will show (which is a hint) but I have not found out why that is.

I've re-indexed, cleared FPC/cache used Magmi indexer etc. with no luck. It's strange because we imported another set of products after and they updated just fine.

Anyone have a clue?


texts: how to display position number as it is filled in associated products in a GROUP PRODUCT

texts: How to display the POSTION NUMBER as filled in the Associated Products Table, i dont wanna use the Count function, as it gives me Serial Numbering, i want it to display the same number FILLED in the position Coloum.


texts: Showing Actual Price of the simple product instead of the lowes from Configurable set

texts:
Hello I need to show the actual price of the simple which belongs to currently viewed category instead of showing the lowest price of the configurable.

For example I have one configurable called A and 3 simples of that called B C D .

B-> belongs to Dresses -> trousers -> Man Category
C-> belongs to Dresses -> trousers -> Woman Category
D-> belongs to Dresses -> trousers -> Children Category

B -> 200
C -> 300
D -> 400

When I go to Man Category I want to show the price of B
When I go to Woman Category I want to show the price of C
When I go to Children Category I want to show the price of D

Currenty all shows 200 as it is the lowest price of the simples of Configurable product A.

How can I code that? Is it a setting or do I need to change some code in category view/list or etc..?

Thanks in advance.


texts:
Whilst browsing the FPC code in Enterprise_PageCache_Model_Processor, I cam e across this method:

/**
     * Check if processor is allowed for current HTTP request.
     * Disable processing HTTPS requests and requests with "NO_CACHE" cookie
     *
     * @return bool
     */
    public function isAllowed()
    {
        if (!$this->_requestId) {
            return false;
        }
        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
            return false;
        }
        if (isset($_COOKIE['NO_CACHE'])) {
            return false;
        }
        if (isset($_GET['no_cache'])) {
            return false;
        }
        if (!Mage::app()->useCache('full_page')) {
            return false;
        }

        return true;
    }

Thus, if I am reading this right, FPC is disabled when in HTTPS?
If a site is only run in HTTPS, is FPC thus pointless/no effect?

I have a site that is only in HTTPS, and FPC writes files to the folder, so what gives? Am I misunderstanding this code?

Anyone shed some light?


texts: Magento 2: Custom category attribute is missing scope

texts:
In Magento 2.2.7 I have created a custom attribute (textarea, wysiwyg) for categories.

This is my InstallData

namespace MyVendor\Mods\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    /**
     * Constructor
     *
     * @param \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function install(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'long_description',
            [
                'type' => 'text',
                'label' => 'Long Description',
                'input' => 'textarea',
                'sort_order' => 5,
                'global' => 0,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => null,
                'group' => 'General Information',
                'searchable' => true,
                'is_html_allowed_on_front' => true,
                'wysiwyg_enabled' => true
            ]
        );
    }
}

The setup works fine, the field shows up in the backend and it saves the data I enter.

There are only two issues here and I sense they are connected:

There is no scope. I cannot save different values for different storeviews. 'global' => 0 behaves identical to \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE, I tried both. The value is always global, no matter what.

2. The value is not stored in the category flat tables. The field long_description does not show up in the flat tables at all.

I copied the field's setup from the catalog module's config for the description field (CategorySetup.php):

'description' => [
    'type' => 'text',
    'label' => 'Description',
    'input' => 'textarea',
    'required' => false,
    'sort_order' => 4,
    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
    'wysiwyg_enabled' => true,
    'is_html_allowed_on_front' => true,
    'group' => 'General Information',
],

What am I missing?

Thank you

EDIT: The attribute shows up in the flat tables after I forced a reindex. I thought the running cronjob would take care of it. Still the scope issue remains.


texts: Magento2.3.5 configurable products not showing out of stock product

texts: I am having issue with showing out of stock products. When all child products of configurable product are out of stock then it donot show out of stock products. If any of them is in stock then it shows all childs (instock & outofstock).


texts: Programmatically check is specific coupon is valid for product

texts: We have a Magento CE 1.9x shop that we developed a message that shows on the product page with a coupon, but we need to ONLY show the message IF the coupon (price rule) IS VALID for that item.  Is there a reasonably simple way to test if the coupon is valid for that item WITHOUT actually applying it?


texts: Magento 1: using Mage::objects() to cache models

texts:
So I found out that in theory, Mage::objects() could be used to cache objects via Varien_Object_Cache.

I noticed that if I run the following:

// Test #1
for ($i = 0; $i < 100000; $i++) {
    $product = Mage::getModel('catalog/product');
}

// Test #2
$productModel = Mage::getModel('catalog/product');
$cache = Mage::objects()->save($productModel);

for ($i = 0; $i < 100000; $i++) {
    $product = Mage::objects()->load($cache);
}

The performance (in both time and memory) is crazy : the first loop takes almost 20 times more time than the second one.

So here's my concern, let's say I have a loop that imports a lot of products like this:

foreach($datas as $data) {
    $product = Mage::getModel('catalog/product');
    $product->addData($data);
    $product->save();
}

Now what if I've added the following to my class:

protected $_productModel;

public function getProductModel()
{
    if (is_null($this->_productModel)) {
        $productModel = Mage::getModel('catalog/product');
        $this->_productModel = Mage::objects()->save($productModel);
    }
    return Mage::objects()->load($this->_productModel);
}

In my loop, let's say I replace:

$product = Mage::getModel('catalog/product');

With:

$product = $this->getProductModel();

So The idea I'm referring to would be to allocate the product class to the object pool from Varien_Object_Cache (accessible via Mage::objects()) so the object from getModel doesn't have to be allocated and destroyed over and over again.

What risks does that imply ?
Is that the proper way of using Mage::objects() ?
What are the limits of Varien_Object_Cache, like can I cache more models such as Mage::getModel('catalog/category') ?


texts: Want to remove "Compare" from my Template?

texts:
I want to remove "Compare Feature" from my Site.  Is this request within scope of Forum ?

Thanks


texts: Not all functions are being called from config.xml

texts:
I have few functions which I want to call from my config.xml, like so:

<firegento_pdf_invoice_edit_page>
            <observers>
                <firegento_pdf>
                    <class>firegento_pdf/observer</class>
                    <method>addInvoiceBarcode</method>
                </firegento_pdf>
            </observers>
            <observers>
                <firegento_pdf>
                    <class>firegento_pdf/observer</class>
                    <method>addBankDetails</method>
                </firegento_pdf>
            </observers>
            <observers>
                <firegento_pdf>
                    <class>firegento_pdf/observer</class>
                    <method>addLogo</method>
                </firegento_pdf>
            </observers>
</firegento_pdf_invoice_edit_page>

The two functions which I've created are addBankDetails and addLogo, they're both in my Observer.php file. I've placed an error log in each function, to check whether they are being called, but only addLogo is being called. I'm unsure what to do to resolve this.

EDIT: Here are the 3 functions I'm using:

public function addInvoiceBarcode(Varien_Event_Observer $observer)
{
    if (!Mage::getStoreConfigFlag('sales_pdf/invoice/order_id_as_barcode')) {
        return $this;
    }
    return $this->_addBarcode($observer);
}

public function addBankDetails(Varien_Event_Observer $observer)
{
    error_log(print_r("addBankDetails", true), 3, '/var/www/html/error.log');
    $page = $observer->getPage();
    $customer = Mage::getModel('customer/customer')->load($observer->getOrder()->getCustomerId());
    $customerGroup = Mage::getModel('customer/group')->load($customer->getGroupId())->getId();
    $allowedCustomerGroups = Mage::getStoreConfig('sales_pdf/firegento_pdf/enable_bank_details');
    $allowedCustomerGroupsArray = explode(',', $allowedCustomerGroups);

    //if the customer is one of the enabled customer groups from the config settings, add the bank details to the PDF
    if (in_array($customerGroup, $allowedCustomerGroupsArray)){
        $bankDetails = Mage::getStoreConfig('sales_pdf/firegento_pdf/bank_details');
        //seperate by newline
        $lineSeperation = 15;
        $textLineArray = explode("\n", $bankDetails);
        foreach($textLineArray as $textLine){
            $page->drawText($textLine, 32, 250 - $lineSeperation, 'UTF-8');
            $lineSeperation += 15;
        }
    }
    return $this;
}

public function addLogo(Varien_Event_Observer $observer)
{
    $page = $observer->getPage();
    $pageHeight = $page->getHeight();
    $pageWidth = $page->getWidth();
    $startWidth = $pageWidth/4;
    $imgPath = Mage::getStoreConfig('sales_pdf/firegento_pdf/factoryx_logo_image');
    $logo = "media/logo/" . $imgPath;
    $logoSize = getimagesize(Mage::getBaseUrl('media') . "logo/" . $imgPath);
    $logoWidth = $logoSize[0];
    $logoHeight = $logoSize[1];
    error_log(print_r($logoHeight, true), 3, '/var/www/html/error.log');
    $customer = Mage::getModel('customer/customer')->load($observer->getOrder()->getCustomerId());
    $customerGroup = Mage::getModel('customer/group')->load($customer->getGroupId())->getId();
    $allowedCustomerGroups = Mage::getStoreConfig('sales_pdf/firegento_pdf/factoryx_logo');
    $allowedCustomerGroupsArray = explode(',', $allowedCustomerGroups);
    //if the image has been uploaded
    if ($imgPath != "") {
        $logo = Zend_Pdf_Image::imageWithPath($logo);
        //if the customer is one of the enabled customer groups from the config settings, add the fx logo
        if (in_array($customerGroup, $allowedCustomerGroupsArray)){
            $page->drawImage($logo, $startWidth, $pageHeight-$logoHeight, $startWidth+$logoWidth, $pageHeight);
        }
    }
    return $this;
}


texts: Magento 1.9 fetch specific cateogry on top level menu in header

texts:
I have added custom attribute for Categories section .I want to fetch specific categories only based on custom attribute value in header .
I want to modify this code :

$this->getChildHtml('topMenu')

$_menu = $this->getHtml('level-top')

I found this method getHtml() , but I am not understanding where  to alter query to get specific categories.


texts: How to add all product to a category at once magento 2

texts: I want to add all website product to a specific categories using database query.anyone?


texts: Magento 2: How to add sub Query on left join

texts:
$collection = $this->rmaLogsFactory->create();
$collection->addFieldToSelect('increment_id');
$collection->getSelect()->joinLeft('rma_log AS arl','main_table.increment_id = arl.order_id AND arl.order_id != "0" AND arl.message_type = "error"',['MAX(arl.created_at)','arl.description']);
$collection->getSelect()->joinLeft('rma_log_details','arl.id = rma_log_details.sync_record_id',['rma_log_details.long_message']);
$collection->getSelect()->where('main_table.status="authorized" AND main_table.failed_retry_count > 0 AND main_table.acumatica_order_id = "" ')->group('arl.order_id');
$this->setCollection($collection);

Above collection return below Query :

SELECT `main_table`.`increment_id`, MAX(arl.created_at), `arl`.`description`, `rma_log_details`.`long_message` FROM `magento_rma` AS `main_table` LEFT JOIN `rma_log` AS `arl` ON main_table.increment_id = arl.order_id AND arl.order_id != "0" AND arl.message_type = "error" LEFT JOIN `rma_log_details` ON arl.id = rma_log_details.sync_record_id WHERE (main_table.status="authorized" AND main_table.failed_retry_count > 0 AND main_table.acumatica_order_id = "" ) GROUP BY `arl`.`order_id`

But I need below query:

SELECT `main_table`.`increment_id`, `rma_log`.`description`
FROM `magento_rma` AS `main_table`
LEFT JOIN `rma_log` ON main_table.increment_id = rma_log.order_id AND rma_log.order_id != "0" AND rma_log.message_type = "error"
LEFT JOIN (SELECT max(created_at),order_id FROM rma_log GROUP BY order_id ) arl ON  rma_log.order_id = arl.order_id
WHERE (main_table.status="authorized" AND main_table.failed_retry_count > 0 AND main_table.acumatica_order_id = "" )


texts: Translating "Please enter your email below and we'll send you confirmation link for it."

texts:
I'm trying to translate the string
"Please enter your email below and we'll send you confirmation link for it."

I've read the article here and adding "\" to confirmation.phtml works indeed.

<?php echo $this->__('Please enter your email below and we\\\'ll send
you confirmation link for it.') ?>

What I don't understand is why with the second option in the article one has to create a new translation file.
I've tried modifying MageCustomer.csv directly but it doesn't seems to work.
Why correcting the MageCustomer.csv by deleting the "\" doesn't work?


texts:
I'm doing some tests in Magento using AJAX and I'm having the following problem:
I want to output periodically some content I've been generating on my php script on my actual page.

So when I click on a Button my js function in my page is called:

page.phtml:

function requestLoop(){

var url = '<?php echo $this->getUrl('mymodule/index/readLine') ?>';

new Ajax.PeriodicalUpdater('Output',url,{
    method: 'post',
    insertion: 'after',
    frequency: 3,
    decay: 2
    });

}

where 'output' is the ID of my table where I want to output my content.
This AJAX request calls my separate php controller file:

   $private static $i=0;
   public function readLineAction(){

    self::$i+= 2;
    $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(self::$i));
    $this->getResponse()->setHeader('Content-type','application-json');
    }

Now I would expect that my

Table displays the numbers 2 4 6 8 ....
But instead I only get 2 2 2 2 ....

So there must be something wrong with either my Request oder my Variable $i.
Can anyone give me an advise?

Thanks in advance


texts: Optimize image on production environment

texts:
Is there any way to Optimize all product images under media folder directly on production server.

I was thinking to do by Gulp or Grunt but both required lots of installation on server which I think would not be the best workaround.

Is there any better solution you guys can suggest me?


texts: How do I get revenue from product ordered report?

texts:
I want to show Revenue from product under Reports> Products> Products Ordered Grid.

I know for the Grid I have to override app\code\core\Mage\Adminhtml\Block\Report\Product\Sold\Grid.php but how do I get revenue for the product.