texts: How can I fix this possible race condition in Magento 1?

texts:
Background

I have an entity that's directly linked to Magento shipments with three fields:

entity_id
data
shipment_id

Problem

This entity is created based on a condition in an observer on the sales_order_shipment_save_before event. Something that looks like this:

if (condition) {
    // Create my entity and keep going
}
else {
    // Throw an exception and stop the Magento shipment creation
}

As you can see, if the condition is not matched, it must stop generating the Magento shipment. However, using this event, I cannot get the Magento shipment id using $shipment->getIncrementId(), because it's a before event.

If I try to use the sales_order_shipment_save_after event, I am able to get the increment id. However, I cannot stop the creation of the Magento shipment as it already has been created.

Temporary fix

A hacky way of fixing my issue is to get the next increment id by calling some code like this:

$sql = sprintf("SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name = 'sales_flat_shipment' and table_schema = '%s'",
               Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname'));
$readConn = Mage::getSingleton('core/resource')->getConnection('core_read');
$results = $readConn->fetchAll($sql);
$nextIncrementId = $results[0]['AUTO_INCREMENT'];

But this could possibly run into a race condition.

So how can I fix my problem without running into a race condition?


texts: Typeahead js upgrade error in require js

texts:
In my magento 2.17 project, I have used a ESPL autocomplete plugin. For Autocomplete they are using twitter typeahead js. As I need to upgrade the typeahead.js, I just copied the new library content (typeahead.bundle.js 0.11.1) to my old library file so that the whole content is replaced. And then ran the upgrade and deploy commands.
But in my search page I'm getting this error "ReferenceError: Bloodhound is not defined". Actually I haven't changed anything in the front end code. What I understand is the new library is not loaded by require js. Anybody have any Idea about this?
Note  : the new library is working fine with normal HTML page - outside the magento project


texts: Customer Session Not working in magento 2

texts:
This is my code,

   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $customerSession = $objectManager->create('Magento\Customer\Model\Session');

   if ($customerSession->isLoggedIn()) {
        $customerSession->getCustomerId();  // get Customer Id
        $customerSession->getCustomerGroupId();
        $customerSession->getCustomer();
        $customerSession->getCustomerData();
        $myemail=(string)$customerSession->getCustomer()->getEmail();
        echo $myemail;

same code I run Custom module its getting customer email , but, I paste same code other magento core module, Now if condition failed if($customerSession->isLoggedIn())   why? how to solve this problem.


texts: Add credit card as a payment method when order is placed through admin

texts: I want to add credit card as a payment method when order is placed through admin in magento2. The order should be placed using credit card as a payment method.I have attached screen capture of the same. Can anyone give any ideas.


texts: Magmi - Ignore attribute set if product already existists

texts:
Currently I'm building an automated import script with Magmi to import a CSV file on a scheduled basis.

The problem is that the CSV has only one value as attribute set (software restriction). So I've set this to default

But on the magento installation the products is updated by another plugin to get information from icecat. This plugin also changes the attribute_set in the magento store to match the right information.

My question is: How can I ignore the attribute_set in the CSV file of the product is already available in the magento store.


texts: Magento-2 Style attribute value on frontend

texts:
I have created attribute using install script

$eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'mydemo',
            [
                'type' => 'text',
                'backend' => '',
                'frontend' => 'Vendor\ModuleName\Model\Frontend\Style',
                'label' => 'My Demo',
                'input' => 'text',
                'class' => '',
                'source' => '',
                'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => true,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );

My frontend model file :

namespace Vendor\ModuleName\Model\Frontend;

class Style extends \Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend
{

    public function __construct(
        \Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory $attrBooleanFactory
    ) {
        parent::__construct($attrBooleanFactory);
    }

    public function getValue(\Magento\Framework\DataObject $object)
    {
        $data = '';
        $value = parent::getValue($object);

        return "<b>{$value}</b>";
    }
}

I want to show attribute value bold on frontend but it's not working. Can anyone suggest me how to achieve this? Any help would be greatly appreciated. Thanks!


texts: How to move sku in price block in product detail page and how to move title in magento 2

texts:
How to move SKU  in price block in product detail page in Magento 2

screenshot

i was tried with below code

 <move element="product.info.sku" destination="product.price.tier" after="-"/>

and
How to move title  in product detail page  alone


texts: How to get customer group in custom module admin page forms in magento 2?

texts:
I am creating a custom module.
I want to assign Customer Group/s to one of my custom table.
In my Grid.php I did customization like this
Path : app\code\Myconpany\BusinessPartner\Block\Adminhtml\Businesspartner
In protected function _prepareColumns()
$this->addColumn(
        'customer_group',
        [
            'header' => __('Customer Group'),
            'index' => 'customer_group',
            'type' => 'options',
            'options' => $this->getOptionArray2()
        ]
    );

In getOptionArray2() function
public function getOptionArray2()
{
    $customerGroups = $this->_customerGroup->toOptionArray();

    $data_arrays=array();

    foreach($customerGroups as $cg){

      $data_arrays[$cg['value']]=$cg['label'];

    }

    return($data_arrays);
}

Above all my customer group/s are retrieve
In main.php file
$fieldset->addField(
        'customer_group',
        'select',
        [
            'label' => __('Customer Group'),
            'title' => __('Customer Group'),
            'name' => 'customer_group',

            'options' => $this->getOptionArray2(),
            'disabled' => $isElementDisabled
        ]
    );

But my customer group/s are not loading in the form.

1 . What I missed here?
2 . Is there any way to get customer group?


texts: Magento 2 :- how to get email address in sales_quote_address_collect_totals_before events

texts:
How to get email address in sales_quote_address_collect_totals_before events    guest user email address.

<?php namespace xxxxxx\xxxx\Observer;

use Magento\Framework\Event\ObserverInterface;

class Observer implements ObserverInterface {

/**
 * @var \Magento\Customer\Helper\Address
 */
protected $customerAddressHelper;

/**
 * Initialize dependencies.
 *
 * @param \Magento\Customer\Helper\Address $customerAddressHelper
 */

public function __construct(

      \Magento\Customer\Helper\Address $customerAddressHelper

) {
   $this->customerAddressHelper = $customerAddressHelper;

}

public function execute(\Magento\Framework\Event\Observer $observer) {

    /** @var \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment */
    $shippingAssignment = $observer->getShippingAssignment();
    /** @var \Magento\Quote\Model\Quote $quote */
    $quote = $observer->getQuote();
    /** @var \Magento\Quote\Model\Quote\Address $address */
    $address = $shippingAssignment->getShipping()->getAddress();

     $order= $observer->getEvent()->getOrder();

    $customer = $quote->getCustomer();
    $storeId = $customer->getStoreId();
    $writer = new \Zend\Log\Writer\Stream(BP. '/var/log/nitesh.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info($address->getTelephone());
    $logger->info($address->getFirstname());
    $logger->info($address->getLastname());
    $logger->info($address->getEmail());
    $logger->info($quote->getCustomerEmail());

}

  print in a log file is : 2019-08-07T07:04:44+00:00 INFO (6):
  7827495597 2019-08-07T07:04:44+00:00 INFO (6): testasd
  2019-08-07T07:04:44+00:00 INFO (6): test1
  2019-08-07T07:04:44+00:00 INFO (6): 2019-08-07T07:04:44+00:00 INFO
  (6):

Email address is empty. I want to get guest user email address in custom observer file .


texts: How can I add new block in the footer and place it like this?

texts:
I'd like to add a new block in the footer and place it like this in Luma theme:
At the moment, the main footer container is using:
display: flex

and it shows all 3 blocks side by side.


texts: how to add city dropdown on checkout page instead of typing the city(M2)

texts:
I need to get rid of this company text field and Country drop down since the store serves locally.

Important :
How I can overide the city (text area) to a drop down with my own custom city list.?


texts: Configurable Product CSV Import - Simples not associating

texts:
I've been trying to import some configurable products via the csv importer in magento ce 2.2.3.

After running the import all products appear in the admin, however if I edit the configurable product, none of the simple products are associated.

Additionally if I then save the configurable product, it changes to a simple.

Here is a sample of my csv (where my multilple value delimiter is ';'):

allow_backorders,product_online,weight,tax_class_name,store_view_code,product_websites,manage_stock,attribute_set_code,product_type,sku,childrens_clothes_size,configurable_variations,barcode,season,description,short_description,fabric,name,clothing_type,color_name,colors,rrp,price,cost,has_options,is_coming_soon,is_in_stock,visibility,category_ids,_super_attribute_code,base_image,small_image,thumbnail,additional_images
1,1,1,Taxable Goods,,wholesale;wholesale_eu;wholesale_us,1,Children's Clothes,simple,TM-SS19-TT-BD-COC-6M-WHT,0-6m,,5055604860593,Spring/Summer,,,,COCONUTS All over printed Tootsa Tots body/White (Hawaiian) 0-6m,Body,White (Hawaiian),White,19,9.5,5.77,0,0,1,Not Visible Individually,,,,,,
1,1,1,Taxable Goods,,wholesale;wholesale_eu;wholesale_us,1,Children's Clothes,simple,TM-SS19-TT-BD-COC-12M-WHT,6-12m,,5055604860609,Spring/Summer,,,,COCONUTS All over printed Tootsa Tots body/White (Hawaiian) 6-12m,Body,White (Hawaiian),White,19,9.5,5.77,0,0,1,Not Visible Individually,,,,,,
1,1,1,Taxable Goods,,wholesale;wholesale_eu;wholesale_us,1,Children's Clothes,simple,TM-SS19-TT-BD-COC-18M-WHT,12-18m,,5055604860616,Spring/Summer,,,,COCONUTS All over printed Tootsa Tots body/White (Hawaiian) 12-18m,Body,White (Hawaiian),White,19,9.5,5.77,0,0,1,Not Visible Individually,,,,,,
1,1,1,Taxable Goods,,wholesale;wholesale_eu;wholesale_us,1,Children's Clothes,simple,TM-SS19-TT-BD-COC-24M-WHT,18-24m,,5055604860623,Spring/Summer,,,,COCONUTS All over printed Tootsa Tots body/White (Hawaiian) 18-24m,Body,White (Hawaiian),White,19,9.5,5.77,0,0,1,Not Visible Individually,,,,,,
1,1,1,Taxable Goods,,wholesale;wholesale_eu;wholesale_us,1,Children's Clothes,configurable,TM-SS19-TT-BD-COC-WHT,,"sku=TM-SS19-TT-BD-COC-6M-WHT,childrens_clothes_size=0-6m;sku=TM-SS19-TT-BD-COC-12M-WHT,childrens_clothes_size=6-12m;sku=TM-SS19-TT-BD-COC-18M-WHT,childrens_clothes_size=12-18m;sku=TM-SS19-TT-BD-COC-24M-WHT,childrens_clothes_size=18-24m",,Spring/Summer,,"Beautifully soft, pre-washed 100% organic Cotton jersey body with an envelope neck and nickel-free, coated snap buttons to make dressing easy. Choose from 3 striking prints and colour options, including this hand painted, Hawaiian shirt style design on fresh bright white.",100% Organic Cotton (GOTS Certified),COCONUTS All over printed Tootsa Tots body/White (Hawaiian),Body,White (Hawaiian),White,19,9.5,5.77,1,1,1,"Catalog, Search","Baby & Toddler/Bodies, Rompers & Pyjamas",childrens_clothes_size,/Sketch_Coconuts_Body_White.jpg,/Sketch_Coconuts_Body_White.jpg,/Sketch_Coconuts_Body_White.jpg,/Sketch_Coconuts_Body_White.jpg

Any assistance gratefully received!


texts: How to change styles-m.css in magento 2.3

texts:
Can any one tell me how can i change my theme css present in /pub/static/version1573734125/frontend/Hiddentechies/bizkickchristmas/en_US/css/styles-m.css.

As we cant change anything in pub/static, is there any way we can override this file or anything such that to modify css present here.
Please help.


texts: How do i get store view id from website id?

texts:
I have a website having one store and one view.
e.g)
Main Website
  Main Store
    Main View
so now i want to get Main View id from Main website id.
how can i do that?
Thank You


texts: How to set a custom shipping address on checkout page?

texts:
On checkout page by default my saved addresses are rendered. How I'll set a custom address as shipping address instead of addresses shown from my account?

I've added an event to observe checkout page load

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch_checkout_index_index">
        <observer name="vendorcheckout_before_dispatch" instance="Vendor\Module\Observer\Dispatch" />
    </event>
</config>

and here is my observer code

<?php

namespace Vendor\Module\Observer;
use Magento\Framework\Event\ObserverInterface;

class Dispatch implements ObserverInterface
{

    public function __construct(
        \Magento\Checkout\Model\Session $session,
        \Magento\Quote\Api\Data\AddressInterface $address,
        \Magento\Checkout\Api\ShippingInformationManagementInterface $shippingInformationManagement,
        \Magento\Checkout\Api\Data\ShippingInformationInterface $shippingInformation
    )
    {
        $this->session = $session;
        $this->address = $address;
        $this->shippingInformationManagement = $shippingInformationManagement;
        $this->shippingInformation = $shippingInformation;
    }

    /**
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $address = $this->address
                    ->setFirstname('john')
                    ->setLastname('cena')
                    ->setStreet('xxxx')
                    ->setCity('Delhi')
                    ->setCountryId('US')
                    ->setRegionId(26)
                    ->setRegion('Kansas')
                    ->setPostcode('6666')
                    ->setTelephone('444')
                    ->setFax('3333')
                    ->setSaveInAddressBook(0)
                    ->setSameAsBilling(0);
        if ($this->session->getQuote()) {
            $cartId = $this->session->getQuote()->getId();
            if ($cartId) {
                $add = $this->shippingInformation->setShippingAddress($address);
                $this->shippingInformationManagement->saveAddressInformation($cartId, $add);
            }
        }
    }
}

Above code is throwing

  Exception #0 (Magento\Framework\Exception\NoSuchEntityException):
  Carrier with such method not found: ,

Just to test manually I've added $carrierCode and $methodCode as flatrate in class module-checkout/Model/ShippingInformationManagement

This is adding shipping address properly to quote_address table. Though on checkout still my account addresses are shown instead of this custom shipping address from quote_address table.

Can someone guide me with following:
1. How to fix exception Carrier with such method not found ?
2. Do I need to update this address somewhere else also to render it on checkout page and save as shipping address with order?


texts: broken table in downloadable product tab

texts:
The table that is to be shown in downloadable product tab does not show the link and the availability and download numbers. Does any body have a solution? I use a Venus theme in RTL Persian language.

I shall say that the page source give this error:


texts: Recommended File System Ownership and Privileges

texts:
I need help for recommended privileges on my dedicated server.

My dedicated server is installed with Debian and on the official documentation of Magento it's recommended to follow the following instructions :

  Dedicated Magento server only. As a user with root privileges :

chown -R web-server-user-name .

Enter the following commands to set permissions:

find . -type f -exec chmod 400 {} \;
find . -type d -exec chmod 500 {} \;
find var/ -type f -exec chmod 600 {} \;
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \;
find media/ -type d -exec chmod 700 {} \;
chmod 700 includes
chmod 600 includes/config.php

On stackexchange posts, the main users use the following privileges:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find var/ -type d -exec chmod 777 {} \;

What is the most secure configuration?

How to secure the app folder and the local.xml?

How to secure the downloadable folder files?

And what are the privileges for run cron?


texts: How to add custom condition in custom rule

texts:
I've created a custom rule in my extension using this
Now I want to add my custom conditions in a rule like order attribute, order billing address attribute and
order shipping address attribute...Using that link I've got this result

But I want to add something like this :

I've tried this link also to do this task HERE
But it is for sales rule so it also adds an extra link in sales rule also!
I'm working with condition rule very first time so I also don't exactly know it's flow.
Does anyone have any idea? Please Let me know!


texts:
I have an attribute called main_category belonging to a product. When I load the product the attribute does not load with it.

If I do a

      var_dump($product)

it is not included in the array.

I don't want to load the full product by doing

    $product->load();

How can I just get this attribute without loading every attribute for each product


texts: Magento 2: Trouble shooting setup:di:compile

texts:
I am in the process to upgrade in existing 2.2.1 installation to 2.2.6.

When I am running setup:di:compile it stops abruptly without throwing any error.

Do it log the error somewhere or
what is other way to fix it?


texts: Static Block goes missing from home page

texts:
I have a Static Block that I've created.  When I flush Magento cache, I see the static block on my home page which is what I want.  However, if I come back the next day, my static block is missing.  Do you have any suggestions on what to do?

Thank you!


texts: Where are Magento 2 Remove Tags Implemented

texts:
Based on this description of Magento 2's layout rendering, where is the remove tag implemented in Magento?

That is, in a Magento 2 layout handle XML, you can tell Magento not to render a block with code that looks like this

<referenceBlock name="product.info.media.image" remove="true"/>

It's not clear what the remove tag is doing.  Where is this block removed?  It it at the layout handle XML parsing stage?  The reader/scheduler stage?  The generation stage?  Somewhere else?


texts: wrong order when sorting by price in admin product grid

texts:
This is screen from my admin products grid, here I sorting by price column(low to high), but as you can see it's not working right.
Can it be because some products are "downloadable" ?


texts: magento UPS Test Error is showing after upgrade 1.9

texts:
After Upgrade Magento 1.7 to 1.9.3 I am getting error on checkout page in UPS Shipping additional Test line is showing i checked in admin but there on Test option How to remove this

http://www.screencast.com/t/csyRTo5i


texts: Cannot read property `scopeLabel` of undefined on Product Detail Page

texts:
I'm using luma theme. Nothing haven't been changed I only installed latest version from Magento connect. Added test category and product. This problem is only on product detail page. Other pages works fine
On Product Page i have js error:

  knockout.js:3012 Uncaught TypeError: Unable to process binding "attr:
  function (){return {'data-config-scope':$data.scopeLabel} }"

  Message: Cannot read property scopeLabel of undefined

I tried php bin/magento setup:static-content:deploy and clear cache etc but nothing changed.
Is it bug magento?
How can i fix it?


texts: Cleaning Changelog tables - Cron Enterprise_Index scheduledCleanup issue

texts:
Our instance is throwing an error on this cronjob

  PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''

The code is pulling empty table name. It seems the reason is because in the function Enterprise_Index_Model_Cron::_runCleanupAction() is this code:

$this->_getClient()->init($metadata->getTableName());

which passes the correct table names as they are in the database (with prefix "mage_"), but then in the underlying method Enterprise_Mview_Model_Client::init($name) it does this...

public function init($name)
{
    $tableName = $this->_factory->getSingleton('core/resource')->getTableName($name);
    $this->_metadata = $this->_factory->getModel('enterprise_mview/metadata')
        ->load($tableName, 'table_name');
    if (!$this->_metadata->getId()) {
        $this->_metadata->setTableName($tableName);
    }
    return $this;
}

It gets a new table name using
$tableName = $this->_factory->getSingleton('core/resource')->getTableName($name);
which returns the same table name string only with a duplicated prefix e.g. "mage_mage_enterprise_url_rewrite_redirect". The code then cannot instantiate the model afterwards on this faulty table name.. This seems like a Magento core issue, no? Has Magento addressed this, or what would be the proper way to resolve this?


texts:
i would like to add the Attachment using below Magento model.

i have tried to add

$mail->getMail()->createAttachment(
    file_get_contents($fileName), //location of file
    Zend_Mime::TYPE_OCTETSTREAM,
    Zend_Mime::DISPOSITION_ATTACHMENT,
    Zend_Mime::ENCODING_BASE64,
    'file.csv'
);

with below model.

$mail = Mage::getModel('core/email')
    ->setToName($senderName)
    ->setToEmail($customerEmail)
    ->setBody($processedTemplate)
    ->setSubject('Subject')
    ->setFromEmail($senderEmail)
    ->setFromName($senderName)
    ->setType('html')
    ->send();

It's Correct ?
Any Help Much Appreciation! Thanks


texts:
I've been getting informed that occasionally when our receptionist is taking orders over the phone on our Magento ver. 1.9 website, her basket is randomly emptying itself.

I've been unable to replicate the issue myself but I've noticed our cookie lifetime is set to 3600 (1 hour).

Because our receptionist is on the website all day every day, am I right in believing that every hour that she's on the website she will lose her cookie and this could be what is causing the problem?

Or would Magento detect that she is still on the website and keep the cookie active?


texts: Error! Some required system tools when trying to apply Magento patches via SSH

texts:
I have been trying to apply some Magento patches via SSH (SUPEE-5344 and SUPEE-1533) from the Magento Community Edition download page (https://www.magentocommerce.com/products/downloads/magento/)

I am running in a SSH session:

sh PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh

but keep getting the following error:

  Error! Some required system tools, that are utilized in this sh script, are not installed:
  Tool(s) "patch" is(are) missed, please install it(them).

I have tried applying earlier patches but receive the same error message. How do I resolve this to apply the patches?


texts: Magento 2.4.1 admin tfa configuration page is blank

texts:
I just migrated from Magento 2.3.4 to 2.4.1 , after i logged in from the backend i was redirected to TFA configuration page, but it shows blank container like this:

i already ran these commands below, but nothing changes
bin/magento config:set twofactorauth/general/force_providers google
bin/magento config:set twofactorauth/google/otp_window 60
bin/magento in:rei
bin/magento c:c


texts: How to disable billing address edit or update in Magento2 checkout page?

texts:
I don't want to allow customers edit or update their billing address in Magento2 checkout page.

Even i want to disable  add new address in checkout page .


texts: Disable previous days in default Magento2 calendar

texts:
I have successfully added calender in my custom form by using below code.

<script>
                require([
                    "jquery",
                    "mage/calendar"
                    ], function($){

                        $("#My_ID").calendar({
                            showsTime: false,
                            hideIfNoPrevNext: true,
                            buttonText:"<?php echo __('Select Date') ?>",
                //dateFormat: "yy-mm-dd"
            });
                    });
            </script>

But, How can I disable previous days in default magento2 calendar?

Any help will be appreciated.

Thanks.


texts: Show configuration changes at different scope

texts:
I'm sure at some point I came across a module that updated the configuration section of the admin panel in order to show if a setting is changed at a lower scope. The idea being that it would be easier to navigate around in the default scope and see if a setting was changed at the website level.

I can't for the life of me find this extension, does anybody have any idea what it might have been?


texts: How to add more new fields into already created custom module for user registration fields?

texts:
What should I do to add more fields into existing custom customer registration form?
I have already created a module for adding new fields in the user registration form and it's working fine. For this, I have followed this link: adding new fields
But now I want to add more fields to the registration form. After adding new fields into the existing custom customer module and running the commands, no new fields show up in customers' details in the admin panel or are found in the EAV_ATTRIBUTE table in the database. I tried updating the version of the module but nothing happens.
If I delete the module name from modules list from app/etc/config.php and from setup_module table, then the new fields are added and are shown after executing the commands. But this deletes the data of the existing old custom fields.


texts: Magento layout and blockcode as plain text in template?

texts:
I have setting up a linux machine based on ubuntu server and deployed an existing magento shop for locale testing purposes. Now I cleared cache /var/cache, change DB and url path settings and when I try to open the main shop site, I see several PHP or Layout instructions as plain text in frontend theme:

For Example (shown as text in quellcode viewed in frontend):

<!--?
$this--->removeLinkBlock('top-link-cart');
?&gt;

or

<!--? if($_product--->hasSpecialPrice()):
                    $_price = $_product-&gt;getPrice();
                    $_specialPrice = $_product-&gt;getSpecialPrice();
                    $_priceDiff = round((100 - ($_specialPrice * 100 /         $_price)) * 1);
                    $_priceDiff = round($_price - $_specialPrice);
                endif; ?&gt;

phtml files are rendered correctly by php engine and I also checked CHMOD permissions. Anybody have an idea where can I solve this issue?


texts: Reuse and customization of existing Magento Custom Options

texts:
So I needed to create custom product type which I've created. Then I had to add new tab like Custom Options or Description etc., when I create new product and that tab, did that too, should have almost the same functionality as Custom Options that Magento provide.

My idea is to only take part of code that creates that "Add New Option" button, add him to my block or wherever it has to go and that he does rest of logic using core files.

Now, my question is, how can I reuse those Custom Options and add them to my new custom tab and how can I change fields Magento renders after clicking on add new option? (Admin should be able to create custom groups)


texts: Shop By menu link is not coming in category page mobile view magento 2 is anyone have any idea regarding this?

texts: shop by menu is not coming in category page mobile view magento 2  is anyone have any idea regarding this.


texts: Magento 2 custom admin router overwrite model

texts:
Is there a way to override model class with custom model class only when going to custom url?
Example:When going to

  http://example.com/admin/adminhtml/sitemap/index/key/aa6f86507bb01ef052dc1baf515d87ca9a3b3098f6d2aa474c4b1e080b3d0775/

uses core model on generation.
Now I want when going to my custom route

  http://example.com/admin/customproduct/sitemap/index/key/aa6f86507bb01ef052dc1baf515d87ca9a3b3098f6d2aa474c4b1e080b3d0775/

rewrite core model with di.xml

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


texts: Magento 2 Why can't I change extension repository with composer?

texts:
I'm trying to install an extension using composer, before I can install it directly with require, I need to configure the repository of the extension with this command
composer config repositories.amasty composer https://composer.amasty.com/community/

For some reason an old repository is still configured, and even changing the config of composer to this new repository, is asking for credentials of the old one.
Also when I run composer update, it asks me for credentials for the old repository.
What can I do?


texts: Get Product Image custom use Helper and Block in Magento 2

texts:
How can I put the below code into the module's files like helper/data.php or block/product.php, and how to use it to call Helper and Block into file.phtml .

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->create("\Magento\Catalog\Model\Product")->load($_item->getId());
$helperImport = $objectManager->get('\Magento\Catalog\Helper\Image');
$imageUrl = $helperImport->init($_product, 'grid_hover_image')
                    ->setImageFile($_product->getHoverImage())
                    ->getUrl();

Thank you.


texts: Magento 1.9.2 products appears ok only if resave them

texts:
The problems that i face in Magento products are:
a) Add to cart button does not appear
b) Image sort order numbers are not set

When I resave a product the "Add to Cart" button is appearing and Images getting order number "0"

How can I massive resave all products?


texts: I get an error when I indicate the path to the Symlink 1.9

texts:
I am using the module Image Optimizer and I need to specify the media folder to optimize the pictures.

But I don’t have a media folder for the project, there is only a Symlink to the directory /mnt/MEDIA/media/ relative to the project root. If I specify the path to the media folder in the admin panel, I get an error

project dir: /var/www/vhosts/xxxe.de/httpdocs/
media dir: /mnt/MEDIA/media/

  Scanning and reindexing failed.

SplFileInfo::isFile(): open_basedir restriction in effect. File(/var/www/vhosts/xxxe.de/httpdocs/media/..) is not within the allowed path(s): (/var/www/vhosts/xxxe.de/:/tmp/:/mnt/MEDIA/media)

File ownership matches :


texts:
I need to show the layer navigation filter values in above the search page heading.

I have tried below code in the
app\design\frontend\rwd\default\template\catalogsearch\result.phtml
file.

$layout         = Mage::getSingleton('core/layout');
$block_header   = $layout->createBlock('catalog/layer_state')->setTemplate('catalog/layer/state_1.phtml');
$block_links    = $layout->createBlock('core/text_list','catalog.leftnav.state.renderers');
$block_header->setChild('state_renderers',$block_links);
echo $block_header->toHtml();

But I am getting empty value.
Please assist me.


texts:
I need help to fix my Magento 2.x website without losing any data. Recently my running Magento 2.x website is down and showing "New Installation" process.

I have found the problem with the "env.php" file has no data saved. I don't know how it's missing from the env.php file.

I was trying to add the PHP configuration back code into the env.php file using by via SSH key but unfortunately, the file can't save with my inputted data.

It's showing Error doing I have open env.php file using NANO env.php and add all the date and press Ctrl+O to save the data but it's gonna save.

Showing warning like No Free space.


texts:
I am using Magento 1.9.2 with luxury theme 1.2.X

My product page shows price of the product like 999.0000  I want to remove the price after decimal points.

I want to show Price like this 999.

Here is my code for Price

<?php $_price = $this->getProduct()->getprice(); ?>
    <?php if($_price) : ?>
        MRP: <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_price, 'price') ?>
    <?php endif ?>

how to achieve it


texts: How to find count that how many times a product is sold in each category?

texts: I need to get the number of times a certain product is sold or ordered.


texts: How to reload shopping cart summary via ajax in Magento 2.2?

texts:
I am adding quantity increment/decrement buttons on shopping cart page. How can I reload cart summery (subtotal/shipping rate/grand total/discount/tax section) via ajax ?

I have added below code in app/degign/frontend/Theme Vendor/Theme/Magento_checkout/templates/cart/item/default.phtml to add +/- buttons

<div class="control qty">
    <button type="button"   id="<?= /* @escapeNotVerified */ $_item->getId() ?>-dec"  class="decreaseQty"></button>
    <input id="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty"
           name="cart[<?= /* @escapeNotVerified */ $_item->getId() ?>][qty]"
           data-cart-item-id="<?= /* @escapeNotVerified */ $_item->getSku() ?>"
           value="<?= /* @escapeNotVerified */ $block->getQty() ?>"
           type="number"
           size="4"
           title="<?= $block->escapeHtml(__('Qty')) ?>"
           class="input-text qty"
           data-validate="{required:true,'validate-greater-than-zero':true}"
           data-role="cart-item-qty"/>
    <button type="button"  id="<?= /* @escapeNotVerified */ $_item->getId() ?>-upt" class="increaseQty"></button>
</div>

And added below javascript in cart.phtml

<script>
require([
    'jquery',
    'Magento_Customer/js/customer-data',
    'jquery/jquery-storageapi',
    'Magento_Checkout/js/action/get-totals'

    ], function ($, customerData, storageApi, getTotalsAction) {
    // $("#submitbutton").hide();
    var form = $('form#form-validate');
    var qtyfields = $('input.qty');
    $('.page.messages').each(function () {
        var thismessage = $(this);
        thismessage.attr('id', 'messages');
    });

    form.find(qtyfields).each(function (e) {
        var thisfield = $(this);
        $(this).change(function () {
            console.log('change detected');
            form.submit();
        });

    });
    form.on('submit', function (e) {
        e.preventDefault();
        $.ajax({
            url: form.attr('action'),
            data: form.serialize(),
            type: 'post',
            success: function (res) {

                //code to reload cart item section
                var parsedResponse = $.parseHTML(res);
                var result = $(parsedResponse).find("#form-validate");
                $("#form-validate").replaceWith(result);

                //below two lines refershing cart summary
                var deferred = $.Deferred();
                getTotalsAction([], deferred);

            },
            error: function () {
                console.log('error');
            }
        });
        console.log('form submitted');
    });
});
</script>

But cart summary is not reloading after quantity change.


texts: Magento 2 - Cant save categories with too much products after migration

texts:
When I try to save categories in Magento 2 Administration in Products > Inventory Categories the following Message appears:

  Something went wrong while saving the category

The exception.log contains the following message(stack-trace can be delivered if asked):

  main.CRITICAL: PDOException: There is no active transaction in
  ../vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:324

The problem does not appear with categories containing less than ~200(numbers may vary) products.

In my experience it doesn't matter if I run the system in production or developer mode. I already truncated the url_rewrite table, cleaned cache and reindexed after migration.


texts: Remove Layered Navigation for specific category in Magento 2.2.11

texts:
My version of 2.2.11 has the new system for Custom Layout Updates where you upload the the layout in app/design/frontend/Theme_Vendor/Theme_Name/Magento_Catalog/layout
I need to disable the display of layered navigation for a category with id 403
So I have uploaded a file in the directory above with the name catalog_category_view_selectable_403_NoLayer.xml
The contents of this file are:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
<referenceContainer name="catalog.leftnav" remove="true" />
    </body>
</page>

The custom layout is then selectable in the Design -> Custom Layout Update list of that specifc category.

I selected and save the category.
I clear all caches.
I would expect the layered navigation not to be visible, but it still is...
I have also tried to setup update, compile. deploy static content in both developer and production mode. Nothing works.
Any ideas what might be wrong?


texts: Extensions installed through composer is not showing in backend

texts:
I have installed few extensions from composer and those were showing enabled in module:status as well as config.php file and setup:module table also has entry. But those modules were actually not installed in backend.
Anyone have any idea why it happening like this?


texts:
We sell baby gates on our site and on amazon. We have combination of gates & extensions of different sizes as group products. It is essential that we keep them as grouped products from inventory management point of view. As each gate (of different size) & each extension (of different size) has different SKU which needs to go from our inventory when a combination of gate + extension is sold.

On Amazon we want to show multiple of these (grouped products) options as one configurable product eg.http://www.amazon.co.uk/Safetots-Extra-Safety-6-4cm-Extension/dp/B00IJVY5FI/ref=sr_1_29?ie=UTF8&qid=1446194604&sr=8-29&keywords=safetots+gate
It is a configurable products with grouped products as options.

As magento won't let us do it. Please can some one guide on what might be better way of doing it.

Thank you!


texts: Stock and Out Of Stock filter in Layered Navigation

texts:
I try to add Stock and Out Of Stock filter in the Layered Navigation.
I set the configuration of the attribute "quantity_and_stock_status":

In the storefront I look the filter, but if the configuration -> Display Product out of Stock is enabled it counts all items without stock status condition.

I have seen the following in the code. Magento does not filter if the option Display Product out of Stock is enabled.

  if (!$this->inventoryConfig->isShowOutOfStock($currentScopeId)) {
        $select->where('stock_index.stock_status = ?', Stock::STOCK_IN_STOCK);
    }

I have tried to replace this class but the methods are private and it gives error.

Is there any alternative?


texts: How to get the Qty left in stock of a particular product in Magento 2

texts: anybody can suggest me that how can i display the left quantity in stock of a particular product in product details page ?. I am using Magento 2.1.3.


texts: Magento 2 Products assigned to category issue

texts:
For some reason we are experiencing a issue with our Magento site with products randomly being added to a certain category.

We have removed them several times but they randomly appear in that category again.

Has anyone else experienced anything like this? If so did you find a solution?


texts: How to get catalog product data in Magento 1.8?

texts:
I use these lines below to get the CMS page data,

// Get current cms page from Mage:getSingleton
$cms_id = Mage::getSingleton('cms/page')->getIdentifier();
$cms_title = Mage::getSingleton('cms/page')->getTitle();
$cms_content = Mage::getSingleton('cms/page')->getContent();
var_dump($cms_content);

What about if I want to get a catalog product data? I want to get the product's name for instance,

$_helper = $this->helper('catalog/output');
$product_id = Mage::getSingleton('catalog/product')->getIdentifier();
$product = Mage::getModel('catalog/product')->load($product_id);
echo $_helper->productAttribute($_product, $_product->getName(), 'name');

result,

  Fatal error: Call to a member function getName() on a non-object in
  C:\wamp\www\mywebiste.com\app\design\frontend\mywebsite\default\template\page\html\banner.phtml
  on line 6

Any ideas?


texts: After upgrade magento 2.3.6 to 2.4.2 issue

texts: After upgrade magento 2.3.6 to 2.4.2 i getting this error when follow setup upgrade :-


texts: Magento 2 how to increase text type field length?

texts:
I have a module where I save a PDF file in a text type field, however I just realized that the pdf was not stored completly, it misses some characters. This is how I created the field:
$installer->getConnection()->addColumn(
            $installer->getTable('sales_order'),
            'pakke_label',
            [
                'type' => 'text',
                'nullable' => true,
                'comment' => 'Pakke Shipment Label',
            ]
        );

The pdf has around 120,000 characters, but it's storing more than the half.
Is this size increase directly in MySQL? or I can increase the size of the field here in Magento?
Greetings!


texts:
I want to create a form in my custom template like http://nimb.ws/YL2oVp.

Is there any Magento 2 extension exist or i have to build it manually if it so then how to manage dynamic country and region drop downs.

I am beginner at back end Magento 2 kindly guide me.

Thanks in Advance.


texts: How to get Store Name by using Multiple Store Id in Magento?

texts:
I want to get store name by using multiple store ids in magento. like:

<?php $store_ids= array(1,2,3);

Now how to get store names of these store ids.


texts: Magento 2: Event name before place order?

texts:
I'm looking for event before any order placed. Need to do validation on observer.

https://www.mageplaza.com/magento-2-module-development/magento-2-events.html

If there is Bank Transfer then before clicked on "Place Order", If there is Paypal then Before went to Paypal.

Before it redirects to any third party Online/Offline it should be called.

I'm here <site url>checkout/#payment


texts: How do I transform the create new customer page

texts:
Where do I transform the first name and Last name field into a single row with round corner?

I am using Magento 2.3

Transform this as new Image


texts: Product pages loading occasionally without product attributes

texts:
I am facing the following issue on an already-live site on Magento 2.3.2:

product pages occasionally don't load completely, missing (amongst other) product attributes / swatches (clothe sizes in our case), which are mandatory and thus preventing orders to be placed.

This happens:
* about 70% of the time the first time a new browser visits a product page
* about 40% on each refresh

I have tried switching magento modes, flushing all caches multiple times, changing PHP version (currently on 7.2 served as FPM app through Apache). As it is already live I have not yet tried to start disabling add on modules, although I see none that could be directly affecting product pages.

No obvious errors in JS console, Magento backend, or Apache logs except:
AH01070, which relates to error parsing script headers / premature end of headers, which I'm currently looking into.

Any one encountered anything similar? If not, any ideas how to rule if it's something Magento-related or webserver misconfiguration?

Thanks

(not adding many magento-related tags until I'm certain)


texts:
I'd like to resize category images in my website, into square thumbnails. I have found and placed the following function in Mage/Catalog/Model/Category.php:

public function getResizedImage($width, $height = null, $quality = 100) {
    if (! $this->getImage ())
        return false;

    $imageUrl = Mage::getBaseDir ( 'media' ) . DS . "catalog" . DS . "category" . DS . $this->getImage ();
    if (! is_file ( $imageUrl ))
        return false;

    $imageResized = Mage::getBaseDir ( 'media' ) . DS . "catalog" . DS . "product" . DS . "cache" . DS . "cat_resized" . DS . $this->getImage ();// Because clean Image cache function works in this folder only
    if (! file_exists ( $imageResized ) && file_exists ( $imageUrl ) || file_exists($imageUrl) && filemtime($imageUrl) > filemtime($imageResized)) :
        $imageObj = new Varien_Image ( $imageUrl );
        $imageObj->constrainOnly ( true );
        $imageObj->keepAspectRatio ( true );
        $imageObj->keepFrame ( false );
        $imageObj->quality ( $quality );
        $imageObj->resize ( $width, $height );
        $imageObj->save ( $imageResized );
    endif;

    if(file_exists($imageResized)){
        return Mage::getBaseUrl ( 'media' ) ."/catalog/product/cache/cat_resized/" . $this->getImage ();
    }else{
        return $this->getImageUrl();
    }

}

and this is how it's used in template files:

<img src="<?php echo $category->getResizedImage(100,100); ?>" alt="<?php echo $category->getName(); ?>" />

But it's not working propely, images are not cropped and they're not resized into 100x100 pixels.

This function is suggested by many people having the same issue, but it's just not working for me. Any suggestions?


texts: We get following error message in logs any idea how to fix it?

texts:
a:5:{i:0;s:1058:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.type_id' in 'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2)) / 1) + 1 AS `range`, COUNT(*) AS `count` FROM `catalog_product_index_price` AS `e` INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '3' INNER JOIN `cataloginventory_stock_item` AS `at_inventory_in_stock` ON (at_inventory_in_stock.`product_id`=e.entity_id) AND ((at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=1 AND at_inventory_in_stock.is_in_stock=1) OR (at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=0) OR (at_inventory_in_stock.use_config_manage_stock = 1)) WHERE (`e`.`type_id` != 'amgiftcard') AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY FLOOR((ROUND((e.min_price) * 1, 2)) / 1) + 1 ORDER BY FLOOR((ROUND((e.min_price) * 1, 2)) / 1) + 1 ASC";i:1;s:5839:"#0 includes/src/Varien_Db_Statement_Pdo_Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

Any idea about this issue?


texts: How to increase shipping amount for UPS & FEDEX in magento 1.7.0.2

texts: I need to increase the calculated shipping amount in magento for ups & fedex.How can i do it?Is there anything we have to change in admin section while enabling shipping.


texts: Magento - How to update product position under a category according to their sub-categories?

texts:
I have been tasked to assign product positions to about 10000+ products, making it an impossible task to be done manually.

So I have a root category with some sub-categories. There are products under each sub-category, and all products under the sub-categories also belong to the root category.

Under the Cable category, I want to assign product positions to each product according to their sub-categories.

For example,

Product 24132 is under Subcategory Marine Cables, I want to change its position to 1.

product 24022 is under Subcategory Marine Cables, I want to change its position to 1.

product 24021 is under Subcategory Industrial Cables, I want to change its position to 2.

Basically I want to loop through all products under a Category, if the item is under a certain sub-category, a specific position will be assigned to it.

I have googled and looked up the api, but found nothing helpful. Your help will be much appreciated!


texts: Magento 2.2.2 error when setting order status with API

texts:
I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data?

This is the url I am calling

  https://localhost/rest/V1/orders

This is the data I am sending

  {"entity": {"entity_id": 10000001, "status": "Complete"}}

This is the error I am getting

  "Fatal Error: 'Uncaught Error: Call to a member function
  getMethodInstance() on null in
  /vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24

  Stack trace:

  0 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Magento\Payment\Observer\SalesOrderBeforeSaveObserver->execute(Object(Magento\Framework\Event\Observer))

  1 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Payment\Observer\SalesOrderBeforeSaveObserver),

  Object(Magento\Framework\Event\Observer))

  2 /vendor/magento/module-staging/Model/Event/Manager.php(97): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array,

  Object(Magento\Framework\Event\Observer))

  3 /generated/code/Magento/Stag' in '/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php'

  on line 24"


texts: Migrate 1.9.* CE to 2.1.3 - field mapping

texts:
I have got the error message:

  Source fields are not mapped. Document: sales_flat_order. Fields: imported,onestepcheckout_order_comment,onestepcheckout_giftwrap_amount

Then I have added to

  vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.2/map.xml

these rules

    <source>
         <field_rules>
          ...
<ignore>
   <field>sales_flat_order_imported</field>
</ignore>

<ignore>
   <field>sales_flat_order_onestepcheckout_order_comment</field>
</ignore>

<ignore>
   <field>sales_flat_order_onestepcheckout_giftwrap_amount</field>
</ignore>

<ignore>
   <field>salesrule_coupon_onestepcheckout_is_popup</field>
</ignore>

          ...
        </field_rules>
       </source>

Then run:

  ./magento migrate:data path/to/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.2/config.xml

But I have got the same message again.

Could you prompt me where I wrong, please?


texts: Magento ver 1.9.x - uploaded image create extra

texts:
I am facing a problem with Magento ver. 1.9.x Image import is working fine but when I try to upload image it don't work. My cache is disabled and media folders is 777. I have added front end and back end screenshots for you to have a look.

Any help will be really appreciated.


texts:
I need to alter the equivalent of native "getProductCollection", but I don't know how and where to do this.

I need the getProductCollection to look like this :

public function getProductCollection()
{
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->addFieldToFilter('bio', true);
    return $collection;
}

this code works fine, but it's not on the catalog product page. How do I change the initial function to add my addFieldToFilter


texts: Getting blank page when saving an existing product in magento

texts:
When I try to save an existing product it takes me to a blank page and the data is not getting saved.It does not happen for all products but only few.It was working fine until last week and haven't installed anything new. I tried error reporting in index and its not showing any errors. I have only system logs and have this warning - not sure its related to my issue.

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 64: parser error : Start tag expected, '<' not found  in /home/magento/public_html/lib/Varien/Simplexml/Config.php on line 510

Current memory limit is 1024


texts: Magento 2 - extend Magento_Ui/js/lib/validation/rules.js

texts:
I need to add custom validation rule to postcode field in my checkout page. Therefore I need to extend Magento_Ui/js/lib/validation/rules.js file.

How can I achieve it in custom module (not theme)?


texts: Catalog Price Discounts vs. Shopping Cart Discounts

texts: When you setup a discount on, for example, a category of products using the catalog price discount admin area, should that effect your shopping cart too or should you need to setup an additional rule for the shopping cart?


texts: Can I Enable Bulk Endpoints Without RabbitMQ

texts:
I'm trying to enable bulk endpoints to upload multiple products at once (The CSV uploader seems to be completely broken, so I'm going this route instead).

