texts: Magento 2 - Add multiple simple product in cart programmatically

texts:
I'm trying to add to the cart the simple products of the programmatically configurable product.
For now I have this script that only puts 1 item in the cart and does not update the minicart:
<?php
namespace Catalog\Product\Controller\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Data\Form\FormKey;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\Product;
class Index extends Action
{
    protected $resultPageFactory;
    protected $formKey;
    protected $cart;
    protected $product;
    public function __construct(
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        Context $context,
        FormKey $formKey,
        Cart $cart,
        Product $product) {
            $this->formKey = $formKey;
            $this->cart = $cart;
            $this->product = $product;
            $this->resultPageFactory = $resultPageFactory;
            parent::__construct($context);
    }
    public function execute()
     {
        //INSERIMENTO NEL CARRELLO PER PROD CONFIGURABILE
        if($_POST['productType'] == 'configurable'){
            $resultRedirect = $this->resultRedirectFactory->create();
            $prodIdColl = $this->product->load($_POST['productID']);
            $simple_collection = array('valore1','valore2','valore3');
            $count = 1;

            foreach($simple_collection as $simple_product){

                ${'prodAddId'.$count} = $_POST['prodCol'.$count.''];
                if( $_POST['qtyCol'.$count.''] > 0 ){
                    ${'params'.$count} = array(
                                'form_key' => $this->formKey->getFormKey(),
                                'product' => ${'prodAddId'.$count} ,
                                'qty'   => $_POST['qtyCol'.$count.'']
                            );
                    ${'productCart'.$count} = $this->product->load( ${'prodAddId'.$count} );
                    $this->_cart->addProduct( ${'productCart'.$count} , ${'params'.$count} );

                }

            $count++;
            }
            $this->_cart->save();
            return $resultRedirect->setPath('checkout');
        }

        //INSERIMENTO NEL CARRELLO PER PROD SEMPLICE
        if($_POST['productType'] == 'simple'){
            $resultRedirect = $this->resultRedirectFactory->create();
            $productId = $_POST['productID'];
            $params = array(
                        'form_key' => $this->formKey->getFormKey(),
                        'product' => $productId,
                        'qty'   => $_POST['qtySimple']
                    );
            $product = $this->product->load($productId);
            $this->_cart->addProduct($product, $params);
            $this->_cart->save();
            return $resultRedirect->setPath('checkout');
        }
     }
}
?>

How can I put all the various simple products in the cart?
Issue with my script:
The problem is that this script only adds one product to the cart and not all the other simple products. The quantities instead the sums. For example, if I want to add 3 simple products to the cart, I only add the first one and add the quantities of all 3
Thank you


texts:
Want to convert number format into currency in mini cart.
Was able to convert it into PHP but it gets converted into another format due to JS

Number 1370000
convert to
$1.370.000,00

Magento2 : Manage currency format in multi-language website


texts:
For grouped products, I would like to see the picture of the by-products.

I  tried several things but without success:

in files : Magento_GroupedProduct\templates\product\view\type
In the loop of associated product, i wrote this code :

$productImage = $block->getImage($_item, 'product_base_image');

<a href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
     <?php echo $productImage->toHtml(); ?>
</a>

but it does not work!!
Would anyone have an idea.
Thanks


texts:
on production server I get main.CRITICAL: Invalid template file: 'my.phtml' in module: MyVendor_myModule, on dev machine everything works fine. How do I debug this?

under app/code/MyVendor/MyModule/View/frontend/layout/catalog_category_view.xml

<body>

    <referenceContainer name="product.info.main">
        <block class="MyVendor\MyModule\Block\Custom" name="product.share" template="MyVendor_MyModule::custom.phtml" after="-" />
    </referenceContainer>

</body>


texts: Is anyone successfully using CloudFlare with Magento + Magento API?  We're troubleshooting intermittent corrupted API results despite having a CloudFlare rule for all API calls as documented here: https://support.cloudflare.com/hc/en-us/articles/200504045-Using-CloudFlare-with-your-API.  Our current thinking is to host Magento's admin/api url on a sub domain so we can turn CloudFlare off on this subdomain.


texts: Optional parameter in Magento 2 REST API

texts:
I have a API route like,

<route url="/V1/product/:productId" method="GET">
    <service class="Vendor\Sample\Api\SampleInterface" method="sample"/>
    <resources>
        <resource ref="anonymous"/>
    </resources>
</route>

As you can see this route has a required parameter productId. Is it possible to add a optional parameter to this route?

Something like,

<route url="/V1/product/:productId/:optionalParam" method="GET">

Thanks in advance!!


texts: how to reward a customer that generates a sale

texts:
Let's say the shop sells once in a lifetime items. You won't buy again likely.
So I can't setup a discount for a customer A that bought an item already and then recommends that item/shop to another person B that then buys an item from the shop.
Also I don't want to discount possible customer B as this wouldn't benefit customer A.
To still stimulate the behaviour I would need to discount/refund customer A's already placed order if customer B buys an item.

What would be the best way to do this if there is any?


texts: How to add a custom CSS to a Store View?

texts:
I have a Shop running on Magento 1.9.2 with a Storeview and got the request to add a Storeview for a different Country with the exact same look.

My Problem is that the original Storeview somehow injects a custom CSS into the Main CSS and i am not able to trace down how this is done.

I searched the source thorougly and tried several tutorials, but for some reason everything i tried didn't work and i wasn't able to get the Custom CSS injected in my copied Storeview.

So my question is: How do i add a custom CSS to the Main CSS in a Storeview properly?


texts: Magento 2 Table missing catalogrule_product_replica

texts:
My magento version is 2.2.2
I tried to upgrade my version into 2.2.5CE
But it shows an error

  SQLSTATE[42S02]: Base table or view not found: 1932 Table
  'amsi_shopmgnto.catalogrule_product_replica' doesn't exist in engine,
  query was: SELECT COUNT(1) AS rows FROM
  catalogrule_product_replica

I checked it in my db the table entry is there but when I tried to retrieve the columns it showed an error

  Error Code: 1932. Table 'catalogrule_product_replica'
  doesn't exist in engine

Any solution for this issue? My cron is not working I can't update my version also.


texts: Resolved - Mass Action - Mass Database Update in Magento Grid

texts:
I have this grid developed for the custom module. I added the mass delete action which works fine. But the mass Approve/Disapprove actions work only for one value, when I select multiple values I get this error.
Please help to resolve this:

Here is the code for the approve function in controller file:

    public function massApproveAction() {
       $requestIds = $this->getRequest()->getParam('id');
       if(!is_array($requestIds)) {
       Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select reqeust(s)'));
       } else {
       try {

        foreach ($requestIds as $requestId) {
            $RequestData = Mage::getModel('cpstest_productcomment/cps')->load($requestId);
            $id = $this->getRequest()->getParam('id');
            $data = array('comment_status'=>'Approved');
            $model = Mage::getModel('cpstest_productcomment/cps')->addData($data);
            }
                $model->setId($id)->save();
                echo "Data updated successfully.";

        } catch (Exception $e){
                echo $e->getMessage();
        }
    }
}


texts: How to Show Product thumbnail (picture) in Sales -> Orders Grid in Magento 2

texts:
I have been able to add custom attribute to the orders grid but do not know how to render sold product thumbbnail.
How to show product picture on the Sales -> Orders grid?

So when a product is sold it would be great to see its picture next to the product SKU in the Sales -> Orders grid.
So when my friend helps me to pack all the orders, he can see how the product looks like and he can easily identify it.

Any Idea?


texts: Magento 2: Get Product Collection by Dropdown Value

texts:
How do you get a collection of products based on the drop down attribute value instead of the id?

....
protected $collectionFactory;

public function __construct(
    ...
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory
) {
    ...
    $this->collectionFactory = $collectionFactory;
}

protected function checkProducts()
{
    $product = $this->collectionFactory->create()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('new_product_status', ['eq' => 254]) // filter by value instead of id here
    ->setPageSize(1)
    ->getFirstItem();
}
...


texts:
I have this line

<!-- HEADER EOF -->
<?php echo $this->getChildHtml('slideshow'); ?>

in my header.phtml file however i need to move it so it is within the page. I thought about just pasting that line into its only .phtml file called slideshow.phtml then calling that on my CMS page using the line

{{block type="core/template" template="page/html/slidershow.phtml"}}

as the template file is located in design/frontend/mytheme/default/template/page/html. and when i look on my page with the block hints on it says the block is there but is displaying nothing.

how can i get this to display my slideshow.phtml file

Thank you


texts: magento2 how to set a loder widget on a page load event

texts:
i Want to set loader on page load event

how can do this any idea about that?

Any help would be appreciated.

Thanks.


texts: I want to remove the message from validation: [magento 2]

texts:
I want to remove the text :

"This is a required field."

from the validation.


texts:
We've recently inherited a mess of a Magento store with a new client that has come to us and there are thousands of DEBUG entries being written to log every minute.

They don't give a lot to go on from what is being written to log (below screenshot) and just wondered what the quickest way you could recommend would be, to track down just where these are coming from in the system?

Short of searching for Mage::log() or running a diff check on the entire site, I am unsure what else I can try.


texts: Checkout page custom filed value not save in magento 1.9.2

texts:
I have to add a custom field called "Mobile number" in Customer registration page and checkout registration the code working perfectly in customer registration but in checkout registration the value is not save i struggle on this for a month can any one help me

here is my config.xml

 <?xml version="1.0"?>
