texts: using data from a collection to find link values

texts:
In, what feels like a never ending quest to teach myself Magento and use it at a practical level I have finally decided that I should dive into the code and learn how individual components are rendered/found (and in doing so cause myself a real headache!).

I have decided to review how a product image is rendered on the catalog list page, or more specifically, how the link is generated to display the required image.

Ive started at template/catalog/products/list.phtml and on line 35 I see a product collection is returned and then on line 52 the required url is echo(ed) using $_product->getProductUrl().

I have gone into a number of the functions to try and understand what is happening in each, some I understand and others I don't. Using var_dump($_productCollection) I tried to find the link in there. Unsurprisingly there was a lot of information (i'm sure it's all very useful, but was lost on me) but no links! Is the array in '_selectAttributes' the answer to finding how the link is generated?

I also noticed '_entityTable' which has the value 'catalog_product_entity' looking in that table has not helped find a connection to catalog_product_entity_media_gallery, which is where I stumbled upon the paths being stored.

My question:

From the information that is provided in the collection how would I track down how the link is being generated?
media/catalog/product/ holds my catalog images, but the folder names are 1-3 and a-z, hence no help in finding required images, is this a database optimisation thing?


texts: Magento 1.9 Paypal opens before Terms and Condition

texts:
I have added Paypal as a payment method to my webshop, and I also have configured my webshop to have customers accept Terms and Condition on checkout page.

The problem is, when customer choose Paypal at Step 5 (Payment Information), and then clicking on Continue button, it opens the Paypal payment window immediately without go to Step 6 where customers need to accept Terms and Condition.

This only happens with Paypal, other payment methods are working fine.

What do I need to do to solve this issue?


texts: Howto add attribute to multiple attribute sets programmatically in magento2?

texts:
Subject. Which classes I need to use to deal with it?

It seems that I don't understand much about how attributes work.

For example I use this code to add attribute to one attribute set and to one attribute group:

/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
$attribute->setAttributeSetId($attributeSetId);
$attribute->setAttributeGroupId($groupId);

Thanks.

UPD:
My problem not in 'how to get attribute set ids', I already have a few. I'm more interesting in the part of code where // add your code here.
I think if we set the value by method $attribute->setAttributeSetId(), it override previous attribute set link in the attribute. I'm trying to find some solution like $attribute->addAttributeSetId() or $attribute->setAttributeSetIds(), but there are none

UPD2:
Found the way: Using \Magento\Eav\Api\AttributeManagementInterface->assign(). Full code in answer below.


texts:
with this code (config.xml on my custom module):

<core>
<rewrite>
    <email_template>Company_Pluginname_Model_Email_Template</email_template>
    <email_template_mailer>Company_Pluginname_Model_Email_Template_Mailer</email_template_mailer>
</rewrite></core>

I override successfully the first model (Mage_Core_Model_Email_Template). But the second, Mage_Core_Model_Email_Template_Mailer not works... why?
Thanks!


texts: Fire Event from Javascript on Product page?

texts:
I currently have a pricing calculation logic being applied when the sales_quote_collect_totals_before event is fired to modify the price depending on options and a few other things. The issue is that right now the price isn't shown to the customer until the item is added to cart (because of the event handler the code is in) but I would like to be able to get the value through an AJAX call from the product page (possibly adding a 'Calculate Pricing' button that would fire the event) and I'm not sure what is the best way to handle this.

My calculation needs all the customisable options selected by the customer in order to properly calculate the price, so an ajax call to a script would work as long as I have access to the choices made by the customer. As a reference, I now have the following bit of code that has all the info I need:

$quote = $observer->getQuote();
foreach ($quote->getAllItems() as $quoteItem) {
    $product = $quoteItem->getProduct();
    $options = $product->getTypeInstance(true)->getOrderOptions($product);

Basically everything from $quoteItem which is a Mage_Sales_Model_Quote_Item object, which also includes the quantity.

Hopefully I'm making the situation clear enough. As a summary this is what I need:

Customer selects a few options on a configurable product
Customer clicks 'Calculate Price' button
AJAX call to a script that receives the product info, including the quantity and all the configurable options selected by the customer
Script calculates the price and returns it to be displayed

Thanks!


texts: What is the difference between getOrigData(); and getData();?

texts:
What is the difference between

$model->getOrigData();

and

$model->getData();


texts: Customers using Cyrillic or Russian alphabet

texts:
I am working on a UK-based site - but we have customers all over the world, including Russia. However, when customers enter their address using the non-latin Russian / Cyrillic alphabet, there are missing characters on the PDF invoice. I expect it's something to do with UTF-8.
Is there a way to show these missing Cyrillic / Russian characters?


texts: JS error with saving admin side form data

texts:
In the custom module with grid i am getting error as following :

TypeError: $.data(...) is undefined

in magento 2 admin form in tab

It was working  perfectly without tab and saving form data in database. But, after this i have added form in tab and m not able to save data. When i am saving or save and continue it's giving error as above.

I am using magento 2.1.6 and also run command php bin/magento setup:static-content:deploy but not working.


texts: Get specific attribute for each product on catalog page

texts:
On catalog page, I want to display custom attribute near each product (e.g. shoes_model). When I try to fetch it:

$_product->getAttributeText('shoes_model'); // returns nothing

... it returns empty value. But when I try to get another attribute, e.g. brand, it returns correct value:

$_product->getAttributeText('brand'); // returns brand name

Can anyone explain why is this happening and how to include custom attribute in catalog products collection.

p.s. Option "Used in Product Listing" is set to Yes for both attributes, and I'm 100% sure that shoes_model is defined.


texts: Dynamic cron schedule based on storeconfig value

texts:
Is it possible to have my module cron schedule set in store config and can be updated by user?

I mean this node:

<schedule>
    <cron_expr>* * * * *</cron_expr>
</schedule>


texts:
I'm new to Magento and trying to edit the success page on 1.9x

All I want is to add payment details for some payment methods.
If the customer selects BANK TRANSFER, I want My_Block to be shown on the success page (these are the bank transfer details 'My bank account #00000')
I would like to apply the same to maybe other payments.

I've tried many statements, but nothing so far.

    <?php if(payment === 'banktransfer'): ?>

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

<?php elseif(payment === 'checkmo'): ?>

<?php echo $this->__('My_block2');?>

<?php else(payment === 'purchaseorder'): ?>

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

<?php endif; ?>

Any ideas on how to achieve this?
Thank you for your help


texts: I am trying to install latest magento2 version(2.4.2) in localhost but it is returning the 404 error, magento 2 root folder xampp/htdocs/m3


texts: Magento 2 get Product Collection creates issue on preparecollection

texts:
I am using Magento 2.2.7. On custom product grid _prepareCollection() I tried to get all product collection by

$collection = $this->_productFactory->create()->getCollection();

but it gets only enabled & in_stock products. If I get count($collection->getData()) it shows all product count. but If I tried with $collection->count() it get only enabled and in_stock product count. How I get all products in grid through $this->setCollection($collection);


texts: magento 2 resource model "save" to implement service contract persistence operations. not saving POST empty

texts:
I have a custom rest api for PUT and POST that the post data is an empty array therefore not saving as it's empty can anyone advise why or what could be wrong?

/**
     * Save data.
     *
     * @param RetailerImageInterface $retailerImage
     * @return RetailerImageInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function save(RetailerImageInterface $retailerImage)
    {
    /** @var RetailerImageInterface|\Magento\Framework\Model\AbstractModel $retailerImage */
        try {
            print_r($retailerImage->getData());
            $this->resource->save($retailerImage);
        } catch (\Exception $e) {
            throw new CouldNotSaveException(__($e->getMessage()));
        }
        return $retailerImage;
}

If I do $this->request->getContent() I can see post data but not through the repository save method.
Has anyone experience this It might be something silly that I'm missing but not sure what it is!
Thanks


texts:
How to disable the Cash on Delivery payment method in backend and frontend Programmatically?

Here the code I'm using:

  etc/di.xml

<type name="Magento\OfflinePayments\Model\Cashondelivery">
    <plugin name="cashondeliveryplugin" type="Xxx\Yyy\Plugin\Model\Cashondelivery" sortOrder="10" disabled="false" />
</type>

Plugin:

public function aroundIsAvailable(
    \Magento\OfflinePayments\Model\Cashondelivery $subject,
    callable $proceed,
    $quote = null
) {
    $result          = $proceed($quote);
    $codAvailability = $this->_pincodeModel->isCODAvailable($quote->getShippingAddress()->getPostcode()) ? "yes" : "no";
    if ($codAvailability == 'no') {
        return false;
    }

    return $result;
}

The actual problem is: the quote is missed when plugin called from the frontend (checkout page).


texts: How to show only USA and Canada in Shopping cart Summary ? - Magento 2

texts:
I'm trying to find a way to show only United States and Canada as options in my Shopping Cart>Summary>Estimate Shipping and Tax select field.

I did many changes in the backend, however, but all the other countries keep showing.

Any help will be appreciated. Thanks


texts:
I am upgrading magento from 1.7 to 1.8. This is the first time I am doing this. Can u tell me how to proceed on this. I had taken db backup using system->tools->backup.

Should I take system backup from there or using the FTP?