When I try to enable bulk endpoints (php bin/magento queue:consumers:start async.operations.all), I get a message saying "Unknown connection name amqp".

This seems to be related to RabbitMQ, which I can't install because I'm on a cloudways server.

Is there any way around this error, or am I going to have to write some custom functionality to upload my products?

Magento 2.3.1 CE


texts: Remove installation's base currency from order summary in admin

texts:
Does anyone know a quick way to remove the base currency from the order summary detail from within Magento's admin panel?

For example at the moment on our multi store setup we have order summary displaying like so:

Grand Total £447.60
           [€523.43]

We want to display the totals in just the store currency that the order was placed in (in this case €'s)


texts: Magento call another action with parameters

texts:
While placing order I'm calling my custom saveOrderAction() where I'm saving order data.

Inside saveOrderAction(), I'm trying to call redirectAction() method where I want to fetch order information and redirect to paytm for payment.

Inside saveOrderAction() I've

  // redirectAction Call
                    if($response){
                        $this->_forward($action = 'redirectAction',
                            $controller = 'zigycheckout_index',
                            $module = 'Medex_ZigyCheckout',
                            $params = array('quote' => $checkoutSession->getQuote()));
                    }

which is not redirecting to redirectAction().
Also how I can fetch data in redirectAction() sent from saveOrderAction()? using $order_id = $this->getRequest()->getPost('quote'); ?


texts: how to create a page with xml and phtml? I am using Magento 2.3.0

texts: I am trying to create a custom page with xml and phtml and I do not know the right way to do that.


texts: How do I remove the "Shipping & Handling" section from the totals section on the cart page?

texts:
I'm talking about this section: http://imgur.com/o7CVglB

I've found totals.phtml at template/checkout/cart/totals.phtml but it renders all totals uniformly.


texts: Magento 1.9.3.0 always redirects to home after update from 1.7.0.2

texts:
I updated a Magento 1.7.0.2 to 1.9.3.0 and at first glance everything looks fine, no errors thrown so far.

I followed the instructions described here: https://magento.stackexchange.com/a/25156

But now every page is being redirected to the homepage. Even if I delete the .htaccess file and prefix the url path after the tld with an index.php.

The database is still in the same state as before the update.
I changed the base URLs to http://localhost/ in the db and deleted the whole var/cache directory.

Needless to say, I'm doing the update locally first.
What could cause this behaviour? Thanks for your help!


texts:
I'm getting crazy with PHP curl and query string against Magento 2 REST Api.
I have the following query:

http://mystore/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=10

coping and pasting it in the browser it works fine. If I use PHP and curl like in this example:

$curl = curl_init("http://mystore/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=10");
...
curl_setopt_array($curl, [
        CURLOPT_RETURNTRANSFER => 1,
        ...
    ]);
return curl_exec($curl);

Magento return an "Invalid signature" error.
I found the problem, is the encoding of "&" character, but I tried using urlencode() or htmlentities(), I cannot find a solution. It works only substituting "&" with "& amp;" (without space), but the query is not correctly interpreted. Which is the correct way to send the query string using PHP curl?


texts: Images are blurry, loading "smaller" then needed

texts:
We are having issues with the Upselling Slider. This is the code I use to get the product thumbnails:
<?php $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); ?>
<?php $productImage = $_imagehelper->init($_item, 'category_page_grid')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(TRUE);
$productImageUrl = $productImage->getUrl();
echo "<!-- " . $productImageUrl . "-->"; ?>
<img src="<?php echo $productImageUrl; ?>" class="img-responsive" />

