texts: Fatal error after upgrade from 2.1.8 to 2.2.0

texts:
I was running 2.1.8 (or if it was 2.1.9) and decided to upgrade. After some errors (documented at gitHub), I was able to run php bin/magento setup:upgrade. It tells me to run bin/magento setup:di:compile, which I did.

It throws the following error:

Fatal error:  Class MagePal\GmailSmtpApp\Model\Transport contains 1
abstract method and must therefore be declared abstract or implement
the remaining methods (Magento\Framework\Mail\TransportInterface::getMessage)
in /opt/bitnami/apps/magento/htdocs/app/code/MagePal/GmailSmtpApp/Model/Transport.php
on line 11

I tried clearing the different var-directories (when in my magento-root), with

rm -rf ./var/di/* ./var/view_preprocessed/* ./var/generation/*
./var/composer_home/* ./var/cache/* ./var/page_cache/*

I've reset the permissions of the owner according to the manual at bitnami (this is the image I run, on a Google cloud instance).

I also looked into the transport.php-file. This didn't implement the getMessage()-function. So I used composer to get the latest (composer require magepal/magento2-gmailsmtpapp), I copied the complete folder into the app/code/-directory instead, as it was where I originally had it. Then, I removed it with composer (composer remove magepal/magento2-gmailsmtpapp). I again clean the different var-directories. I then run the magento setup:upgrade-command and magento setup:di:compile-command again. It throws the same error. For reference, the transport.php-file looks like this. This is one solution to the issue, I just messed up the copying (see below answer).

Sometimes, there is also a note about Segmentation fault. However, it seems to disappear after I've runned the setup:di:compile a couple of times, I also read about setting "ulimit -s 65536", it doesn't help.

The only thing I've been able to do, to get it up and running again is to rollback backups into a clean 2.1.9-installation.

Any advice would be very appreciated. Thanks.


texts: Wrong products show up on substore main page?

texts:
We use Magento ver. 1.9.3.6

We have multiple substores in our shop
In substore with store_id=3 products must be shown from cat_id=233
In CMS page I added:

 {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="233" template="catalog/product/list.phtml"}}

But the substore home page is also showing products from other categories??
I disabled all cache and enabled SQL logging.

This is the SQL Magento produces:

SELECT `e`.`entity_id`, `e`.`type_id`, `e`.`attribute_set_id`, `cat_index`.`position` AS `cat_index_position`, `e`.`name`, `e`.`description`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`weight`, `e`.`manufacturer`, `e`.`manufacturer_value`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`color`, `e`.`color_value`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`status`, `e`.`url_key`, `e`.`visibility`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`msrp_enabled`, `e`.`msrp_display_actual_price_type`, `e`.`msrp`, `e`.`tax_class_id`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`shipment_type`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`ean`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `stock_status`.`stock_status` AS `salable`, `at_bestsellers`.`bestsellers`
                           FROM `catalog_product_flat_3` AS `e`
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON
                          cat_index.product_id=e.entity_id AND
                                      cat_index.store_id=3 AND
                             cat_index.visibility IN(2, 4) AND
                             cat_index.category_id = '233' AND
                                     cat_index.is_parent=1

 INNER JOIN `catalog_product_index_price` AS `price_index` ON
                       price_index.entity_id = e.entity_id AND
                              price_index.website_id = '1' AND
                        price_index.customer_group_id = 0

 LEFT JOIN `cataloginventory_stock_status` AS `stock_status` ON
                      e.entity_id = stock_status.product_id AND
                      stock_status.website_id=1

 LEFT JOIN `am_sorting_bestsellers` AS `at_bestsellers` ON
                     (at_bestsellers.`id`=e.entity_id) AND (at_bestsellers.store_id = '3') WHERE
        (e.status = 1) ORDER BY `salable` desc, `bestsellers` desc, `at_bestsellers`.`bestsellers` DESC LIMIT 12

Now I took a faulty product that was showing on the page:
it has entity_id 3601

Now when I do

SELECT * FROM `catalog_category_product_index` WHERE `product_id` = 3601 AND `store_id` = 3

Then I get 3 results with one result in category 233 ?? (other 2 correct for this product)
In the backoffice I checked this product, and only 2 categories are checked.

How is this possible??

When I look in catalog_category_product there the correct results (for that product) are given.

It seems catalog_category_product_index has faulty entries...
I re-indexed all products, without any success

Can anyone give me some guidance how to solve this problem?

Kind regards
John


texts: Send Order Email Programmatically Magento 2

texts: How To send Order Email Programmatically In Magento 2.2.8


texts: Magento 2 Redirect To Product Details Page If hit the link of any disable product it open on another product of same Category as Product Details Page.


texts: Magento 2 Create Product Customizable Option programmatically without using objectmanager

texts:
Magento 2 How to create the Product Customizable options without using the Objectmanager.I saw many tutorials but the all tutorials is used the objectmanager.Magento Coading Standard does not allow the objectmanager.

Thank you so much


texts:
I have a brand new Magento instance (2.4) and an old instance (2.3) with product/order/cms/theme data.
I would like to migrate the data from Magento 2.3 to 2.4, is there any way to do this?
I have tried upgrading the existing 2.3 (cli) site but running into a lot of errors - and to move to a new set up, where I know 2.4 is working, seems to be a sensible option, but is it possible?


texts: My Magento Extension manager gets stuck at "Please wait", What do I do?

texts:
Initially when I accessed the extension manager, I had this error
Command "show" failed: GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/splashlab/magento-2-cors-requests/tags?per_page=100. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset. Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+server178.web-hosting.com+2020-09-02+1510 to retrieve a token. It will be stored in "/home/goldkuvc/idgigs.com/var/composer_home/auth.json" for future use by Composer. Token (hidden): No token given, aborting. You can also add it manually later by using "composer config --global --auth github-oauth.github.com " In RemoteFilesystem.php line 687: Could not authenticate against github.com show [--all] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest] [-o|--outdated] [--ignore IGNORE] [-m|--minor-only] [-D|--direct] [--strict] [-f|--format FORMAT] [--] [ []]
Then after series of debugging I discovered my composer.json wasn't able to access the token given, then I included this
"config": {
"github-oauth": {
"github.com": "my-token"
}
} in the composer.json file, then cleared the cache, when I tried access the Extension manager, it got stuck at "Please wait". What do I do Please??


texts: State field misaligned in billing form - Magento 2 checkout page

texts:
The state field coming top of the billing form in checkout payment page.

The issue coming only in chrome browser when I refresh the page more than three times.  I hope that it is because of cache issue.

Can anyone please help me on this issue?

Thanks,
Karol M


texts: reimport missing data after migration is done

texts:
i did data import to migrate all my products by after migration i found few order or new customer.

now i do not want to redo database reset and redo migration is there way to migrate just missing one or way that migration will start from last migrated data anything to solve rework


texts: Need to create the QRcode for the for specific URL, so that customer will scan the QR code and redirect to specific URL.


texts: Magento 2 - enable cash on delivery only for specific shipment method

texts:
How to, for example, enable cash on delivery payment only when customer selected flat rate shipping method?

I cannot find a way doing this in shipment/payment configuration or in cart rules.


texts: How can I test that the default cache is working correctly?

texts:
I changed "Enable External Cache" to "no" and flush the cache for a few mins to see if that effected loading times, but they were about the same. Is that an effective way of testing if the cache is being using?

(I know the cache files are being created ok, I can see them in FTP, I just suspect that they are not being used when loading the pages)


texts: Magento 2.3.0: High MYSQL CPU Usage @ magento Cron Jobs

texts:
High MYSQL CPU Usage @ Cron Jobs

Hello,

I have a problem at a server which is utilizing so much CPU so that the website is really slow.

I checked the server, logs, magento logs, and it seems its caused by the cron-jobs of magento.

I guess its related to this issue, though we have 2.3.0 here:

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

as stated here,

  https://www.splendid-internet.de/blog/cronjob-bug-in-magento-2-2-x-fuehrt-zu-hoher-cpu-auslastung/

I tried to

  select count(*) from cron_schedule;

but

  delete from cron_schedule where scheduled_at < date_sub(now(), interval 1 day);

did not change the value which was 1403 and also did not fix the server load...

I hope somebody has an idea whats causing this.

here are the log files, if any help

  /var/log/syslog output : pastebin.com/xsWDQNkC

  var/log/system.log : pastebin.com/EdfjN48t

  var/log/magento.cron.log : pastebin.com/0H5Y44NT

Edit:

I found these on Github, If this are viable Solutions - which one should be preferred?

  Magento 2 cron project to fix bugs and common cron issues.
  github.com/magemojo/m2-ce-cron

  Plugin to Magento 2 which mark old cron jobs with status "running" as error. This can prevent the Magento 2 from consuming CPU
  github.com/Alekseon/CleanRunningJobs


texts: Injectables and non Injecatbles clarification

texts:
According to the Magento docs

  Injectables can request other injectables in the constructor, but
  non-injectables cannot request other objects in a constructor

As an example it refers the Product Model
https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Catalog/Model/Product.php

Checking at the constructor of that class i can see that it requests other objects as well. Can somebody clarify how a non-injectable should be implemented and what classes can request/use?


texts: Magento add db error \DB\Adapter\Pdo\Mysql Solution

texts:
\DB\Adapter\Pdo\Mysql error magento

How to resolve this??

https://i.stack.imgur.com/JWmOO.pngHow to resolve this?


texts: how to save value of post data to a custom table in magento 1.9

texts:
Getting error

  Fatal error:  Call to a member function setData() on boolean in /home/company/lampstack-5.6.28-1/apps/kb/htdocs/app/code/local/Namespace/Manager/controllers/Service.php on line 2849

My function in IndexController.php

elseif ($service == "getPunchHistory") {
            $res = $ws_service->ws_getPunchHistory($custid,$intime,$outtime,$inlocation,$outlocation,$punchstatus,$create_at);
            echo $_GET["callback"] . json_encode($res);
        }

my function in Included file in IndexController via another file. where my function is

public function ws_getPunchHistory($custid,$intime,$outtime,$inlocation,$outlocation,$punchstatus,$create_at)
     {
       if(Mage::getSingleton('customer/session')->isLoggedIn()){
        }
        else{
            $res["error"] = "Invalid request";
            return $res;
        }
        $res = array();
        $data = array();
        $custid = Mage::getSingleton('customer/session')->getId();
        if ($custid != '')
        {
            // $collection = Mage::getModel("manager/asmtracker")->getCollection()
            // $data = $model->getData();
            try{
                $data = array(
                    'manager_id' => $custid,
                    'punch_in_time' => $intime,
                    'punch_out_time' => $outtime,
                    'in_coordinates' => $inlocation,
                    'out_coordinates' => $outlocation,
                    'status' => $punchstatus,
                    'create_at' => $create_at

                );
                echo "<pre>"; print_r($data);
                $this->_controller = 'adminhtml_tracker';
               $smodel = Mage::getModel("manager/asmtracker")->setData($post_data)->save();  **// here is error line**

                $res['code'] = 200;
                $res['asmtracker'] = 'ok';
            }catch(exception $exception){
                $res['code'] = 400;
                $res['asmtrakcer'] = $exception->getMessage();
            }

        }else{
            $res['code'] = 500;
            //$res['asmtrakcer'] = $exception->getMessage();
        }
        return $res;
     }