<config>
  <modules>
    <Mobilenum_Cusmobile>
      <version>0.0.1</version>
    </Mobilenum_Cusmobile>
  </modules>
  <global>
       <fieldsets>
        <checkout_onepage_quote>
            <customer_mobile_reg>
                <to_customer>mobile_reg</to_customer>
            </customer_mobile_reg>
        </checkout_onepage_quote>
    </fieldsets>
        <helpers>
      <cusmobile>
        <class>Mobilenum_Cusmobile_Helper</class>
      </cusmobile>
    </helpers>
    <models>
      <cusmobile>
        <class>Mobilenum_Cusmobile_Model</class>
        <resourceModel>cusmobile_mysql4</resourceModel>
      </cusmobile>
    </models>
    <resources>
      <customerattribute1486024557_setup>
        <setup>
          <module>Mobilenum_Cusmobile</module>
          <class>Mage_Customer_Model_Entity_Setup</class>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </customerattribute1486024557_setup>
      <customerattribute1486024557_write>
        <connection>
          <use>core_write</use>
        </connection>
      </customerattribute1486024557_write>
      <customerattribute1486024557_read>
        <connection>
          <use>core_read</use>
        </connection>
      </customerattribute1486024557_read>
    </resources>
  </global>
</config>

and my sql setup code

<?php
$installer = $this;
$installer->startSetup();

$installer->addAttribute("customer", "mobile_reg",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "Mobile Number",
    "input"    => "text",
    "source"   => "",
    "visible"  => true,
    "required" => true,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => ""

    ));

        $attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "mobile_reg");

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
        $attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100)
        ;
        $attribute->save();

$installer->endSetup();


texts: CloudFront like reverse proxy instead Varnish

texts:
I know that CloudFront is CDN, not reverse proxy, but if I understand correctly now is possible to use CloudFront to serve everything behind it.

I found few links, and seems like it is possible. For example:
http://www.zhudev.com/2018/10/19/use-aws-cloudfront-with-ec2-instance/
He set it, but I can't find any info if cookies will be problem and what problems can cause full page caching.
I found somewhere that cart can be problem for example, and also privileges in admin panel.

Does someone set like that?
Do you can me direct somewhere when I can read and understand how to set it up?

My plan is to set like:
Public ---> CloudFront -> ELB -> ASG


texts: Template invoice PDF - additional field tax rate

texts:
Here is code my template invoice PDF.

COMPANY

Address

mail@email.eu

KLIENT:

{{var formattedBillingAddress|raw}}

FAKTURA NR {{var invoice.increment_id}}

Data wystawienia faktury:{{var invoice.created_at}}

Status: {{var order.status}}

{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

how to display on invoice additional field TAX RATE for example 0% ?

Maybe someone can send a ready template?


texts:
I'm new to Magento and I'm on my learning curve. Recently I've installed on my test VM the latest and greatest ver. 2.4.2-p1.
I did a few test orders and I can't find a reason why, when being logged in as admin with theoretically full permissions, sales orders are sanitized with asterisks:

If I try to edit them I'm given information:

Access Denied You don't have permision to view

I've been trying to find information on different sorts of blogs, forums and so on, nothing. I can't find any related settings except User roles, which in case of admin, are set to "All". I did create different users (admins and other), and nothing. Can you point me at the right direction?


texts: What is the best email template extension?

texts:
I'am looking for an extension to create and edit my email templates. Can anyone recommend a good extension for Magento 2.2?

Christian


texts:
I have a collection of generic functions in my Magento project. Right now they're in single PHP file, and it's being called with a require_once in each phtml that needs it.

I don't like it and I feel there's got to be a better place for them.

What's the Magento way of dealing with this? A module just for these function? Most of them call Mage::app, but not all.


texts: Get customer ID inside phtml file used in order email

texts:
I am using a .phtml file which I pull into the order email I need to use the customer ID inside this .phtml file inside a function to pass back a value to my email, how can I get this information inside this .phtml file? My code is below:

$customerData = Mage::getSingleton('customer/session')->getCustomer();
$customerId = $customerData->getId();

Do I need to be looking at an order collection rather than the customer? If so what is the best way to go about this?


texts:
I want to create an sql query that will count the number of order per category month on month on a defined time frame.

i.e. from 1st april 2016 to 31st dec 2016, list number of orders per category and display by month

there will be overlap of order numbers since orders could have multiple categories in them... thats fine... and only need level 1 category breakup

is this even possible?


texts: Magento 2 Extend class with custom method through preference doesn't work

texts:
I'm trying to add a custom method Magento\LayeredNavigation\Block\Navigation. To my knowledge preference is the only way to do that.

My di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
 <preference for="Magento\LayeredNavigation\Block\Navigation" type="Vendor\ModuleName\Block\Navigation" />
</config>

My Navigation.php

<?php

 namespace Vendor\ModuleName\Block;

 class Navigation extends \Magento\LayeredNavigation\Block\Navigation
 {
  public function customMethod() {
   ...code
  }
 }

I run magento setup:upgrade and compile but when i try to call the function i get nothing back. Putting the same function in core works fine, so nothing wrong with the function itself.

<?php var_dump($block->customMethod()); ?>

Returns NULL

I've seen a bunch of questions from people having problems regarding this but not any satisfying solutions.


texts: Magento 2: Trouble adding product to cart

texts:
Randomly, when I add something to cart from the product page, I am redirected to the cart page and told I have nothing in my cart. This doesn't happen consistently – if I refresh the cache (magento cache:clean), I'm able to add to cart again as normal (item is added to mini cart and I'm shown the confirmation message at the top of the product page).

Unfortunately, for no reason (that I can find), after using the site for a short period after the cache refresh, I run into the issue again!

I've disabled my custom theme and also the modules I've created, but it continues to happen.

I've checked the session, which appears to be blank on the times the cart fails to update.

Any help/advice/ideas where to look, would be extremely helpful.


texts: Include Shipment and Inoices pdf generator in order grid in magento 2.3.2

texts:
As in magento 1, there is Shipment and invoice Pdf generator in order grid also.

How can i include that in magento 2 as well.
I want to include and shipment and invoce pdf generator in order grid Action tab as well.
https://prnt.sc/t42n33


texts: M2.2.5 : Can someone explain the role / functionality of the various tables used by the indexing process?

texts:
I've read the documentation about indexing in Magento 2, but it's very much on the surface. What I am wondering is how do the internals of the indexing mechanism work. Can somebody explain this to me? If I look for example at the Category/Product relation I can determine the following:

The following tables are involved in my setup:

catalog_category_product
catalog_category_product_cl
catalog_category_product_index
catalog_category_product_index_replica
catalog_category_product_index_store1
catalog_category_product_index_store1_replica
catalog_category_product_index_store2
catalog_category_product_index_store2_replica
catalog_category_product_index_tmp

So far, I understand the following about the indexing process:

Category/Product relations are stored in catalog_category_product.
Whenever the is a change to this relation, a new version is pushed to the changelog (catalog_category_product_cl) to be picked up by the Materialized View implementation by comparing versions in the mview_state-table.
catalog_category_product_index_tmp is populated during indexing and swapped at the end the process with catalog_category_product_index.

But here are my questions I still have left:

What is the purpose of the _replica-table?
Why are there indexes per store even though the catalog_category_product_index has a store_id-table?
Not sure if this is a bug, but why are there differences between the products in catalog_category_product_index::store_id=1 and catalog_category_product_index_store1? To clarify: In catalog_category_product_index I have a product that is assigned to 6 category ID's, whereas the same product in the dedicated _store1-index is only assigned to 4 category ID's. Could be a bug though.

Any help/explanation from core Magento developers or more experienced Magento developers is appreciated.


texts: Magento 1 vs Magento 2. Difference between solutions offered by Magento 1 and Magento 2 when is comes to web APIs

texts:
Specific on the area of web APIs.
Does Magento 2 offer something that Magento 1 does not.
Are there any problems with Magento 1 Web APIs that Magento 2 has fixed
What are the main differences between Magento 1 Web APIs and Magento 2 Web APIs

I've read the docs found here, found no obvious (or any other for that matter) differences

https://devdocs.magento.com/guides/m1x/api/rest/introduction.html
https://devdocs.magento.com/guides/v2.2/get-started/bk-get-started-api.html


texts: Magento 2: Checkout deselect a payment method trough PHP

texts:
Hi i'm currently doing the following: Magento 2: Hide payment method if company name field got a value this hides a payment method if company is filled. This works but....

If i first fill in a company and then go to payment the payment method is there. I select it and go back to the first step and remove the company name. Then go back to payment methods and my payment provider crashes since the selected payment method is now disabled.

I'm looking for a solution that deselects the payment method. Since the rest is in PHP i think php would be preferred. Or a complete new solution that also looks at the company name in JS?

Thanks in advance.


texts: Simple Product Price for configurable product

texts:
I am currently using Magento version 1.9.1, therefore I can't really use this plugin which does exactly what I want:
http://www.magentocommerce.com/magento-connect/simple-configurable-products.html

Is there a plugin (paid or free) that works for 1.9.1 and I can use it so when you select an option while on a configurable product, it fetches the SKU, price, images and description of the SIMPLE product? Also its very important for special prices to work, because for example I have a simple product that has different prices for Silver, Gold and VIP members so depending on what group the user is in should receive the correct price from the simple product price table when selecting an option.

Hope I was clear and thanks in advance.


texts: Magento 2 catalog search with apostrophe not working

texts:
When I search brand name like L'Occitane and Geather's
the search result does not give me the exact result
how can I achieve this ?
Magento Version 2.3.6 and search engine Mysql


texts: Magento 2: How to add a custom discount and title under discount in cart page

texts:
In magento2,  how to add a custom discount  and title under discount  in cart page

I have created a custom promotion in magento2.  I needed to do some customization in cart which I am trying to do with salesrule_validator_process event. I needed the rule name and discount values to be modified before applying in cart.


texts: Magento2 how to get upsell product on category listing page using object manager

texts:
Note : First of all it is not good practice to use object manager directly on any file.use magento standard only

Below code is just to show that how we can easily get the upsell product on category listing page.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$categoryId = $category->getId();
$categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory');

$category = $categoryFactory->create()->load($categoryId);
$categoryProducts = $category->getProductCollection()
                         ->addAttributeToSelect('*');

foreach ($categoryProducts as $product) {
    $current_product_id = $product->getId();
    $current_product = $objectManager->create('Magento\Catalog\Model\Product')->load($current_product_id);
    if ($current_product) {
    $upSellProducts = $current_product->getUpSellProducts();

    if (!empty($upSellProducts)) {
        foreach ($upSellProducts as $upSellProduct) {
                $productId = $upSellProduct->getId();
                $product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId);
                echo 'Upsell Product name---'.$product->getName().'

';
            }
        }
    }
}


texts:
When editing a product from the grid. We make changes, save and want to go back to the grid by clicking 1 button.
Question: How can I make Save & Close the default action instead of Save
Should Magento have a config option to make Save and Close the default acion? Or should it be Save and Close by default (instead of currently Save)


texts: Error 404 with all pages After Migrating my Magento to new server

texts:
After Migrating my magento to new server. My Homepage is working and my admin page is also working. But all frontend pages will give 404 error. Note from initial server index.php has been removed. For example instead of //mydomain.com/index.php/one-page.html, we uses mydomain.com/one-page.html.

In the new server mydomain.com/one-page.html. is not working (Error 404) until you put index.php to it before it gives content on the page

Please what is the way out ?


texts: How to add customer account login to custom module page

texts:
I have custom module that registers customers for an event/product.
I created a page that displays the registration form from my module.

The link to the registration page is in the footer.

When a user clicks on the footer link, I don't want users to be able to see the registration form if they aren't logged in.

So I need them to first see the login/register screen and only once they successfully login/register they should get redirected to the page with my module's registration form.

screenshot:

In attached image its should show form fields after login/register
magento1


texts: Compute shipping fee before choosing payment method

texts:
In my magento store, I have merged the payment method and review steps in the onepage checkout. The shipping method is also skipped since it's fixed(table rates). With that, after I input the billing info, it goes to the Payment and Order Review step which is the last step of my checkout page.

At the order review table on that section, the shipping fee is not displayed unless I go back one step and then forward again to Payment and Order Review step.

What I want to do is when I input the billing info, it computes the shipping fee before proceeding to the payment method step. That way it would already appear at the review table.


texts: I am developing a custom module for Magento 1. In this module there is a form field which uploads image. I would like to know the location of the uploaded image. Where can I find the uploaded images?


texts: Magento 2.1 Custom Field at Customer Registration Form Not Working

texts:
I need to add an affiliate email field for customer registration form .

Here are the files I used

app/design/frontend/vendor/theme/Magento_Customer/templates/form/register.phtml

        <?= __('affiliateEmail') ?>

            <input type="text" name="affiliate_email" id="affiliate_email" value="<?= $block->escapeHtml($block->getFormData()->getCustomField()) ?>" title="<?= __('affiliateEmail') ?>" class="input-text" data-validate="{required:false,'validate-email':true}">

app/code/vendor/module/setup/InstallData.php

namespace Vendor\module\Setup {
    use Magento\Customer\Setup\CustomerSetupFactory;
    use Magento\Customer\Model\Customer;
    use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet;
    use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;
    use Magento\Framework\Setup\InstallDataInterface;
    use Magento\Framework\Setup\ModuleContextInterface;
    use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * Install data
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{

    /**
     * CustomerSetupFactory
     * @var CustomerSetupFactory
     */
    protected $customerSetupFactory;

    /**
     * $attributeSetFactory
     * @var AttributeSetFactory
     */
    private $attributeSetFactory;

    /**
     * initiate object
     * @param CustomerSetupFactory $customerSetupFactory
     * @param AttributeSetFactory $attributeSetFactory
     */
    public function __construct(
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    )
    {
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    /**
     * install data method
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        /** @var $attributeSet AttributeSet */
        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);
        /**
         * customer registration form  affiliate email address
         */
        $customerSetup->addAttribute(Customer::ENTITY, 'affiliate_email', [
            'type' => 'varchar',
            'label' => 'Affiliate Email',
            'input' => 'text',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 1000,
            'position' => 1000,
            'system' => 0,
        ]);
        //add attribute to attribute set
        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'affiliate_email')
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer', 'customer_account_create'],
            ]);

        $attribute->save();

    }
}

}