This is the result we get:

The Default code in the items.phtml is:
 <?php echo $block->getImage($_item, $image)->toHtml(); ?>

which gives us the same result (I'd say), so I does not depend on the code, as far as I understand this.
How can I load "full" thumbnail images? I understand that this will increase loading times, but the customer wishes to get non-blurry images, which is understandable.


texts: Magento Paypal standard partial refund change order state to complete

texts:
I am getting issue with paypal standard on my Magento 1.5.1.0 ,Below is the scenario:

I am working with sandbox account
After payment , paypal IPN changes my order state to "Processing" from "Pending Payment".
Now I go to my paypal account and issue a partial refund like if order total is 20$
, I refund 2$.
Now in response Paypal IPN do two things on magento

Change order state to complete [This is the issue it shouldn't
change the state to complete because I had done a partial refund
from order amount]
Create credit memo of 2$ and send email to customer.

The code I found is :

File     : app/code/core/Mage/Paypal/Model/Ipn.php

function : _registerPaymentRefund

Code     :

**Here order status is "Processing" checked via Mage::log**

    $payment = $this->_order->getPayment()
                ->setPreparedMessage($this->_createIpnComment($this->_info->explainReasonCode($reason)))
                ->setTransactionId($this->getRequestData('txn_id'))
                ->setParentTransactionId($this->getRequestData('parent_txn_id'))
                ->setIsTransactionClosed($isRefundFinal)
                ->registerRefundNotification(-1 * $this->getRequestData('mc_gross'));

        $this->_order->save();

**Here order status is "Complete" checked via Mage::log**

Below are the screen for more clear view first one is for magento and another one is for paypal :

It will be really appreciable if some one can guide me which function in above code changing order state from "Processing" to "Complete"


texts: How to get 10K products sample data in Magento 2?

texts:
I have downloaded Magento 2.2 with sample data.

So in sample data instance, there are only 2046 products. So I want 10K sample data products data.

how can I get this data?

Because I want to test my module on 10k products.

Anyone know about this solution?


texts: Need csv format for size and color Configurable product Magento2?

texts: Please Anyone suggest the sample csv file for both color and size Product for bulk import in magento2.


texts:
We are using below 2 parts of code in view.phtml to display result in product view page.

now Part 2 [ Features ] result is displaying below Part1 [ Product Description ]. I want to display these 2 parts as tabs in view page, so that if we click on particular tab, that part should open.

Part 1

Product Description

<?php echo $_product->getDescription();?>

Product Size & Space <?php echo $_product->getSku();?>

<?php echo $attribute_value = $_product->getData('size_space');?>

Part 2

<?php echo $attribute_value = $_product->getData('interior_exterior');?>


texts: How to stop Magento 2 from logging into var/debug/db.log

texts:
I have a Magento 2 site which crashes everytime db.log file gets full. All I need to do to restore the site is to delete db.log file in var/debug/ folder and make the folder writable.

How do I tell Magento not to log into this file again?


texts: SOAP V2 : catalog_category.tree Not Working on Localhost

texts:
Configuration :

Code:

<?php
$proxy = new SoapClient('http://192.168.1.89/abc/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('cat', 'welcome'); // TODO : change login and pwd if necessary
$result = $proxy->catalogCategoryTree($sessionId);
var_dump($result);
?>

output:

Note : Localhost - Wamp 3.1 - Windows 7


texts: Crosssell rows dropped despite valid CSV

texts:
Deleting all products for fresh start, then importing a CSV with six cross-sell items per SKU produces dropped cross-sell rows.

No errors reported at import stage:

Checked rows: 4157, checked entities: 706, invalid rows: 0, total errors: 0

File is valid! To start import process press "Import" button

Re-exporting the data confirms that cross-sell rows are indeed lost - but total row count has increased to 4073, somehow.

Deleting all products then re-importing original CSV gives exact same results.

Store already successfully configured to cope with up to ten cross-sell items, as per
How to Increase the Number of Crosssell Items in Cart?

Suggestions welcome :)


texts: Why we need to commit composer.lock file in magento 2?

texts:
I am a little confused regarding composer.json and composer.lock file.I have read about composer and got when we commit code then it is necessary to push composer.lock file.I am not understanding why we need this while we can manage dependency by composer.json file?

If any body know about it then please explain it briefly.


texts: Layered navigation - multiple attribute choices

texts:
I'd like to make a simple "multiple choices per attribute" addon for the layered navigation.

Simply put, I want

/pisarniska-razsvetljava.html?led_color[]=3&led_color[]=4

to work. For this to happen, I need to

convert attribute keys into IDs (e.g. led_color -> ID #2)
alter the product collection load procedure to handle attribute value arrays and not just plain values

Because I can't see any of that happening in Mage/Catalog/CategoryController, where would I go or which class/method would I need to overload?

I found this repo https://github.com/mercator/catalin_seo which does what we want but it's very difficult to make any sense of it as the author overloads a ton of classes. I am hoping for a simpler solution.


texts: Magento 2 : Difference between is_used_for_price_rules and is_used_for_promo_rules?

texts:
Catalog product attributes have two properties (can be found in catalog_eav_attribute table)

is_used_for_price_rules
is_used_for_promo_rules

I suspect that they connect to cart and catalog rules.

What does each of the properties refer to?


texts: Magento 2 How to hide "Sub Total" div in mini cart if not items in cart?

texts:
In Magento 2.3.5-p1 I want to hide the "Sub Total" div if no items in the cart. Also, if the cart has items then that div will show again. How can I achieve this?
There is a "subtotal.html" file in "web/template/minicart/item/" the file content as below:

As this div is updating with a knockout Js, can we place any custom class to that div or any other way? please suggest the quickest solution.


texts:
My Magento 2.3.3 Store is not calculating the VAT correctly.
I need to charge 19% VAT which is INCLUDED in the price.
But in the cart, the VAT calculation is wrong. Magento only calculates with 16% and I don't know why.
Here are my Settings:

https://prntscr.com/qjwesh
https://prntscr.com/qjweu2
https://prntscr.com/qjwevi
https://prntscr.com/qjwexf
https://prntscr.com/qjwf21

How can I fix this?


texts: Magento 1 to 2 data migration issue: "cart price rules" are missing website and group selection from Magento 1

texts:
After migrating data from magento 1.6.2 to magento 2.3.2 the shopping cart price rules are missing the website and groups selection.

For some reason the first 4 shopping cart price rules are not affected by this issue.


texts: Data Collection and Preparation: 15,000+ products for Magento 2

texts:
We're at the early stages of a reasonably large Magento project that will have a catalog of over 15,000 products.

The big problem is that the customer doesn't have any information on the products apart from the supplier and the product SKU.

The client is willing to use their company workforce to collect the data (e.g. from the various supplier websites), so that's not a problem. The issue is, without knowing anything about the products we're unable to model them in Magento (e.g. attribute sets and the like)

Is there an accepted practice or system (commercial or otherwise) that's used in these cases? At this stage we're thinking of making a web interface that allows them to record information about the products, which we will then use to import the data into Magento. But even this still has the issue of not knowing what attributes we should make available, as we have to be well structured in the way users input the data (being mindful of the old "garbage in, garbage out" adage!)

I'm not expecting a comprehensive answer, but any pointers in the right direction would be very helpful.


texts:
I am working with the magento(1.9), i changed my home page design using the cms block see below the code.

<reference name="content">
    <block type="core/template" template="federallawyer/topmenu/home/page.phtml">
        <block type="fljob/jobs_list"  name="home_jobs_list"  template="federallawyer/fljob/jobs/home/list.phtml"/>
    </block>
</reference>

I can see that page.phtml is get used in my page, but not my custom home_jobs_list child block.

I called that child block in page.phtml like this.

$this->getChildHtml('home_jobs_list')


texts:
I'm currently working for a client who has a magento 1.7 version and the etc folder has been put outside the root.
Is there any reason other than security to do it? Is not safe enough to have etc folder under app?
thanks


texts: Magento secure trading payment method need to hold a payment option

texts:
In my magento store have many customers. I want to offer my old customer with this special option.

(i.e) No need to pay at the end of the sale. They can pay later with their outstanding invoices by online mode. Is there any possible to set this option with magento store.

I m using Secure trading payment gateway.

Thanks


texts: Magento: how to log messages in custom module install script?

texts:
I would like to know how to log messages in custom module install script.

File path:

app/code/local/Namespace/Modulename/sql/modulename_setup/mysql4-install-0.0.1.php

The script is running fine. I'm able to debug the file and see the SQL error, moreover, core_resource table is updated properly but the message under the catch block is not logged at:

var/log/modulename_setup.log

My script:

<?php

try {
    $installer = $this;
    $installer->startSetup();
    $installer->run("
       CREATE TABL 'dummy_table' (
        'id' int(11) unsigned NOT NULL auto_increment,
         PRIMARY KEY ('id')
       ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    ");
    $installer->endSetup();
} catch(Exception $e) {
    Mage::log('Something went wrong.', null, 'modulename_setup.log');
}

?>

Any suggestions?


texts:
I have created phtml file,

app/design/frontend/Smartwave/porto/Magento_Contact/templates/inquiry.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile
/** @var \Magento\Contact\Block\ContactForm $block */
?>
<form>

    Full Name:
    <input type="text" class="form-control" id="name">

    Company Name:
    <input type="text" class="form-control" id="companyname">

    Email Id:
    <input type="text" class="form-control" id="emailid">

    Contact Number:
    <input type="text" class="form-control" id="contactnumber">

    Product Name:
    <input type="text" class="form-control" id="productname">

  Comment:
  <textarea class="form-control" rows="5" id="comment"></textarea>

  <button type="submit" class="btn btn-default">Submit</button>
</form>
</form>

and call this file in a static block in the backend

{{store url="inquiry-page"}}

{{block class="Magento\Framework\View\Element\Template" template="porto/Magento_Contact/inquiry.phtml"}}

but only
{{store url="inquiry-page"}}
 is working. Phtml block in not calling up


texts: How can I save shipping address and load it from cookie/local storage in Magento 2?

texts:
How can I save shipping address in cookie/localstorage when user fill it and whenever he/she come back to checkout page it automatically populate the saved data from cookie/localstorage in to corresponding fields - For guest user only.

I have done this in Magento 1 but In magento 2 Most of the checkout page is rendered by knockout js(I have zero knowledge of knockout js), I have no Idea how to proceed.

any help is appreciated


texts: Magento2 : How to show button in admin for custom module page?

texts:
I want to show the button in my custom module (admin page)

  but I am getting an error

I want to add a button and how I add action process for that button

i already tried this answer : (https://magento.stackexchange.com/a/212656/73525 )

GenericButton.php

    <?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Webkul\Mpquotesystem\Block\Adminhtml\Managequotes\Edit;

use Magento\Backend\Block\Widget\Context;
//use FME\News\Api\NewsRepositoryInterface;
use Magento\Framework\Exception\NoSuchEntityException;

/**
 * Class GenericButton
 */
class GenericButton
{
    /**
     * @var Context
     */
    protected $context;

    /**
     * @var BlockRepositoryInterface
     */
    protected $blockRepository;

    /**
     * @param Context $context
     * @param BlockRepositoryInterface $blockRepository
     */
    public function __construct(
        Context $context
    ) {
        $this->context = $context;
        //$this->blockRepository = $blockRepository;
    }

    /**
     * Return CMS block ID
     *
     * @return int|null
     */
    public function getBlockId()
    {
/*
        {
            return $this->blockRepository->getById(
                $this->context->getRequest()->getParam('news_id')
            )->getId();
        }  */
        return null;
    }

    /**
     * Generate url by route and parameters
     *
     * @param   string $route
     * @param   array $params
     * @return  string
     */
    public function getUrl($route = '', $params = [])
    {
        return $this->context->getUrlBuilder()->getUrl($route, $params);
    }
}

SaveandContinuebutton.php

<?php

namespace  Webkul\Mpquotesystem\Block\Adminhtml\Managequotes\Edit;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
 * Class SaveAndContinueButton
 */
class SaveAndContinueButton extends GenericButton implements ButtonProviderInterface
{

    public function getButtonData()
    {
        return [
            'label' => __('ADmin pproval'),
            'class' => 'save',
            'on_click' => 'location.reload();',
            'sort_order' => 30
        ];
    }
}

view/adminhtml/uicomponent/custommodule_edit.xml

<?xml version="1.0"?>
<!-- /**
 * Webkul Software
 *
 * @category  Webkul
 * @package   Webkul_Mpquotesystem
 * @author    Webkul
 * @copyright Copyright (c) 2010-2018 Webkul Software Private Limited (https://webkul.com)
 * @license   https://store.webkul.com/license.html
 */ -->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">

    <item name="buttons" xsi:type="array">
        <item name="save_and_continue" xsi:type="string">Webkul\Mpquotesystem\Block\Adminhtml\Managequotes\Edit\SaveAndContinueButton</item>
    </item>

    </argument>
</form>

when clicking that admin custom module page :

  Fatal error: Method
  Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
  exception, caught Error: Call to a member function
  getRequestFieldName() on null in
  /var/www/html/equpo2/vendor/magento/module-ui/Component/Wrapper/UiComponent.php
  on line


texts: Magento 2.1.1 Rest API Update price only

texts:
Trying to Change only the price of the products with PUT method.

HERE http://devdocs.magento.com/guides/m1x/api/rest/Resources/Products/products.html#RESTAPI-Resource-Products-HTTPMethod-PUT-products--id

is stated that this is possible! But When i make a call with only the price in the product array i get a response like

    Array
(
    [message] => Invalid product data: %1
    [parameters] => Array
        (
            [0] => Invalid attribute set entity type
        )

)

So i add attribute set adn then i get the response

Array
(
    [message] => The value of attribute "name" must be set
)

On the magento link here http://devdocs.magento.com/guides/m1x/api/rest/Resources/Products/products.html#RESTAPI-Resource-Products-HTTPMethod-PUT-products--id

Says that this should be possible with no other params

  Enter only those parameters which you want to update.

Any ideas why is this happening?

the call i am using
    PUT /rest/V1/products/:sku


texts: Display Street Address in multiple lines

texts:
1) Below is Street 1 address entered by customer & displaying in invoice pdf :

I am getting Street 1 address in Custom pdf. but its displaying in single line.

2) My custom Pdf :

Issue :

its not displaying complete Street 1 address.

Requirement :

Restrict Number of charactars & words in single line so that complete street  address will display in multiple lines.

$page->drawText($shippingAddress->getStreet(1) , 20, $page->getHeight()-240);


texts:
I created a page that shows a carousel with the images of the categories, but Magento is replicating the same block below the footer. Why?

Line for the block on HomePage:

<reference name="content">
<block type="page/html" name="branches" output="toHtml" template="branches/list.phtml"></block>

</reference>

Code of html page:

<?php
$categories = Mage::getModel('catalog/category')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addAttributeToFilter('level', 3)
                ->addIsActiveFilter();

foreach ($categories as $category) { ?>

    <a href="<?php echo $category->getUrlPath(); ?>">
    <img src="<?php echo $category->getCategoryImage($this,100,100); ?>" alt="<?php echo $category->getName(); ?>"/>

<?php } ?>
<?php ?>

Any idea?
Thanks!!


texts: What order the same event will fire if it is captured in several modules?

texts:
I want to listen to an event by using an observer in my module. There are some other module observers as well which are listening the same event. So is there any particular order of firing the observer functions for this event? Or can I set is through the code to fire my modules observer function after some other observer function?

Any suggestions will be appreciated. Thanks in advanced.


texts:
I just wanted to know that what is the right way to print array data into json format. I Know we can use php function json_encode() but is this the right way to print array data? Because i saw one of magento's core file, there was something like this

        if (!$_isValidFormKey || !$_isValidSecretKey) {
        $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
        $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true);
        if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) {
            $this->getResponse()->representJson(
                $this->_objectManager->get(
                    \Magento\Framework\Json\Helper\Data::class
                )->jsonEncode(
                    ['error' => true, 'message' => $_keyErrorMsg]
                )
            );
        } else {
            $this->_redirect($this->_backendUrl->getStartupPageUrl());
        }
        return false;
    }
    return true;
}