Should I use Magento upgrade or ssh(don't know details how to use this, just found some suggestion on Google)


texts: Which file contains info about the header logo?

texts:
Magento is not displaying the header logo no matter what theme I'm using.

I might have commented out or deleted the section in the file, but I forgot and I got lost several times figuring out where it might be in the many sub folders of Magento.

I'm aware that the header info usually is stored in a header.php file and in Magentos case a .phtml file

Maybe I turned off the display inside Magento backend.

I'm new to Magento so I've been lost a few times in the back end.

Can someone please tell me how to bring it back on?

Thanks in advance.

Thomas


texts: “Edit” column in `Promotions->Catalog Price Rules`

texts:
To add an "Edit" column for CMS->Static Blocks I can use:

  $this->addColumn('action',
    array(
        'header'    => Mage::helper('catalog')->__('Action'),
        'width'     => '50px',
        'type'      => 'action',
        'getter'     => 'getBlockId',
        'actions'   => array(
            array(
                'caption' => Mage::helper('catalog')->__('Edit'),
                'url'     => array(
                    'base'=>'*/*/edit',
                    'params'=>array('store'=>$this->getRequest()->getParam('store'))
                ),
                'field'   => 'block_id'
            )
        ),
        'filter'    => false,
        'sortable'  => false,
        'index'     => 'stores',
    ));

But now I want to do the same thing for Promotions->Catalog Price Rule and Promotions-> Shopping Cart Price Rules grids.

I probably just have to change the getBlockId to something else but I don't know how to find the correct function.


texts: 1.9 - Add product to category collection by ID

texts:
I want to add a product to a category page depending on the category ID.  This product is not part of the category.

In Mage_Catalog_Block_Product_List I see the following line:

$category = Mage::getModel('catalog/category')->load($this->getCategoryId());

Would it be possible to have an if underneath? - Is this the right place?

$category = Mage::getModel('catalog/category')->load($this->getCategoryId());
if ($this->getCategoryId() == 123) {
  //add product id 456 to the collection
}

If so, how do I add a product to the $category collection?

And further to this, is it possible to insert it in a particular place, lets say inbetween the 3rd and 4th product?


texts: Magento Database Tables - What are the "pma__" tables?

texts:
I am looking to copy over the catalog from one Magento install to another and I was curious what the pma__ tables are for.

pma__bookmark
pma__central_columns
pma__column_info
pma__favorite
pma__history
pma__navigationhiding
pma__pdf_pages
pma__recent
pma__relation
pma__savedsearches
pma__table_coords
pma__table_info
pma__table_uiprefs
pma__tracking
pma__userconfig
pma__usergroups
pma__users

Are these Magento default tables or from an extension?


texts: Setup Google AdWords Conversion Tracking in Google Tag Manager for Magento 2

texts:
I am new to Magento (Community Edition) and need to setup the AdWords Conversion Tracking in Google Tag Manager. Is there an manual for it? The Google Tag Manager is installed already with MagePal Google Tag Manager and working.

I have already checked the documentation on http://docs.magento.com/m2/ee/user_guide/marketing/google-tag-manager-create-tag.html but it seems to be very old.


texts: Magento site shows error SQLSTATE[HY000]: General error: 5 Out of memory

texts:
One of our store show following error and stop working at all.

SQLSTATE[HY000]: General error: 5 Out of memory

and Mysql / Innodb Error

InnoDB: ERROR: the age of the last checkpoint is 943460

[ERROR] /usr/sbin/mysqld: Out of memory (Needed 27262948 bytes)

Why Magento showing goes down and show this error?

More details (if needed):

At that time error occur online user were 150.

My.ini settings related to innodb are

innodb_file_per_table=1
query_cache_limit =500M
query_cache_size = 96M
innodb_buffer_pool_size = 2048M
key_buffer = 512M
max_allowed_packet = 64M
table_cache = 1024
sort_buffer_size = 4M
read_buffer_size = 4M
query_cache_type = 1
max_connections=500
wait_timeout=120
innodb_additional_mem_pool_size = 20M
set-variable = max_connections=500

Server:

CPU: inter quad core
memory: 4GB
disk: 100GB

OS centOS 6.3
Apache 2.0
PHP 5.3
Mysql 5.0

PS.

As per error ie. trying insert too much data into InnoDB too quickly.

log_visitor_info, log_url_info and log_url are much overwritten.

What if I will change log_visitor_info, log_url_info and log_url storage engine to myISAM will it solve this problem?

is it ok changing of storage engine of these tables?

Thanks in advance...


texts: Magento: Special Product with price input field

texts:
I have a lot of standard products in my magento.

Now i need a special kind of products. Everythink is the same like a stanard product, only hidden price.

Every special product have this formular:

Price: The customer can type the price in the field
URL: The customer can type the URL in the field
Size: The customer can type the size in the field
Color: The customer can type the color in the field

My idea is to use a template for this special kind of products.
Do you have any ideas how i can get this special kind of products?


texts: In Magento1.x we see multiple errors from Amasty SeoShortUrl plugin whenever there is "?___SID=U" in URL

texts:
In error.log & access.log
2021/02/15 11:49:19 [error] 7429#7429: *11059097 FastCGI sent in stderr: "PHP message: PHP

Fatal error:  Call to a member function **getAttributeCode**() on boolean in
httpdocs/includes/src/Amasty_SeoShortUrl_Helper_Attributes.php
on line 119" while reading response header from upstream, client: 152.115.137.98,
server: www.example.com,
request: "GET /herreure?___SID=U HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm/example.sock:",
 host: "www.example.com",
referrer: "https://www.example.com/borneure"


texts: onclick login button results in ajax symbol instead of login to site

texts:
we are creating product programatically once we click on login button.

now we needed to do same after click on register button. so we tried below code, after that now login button is not working , it shows ajax symbol onclick.

template :

<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>

            <?php echo $this->__('Create an Account') ?>

        <form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect1', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'), 'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">
            <?php echo $this->getChildHtml(); ?>
        </form>

<?php endif; ?>

you can see file here


texts: Magento 2: add classes and icons to homepage widget

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

On the home page, I have inserted a "New Products" widget via the Magento admin.

I am using Font Awesome and Bootstrap in my custom theme and I want to take advantage of those, by adding classes and icons to the product boxes in the image below.

I want those "Add to Cart" to have this code:

<button type="submit" title="Add to Cart" class="action tocart btn">
 Add to Cart

</button>

The problem is the HTML editor in the Magento admin does not offer this possibility and I can't find the .phtml template responsible for rendering the widget.

What is a viable alternative to what I did so far?
Is there an alternative to inserting the "New Products" widget via the Magento admin, that would allow me to edit the widget's HTML as detailed as I wish/need? In other words: can I insert the block via some template?

Thank you!


texts:
Magento CE 2.2.4

I want to add product gallery images alongside the main image on the category list & use the default gallery UI component if possible.

I can add the gallery images to list.phtml like so:

<?php $images = $_product->getMediaGalleryImages(); ?>

<?php foreach($images as $child) : ?>

<img class="list-gallery-thumb" src="<?php echo $child->getUrl(); ?>" width="75" height="75" alt="<?php echo $_product->getSku() ?>" />

<?php endforeach; ?>

This outputs the gallery images OK as a simple list, but I'm also looking to include the standard gallery functionality too - so that the fotorama gallery is rendered.

Is it possible to just add the following to catalog_category_view.xml?

 <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Product\Gallery" name="catalog_product_gallery" template="Magento_Catalog::product/gallery.phtml"/>
    </referenceContainer>

If so, how would I reference the the correct $block in list.phtml?


texts: Magento 2: Adding Arbitrary HTML to the  of Every Page?

texts:
In Magento 2, is it possible to add an arbitrary bit of HTML to every frontend/cart page's <head/>?

I know I can add a block to the content/<body> area with code something like this

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="content">
            <block type="Pulsestorm\Test\Block\Head" name="pulsestorm.head" as="pulsestorm.head" template="pulsestorm/head.phtml"/>
        </referenceBlock>
    </body>
</page>

However, it's not clear if there's a similar block for adding content to the <head/> element of a page.    I've looked through the dev docs site and the source code, and there's lots of references to new tags you can use with a <head/> tag

<head>
    <css.../>
    <js.../>
</head>

but I can't find any reference of a way to add arbitrary html/text to the <head/> section of a page in Magento 2.


texts: Magento 1.9: How to show instock items first in product listing even after using sorting

texts:
I am facing an issue in Magento 1.9 where in product listing page every thing is working fine, We have a number of sorting options for products and a paging tab, now our requirement is to show first in-stock items in a list and after that, it should show out-of-stock items if any.

I tried below code in /app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php

public function setCollection($collection)
    {
        $this->_collection = $collection;
        $this->_collection->setCurPage($this->getCurrentPage());

        // we need to set pagination only if passed value integer and more that 0
        $limit = (int)$this->getLimit();
        if ($limit) {
            $this->_collection->setPageSize($limit);
        }
        if ($this->getCurrentOrder()) {
                $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
                $this->_collection->getSelect()
                ->joinLeft(
                            array('sfoi' => $this->_collection->getResource()->getTable('cataloginventory/stock_item')),
                             'e.entity_id = sfoi.product_id'
                             ,array('qty' => 'sfoi.qty')
                         )
                     //->group('e.entity_id')
                     ->order('sfoi.qty DESC');

                //echo $this->_collection->getSelect();exit;

        }
        return $this;
    }

The above code is sorting products first with in-stock but it is having issues -

1- it showing products from out of the category which is not assigned to it.
2- products are sorted as per quantity, so it will change the alignment of products when quantity changed.

Any help will be helpful to me.

Thanks
EDIT
====

After doing R & D , I come to know that if you have allowed products in Backorders then the auto updation by magento to update status to `out of stock` has been stoped, i.e. if a product has been out of stock, magento will still show and keep status `in stock`, so that customers can add them to back orders.

Now my issue is that , I still want to show those products above in a list which is actually are in stock or you can say that greater than 0 in quantity, will any one please let me help on this ,

Thanks


texts: When Product is Disabled it stills hows up in search results

texts:
ISSUE:
[See screenshot]
Despite the status of product being “disabled” in the backend the item is still showing in a search result. No filters are selected in this search. Just hit Go.

When you select Honda as a search filter then hit Go the item doesn't show up which is expected behavior but the first statement the product should not show.

I literally have tried everything from changing the inventory to "0" to changing Global Setting. This is happening to all products in our store.


texts: Get Full Image path on frontend uploaded from custom field in database

texts:
I am struggling with getting the full image path form image uploaded via custom field in backend

I am able to get only the name of the image file, but not the full media path

Here is the form code

  $fieldset->addField('featured_image', 'image', array(
        'name' => 'featured_image',
        'label' => 'Featured Image'
    ));

Here is the saveAction Method

 if ($data = $this->getRequest()->getPost()) {
        $model = Mage::getModel('blog/post');
 /* Code For Featured Image */

 if(isset($_FILES['featured_image']['name']) and (file_exists($_FILES['featured_image']['tmp_name']))) {
            try {
                $uploader = new Varien_File_Uploader('featured_image');
                $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
                $uploader->setAllowRenameFiles(false);
                $uploader->setFilesDispersion(false);
                $path = Mage::getBaseDir('media') . DS .'blog'.DS;

                $cleaned_image_name = str_replace(' ', '_', $_FILES['featured_image']['name']);
                $dest_featured_img = $path.$cleaned_image_name;
                $new_fetaured_img_name = $uploader->getNewFileName($dest_featured_img);
               // $uploader->save($path, $_FILES['featured_image']['name']);
              $uploader->save($path, $new_fetaured_img_name);

              $data['featured_image'] = $new_fetaured_img_name;
            }
            catch(Exception $e) {
                echo $e->getMessage();
                exit;
            }
        }
$model->setFeaturedImage($data['featured_image']);
            $model->save();
}