texts: How to Add Attachment with email magento 2.3?

texts:
Can anyone help us on Add Attachment with email Magento 2.3? We have tried but face the same issue like this.

  Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Mail\Message\Interceptor::createAttachment() in Mail/TransportBuilder.php

Thank you in advance.


texts: proceed checkout btn redirect to onepage checkout instead of custom checkout extension

texts: I installed firecheckout, but when i click proceed checkout in shopping card page it redirect me to onepage checkout instead of firecheckout


texts: Difference between _extend.less . and _extends.less

texts:
While working on a custom theme with blank parent theme , I noticed strange behaviors:
First of all, gulp and grunt give a different output. Mostly these are parts of code in different order (on gulp's output, the parts are below to grunt's output).
Also, comparing only these code parts, there are differences. (see here)
With the help of sourcemaps it would seem that the code comes from

  "pub / static / frontend / vendor / theme / en_US / css / source /
  _extends.less"

This comes from the default blank theme.
Normally, Magento uses "_extend.less" files for less instructions extending existing styles.
But why use "_extends.less"?
I noticed it existed only in this position and only on the blank theme.

The styles-l.less load this file like this:

    @import (reference) 'source / _extends.less';

Is there a particular reason for its use?

UPDATE

Removing extends.less from blank theme, gulp's output and grunt's output are the same.

A possible workaround could be to remove the extends.less file and then have the same result with both.

However, there is still a doubt as to why this file was inserted (and why in this way).


texts: magento 2 e mails not sending since https

texts:
We have a Magento 2.1.11 website which started with http.

The automatic emails worked fine, but as soon as we put a redirect to https then they stopped sending.

Please can anyone help?


texts: Error message when I open the product page in admin backend

texts:
I transferred my database to a new site and now get an error message when I open product page in admin dashboard "Invalid entity_type specified:"
and other products have this error "No such entity with id=9". I'm using Magento CE 2.1.9

How do I fix that? Can anyone help me?

[2018-01-30 12:51:56] main.CRITICAL: Magento\Framework\Exception\LocalizedException: Invalid entity_type specified:  in /home/storesah/public_html/m4/vendor/magento/module-eav/Model/Config.php:350

[2018-02-06 07:33:04] main.WARNING: Magento\Framework\Exception\FileSystemException: Cannot gather stats! Warning!stat(): stat failed for /home/storesah/public_html/m4/pub/media/catalog/product/r/y/ryobi_chain_saw_cs-2240.jpg in /home/storesah/public_html/m4/vendor/magento/framework/Filesystem/Driver/File.php:71


texts: Magento\Catalog\Helper\Image returns unsecure product image url in custom CLI command

texts:
I am using Magento's image helper class to try to get a product's image url in a CLI command:
$this->image->init($product, 'product_page_main_image_default')->getUrl().

When I use this code in a block in a frontend page, it returns https://... but when used in a CLI command it instead returns http://.... I was having the same issues with the Magento\Framework\UrlInterface where getting the base url also returned the insecure version. I had to explicitly specific $this->url->getBaseUrl(array('_secure' => true)) to get the secure version.

For the CLI command, I am setting the area code to frontend and I am also emulating the frontend store view $this->emulator->startEnvironmentEmulation(1, \Magento\Framework\App\Area::AREA_FRONTEND, true); My admin has the correct Secure Base Url and Base Link Url in place.

I am wondering if I am doing something wrong or if anyone knowns a fix to get the secure product image url rather than doing a str_replace on the insecure url.

Edit: added relevant code snippet:

Where I am attempting to get secure product image url, using Magento\Catalog\Model\ProductFactory and Magento\Catalog\Helper\Image:

$product = $this->productFactory->create()
                ->setId($id)
                ->setImage($imageLink);

$this->image->init($product, 'product_page_main_image_default')->getUrl();


texts: Magento 2 how to get products per website programmatically?

texts:
I want to know how to get the amount of products per website? I don't know if this exists, it should.
I was searching for a plugin or observer, but I cannot find it, under magento-catalog and magento-catalog-inventory.
Greetings!


texts: Free Shipping shopping cart rule based on discounted subtotal

texts:
I know there are other instances of this questions strewn about on this stack, but I haven't found a clear and defined answer.

I currently have a free shipping shopping cart rule created. I have to use this method instead of the free shipping section under the config/shipping section of the admin since I have to exclude Hawaii & Alaska from receiving the free shipping. The rule is set to work on USA based orders with a subtotal of $75 or greater. Works perfectly fine, however, if someone also uses a discount code that puts them below the $75 threshold, it still applies the free shipping.

ex. Customer has a subtotal of $80 and then applies a 10% discount code, putting their subtotal at $72, magento still gives them free shipping since it's looking at the subtotal pre-discount.

I'm using 1.9.1 currently, how can I fix this easily? I'd rather not touch any core files, since I don't want to have to fix this anytime Magento gets upgraded.


texts: Magento2 store table the store_id needs changed from 2 to 0 to be reset

texts:
Not sure how it has occurred, but in our store table, the store_id has changed to 2, but should be 0 I believe for admin. What is the query to run to reset it?

We have backups with the correct values, but when uploading the backup, they do not take, and the incorrect value remains.


texts: Magento Search: Fulltext & Combine (Like and Fulltext) in relation to Relevance

texts:
I'm trying to understand the Magento search index, from what I've read the "Like" search type builds no relevance, and as such having that enabled and sorting by relevance is pretty pointless.

System → Configuration → Catalogue → Catalog Search → Search Type