texts: Is there a free product configurator/ designer extension for Magento?

texts:
I'am recently building a eShop with the help of Magento and my fellow students for a university seminar. Since the business idea we had to think of resolves around customizable furniture I wanted to know whether or not there are any free or demo versions of these extensions for Magento to be found.

Alternatively we would have to explain the way we would've implemented and configured the plugin but I'd prefer to show them the real thing, integrated into our shop system.

The main feature I would be looking for is the overlay of images according to the given feature options to show the new product, anything else would be a bonus.


texts: Applying shopping cart price rule to Customer purchasing from a gift registry

texts:
I would like to know if it's possible to apply discounts to customers purchasing from an existing gift registry

Or is there a plugin/extension i can use that does this?

Please help.

Thanks


texts: Magento2 How to call model function in Controller

texts:
I have following model in one module

namespace Abc\Abcd\Model\Job;
use Magento\Backend\App\Action\Context;

abstract class AbstractJob extends AbstractModel
{
    private $name;

    public function __construct(
        $name = null,
        Context $context,
        array $data = []
    )
    {
        $name = null,
    }
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }
}

I've following controller in another module

namespace Qwerty\Abc\Controller\Adminhtml\Hooks;

use Magento\Backend\App\Action;

abstract class AbstractHooksbackend extends Action
{
    protected $_abstractJob;
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Abc\Abcd\Model\Job\AbstractJob $abstractJob
    )
    {
        $this->_abstractJob = $abstractJob;
        parent::__construct($context);
    }
    public function setnewName($name)
    {
        $this->_abstractJob->setName($name);
    }
}

And I'm getting following error

Exception #0 (BadMethodCallException): Missing required argument $name of Abc\Abcd\Model\Job\AbstractJob.

Can anyone explain to me why I'm getting this error? and how can I make it correct?

Edit: You $name was already defined I forgot to update it here.


texts: Get all configurable products without any associated products

texts: In magento 1.9 I need to get collection of all configurable products that have no associated products. The first idea is to get all configurable and then in loop check each for its children. But maybe there is more elegant way?


texts: Magento 2 : event observer before customer edit form save

texts:
I want to fire event observer before customer account edit details are
saved, i am unable to find event observer for it.
Is there any observer like customer_account_edited_before.


texts: Extend Custom Attribute Value Limit from VARCHAR 255 to 500

texts:
OK had a look round and cannot seem to find an exact solution to my problem.

I have a custom attribute that stores a link, on some cases this link can be up to 500 characters long.

When I show show the link on my website the link is only part there.

Where do I change the default 255 limit as I do not want to have any additional scripts running to ensure they are saved correctly in catalog_product_entity_varchar


texts: how to Split payments Using two cards for one transaction magento2

texts: What would be the proper way to approach splitting order payment amount to a several payment transactions? For example to split order of 5000 and make payment of rs 3000 from card/UPI and rest 2000 COD/card??


texts:
A client has moved a magento installation to a new server, I believe they have just copied the lot over - files and database.

The site is now kinda functional but there is lots of stuff missing. Product categories are there but no products are displayed and no errors are showing. On the home page under special offers the following error showed:

  Fatal error: Class
  'Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract' not found in
  /path/to/magento/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php
  on line 36

in Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice there is a file called Abs (just Abs, no extension) which looks like a regular php file and which declares the following class:

abstract class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract
    extends Mage_Core_Model_Resource_Db_Abstract

So I saved it to the same location as Abstract.php and it cleared up the above error.
Now in the admin area when I go to Catalog->Manage Products the following error shows:

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

  /path/to/magento/includes/src/Mage_Adminhtml_Block_Widget_Grid_Massaction_Item.php
  on line 92

Does this look like a familiar story? Is it likely something has gone wrong while the files were copied? Do I need to see if the old site is still there and copy it again?


texts: How best to call a custom long running PHP program over and over

texts:
I wrote a PHP cli program that I call many times in a loop, each loop processing a set number of rows at one time until there is no more data.

It is a custom REST program that is the middle piece between Magento and a drop shipper.

Each run may take up to 25 minutes and there may be up to 400 runs.

When I had the process in one PHP program I ran into timeout and memory issues.

So now I have a bash script that calls the PHP program as many times as needed until there is no more data. The method works.

I am concerned that I am not following Magento standards by using a bash shell program.

The Magento cron system seems to only support php calls and not a bash call, so I have to use the OS cron.

Is there a better way for running a program over and over again?

Secondarily, is there a way to open a bash window from within the admin?


texts: Magento 1.8.1 SMTPPro order from email address is store address

texts:
I have a Magento 1.8.1 with the Module SMTPPro installed (latest version).
When a client makes an order, the admin receives an email with the order.

The problem is that the "from" appears to be the store's email address instead of client's email address.

What should I change in order to make sure that the "From" is client's email address, and not the store email address.

Any idea might help. Anticipate thanks.


texts: MySql query ::group function is not defined in Model

texts:
I am trying to run this query :

    $collection = $this->getCollection()
    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('category_id', array('in' => $categoryId))
    ->addAttributeToFilter('visibility', $visibility)
    ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
    ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
    ->addAttributeToFilter('special_to_date', array('or'=> array(
        0 => array('date' => true, 'from' => $tomorrowDate))
        ), 'left')
    ->setPageSize($prodCount);
    $collection->group('e.entity_id');
    $collection->load();
    Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);
    return $collection;

As you can see there is nothing wrong with the query.

But I get this error when I run it:

  Array
  (
    [type] =&gt; 1
    [message] =&gt; Call to undefined method TypoStores_Filter_Model_Resource_Product_Collection::group()
    [file] =&gt; /var/www/vhosts/manglory.de/magento.manglory.de/app/code/community/Vsourz/Deals/Model/Deals.php
    [line] =&gt; 32
)

Typostores is an extension I use but the issue is that that extension is overriding only some functions and being extended from the core resource model.

I didnt get why group is not known by the resource model any more. It is a standart sql function in zend framework and also in magento.

So the Question is : How can I add GROUP function in that model and use it in general. Cause without it most of the queries will just throw duplicate item error


texts: Does the magento framework support on module development?

texts:
I'm new at magento and I'm not happy with magento.
I'm not having a course yet and try to get started with magento 2.
The following text is my experience with magento and I ask my self if it was a good decision to choose magento. So I want to ask you, if you have similar experience with magento and how you solved this for you.
At the beginning I started to dive into the documentation to get started with module development.
First in my opinion the documentation is not really helping, because it is more like a reference and not a documentation how to do things.
Second if there are step by step documentation in most cases it is incomplete. Means if you follow the step by step guide completely, the outcome is something that does not work.
I started to develop an admin grid, that lists some data from the database and has the possibility to edit the data.
So creating the route, menu and acl was easy to understand, but when it comes to the listing it gets complicated with all this xml stuff, that not shows you an error if you do something wrong eg. you have a typo in a string like the datasource string.
So by investigating existing modules I got forward step by step. But this step by step not means, that you can slowly get to the expected result step by step. No you have to create a few xml files, Controllers, Actions, Model, ModelResource and so on. So you end up with many new files, before you can test your work of the last hour.
Of course in most cases something does not work, because of something in a xml file is wrong. So you see an endless spinner for example. No error, no help.
Ok, so after a lot of frustration and many "WHY" I got my listing done.
After that I started to develop the form.
First of all, why I have to do that? Why the framework is not doing that for me by default? Why I have to implement the functionality to edit an entry of a listing? I created already Model and ModelResources and so on, so there is everything that need to be known.
Then there are this buttons that you can define in the toolbar. I see in existing modules, that this Buttons are defined in own classes. This causes to have a lot of duplicate code, that is very bad.
Why not having just buttons that you can reuse, like the back button or the save button. Why I have to define them from scratch for myself? I expect from a framework, that things like this are already implemented. I would understand if you need a special behavior, that you can implement this. But there should be a default behavior.
I can point a few more examples, but this were the things that annoying me most.
I hope some of you can tell me, that I did things wrong, and that I missed some sources like Tutorials or Documentations and Reusable Code.


texts: module to add custom code in code_core_mage_sales_etc_config.xml via module or observer