so if we look at this section

$this->getResponse()->representJson(
                $this->_objectManager->get(
                    \Magento\Framework\Json\Helper\Data::class
                )->jsonEncode(
                    ['error' => true, 'message' => $_keyErrorMsg]
                )
            );

we see magento is encoding data using \Magento\Framework\Json\Helper\Data class.

I am working on custom APIs where i need to send data in json format. So please correct me if i am not wrong that we can also print Array data using this \Magento\Framework\Json\Helper\Data class.

Thankyou.


texts: How can i integrate Magento 2 server with GitHub?

texts:
I'm new to Magento. I would like to create and design my online Marketplace by using Magento2.
I installed and configured two servers with Magento 2.4 (Community Edition), the first server is a test server and the second is for the productive server.
I am planning to buy some extensions from a developer company.
First, I would like to connect my Magento test server with Github, to give this company access to customize the extensions for me.
After that, I would like to connect the productive server to Github so I can push the customized extensions from the test to the productive server.
Is there any documentation or video (step by step for beginners) to help me to do the following?

How can I integrate the Magento2 server with Github?
Which Magento folders or files should be added to the gitignore file in Github?
How can I push the new customized codes (extensions) from the test to the productive server?

Thanks for your help.


texts: Merge one website into another website on same domain in Magento1.9.2.4 [Multiwebsite]