I read this post on SO: Magento Search 'relevance' Value is Always 0

The answer (to which the bounty was awarded) by Vinai mentions some interesting points:

  Short answer: the relevance is only used in full text search mode.

  The way Magento builds the search index isn't very intuitive, I
  recommend a look at the table catalogsearch_fulltext. Then tune the
  attributes you want to use in the search by adjusting the Used in
  Quick Search property for them. This setting can be found under
  Catalog > Attributes > Manage Attributes. Then reindex the catalog
  search index. I also recommend clearing out the catalogsearch_result
  table after you adjust the attributes.

ColinM comments:

  After you truncate catalogsearch_result you need to
  also UPDATE catalogsearch_query SET is_processed=0 to force queries to
  be re-evaluated or else you get blank results

My questions are as follows:

Is it safe to truncate the catalogsearch_* tables (fulltext,query & result)
Does the Combine (Like and Fulltext) catalog search type utilize the relevance index?

Any input would be much appreciated.


texts: Magento 2 : How to display product name in custom tab in admin grid?

texts:
I want to display the product name in custom tab form on admin grid and
you can see the form image I have added below.


texts: how to get customer id by custom attribute value

texts:
I need to get customer id before login by custom attribute value in Magento 2.1.5, for login by username.
$this->customerRepository->get($username);


texts: customer_index_index: Please correct the XML data and try again. in Magento 2

texts:
I have created custom customer attribute by using new module and run the InstallData.php -

namespace mynamespace\modulename\Setup;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetup;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface {

/**
 * Customer setup factory
 *
 * @var \Magento\Customer\Setup\CustomerSetupFactory
 */
private $customerSetupFactory;

public function __construct(CustomerSetupFactory $customerSetupFactory) {
    $this->customerSetupFactory = $customerSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
    $setup->startSetup();
    /** @var CustomerSetup $customerSetup */
    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerSetup->addAttribute(Customer::ENTITY, 'service_agreement', [
        'type' => 'int',
        'input' => 'select',
        'position' => 25,
        'label' => 'Service Agreement',
        'required' => false,
        'sort_order' => 120,
        'source' => 'Magento\Config\Model\Config\Source\Yesno',
        'visible' => true,
        'system' => false ]
        //'is_used_in_grid' => true,
        //'is_visible_in_grid' => true,
        //'is_filterable_in_grid' => true,
        //'is_searchable_in_grid' => true]
    );

    // add attribute to form
    /** @var  $attribute */
    $attribute = $customerSetup->getEavConfig()->getAttribute('customer', 'service_agreement');
    $attribute->setData('used_in_forms', ['adminhtml_customer', 'customer_account_create']);
    $attribute->save();

    $setup->endSetup();
}

}

using magento setup:upgrade it installed and attribute created but when I going to "All customer" section from admin section its give me 500 error. As I check in log file its showing below error -

main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_518574bb8b0fd6fa628f8c37dcd7903e2 and handles default, customer_index_index: Please correct the XML data and try again.  [] []
main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_5cf9ab1b1723bedc1dcd665a812b00335 and handles admin-1column: Please correct the XML data and try again.  [] []
main.CRITICAL: Broken reference: the 'header' tries to reorder itself towards 'global.notices', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
main.CRITICAL: Broken reference: the 'page.breadcrumbs' tries to reorder itself towards 'notifications', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
main.CRITICAL: Broken reference: the 'global.search' tries to reorder itself towards 'notification.messages', but their parents are different: 'header.inner.right' and 'header' respectively. [] []

I am stuck in this, didn't fine any specific solution for this.


texts: Running a data install script using php -f /data-install-0.1.0.php

texts:
I'm trying to run this script and I keep getting this error.

vagrant@precise32:/var/www/app/code/local/Project/Config/data/project_config$ php -f data-install-0.1.0.php
PHP Notice:  Undefined variable: this in /var/www/app/code/local/Project/Config/data/project_config/data-install-0.1.0.php on line 11
PHP Fatal error:  Uncaught Error: Class 'Mage' not found in /var/www/app/code/local/Project/Config/data/project_config/data-install-0.1.0.php:14
Stack trace:
#0 {main}
  thrown in /var/www/app/code/local/Project/Config/data/project_config/data-install-0.1.0.php on line 14
vagrant@precise32:/var/www/app/code/local/Project/Config/data/project_config$

Here is my file:

<?php
/**
 * @category  Namespace
 * @package   Namespace_Module
 * @author    Anna Völkl
 * @author    Christoph Aßmann
 * @author    Fabian Schmengler
 */

/** @var Mage_Core_Model_Resource_Setup $installer */
$installer = $this;

// Make sure the upgrade is not performed on legacy installations with tables missing
$adminVersion = Mage::getConfig()->getModuleConfig('Mage_Admin')->version;
if (version_compare($adminVersion, '1.6.1.1', '>')) {

    $connection = $installer->getConnection();

    //---------------------------------------------------
    // Add variables
    //---------------------------------------------------
    $table = $installer->getTable('admin/permission_variable');
    $variableNames = array(
      'trans_email/ident_support/name',
      'trans_email/ident_support/email',
      'web/unsecure/base_url',
      'web/secure/base_url',
      'trans_email/ident_general/name',
      'trans_email/ident_general/email',
      'trans_email/ident_sales/name',
      'trans_email/ident_sales/email',
      'trans_email/ident_custom1/name',
      'trans_email/ident_custom1/email',
      'trans_email/ident_custom2/name',
      'trans_email/ident_custom2/email',
      'general/store_information/name',
      'general/store_information/phone',
      'general/store_information/address'
    );
    foreach ($variableNames as $variableName) {
        $connection->insertIgnore($table, array(
            'variable_name' => $variableName,
            'is_allowed' => 1,
        ));
    }

    //---------------------------------------------------
    // Add blocks
    //---------------------------------------------------
    $table = $installer->getTable('admin/permission_block');
    $blockNames = array(
      'core/template',
      'catalog/product_new',
      'enterprise_catalogevent/event_lister',
      'flexslider/view',
      'ebizmarts_abandonedcart/email_order_items',
      'ebizmarts_autoresponder/email_backtostock_item',
      'ebizmarts_autoresponder/email_related_items',
      'ebizmarts_autoresponder/email_review_items',
      'ebizmarts_autoresponder/email_wishlist_items',
      'tm_quickview/popup',
      'cms/block',
      'catalog/product_list',
      'tm_mailchimp/signup_general_form',
      'plugincompany_contactforms/form_embedded_view'
    );
    foreach ($blockNames as $blockName) {
        $connection->insertIgnore($table, array(
            'block_name' => $blockName,
            'is_allowed' => 1,
        ));
    }

}

Why does it keep saying uncaught error class Mage not found??


texts: I am using magento 1.9 for my website and I wish to set one time promotion without Coupon Code. So I have set "Use Per Customer" to 1 with "No Coupon". But customer can still use this promotion multiple time with Paypal Checkout. Is "Use Per Customer"  function only work with Coupon Code? Thanks in advance.


texts: Magento2 How to create custom variables to use on config.xml

texts:
In the etc/config.xml I can use some variables, like {{base_url}}, but I need to use other urls in this config.

How I can create custom variables to use in the etc/config.xml file?

Example:

In my config.xml I have this:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <payment>
        <pagseguro>
            <application_authorization_redirect>{{base_url}}pagseguro/application/authorization</application_authorization_redirect>
            <after_authorization_redirect>http://frontendapp.com/pagseguro</after_authorization_redirect>
        </pagseguro>
    <payment>
</config>

In the "application_authorization_redirect" I used the variable {{base_url}} but in the "after_authorization_redirect" I hardcoded the url, but I what to use here a dynamic url too. Something like:

<after_authorization_redirect>{{frontendapp_url}}pagseguro</after_authorization_redirect>


texts: Eliminate render-blocking JavaScript and CSS

texts:
I have been trying to speed up one of my latest website www.spicytrendz.in using google speed test
speed test result

if you go to the above url you will see google suggestion to fix blocking JavaScript and CSS on page load.

I have tried quite a few things but failed. one of the link I found in this link
I solve Remove render-blocking JavaScript issue

saying add prototype/prototype.jsasync in app\design\frontend\base\default\layout\page.xml

in my page.xml I can see the below entry:

<block type="page/html_head" name="head" as="head"> <action method="addJs"><script>prototype/prototype.js</script></action> <action method="addJs"><script>mage/translate.js</script></action> <action method="addJs"><script>lib/ccard.js</script></action> <action method="addJs"><script>prototype/validation.js</script></action> <action method="addJs"><script>varien/js.js</script></action>

<action method="addCss"><stylesheet>css/styles.css</stylesheet></action> <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action> <action method="addCss"><stylesheet>css/widgets.css</stylesheet></action> <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>

<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action> <action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>

</block>

I am not sure what the above code is doing. Can some one please tell me if there is any way I can call all my css and js on page load. Thank you for looking into this.

warm regards,
Saif


texts: Magento2 get Selected Customizable options value in addtocart.phtml page

texts: Magento 2.3.3 How can I get current selected Customizable options value in addtocart.phtml page. I need to pass it along with ajax call parameters to programmatically add product to cart from controller.


texts:
Does anyone know why after upgrading to Magento 2.2.9, we don't see the Dashboard Graph?  It seems really obvious but I can't work it out and my searches on Google aren't helping :-(

Any help greatly appreciated

Mike


texts:
I want to deploy the Magento Core Files (Magento CE 1.7.0.2) through modman. However, when the file app/Mage.php is symlinked, the Magento Shop returns the install page.

When i restore the original file for app/Mage.php, everything works again.
First, I supposed the file permissions for the symlinked file are not correct:

File: app/Mage.php

Symlinked: 777
Original: 664

However, it is impossible to change the file permission of a symlink.
In Magento Backend, the setting "dev/template/allow_symlink" is true.