texts:
i want to add order line items in magento :
i followed link :http://www.webcenter.co.in/how-to-add-custom-fields-for-order-line-items-in-magento

now i created module for steps in that link

for step 6:

XML: code_core_mage_sales_etc_config.xml
ADD: <training_location><to_order_item>*</to_order_item></training_location>
Between: <sales_convert_quote_item> and </sales_convert_quote_item>
Also Add:
<training_location><to_quote_item>*</to_quote_item><to_invoice_item>*</to_invoice_item><to_shipment_item>*</to_shipment_item><to_cm_item>*</to_
cm_item></training_location>
Between: <sales_convert_order_item> and </sales_convert_order_item>

i do not want to change in code , how can i do above steps via module

pls help


texts: Magento 2 Admin Custom Form Fields Creation

texts:
I am creating Custom Grid in Magento 2 admin. I need when we click any button it should show div with form fields in Magento 2 Admin. Please find the screen shot.

Screen Shot :


texts:
I have a custom module that subscribes to an event called catalog_product_collection_apply_limitations_after. In the observer I am setting a variable (E.g $_GET['test'] = true)

Then later in my .phtml file I am accessing that to do logic based on the variable. It works well, however, once launched on one of our client's webshop, all the globals like $_GET, $_POST, $_REQUEST appears empty.

My guess is that there is a redirect happening, but then I ask myself why in the world would someone do that, as it definitely messes up most 3rd party extensions. But I might be wrong though.

Any other ideas of why would this be happening ?