Now, The image is being uploaded fine, but as we can see only name of the image file is getting saved to db. Hence When retriving in phtml file as below, only name is printed

Retrive image from db in phtml file

   <img src="<?php echo
     $post->getFeaturedImage();?>">

Output is (Current)

'`

However it should be (Expected)

''

I seriously do not want to hardcode the media/blog/ in phtml file as answered Here , nor would like to save the complete hardcoded url in db field as later on I'd be implenting cdn for images.

Also hardcoding would then fail if i intend to save image in catalog like style

media/blog/a/1/atest_image.jpg
media/blog/a/2/atest2-image2.jpg

Then What is the correct way to get the full url of image by image name in this case.

I have seen various answers on stackoverflow / other site tutorials including followig but they don't talk about the full image url, but only the filename saved in db field.

Magento is not saving new field in database even after flush cache storage

http://www.devproblems.com/add-an-image-field-in-your-admin-plugin-by-example-aw-blog/

ad thumbnail to aw blog posts


texts:
I am trying to map xml file in magento 2 while working on new module declaration through this command

 bin/magento dev:urn-catalog:generate .idea/misc.xml

the directory is (through pwd command)

/opt/lampp/htdocs/magento

at first it shows me this error

cache_dir "/opt/lampp/htdocs/magento/var/cache/" is not writable

So I have launched this command

chmod -R -v 777 var/cache

It shows me now this

 There are no commands defined in the "dev:urn-catalog" namespace.


texts:
My Magento store is slow but only during the first request when it isn't accessed for a while. Every request from any PC or IP after that is blazing fast and I can't figure out which type of cache is causing this.

The server itself is very simple, just apache with php-fpm and OPCache. No varnish, solr, redis or anytype of other cache. The store itself is in production mode with all cache enable and including full page cache. Static content is properly deployed and DI is also compiled properly.

I have a feeling that this might be caused by OPCache unloading the cached PHP files after a while. Does this sound plausible? Is there any way to fix this issue?


texts: Where can I find documentation on the Varien Javascript library?

texts:
Magento ships with a number Varien javascript libraries (located under js/varien) which it uses for clientside features such as form validation.

Where can I find an API guide for this, or high level documentation of what's included and how it's intended to be used?


texts:
I need add a tab tabs of sales order.

I think the tabs are defined in sales_order_view but I create a module in Vendor/ModuleName/view/adminhtml/layout/sales_order_view.xml and I put this:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_info">
          <action method="addTab">
              <argument name="name" xsi:type="string">order_transzuri</argument>
              <argument name="block" xsi:type="string">Sistel\Transzuri\Block\Adminhtml\Order\View\Tab\Custom</argument>
          </action>
        </referenceBlock>
    </body>
</page>

And I create in Sistel\Transzuri\Block\Adminhtml\Order\View\Tab\Custom this:

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Sistel\Transzuri\Block\Adminhtml\Order\View\Tab;

/**
 * Order transactions tab
 *
 * @author     Magento Core Team <core@magentocommerce.com>
 */
class Custom extends \Magento\Framework\View\Element\Text\ListText implements
    \Magento\Backend\Block\Widget\Tab\TabInterface
{
    /**
     * @var \Magento\Framework\AuthorizationInterface
     */
    protected $_authorization;

    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry = null;

    /**
     * @param \Magento\Framework\View\Element\Context $context
     * @param \Magento\Framework\AuthorizationInterface $authorization
     * @param \Magento\Framework\Registry $registry
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Context $context,
        \Magento\Framework\AuthorizationInterface $authorization,
        \Magento\Framework\Registry $registry,
        array $data = []
    ) {
        $this->_authorization = $authorization;
        $this->_coreRegistry = $registry;
        parent::__construct($context, $data);
    }

    /**
     * Retrieve order model instance
     *
     * @return \Magento\Sales\Model\Order
     */
    public function getOrder()
    {
        return $this->_coreRegistry->registry('current_order');
    }

    /**
     * {@inheritdoc}
     */
    public function getTabLabel()
    {
        return __('Transzuri');
    }

    /**
     * {@inheritdoc}
     */
    public function getTabTitle()
    {
        return __('Transzuri');
    }

    /**
     * {@inheritdoc}
     */
    public function canShowTab()
    {
        return !$this->getOrder()->getPayment()->getMethodInstance()->isOffline();
    }

    /**
     * {@inheritdoc}
     */
    public function isHidden()
    {
        return !$this->_authorization->isAllowed('Sistel_Transzuri::transzuri');
    }
}

But It not shows in admin panel. Why?


texts:
Getting this error:

prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function
prototype.js:2304 Uncaught TypeError: Cannot read property 'length' of undefinedElement.Methods.hasClassName
prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function
prototype.js:5653 Uncaught TypeError: element.attachEvent is not a function
prototype.js:5644 Uncaught TypeError: element.attachEvent is not a function
prototype.js:5734 Uncaught TypeError: element.dispatchEvent is not a function
kam-black-cargo-trousers-38-inch-leg:2904 Uncaught TypeError: $(...).fancybox is not a function

I think it could be a jquery conflict problem, could anyone suggest anything to check.Thanks


texts: Logging in at the checkout process empties the cart/redirects to an empty cart

texts:
User adds a product to the cart -> Goes to checkout -> Log in into their customer account (in the checkout process).

Expected result: Customer is being logged in to their account with the items chosen previously.

Actual result: User is being redirected to an empty cart.

Using Magento ver. 2.2.4.

UPDATE:

Just to give a bit more information... There are no logs in regards to this issue. Also, when adding a product to cart and logging in anywhere other than checkout works fine. So it might be worth mentioning that I use OnePageCheckout by Amasty.


texts: How to add a second static link block in footer (Magento2)?

texts:
Currently I only have 1 static block with footer links.

I would like to have a second one like in the image below (image is from magento1.9) I would also like to add a "title" to the footer link block like in the image below.


texts: Magento2 multistore setup, getStore()->getCode() shows default

texts:
Add store codes to urls is set to yes.

Store code is: test.

Default homepage for that store loads correctly: home cms page for
that particular store.
In the menu the store code is added to the urls:
www.example.com/test/men.html

But when I add this code in a template file (one called in the homepage for example):

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$store = $objectManager->create('\Magento\Store\Model\StoreManagerInterface');
echo "Code: ".$store->getStore()->getCode();
echo "Name: ".$store->getStore()->getName();

I get the default store code and default store code name.

Why is that? I didn't edit the index file or htaccess.

If I would go ahead and add this to the index file:

 $params = $_SERVER;
 $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'test';
 $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 $app = $bootstrap->createApplication('Magento\Framework\App\Http');
 $bootstrap->run($app);

Then it will show the right store code, but I don't want to edit the index file as the client must be able create the stores in the admin without us editing files.


texts:
Hi in a frontend module I made I use the following to post a form;

<form action="<?php echo $this->getUrl('my-module/') ?>index/search">

and had a searchAction function to handle the form. I have tried doing something similair using some tips found online but still to no avail;

<form method="post" action="<?php echo Mage::helper("adminhtml")->getUrl("MYADMINFOLDER/MYMODULE/index/AttributeSet"); ?>">

Just wanting to know how to post to an admin form and where I'm going wrong! Thanks


texts:
I'm trying to install Magento on the ipage server. In database connection setup stage I'm getting the error

  Fatal error: Call to a member function insert() on a non-object in
  /hermes/bosoraweb129/b1598/ipg.xxx/xxx/private/app/code/core/Mage/Core/Model/Resource/Resource.php
  on line 133.

I don't know what this error is saying.

Please anyone help me to solve this problem.


texts: Get available quantity in Magento 2.3 for CSV export

texts:
I can't find a way to get the available quantity in Magento 2. I am Building a file to export products to CSV. Quantity must be stored in 'quantity_and_stock_status' but how to extract it I don't know.

Tried $product->getQty(); below is the part that builds CSV