The file app/Mage.php defines an incorrect magento root folder, when it is located for example at magento_root/.modman/Magento_Core/app/Mage.php and symlinked into magento_root/app/Mage.php. I could reproduce this with a magento vanilla installation.

Does anybody have an idea to overcome this issue?


texts: Magento 1 Product Image RollOver For Category Page

texts:
I am trying to create the ability for users to see the product rollover image on mobile category.
So when we click the product image on the right side middle of image, it should display another picture of the product.
Is their any free extension available for this ?
Or any ideas how can i start implementing this functionality ?
Thankyou


texts: When try to flush cache Magento admin get log out automatically and css files not found

texts:
I am getting a strange error in my Magento admin panel. Whenever I try to hit flush cache button, Magento admin gets logout and all CSS removed. It looks like this:

Then if I refresh it, I get normal Login screen of Admin panel. After I login again, all my websites (I am using multi-website) gone. So to achieve my websites again I have to save my main website from here:

After I hit save button, admin panel again gets logout and I get this window:

When I login again, all websites come back again and all goes fine. But If I again try to flush the cache, the above process again follows.

Please help me urgently.

Thanks


texts: Pages are not displaying on the front end properly

texts:
I don't know what my developers did but a site that was loading fine is now showing users basically I'm assuming how a bot sees it. Only shows menus at the text, no pictures unless you scroll so far down the page after the menu trees. See screenshot. I'm not a developer but need to know how to fix this as my developer can't recreate the error but I get customers calling and using Lucky Orange to watch customers on-site, this is what I see. Every single person coming to the site is leaving immediately so I know there is an issue (and more importantly, no orders).  I tried clearing the cache on Magento. My server company cleared the cache. I cleared the cache on CDN (sucuri).  It is also, in this screenshot is showing my trust symbol on the bottom right with 2/18 date but this was a visitor that visited the site today (3/5).  I wonder if this means they are looking at an older version of the site for some reason?

What may cause this?

Any help as my developer is not being helpful with this continuous issue. It doesn't happen for everyone which is part of the problem. But 90% of the visitors today did get this error.


texts: Why is my Magento Catalog Block Preference ignored in di.xml?

texts:
I am trying to extend the Magento\Catalog\Block\Product\ListProduct block in Magento 2.1
My Vendor_ModuleName module has the registration.php, the etc/module.xml and it's enabled.

Then I add an etc/di.xml file with the following content:

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

I expect the rendering of the catalog listing to break because my module block has not yet been created, however, my catalog seems to render as usual.

Indeed, no matter what I put in my Vendor\ModuleName\Block\Product\ListProduct class, it's completely ignored, and this is confirmed by enabling template and block name hints on the storefront: The output block is Magento\Catalog\Block\Product\ListProduct

What is it that I've missed here?


texts: M2 | Customer is not detecting by $customerSession->isLoggedIn()

texts:
I am trying to get loggedIn customer ID, I logged in and it is also showing in Online customer grid in the backend also can see on frontend. But if I check by

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
   echo "login";
}

It gives out as not logged in. (using DI way also result is same)

Also

$ID = var_dump($this->_customerSession->isLoggedIn());
    echo $ID;

It gives output as:

  bool(false)

How can I get Logged In customer ID from session ?


texts:
I have a virtual store in magento and I want to know which is the best plug-in email marketing or platform that can be synchronized with magento 1, to do:

an automatic email to send when the customer does not complete the
purchase and sends for him a discounted email.
automatic email for the birthdays of the month, on the anniversary
day.
an email for when the user has contracted the plan, send an email when this plan is close to expiring.
automatic welcome email.
automatic email when payment is not approved.
Any suggestion? Thanks in advance!


texts: Is there a way to add CMS block inside of the description tab on product page

texts:
I see many posts about creating a custom CMS tab on product page.
However is there a way to add cms block under existing tab (description)?


texts: Product page needs to be refresh after customer login in new tab of same browser in Magento

texts:
I am stuck in one problem with Magento.

When I click Addtocart button on product page of Magento, Product successfully adds in Cart and than I open the Customer Login Page in New Tab of same browser and than I Login successfully in that New Tab, But now the problem is when I go back the Product Page Tab and click AddtoCart button than product is not adding into Cart until I refresh the product page.

How I can add product in cart without refreshing the page after Login the customer account in another Tab of same browser?

Will appreciate any help please.

Thanks


texts: How to enable add to cart button duplicated on product page due to bootstrap4 display classes

texts:
im facing an issue in a theme for magento 2.3 im creating for the company i work for.
Here's the situation:
I'm using bootstrap4 grid css so i can take advantage of the layout features plus class utilities.
Given these, i duplicated the block add to cart to comply to graphic design of the product page showing and hiding it in certain device contexts, and now when the conditions to activate the add to cart button happens it only activates the first button on the DOM that appears, forgetting the other.
How can i proceed in order to allow for two add to cart buttons and that the two functions correctly in the product page?
Thanks in advance


texts: Magento 2 Free Input Text Field Attribute

texts: I would like to create a free input text field attribute, where basically the client, on the product page, have this input text field where he can insert a text, and if he chose to, the product will cost a bit more, basically a configured product. The problem is that when I try to create new attributes, the only option I get from Magento 2 are: Dropdown, Visual Swatch and Text Swatch(is a text I just click on, not a input field).


texts:
The below error reflecting on front end.

Array (
      [type] => 8
      [message] => Undefined index: price
      [file] => /home/studious/public_html/maal-php/app/design/frontend/rwd/default/template/catalog/product/brand.phtml [line] => 71
      )

and am using below code on line 71

<?php
    if($_GET['price']!="")
    {
    $price=str_replace(",", "%2C", $_GET['price']);
 $url="?brands=".$optionId."&price=".$price;
    }
    else
    {
    $url="?brands=".$optionId;
    $price="";
    }
    ?>


texts: php code to generate sku in magento 1.9.3

texts:
We have a mass import &update module installed in our magento 1.9.3.10, but the products in the import feed do not have skus. Therefore we need a php script to enable us to generate sku when importing the new products from the feed (the module has a text box for php script as part pf the mapping)
Thanks in advance


texts: All product displaying placeholder image instead of uploaded images

texts: I try to re save, reindex,update attribute, clear cache, images are checked in backend. 777 permission is given to media folder. i have disabled all extensions which were over-riding media.phtml but still it showing placeholder even in product listing page.


texts: Custom Console command creation error in Magento 2

texts:
I am creating console command to input values into the database, there is some argument missing an error. I have gone through several tutorials but to me, the code looks fine. The error is:

  Not enough arguments (missing: "Credit, Amount has been credited").

Here is Console Class:

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Vendor\Module\Model\AmountFactory;

class AddItem extends Command
{
const INPUT_KEY_ACTION = 'Credit';
const INPUT_KEY_REFERENCE = 'Amount has been credited';
//const INPUT_KEY_AMOUNT = 50;

private $amountFactory;

public function __construct(AmountFactory $amountFactory)
{

  $this->amountFactory = $amountFactory;
  parent::__construct();

}

protected function configure()
{

   $this->setName('example:credit:refund')
   ->addArgument(
    self::INPUT_KEY_ACTION,
    InputArgument::REQUIRED,
    'Action name'
   )->addArgument(
    self::INPUT_KEY_REFERENCE,
    InputArgument::REQUIRED,
    'Action Reference'
   );
   //$this->setDescription('Demo console command');

   parent::configure();
   }
protected function execute(InputInterface $input, OutputInterface $output)
  {
   $amount = $this->amountFactory->create();
   $amount->setAction($input->getArgument(self::INPUT_KEY_ACTION));
   $amount->setReference($input->getArgument(self::INPUT_KEY_REFERENCE));
   //$amount->setAmount($input->getArgument(self::INPUT_KEY_AMOUNT));
   $amount->setIsObjectNew(true);
   $amount->save();
   return Cli::RETURN_SUCCESS;
 }
 }

In di.xml:

<type name="Magento\Framework\Console\CommandList">
   <arguments>
       <argument name="commands" xsi:type="array">
           <item name="rhinosCredit" xsi:type="object">Vendor\Module\Console\Command\AddItem</item>
       </argument>
   </arguments>

When I uncomment lines for third argument i.e Amount I get error

  The "50" argument does not exist.

Can somebody help to figure out this error? Thank you


texts: Is that possible to set phone number in checkout page?

texts:
In my module i am creating one customer attribute in that i saved customer phone number.

Now i want to set that number in phone number field on checkout page if there is no address saved.

is this possible to do? if yes than how can i do this?

EDIT

InstallData

$customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

  $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'telephone_no', [
            'type' => 'varchar',
            'label' => 'Telephone No.',
            'input' => 'text',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 90,
            'position' => 90,
            'system' => 0,
        ]);

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

        $attribute->save();

EDIT THIS ONLY

 'used_in_forms' => ['adminhtml_customer','checkout_register','customer_account_create','customer_account_edit','adminhtml_checkout']


texts: How to call a controller action inside other Controller in Magento 2.2?

texts:
I have a form with text fields and one image file . I want to upload the image and next save the form information in the database.
I have two actions : Create and UploadImage.
I want to call the execute method of UploadImage action in the execute method of Create.
The idea is upload the file first and next create the fields.

It is possible to inject the UploadAction in my Create and call the execute method of UploadAction in the execute method of Create?


texts: In Checkout while Magento upgrade to 2.3.1 Exception #0 (InvalidArgumentException): Unable to serialize value

texts:
Getting below issue at checkout step after upgrade of magento to 2.3.1 from 2.1.8.

1 exception(s):
Exception #0 (InvalidArgumentException): Unable to serialize value.