P.S Here's a subset of var dump of $GLOBALS variable in the frontend:

  array(16) { ["_GET"]=> array(1) { ["limit"]=> string(2) "12" }
  ["_POST"]=> array(0) { }


texts: How to disable the default CAPTCHA packaged with Magento 1.9

texts:
I've recently stumbled into an error using the default version of CAPTCHA in Magento 1.9: "Image CAPTCHA requires FT fonts support".

As far as my understanding goes, this means FreeType font support isn't enabled on the server. As this version of reCAPTCHA is old, I don't see any reason to resolve this issue, and have opted for this extension, which uses version 2 and I have no issues.

The problem is that, if a client enables the built-in CAPTCHA in CUSTOMERS > Customer Configuration > CAPTCHA > Enable CAPTCHA on Frontend > Yes or Advanced > Admin > CAPTCHA > Enabled CAPTCHA in Admin > Yes, any page this is enabled for will crash that specific page.

So whilst it is avoidable by not fiddling with settings, this is not desirable and will likely be confused with the proprietary extension.

What would be the best way to remove this from Magento?


texts:
I am using magento2.3
I want to change the label of Subtotal to Subtotal(including vat) on shopping cart.
Attaching image link for understanding.
https://prnt.sc/of9a5c


texts: is it possible to add callback on event dispatching?

texts:
Is it possible somehow to add callback on event in magento without registering observer in for it ?  (like wordpress hooks works)

For example, add callback:

    FunctionToAddCallback('catalog_product_save_after', function(){ Mage::log('callback works'); });

and after

    Mage::dispatchEvent('catalog_product_save_after',array('product'=>$this));

It should log 'callback works'.

Is this possible or adding observer is the only way ?


texts: How to change shipping method title dynamically in magento 2

texts:
I have created one custom shipping method, I need to change shipping method title dynamically.

public function collectRates(RateRequest $request)
    {
        if (!$this->isActive())
        {
            return false;
        }

    $result = $this->_rateResultFactory->create();

    $shippingPrice = 15;//$this->getConfigData('price'); //this is updating price at run time

    $method = $this->_rateMethodFactory->create();

    $method->setCarrier($this->getCarrierCode());
    $method->setCarrierTitle($this->getConfigData('title'));

    $method->setMethod($this->getCarrierCode());
    $method->setMethodTitle("custom title");//($this->getConfigData('name')); this is not working

    $method->setPrice($shippingPrice);
    $method->setCost($shippingPrice);

    $result->append($method);
    return $result;
}

But its not working.


texts: How to update/trigger wishlist counter in Magento 2.3?

texts:
I am trying to add products in wishlist using ajax with phtml + Controller.
However, the product gets added to wishlist but the counter of wishlist doesn't change.

Is there a way to trigger an update for wishlist counter.


texts: Magento2 Blank Invoice, Shipping, Credit Memos

texts: I'm completely stuck on this. When you view and order under Sales > Orders. Then click on the invoices tab it is completely empty. Same for credit memos and shipments. I can view them fine under their individual links such as Sales > Invoices. There seems to be no errors showing in console or in error logs. Anyone got any ideas?


texts: How to redirect simple products to configurable product URL with options preselected in Magento 2.1

texts:
How can I redirect a SEO URL Key of a Simple product of which the visibility is set to "Not Individually Visible" to the parent Configurable Product SEO URL Key?

There are two important conditions that needs to be met:

the options on the Configurable Product page should be correctly preselected to display the attributes of the Simple product.
the price for the Single Product also needs to be displayed correctly.

Example

Configurable Product P1 has two attributes.
Each attribute has two options:

Attribute A1 has option O1 and O2

Attribute A2 has option O3 and O4

So Configurable Product P1 has 4 Configurations represented by 4 Simple Products with each a different price:

P2: O1 and O3 -> EUR 1

P3: O1 and O4 -> EUR 2

P4: O2 and O3 -> EUR 3

P5: O2 and O4 -> EUR 4

The problem that needs to be solved is that for each Configuration the parent Configurable Product URL Key is sent to Google Merchant Shopping as an XML feed.

But when Google is verifying the prices of the Configurations on the parent Configurable Product URL page the prices won't match for P3, P4 and P5 as by default the lowest price is shown by Magento. And this in turn will result in the following warning in Google Merchant:

  "Insufficient match of microdata price information". In the above
  example 75% of the data isn't matching.

I already took a look at How redirect simple products of Configurable product but it is referring to an event which to my understanding does not exists in Magento 2: controller_action_predispatch_catalog_product_view.

I also tried the suggestions at Magento2 Event Observer Redirect Simple Product to Configurable Product but it seems that the Plugin can only work if the product visibility is not set to "Not Individually Visible".

So I suspect that the canShow method defined in Magento/Catalog/Helper/Product.php is called before the Magento/Catalog/Controller/Product/View is executed but I have an hard time figuring out where this happens.

How does Magento determine that an URL key is representing a product?

And where are the product id, category id and options parameters derived from the URL key to be passed on to the execute method in Magento/Catalog/Controller/Product/View.php?

Any help would be much appreciated.


texts: I installed mageplaza social login but i got those error when trying to connect


texts: Export customers and their passwords from Magento CE 1.9.0.1 to another platform?

texts:
So at my workplace, there's been a decision to potentially move away from Magento if we can find a suitable alternative. The rationale is basically because it takes up most of my time and it's had a few niggles over the last few months. Nothing that is a showstopper tbh though and there aren't a lot of issues, but lots of demands to have this and that. I'm the only one who looks after, maintains and supports it (aside from some help with product updates), along with anything else related to our website, or promotion of it.

So I've been looking at a few options and the MD is keen to not have to make customers on the new system have to activate an account or set a new password on the new system when we transfer the customer data over. I've seen that a few platforms will allow importing of customers and their passwords, as long as the passwords are clear text. However, this is not possible to get from Magento because it's MD5 encrypted and you can't get back the clear password once encrypted.

I've seen an extension from liteextension that will migrate passwords from a Magento store to Prestashop, which manages to migrate the MD5 hash password over to Prestashop (which also uses MD5). However, that's if we decide to use Prestashop! I just wonder if there's any other options for me to be able to migrate passwords across for another system.

Everything I've read thus far, points to generally just getting customers to create a new password on the system. Sorry for the long post!

Thanks,

M


texts: after applied patch 8788 in Magento V. 1.9.0.0 admin product image browse files not working

texts:
I have applied patch 3941 and after that I have applied patch 8788 but when in admin product try to select image see following steps

-> I click on Browse Files...
-> It opens a dialog box and then
-> I select the image and click on Open

it takes few minute and it shows me error like below image

Why does this happen? if i revert patch 8788 its working fine.

Note: It is working fine in safari browser.
 Not working in chrome and Mozilla.


texts: Include category path in product urls in sitemap and canonical urls

texts:
I am using magento-2.3 EE. I want to include category path in product url, in sitemap urls and same should be in their canonical urls.

Like in sitemap, product urls should be like - site.com/category1/category2/product-name.html

Similar structure should be in canonical urls of each product.


texts: Magento multiple store setup with different prices

texts:
Is it ok to create a duplicate store with slightly changed content in order to achieve more sales? Customers should view both the stores as distinct companies and they should appear in Google search as distinct urls. Both stores would contain same products. It is just the pricing and description would be little different. And I plan to use different themes for both the stores so that they look different.

What is the right way to do this?

Create a different Magento instance with all new website (or)
Create a store within the same instance? I am not too familiar with Magento multiple store setup.

Would anyone advise me on what is the correct approach to achieve my objective?


texts: customer get order confirmation email before pay

texts:
I'm using the third party extensions for payment(Paytm and PayUmoney) for our magento website. the issue is customer get an order confirmation email before Pay when they just redirected.

I made all the changes as this post mentioned (magento 2 order confirmation email sending before payment gatway redirection) and its working fine in PayUmoney but not for Paytm.

If I pay through PayUmoney not getting any email before pay but if I pay through Paytm I get order confirmation email before pay.

Website Link- https://oyekitchen.com
version- Magento 2.1.9


texts: How to get All Column names of table in magento 2

texts: I created a custom form in admin using block(without UI component). So i want to get all columns of my custom table in form block file. Please suggest me.


texts: How to setup multi-language store in Magento 2?

texts: I need to setup multi-language options for multiple websites in Magento2.


texts: Unable to call function within class of extension

texts:
I currently have some code on a product view page like:

<?php
$_product = $this->getProduct();
if (Mage::helper('core')->isModuleEnabled('Module_Name')):
$exclImg = $_product->getMediaGalleryExcludedImages();
endif; ?>

The function getMediaGalleryExcludedImages() is contained within a file
Module_Name/Model/Catalog/Product.php

and looks like:

class Module_Name_Model_Catalog_Product extends Mage_Catalog_Model_Product {

    public function getMediaGalleryExcludedImages() {

    // the function

    }
}

My problem is, that although the module is enabled and shows as such, the line:

$exclImg = $_product->getMediaGalleryExcludedImages();

isn't throwing an error on getting a value.

How is it that I am calling the function wrongly or what should I be registering?

Thank you so much


texts: Working around knockout without need to compile

texts:
How can we work with knockout without having to compile the Magento every time?
I have disabled all cache and set Magento on developer mode but still, it needs to compile and clear cache.


texts: How to override products saveAction and editAction function in Magento?

texts:
app\code\core\Mage\Adminhtml\controllers\Catalog\ProductController.php

I want to override save and edit function from ProductControll.php page.

While saving product want to override function.


texts: Magento 2 remove Gift Cards Cart Summary

texts:
Working to remove the Gift Card feature on Magento 2 Cart summary section. Having issue getting this working.
Have created the following file:

.../app/design/frontend/***/***/Magento_Checkout/layout/checkout_cart_index.xml

The following code is not working to remove the giftcard block:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="cart.summary">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="block-giftcard" xsi:type="array">
                            <item name="config" xsi:type="array">
                                <item name="componentDisabled" xsi:type="boolean">true</item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>


texts: is there a better way than "replace" behavior during the import, to avoid duplicated images

texts:
We import products using CSV files via the backend. FireGento_ExtendedImport2 is installed as well.

Now we saw that images are added again and again to a product's image gallery on each import.

We tried using the replace behavior which seems solves this at first  glance --- but I feel it is ineffective to re-create thousands of products again and again.

Is there another way to avoid duplication of images during repeated imports?


texts:
I need a redirect handeling url's like this:

http ==> https
www ==> non-www

Somebody calling http://www.mydomain.de/mypath ==> https://mydomain.de/mypath

At the moment he gets redirected to https://mydomain.de

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteRule ^api/rest api.php?type=rest [QSA,L]

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

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

RewriteRule .* index.php [L]
</IfModule>


texts: Understanding the Magento 2 checkout_index_index.xml

texts:
With Magento 2 how can I view the full checkout_index_index to gain a better understanding of it.

I need to make some modifications to it but need to know the appropriate layout for nesting all of the tags...

Is there a way to clearly visualize this on the front end perhaps?

Thanks in advance.


texts: Magento 2: custom product import taking long time

texts:
We had a magento 2.3.0 multi-website shop and we use custom product import for shops.
We use CLI script as a config for each shops and execute import with a common custom module handing few checkings.
We read the a pre-defined column file and import to corresponding product attributes.
Each shops crons are set on different timing(for example, for shop X we have "php importX.php" where we define basic configuration like website id, code,sku prefix etc).
Now issue we have is some shops having around 3500 rows in the file and it's taking more than 7 hours to complete.
Any advice on this really appreciated.


texts: Is there a way to disable "add to cart" and "wishlist" for customers that aren't logged in

texts:
Like the title says, those buttons look terrible when customers aren't logged in, and the functionality ins't needed, so how can I disable favorites and compare for people who aren't logged in?
Thanks


texts: Magento direct sql query not working in my dynamic adminhtml module config

texts:
Following this tutorial I've implemented a dynamic key => value pair setting in my magento adminhtml backend module config.

So, this is my system.xml

<shipping_method_mapping translate="label">
    <label>Shipping Method Mapping</label>
    <comment><![CDATA[Select an active shipping method in magento and map it to the code used by Asendia.]]></comment>
    <frontend_model>infiniteconnect/fieldasendia</frontend_model>
    <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
    <source_model>infiniteconnect_adminhtml/system_config_source_dropdown_activeshippingmethods</source_model>
    <sort_order>4</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>0</show_in_website>
    <show_in_store>0</show_in_store>
</shipping_method_mapping>

and this is my Activeshippingmethods.php (dropdown source model):

class Intellibi_InfiniteConnect_Adminhtml_Model_System_Config_Source_Dropdown_Activeshippingmethods
{
    public function toOptionArray()
    {
        // Init Option Array
        $optionArray = array();

        // Load Magento DB Connection
        $resource = Mage::getSingleton('core/resource');
        $readConnection = $resource->getConnection('core_read');

        // Query Magento DB
        $active_shipping_methods = $readConnection->fetchAll(
            "SELECT DISTINCT `shipping_description` AS `name` FROM ". $resource->getTableName('sales_flat_order'));

        // Build Option Array
        foreach ($active_shipping_methods as $active_shipping_method) {
            $optionArray[] = array(
                'value' => md5($active_shipping_method['name']),
                'label' => Mage::helper('infiniteconnect')->__($active_shipping_method['name'])
            );
        }

        // Finished
        return $optionArray;
    }
}

When I test this locally on my wamp installation; it works great:

However, when I upload this to my remote DEV server running LEMP stack, the behaviour changes and the config screen breaks/does not render correctly like this:

If I modify my Activeshippingmethods.php dropdown source model and comment out all the direct query stuff and return an empty array, then the config screen doesn't break and renders correctly - so this is why I thought there's a problem with the direct query...

I've already checked if my remote linux server has entries in sales_flat_order table and it does (58 distinct shipping_description).

Any idea why this isn't working correctly on a linux server, but it's fine on the WAMP server for some reason? Is this some sort of issue with my module not having the correct ACL to use core_read connection?


texts: Magento checkout stuck with Submitting Order Information

texts:
Magento checkout stuck with “Submitting Order Information”

Magento Version Magento ver. 1.8.0.1 http://test.cmedical.nl

The entire process works in the checkout (Billing info, shipping info, shipping method, etc.) except when one finally decides to submit the order, (hit "place order” button) it just hangs at "submitting order information”. After sitting there for a few minutes, the shopper will be returned to the shopping cart, and the order never makes it through!

I hope and assume others have had the same problem? Have you been able to fix it? I’m worried that it might be the theme because I’ve haven’t had much luck finding the solution on the internet. However, I don’t understand where the images & css of the custom theme would interfere with the order process.

I’ve tried multiply solutions but none worked.
It seems i get a prototype.js 302 moved error if i use crome + f12

Has anyone had experience in the one page checkout process? If I could get any input, I would really appreciate it. I’m about to pull my hair out.

Thanks in advanced.


texts: How to configure and setup piwik in Magento 2?

texts:
I want to configure and setup piwik in Magento 2 based on custom data.

I refered this module. Click Here

But, not understand how to manage with Magento 2.

Please help me.

Thanks.


texts: Magento 2 from which database table data comes to credit memo grid.

texts: I need to add custom diiscount to credit memo grid, I added to invoice grid as data populated from sales_invoice table but unable to find table to credit memo.


texts: Installed Magento 2.0.4 with composer, importet DB from Live-System, 404s are present

texts:
We planned to create a stage of our Live System.

We are using Magento 2.0.4.

I installed Magento 2.0.4 with Composer and installed Magento over
the Web.
I uploaded Themes and pub/media-Files to the desired
destinations.
I implemented splendid-Internets de_DE-CSV. I importet
the DB with mysql -Ddatabase < dump.sql (worked nicely)
corrected base_url in the core-row via PhpMyadmin
I removed cache and pub/static/*
I did bin/magento setup:static-content:deploy de_DE en_US
I switched to developer mode
I also commented the Dev-Line in the roots .htaccess out
Filesettings are correct (as stated in Magentos Documents)

However, we are receiving huge 404s on both frontend and backend.

Tried:

change di.xml from Symlink to Copy
set files to 777

Non of those have worked.

Our server settings:

PHP 7.0
Apache2 (rewrites enabled)

The files are present in pub/static/..., however, you can't access them from the browser directly. Filesettings for those files are 755 for Folders, and 644 for files. Should be fine - but won't work.

We are running out of ideas.


texts:
When you are working in the adminhtml backend of your module, this code returns the username of the currently logged in user:

Mage::getSingleton('admin/session')->getUser()->getUsername()

What value would the above code return, when the magento cron is executing one of my controller method in my custom module? Will it say "cron" or something equivalent? Or will it be empty?


texts:
I am using Luma default theme in Magento 2 and I want to create a new phtml file and call it from CMS.

Can anyone tell me in which path i need to create my file and how to call it form CMS?

I trying to create in this path: C:\xampp2\htdocs\medipoint\vendor\magento\theme-frontend-luma\Special_Price\special_price.phtml

and call it in this way:

{{block class="Magento\Framework\View\Element\Template" name="myname" template="Magento_Theme::Special_price/special_price.phtml"}}

but it doesn't work.


texts:
When I need to change anything in quote from admin panel, I have to create new one and edit info there.

The problem is that when I create order based on the second quote, magento combines items list from both quotes and put into order. How can I fix this thing and make it to pull info only from the latest active quote?


texts: How to display product add to cart at the end of product detail page?

texts:
To show Product details and add to cart link at the end of product view page i have created a new block like follows, in local.xml file i have added following lines

<catalog_product_view>
    <reference name="content">
        <block type="page/html" name="product_footer" template="productblock/productfooter.phtml">
            <block type="catalog/product_footer_view" name="product.info.view" as="footer.view" template="catalog/product/footer_view.phtml">
                <block type="catalog/product_view" name="product.info.addtocart" as="addtocart_footer" template="catalog/product/view/addtocart_footer.phtml"/>
                <block type="catalog/product_view" name="product.info.media" as="media_footer" template="catalog/product/view/media_footer.phtml"/>
            </block>
        </block>
    </reference>
</catalog_product_view>

and created productfooter.phtml with <?php echo $this->getChildHtml('footer_view'); ?>.And also duplicated view.phtml,media.phtml,addtocart.phtml. Now the block is there in my product view page but the footer_view.phtml is not displaying anything.Please help me to find the mistake in my code.


texts: When getting current cart from an external file, it's empty

texts:
I searched and was unable to find anything. I've tried many solutions such as: How to get all items in cart currently? as far as I can tell it should work in Magento 1.8. I've tried Mage::getModel('checkout/cart')->getQuote(); and Mage::getSingleton('checkout/session')->getQuote();

An example of something I tried:

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    echo "something";
}

Doing print_r on $cart shows that $_items is empty and Mage::helper('checkout/cart')->getItemsCount(); returns 0.

Full example code to clear confusion, error reporting is on:

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',true);

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

$totalItems = Mage::helper('checkout/cart')->getItemsCount();
if( $totalItems == 0 )
{
    echo "0 items";
}

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item)
{
    echo "something";
}

Someone will visit the magento store, add items to their basket and then click a link which takes them a PHP file. However, their basket is always empty when checked from the external file. Is there a problem with the code or the magento configuration or is the wrong way to do it in Magento 1.8?


texts: I create custom grid but it throw error on console here is a screen shot


texts:
I am using Magento 2.2.2. I want to integrate the Progressive web app module.

I have used this extension.

I followed Installation guide given with the module.

From that I found a command composer require sngrl/php-firebase-cloud-messaging dev-master.

Running this command provides following error. How to solve it also
Suggest other free PWA extension if there any.


texts: How can i remove shipping.phtml from cart page on Magento 2?

texts:
I try to remove shipping.phtml from cart page

I tried to diseable this field from module-checkout\view\frontend\layout\checkout_cart_index.xml

 <block class="Magento\Checkout\Block\Cart\Shipping" name="checkout.cart.shipping" as="shipping" template="cart/shipping.phtml" after="checkout.cart.summary.title">
<referenceBlock name="checkout.cart.shipping" remove="true" />

by adding <referenceBlock name="checkout.cart.shipping" remove="true" /> , but it dosen't work.

Does anyone know if it's another way do disable this phtml?


texts: Magento2 install stuck on file permissions

texts:
I am using a fresh version of Magento 2.1
Apache 2.2
I have set my file permissions to 777 on the entire folder
I can see that Apache is writing as apache:apache
I have chown'd the entire folder to apache:apache

This spins

Finally it ends up like this


texts: Magento 2.3.6 responsive menu chile item not opening when click on arrow

texts:
i have upgrade with magento 2.3.6 and after responsive menu click and child category not open

also no any errors in console
Thanks in Advance


texts:
I am using Magento 2.1.7. In My theme I want define module 1column.xml like

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="custom.header.container" label="Page Header Container" htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="custom.page.top" label="After Page Header" after="custom.header.container"/>
        <container name="custom.footer-container" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"/>
    </referenceContainer>
</layout>

But when I load page it accept both layout 1column in core and layout 1column in mytheme.

Any body help me how to define my layout with name is 1column.xml


texts: Order Details Email (From Customer Email Address)

texts: I'm looking to change the from email address that is visible in the Order details email sent to the store when an order is placed. The store wants this to be the address of the customer to make replying easier. Can this be specified through Magento Admin or do the files need changing/is an extension needed?


texts: Changing URL of Wishlist without change to core code

texts:
I'm working on Magento CE 1.9.2.2 site and want to change the URL to the Wishlist that comes with Magento.

I tried to copy app/code/core/Mage/Wishlist/etc/config.xml to app/code/local/Mage/Wishlist/etc/config.xml and change the following:

<routers>
    <wishlist>
        <use>standard</use>
        <args>
            <module>Mage_Wishlist</module>
            <frontName>moodboard</frontName>
        </args>
    </wishlist>
</routers>

The intention is to change the URL to /moodboard as opposed to /wishlist.

This doesn't work. However if I edit the core version of the file (in app/code/core/) it works.

I've disabled the cache, reindexed, etc etc and it doesn't work.

Obviously I don't want to edit core code so am trying to make my changes in app/code/local. Why doesn't it work?


texts: Magento Get Product collection based on product name content first letter as digit

texts: I want to get product collections of all products which start digit as number like "0Pro","1Pro","3Pro","4Pro" and "41Pro" etc.,means it's first character must me a digit.


texts:
I just installed a new theme. why it's displaying like this :

and check here too :

please help me to find solution.


texts:
I'm seeing different output from my production clone site than on production.  The most obvious difference I can see so far (and there is probably more) is that the js/css references in the main document look to have been min-ified on production:

<link rel="stylesheet" type="text/css" href="https://www.example.com/media/css_secure/eb0df35e22a81d2150af7faddb2a014c-v2.18.css" media="all" />
<script type="text/javascript" src="https://www.example.com/media/js/f081fea0e1f96e90201edfc964382601-v2.18.js"></script>

But in my production clone, they come back like this:

<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/responsive/default/css/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/base/default/css/widgets.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/base/default/css/amasty/amfpc/styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="/git/magento/skin/frontend/responsive/default/css/AutoComplete.css" media="all" />
...
<script type="text/javascript" src="/git/magento/js/prototype/prototype.min.js"></script>
<script type="text/javascript" src="/git/magento/js/lib/ccard.min.js"></script>
<script type="text/javascript" src="/git/magento/js/prototype/validation.min.js"></script>
<script type="text/javascript" src="/git/magento/js/scriptaculous/builder.min.js"></script>
...

There are 2 problems I see:

I would like my clone to have the same min-ified CSS and JS as prod
The CSS and JS urls for the clone start with "/git/magento" which is actually the name of my Magento ROOT folder on disk, so that's not right and they all come back as 404s.

When I did the production clone, I didn't bring over any of the files in /media (that's the advice I got).  Is there anything I should be doing differently?  I also followed these steps: How can we stop a Magento site clone from redirecting back to live site?


texts: view image magento 2.3.2 after import with magmi 7.23 of product with url

texts:
I installed magento 2.3.2 and magmi 7.23, everything works fine.
Import products: ok
result import images in pub / media / catalog: ok
but in the frontend of the store, the image does not display, I get a logo image of magento.
can you help me ?
thank you


texts: How to register in new database when create an account as a guest checkout in magento

texts:
I am using magento with another php site.when a user register or login in magento user will register or login in php site also and vice versa.

but when user checkout as a guest and check the box "create an account for later use" it will create an account in magento only.I want to register the same user in php site also.

I am using onepage checkout method.Can anybody tell me which file or function i have to edit for this?


texts: Magento 2: Multistore url not working in Nginx

texts:
i have create two website in magento single instance. For second website i have create new folder in root for accessing second website using this url www.domain.com/site2/ and inside this folder i have added inder.php , pub, lib, app, var symilnk.

I have use Nginx server so when i tried to access this folder then its showing 404 page so not able to access this new folder 'site2/'

is there any idea how can i access this folder for access another website.


texts: Magento 2: How to get Current category product collection?

texts:
I want to get product collection for current category while I am on a list page.

I want to get current product collection for current category while ajax call (i want the same collection in the controller which return some data based on collection) so is there any way that I can get the same product collection which was used in list.phtml

Here is code, which returns product collection but results not match 100%

    namespace Vendor\Module\Controller\Index;
    use Magento\Framework\App\Action\Context;

    class Model extends \Magento\Framework\App\Action\Action
    {
        protected $resultJsonFactory;
        protected $request;
        protected $store_manager;
        protected $productRepository;
        protected $searchCriteriaBuilder;
        protected $eavConfig;

        public function __construct(
            Context $context,
            \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
            \Magento\Framework\App\RequestInterface $request,
            \Magento\Store\Model\StoreManagerInterface $store_manager,
            \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
            \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
            \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collection,
            \Magento\Catalog\Model\CategoryRepository $categoryRepository,
            \Magento\Catalog\Model\CategoryFactory $categoryFactory,
            \Magento\Eav\Model\Config $eavConfig)
        {
            $this->request = $request;
            $this->resultJsonFactory = $resultJsonFactory;
            $this->store_manager = $store_manager;
            $this->productRepository = $productRepository;
            $this->searchCriteriaBuilder = $searchCriteriaBuilder;
            $this->eavConfig = $eavConfig;
            $this->productCollection = $collection;
            $this->categoryRepository = $categoryRepository;
            $this->_categoryFactory = $categoryFactory;
            parent::__construct($context);
        }

        public function execute()
        {
$data = $this->request->getParams();
$parent_category_id = $data['current_category_id'];
            $productsCollection=$this->getProductCollection($parent_category_id);
            $productsCollection->addAttributeToFilter('make',array('in'=>array(floatval($data['make']))));

        }

        private function getStoreCode()
        {
            return $this->store_manager->getStore()->getCode();
        }

        public function getProductCollection($categoryId)
        {
            $category = $this->_categoryFactory->create()->load($categoryId);
            $collection = $this->productCollection->create();
            $collection->addAttributeToSelect('*');
            $collection->addCategoryFilter($category);
            $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
            $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
            return $collection;
        }
    }

Does anyone have any idea how can I achieve my above requirement?
Thanks


texts: How to add translations to my custom validation

texts:
I have added my own custom validations, with a JS mixin, like:

validator.addRule(
    'validate-jurgis',
    function (value) {
        if (value.match(/\d/)) {return false;}
        else {return true;}
    },
    $.mage.__('Address should contain a house number')
);

How do I add translations to the message?


texts: magento 2.3.2: checkout Uncaught TypeError: Cannot read property 'getCacheKey' of null

texts:
I have an issue on checkout page and we are getting below error on console. It looks like address object is not loaded correctly on quote object and we are getting different error each time.

i know here someone asked this question but nothing find proper solution

billing-address.min.js:1 Uncaught TypeError: Cannot read property 'getCacheKey' of null
    at UiClass.<anonymous> (billing-address.min.js:1)
    at Function.notifySubscribers (knockout.min.js:133)
    at Function.valueHasMutated (knockout.min.js:149)
    at Object.observable [as billingAddress] (knockout.min.js:143)
    at select-billing-address.min.js:2
    at checkout-data-resolver.min.js:14
    at Function._.some._.any (underscore.min.js:15)
    at Function.some (observable_array.min.js:4)
    at Object.applyBillingAddress (checkout-data-resolver.min.js:14)
    at Object.resolveBillingAddress (checkout-data-resolver.min.js:13)

Any help would be appreciated.

Thanks.


texts: How to add form for additional information in checkout for virtual product

texts:
As we know when we checkout any virtual product it does not ask any shipping information. Only shows payment Information and go on.
Here I want a tab before payment named as Your Entries and will take information from user like name etc as shown in image

Is there any free extension using which I can do this or I have to create my own module.
Small help will be highly appreciated.
Thanks in Advance :)


texts:
PHP Settings Check
You must have installed GD library with --with-jpeg-dir=DIR option.

Getting the issue when I install Magento


texts: Add custom grid to custom tab in admin panel

texts:
I have created a tab in the admin panel (Add tab to Product Information in admin panel) and now want to create a grid to show, filter, etc the data from a custom table.

How do I extend my module to show a grid driven by a custom table of data?


texts:
I'm trying to update magento 1.9.4.2 from PHP 5.6 to PHP 7
everything seems to work well, but i have problem on checkout page
i can't enter data in the fields, as far as I understood Magento 1.9.4.2 does not receive braintree iframe

How can I solve this problem?


texts: PDO extension is required for this adapter - Magento Connect

texts:
I just did a new magento install of V 1.9.2.2 and when I go to magento connect I get the...

"The PDO extension is required for this adapter but the extension is not loaded" error. BUT IT IS!

I have root access to the WHM apache server its running on and it is installed through easyapache, and I did a phpinfo.php file check and the PDO is seen as working on the info sheet.  I looked in the php.ini file in the main directory and the PDO extension calls are present.  What else would be causing this?   The Cpanel its running on has just this install and the single database nothing else to interfere with it?


texts: Programmatically change base url of store

texts:
i setup websites / store / storeview in code from controller with this :

public function createWebsite($nom, $language){
        $code = $this->transformerEnURL($nom);

        $category = $this->categoryFactory->create();
        $category->load($nom);
        $category->setName($nom);
        $category->setParentId(1);
        $category->setIsActive(true);
        $this->categoryRepositoryInterface->save($category);

        /** @var \Magento\Store\Model\Website $website */
        $website = $this->websiteFactory->create();
        $website->load($nom);
        if(!$website->getId()){
            $website->setCode($code);
            $website->setName($nom);
            $website->setDefaultGroupId(3);
            $this->websiteResourceModel->save($website);
        }

        if($website->getId()){
            /** @var \Magento\Store\Model\Group $group */
            $group = $this->groupFactory->create();
            $group->setWebsiteId($website->getWebsiteId());
            $group->setName('main '.$nom);
            $group->setRootCategoryId($category->getId());
            $group->setDefaultStoreId(3);
            $this->groupResourceModel->save($group);
        }

        foreach ($language as $value) {
            $lang = 'Français';
            if ($value == 'fr')$lang = 'Français';
            if ($value == 'en')$lang = 'English';
            if ($value == 'es')$lang = 'Espanol';
            if ($value == 'it')$lang = 'Italiano';
            if ($value == 'de')$lang = 'Deutsch';
            if ($value == 'ro')$lang = 'Român';
            /** @var  \Magento\Store\Model\Store $store */
            $store = $this->storeFactory->create();
            $store->load($value.'_'.$nom);
            if(!$store->getId()){
                $group = $this->groupFactory->create();
                $group->load('main '.$nom, 'name');
                $store->setCode($value.'_'.$code);
                $store->setName($lang.' '.$nom);
                $store->setWebsite($website);
                $store->setGroupId($group->getId());
                $store->setData('is_active','1');
                $this->storeResourceModel->save($store);
                // Trigger event to insert some data to the sales_sequence_meta table (fix bug place order in checkout)
                $this->eventManager->dispatch('store_add', ['store' => $store]);
            }
        }
    }

The foreach is for language obviously.

Now i need to change base Url of store view, I tried :

$store->setBaseUrl('http://www.url.com');
But i got error on it and don't know what is the correct method.
$store->setConfigData('web/unsecure/base_url','http://www.url.com','stores',$store->getiD());
But i don't know how to use it, i tried after the save of $store, i tried to reload a store but still get error.

So first, am I in the good way ? How can I setup base url ?

Regards,


texts: Magento 2 My site's header now show for the first load after flush the cache

texts:
After i flush all cache and delete my browser's history and try to reach my site as a new visitor my site's header not show no matter how much time i wait.
When i refresh the page its show up with no problem.
This error applies to the whole header section including search bar,cart,profile,logo, etc.

Im using custom theme with varnish and memcached.

Thank you


texts:
Is there any (easy) way to find out which API users are still active? Or when a user was used the last time?

I just came up with add some logging code in

app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
login()


texts: How to call checkout sucesspage with ajax request

texts: i have created some extra steps on checkout page. The last step is to show successpage.Is there any  way to call successpage layout using ajax request on that step? or is there any other way to make successpage as a checkout step?


texts: Magento 2.3.3 Fails on magento setup:di:compile with an error mentioning InvoiceFlexFieldProcessorInterface

texts:
I have installed the new Magento 2.3.3 version.

After I have run the command:

  php bin/magento setup:di:compile

I have Faced the following error:

  PHP Fatal error: Interface 'Vertex\Tax\Model\Flexfield\Processor\InvoiceFlexFieldProcessorInterface' not found in /var/www/html/magento2/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php on line 24

Please refer the following screenshot:

How to solve this.

Thanks in Advance.


texts: Why is BitDefender flagging Magento 1 sites as containing malware

texts:
I'm not sure if this is the right place to ask this question, so apologies in advance.

I've just noticed that several Magento 1 sites I look after including development sites are now being blocked by Bitdefender as containing malware, but I've scanned them and I am absolutely sure they haven't been compromised. I notice the Porto Magento Demo theme site is also being blocked so I think it's a problem with Bitdefender.

Anyone know if there is a work around for this. I've filed false positive reports with Bitdefender but have not heard back.

A couple of customers using Bitdefender are saying that they get a malware message about JS:Trojan.Cryxos.3663

It appears that it is only the product pages that get blocked


texts: How to show the product attribute in the product listing page Magento 2.3

texts:
How to show the product attribute in the Product listing page i had used the helper in Magento_Catalog (Magento_Catalog/templates/product/list.phtml) but it gives the value of the product attribute not label the attribute type is Dropdown.

$this->helper('Magento\Catalog\Helper\Output');
$_helper->productAttribute($_product, $_product->getManufacturer(), 'manufacturer');

I got the out as 5755

I want to get the value using above method how can we do this.

Thanks in Advance:)