foreach ($_columns as $_column) {
                switch ($_column) {
                    case 'link':
            $data[] = $product->getProductUrl();
                        break;
                    case 'id':
            $data[] = $product->getSku();
                        break;
                    case 'image_link':
            $data[] = $this->getMediaUrl() . 'catalog/product' . $product->getImage();
                        break;
                    case 'brand':
            $data[] = $product->getBrand();
            break;
                    case 'availability':
            $data[] = $product->getAttributeText('quantity_and_stock_status');
            break;
                    case 'inventory':
            $data[] = $product->getQty();
            break;


texts: Magento - can a returning customer checkout without logging in?

texts:
something we get questions from returning customers that they can't place an order.

They forget to log-in with their account.

But is it possible to place an order for already existing customers, but without they have to log-in ...

Can any-one help with that?


texts: Magento2 : How to setup PWA in Localhost?

texts:
I want to setup PWA in localhost. I have tried in localhost but at last its giving dynamic staging server URL like below

https://magento-venia.local.pwadev:51828/

How can we change it to our localhost server URL.


texts: The correct implementation of the output of subcategories in the main category

texts:
i want to display subcategories in the root category, i found this way that works for me.

  app/design/frontend/[Vendor]/[theme]/Magento_Catalog/templates/category/products.phtml

<?php $category = $block->getCurrentCategory(); ?>
<?php $subcategories = $category->getChildrenCategories(); ?>
<?php $_helper = $this->helper('Magento\Catalog\Helper\Output'); ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php if(count($subcategories) > 0): ?>

            <?php foreach($category->getChildrenCategories() as $subcategory): ?>
                <?php $subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($subcategory->getId()); ?>

                        <?php if ($_imgUrl = $subcategory->getImageUrl()): ?>
                            <a href="<?= $subcategory->getUrl() ?>" class="product photo product-item-photo">

                                    <?php $_imgHtml = ''; ?>
                                    <?php echo $_imgHtml = $_helper->categoryAttribute($subcategory, $_imgHtml, 'image'); ?>

                        <?php endif; ?>

                                <a class="product-item-link" href="<?= $subcategory->getUrl() ?>"><?= $subcategory->getName() ?>

            <?php endforeach; ?>

<?php else: ?>
    <?php if (!$block->isContentMode() || $block->isMixedMode()): ?>
        <?= $block->getProductListHtml() ?>
    <?php endif; ?>
<?php endif; ?>

But this method alarms me with the fact that the objectManager is called to get the data, it is just as bad that this logic is used in the template.

Help implement this method through a block or View Model approach.

Still hope for help


texts: Why does my var folder contain brute-force.ini?

texts:
In the var folder, a file has suddenly appeared called brute-force.ini.

Is it harmful or not? Can I delete this file?


texts:
I create an observer for controller_action_predispatch in frontend to redirect site to particular store url like this:

public function execute(
        \Magento\Framework\Event\Observer $observer
    ) {
      $url = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')
            ->getStore('1')
            ->getBaseUrl();
      $this->_responseFactory->create()->setRedirect($url)->sendResponse();
      exit;
}

the problem is the page is always loading and never redirect and i need to set the redirect url same with previous url, for example if the previous url is http://base.com/storeA/checkout then it needs to change to http://base.com/storeB/checkout


texts: magento 2 : How to render background images in phtml pages

texts:
How do you render a background image from a phtml page.

I have tried this:

And this:

My images are held in my website theme:

\app\design\frontend\Mytheme\Theme-frontend-default\web\images


texts: How to create API method product info in magento 1.9

texts: The code should be optimized to load the page faster


texts: Is there any way to tell where a page element is loaded from in Magento?

texts: When I see a page that uses Magento, is there any way for me to know where the elements on the page loaded from? How can I know if something is loaded from a static block or from a file somewhere? And if I know what kind of thing loaded an element can I find the file path tracing back to that element?


texts:
It's my massAction controller:

<?php
/**
 * Created by PhpStorm.
 * User: pkushnerevich
 * Date: 19.10.18
 * Time: 18.20
 */

namespace Aty\TestTask\Controller\Adminhtml\AddedList;

use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;

class MassDelete extends \Magento\Backend\App\Action
{
    protected $filter;

    protected $collectionFactory;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Ui\Component\MassAction\Filter $filter,
        \Aty\TestTask\Model\ResourceModel\InsSku\CollectionFactory $collectionFactory)
    {
        $this->filter = $filter;
        $this->collectionFactory = $collectionFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        $collection = $this->filter->getCollection($this->collectionFactory->create())->walk('delete');
        $collectionSize = $collection->getSize();

        $this->messageManager->addSuccess(__('A total of %1 element(s) have been deleted.', $collectionSize));

        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        return $resultRedirect->setPath('*/*/');
    }
}

Exception: Some transactions have not been committed or rolled back

After debugger I found, that it's here

vendor/magento/framework/Model/AbstractModel.php

 public function beforeDelete()
    {
        if (!$this->_actionValidator->isAllowed($this)) {
            throw new \Magento\Framework\Exception\LocalizedException(
                new \Magento\Framework\Phrase('Delete operation is forbidden for current area')
            );
        }

        $this->_eventManager->dispatch('model_delete_before', ['object' => $this]);
        $this->_eventManager->dispatch($this->_eventPrefix . '_delete_before', $this->_getEventData());
        $this->cleanModelCache();
        return $this;
    }


texts: Apply coupon checking with Custom Timezone

texts:
For the cart price rules, I have added different Timezone configuration for every website like US, CA, AU.
Now when applying coupons on the front side I need to check with the assigned Timezone to that website. It's valid to date or not?
Please give me some suggestion for this.


texts: Internal Server Error 500 after upgrade Magento version from 2.2.6 to 2.2.10

texts:
After I upgrade the Magento version from 2.2.6 to version 2.2.10, I get Internal Server Error 500 when I try to access the website.

I tried multiple solutions for example (a) removing var folder and generated folder, (b) changing the file permissions, re-run setup:upgrade, and static:content:deploy, but neither of these work for me.

One sort of working solution is if I remove the .htaccess from the root directory, then I was able to load the home page with js/css errors. But then when I go to any other page, I receive 404 error.

Can someone give me an advise?


texts: Reflection of getUrl method in Magento 2.1.12

texts: If I change getUrl method of AbstractTemplate.php, how much effect on other template in Magento 2.1.12. I am doing this for redirect custom forgotpassword page in Angular frontend. Please tell me.


texts:
Customer can leave review (name, comment) but the rating (which can mark 1 ~ 5 star) is not showing on review block at the product page

Mage_Rating is enable on System - Advanced

What should I check more to enable the ratings to be seen on the frontend product page?


texts: Change product tab (Specifications) from single column to double column

texts:
I use magento 2.3.4.
Our products has close to 30 attributes in a set.
From the product page, the list of attributes for the specifications are in a single column. This has made our product page too long . We will like to have the SPECIFICATION tab which hosts the attributes to be in a double column instead of a single column as in image below.
I tried to use CSS but it didn't come out fine. i am still open for suggestions . I would like the single column to split to double column after 50% of the attributes are displayed in the specification tab

I need the single column in the specification tab to be double column.


texts: Category filters not appearing in layered navigation

texts:
Category filters are not appearing in Layered Navigation. I am not using any plugin for layered navigation. Attribute and Price filters are appearing.

I have set Is Anchor and Show In Navigation to YES for all the categories. I have read other answers on stackexchange as well. No idea why this is happening.

In app/code/core/Mage/Catalog/Block/Layer/View.php (Line 207)
return $this->getChild('category_filter'); is returning NULL.


texts: Magento2: Issue after installing module GA

texts:
I am installing GA module from:
https://www.weltpixel.com/google-analytics-enhanced-ecommerce-tag-manager-magento-2.html

But after installing this module, the store started walking very very slowly. I tries to run the deploy command and receives the issue:


texts: Is it possible to downgrade 1.9.3.3 version to 1.9.3.2?

texts: How to downgrade the the version from 1.9.3.3 to 1.9.3.2.. Is there any possibilities to do this?


texts: I need constructor or init function that can be run for my custom module. I need to call it every time when request made to my module's controller in magento.


texts:
Is there an option in admin to show swatches instead of drop downs?

I seem to remember there being an option in magento 1.9 to do this but can't seem to find it in admin here.

Just to clarify this is so that instead of drop down for sizes there will be boxes such as in this demo product page: http://magento2.demo.ubertheme.com/neve-studio-dance-jacket.html

ack found it immediately after in attributes>product

Actually that is for input in admin not for store front soo still same question


texts: Grand total is wrong: VAT is substracted

texts:
We've recently upgraded from Magento v1.7.2 to v1.9.2 using Magento Connect Manager.
At first we were very happy it went rather smootly.

But now we noticed the grand total price is completely wrong.
All my prices are including VAT. I have one product in my cart which costs € 5.85
My cart overview is:

Subtotal:                 € 5.85
Total (excl. VAT)         € 3.81
VAT                       € 1.02
Grand Total (incl. VAT)   € 4.83

The subtotal is OK, the VAT is wrong. It should be 21% which is 1.23 and the grand total should stay 5.85. Now my customers are paying less than they should be. It looks like some settings have been set to different values after upgrading, but I can't figure out which setting I need to change.

Does anybody have a link to some documentation about how to set the VAT in Magento CE v1.9.2? I could find some for older version but they didn't help.

Update
As requested here is a screenshot of my tax settings. It is in Dutch however:


texts: how to place all product reviews and show them on a single page in category

texts: I have done a lot of searching prior to me coming here and basically what i was looking to do was to try and place all my reviews under one page or category. unfortunately I haven't yet succeeded. I currently have magento version 1.8.1.0 and i try putting codes in the local. file but it only messed up my site.


texts: Magento 2: How to insert data into custom table in model file?

texts:
Magento version: 2.0

I created a table to store some data. but maybe I have to use many file to do it from some tutorials, such as model, resource and collection folder's files.
I just save, update or delete the data into table, don't need to many works with it. So, there is simple method to do it?


texts: Best way to update product's attribute value

texts:
Today I came accross the issue of updating product's attribute programatically in observer on each visit on product page. As it should be really fast in that case I was wondering what is the best way to achieve that.

First of all one can get product model, set value on object using setter and save it using productRepository. But it is not fast, and it is really buggy on frontend.

Second option is using (I think) some methods from Magento/Catalog/Model/ResourceModel/AbstractResource and there two method that catch my eye here. First one is _updateAttribute($object, $attribute, $valueId, $value), but it is a bit unclear for me - $object is for sure product object which is binded with value to update, $value means exact value it should be after saving, but what exactly should I pass as $argument - instance of what class and do I really need to have id of field in db as $valueId?

Method _updateAttributeForStore($object, $attribute, $value, $storeId) seems more clear to me. Although I still have to have some object for $attribute, but I don't have to provide exact field id - so maybe I should use this one?

Of course both methods are protected, so I have to find some class that has access to these methods or create new class with wrappers for that ones.

Third way is to create direct query to db using some methods of classes directly communicating with db and mysql. I think although it shouldn't be used if possible for many reasons - for example safety of crud operations or breaking of model concept.


texts:
Using putty, I want to manage compiler mode through command line, but the answer received is always the compiler help:

myuser@serv01 [~]# php public_html/shell/compiler.php state
Content-type: text/html

Usage:  php -f compiler.php -- [options]

state         Show Compilation State
compile       Run Compilation Process
clear         Disable Compiler include path and Remove compiled files
enable        Enable Compiler include path
disable       Disable Compiler include path
help          This help

What am I doing wrong?


texts:
I am trying to insert multiple items on Db. It inserts successfully but when it comes to multiple items it duplicates it looks like am replacing on this array.

Here is the code:

$orderitems=$order->getAllItems();

    if(!empty($orderitems)){

        foreach($orderitems as $item){

            $aProduct = new OrderDetail;
            $aProduct->SkuId                        = $item->getSku();
            $aProduct->Quantity                     = number_format($item->getQtyOrdered(),0);
            $aProduct->Sellprice                    = number_format($item->getPrice(),2);
            $aProduct->LineNote                     = '';
            $aWebOrder->ProductDetailList[]         = $aProduct;
        }
    }


texts:
I read many posts and articles but still didn't find a solution.

I would like to filter my product collection with this condition:

...
WHERE ('supplier_id' = 1 AND 'product_type' = 'first_type')
OR ('supplier_id' = 2 AND 'product_type' = 'another_type')
...

Is it possible to achieve this using addFieldToFilter method?

Any other suggestions are welcome as well!


texts: Impossible display categories on the catalog list

texts:
Im Trying to display the category view in the Catalog list.

So I go to:

Stores ---> Attributes ---> Product

and edit position category_ids

Then I go to Advanced Attribute Properties and try enable "Add to column options".
But is not possible enable:

Its very important for me, anyone know how to solve it or enable this?


texts: How to save Customer Extension attribute in Magento 2/2.1

texts:
Issue:
I am stuck at the last step of saving Customer's extension attribute using the plugin method.

My code

  /etc/extension_attribute.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
        <attribute code="test" type="string" />
    </extension_attributes>
</config>

  /etc/di.xml

    <type name="Magento\Customer\Api\CustomerRepositoryInterface">
        <plugin name="get_tto_attributes" type="Tto\Custom\Plugin\CustomerGet"/>
        <plugin name="save_tto_attributes" type="Tto\Custom\Plugin\CustomerSave"/>
    </type>

    <!-- plugin to retirve customer extension attribute -->
    <type name="Magento\Customer\Model\Data\Customer">
        <plugin name="get_extension_attributes" type="Tto\Custom\Plugin\CustomerAttributesLoad"/>
    </type>

  Tto\Custom\Plugin\CustomerSave

<?php
/**
 * Save customer plugin
 * we are adding/saving our custom extension attributes
 */
namespace Tto\Custom\Plugin;

use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Model\ResourceModel\CustomerRepository;
use Magento\Customer\Model\CustomerFactory;
use Psr\Log\LoggerInterface;

class CustomerSave
{   /**
    * initiate
    */
    public function __construct(
        LoggerInterface $logger,
        CustomerRepository $customerRepo,
        CustomerFactory $customerFactory
    )
    {
        $this->logger = $logger;
        $this->customerRepo = $customerRepo;
        $this->customerFactory = $customerFactory;
    }

    /**
     *  after save interceptor
     */
    public function afterSave(
        CustomerRepositoryInterface $subject,
        $customer
    ) {
        $this->logger->debug('afterSave Started', array('customer OBJ' => $customer, 'subject OBJ' => $subject ));

        $result = $this->saveTtoAttribute($customer);

        return $result;
    }

    /**
     *  function to save our attributes
     */
    private function saveTtoAttribute( $customer )
    {
        $this->logger->debug('saveTtoAttribute Started', array('object' => $customer ));

        //get customer id and initiate \Magento\Customer\Model\customer Object using customer factory
           // TO DO
         /** get current extension attributes from entity **/
        $extensionAttributes = $customer->getExtensionAttributes();
        $this->logger->debug('extensionAttributes', array('object' =>  $extensionAttributes ));
        try{

            $testData = $extensionAttributes->getTest();
            $this->logger->debug( 'test', array( 'object' =>  $testData ));
            $this->customerFactory->save($testData);

        }catch( CouldNotSaveException $e  ){

            $this->logger->debug('could not save');

        }

        //$ourCustomData = $extensionAttributes->getOurCustomData();
       // $this->logger->debug('ourcustomData', array('object' =>  $ourCustomData ));
        //$this->customDataRepository->save($ourCustomData);

        return $customer;
    }

}

Now I am stuck with correct use of $this->customerFactory->save($testData); in saveTtoAttribute() function.

According to Magento2 DevDocs http://devdocs.magento.com/guides/v2.0/extension-dev-guide/extension_attributes/adding-attributes.html
use of $this->customDataRepository->save($ourCustomData); in afterSave() function

I can't figure out which Repository(in place of customDataRepository) I should use to save the extension attribute data?

Currently, I cant save the data.


texts: How to programmatically login an admin user?

texts:
I am on Magento 2.3.1 and I am trying to login an admin user automatically given their username. I have tried using the Magento\Backend\Model\Auth\Session class like this:

$this->_authSession->setUser($adminUserName);
$this->_authSession->processLogin();
$this->_authSession->refreshAcl();
$this->_authSession->prolong();

and then redirecting like this:

return $this->_backendUrl->getUrl('admin/dashboard/index');

but it keeps giving me the login prompt instead of the dashboard even though this test:

var_dump($this->_authSession->isLoggedIn());

returns the boolean True.

Any help would be appreciated


texts: Filter products by store ID in Magento 1

texts:
How to get product collection which is assigned to ONLY ONE STORE? This is not working by passing store ID to ->addStoreFilter();

Does have any idea?


texts: Session, Default and Page Cache via redis

texts:
we are providing a multi store Magento 2 Shop on a multi webnode infrastructure.
Sessions are handled by a redis docker on the DB Server. Is it useful to start new separately docker instances for default and page cache as well or can all be in the same redis-server?


texts: Voucher code affects the prices of products shown in EMail and PDF

texts:
I have a weird problem. I am applying the voucher discount on the cart for newsletter subscribers and it works on Checkout process without a problem. But in the email and pdf files I see the prices for products are changed unlogicly.

I have attached an image to show the difference.
Left side is on PDF and EMail and right side is on Admin Panel.

Any help will be appreciated.


texts: Can I use Magento's rest API through JavaScript?

texts:
I want to create Magento store Android app using PhoneGap. I found Magento's XML-RPC is the best option to create an API but now how I can call this API using only JavaScript and HTML ?

So it is sure my case I have to use JavaScript to use the API.So there is two options I think

If yes then how to use ?
if No then what's option?


texts: Child blocks not called when calling a template file from another template file

texts:
I am using social login plugin that overrides the default customer login form template in this way :

<customer_account_login>
       <reference name="customer_form_login">
            <action method="setTemplate"><template>ced/sociallogin/customer/form/login.phtml</template></action>
            <block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
            <block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
            <block type="sociallogin/login" name="ced_sociallogin_login">
                <block type="sociallogin/google_button" name="ced_google_login_button" />
                <block type="sociallogin/facebook_button" name="ced_facebook_login_button" />
                <block type="sociallogin/twitter_button" name="ced_twitter_login_button" />
                <block type="sociallogin/linkedin_button" name="ced_linkedin_login_button" />
                <block type="sociallogin/yahoo_button" name="ced_yahoo_login_button" />
            </block>
        </reference>
    </customer_account_login>

Now I am calling this block in another template file like this:

 <?php echo $this->getLayout()->createBlock('customer/form_login')->setTemplate('ced/sociallogin/customer/form/login.phtml')->toHtml(); ?>

This template - "login.phtml" has a small list of child methods called in this way:

<?php echo $this->getChildHtml('form.additional.info'); ?>
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
<?php echo $this->getChildHtml("ced_sociallogin_login"); ?>

But none of them are being called.. Why is this so??


texts: Magento 2 , How to get customer public ip address and send that public address with order inforamtion

texts:
I am integration PayFort Payment method with my Magento 2 store and PayFort team review my store and comments from pay fort team was.
Please make sure to detect the customer browsing IP address which is a public IP address and pass it to customer IP parameter currently you are passing the following value in customer _ip parameter and this is not my public IP address ( 52.94.36.25)
Now how I can get customer public IP and send that order information.


texts: Magento ver. 1.9.3.1 paypal standard redirecting to paypal express checkout

texts:
We have updated our website from magento 1.6 to magento 1.9.3. Paypal standard was working fine in our previous magento version. In latest version there is Payments Standard (Includes Express Checkout) instead of only Paypal standard.
I have configured this payment method. Now issue is on my onestepcheckout page, i can see paypal_express instead of paypal_standard and when i an clicking on Place order button, its redirect me to express checkout page.

I hope some have idea how to fix this.


texts:
In Cart page , Summary Section is there know , in that shipping flat rate will be 5. so i want to add static amount 10. so whenever i will go to cart page shipping rate will be 5+10 = 15 .
So how i can achieve this? I want to use only observer. Can anyone please help me to do this.
getEvent()->getQuote();
        $quote->setShippingAmount(10);
        $quote->save();

    }
}