Exception #0 (InvalidArgumentException): Unable to serialize value.
<pre>#1 Magento\Checkout\Block\Onepage->getSerializedCheckoutConfig() called at [vendor/magento/module-checkout/view/frontend/templates/onepage.phtml:26]
#2 include('/var/www/project...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#3 Magento\Framework\View\TemplateEngine\Php->render(&Magento\Checkout\Block\Onepage\Interceptor#000000001d8c0f290000000035fe6de3#, '/var/www/project...', array()) called at [vendor/magento/framework/View/Element/Template.php:271]
#4 Magento\Framework\View\Element\Template->fetchView('/var/www/project...') called at [vendor/magento/framework/View/Element/Template.php:301]
#5 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:668]
#6 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#7 Magento\Framework\View\Layout->_renderBlock('checkout.root') called at [vendor/magento/framework/View/Layout.php:533]
#8 Magento\Framework\View\Layout->renderNonCachedElement('checkout.root') called at [vendor/magento/framework/View/Layout.php:488]
#9 Magento\Framework\View\Layout->renderElement('checkout.root', false) called at [vendor/magento/framework/View/Layout.php:585]
#10 Magento\Framework\View\Layout->_renderContainer('content', false) called at [vendor/magento/framework/View/Layout.php:535]
#11 Magento\Framework\View\Layout->renderNonCachedElement('content') called at [vendor/magento/framework/View/Layout.php:488]
#12 Magento\Framework\View\Layout->renderElement('content', false) called at [vendor/magento/framework/View/Layout.php:585]
#13 Magento\Framework\View\Layout->_renderContainer('main', false) called at [vendor/magento/framework/View/Layout.php:535]
#14 Magento\Framework\View\Layout->renderNonCachedElement('main') called at [vendor/magento/framework/View/Layout.php:488]

Please let me know if someone faced this before.


texts: How to set the product can not be seen in new products block but still can be seen on the category page?

texts:
I try to add a product rather than as a new product but still be accessible from other pages such as categories or related products. In the admin panel, Set Product as New from Date and Set Product as New to Date has been filled in correctly. But the product still exists in the block of new products on the home page.

EDITED.

File edited from public_html/app/code/core/Mage/Catalog/Block/Product/New.php

This the code :

$collection = Mage::getResourceModel("catalog/product_collection');
$collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
        $collection = $this->_addProductAttributesAndPrices($collection)
            ->addStoreFilter()
            // this is the code i've edited
            ->addAttributeToFilter('is_new_product', array('eq' => 1))
            ->addAttributeToSort('news_from_date', 'asc')
            ->setPageSize($this->getProductsCount())
            ->setCurPage(1);

Can someone please explain?


texts: Magento 2 how to redirect backend controller to previous page?

texts:
I'm trying to redirect a controller that is executed in Order Detail.
If I end the controller returning redirect like this, it throws an error:
return $resultRedirect;

If I end the controller with exit; it does not throws error but a blank page is displayed.
exit;

Here is my code:
<?php

use Magento\Backend\App\Action;
use Magento\Framework\App\RequestInterface;
use Vendor\Module\Logger\Logger;
use Magento\Sales\Api\OrderRepositoryInterface;

class Pdf extends Action
{
    /**
     * @var PageFactory
     */
    protected $request;
    protected $logger;
    protected $orderRepository;
    protected $resultRedirectFactory;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */

    public function __construct(
        RequestInterface $request,
        Logger $logger,
        OrderRepositoryInterface $orderRepository,
        \Magento\Framework\Controller\ResultFactory $resultRedirectFactory,
        \Magento\Backend\App\Action $context
    ) {
        parent::__construct($context);
        $this->request = $request;
        $this->logger = $logger;
        $this->orderRepository = $orderRepository;
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->execute();
    }

    /**
     * Index action
     *
     * @return \Magento\Backend\Model\View\Result\Page
     */
    public function execute()
    {
        $completeState = \Magento\Sales\Model\Order::STATE_COMPLETE;

        $order_id = $this->request->getParam('order_id');

            $order = $this->orderRepository->get($order_id);
            $order->setStatus($completeState)->setState($completeState);
            $this->orderRepository->save($order);

            $resultRedirect = $this->resultRedirectFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setPath('/sales/order/view/order_id/'.$order_id.'/');
            return $resultRedirect;
            exit;

    }

}


texts:
I want to override a Zend class (Zend_Date). In Magento 1, I used to put Date.php in app/code/community/Zend  and Magento itself used to do the rest. But now, there is no such directory. How can I override that class?

Edit:
I installed Magento_SampleNewPage  module and it shows Hello world! message properly when I go to http://domain.com/newpage. I edited composer.json and added my Date.php  to it:

{
  "name": "magento/sample-module-newpage",
  "description": "A Magento 2 module that creates a new page",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/framework": "~100.0"
  },
  "autoload": {
    "files": [ "Zend/Date.php" , "registration.php"  ],
    "psr-4": {
      "Magento\\SampleNewPage\\": ""
    }
  }
}

But still, it doesn't work. When I instantiate a new Zend_Date , it's from vendor/Magento/zendframework1/library/Zend/Date.php  not my Zend_Date.


texts: Adding new blocks to a catalog product view

texts:
I'm trying to add multiple blocks to the right template part of my product view.

I want to add the "add to cart" buttons and some other information there.

My local.xml:

<catalog_product_view>
    <reference name="root">
        <action method="setTemplate">
            <template>page/3columns.phtml</template>
        </action>
        <block type="core/text_list" name="newreference" as="newreference" translate="label">
            <label>New Reference</label>
        </block>
    </reference>
    <reference name="left">
        <block type="core/template" name="leftprice" template="catalog/product/leftdesc.phtml" before="-"/>
    </reference>
    <reference name="right">
        <block type="core/template" name="rightprice" template="catalog/product/rightprice.phtml" />
        <block type="core/template" name="addtocart" template="catalog/product/addtocart.phtml" />
        <block type="core/template" name="addto" template="catalog/product/addto.phtml" />
    </reference>
</catalog_product_view>

in 3columns.phtml, I can load the right side template using <?php echo $this->getChildHtml('right') ?> - this loads the template file rightprice.phtml correctly. My question is how/where can I properly load the addtocart.phtml and addto.phtml blocks?

I've tried loading them in the rightprice.phtml using <?php echo $this->getBlockHtml('addto') ?> as well as the getChildHtml method as well, but this loads nothing. I know I'm probably giving magento the wrong information in my local.xml file, but I can't replicate any working examples to load the add to cart functionality in a different place than where it is currently.


texts: How to call Function in Javascript Magento2

texts:
I want to show alert using function in phtml file as per below but it seems like the function (myfunction) is not calling.

<button onclick="myFunction()">Try it</button>

<script type="text/javascript">
require(['jquery'], function($){
    function myFunction() {
      alert("I am an alert box!");
    }
})
</script>


texts: How to push order to paypal to get paid for pending orders : Magento

texts:
I am using PayPal express checkout on magento store. For some reason it was switched to sandbox and some customer put an order through this sandbox account so the orders are placed but no amount is received in actual pay pal account. Now I just want to know is there any way to push the orders to completed and get paid?

Thanks!


texts: Magento 2 : Pass argument/variable in component js

texts:
I am using Magento2.2 . I want to pass variable in component JS from phtml file on frontend but don't know how ? I am using following code

<div id="product-custom-info" data-bind="scope: 'custom-scope'">
    <!-- ko template: getTemplate() --><!-- /ko -->
    <script type="text/x-magento-init">
    {
      "#product-custom-info": {
            "Magento_Ui/js/core/app": {
            "components":{
              "custom-scope":{
                "component":"Namespace_Modulename/js/customjs"
              }
            }
          }
      }
    }
    </script>

</div>

Namespace/Modulename/view/frontend/template/web/js/customjs.js

define([
'jquery',
'ko',
'uiComponent',
'domReady!',
], function ($, ko, component) {
    'use strict';
    return component.extend(function(config){
      console.log(config);
      });
})

Please help me solve this problem. Any help would be appreciated.

Thanks in advance.


texts: Installation limit on purchased themes for Magento 2?

texts: Is there a limit on the number of stores or sites on which a purchased Magento 2 theme can be installed?


texts:
We need to figure out a way to only provide real time UPS rates if cart totals are over $65. This could be if a single product is over $65 or if multiple low priced items total over $65 - meaning we can't simply apply shipping rules to all products priced over $65. A user could buy a bunch of t-shirts that total over $65 and we would need UPS to be the only rate that appears.

Otherwise, if cart totals are less than $65, real time USPS rate will also be offered (in addition to UPS).

Is this possible? If so, how would we accomplish this?


texts: Magento in subfolder. Error in category page

texts: I have a magento installation "live" in my server ( www.mydomain.com ) and moved another installation of magento ( test website ) in a subfolder ( www.mydomain.com/test ). When i try to open the subfolder, i see only the homepage, and if i try to open category page , i see "page not found" but with graphic of live website. How i can fix this problem? I tryed to move the index.php and .htaccess of live website to website in test folder , and magento show me the homepage, but other page not work. I use magento 1.9.0.1


texts: How to show helper text / hint / label under product attributes in magento2?

texts:
I want to show some helping text under custom product attributes in the product grid in adminhtml. Is this possible?
Thanks for guidance!


texts: Is my product too complex to be sold as a configurable product

texts:
My product is made up of many different components. This product has 3 significant points of detail.

The first is the width - three options 0.7, 1.2, 1.8

The second is length - four options 1.2, 1.8, 2.4, 3.0

The third is height - ten options 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0

The final product is able to be any combination of these three points of detail, is it possible to sell a product with this many variances?

There is a final fourth choice that is footing - two options - fixed or portable - over 90% of the time the portable decision is portable and therefore a minor decision.

Furthermore I would like to add in the possibility of my clients being able to purchase additional components. Such as Components A and F that are based on width (choice 1) or Components B, C, D, E and G  which is based on length (choice 2).