texts: Workflow for development using IDE and SVN

texts:
Before I ask this I realize the answer is going to be different for everyone, but I think that the majority of magento pro's will have some amount of common ground on this.

What is the ideal workflow for magento development using an IDE and SVN?

Up to this point I have been using sublimeText and manually uploading files into the working copy, then once tested, I commit. We are now starting to use PHPstorm with SVN integrated, but the problem I see is how do you test code without committing? If you commit a change and it doesn't work then what? Revert?


texts: Change bundle product price type via database

texts: Is it possible to change an existing bundle product from dynamic to fixed price via the database rather than having to create a new product?


texts:
In Magento , we can able to share the customer with website. is it possible to map the customer with store ?

I mean for customers has to be mapped with specific stores.


texts: Addtocart in custom phtml executes multiple time when browser is refreshed?

texts:
I have a button which add product to cart programatically.I execute but when the browser is refreshed it execute again.Give solution. It is not a submit button.

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="btncart" onclick="setLocation('<?php echo Mage::getUrl('mycustommodule/custommodule/savetocart/',array('visitorid'
=> $visitorid))?>')"><?php echo $this->__('Add to Cart') ?></button>


texts: Is there real working solution for reindex only one specific product?

texts:
I've tried to do these but nothing worked:

Mage::getSingleton('catalogsearch/fulltext')->cleanIndex(null, $productId);
$storeIds = $product->getStoreIds();
foreach($storeIds as $storeId) {
  $searchIndex = ' ' . $product->getName() . ' ' . $product->getSku() . ' ';
  Mage::getResourceModel('catalogsearch/fulltext_engine')->saveEntityIndex($productId, $storeId, $searchIndex);
}