I have used this code. but i didnt get.

Thanks


texts: How can I change product name to product sku in qtyincrements.phtml?

texts:
On our item page we have a block that says "product name is available for purchase in increments of amount" I would like to change product name to product sku. Here is how the original code looks ...

<?php if ($this->getProductQtyIncrements()) : ?>
<div class="product-pricing">
    <?php echo $this->__('%s is available for purchase in increments of %s', $this->getProductName(), $this->getProductQtyIncrements()) ?>
</div>
<?php endif ?>

I tried changing $this->getProductName() to $this->getProductSku() or to $this->getSku() and nothing shows up. What am I missing?


texts: Give Logout url after changing name from Login to Logout

texts:
Once we click on "Login" button present in pop up, we want to change text "Login" to "Logout" present on top menu.

So i tried as CodePen , now i can able to change text from "Login" to "Logout" , along with this i want to give Logout url : <url helper="customer/getLogoutUrl"/> , is this possible ?

  Login1 - pop up : app/design/frontend/rwd/Theme1/template/productlike - index.phtml

<form>
<input onclick="change();" type="submit" value="Login1"  />
</form>

script

function change() {
    var elem = document.getElementById("delUserButton")
    if (elem.value === "Login2")
        elem.value = "Logout";
    else
        elem.value = "Login2";
}

  Login in top menu [Login2] - app/design/frontend/rwd/Theme1/layout - customer.xml

<customer_logged_out>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer">

            <![CDATA[
<input  type="button" id="delUserButton"  value="Login2" />
]]>

            <url helper="customer/getLoginUrl"/><title>Log In</title>
            <prepare/><urlParams/><position>100</position></action>
        </reference>
        <remove name="reorder"></remove>
</customer_logged_out>


texts: Is it possible to add extra fields in magento banner

texts:
I need to add some extra fields (start date and end date) in Banner add/edit page (admin->cms->banner).

If possible I want to create a new extension for adding my fields.


texts: How to disable purchase order for guest checkout?