texts:
I have Multi-website domain , which has 4 website with one store in each.

Likewise Site Structure-

Domain : example.com

Website                Store

example.com             UK
example.com/fr          FR
outlet.example.com      UK
outlet.example.com/fr   FR

Now I want to merge website-

  outlet.example.com (UK) into example.com (UK)

and

  outlet.example.com/fr (FR) into example.com (UK).

So -

Which Entities among below,I need to move and HOW can I move each of
them  ?

customer,
orders,
promotions,
categories,
products,
newsletter subscribers etc.

What changes it would require at backend or at code level as well ?


texts:
I am trying to creating a web services for product category . I have created the files in etc folder i.e config.xml,api.xml and wsdl.xml .Under model i have created a product folder in it there is a api.php file. can anyone tell how to get the response in json form . i am getting the xml format in response. i want alll the product categories in that.

Click here to check the demo

dev.webtechstairs.com/ecommerce/api/v2_soap?wsdl=1?products


texts: Magento 2.2 runs super slow on frontend and backend using MAMP localhost

texts:
I install Magento 2 on MAMP Localhost on Mac but I don't know why It runs really slow on frontend and backend even I did turn on Varnish cache, minify CSS and JS, turn magento to developing mode and change php memory_limit to 1G. Can you guys please help? Here is my configuration:

Macbook Air 2015:
- CPU: i5 1.6GHz
- Memory: 8GB
- SSD: 128GB

MAMP:
- php: 7.0.22
- MySQL: 5.6.35


texts: How to add custom dropdown attribute for category in Magento 2

texts:
Now, I've got empty dropdown.

Here is my code (InstallData.php):

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Category::ENTITY,
        'width',
        [
            'type' => 'int',
            'label' => 'Width',
            'input' => 'select',
            'source' => 'Magento\Catalog\Model\Category\Attribute\Source\Page',
            'required' => false,
            'sort_order' => 4,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'is_html_allowed_on_front' => true,
            'group' => 'General Information',
        ]
    );

    $setup->endSetup();
}

And category_form.xml:

<?xml version="1.0"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="display_settings">
        <field name="width">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Width</item>
                    <item name="options" xsi:type="array">
                        <item name="33" xsi:type="string">33</item>
                        <item name="50" xsi:type="string">50</item>
                    </item>
                    <item name="default" xsi:type="number">50</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: magento2: unknown query INSERT INTO "search_tmp..."

texts:
recently i've done mass attribute update and noticed that i got new processes in DB, like that:

INSERT INTO `search_tmp_5b069a25b016d1_83026725` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT `search_index`.`entity_id`, (((0) + (0) + (0) + (0) + (0)) * 1) AS `score`