This also didn't work:

$processes = Mage::getSingleton('index/indexer')->getProcessesCollection()->addEventsStats();
$observer->getProduct()->getResource()->refreshIndex($observer->getProduct());
Mage::getSingleton('catalogsearch/fulltext')->cleanIndex(null, $productId);
$storeIds = $observer->getProduct()->getStoreIds();
foreach($storeIds as $storeId) {
  Mage::getResourceModel('catalog/product_flat_indexer')->updateProduct($productId, $storeId);
}

This also didn't work:

$product = $observer->getProduct();
$product->setForceReindexRequired(1)->setIsChangedCategories(1);
$product->dataHasChangedFor('name');
$indexerCodes = [
  'catalog_product_attribute',
  'catalog_product_attribute',
  'catalog_product_flat',
  'catalog_product_price',
  'catalogsearch_fulltext',
  'catalog_url'
  'cataloginventory_stock',
  'catalog_category_flat',
  'catalog_category_product',
];

$event = Mage::getSingleton('index/indexer')->logEvent(
  $product,
  $product->getResource()->getType(),
  Mage_Index_Model_Event::TYPE_SAVE,
  false
);

I know that I can find couple of similar questions and answers here and there but I still cannot find fully working solution to reindex only one specific product.


texts: What does ~ and ^ mean before version number after module name in composer.json?