texts:
In magento 1.9.2.4 you can disable checkout for guests completely. However, what I would like is if customer chooses to checkout as a guest then they can only checkout via paypal standard. But, if they choose to register and checkout then they have the option of being able to checkout with paypal or purchase order.

Would this even be possible? I am using a theme based on the default RWD theme.


texts: How can we add Page builder with custom form without Eav attribute and Ui component. Is there any way to include page builder in $form->addField().


texts: What are the differece between core/email_template and core/email_template_mailer

texts: every one ,can anyone tell me please what are the difference between core/email_template_mailer and core/email_template...I want to know its each function in details.


texts: Magento 2.3, cannot get attribute ts_dimensions_height within product loop

texts:
We are trying to build a shipping plugin, however have run into a hurdle trying to retrieve values for ts_dimensions_height, ts_dimensions_width and ts_dimensions_length.

Our constructor looks like so:

public function __construct(
    \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
    \Magento\Framework\App\Helper\Context $context,
    \Magento\Framework\Encryption\EncryptorInterface $encryptor,
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Sales\Api\OrderItemRepositoryInterface $orderItemRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    // \Magento\Eav\Setup\EavSetupFactory $eavFactory,
    \Magento\Directory\Model\RegionFactory $regionFactory
)
{
    parent::__construct($context);
    $this->encryptor = $encryptor;
    $this->customerRepository = $customerRepository;
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->orderItemRepository = $orderItemRepository;
    $this->productRepository = $productRepository;
    // $this->eavFactory = $eavFactory;
    $this->regionFactory = $regionFactory;
}

While in the Product object, we have tried all of the following:

$product->getCustomAttribute('ts_dimensions_height');

$product->getResource()->getAttribute('ts_dimensions_width');

NOTE: we do not have an issue getting other product data. E.g. getWeight, getSku, getName all work fine.


texts: Magento Admin Actions Log - How to capture mass action data?

texts:
We've created a module for Enterprise that has 2 controller actions, one is the index and the other is a save from a massaction. We're logging to the Admin Actions Log with the following logging.xml:

<?xml version="1.0" encoding="UTF-8"?>
<logging>
    <acme_productlabels translate="label">
        <label>Acme Product Labels</label>
        <actions>
            <productlabels_productlabels_print>
                <action>save</action>
                <post_dispatch>postDispatchGeneric</post_dispatch>
            </productlabels_productlabels_print>
            <productlabels_productlabels_index>
                <action>view</action>
                <post_dispatch>postDispatchSimpleSave</post_dispatch>
            </productlabels_productlabels_index>
        </actions>
    </acme_productlabels>
</logging>

This uses a custom route, so we added an observer in config.xml to accomplish this:

<config>
    <adminhtml>
        <events>
            <controller_action_postdispatch_productlabels>
                <observers>
                    <enterprise_logging>
                        <class>enterprise_logging/observer</class>
                        <method>controllerPostdispatch</method>
                    </enterprise_logging>
                </observers>
            </controller_action_postdispatch_productlabels>
        </events>
    </adminhtml>
</config>

This works fine for the index, but for the save action, it fails. When we use postDispatchSimpleSave for the save action, it logs the action but without the full details.

We need the save action, when logged, to also include the parameters that were submitted to the save action. Currently that includes a selection of products, a quantity, and a boolean value, submitted as a massaction in a grid.

So our basic question is, how do we log the full details of a save action in Magento's admin action log?


texts: How to get attributes by attribute set ID in Magento 2?

texts: How can I retrieve a list of attributes and values by given attribute set ID in Magento 2?


texts: Magento 2 Add select-box with search/filter option

texts:
I would like to add select-box with search/filter option. Is it possible, Magento ui-components provide this kind of functionality? If so, how to achieve this?

Now I am working with Product Entity - adding an attribute programmatically. A new attribute was added by InstallData setup class. Input and source were specified like this:

'input' => 'select',
'source' => 'Vendor\ModuleName\Model\Attribute\Source\Data'

Desirable effect:


texts: how i can get order id and customer name in oberserver magento 2

texts:
I have used event

<event name="checkout_onepage_controller_success_action">

  when I use this code I am getting null $order

        $order = $observer->getEvent()->getOrder();   // im getting null
        $order_id = $order->getIncrementId();
        $this->_logger->info($order_id);
        foreach($order->getAllItems() as $item){
            $ProdustIds[]= $item->getProductId();

            $proName[] = $item->getName(); // product name
        }
        $this->logger->info($ProdustIds);
        $customer = $order->getCustomerId();

how I can get order id and customer name in Magento 2???


texts: Magento 2 running so slow on localhost development

texts:
I recently started developing on magento2 new extensions or customizations, and my first impression was a nightmare. I have to wait about 20-30s for every change I make? really?

I'm talking about development mode, I know that in production with cache enabled and other things the website can be smooth. But when I'm working with an extension or layout problem I need to be removing static files, clearing cache, etc.

My question is, how you all M2 developers work? because I don't believe you have to wait 20s-30s for refreshing the page...

My environment: My pc is "good" i5 with 8gb RAM. I need to work with Windows so I use vagrant:

Use of all 4 cores CPU
Use 5120MB of RAM
Ubuntu/trusty64 - Ubuntu 14.04
PHP Version 7.0.12-1+deb.sury.org~trusty+1
MariaDB - 10.1.18-MariaDB-1~trusty
Magento 2.1.2 is installed only with sampledata (no more modules are installed)
(Ask me if you wanna know sth more)

What is happenning exactly?
Usually M2 responds okay, slow but okay, about 5-10s to load the pages, but sometimes (more usually than sometimes) it just stucks forever! sometimes is the first page and sometimes are the css,js,html files but always the problem is with TTFB.

I saw a problem going to setup wizard too... with angular.js these files lasts forever...

These 2 pictures are about navigating inside setup wizard.

Then another one navigating on frontend catalog:

What am I asking exactly?
Is this normal? you guys work with this timing? I commented this with some colleagues and we just don't believe, I have to be working like this? I sometimes despair of waiting all the time watching the screen...

If someone asks me for show him a test, like creating a new product or something like that he just freaks out... Creating a new order, filling the fields and every field executes a js that lasts for 5-6s...

I don't know but I feel so bad developing with this stuff...


texts:
We have a multistore in multilanguage and as test we set one to connect the media and static url through static.domain.com to a CDN but that is not working.

But now the template for that storeview and the admin are messed up. I looked in core_config_data but I can not the change the static url for one store in there.

We tried the normal things, reindex, deploy static content, set to production etc etc but that is not working.

Is there an other place where I can change it back to blank?

This is the domain: https://bakmina.com/


texts:
This is the url ....customer/address/new/. This is the code from the layout:

<customer_address_new>
        <reference name="root">
           <block type="core/template" name="headertext" template="customer/address/header_address.phtml" />
        </reference>
</customer_address_new>

This is a code from 2column-left.phtml

<?php echo $this->getChildHtml('headertext')
    $request = $this->getRequest();
    $module = $request->getModuleName();
    $controller = $request->getControllerName();
    $action = $request->getActionName();
?>

The result of a var_dump for $module is : customer

The result of a var_dump for $controller is : address

The result of a var_dump for $action is : form

I tried every combination of creating my xml.  These are the combination

<customer_address_new>
<customer_address_form>
<customer_address_index>

neither of them are not working. What am I missing ?


texts: Magento 2 sample data installed but not showing

texts: I have just installed Magento 2. I think I have installed the sample data. I did php bin/magento sampledata:deploy , php bin/magento setup:upgrade and then php bin/magento setup:di:compile however the sample data isn't showing on my magento site. Why isn't it showing?


texts: Exclude Parent categories from product collection

texts:
Hi i have below categories,

Category 1 (id 1)
   - Sub category 1 (id 11)
   - Sub Category 2 (id 12)

Category 2 (id 2)
   - Sub Category 3 (id 13)
   - Sub category 4 (id 14)

And all my products are assigned to One Parent and one child category.

If i use

    foreach ($this->getItemCollection()->getItems() as $item) {
        print_r($item->getCategoryIds());
        ...............
}

Below is my result

Array
(
    [0] => 1
    [1] => 11
)
Array
(
    [0] => 1
    [1] => 12
)
Array
(
    [0] => 2
    [1] => 13
)
Array
(
    [0] => 2
    [1] => 14
)

Now how can i exclude product's parent category id's, this case how to remove categories having id's 1 and 2


texts: Can't create unique and fulltext index on the same column

texts:
My table in db_schema looks like below.

<table name="test">
    <column xsi:type="int" identity="true" name="test_id" padding="10" unsigned="true" nullable="false" comment="Entity Id"/>
    <column xsi:type="varchar" name="name" nullable="false" length="255" default="" />
    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="test_id"/>
    </constraint>
    <index referenceId="TEST_NAME" indexType="fulltext">
        <column name="name"/>
    </index>
    <constraint xsi:type="unique" referenceId="TEST_NAME_UNIQUE">
        <column name="name"/>
    </constraint>
</table>

After setup:upgrade I get an error "SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'TEST_NAME', query was: CREATE TABLE test (
test_id int(10) UNSIGNED NOT NULL  AUTO_INCREMENT COMMENT "Entity Id",
name varchar(255) NOT NULL DEFAULT "" ,
CONSTRAINT  PRIMARY KEY (test_id),
CONSTRAINT TEST_NAME UNIQUE KEY (name),
FULLTEXT INDEX TEST_NAME (name)
) ENGINE=innodb DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci"

I know there cannot be two indexes with the same name, so how to customize the index name?
I thought referenceId field indicates the name of index but I was wrong.

I'm using Magento 2.3.5 and MariaDB


texts: how to echo custom attribute value in crosssell.phtml in magento?

texts:
this is my crosssell.phtml code:

<?php echo $this->__('THIS PRODUCT IS ALSO AVAILABLE IN ') ?>

    <?php foreach ($this->getItems() as $_item): ?>

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

    <?php endforeach; ?>

Now I have a custom attribute say 'colour'. I want to show this custom attribute value in crossell.phtml in the foreach loop.
My attempt so far:

<?php echo $attr= $_item->getResource()->getAttribute('colour')->getFrontend()->getValue($_item); ?>

Please help. Thanks in advance.


texts:
I m trying to recalculate magento total using magento event observer after placing order.I m use below code to calculate total.

Observer Functon