Also if possible I would like my clients to also have the ability to omit components to lower the final price.


texts: Magento 2 : Need Slider on Page Other Than Homepage

texts:
I want to add slider on magento page and want to remove breadcrumb from other than homepage.

Any body can advice how can I add slider to page other than homepage, and how can I remove breadcrumb from just one page..

Thanks in advance.


texts:
When i am browsing my store and for example on page 3, I go into a product and the press the back button - this then takes me back to page 1 not back to where i was on page 3.

How do i sort this?


texts: Illegal offset type in isset or empty Magento 1.9

texts:
I currently have some errors in my system.log that I can not solve, due to default Magento core files:

2018-07-31T08:55:56+00:00 ERR (3): Warning: Illegal offset type in isset or empty  in /app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 53
2018-07-31T08:55:56+00:00 ERR (3): Warning: addcslashes() expects parameter 1 to be string, object given  in /lib/Zend/Db/Adapter/Pdo/Abstract.php on line 296
2018-07-31T08:55:56+00:00 ERR (3): Warning: Illegal offset type  in /app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 59
2018-07-31T08:55:56+00:00 ERR (3): Warning: Illegal offset type  in /app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 60
2018-07-31T08:55:56+00:00 ERR (3): Warning: Illegal offset type  in /app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php on line 62

How can I solve this issue?


texts: Trouble adding filter to product collection via observer

texts:
My goal is to filter the category product list by product's first letter. This works on my staging site by implementing the following:

/app/code/local/Etre/Alphapagination/etc/config.xml

    <catalog_product_collection_apply_limitations_after>
        <observers>
            <etre_alphapagination>
                <type>model</type>
                <class>etre_alphapagination/observer</class>
                <method>applyFilter</method>
            </etre_alphapagination>
        </observers>
    </catalog_product_collection_apply_limitations_after>

/app/code/local/Etre/Alphapagination/Model/Observer.php

<?php

class Etre_Alphapagination_Model_Observer
{
    public function insertPagination($observer)
    {
        /** @var $_block Mage_Core_Block_Abstract */
        /*Get block instance*/
        $_block = $observer->getBlock();
        /*get Block type*/
        $_type = $_block->getType();
        /*Check block type*/
        if ($_type == 'page/html_pager') {
            /*Clone block instance*/
            $_child = clone $_block;
            /*set another type for block*/
            $_child->setType('alphapagination/html_pager');
            /*set child for block*/
            $_block->setChild('originalPagination', $_child);
            /*set our template*/
            $_block->setTemplate('etre_alphapagination/alphapaginator.phtml');
        }
    }
    public function applyFilter($observer){

        if ($alphaFilter = Mage::getModel('etre_alphapagination/parametersactions')->currentAlphaFilter()) {
            $event = $observer->getEvent();
            $collection = Mage::getModel('etre_alphapagination/parametersactions')->applyFilter($event->getCollection(), $alphaFilter, "name");
            return $this;
        }
    }
}

The applyFilter function looks like this:

public function applyFilter($collection, $query="",$attribute = 'name') //let's provide the option to filter the collection by whichever attribute desired
{
    try {
        $collection->addAttributeToFilter('name', array('like' => $query.'%'));
    } catch (Exception $e) {
        Mage::logException($e);
    }
    return $collection;
}

The full code can be seen here.

Whenever I filter by a letter attribute counts are updated correctly but pagination is not and sometimes I get Magento's "there are no products matching this..." notice when there are results to be returned.

On my staging site the module works perfectly - but am having a hard time troubleshooting this on my live site.


texts: Magento 2.3.4 indexing error in Catalog Search indexer

texts:
Error when running indexing:

Notice: Undefined index: queries in /var/www/stage/vendor/magento/module-catalog-graph-ql/Plugin/Search/Request/ConfigReader.php on line 84


texts: How to create a category and add an image programatically

texts:
I've written a script that creates a category and adds a thumbnail image. It is inserted in the database but the thumbnail is not displayed.

When I upload from the backend it works fine.

This is my code

<?php
    require_once 'businessclasses.php';
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(1); // Mage_Core_Model_App::ADMIN_STORE_ID
$count = 0;
importRootCategories('us', '1/31/32', 4);
function importRootCategories($language, $path, $storeID)
{
    $data = new getCSV();
    $rows = $data->getRootCategories(); // Gets the list of root categories.
    foreach($rows as $row) {
        $categoryName = utf8_decode(iconv('ISO-8859-1','UTF-8',strip_tags(trim($row[$language])))); // Name of Category
        if($language == "us") {
            if($row[$language] == "")
                $categoryName = utf8_decode(iconv('ISO-8859-1','UTF-8',strip_tags(trim($row["en"])))); // Name of Category
        }
        // Create category object
        $category = Mage::getModel('catalog/category');
        $category->setStoreId($storeID); // 'US-Store' store is assigned to this category
        $rootCategory['name'] = $categoryName;
        $rootCategory['path'] = $path; // this is the catgeory path - 1 for root category
        $rootCategory['display_mode'] = "PRODUCTS";
        $rootCategory['include_in_menu'] = 1;
        $rootCategory['is_active'] = 1;
        $rootCategory['is_anchor'] = 1;
        $rootCategory['thumbnail'] = _getCategoryImageFile($row['catimg'].'.jpg');
        $category->addData($rootCategory);
        try {
            $category->save();
            echo $rootCategoryId = $category->getId();
        }
        catch (Exception $e){
            echo $e->getMessage();
        }
    }
}
function _getCategoryImageFile($filename)
{
    $filePath = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'category' . DS . $filename;
    $fileUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'import/category/'. $filename;
    $imageUrl=file_get_contents($imageUrl);
    $file_handler=fopen($filePath,'w');
    if(fwrite($file_handler,$fileUrl)==false){
       Mage::log('ERROR: ', null,'error');
    }
    else{
        Mage::log('Image Created Successfully', null, '');
    }
    fclose($file_handler);
    return  $filename;
}
?>


texts: How do I trigger on customer delete event

texts:
I am trying to triggering my function using the event customer_delete_before.

Here is what I wrote in the config.xml:

<customer_delete_before>
    <observers>
        <module_customer_delete>
            <class>module/observer</class>
            <method>deleteCustomer</method>
        </module_customer_delete>
    </observers>
</customer_delete_before>

I've already used that xml to triggering other events but only this one does not work.

I'm using Magento 1.9.1.1.


texts: After created custom theme in magento, list.phtml file is not working fine in Mobile App, when change product mode List/Grid?

texts:
I am facing issues in app/design/frontend/Abc/theme1/template/catalog/product/list.phtml file for custom theme in Magento. I am creating Mobile App for my site.

When I am click on List/Grid/Pagination/Sort by option on product list page, then my custom theme file app/design/frontend/Abc/theme1/template/catalog/product/list.phtml is not called, It is called from my other custom theme app/design/frontend/Abc/theme2/template/catalog/product/list.phtml after change the mode(Grid/List).

By default, When I open the app first time it will be called from theme1 list.phtml file, but after change the mode, it will be called from theme2 list.phtml file.

I have already created local.xml file for my custom theme1.
This issue happen Only for Mobile App.

Why my list.phtml file is not working after change product mode(List/Grid)?

Please give me suitable solution for this issue ?


texts:
I have an issue with my website. I do not know what's wrong and i forgot what i did last time. The mini cart doesn't update itself when i tried to add product, the mini cart's counts works well, but when i'm trying to view my mini cart, it says "You have no items in your shopping cart."

This is my website :http://sanvanina.com. Please help me, thank you


texts: Decrease stock when order status changes to processing

texts: I have a condition that I have to change/decrease the stock only when the order status changes to processing. By default it is changed as soon as order is placed. But, this is what I need to achieve.


texts: magento 2 Change configuration value dynamically on certain condition

texts:
I required to change configuration values dynamically On certain condition.

Consider i need to change value of "Display Out of Stock Products" dynamically on certain condition.

I do not want to make changes by using plugin or observer where it is used.

Thanks


texts:
Having a huge problem with sales tax calculation.
Magento 1.9

In NY state clothing and shoes under $110 cannot be charged with tax, and items in magento store that were more than $110 and after discount price went bellow $110 are still being taxed.

Here is how I have it set up
and this is how it comes up on checkout.
original price on this jacket is $223 and after 60% sale its $89 however magento still adds tax to the discounted price.
Thanks in advance guys.


texts: How can I get admin order view blocks into a custom module page

texts:
I've got a custom module, Mirasvit Ticket, and I've added a tab for order information.

I'd like to be able to place pretty much the entire order view into that tab. However, I'm unable to get the blocks to show up.

Here's what I've pasted into my custom view pulled from app/design/adminhtml/default/default/template/sales/order/view.phtml

The file I'm working on is:

app/design/adminhtml/default/default/template/mst_helpdesk/ticket/edit/tab/orderinfo.phtml

        <col />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <col width="1" />

                <?php echo $this->helper('sales')->__('Product') ?>
                <?php echo $this->helper('sales')->__('Item Status') ?>
                <?php echo $this->helper('sales')->__('Original Price') ?>
                <?php echo $this->helper('sales')->__('Price') ?>
                <?php echo $this->helper('sales')->__('Qty') ?>
                <?php echo $this->helper('sales')->__('Subtotal') ?>
                <?php echo $this->helper('sales')->__('Tax Amount') ?>
                <?php echo $this->helper('sales')->__('Tax Percent') ?>
                <?php echo $this->helper('sales')->__('Discount Amount') ?>
                <?php echo $this->helper('sales')->__('Row Total') ?>

        <?php $_items = $_order->getItemsCollection() ?>
        <?php $i=0;foreach ($_items as $_item):?>
            <?php if ($_item->getParentItem()) continue; else $i++;?>
            <tbody class="<?php echo $i%2?'even':'odd' ?>">
                <?php echo $this->getItemHtml($_item) ?>
                <?php echo $this->getItemExtraInfoHtml($_item) ?>

        <?php endforeach; ?>