texts:
Sorry for this newbie question:
What does ~ and ^ mean before version number after module name in composer.json ?
"mageplaza/module-core": "^1.4.1"
"sebastian/phpcpd": "~3.0.0"


texts: How to create an Add to Cart button to add multiple products?

texts:
I have a website based on magento c.e 1.7, now i need a "add to cart" button on my cms page which add multiple simple products to the cart.
Right now i have id of those products, there is no problem with quantity as i only need to add each product with quantity one.

Thanks in advance,
Sarvagya


texts:
I am using Magento version 1.9.3.4 and having around 6000 products in my stores with varies categories. Now I need to change the product Price by increasing 8% for all products.

I have tried adding excel sheet and importing it and its taking very longer time to import.

Is there any other options to change the Price for all products at same time?


texts: exceptional error : attributeCode "thumbnail" does not exist in magento2

texts:
Hi guys can anyone exlain why i am getting this error in magento2 fronend , all commands runs succesfully i have installed amasty extension of layered navigation ,it works fine in dashboard but on frontend there is some attribute missing , any expert can save my time please ???

  1 exception(s): Exception #0
  (Magento\Framework\Exception\NoSuchEntityException): Attribute with
  attributeCode "thumbnail" does not exist.

edit : --------------
i solved it my own , i goto my phpadmin

(`SELECT * FROM `eav_attribute)

run this query , and change the attribute_id of thumbnail from 0 to 1 and it works fine now.


texts: Change Customer group during checkout based on country

texts:
i want to change customer group on one-page checkout based on checkout address .

Basically two type of customer group : Indian Customer , Outside India, if checkout country is other than India customer groups should auto switch to Outside India

issue : can same be applied for guest customer (non logged in users also).

I am using tier price for products based on Customer Group.

Please help me with way to do same .


texts: Unable to save version on Magento Connect extension upload

texts: I used to upload new version for my extension with no issue, but this time i am getting this error "Unable to save version".


texts: Magento2 - When customer reaches a .phtml block, log them out automatically if they're logged in

texts:
Is there a way where in a check through a .phtml block to see that the customer is logged in, and If so, automatically log them out - please no observers or modules.

I feel confident that I've seen a solution that talked about auto log out somewhere  vaguely, but I am unable to find this.


texts: how to update tax amount with custom price in magento 2

texts: HOW TO UPDATE TAX WITH CUSTOM VALUE IN CART OR CHECKOUT.My requirement was when customer click add to cart and he move to cart that time i want to update tax with some API so do the needful.


texts: EcomDev_PHPUnit set up in Magento EE 1.13

texts:
I am trying to set up EComDev_PHPUnit in EE 1.13 as per the instructions in

https://github.com/EcomDev/EcomDev_PHPUnit

Well first hurdle was to get modman working but I gave up and copied over the modules manually. Now the second issue is in the step 2: when I execute

php ecomdev-phpunit.php -a magento-config --db-name $DB_NAME --base-url http://your.magento.url/

I get an exception that says

 PHP Fatal error : Class 'Mage_Core_Model_Factory' not found in '../../../shell/abstract.php' on line 88

I went and added the factory path with require_once in abstract.pho but then it throws up an error saying another class is missing...

Has anyone encountered this? I am using Ubuntu 12.10 in a VirtualBox. Any help on this will be appreciated.

Solution or temporary solution:

I had to add

require_once '../app/code/core/Mage/Core/Model/Factory.php';
require_once '../app/Mage.php';

as the first lines of ../shell/ecomdev-phpunit.php

Which made it work fine. I am not sure if it is right or wrong :) Expert suggestions welcome
(stackexchange does not let me add a solution within 8 hrs of asking question and I have a low reputation, hence adding the answer here)


texts: $product->getOptions() returns empty result

texts:
I am trying to get product details including product custom options value in a custom block i created.This is the code i used on product detail page and it worked there, but when trying to use it on custom block page get Options returns empty value.

if ($_product->getId()) {
    foreach ($_product->getOptions() as $opt) {
    echo  $optionType = $opt->getType();
      if ($optionType == 'drop_down') {
        $values = $opt->getValues();
        foreach($values as $v)
        {
     $mydata = $v->getTitle();
print_r($mydata);
        }
      }
    }
}

I am new to magento so not sure what i am missing out here.
Can any one give me a hint please
Thanks


texts: Why there's no checkbox of the terms and conditions in the checkout?

texts:
I'm a newbie of magento :)
I wanted to ask , as ever , despite having flagged in magento admin checkbox that enables conditions and terms and , why in the frontend , in the checkout at the end of the purchase process , there's no checkbox terms and conditions ?
Thanks !


texts: Magento 2 order is shipped twice on sales_order_save_commit_after event

texts:
I'm trying to ship an order automatically everytime an order is placed, just with event sales_order_save_commit_after works, I tried sales_order_place_after and it throws me the error of "No such entity with order ID".

Anyway,I have the event in etc/events.xml , because in frontend it does not run.
However, the order is shipped twice, here you can see:

How can I just run once this event, so I can have just one shipment?

Greetings!


texts: Create product custom options template screen and assign to multiple product as mass assignment without effecting existing custom options

texts:
Hi All we are planning to create a admin page so as to create templates for product custom options.
So that we can assign a custom option template to multiple products as a mass assignment.
We know that programmatically we can set custom options to product and that will get added to the product.And we can see that from admin product edit screen.
Example: https://www.rakeshjesadiya.com/add-custom-option-programmatically-in-magento-2/
But we don't want the custom options to be saved to the product or make any changes to the existing custom options. We want to use the our custom options defined in the template rather than what is actually set for the product.
We will use our custom options defined in the template during add to cart and it should be assigned to the product and do the checkout process. We will make existing custom options as non-mandatory from database.
Later if admin assigns a different Custom option template to the product, than again during add to cart we will check which Custom option template is assigned and assign the options to the product and do checkout.
But we will neither use nor delete the existing custom options associated with the product already.
How can we implement such feature. Please provide your suggestions.


texts:
How to  disable cash on delivery payment based on cod availability.
etc/di.xml

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

Cashondelivery.php

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

Its not working in frontend...Any modification in my code .....


texts:
When I change a product in terms of its category Magento doesn't reindex automatically - I have to do it manually. Is this how it's meant to work? Its very annoying. We have set up a cronjob to run every night but i've just had the following back from the client:

The scheduled daily re-index does not do the full indexing list, essentially missing out the search indexing. (I do this manually when I do any additions/ movements

Thanks


texts: How the full page cache and varnish work in magento2?

texts:
I have check full page cache in devdocs

when full page cache on var/page_cache generated but when varnish is enable it's not generated.

so how the both work differently.
how the request work for caching.

Can anyone explain which have advance knowledge of caching.

Please read the question carefully before answering !!!!


texts: Magento 2 MSI - How to listen the event of all source item stock update API

texts:
Am using the below rest API to update bulk product's Stock information

/rest/all/V1/inventory/source-items

My requirement is that I need to listen the observer or some file whenever this API is triggered to write my custom logic.

Can anyone help me on how this can be done?


texts: Admin Forget Password not working? nothing happen when click on button

texts:
i try to inspect what happen

its show validation.js.. many more javascript file missing but they are in right place


texts: Multiple pdf invoice download restricted to 3 x 200 in Magento 1.9

texts:
I am trying to download multiple invoices in pdf format and can successfully download 3 consecutive batches of 200 invoices.
Any subsequent attempts generate an error. I have tried downloading just 10 at a time to no avail. I can download them singly.
If I use a different user, I can achieve exactly the same thing but no more, even if i attempt to down load invoices 601 >800 as a first print option.

The error log record is as follows:

  cat:
  /var/www/vhosts/magento.domainname.co.uk/httpdocs/var/report/1385309872091:
  Permission denied filemng: Error occurred during /bin/cat command.

and after renaming local.xml.sample get the following:
here has been an error processing your request
The requested Payment Method is not available.

Trace:

#0 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Payment/Model/Info.php(82): Mage::throwException('The requested P...')
#1 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Payment/Helper/Data.php(119): Mage_Payment_Model_Info->getMethodInstance()
#2 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php(316): Mage_Payment_Helper_Data->getInfoBlock(Object(Mage_Sales_Model_Order_Payment))
#3 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php(131): Mage_Sales_Model_Order_Pdf_Abstract->insertOrder(Object(Zend_Pdf_Page), Object(Mage_Sales_Model_Order), true)
#4 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php(137): Mage_Sales_Model_Order_Pdf_Invoice->getPdf(Object(Mage_Sales_Model_Resource_Order_Invoice_Collection))
#5 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Controller_Sales_Invoice->pdfinvoicesAction()
#6 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('pdfinvoices')
#7 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 /var/www/vhosts/magento.domainname.co.uk/httpdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /var/www/vhosts/magento.domainname.co.uk/httpdocs/index.php(86): Mage::run('', 'store')
#11 {main}

Any help would be appreciated. I have cleared the var/cache.


texts: Saving a product collection and showing parts of it per page, without reloading

texts:
In catalog/product/list.phtml, how can I always use the products from a single, saved product collection?

Is there a way to load a product collection, save it, then show some of these products (e.g. 20) per page without having to reload the product collection again when a new page is reached (either clicked or in infinite scrolling)?

I considered a couple of ways, but my understanding falls way short.

Create an observer which filters out any products that have already appeared.

//catalog_product_collection_load_before

$productCollection = $observer->getEvent()->getCollection();
$currentPage = (int) Mage::App()->getRequest()->getParam('p');
$seen = array();
    foreach($productCollection as $item){ // getting 503 on page 2
        $seen[] = $item->getId();
    }
    $productCollection->clear();
    $productCollection->addAttributeToFilter('entity_id', array('nin' => $seen));
    $productCollection->setCurPage($currentPage)->setPageSize(20);

Some kind of controller (indexAction)

$productsCollection->setCurPage($currentPage);
$productsCollection->load();

foreach ($productsCollection as $_product) {

    // ???
}

$currentPage++;

$productsCollection->clear();

Of course these are just fragments. Any pointers would be much appreciated.


texts: Associated product not getting added to parent product. Configurable product issue

texts:
I have a strange situation.
We have a configurable product with 2 dropdown options. Colour and Size.
After creating the product and saving it. we go to the associated products tab.

When we add products via the Quick Add feature. We do get all the signs of a functioning system. Although the product seems to be added under the options, in the table beneath there is no action. after saving the product all is gone. The simple products are created perfectly. No errors in exception, system or apache logs.

I added a photo.

EDIT
Good to mention. that the site is full of configurable products (shoes) those have just 1 configurable item (size) those work without any problems.


texts: Bypass Magento's form key usage to allow simple product to be added to cart

texts:
Magento CE 1.9.0.1

Just upgraded from CE 1.7 and our links that we previously used to add products to cart no longer work.

Examples:
http://www.website.com/checkout/cart/add?product=215&qty=1
http://www.website.com/checkout/cart/add?product=215&qty=1&coupon=save20

Basically, the user is led to an empty cart.

I have tried implementing a module that overrides the Magento CartController with a custom module however it still does not work.

The proper way since CE 1.8 is to include a form key which is unique to each session. I wouldn't mind included this in the URL but we provide external links for our 3rd party affiliates that allow them to essentially sell our product on their site.

Is there a way to disable the form key? If not, is there a way to dynamically include it into a URL? Thank you.


texts: Magento 1.9 Create new Magento Rest API to get category list

texts:
I am very confused about what kind of mistake I am doing to follow these steps provided here at the following link :

  Create new Magento Rest API to get category list in
  Magento

After doing all these steps and even editing, after reading all the solutions still getting the same error as getting before the implementation of this link steps.

To Create new Magento Rest API to get category list in Magento 1.9,
Where I can get category tree?


texts:
I'm trying to create customer account manually in my custom module. Customer account is getting created successfully and welcome email is sent to the new  customer using $customer->sendNewAccountEmail();. But On clicking the forgot password link I found the rp_token is missing in the template.

If we're programmatically creating customer_entity table is not updating. If the customer is registered via Magento default create account page in the frontend the rp_token is updating successfully.

How to create and insert rp_token on creating customer account programmatically? See my customer creation code below

        $orderArray = $this->getRequest()->getPost('order');
        $sellerComment = $orderArray['comment']['customer_note'];
        $id = $this->convert->_getSession()->getCustomerId();
        $websiteId = $this->_storeManager->getStore()->getId();
        $customerEmail = $orderArray['account']['email'];
        $customerFirstName = $orderArray['billing_address']['firstname'];
        $customerLastName = $orderArray['billing_address']['lastname'];
        $customerCompany = $orderArray['billing_address']['company'];
        $customerCity = $orderArray['billing_address']['city'];
        $customerCountryId = $orderArray['billing_address']['country_id'];
        $customerPostcode = $orderArray['billing_address']['postcode'];
        $customerTelephone = $orderArray['billing_address']['telephone'];
        $customerFax = $orderArray['billing_address']['fax'];
        $customerStreetArray = $orderArray['billing_address']['street'];
        $customerStreet = implode(',', $customerStreetArray);
        $customerID = '';

        /* if new customer */
        if ($id == 0) {
            $chars = \Magento\Framework\Math\Random::CHARS_LOWERS
                    . \Magento\Framework\Math\Random::CHARS_UPPERS
                    . \Magento\Framework\Math\Random::CHARS_DIGITS;

            $password = $this->mathRandom->getRandomString(10, $chars);
            $customer = $this->_customerFactory->create();
            $customer->setWebsiteId($websiteId);
            $customer->setEmail($customerEmail);
            $customer->setFirstname($customerFirstName);
            $customer->setLastname($customerLastName);
            $customer->setPassword($password);
            $customer->setForceConfirmed(true);
            $customer->save();
            $customerID = $customer->getId();
            $address = $this->_addressFactory->create();
            $address->setCustomerId($customer->getId())
                    ->setFirstname($customerFirstName)
                    ->setLastname($customerLastName)
                    ->setCountryId($customerCountryId)
                    ->setPostcode($customerPostcode)
                    ->setCity($customerCity)
                    ->setTelephone($customerTelephone)
                    ->setFax($customerFax)
                    ->setCompany($customerCompany)
                    ->setStreet($customerStreet)
                    ->setIsDefaultBilling('1')
                    ->setIsDefaultShipping('1')
                    ->setSaveInAddressBook('1');

            $address->save();
            $customer->sendNewAccountEmail();
        }


texts: Magento 2.3 sage pay credit card not working

texts:
We are using porto theme and configure sage pay payment getaway for credit card but its not working. Displaying error:
Error 1002 - Authentication failed

Please help me...!


texts:
I have a block to add link at top based on if customer login like this, when i'm at myaccount page the header link show the right one, but when i go to other page it shows the wrong one, here's my code:

<?php

namespace Namespace\Module\Block;

class Link extends \Magento\Framework\View\Element\Html\Link
{

protected function _toHtml()
    {
     if (false != $this->getTemplate()) {
     return parent::_toHtml();
     }
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $customerSession = $objectManager->get('Magento\Customer\Model\Session');
     if($customerSession->isLoggedIn()) {
       return '
 Logged In
' ;
     } else {
       return '
 Not Logged In
';
     }
    }
}


texts: how to display best selling products on homepage in magento

texts:
I need to show best selling product on product view page. I tried with the code:

$storeId = Mage::app()->getStore()->getId();
            $_productCollection = Mage::getResourceModel('reports/product_collection')
                    ->addOrderedQty()
                    ->addAttributeToSelect('*')
                    ->setStoreId($storeId)
                    ->addStoreFilter($storeId)
                    ->setOrder('ordered_qty', 'desc');
            Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($_productCollection);
            Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($_productCollection);
            $_productCollection->setPageSize(16)->setCurPage(1);
            $this->setProductCollection($_productCollection);

But this give error

a:5:{i:0;s:813:"SELECT SUM(order_items.qty_ordered) AS `ordered_qty`, `order_items`.`name` AS `order_items_name`, `order_items`.`product_id` AS `entity_id`, `e`.`entity_type_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`sku`, `e`.`has_options`, `e`.`required_options`, `e`.`created_at`, `e`.`updated_at` FROM `sales_flat_order_item` AS `order_items`
 INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state  'canceled'
 LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4 WHERE (parent_item_id IS NULL) AND (((e.visibility = '4') OR (e.visibility = '2'))) GROUP BY `order_items`.`product_id` HAVING (SUM(order_items.qty_ordered) > 0) ORDER BY `ordered_qty` desc

";i:1;s:4910:"#0 /public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

please help


texts:
Is there a way to load base url for background-image in css file? for example:

background-image: url('{base_url}/myimage.jpg');
background-repeat: repeat;


texts:
I want to log the SQL query for a custom collection. I tried the following code. But did not work. Any suggestions will be appreciated.

Mage::log($collection->getSelect(),null,'test.log',true);


texts: How to remove (colon) : after SKU on the product page? in magento 2

texts: I want to remove the  (colon)  : after SKU from the product display page. How can I do this?


texts: Operator [backend] create unique cart link for customer - extension? code? method?

texts:
several times per day customers e-mail us: "hi, the coupon code is not working", or "I can't add 3 products to my cart" .... and more problems like that. Very often we send a step by step procedure how they can do whatever they want succesfully.

But that made me think: would it be possible for our operators to create a link from the backend, or frontend for that matter, that we can send to the customer. If the customer clicks the link:
- a cart (that we made for them) is already activated
- and a coupon code is also already activated

In other words: can we create a cart for the customer from the backend? A cart that we then can then hand over to the customer by sending a link?

(I hope this is clear and appreciate your help)


texts: 'Enterprise_Index_Model_Action_Exception' with message 'Can't perform operation, incomplete metadata!'

texts:
Getting this error after an upgrade and after I try to run

php indexer.php --reindex catalog_category_product.

Please Help to solve this Problem.


texts: Custom payment method frontend requires JavaScript to be activated only after it is selected

texts:
Background story

I am building a new payment method. I'm in the process of adding the frontend in the checkout page. The payment method require javascript.

So I have managed to add a script to the header of the checkout page.

<?xml version="1.0"?>
<layout>
    <checkout_onepage_index>
        <reference name="head">
            <action method="addJs">
                <script>foo/bar.js</script>
            </action>
        </reference>
    </checkout_onepage_index>
</layout>

The problem:

However in my case, foo/bar.js bind a DOM element which not yet exists. Hence error in the JavaScript. That DOM element is only added to the page after the buyers reach the payment stage.

One dirty solution is to addJs together with the content, such that the script is executed together. This method however give me a problem that the block checkout.payment.methods does not have the method addJs. If we're to use this approach, what should I do to be able to addJs in checkout.payment.methods block?

Alternatively, I keep the script at head block, and I update my JavaScript to be triggered only when the buyer select my payment method. However I am not sure what JavaScript event is being dispatch if we were to listen on payment method selected. What would it be?