public function recalculateTotal($observer)
{
    //var_dump($observer->getOrder()->getData());exit;
    $orderModel = $observer->getOrder();
    //echo "
";print_r($orderModel->getData());echo "
";exit;
    $saveModel = Mage::getModel('sales/order')->load($orderModel->getId());
    $saveModel->setSurcharge(10);
    $saveModel->setBaseSurcharge(10);
    $saveModel->collectTotals();
    $saveModel->save();
    echo "
";print_r($orderModel->getData());echo "
";exit;
}

Event

     <global>
        <events>
            <sales_order_place_after>
              <observers>
                <order_surcharge_display>
                  <type>singleton</type>
                  <class>surcharge/observer</class>
                  <method>recalculateTotal</method>
                </order_surcharge_display>
              </observers>
            </sales_order_place_after>
      </events>
    </global>

But this is not working Please help.


texts: How can I get best seller product for each category in magento 2?

texts:
I have a main category "Computer" with 3 sub categories:

Laptop
Storage
Software

I know how can I get a sub category. But I need best the selling product for each category, for example:

Laptop

Product Laptop1
Product Laptop2 (This 2 product is best seller product for laptop category)

Storage

Product Storage1
Product Storage2 (This 2 product is best seller product for storage category)

Software

Product Software1
Product Software2 (This 2 product is best seller product for software category)

My code to get the category list for the main category is:

public function __construct(
        Template\Context $context,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver,
        \Magento\Framework\Registry $registry,
        \Magento\Catalog\Helper\Category $categoryHelper,
        \Magento\Catalog\Model\CategoryFactory  $categoryFactory,
        array $data = array())
    {
        parent::__construct($context, $layerResolver, $registry, $categoryHelper,$data);
        $this->_categoryFactory = $categoryFactory;
        $this->_collectionFactory = $collectionFactory;
     }

    public function getCategoryList()
    {
      $_category  = $this->getCurrentCategory();
      $collection = $this->_categoryFactory->create()->getCollection()->addAttributeToSelect('*')
              ->addAttributeToFilter('is_active', 1)
              ->setOrder('position', 'ASC')
              ->addIdFilter($_category->getChildren());
      return $collection;

    }


texts: Magento resizing images for cache and making them bigger

texts:
I've noticed on our Magento 1.9.3.1 store that when Magento puts product images into cache it's actually making them bigger.  I'm not sure where to start debugging this or if there is a fix for it?

To give you an example I uploaded a image which was compressed to 92kb with PhotoShops Save for Web feature. However when I checked the frontend of the website I found that it had increased to 209kb.

The larger version of the file is coming from the Magento cache for product images, it's file path is:

media/catalog/product/cache/9/thumbnail/c96a280f94e22e3ee3823dd0a1a87606/i/m/img_4901-3v2.jpg

The original file still has the 92kb file size and is located in:

media/catalog/product/i/m/img_4901-3v2.jpg

Why & How could Magento be making the file bigger? Also why is it putting the cahed image in a thumbnail directory, all the cached versions of this image are being put in the thumbnail directory, i.e.

media/catalog/product/cache/9/thumbnail/200x/1ac472b2e3bed24f4b7f75082897d970/i/m/img_4901-3v3.jpg

media/catalog/product/cache/9/thumbnail/535x/1ac472b2e3bed24f4b7f75082897d970/i/m/img_4901-3v3.jpg

Where in the code does Magento process images for the cache?

I've looked in lib/tcpdf/tcpdf.php at $img->setCompressionQuality($this->jpeg_quality);.  I've also checked template/catalog/product/view/media.phtml but couldn't find anything.


texts: I'm researching how to create a custom payment method that outputs an XML file of the order. Is this possible in Magento? Does anyone know any resources to help me? I've read through a fair amount custom payment method tutorials and I haven't found anything that relates to what I need to build.


texts: How to modify a module installed from marketplace?

texts: there are some behaviors in a module that i installed from Marketplace that i want to change a bit, like adding some more configurations, overriding template files and add a bit more Javascript, stylings, etc. I'm not seeing anywhere i can extend from a 3rd party module installed from Marketplace, what would be the best practices to deal with this? As i don't really want to modify the extension's code. I'm using Magento 2


texts: Move billing address form to shipping address page in magento 2.1

texts:
I am using Magento-2.1.7. I am trying to move where the billing address is set by default it is set on the payment page and I would like to move this to the shipping methods section.

Here is my checkout_index_index.xml:

<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">before-shipping-method-form</item>
<item name="children" xsi:type="array">
    <item name="billing-address" xsi:type="array">
        <item name="component" xsi:type="string">Magento_Checkout/js/view/payment/default</item>
        <item name="component" xsi:type="string">Magento_Checkout/js/view/billing-address</item>
        <item name="displayArea" xsi:type="string">billing-address</item>
        <item name="dataScope" xsi:type="string">afterMethods</item>
        <item name="provider" xsi:type="string">checkoutProvider</item>
        <item name="config" xsi:type="array">
            <item name="template" xsi:type="string">Magento_Checkout/billing-address</item>
        </item>
    </item>
</item>

This is loading the checkbox and label but the form is empty


texts:
We are building a Magento online store for our brick and mortar retail store. We have been running our daily sells with our taylor made in house developed POS system. It stores all information in a MySql database.

Do you know of anything that can help us sync both Magento and POS qty to avoid stock problems. Maybe some kind of trigger that makes Magento qty to update when POS makes a sell and POS qty to update when Magento does.

Any light in the subject will be appreciated.


texts: Product not changing to 'Out of stock' even though qty has gone below minimum

texts:
I have followed the steps of the very helpful solution on Add to cart for out of stock products

Now I can have products with the "Qty for Item's Status to Become Out of Stock" as “-1” instead of “0” whilst having “Stock Availability” as “In Stock”.

“-1” is my default config setting, but I have other products that have overidden this with a value of “0”.

This all seems great.  I have run some successful test purchases and the “Qty” successfully changes to “-2” or “-1” in the Admin Panel as expected.

However, the problem I have is that “Stock Availability” does not change from “In Stock” to “Out of stock” when these “Qty for Item's Status to Become Out of Stock” thresholds are reached, meaning that the items continue to be orderable on the frontend.  They should change to Out of stock.  Please see screenshots.

I didn’t do step 7 of the referenced solution because I still want Magento to switch products to "Out of stock" on the backend and frontend, but perhaps I am confused here.  Perhaps that code will somehow do what I want it to do but to be honest I am not sure how to apply it.  I can see the code referred to in the list.phtml and view.phtml files, but an not sure what it is I am pasting.  Do I paste all of it over part of the code, or just down to __('Out of stock') ?>
What is the significance of the space between __('Out of stock') ?> and __('In Stock')?>

Can anyone help please, sorry for my ignorance!


texts: Cannot explain pagespeed score difference at similar magento 1 pages

texts:
I've got 2 almost identical pages: one for brand, and one for category.

Brand looks exactly like category, and has same number of products.

Brand page gets score 64/95, and category gets score 88/80.

There is Amasty FPC installed, and both pages are served from cache, page load time is the same: 0.4 sec.

The only difference I see at pagespeed is this:

Brand mobile: PSI estimates this page requires 7 render-blocking round trips and 54 resources (1.2MB) to load.
Brand desktop: PSI estimates this page requires 1 render-blocking round trips and 58 resources (1.1MB) to load.
Category mobile: PSI estimates this page requires 1 render-blocking round trips and 59 resources (1.2MB) to load.
Category desktop: PSI estimates this page requires 1 render-blocking round trips and 63 resources (1.4MB) to load.

Note that at mobile brand it shows 7 round trips, and 1 everywhere else. I assume this is this issue. But mobile brand and desktop brand are the same page.

All pages have the same 3 minified CSS, and 1 minified JS.

There are both links:

category: link

brand: link

Note that if you check the scores, load them twice, to prime the cache.


texts:
When I have tried to setup magento 2 in mamp 5.5 I got an error.

This page isn’t workinglocalhost is currently unable to handle this request.
HTTP ERROR 500


texts: Meta title is displaying instead of product name for mobile version in magento 2

texts:
I am facing the weird issue that for mobile version, meta title is displaying instead of product name.
For desktop version, it is displaying fine without any issue.


texts: NOT_FOUND - no queue 'async.operations.all' in vhost '/' : RabitMQ : Magento 2.3 EE

texts:
I am integrating RabbitMQ with magento 2.3. EE ,

  When I try to run cron It is giving me below error

  NOT_FOUND - no queue 'async.operations.all' in vhost '/'

Can anyone help me on this.


texts: Magento2 Product doesn't return extention attributes

texts: Today I have encountered an error when getting product detail as describing here. Everything work fine except extension_attributes return empty despite it has data. I don't have any idea about how it happens and how to fix it. Any idea? Thank you.


texts: Move Custom Module from one set up to other in local host?

texts:
My custom module (which override product controller) successfully run in my set up but when i moved it into in any set up . it will give an error like this.