problem is that the never-ending, they slowing down the server and what is most important - they creating new same processes until server reaches pm.max_children parameter value and PHP-fpm die.

please advise what is nature of this processes and how to kill it completely? (if I kill existing ones - new are borns after some time)

p.s. indexer processes are not running.


texts: custom less not working in magento 2 production mode

texts:
I've a less file inside app/design/frontend//web/css/source/_test.less and included in default.xml like

<head>
    <css src="css/source/_test.css" />
</head>

It's working perfectly in developer mode but in production mode it's showing error like "

(index):1 Refused to apply style from ....


texts: Magento 2.3.2 - Unable to get Currency Rates for INR to USD form Store => Currency => Currency Rates

texts:
I am currently using Magento version 2.3.2.

I want to show currency switcher for INR and USD and want to show INR as default currency on the front-end, for this, I have made some setting in the Store => configuration => General => Currency Setup.

Please find the attached snapshot of the setting below:

As per the above setting when I want to get currency rate I am getting error

  Notice: Undefined index: INR_USD in /var/www/html/magento232/vendor/magento/module-directory/Model/Currency/Import/CurrencyConverterApi.php on line 91

Please find the snapshot of error page below:

Please suggest how can I configure currency switcher.

Thanks in advance.


texts: Product images dissappear after re-index