I'm thinking that my problem is that $this is clearly different from the $this in that file.

Is there a way I can just load the blocks directly?


texts: Shopping Cart Price Rules not applied to correct group_id

texts:
While debugging the shopping cart price rule calculation i found out that the system uses the default_group configured in backend instead of the actual customer group on this customer group sensitive rule.

It seems to me that this is a bug. But i have never heard of this. I am quite sure there is no custom code responsible for this. When i look into sales_flat_quote db table the customer group id is correctly set with the actual customers group id.

Any hints on this topic?

I checked this in class

  code/core/Mage/SalesRule/Model/Quote/Discount.php

in method

  collect()

This is the proof:

        Mage::log("BEFORE ENTERING CALCULATOR WE SEE default_group ID");
        Mage::log($quote->getCustomerGroupId());
        $this->_calculator->init($store->getWebsiteId(), $quote->getCustomerGroupId(), $quote->getCouponCode());

I am still debugging but maybe you guys have some hint from experiencing same problems...thank you so much!

P.S.: this is found in EE 1.12 but i am sure its in 1.7.0.2 too.


texts: Connecting Maria db 10.2 to magento 2.3.5

texts:
I have website to connected database
I am using RDS MARIAB 10.2
while running upgrade command faced :
SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable), query was: CREATE
   TRIGGER trg_catalog_compare_item_after_insert AFTER INSERT ON catalog_compare_item FOR EACH ROW
  BEGIN
  INSERT INTO m2_cl_catalog_compare_item (`catalog_compare_item_id`, `operation`) VALUES (NEW.catalog_compare_item_id, 'INSERT')ON DUPLICATE KEY UPDATE operation = 'INSERT';
  END

any solution??


texts: Magento 2: How to get the themes detail that are used by my magento site?

texts:
I was trying to get the theme detail used by the Magento but got nothing till now.
I am using this method still get nothing special.

  public static function ThemeDetail(){
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance()
                ->get('Magento\Framework\App\ResourceConnection');
             $connection= $objectManager->getConnection();
             $theme_table = $objectManager->getTableName('theme');
             $theme_data = $connection->fetchAll("SELECT * FROM ".$theme_table);
             if(!empty($theme_data)){
                foreach($theme_data as $theme_name => $value){
                 $themeArray[] = array('name'=> $theme_data[$theme_name]['theme_title'], 'version'=>'2.0.5');
                }

              return $themeArray;
             } else {
              return FALSE;
             }

      }


texts: Display Date in Block in Customer's Timezone

texts:
I am trying to display a date I have a store in a custom table in UTC format in a block; I need to display this date in the customer's timezone (it is an expected delivery date).
What is the proper way to do this in Magento?
Thanks.


texts: Magento 1.9 use Paypal Express order status is wrong!

texts:
i use paypal express payment,after paid the order status become "pending" from "processing",
this is "DoExpressCheckoutPayment" picture

please help me ~~thanks


texts: Toolbar not showing in overridden catalog list block

texts:
I have this in my di.xml

<type name="Magento\Framework\View\Element\AbstractBlock">
    <plugin name="easymart_inject" type="NameSpace\Module\Plugin\CategoryPlugin" />
</type>

And my CategoryPlugin.php

<?php
namespace NameSpace\Module\Plugin;

class CategoryPlugin
{

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

    public function __construct(
        \Magento\Framework\App\RequestInterface $request,
        \Magento\Framework\Registry $registry
    ){
        $this->_request = $request;
        $this->_coreRegistry = $registry;
    }

    public function aftertoHtml(\Magento\Framework\View\Element\AbstractBlock $block, $result){

        if($this->_request->getFullActionName() == 'catalog_category_view'){
            $category = $this->_coreRegistry->registry('current_category');
            if($category && $category->getId()==5 && $block->getNameInLayout() == 'category.products.list'){
                $bl = $block->getLayout()->createBlock(\NameSpace\Module\Block\Band::class);

                return $bl->toHtml();
            }
        }
        return $result;
    }

And my Band.php class

<?php
namespace NamsSpace\Module\Block;

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Block\Product\ProductList\Toolbar;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\Config;
use Magento\Catalog\Model\Layer;
use Magento\Catalog\Model\Layer\Resolver;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Catalog\Pricing\Price\FinalPrice;
use Magento\Catalog\Pricing\Price\BasePrice;
use Magento\Catalog\Pricing\Price\ConfiguredRegularPrice;
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\App\Config\Element;
use Magento\Framework\Data\Helper\PostHelper;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Pricing\Render;
use Magento\Framework\Url\Helper\Data;

class Band extends \Magento\Catalog\Block\Product\ListProduct
{
    protected $_productFactory;
    protected $_storeManager;
    protected $baseAmount;
    protected $priceInterface;

    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        PostHelper $postDataHelper,
        Resolver $layerResolver,
        CategoryRepositoryInterface $categoryRepository,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        Data $urlHelper,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Pricing\Amount\BaseFactory $baseAmount,
        \Magento\Framework\Pricing\Price\AbstractPriceFactory $priceInterface,
        array $data = []
    ) {
        $this->_productFactory = $productFactory;
        $this->_storeManager = $storeManager;
        $this->baseAmount = $baseAmount;
        $this->priceInterface = $priceInterface;
        parent::__construct(
            $context,
            $postDataHelper,
            $layerResolver,
            $categoryRepository,
            $urlHelper,
            $data
        );
        $this->setTemplate('NameSpace_Module::band.phtml');
    }
}
?>

Now, in my band.phtml all the products for that category is loaded, but no toolbar is printing.

My band.phtml

$_productCollection = $block->getLoadedProductCollection();
//echo "SIZE: ".$_productCollection->getSize()."<br>"; //prints correct size

But it never shows toolbar. Below code in band.phtml has no effect at all. Any suggestions?

<?= $block->getToolbarHtml() ?>
<?= $block->getChildHtml('product_list_toolbar') ?>
<?= $block->getChildHtml('toolbar') ?>


texts: Is it possible that Magento doesn't transform my optimized images?

texts:
a graphic designer optimizes the images (products, galleries,...) for me, with good proportion of quality and compression,… and then Magento creates new images,… that are double size and not same quality. In example, 3 optimized images with sizes 392K, 428K, 281K, Magento create new ones to cache folder, and what I get at frontend are this new images: 642K, 738K, 504K.

So, my question is How can I solve this? It has no sense to have a graphic designer, and then Magento overwrite his work,...

Thank you.


texts:
In catalog_product.view.xml I try move product tabs to short description area:
<move element="reviews.tab" destination="product.info.overview" after="-" />
<move element="product.attributes" destination="product.info.overview" after="-"/>

When I use this code, tabs disappear. Does anyone have any solution?
https://prnt.sc/tc42v2


texts:
I created my own admin route.
This is it's controller:

  Route controller

<?php

class Mediabase extends \Magento\Sales\Controller\Adminhtml\Order
{
    public function execute()
    {

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $urlInterface = $objectManager->get(\Magento\Backend\Model\UrlInterface::class);
        $mediabaseUrl = $urlInterface->getUrl("uo_mediabase/order/mediabase");

        print_r($this->getRequest()->getPost());
        $currentUrl = $urlInterface->getCurrentUrl();
    }
}
?>

This is the form which is calling the route

        Mediabase

        Bestellnummer

        Mediabase-Bestellnummer: <?php echo $block->getMediabaseNumber(); ?>

    <form id="mediabase_edit_form" action="<?= $this->getFormUrl() ?>" method="post">
        <input type="text" name="bestellnr">

        <input class="action-default" type="submit" value="Speichern">
    </form>

So when the route is called I want to get the

  bestellnr

value.

However my form doesn't seem to send POST data.

Do you know how I can achieve that?

Thanks!


texts: Why magento not provide facility of add product for a store view

texts:
I am working on multi store functionality and stuck in a problem for managing products.
My requirement is just around for store views products that's why sending this post.
I just want to know, why magento not implement functionality at the time of add product for choose store view also.


texts: Magento 2 - remove stylesheet and javascript from the home page to improve page load speed

texts:
i'm trying to remove some unnecessarily css and javascript that is included in the homepage.
For example, the swatches.mini.css, blog-m.min.css, blog-custom.min.css, calendar.min.css doesn't seem to need to be loaded at homepage, etc. I would like to try to remove them in order to increase the pagespeed.

<meta name="robots" content="INDEX,FOLLOW" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
<title>example® </title>
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/mage/calendar.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/css/styles-m.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/css/exampleStyle.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/Magefan_Blog/css/blog-m.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/Magefan_Blog/css/blog-custom.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/Magezon_Core/css/styles.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/Magento_Swatches/css/swatches.min.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/css/styles-l.min.css" />
<link rel="stylesheet" type="text/css" media="print" href="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/css/print.min.css" />
<script type="af29dba34304251ada1879a6-text/javascript" src="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/requirejs/require.min.js"></script>
<script type="af29dba34304251ada1879a6-text/javascript" src="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/requirejs-min-resolver.min.js"></script>
<script type="af29dba34304251ada1879a6-text/javascript" src="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/mage/requirejs/mixins.min.js"></script>
<script type="af29dba34304251ada1879a6-text/javascript" src="https://www.example.com/pub/static/version1564705015/frontend/Infortis/ultimo/en_US/requirejs-config.min.js"></script>
<link rel="canonical" href="https://www.example.com" />
<link rel="icon" type="image/x-icon" href="https://www.example.com/pub/media/favicon/default/example_favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="https://www.example.com/pub/media/favicon/default/example_favicon.png" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">