Exception printing is disabled by default for security reasons.

  a:5:{i:0;s:745:"Error in file:
  "/var/www/html/mage2016/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php"
  - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'permission_variable' already exists, query was: CREATE TABLE
  permission_variable (
        variable_id int UNSIGNED NOT NULL auto_increment COMMENT 'Variable ID' ,
        variable_name varchar(255) NOT NULL default '' COMMENT 'Config Path' ,
        is_allowed bool NOT NULL default '0' COMMENT 'Mark that config can be processed by filters' ,
        PRIMARY KEY (variable_id, variable_name),
        UNIQUE UNQ_PERMISSION_VARIABLE_VARIABLE_NAME (variable_name)
      ) COMMENT='System variables that can be processed via content filter' ENGINE=INNODB charset=utf8
  COLLATE=utf8_general_ci";i:1;s:954:"#0
  /var/www/html/mage2016/app/code/core/Mage/Core/Model/Resource/Setup.php(644):
  Mage::exception('Mage_Core', 'Error in file: ...')


texts: Always embed a hidden invisible product to cart

texts:
I want to co-opt my ultimo-shop, therefore I need a solution for an always fixed, invisible product (Price: 0 € in the cart).
The customer should not see this product.

This product must be always there, not only after clicking an url (I tried the extension salgua, which works fine, but not for my problem).

I already found out, how to make the first product in my cart invisible in the fronted.
(CSS, display:none).
But now I don´t know, how to place the product always fixed in the cart.

Has anybody any idea?
Thank you,
Sara


texts: Can we trust Magento 2 builtin backup tool?

texts: In this post Ben Lessani - Sonassi said to not use the built in backup tool. Is it still true for Magento 2?


texts: how i can display label in only Inclusive of tax price before in magento 2

texts:
Exclusive word comes for both prices

  Hi I want to add a label before the product inclusive of price in
  magento 2

  but I added a label  using  this answer

https://magento.stackexchange.com/a/222750/73525

but it displaying label also exclusive price.

Does anyone help me to fix this issue??


texts: Magento 2 not passing minimum QTY when adding related products to cart

texts:
I'm currently experiencing an issue on Magento 2.2.5.  We have a number of simple products that have a minimum order qty set as 100.

If I view on of these simple products, we'll call this Product A. I can see the qty field defaults to 100 and when I add the item to the basket, it adds 100.  This is working correctly.

The issue occurs when I have another product (Product B) and Product B has Product A set against it as a related item.  If I tick the box to add Product A to the basket at the same time as Product B, it adds both products to the basket but there is an error message on the cart page as it has only added 1 Product A instead of 100.

Am I missing a simple setting or is it a bug in Magento?

Thanks


texts: How to stop saving resource model and throw error messages inside _beforeSave function?

texts:
I have the following codes inside a custom resourceModel class:

protected function _beforeSave(
    AbstractModel $object
)
{
    //My operations
    return parent::_beforeSave($object);
}

I added a checking inside _beforeSave() but I don't know how to prevent the resuorce model to continue the save actions.

I found this answer but it's for M1. I need a M2 solution.

Cancel save() in custom model if condition is met in _beforeSave()


texts: Magento 2: Add To Cart functionality from external site

texts:
I have my products in Magento db but I am borrowing the cart module from external site through an API. So basically when a customer clicks on "ADD TO CART" button, the product details are sent to the external site via a post API call,  now using a get API call I am retrieving the cart details from the external site. But I am not getting which particular classes do I need to override in Magento so that cart displays the product details retrieved from the API.
Also I am sending the product details to the external site by overiding the addProduct method in checkout module. Is this the correct way? I am confused about the parameters that are passed there i.e $product & $requestinfo .
Can you please clarify my doubts. Thanks in advance


texts: Instructions to update extension in Magento 1.9

texts:
I'm relatively new to Magento and am currently using version 1.9.3.9.

Out payment system providers (Adyen) have recently provided a new version of their extension with better security (on gitlab this version is designated adyen-magento-2.11.1.)

I'd like to install this new version but I'm concerned that if I do it wrong it will mess up the current version that is installed. I'm assuming that I'd have to log into SSH and use a composer update but I'm unsure about where to load the files and which command to use subsequently.

I cannot seem to find any instructions about how to update this version online.


texts: Magento 2 html file and phtml file in custom template process?

texts:
As I checked from magento 2 documentation about changing minicart content.

There are two ways :

In this page : http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-inherit.html

We change it by customizing minicart.phml and placing it in:
 app/design/frontend/OrangeCo/orange/Magento_Checkout/templates/cart/minicart.phtml

But on the other page :
http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-sample.html

We customise it in content.html and place it in:

app/design/frontend/OrangeCo/orange/Magento_Checkout/web/template/minicart/content.html

So these questions are :

How magento 2 decides when to use html file and phtml file ?

Is this related to 3 mode in Magento 2: Default, Developer and Production ?


texts:
The issue happen when i enable the flat product, and i need this feature to reduce the load/response time.

Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::getEntityTablePrefix() in /home/*****/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php on line 507


texts:
I need to add urldecode to the below function but unsure how to modify it so...

public function getAddFilterUrl($attribute)
{
    $filtering = $this->getRequest()->getParam('filtering', array());
    $filtering[] = $attribute->getAttributeCode();

    return $this->getUrl('*/*/*', array(
        '_current' => true,
        '_escape' => true,
        '_query' => array(
            'filtering' => array_unique($filtering)
        )
    ));
}

For example, the current URL outputted from the above is:-

/price_update/products/key/3b6f41cb95705740b8f46bbf1411a5e1/?filtering%5B0%5D=manufacturer

And what I want to output is:-

/price_update/products/key/3b6f41cb95705740b8f46bbf1411a5e1/?filtering[0]=manufacturer

I have tried modifying _escape in the array to no avail.


texts:
I am trying to upgrade Magento 2.3.2 to Magento 2.3.3. Copy and paste the file and run upgrade command but process stuck process not progress process.

  only show last is Schema creation/updates:

Following is screenshot:


texts: magento2 - catalogsearch override template not working

texts:
etc/frontend/routes:

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
    <route id="catalogsearch" frontName="catalogsearch">
        <module name="Vendor_Module" before="Magento_CatalogSearch"/>
    </route>
</router>
</config>

Controller:

namespace Vendor\Module\Controller\Result;

use Magento\Framework\App\Action\Context;
use Magento\Catalog\Model\Session;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Search\Model\QueryFactory;
use Magento\Catalog\Model\Layer\Resolver;

class Index extends \Magento\CatalogSearch\Controller\Result\Index
{
   protected $tglssearchHelper;
   protected $resultPageFactory;
   public function __construct(
    Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory

) {
     parent::__construct($context);
     $this->resultPageFactory = $resultPageFactory;
}

public function execute()
{   //echo 'tag exe';die;
    $resultPage = $this->resultPageFactory->create();
    $resultPage->getLayout()->initMessages();
    $resultPage->getLayout()->getBlock('catalogsearch.leftnav');

    return $resultPage;
}

}

UPDATED      view/frontend/layout:  catalogsearch_result_index.xml

<referenceBlock name="catalogsearch.leftnav">
<action method="setTemplate">
    <argument name="template" xsi:type="string">Vendor_Module::layer/view.phtml</argument>
</action>
 </referenceBlock>

view/frontend/templates:
    layer/view.phtml

/catalogsearch/result/?q=wirel...  i get blank screen.


texts:
Hi I have added a custom field on checkout page and it show in order also. But how can I actualy get it from the order in xml file. I already have taken in phtml with this part of code, <?php $order_ref = $this->htmlEscape($this->getOrder()->getssn());?>.
The module I have used is on this page http://excellencemagentoblog.com/magento-add-custom-fields-checkout-page.

And also I already have tried with previous code to get in xml but it doesn't work any proposition or help please


texts: Create a new package based on “default” package’s “default” theme

texts:
I'm studying to get Magento FE certification and I've found some demo questions like this:

  You want to create a new “screendesign” package based on the “default”
  package’s “default” theme. Which ONE of the following steps do you
  have to take?

  A. Copy app/design/base to app/design/screendesign

  B. Create an empty folder app/design/frontend/screendesign and copy
  app/design/frontend/default/default into it

  C. Create skin/frontend/screendesign, then copy the CSS and images
  folders and their files from /skin/frontend/default/default/ to
  skin/frontend/screendesign/default

  D. Inside app/design/frontend and skin/frontend, copy the folder
  “default” to the folder “custom”; then rename custom/default to
  custom/screendesign in both places

  E. Create app/design/frontend/default/screendesign

The answer suggested is C, but I don't agree and I think is B because if you don't create at least the package folder, you'll get error when setting the package (folder not found). Am I wrong?
thanks


texts: Magento 2 how to override the admin user's grid

texts:
I am trying to add new custom field in admin user's grid but it's not in UI components.
They are generating grid with data object in Magento\User\Block\User. Can any one please provide the solution to override the grid


texts:
For example I'm on boots catalog page: Shoes > Womens > Boots

If I add this code:

$category = Mage::getBlockSingleton('catalog/navigation')->getCurrentCategory();

It'll return only Boots category. How can I get full trail programatically starting from Shoes?

Thank you.


texts: Magento setPrice() and setCost() methods

texts: What is the difference between the Magento methods setPrice() and setCost()?


texts: 1.9.1 Responsive Transactional Emails: totals break table

texts:
I'm upgrading to 1.9.1 and I'm embracing the RWD email templates. Where are the totals generated for the transactional emails?  The order totals are breaking the table (see image). I can't find what's building getChildHtml('order_totals')

It's not /app/design/frontend/rwd/default/template/email/order/totals/wrapper.phtml

And it's not /app/design/frontend/rwd/default/template/email/order/items/order/default.phtml

Any help would be greatly appreciated. Thanks.


texts: When to use theme and when module to override layout and templates

texts:
I am confused about when to override things from my module and when from my theme.

I am creating a module in which I am changing the checkout functionality. I am using js-mixin, creating blocks and adding translations. I also need to override layout and template files, which is crucial and cannot exist independently without my mixins and blocks from the module.

The problem is that most (read "all") of the tutorials suggest overriding templates and layouts from a theme. For me, it doesn't make sense to add some things in the theme and some in the module if they cannot exist independently.

Is there anything wrong with overriding templates and layouts from a module (Im assuming there is a way to do it, I just haven't found it yet)?

EDIT Only just found this answer here, does add some clarity.


texts: Magento 2.3 error after filling in credit card info

texts:
We are using the payunity extension and following payment methods are available to our customer: Check/money, Visa, MasterCard and Sofortuberweisung.

The extension is set to test mode. If I set Payment Authorization to Server Authorization instead of Widget Authorization I can finish an order with Sofortuberweisung payment method without an error. But the credit card payment methods have only Widget Authorization available. The check/money payment method works fine.

I can get through the checkout without an issue but after I place the order it redirects me to this url: /payunitycw/checkout/widget/ where the widget in which I have to enter the credit card info is.

After I fill in the test credit card info and submit, I get this error:

  {"result":{"code":"200.300.404","description":"invalid or missing parameter","parameterErrors":[{"name":"form_key","value":"w3R1CsKRddwqheI2","message":"is not an allowed parameter"}]},"buildNumber":"deebd8c9af7d84ddee98c38b7f4afcc814012b5b@2019-01-22 13:58:00 +0000","timestamp":"2019-01-25 08:36:29+0000","ndc":"C54C9C1378FE55CE7A8407823A07DD5F.uat01-vm-tx02"}

Does anyone have an idea how to solve this? Any help would be appreciated. Thanks.