texts:
I am in the process of importing a bunch of configurable and simple products.

All was good until, the last few products.

After importing the csv file for the product images, and visiting the product in admin the image is imported correctly. However I have the re-index message obviously.

After running the re-index however all of the images for that product are gone.

I went into the database to try and see what was going on. I found the images still listed in the table 'catalog_product_entity_varchar'

So I deleted all the rows with the image that I was importing. Then I went to import the image again. And same problem. The image shows up until I run the re-index.

What can I do?

I just checked a bunch of the other simple products that I had made and ensured the images were there. But now they seem to not be there either in the admin. However on the front end of the site the images load when they are selected. So it appears the issues is really that the product images are not being shown in admin but do in fact exist, and are being properly associated with the product.

So why arent they showing in admin?


texts: Magento 2.3.5 - Configurable product showing all associate product in configuration grid in admin

texts:
I'm facing an issue that when I open any configurable product and then in configuration grid of associate products when I click on next to get another list of associate products its load all the products even if I have per page size set to 20 products.

Please help me if anyone knows how to fix this issue.


texts:
I have a problem with discount codes and taxes, I just cannot get it to result in the correct values.

Settings:

I have a tax of 25% on my site.
The tax is already applied to the price of the products.
I have a product in my basket worth 120
I have a 30% discount code

Intended result:
Subtotal: 120
Discount: -36
Total: 84
Tax: 16.8

Tried everything
I have now tried every combination possible to have this outcome, but no matter which settings I pair together, one of the values is wrong.

The closest I can come is through:

Apply Customer Tax: Before Discount
Apply Discount on Prices: Excluding Tax

This combination provides the wrong discount value in frontend, but it is purely cosmetic as the calculations and the total are done correctly:
Subtotal: 120
Discount: -29
Total: 84
Tax: 16.8

This approach however does not work with fixed discount values.

Is there something I am missing? What can I do?


texts: What is use of getFacetedData() in Magento 2?

texts: Can any please explain use of getFacetedData() is Magento 2 with collection


texts: Show No Image against Specific Color if Image not there

texts:
i am using magento 1.9.2.3 version. Normally mangeto behave when user click on the different color or size in configurable product case system show the specific image against every color if specific color image is not upload than system display the default image.
But My client requirement is when user click on the different color or size in configurable product which image is not upload than system should be display 'No Image or Blank Image' instead of default image. Because customer confuse against colors.

Can someone know how can i do this?

thanks


texts: Magento 2 : Image upload field in admin form using ui component

texts:
In my admin form I need 2 image upload field. I have added an image upload field using the below code.

mymodule_form.xml

<field name="image">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="source" xsi:type="string">store_logo</item>
            <item name="label" xsi:type="string" translate="true">Product Page Label</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="formElement" xsi:type="string">fileUploader</item>
            <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="uploaderConfig" xsi:type="array">
                <item name="url" xsi:type="url" path="mymodule/mymodule_storelogo/upload"/>
            </item>
        </item>
    </argument>
</field>

And I need one more field like this, but I am getting only one field upon duplicating this code. My doubt is that is it necessary to give the field name as image inorder to get image upload field ? Because when I change the field name to any other, it is showing me an error

  Attention
  The file was not uploaded.

Please Help


texts:
We are having an issue with Magento. Randomly this week it started only displaying free shipping. We don't offer free shipping.

It's disabled on the backend and there are no rules allowing for it. We use matrixrates to calculate the rates.

Any ideas how to get rid of it?


texts: Programmatically replace root block of the layout from controller

texts:
In controller, for some condition, I want to set another parent block instead of the declared one in the layout XML. The goal is to have a possibility to make checks in template file like this:

if ($this instanceof My_Module_Block_CustomBlock) {
    // ... custom stuff in template ...
}

I have tried append my custom block in the layout, but parent block is still which was declared in layout XML. The appended block is shown as a child1 of parent block:

public function ConversationAction(){

    // some condition:
    $converation_id = (int) $this->getRequest()->getParam('id');

    if (is_int($converation_id) && $converation_id > 0) {
        // I want to set my parent block here instead of default registered in xml layout file

        $this->loadLayout();

        $block = $this->getLayout()->createBlock('MyModule/Conversation')
            ->setData('area', 'frontend')->setTemplate('customer/Conversation.phtml');
        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    } else {
        // ... default layout and block ...

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

Is it possible to change the root block from controller somehow ?


texts: Filter by price shows but doesn't filter

texts:
My filter by price navigation shows but when a filter is clicked it just posts back to the same page with no change applied.

The filter categories are distributed evenly in line with the price set for products in the category and the correct number of products in each price range displays properly.


texts: Cannot See Product name in admin panel after saving

texts:
Recently I\m trying to add new products in magento admin panel, when I create the product and press the save button. but after that I see the name column in admin panel is empty!

What I did so far:
I cleaned the cache, I tried to reindex BUT the catalog_URL_rewrite is stuck in processing giving these error:

Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory' in lib/Zend/Db/Adapter/Pdo/Abstract.php:144

I checked the database for double URLs, checked for double product SKU and checked for double product name, but still have the same problem.

I even truncated some tables, I also checked the Unsigned Value_Id in database, even changed the INT to BIGINT, but still no luck.

by the way it is my first time writing in here so if you need more information let me know.

Thank you


texts:
I am facing problem after installing jQuery Lightboxes (FancyBox, PiroBox etc.)

Fatal error: Class ‘MagentoPycho_Lightboxes_Helper_Data’ not found in appMage.php on line 516

[UPDATED]

Some parameters in the js/colorswatch/colorswatch.js  (line 34) are undefined when Lightboxes are instaslled ( even if they are disabled ).

Here is my error message. in var\log\system.log:

  2013-03-01T10:05:02+00:00 ERR (3): Notice: Trying to get property of
  non-object  in
  D:\xampp\htdocs\store\includes\src\Mage_Adminhtml_Model_Config_Data.php
  on line 135 2013-03-01T10:05:02+00:00 ERR (3): Notice: Trying to get
  property of non-object  in
  D:\xampp\htdocs\store\includes\src\Mage_Adminhtml_Model_Config_Data.php
  on line 135 2013-03-01T10:05:09+00:00 ERR (3): Notice: Undefined
  variable: productId  in
  D:\xampp\htdocs\store\app\design\frontend\default\helloresponsive\template\catalog\product\compare\sidebar.phtml
  on line 32 2013-03-01T10:05:17+00:00 ERR (3): Notice: Undefined
  variable: productId  in
  D:\xampp\htdocs\store\app\design\frontend\default\helloresponsive\template\catalog\product\compare\sidebar.phtml
  on line 32 2013-03-01T10:05:22+00:00 ERR (3): Notice: Undefined
  variable: productId  in
  D:\xampp\htdocs\store\app\design\frontend\default\helloresponsive\template\catalog\product\compare\sidebar.phtml
  on line 32

This function  $this->getGroups() is not returning anything.


texts:
I am new to magento. I have module which is to Modify Shipping/handling charges during checkout.

Ex: If Customer select any UPS/FedEx/USPS services it will be populate/add from Cart/Checkout summery but no need to add/apply charges (no need to apply Shipping Charges).

Any Idea,Suggestions.

Thanks.


texts: Getting custom email template name in system configuration

texts:
I need to get custom email template in admin system configuration.
system.xml

This is my email template field code.

<email_template>
    Email Template
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
    <sort_order>5</sort_order>
    <frontend_type>select</frontend_type>
    <source_model>adminhtml/system_config_source_email_template</source_model>
</email_template>

config.xml
<template>
    <email>
    <custom_email_template translate="label" module="eztestimonial">
    Custom Email Template
    <file>mymodule/custom_email.html</file>
    <type>html</type>
    </custom_email_template>
    </email>
</template>
<default>
    <mymodulesettings>
      <email>
          <email_template>custom_email_template</email_template>
      </email>
    </mymodulesettings>
</default>

And i have added email.html file in locale/en_US/template/email/mymodule/ path
Now i got a outut like this

But i need to show my custom email name in that dropdown.
like:
I refer AW Blog Extension for this.


texts: Discounted shopping cart not working with PayPal

texts:
I am trying to add a surcharge to anyone who pay with PayPal. There are couples of extensions but the free one don't work too well. Then I was pointed to a direction to put "Negative Discount" under "Shopping Cart Price Rules" to mimic a surcharge.

First I was told to remove the limitation to insert negative amount into discount which now it works. However in the checkout process it doesn't get through PayPal.

Everything works well, it display "Negative Discount" in the shopping cart. The sub-total got updated however the value doesn't seem to pass to PayPal correctly. Upon checking out and choosing PayPal as an payment option it returns with:

  PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).

However, if I turn this "Negative Discount" price rule to a positive discount (that actually deduce the sub-total), everything will work perfectly well. So kind of pinpointed the issue to be on having "Negative Discount" to have confused PayPal on receiving a correct sub-total or line-item. I imagine PayPal wouldn't take a positive amount as a "Discount" line-item.

Questions are:

Is there a way to keep using this "Negative Discount" at all? By adding events on modules perhaps?
Is there another way to add surcharge to all orders that paid with PayPal?

Thanks in advance!


texts:
Magento2 text is not getting converted to lowercase on using the below code in the email template
{{ var data.enquiry_type | downcase }}

How can I achieve this in Contact Us email?