texts: URL for adding a simple product to the cart associated to a grouped product

texts:
I have a simple product with an ID of 2 and a grouped product with an ID of 1. The simple product is associated to the grouped product.

I can add the simple product to the cart with this URL:

Mage::helper('checkout/cart')->getAddUrl($simpleProduct);

However, when I want to add the simple product to the cart as an associated product of the grouped product, so that it will be linked to the grouped product in the cart, I am coming up short.

Here is what I've tried:

Mage::helper('checkout/cart')->getAddUrl($groupedProduct, array('super_group[2]' => 99));

This returns a seemingly working URL, but accessing it does not add anything to the cart, with the error "Please select a quantity":

  checkout/cart/add/uenc/aHR0cDovL211ZWhsZG9yZmVyLmxvY2FsL3Rvb2xzL3Rlc3QucGhw/form_key/eiCAR1v74QWXeU05/super_group[2]/99/

I have also tried manually adding a

  "?qty=10"

parameter to this URL without any change.

This does not work either:

Mage::helper('checkout/cart')->getAddUrl($groupedProduct, array('super_group' => array(2 => 99)));

This seems to completely ignore the second parameter.

Any ideas how I can create an URL that adds the simple product to the cart with the association to the grouped product?


texts: CE 1.7: Merge two different databases in 1

texts:
Well Hello,

I've the need to merge 2 different databases together. But! I need to keep some data from 1 and other data from the other one...

DB 1: is a multisite setup
DB 2: is only 1 website...

DB 1: has all the setups for the other sites plus it works with new layout
and has some dummy products...
DB 2: it's the db of the current life site.. but I only need the products,
users & their data and newsletters mails

-

So my question is, do you guys know a way I could merge the 2 databases and have them working?!


texts: The curious case of the phantom navigation decorator striking Magento's EE cache

texts:
Get ready for a weird one. So I'm customizing the primary catalog navigation to build a state-full UI behavior that handles multiple interaction models (menus, dropdowns, modals, etc) across devices. Like you do.

That means overriding this class/method:

app/code/core/Mage/Page/Block/Html/Topmenu.php :: _getHtml()

To produce HTML output like this (somewhat simplified):

        Bazzow

 ...

        Bazinga

 ...

Now, this is pretty boring/standard except for the data-ui-action attribute. That's where the JS magic happens. Any clicks on elements with that attribute update the UI state. You guessed it, the li.nav-X class (which Magento adds) acts as my hook to bind the UI state to the activated element.

All good, right? Turn on EE cache. All good right? Wrong.

If the page you're viewing is within the catalog hierarchy of Bazinga (aka nav-2), then suddenly you will see this:

data-ui-action="nav-2 active"

Who added the nasty active string? The phantom is who.

And now your UI state fails, because the data attribute's value doesn't match the
 class anymore. Hunt down the phantom.

The Hunt

First, you check that under EE cache the variable $child->getPositionClass() which outputs nav-2 doesn't actually have other (presumably) class values appended. It does not.
You check that one of Magento's many decorator JS scripts isn't executing on the nav list. It's not.
Maybe it's actually some odd thing in /js/varien/menu.js. But you already excluded those core scripts like you always do.
Maybe it's some crazy inline JS you'd never know a module renders out of the PHP class. Search the page source for active within


texts: The Different types of observers explanation

texts:
I want to know with a pretty explanation the difference between the different types of Observers bellow:

1)

<?php
class Company_Module_Model_Observer
{
    public function someFunction($observer)
    {
        ...
    }
}

2)

<?php
class Company_Module_Model_Observer extends Varien_Event_Observer
{
    public function someFunction($observer)
    {
        ...
    }
}

3)

<?php
class Company_Module_Model_Observer
{
    public function someFunction(Varien_Event_Observer $observer)
    {
        ...
    }
}

And also the difference in the xml declaration between <type>singleton</type> and <type>model</type>, in which case we should use each one.


texts:
Hi Guys I'm new to Magento,

I'm trying to edit a contact form previously developed by another company and cannot seem to find the code anywhere please advise.

I have checked the static blocks to no avail, also checked the form.phtml files in the theme. I just need to add a new branch?

This is the form:
https://www.arb.co.za/enquiry

need to make an edit here:

Thanks


texts: How to stay logged into Magento 2.0 longer

texts:
Magento 2.0.2 seems to log me out after 5 or so minutes of inactivity.

Is there a setting to keep me logged into the Admin backend longer? If so, where and how?


texts: Call to a member function setCanReadPrice() on boolean During rewrite Adminhtml Block

texts:
I've tried to rewrite 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select'  and

'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' Block but i got a error like.

  Fatal error: Call to a member function setCanReadPrice() on boolean in /app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php on line 193

Here is my config.xml file code with file path:

  /app/code/local/Eventprice/Meta/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Eventprice_Meta>
            <version>0.0.1</version>
        </Eventprice_Meta>
    </modules>
    <global>
        <models>
            <eventprice_meta>
                <class>Eventprice_Meta_Model</class>
            </eventprice_meta>

              <catalog>
                <rewrite>
                  <catalog_product_edit_tab_options_option>
                        Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option
                    </catalog_product_edit_tab_options_option>
                </rewrite>
              </catalog>
        </models>
        <resources>
            <eventprice_sql>
                <setup>
                    <module>Eventprice_Meta</module>
                </setup>
            </eventprice_sql>
        </resources>
        <blocks>
            <eventprice_meta>
                <class>Eventprice_Meta_Block</class>
            </eventprice_meta>
            <adminhtml>
                <rewrite>
                    <catalog_product_edit_tab_options_type_select>
                        Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select
                    </catalog_product_edit_tab_options_type_select>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

And here is my Select.php file code with path:

  app/code/local/Eventprice/Meta/Block/Adminhtml/Catalog/Product/Edit/Tab/Options/Type/Select.php

<?php
class Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select extends
 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select
{

    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('sphere/catalog/product/edit/options/type/select.phtml');
        $this->setCanEditPrice(true);
        $this->setCanReadPrice(true);
    }
}
?>

This is my Option.php files code with path:

  app/code/local/Eventprice/Meta/Block/Adminhtml/Catalog/Product/Edit/Tab/Options/Option.php

<?php
class Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option extends
 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option
{
    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('sphere/catalog/product/edit/options/option.phtml');
        $this->setCanReadPrice(true);
        $this->setCanEditPrice(true);
    }
    public function getOptionValues()
    {
       // I want change the code into this function so for that I want to overwrite this class
    }
}

I've followed the http://magento.ikantam.com/qa/how-add-custom-attributes-custom-options tutorials to add new field.

This doesn't seem to be working. Any ideas?


texts: How to set intro page before homepage in magento 1.9?

texts:
I want to set introduction page before home page load.

In short when user hit / enter domain name, first of all it should be show an introduction page and once click on Enter Site button user can redirect to the homepage.

Is it possible to implement this kind of functionality?


texts: How to change jQuery version in Magento2

texts: Magento 2.1.2 bundled with jQuery 1.11. How it possible to replace it with jQuery 2.1?


texts: Magento 2.3.4 new layout update doesnt work

texts:
I have an issue with the new Magento layout update xml feature. I added a custom layout update file to change a category. It shows up in the Magento backend, but when I select it, nothing changes on the frontend. Anyone that may know the solution?
I'm aware of the issue with porto theme & the new layout update feature, but that issue is already solved. It's just that the xml changes don't appear on the frontend.
The layout file content:

app/design/frontend/Smartwave/porto_child/Magento_Catalog/layout/catlog_category_view_selectable_9_TEST.xml

<?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">
    <update handle="catalog_category_view_selectable_9_TEST"/>
    <body>
        <css src="css/test.css" />
    </body>
</page>

The category config:


texts: How to change theme programmatically for specific controller in magento 2?

texts:
In magento 1.X we can change theme programmatically in controller action by below code :

Mage::getDesign()->setArea('frontend') //Area (frontend|adminhtml)
    ->setPackageName('packagename') //Name of Package
    ->setTheme('default');// Name of theme

How to change theme programmatically for specific controller in magento 2 ?


texts: How to add News Letter Subscription checkbox on checkout Success Page in Magento 2?

texts:
I am getting email address in the database with this function:

protected $subscriberFactory;

    public function __construct(
    \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory,
    ...code...
    )
    {
     $this->subscriberFactory= $subscriberFactory;
     ....code....
    }

public function subscribeNewsLetter($email)
     {

        $this->subscriberFactory->create()->subscribe($email);

     }

In my template file, calling it as:

   <input type="checkbox" onClick="<?php $block-
>subscribeNewsLetter($email); ?>">Subscribe to News Letter</button>r

The problem here is, when I refresh the page function subscrieNewsLetter()  is executed before checking the checkbox. Even checkbox is not checked, the email address gets stored in database.

I find some examples for this using AJAX like:
https://blog.mdnsolutions.com/magento-2-newsletter-subscription-via-ajax/ but it is bit different form my problem. I know magetions will find a more smarter way to do it.


texts: Magento 2 - How to solve the issue after import image from backend replaced by placeholder image

texts: I just import images from the backend, save after upload replaced by placeholder image, my uploaded image does not save instead of placeholder image available, how to solve this issue?


texts:
I want to show the number of the product in a specific category. For example, these are my products in a category:

Product 1
Product 2
Product 3
Product 4

I know how to get the number of products in this category, but I also want so show the (position) number of the product in the category. So when I am on Product 3, I want to display that I'm on product 3 of the 4 products in this category. I'm not able to do this with position, because I don't want my customer to have to give a position to every single product in every single category.

How do I do this?


texts: Magento: Getting Warning in log file, php_network_getaddresses: getaddrinfo failed: Name or service not known

texts:
I am Getting the Warning on system.log file,Any way to fix this ?

Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known  in lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129


texts: Magento 2: How to get store logo in footer phtml?

texts:
In magento 1 i could call the store logo in any template with something like this Mage::getStoreConfig('design/header/logo_src');.

How can I do the equivalent in Magento 2?


texts: Magento 2.3: How to make a custom block with all added items in the cart?

texts:
I am using Porto theme. In addition to the available mini cart sidebar, I'd like to create a custom block on the right side with a sticky cart, so customers would be able to see what they add and what they wanna remove from the there cart (without clicking on the mini cart icon in the header). Similar to this:

I tried to use the solution recommended here: Magento 2 get cart items in block class
I don't know why it is not working. I'm attaching the code below.

1) BDK/Mycartblock/Block/ShoppingCart.php

<?php
namespace BDK\Mycartblock\Block;
use \Magento\Framework\View\Element\Template;

class ShoppingCart extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        array $data = []
    ) {
        $this->_checkoutSession = $checkoutSession;;
        parent::__construct($context, $data);
    }

    /**
     * Get quote object associated with cart. By default it is current customer session quote
     *
     * @return \Magento\Quote\Model\Quote
     */
    public function getQuoteData()
    {
        $this->_checkoutSession->getQuote();
        if (!$this->hasData('quote')) {
            $this->setData('quote', $this->_checkoutSession->getQuote());
        }
        return $this->_getData('quote');
    }
}

2) BDK/Mycartblock/etc/module.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="BDK_Mycartblock" schema_version="1.0.0" setup_version="1.0.0" >
    </module>
</config>

3) BDK/Mycartblock/view/frontend/layout/default.xml

<?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">

        <referenceContainer name="content">
           <block class="BDK\Mycartblock\Block\ShoppingCart" name="mycartblock" template="BDK_Mycartblock::my-template.phtml">
            </block>
        </referenceContainer>

</page>

4) BDK/Mycartblock/view/frontend/templates/my-template.phtml

<?php

// Get all visible items in cart
$quote = $block->getQuoteData();

foreach($quote->getAllVisibleItems() as $_item) {
    echo 'ID: '.$_item->getProductId().'
';
    echo 'Name: '.$_item->getName().'
';
    echo 'Sku: '.$_item->getSku().'
';
    echo 'Quantity: '.$_item->getQty().'
';
    echo 'Price: '.$_item->getPrice().'
';
    echo 'Product Type: '.$_item->getProductType().'
';
    echo 'Discount: '.$_item->getDiscountAmount();echo "
";
    echo "
";
}
?>

Pls, help find the solution. Thanks to all in advance!


texts: Alternative to flushing cache in dashboard when making theme changes?

texts:
Every time I make changes to the theme I'm developing I have to go into the dashboard and clear static files, css/js cache and afterwards the magento cache (in that order). I'm running in developer mode.
Is there any way to avoid having to do this every time I make a change? Or, is there any easier way?


texts: I am new in magento. I want to have terms and condition checkbox on cart page where proceed to checkout button is there. I have enabled terms and condition but it is on the last of the all process.  So, can we have in starting or in cart page.


texts:
In mobile smartphone when I click  Registrati the square is below icon cart

RegardsRoberto


texts: I made a change to my Admin URL in SYSTEM CONFIGURATION

texts:
I changed the URL of my store but made no other changes, now the Admin url is not working.

How do I get my admin panel working again?

I am working in a test website, and the version of Magento is 1.9.1.1.


texts: Installing magento from command line errors

texts:
I follow this guide.

http://devdocs.magento.com/guides/v2.1/install-gde/install/cli/install-cli-install.html

I tried to run web installation but it always got stucked so now i try this.

when i go to mysql as root

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0,00 sec)

there are not any tables for magento.

So i run this command given in the link

magento setup:install --base-url=http://127.0.0.1/magento2/ \
--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \
--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1

but mine cant run magento so i use ./magento

root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento2/ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
SQLSTATE[HY000] [1045] Access denied for user 'magento'@'localhost' (using password: YES)

  [InvalidArgumentException]
  Parameter validation failed

and other green writings

setup:install [--backend-frontname="..."] [--key="..."] [--session-save="..."] [--definition-format="..."] [--db-host="..."]

  [--db-name="..."] [--db-user="..."] [--db-engine="..."]
  [--db-password="..."] [--db-prefix="..."] [--db-model="..."]
  [--db-init-statements="..."] [-s|--skip-db-validation]
  [--http-cache-hosts="..."] [--base-url="..."] [--language="..."]
  [--timezone="..."] [--currency="..."] [--use-rewrites="..."]
  [--use-secure="..."] [--base-url-secure="..."]
  [--use-secure-admin="..."] [--admin-use-security-key="..."]
  [--admin-user="..."] [--admin-password="..."] [--admin-email="..."]
  [--admin-firstname="..."] [--admin-lastname="..."]
  [--cleanup-database] [--sales-order-increment-prefix="..."]
  [--use-sample-data] [--magento-init-params="..."]

it says in informaton

--db-user

User name of the Magento database instance owner.

Default is root.

so i use my mysql password and admin name for it. this time it works but another errors

root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento/ --db-host=localhost --db-name=magentodb --db-user=root --db-password= root --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --cleanup-database help

  [RuntimeException]
  Too many arguments.

SO, i decrease parameters. but again same

root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento/ --db-host=localhost --db-name=magentodb --db-user=root --db-password= root

  [RuntimeException]
  Too many arguments.

i can see

http://localhost/magento2/setup/#/landing-install

page here. i think there are no errors. i can run also setup but it stuck at %66 %67. yesterday i completed this but it was not adding to shopping card, today i deleted all php 5.6 7.0 in my pc and reinstall all. But now, it cant install..

what can be reason? i downloaded magento from web and extracted to ww/html

directory is

/var/www/html/magento2/bin

even for this errors

root@vegan:/var/www/html/magento2/bin# ./magento setup:install admin-user="root"

  [RuntimeException]
  Too many arguments.

By the way, i forgot to put.

i create user and db before

mysql> CREATE DATABASE prestashopdb;
7- mysql> CREATE USER magento@localhost IDENTIFIED BY 'magento';
8- mysql> GRANT ALL PRIVILEGES on magentodb.* to magento@localhost;
9- mysql> FLUSH PRIVILEGES;
10- mysql> exit
11- sudo service apache2 restart
12- sudo service mysql restart


texts: Magento 2. How do Tax Rules apply? (Priority)

texts:
I'm looking at the docs on tax rules and I'm a little fuzzy in regards to the priority field and how rules apply.

  If two tax rules with the same priority apply, the taxes are added together. If two taxes with different priority settings apply, the taxes are compounded.

What does compounded mean in practice? An example would be great.

Many Thanks.


texts: Error shows Invalid type for value: array when update customer image using rest api

texts:
Errors create/update customer image using REST API in magento2?
I searched a lot on google but not getting any solution for this.
Please help me in this.


texts: I am currently developing an extension and am planning to release it to Magento Connect. Is there a way for me to restrict who can download the extension (restrict download ability to a few select stores) or can any store download it once it is on Connect?


texts: How to convert the sql query into magento query in magento 2

texts:
I want to take the increment id from sales order table and status should be complete.I have created one custom table called hydrogen_xml_generation.

Initially the xml generated status is 0. Once the xml is generated it will be 1. How to write the below query in Magento 2.

$sales_shipment = $connection->fetchAll("SELECT increment_id FROM sales_order WHERE status = 'complete' AND sales_order.increment_id NOT IN (SELECT increment_id FROM hydrogen_xml_generation WHERE xml_generated = '1')");


texts: Magento 2.1.9 : Change store based on country

texts:
Important: I don't want to buy any GeoIP extension.
I have a Magento 2.1.9 website with multi-site and multi-store setup.
I have setup website for KSA, UAE, CHINA, EGYPT etc. and under each website are at least 2 Store views, e.g., for KSA I have Arabic and English store views.

I want to show the user the website according to his country as per IP Address.
e.g., for users accessing from KSA the ar_sa (Arabic - Saudi arabia store should be default) similarly for users from UAE (ar_uae or en_uae).

I have done the following coding so far and got the country from IP address successfully.

This is my etc/frontend/events.xml file:

<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework/Event/etc/events.xsd'>
    <event name='controller_action_predispatch'>
        <observer name='Asoft_GeoIP_Redirect' instance='Asoft\GeoIP\Observer\Redirect' />
    </event>
</config>

And this is my Observer/Redirect.php:

namespace Asoft\GeoIP\Observer;

class Redirect implements \Magento\Framework\Event\ObserverInterface
{

    protected $_objectManager;
    protected $_storeManager;
    protected $_curl;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\HTTP\Client\Curl $curl
    ) {
        $this->_objectManager = $objectManager;
        $this->_storeManager = $storeManager;
        $this->_curl = $curl;

    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        //echo 'You are browsing from : '.$this->getCountryName();
        switch ($this->getCountryName()){
            case 'UAE':
                $store_id = '11';
                break;
            default :
                $store_id = '7';
        }$this->_storeManager->setCurrentStore($store_id);
    }

    public function getCountryName()
    {
        $visitorIp = $this->getVisitorIp();
        $url = "freegeoip.net/json/".$visitorIp;
        $this->_curl->get($url);
        $response = json_decode($this->_curl->getBody(), true);
        //echo '<pre>';
        //print_r($response);
        $countryCode = $response['country_code'];
        $countryName = $response['country_name'];
        $stateName = $response['region_name'];
        return $countryCode;
    }

    function getVisitorIp()
    {
        $remoteAddress = $this->_objectManager->create('Magento\Framework\HTTP\PhpEnvironment\RemoteAddress');
        return $remoteAddress->getRemoteAddress();
    }
}

But this changes only the store name and not other things - like language / currency or layout.


texts: How to remove extension (installed via FTP) completely?

texts:
I need to remove several extensions that were originally installed via FTP.

I can disable the extensions by changing the status from True to False in xml file, which will deactivate extension only. But, I would like to remove the extension files with all their files.


texts: how i can get parameter value of url parameter in customer registration success observer magento 2

texts:
I have set link like this

http://localhost/magento/customer/account/create/?param_id=20

  how I can get that (param_id) value in customer registration success observer in Magento 2

  how I can do this??

  I already tried this answer but not working --> https://magento.stackexchange.com/a/154141/73525

  Observer

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

class Setcustomer implements ObserverInterface
{

    const CUSTOMER_GROUP_ID = 2;
    protected $request;
    protected $_customerRepositoryInterface;

    public function __construct(
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
       \Magento\Framework\App\Request\Http $request
    ) {
        $this->_customerRepositoryInterface = $customerRepositoryInterface;
        $this->request = $request;
    }

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

        $customer = $observer->getEvent()->getCustomer();
        if ($customer->getGroupId() == 1) {
            $customer->setGroupId(self::CUSTOMER_GROUP_ID);
            $id=getIddata();
            $this->_customerRepositoryInterface->save($customer);
        }

    }
    public function getIddata()
    {
        $this->request->getParams();

        return $this->request->getParam('id');
    }

}

  xml

<?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="customer_register_success">
        <observer name="setdealer_forcustomer" instance="Lunatic\Module\Observer\Setcustomer"/>
    </event>
</config>


texts: Magento 2 - Type format catalog admin grid

texts:
We have two questions about the catalog grid in Magento 2:

By default there is a qty column, but this value has a dot and 4 zero's behind it. How can we show just the rounded value?
We've added the 'Cost Price' column, but this is not shown as a price. How can we format this column as price.

See: https://www.dropbox.com/s/fy5sfgxerg7ugp9/Schermafbeelding%202017-12-05%20om%2010.31.29.png?dl=0


texts: Get number of first time customers based on shipping date

texts:
I get the number of orders by shipping_arrival_date with the following query:

SELECT COUNT(*) as orders_on_day, shipping_arrival_dateenter preformatted text here
  FROM sales_flat_order
group by shipping_arrival_date
order by shipping_arrival_date asc

How can I modify this query in a way that it shows me a third column with the number of first time customers on this particular shipping date?

I know that within sales_flat_order there is the customer_id which matches with the entity_id in customer_entity, but I somehow need to know if the customer has ordered before.

Does anybody can help here?

Thanks.


texts:
When we reload our product pages so product images not loading even detials not showing :(

Website: http://thekoonj.com/

Please review product page and also homepage product slider not working or page refresh.

I do not know why it is happaning...


texts: How to switch from Mysql 5.7 to 8.0 in Magento 2.4

texts:
I was developing Magento 2 with MySql 5.7 but on production server there is MySql 8 installed which is giving me some query errors.
After following a guide of migrating from MySql 5.7 to MySql 8.0 it states in step 6.:
6. In the Magento admin, set the database engine to MySQL 8.

Where in Magento admin is this option, I can't find it anywhere...?


texts: Magento2 - multistore using different domains, relative folder in base url & store codes... language switcher broken

texts:
This is a Magento 2.3.2 CE project

Let's assume url of default storeview is https://www.domain.com/store/es

Url of second storeview is https://www.domain.pt/pt

Language switcher gives error, redirecting to same storeview 404 page... is this a bug or a feature? I understand this url configuration is weird, and it makes no sense using store codes in this case


texts:
I want to check template name for this website:
https://sportofino.com/

I try to find in source skin but cannot find. Anyone help?


texts:
I want to change the price precision for showing 4 decimal points. I can see that this can be done by overwriting the  vendor/magento/zendframework1/library/Zend/Currency.php
How can I overwrite the Currency.php to my local?


texts: Readiness check didn't have a problem, but update.log complains about non-writable paths

texts:
I'm running Magento 2 CE on Ubuntu 16.04.  I followed the setup guide pretty closely and everything seems to be working fine from a usability standpoint, but I discovered today that var/log/update.log is 4+ GB and growing fast.  Upon further examination it turns out that the file is full of a gazillion lines (they seem to get written once a minute when the cron jobs run) of the form update-cron.ERROR: Cron readiness check failure! Found non-writable paths: followed by a list of some 12,000 paths to which it doesn't have write permission.  And it's not lying, when I spot-checked those paths I found that they were in fact not writable by the Magento user.

This seems weird to me, however, because I followed the instructions here for setting filesystem ownership (I'm running on a two-user system), and it seemed perfectly happy with them when it ran its own pre-install filesystem permission check.

Moreover, the paths that update.log is screaming about are all outside of the directories specified in that guide.  Most of them are in dev/ (8281 paths), lib/ (3060), and setup/ (831), with a few scattered around elsewhere.  All of the top-level files in magento/ itself are also listed.  (The full list of paths is here for anyone interested.  Bare files are at the top, after that it's sorted alphabetically.)

This leads me to believe that whatever is leaving error messages in update.log simply wants the whole magento/ directory to be writable by the Magento user.  If this is necessary, however, why go to all that trouble to just make certain specific files and directories writable?

So to deal with this, should I:

Ignore the error messages, setup logrotate or similar to keep the filesize down, and move on with my life?
Grant write permission to the whole magento/ folder to my Magento user?
Something else that will actually fix the problem instead of just working around it?


texts: Magento update quote item change row total

texts:
I am facing a problem in changing bundler product price in checkout_cart_product_add_after event. i have written code which changes the price of simple products which are child of bundle product. Quote item changes as per my requirement but when a cart page get refreshed, row total of each item get set to default price of product.

Following is the code i have written to change the product custom price and rowtotal.

        $quote      = Mage::getSingleton('checkout/session')->getQuote();
        $product1   = Mage::getModel('catalog/product')->loadByAttribute('sku',$bundlePackageSku);

        $bundler_Price = 0;

        foreach($quote->getAllVisibleItems() as $quote_item1) {
                if ($bundler_Price > 0) {

                    if($quote_item1->getProductId() == $bundleId){
                        // print_r(get_class_methods($quote_item1));
                        $quote_item1->setPrice($bundler_Price);
                        $quote_item1->setCustomPrice($bundler_Price);
                        $quote_item1->setOriginalCustomPrice($bundler_Price);
                        $quote_item1->setRowTotal($bundler_Price);
                        $quote_item1->save();
                        // exit();
                    } //end of if condition
                }

            } //end of foreach

I came to conclusion that magento's default behaviour which regenerates the Rowtotal of each quote item after changing the quote price from table itself.

Can anybody tell me where and what class need to be override to overcome this problem???

Thanks in advance.


texts: Magento rewrite product url to link with categories

texts:
Version : Magento 1.18

Our actual URLs for the same product :

store.com/product-name-1.html

store.com/cat1/cat2/product-name-1.html

How we can redirect the first URL to the second URL

  store.com/product-name-1.html == Redirect to ==>
  store.com/cat1/cat2/product-name-1.html


texts: Magento 1.9 : How to Create a "simple contact form"

texts: how to create simple custom contact form with MySQL in Magento?


texts: Magento2: Import custom attribute for specific product id using csv

texts:
I am working on CSV import to add custom attribute data for Products. I have created a custom attribute as "slide_link". I am unable to add only SKU and slide_link in CSV for adding data of attribute in the product.

Please provide a solution for above.


texts:
Does anyone know if there's a built in way to define a logo specifically for mobile?

I read somewhere that you could place a logo-small.svg file in app/design/frontend/[vendor]/[theme]/web/images/ but I've not had any success with this yet.


texts: Magento 2: Admin Move Filters & Paging to Top

texts:
I have below image in Admin. Don't know how it happened. But it moved to Bottom.

I have so many pages where it moved to Bottom.

How to move it to top position again.


texts: Delete Cookie in Magento on Browser Close

texts:
I had stuck issue.I had created one cookie but my client needs this cookie should be deleted when the browser is closed.

I had tried many links on the google but not got solution.

Please Help Me.

Thanks


texts:
I have successfully install this module Reviews/Rating
I call this url="/V1/review/mine/post" method="POST".I don't know what data is passed in body of this URL.


texts: Magento 2: Zendframework dependency not installed

texts:
We're running Magento2 v2.2.10. And we're deploying the repo using Capistrano but it fails during bin/magento tasks.

An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig).

The issue and simply appears to be that it is missing the Zendframework (the folder and its sub-packages do not exist in vendor).

We've tried to include it in our composer.json manually but without luck. Copying the Zendframework folder from a backup into /vendor solves the issue. If we manually run composer update/install in the release folder it works (after deleting the vendor folder). We've tried to play around with composer flags but it didn't care.

What the hell is going on? >=(

==

The composer.json file:

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.10",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.2.10",
        "composer/composer": "@alpha",
        "mollie/magento2": "^1.9",
        "mageplaza/magento-2-german-language-pack": "dev-master",
        "mageplaza/magento-2-french-language-pack": "dev-master",
        "mageplaza/magento-2-dutch-language-pack": "dev-master",
        "olegkoval/magento2-regenerate-url-rewrites": "^1.5",
        "sendcloud/sendcloud": "^1.1"
    },
    "require-dev": {
        "allure-framework/allure-phpunit": "~1.2.0",
        "magento/magento2-functional-testing-framework": "2.4.5",
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.2.2",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "friendsofphp/php-cs-fixer": "~2.2.1",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "2.0.4"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/"
        },
        "psr-0": {
            "": [
                "app/code/",
                "generated/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "minimum-stability": "stable",
    "repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com/"
        }
    ],
    "extra": {
        "magento-force": "override"
    }
}


texts: How to check all order item already invoiced

texts:
Currently I can check if order already has invoice like this:

$order = Mage::getModel('sales/order')->load('1');
$hasInvoice = $order->getInvoiceCollection()->count();
if($hasInvoice > 0) return true;
else return false;

You can create invoice for all order items or just some of the order item. And the problem is i need to know if all the order item has already been invoiced?


texts: How can I get my custom modal to work in with my js

texts:
This is a fiddle I have with it working but I would not like to apply it within magento
http://jsfiddle.net/7yhmkf98/
I have a requirejs-comfig.js file set uo like this
var config = {
    paths: {
        wow: 'js/wow',
        modernizr: 'js/modernizr.custom.49511',
        hotspot: 'js/jquery.hotspot.min',
        venobox: 'js/venobox',
        popup: 'js/popup'
        },
    shim: {
        wow: {
            deps: ['jquery']
        },
        modernizr: {
            deps: ['jquery']
        },
        hotspot: {
            deps: ['jquery']
        },
        venobox: {
            deps: ['jquery']
        },
        popup: {
            deps: ['jquery']
        }
    },
    config: {
        mixins: {
            'mage/collapsible': {
                'js/mage/collapsible-mixin': true
            }
        }
    }
};

I also tried to link it in my default_head_blocks.xml but nothing works.


texts: I uploaded additional files for products. They get stored in media folder in Magento root directory. How can I access files stored at media folder in Magento root folder? Should I use a method for accessing files outside Root directory or simply involve a direct access code in php?


texts: Store direct_url in category text in Magento 2

texts:
We are moving our shop to Magento 2 and I just noticed that the store direct_url is not working anymore in our category texts. Does anyone know how you have to put this in Magento 2.

We have it in Magento 1 as following:

text

Hope someone can help.


texts: Why does Magento use GET instead of POST for admin keys?

texts:
Well, the title almost says everything. Magento uses a key parameter in the admin area which it appends to every URL. I was just wondering why they don't do this using php post instead of get.

With post it would be hidden, that's why I would prefer it, but I'm sure there is a good explanation for it.


texts: Magento 2: Show price of custom option in mini cart

texts:
I have a product has a custom option like this

In my mini cart how to show label and price of custom option, currently only the label.

Any helps? Thank in advance.


texts: How can we measure actual performance of magento2 store?

texts:
-- We need to measure performance of our Magento 2 website.
-- Our website is in development stage so domain is password protected.
-- We have tested website score in GTMetrix and WebPageTest which allow us to test password protected domain as well.
Problem Is:
We are checking website performance using GT-Metric tool and we are getting very inconstant data for the same request from a given server location(USA - Dallas) when we hit multiple times.
Please find the below four time page load time for your kind reference:
First Instance - 12.8s
Second Instance - 5.6s
Third Instance - 8.7s
Fourth Instance - 7.5s
How can we measure actual page load time?


texts: Create custom Sort By option from a custom table

texts:
I'm using magento 2.4, I have a custom db table with the As Low As prices, I need to use the Sort By price and the filter price with this as low as prices but magento uses the table catalog_product_index_price so my question is how can maybe override the magento default select to use my custom table with the as low as prices instead of the magento default table catalog_product_index_price.
If it is not possible to override that magento Select, how can I create a custom Sort By price but with my custom db table?


texts: Billing Agreement not showing in customer account page

texts:
I am trying to display a customer's billing agreement information inside the customer account page but for some reason it won't show the billing agreement just the default "There are no billing agreements yet."

I can use the billing agreement information (saved credit card) when I checkout so I know it has been created I simply need to show it inside the customer account page.

Here is my code:

                            <a title="" href="<?php echo Mage::getBaseUrl(); ?>"><?php echo $this->__('Home')  ?>
                                        &gt;

                            <a title="" href="<?php echo $this->getUrl('customer/account/') ?>"><?php echo $this->__('Your Account')  ?>
                                        &gt;

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

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

 <?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
<?php //echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php echo $this->__('Your Billing Addresses') ?>

<?php echo $this->__('Your Billing Agreements') ?>

        <?php echo $this->getChildHtml('account_address'); ?>

       <?php echo $this->getChildHtml('account_payment'); ?>

I am using the childHtml method to call the sales/billing_agreements template file

<?php echo $this->getChildHtml('account_payment'); ?>

But something isn't right and I'm not sure what it is???

Please help somebody!


texts: Something went wrong while saving the customer?

texts:
When I edit a customer from admin or front-end then showing the below error

Something went wrong while saving the customer

When I Print Error -- >

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE customer_entity SET website_id = ?, email = ?, group_id = ?, store_id = ?, created_at = '2019-03-14 12:57:34', updated_at = '2019-06-29 11:25:45', disable_auto_group_change = ?, created_in = ?, prefix = ?, firstname = ?, middlename = ?, lastname = ?, suffix = ?, password_hash = ?, rp_token = ?, rp_token_created_at = ?, default_billing = ?, default_shipping = ?, taxvat = ?, confirmation = ?, gender = ?, failures_num = ?, first_failure = ?, lock_expires = ? WHERE (entity_id=104903)


texts: Catalog Search not working in magento 2.2.4

texts: No search result in catalog search. I have reindex data still getting no result. When i look in data base, i found that my catalogsearch_fulltext_scope1 table is empty. is there any issue with this?


texts:
I just hosted on Godaddy, and i downleded magento 2.3.6 from magento official site and i uploaded it into filemanager, when i run the URL, it is showing 500 error.
Can you please guys help me this.
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@towercirclestore.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.```


texts: How to remove applied coupon code in a custom controller on Magento 2

texts:
I have a custom controller where i apply coupon code discount like this:

$this->checkoutSession->getQuote()->setCouponCode($discount)
                            ->collectTotals()
                            ->save();

Now, like magento 2 default does, I want to be able to remove that coupon code discount.

So i created a custom controller and i want to remove here the discount:

the only thing i found to remove the coupon discount is this:

$couponCode = $this->getRequest()->getParam('remove') == 1
        ? ''
        : trim($this->getRequest()->getParam('coupon_code'));

But this dosen't work for me.

Does anyone know what it's the right way to remove this discounts in my controller?


texts: How do I set simple product name instead of configurable into cart,checkout Order summary , mini-cart and also order and email in Magento2?

texts:
I already used this answer but this answer is just half answer to my question-
 How do I get simple product name of configurable into checkout Order summary?

I need to get the simple product name of configurable into a cart, checkout Order summary, mini-cart and also order and email template. So I need to know how to do it?


texts:
I have integrated Pay with Amazon payment module and getting error while redirect to amazon site.

Below is the error messages:

  We're sorry!
  An error occurred when we tried to process your request. Rest assured, we're already working on the problem and expect to resolve it shortly.

  Error Summary
  400 Bad Request - The redirect URI you provided has not been white-listed for your application


texts: Adding some custom order status in Magento

texts:
I'm new to Magento. We need some custom order shipment flow where we need to track order status with some parameters.

So flow is like this:

Order status : new > processing > ready to deliver > delivered

In case of "cash on delivery" (COD) we need another state "pending payment"

So order status will be : new > processing > ready to deliver > pending payment > delivered

How we can map this status to already existing status? Or do we need some custom coding to implement this?

Any help appreciated.


texts: Is Magmi Safe To use in magento for Import export on advance level

texts:
I want to import export category.....attributes...and some complex data....
I heard about magmi tools for the faster import export...its uses Direct Sql Query...Is it safe...is it create any error in magento database....magento databse is very complex....so its hard to find error ...so I want to know that is magmi is safe for magento import export.......
It is also very hard to understand ...So i want to know that is it good with magento....


texts:
I've added a category link widget (as below) to my homepage. The link does not display on the frontend though.

{{widget type="Magento\Catalog\Block\Category\Widget\Link" anchor_text="Shop Caps" title="Show Caps" template="category/widget/link/link_block.phtml" id_path="category/2"}}

I have performed the following:

Created category Caps.
Created a test product and assigned it to Caps.
Created the widget on the page and saved.
Cleared var/cache and var/page_cache.

Other CMS changes on the homepage display, and other widgets (such as a product list) display. It seems to be this singular widget type that won't display.


texts: Can't find Report folder to see the error log

texts:
I've just uploaded the Magento files to my server and just gave the proper permissions to folders... but I'm getting an error before the install.
I know that I have to look for the error at the report folder that it's inside var folder, but it isn't even created.


texts: Magento 2 : When running integration tests, how can I override some of the dependencies that are injected?

texts:
I am running an integration test for Magento 2, but I am at a certain point that my integration test needs a different dependency than my production code. Without going too much into detail as to why, I noticed that Magento does the same thing in dev/tests/integration/etc/di/preferences/ce.php.

In this file, Magento maps certain dependencies to framework classes, for example:

\Magento\Framework\App\Request\Http::class => \Magento\TestFramework\Request::class

No I thought this would be the right place for my di override, so I added a file to this folder with my own dependency override:

dev/tests/integration/etc/di/preferences/custom.php:

return [
    \Vendor\Module\Api\StrategyPoolInterface::class => \Vendor\Module\Test\Integration\Di\StrategyPool::class
];

However, this does not seem to work. My integration test still uses the original class instead of the override set in my custom.php file. The file does get picked up, I already checked that, and my dependency is added to the list (you can see this in dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php::_loadPrimaryConfig().

Can anyone tell me what I'm missing here?

Edit:

When I try the following directly in my integration test, it works as expected:

$this->om = Bootstrap::getObjectManager();
$this->om->configure([
    'preferences' => [
        \Vendor\Module\Api\StrategyPoolInterface::class => \Vendor\Module\Test\Integration\Di\StrategyPool::class
    ]
]);

So why doesn't it work when I put it in a separate file?


texts:
I have a model, I call it in a block and when I use the create method I get an error saying:
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Vendor\Namespace\Model\Modelname::create

The Block (/app/code/Vendor/Namespace/Block/Blockname.php) look like this:

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Vendor\Namespace\Model\Modelname $modelFactory,
    array $data = []
)
{
    $this->_modelFactory = $modelFactory;
    parent::__construct($context, $data);
}

public function getAllJohns(){
    $modelFactory = $this->_modelFactory->create()->getCollection();
}

The Model (/app/code/Vendor/Namespace/Model/Modelname.php) looks like this:

const CACHE_TAG = 'namespace_Modelname';
protected $_cacheTag = 'vendor_namespace_modelname';
protected $_eventPrefix = 'vendor_namespace_modelname';

protected function _constructor() {
    $this->_init('Vendor\Namespace\Model\ResourceModel\Modelname');
}
//lots of getters and setters down here

of course it extends: \Magento\Framework\Model\AbstractModel. And implements 2  interfaces 1 custom and the other one is Magento\Framework\DataObject\IdentityInterface.

Then we have the resourcemodel (/app/code/Vendor/Namespace/Model/ResourceModel/Modelname.php):

 public function __construct(
    \Magento\Framework\Model\ResourceModel\Db\Context $context
) {
      parent::__construct($context);
}

protected function _construct() {
    $this->_init('vendor_namespace_model', 'id');
}

And it extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb

and last but not least the collection (/app/code/Vendor/Namespace/Model/ResourceModel/Modelname/Collection.php):

protected $_idFieldName = 'id';
protected $_eventPrefix = 'vendor_namespace_modelname';
protected $_eventObject = 'modelname_collection';

protected function _construct()
{
    $this->_init('Vendor\Namespace\Model\Modelname',
'Vendor\Namespace\Model\ResourceModel\Modelname');
}

and yes it extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

The rest should be good because if i change the function getAllJohns to return a function from the model that returns a string there is no error/conflict and I can see the string:

public function getAllJohns(){
    $modelFactory = $this->_modelFactory->sayHello(); // returns hello
}

So far i have tried to rebuild the module, follow multiple tutorials, look at other models in the app, cache:clean, cache:flush, setup:upgrade, setup:di:compile. ( error.log is empty )


texts: Clean magento tables before data migration

texts:
I'm in the process of migrating magento 1.6 to magento 2.1. I only need clients (and their addresses) as well as products.  What tables can I truncate beforehand?

Found a script that gets rid of:

TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

But I'm wondering if some other tables are safe to get rid of.


texts: can we get Featured products from all store in magento?

texts:
i am working on multi store website.
i want to show all Featured product from all store in main store.
can we get Featured products from all store in magento ?


texts:
I am trying to update the default sort options for list pages. Here's what I have in catalog.xml

    <reference name="product_list">
        <action method="setAvailableOrders" json="value">
            <value><![CDATA[{"news_from_date":"New Arrivals","price":"Price"}]]></value>
        </action>
    </reference>
    <reference name="product_list_toolbar">
        <action method="setDefaultDirection"><dir>desc</dir></action>
        <action method="setDefaultOrder"><string>news_from_date</string></action>
    </reference>
</catalog_category_layered>

When I load a category page, the products are sorted ascending but the toolbar is indicating that they're sorted descending.
If I click on the ascending icon, it will reload the grid in ascending order.
If I then click on the descending icon, the grid will reload with the items in descending order.


texts: Magento 1.9/1.4: sending email with attachment using core/email_queue

texts:
I wish to send email with an attachemnt, and I must use core/email_queue. How can I add attachment to the email?

There are a lot of anwers on how to adding attachment using core/email_template, but this is what I'm after.


texts: In magento 2 admin product-catalog page how to add a additional option in back orders select field under advance Inventory


texts: Android app for Magento store using REST or SOAP?

texts: Hi there i want to know which service to use for making a mobile application for magento does it have to be rest or soap i want to have complete functionality as that of my website inside mobile app.any type of personal experience and help is much appreciated


texts: Magento 2 | Mini Cart has items but cart is empty | Session problem? | Double clicking on "Proceed To Checkout" redirects to an empty cart

texts:
I have a weird problem where my mini-cart is showing that there are products in the cart, however, cart is showing empty.

Also, when refreshing the checkout a few times, it redirects to the cart with a message of:

  You have no items in your shopping cart.

  Click here to continue shopping.

I have set my cookie life time to 1 year but that didn't solve my problem. Could the problem be related to customer session? Not sure how to debug this.

UPDATE:

When logged in - double click on "Proceed To Checkout" - This clears the cart and "logges out". However, the "Welcome message" still displays the customer name and mini-cart seems to have items inside.

UPDATE 2:
After applying this commit: https://github.com/magento/magento2/commit/9a799f130a0a8b64028de6258e7cf1378bc9bc8f the problem with "Double clicking the 'Proceed to Checkout' button" is now fixed. All it does is disabling the button once it's clicked.

However, when refreshing the checkout twice still redirects to the empty cart with mini-cart still showing items.


texts: How to Add a Custom Button to Admin Sales Order View in Magento2

texts:
How to add a custom button to sales order view in magento2, since some of the events was remove in-favor of plugins.

Removed some events (plugins must be used instead):

adminhtml_widget_container_html_before (use in magento 1.x)
admin_session_user_logout
model_config_data_save_before
...

See Magento2 Change Log


texts: How to NOINDEX the layared navigation and forms to avoid being indexed by google

texts:
Price is one of the attribute filtering, however in Google search result it displays all the parameters. In addition, I could see some content of the "return" form we have in search result. Should I use below code to avoid this indexing? but how goes for forms?

    <layout>
    <catalog_category_layered>
        <reference name="head">
            <action method="setRobots"><meta>NOINDEX,FOLLOW</meta></action>
        </reference>
    </catalog_category_layered>
   </layout>


texts: Magento 2.2.4 - How to move Layered Navigation on top of Content on Search Pages

texts:
I am using the below mentioned code to move the Layered navigation above content on Search pages in catalogsearch_result_index.xml

<body>
    <move element="catalogsearch.leftnav" destination="content" before="-" />
</body>

But it is not showing above content on search pages.

Please help me in correcting the code, if i am missing something in this


texts:
On One Step Checkout, ive changed table rates for purchases over 1000 to charge 85 fee.
Currently its only displaying "85", I want it to show ["Shipping fee" is 85]

Copy Base/...available.phtml to child_theme/templates/checkout....
Not sure where in this form where i can concat the text "Shipping fee will be"

    <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
    <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
    <?php echo $_excl; ?>
    <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl) : ?>
        (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
    <?php endif; ?>
</label> ```

thanks


texts:
I have a strange issue:
when I turn on a flat mode for category, thumbnail and image for all category are empty. For example:

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

$mageFilename = 'app/Mage.php';

if (!file_exists($mageFilename)) {
    echo $mageFilename." was not found";
    exit;
}

require_once $mageFilename;
//important
Mage::setIsDeveloperMode(true);
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(3));

$category = Mage::getModel('catalog/category')->load(15791118);
print_r($category);

Image and thumbnail are empty.

If I turn off a flat mode for category, image and thumbnail has values.
For each change of catalog mode I turn on reindex.

In catalog_category_flat_3 fields image (attribute id: 45) and thumbnail (attribute id: 133) are null.


texts:
Getting Error

Warning: require(C:\xampp\htdocs\Magento\vendor\composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Magento\vendor\composer\autoload_real.php on line 70

Fatal error: require(): Failed opening required 'C:\xampp\htdocs\Magento\vendor\composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='C:\xampp\htdocs\Magento\vendor/magento/zendframework1/library;C:\xampp\php\PEAR') in C:\xampp\htdocs\Magento\vendor\composer\autoload_real.php on line 70


texts: Add-to-cart button for all products on detail page

texts:
I want to add add to cart button in third party module .phtml file same as add to cart works on detail page.

There are different product-type like grouped product and I want add-to-cart button on all products.


texts: The media uploader is not working properly?

texts:
This question already has an answer here:
  Magento - Upload HTTP Error

I am following this thread for setting the media uploader for uploading multiple images like image upload in product images.

I got the media tab in the form but when I click on upload files I am getting an error  "upload http error". I dont know where I was going wrong in this thread.

How can I resolve this. I have no idea why this is happening.

If there is something wrong then how can media uploader can be used in the custom module. What are the proper step of using it. I didn't find anything on media uploader on the net.

How can I make this right.


texts: Magento one-install multisite setup, how to keep multisite url for backend?

texts:
I have setup Magento multisite. I tried both these options:

Subdomain install, in htaccess with SetEnvIf I checked the domain and If domainx then runcode = site2
Subfolder install, created a subfolder on my Magento directory called 'site2', copied htaccess and index.php to that dir and changed vars so the correct website is runned by Magento.

This both works. But, it only works for the frontend.

What I want now is to have 2 backend logins, like this:

mysite.com/admin
shop2.mysite.com/admin
(or via subdirectory, e.g.: mysite.com/admin and mysite.com/site2/admin)

My guess is I cannot login via /site2/admin/ because the cookies cannot be set for that domain. So I also set the session cookie path in Magento for site2 to /site2 so it sets the cookie for the correct dir, but I`m not sure if this is nessecary.

I am able to show the admin screen for both url's, but when I log into Magento via the /site2/admin/ url it redirects me to mysite.com/admin and I`m not logged in.

Thanks in advance!

EDIT: By setting my default cookie path to / and setting my cookie domain to mysite.com I am now able to login from both domains. However, the URL still changes to mysite.com/admin whilst I want it to stay site2/admin/


texts: Full page cache not working, appears to be caching per session instead of per user group

texts:
Full page caching appears to be working on a per session basis.

If I go to a page, the first page load takes a few seconds, the second page load much less
If my co-worker visits that same page, it takes a few seconds and the second page load much less.

We have exhausted all the FPC documentation, tutorials, and posts we can find. We are completely out of ideas, We have hole punched the one per session object on our pages (cart contents) and FPC still appears to only work on a per session basis instead of on a user group basis like we would expeect.

Any idea why this would be occurring?


texts: Magento 2.1 How to Add a Second CMS Block in Category adminhtml

texts:
I am trying to add a second cms block in the category backend just below the default one. I copied and altered the category_form.xml and CategorySetup.php from core into a separate module.

I think I may be close as I can create the attribute and get a select element on the page. The issue is that the select box is empty - there are no options:

I am assuming I need to copy a source model or something like that but haven't found anything helpful online. Does anyone have some insight on this? I am running Magento EE 2.1.8.

Here is my relevant code:

InstallData.php

<?php
namespace [Vendor]\[Module]\Setup;

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

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */

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

        /**
         * Add attributes to the eav/attribute - landing_page_secondary
        **/

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'landing_page_secondary', [
                'type' => 'int',
                'label' => 'Secondary CMS Block',
                'input' => 'select',
                'source' => 'Magento\Catalog\Model\Category\Attribute\Source\Page',
                'required' => false,
                'sort_order' => 25,
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'group' => 'Display Settings',
            ]
        );

    }
}

category_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="landing_page_secondary">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">65</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="label" xsi:type="string" translate="true">Add Secondary CMS Block</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Additionally, in Catalog/Block/Category/View.php I found this code for outputting the cms block. It does not reference the landing_page category attribute which is another reason why I think there are a few more classes I need to override/duplicate.

/**
 * @return mixed
 */
public function getCmsBlockHtml()
{
    if (!$this->getData('cms_block_html')) {
        $html = $this->getLayout()->createBlock(
            'Magento\Cms\Block\Block'
        )->setBlockId(
            $this->getCurrentCategory()->getLandingPage()
        )->toHtml();
        $this->setData('cms_block_html', $html);
    }
    return $this->getData('cms_block_html');
}


texts:
I create a custom theme and I want to change this file: module-search/view/frontend/template/form.mini.phtml

To be safe I need to move this file in my custom theme? If yes what will be the correct path in my theme folder?

Thanks


texts:
I encountered problem width Magento Paypal Express checkout and maybe there are more experienced programmers that could help me. What I need to do is after order is created after making payment via Paypal Express checkout I need to update sales_flat_order_grid table with some additional data in columns. I created observer that uses sales_order_place_after event. Now the problem is that sales_flat_order_grid isn't updated though both event and query I'm using to update table are correct. Maybe someone could help me sort this out? Below are my Observer files.

config.xml

<config>
    <modules>
        <InkWorks_OrderUpdate>
            <version>0.0.1</version>
        </InkWorks_OrderUpdate>
    </modules>
    <global>
        <models>
            <inkworks_orderupdate>
                <class>InkWorks_OrderUpdate_Model</class>
            </inkworks_orderupdate>
        </models>
        <events>
            <sales_order_place_after>
                <observers>
                    <inkworks_orderupdate>
                        <type>singleton</type>
                        <class>inkworks_orderupdate/observer</class>
                        <method>autoUpdateOrder</method>
                    </inkworks_orderupdate>
                </observers>
            </sales_order_place_after>
        </events>
    </global>
</config>

Observer.php

class InkWorks_OrderUpdate_Model_Observer {
    public function autoUpdateOrder($observer) {
        $order = $observer->getEvent()->getOrder();
if($order->getPayment()->getMethodInstance()->getCode()=="paypal_express"){
            $write = Mage::getSingleton('core/resource')->getConnection('core_write');
            $sql = "UPDATE sales_flat_order_grid
                SET
                    deliverydue = '2016-03-15 09:00',
                    kam = billing_name,
                    kur = 'Kaunas',
                    kliento_tipas = '',
                    pristatymo_budas = 'Kurjeris Lietuvoje '
                WHERE entity_id = '41'";
            $write->query($sql);
        }
    }
}


texts:
I need to get the orders collection from the last 2 Days until now (including today).

Example: If today is 11/30/2017 -> then I need orders from 11/28/2017, 11/29/2017 and 11/30/2017.

This is how I started:

    public function __construct(

    \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Framework\Api\SortOrderBuilder $sortBuilder,
    \Magento\Framework\View\Element\Template\Context $context,
    array $data = [])
    {

      $this->orderRepository = $orderRepository;
      $this->searchCriteriaBuilder = $searchCriteriaBuilder;
      $this->sortBuilder = $sortBuilder;

      parent::__construct($context, $data);
    }

    protected function _prepareLayout()
    {
          $searchCriteria = $this->searchCriteriaBuilder
          ->addFilter('status','pending','eq')
          ->addSortOrder($this->sortBuilder->setField('entity_id')
          ->setDescendingDirection()->create())
          ->setPageSize(100)->setCurrentPage(1)->create();

          $ordersList = $this->orderRepository->getList($searchCriteria);
    }

When I print out an order from the $ordersList, this is what I get:

{"entity_id":"21","state":"new","status":"pending","coupon_code":null,"protect_code":"619c73", ....
,"created_at":"2017-11-23 10:15:18","updated_at":"2017-11-24 16:03:37", .... }

So I think filtering by 'created_at' field is probably the solution.

Maybe something like: ->addFilter('created_at','<today minus 2 days>','gteq')

Any tips on how to do that correctly ?

Thanks


texts: jQuery event listeners working most of the time but not sometimes?

texts:
Update:

The problem occurred again and gave me a chance to check a few more things.
The script is loaded and the contents can be viewed in Chrome's developer tools under the "Sources" panel.

This means that it is being loaded, but it is not being executed.

jQuery is available on that page publicly and I was trying to pass it through as a dependency into the call back as jQuery

Since the function is anonymous - there should be no conflict here - no?

My proof is that this works and logs the response from the ajax query. Is requireJs refusing to use it with that name since the global variable already exists for that parameter?
jQuery.ajax('/', function(jQuery) { console.log(jQuery); });

Original Post:

It is very important that I understand why this is happening and how to get around it.

I am avoiding the use of the $ sign for jQuery everywhere in my scripts and loading all of them through requirejs.

There are many buttons that have event listeners attached to them that work nearly all of the time - however sometimes when the page loads the events do not fire or may never be binded to the elements.

I don't know if it's a requirejs problem or jquery conflict. Has anyone else dealt with this yet?

Config:

var config = {
    map: {
        '*': {
            footerContact: 'Module_Contact/js/contact',
        }
    }
};

Script (contact.js)

define([
    "jquery",
], function(jquery){
    "use strict";

    jquery('.element').on('click', function(event) {
    });
});

phtml include:

<script type="text/javascript">
  require(['footerContact']);
</script>

Edit:

I am not convinced it is a requirejs shim issue, reading the documentation it states the criteria for using shim config:

Ideally the scripts you load will be modules that are defined by calling define(). However, you may need to use some traditional/legacy "browser globals" scripts that do not express their dependencies via define(). For those, you can use the shim config. To properly express their dependencies.

Yet my script uses define to include its dependencies...


texts: I have configurable products with options.  I simply want to change the title of that option, but can't find a field where it is editable. Is this possible?


texts: Magento 2: Recommended File Permission for shared hosting

texts:
I have hosted the Magento 2 on a shared hosting server where they recommend to keep all folders as 755 and files as 644.  However Magento recommeds to keep 770 for folders and 660 for all files.

As per the recommendation by hosting provider I set as 755 and 644 along with a small hack in the vendor\magento\framework\Filesystem\DriverInterface.php by setting the same 755 and 644.

Majority of the website is working great however I hit file permission problems whenever I want to access anything inside var or media folder.

For Ex:

./bin/magento setup:upgrade

This throws an error saying unable to access var folder.

While googling I found the thread and noticed someone recommending to keep 777 for the below folders.

find ./var -type d -exec chmod 777 {} ;
find ./pub/media -type d -exec chmod 777 {} ;
find ./pub/static -type d -exec chmod 777 {} ;
chmod 777 ./app/etc

Setting this solved my problem however I am worried will that not open any security risk?  I do have downloadable files under media.  If yes, what is the recommended file permission setup for Magento 2 on a shared hosting server.


texts: How to set colspan 4 in overridden sales_email_order_items.xml in Magento2?

texts:
I want to set colspan 4 in my custom sales_email_order_items.xml file.
Location of file is app\code\My\Module\view\frontend\layout\sales_email_order_items.xml

 <?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" label="Email Order Items List" design_abstraction="custom">
    <body>
        <referenceBlock class="Magento\Sales\Block\Order\Email\Items" name="items">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">My_Module::my_module/email/order/items.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="order_totals">
            <arguments>
                <argument name="label_properties" xsi:type="string">colspan="4" align="right"</argument>  <!-- This is not working -->
            </arguments>
        </referenceBlock>
     </body>
</page>

But my code is not working. What is the correct way of doing it?


texts: Extension update - Technical submission fails

texts:
Magento 2.3 got CsrfAwareActionInterface, which needs to be implemented in order to be able to handle webhooks properly.

I got the following

$part = interface_exists('Magento\Framework\App\CsrfAwareActionInterface') ? 'new' : 'old';
include_once sprintf('a/b/c/d+%s.php', $part);

In practice, this works, CsrfAwareActionInterface won't exist in Magento <2.3, but Magento's code sniffer won't agree.

It tests the code with PHP 7.1 and is successful, then it tries PHP 5.6 which has no return types, resulting in
PHP syntax error: syntax error, unexpected ':', expecting ';' or '{', telling me to fix the errors and resubmit.

Implementing the interface without compatible return types won't work.

Releasing 2 different versions (2.3 & <2.3) and supporting them wouldn't be wise, given that CsrfAwareActionInterface would be the sole difference between them.

Is the result of that test (code sniffer) breaking? Can an extension be approved despite that test failing?


texts: How to exclude 3rd party JS files from minification?

texts:
I have read these pages below:

https://github.com/magento/magento2/issues/5835
Exclude custommodule Js from minification of Js in Magento2
https://github.com/magento/magento2/pull/13687

and I still don't know how to modify config.xml to exclude 3rd party JS files

The module is from an extension by Mageplaza https://www.mageplaza.com/magento-2-social-share/

The code I add to the module config.xml is

        <dev>
            <js>
                <minify_exclude>
                    <config>https://static.addtoany.com/menu/page.js</config>
                </minify_exclude>
            </js>
        </dev>


texts: A purchased theme of Magento 2 gives us errors continuously, and one of them is the product magnifier isn't working as the way it should work. I have pointed out a strange url for the product image and guess this is resulted not to work the magnifier.


texts: Call to undefined method Mage_Sales_Model_Resource_Order::getCollection()

texts:
I am having issues getting a collection from the DB in Magento.

I am trying to pull the field rx_queue from the table sales_flat_order (it's a custom column we added).

When I run the function that is supposed to do this, I get the error message listed in the title of this question.

Here is the function

public function getPrescriptionQueue($orderId) {
    $prescription = Mage::getResourceModel('sales/order')->getCollection()->addFieldToFilter('increment_id', array('eq' => $orderId))->getSelect();
    return $prescription['rx_queue'];
}

What am I doing that gives me this error in the first place? How can I fix it?


texts: M2: How to give the product a "ready for shipment" duration?

texts:
I have products with a different shipping duration. How can I make it this visible on the product page. At the moment I only find a option to give the customer the information product is "in stock" or "out of stock".

How can I give the information "ready for shipment in 3/10/14 days" for each product?

Thank you

Regards


texts:
I'm trying to setup PayPal express checkout to bypass redirect to Magento review page.
I have followed directions posted on stackoverflow link below but I am still redirected to http://mysite.com/index.php/paypal/express/review/   review page the button has changed to pay now but I am redirected before I can complete checkout.

https://stackoverflow.com/questions/7607180/magento-easy-way-to-remove-paypal-express-review-step/14313748#14313748

Anybody point me in the right direction?

Changed
 \app\code\core\Mage\Paypal\Controller\Express\Abstract.php

returnAction() for:
$this->_redirect('//review');

changed:
$this->_redirect('//review');

to:
$this->_redirect('//placeOrder');
 Go to: \app\code\core\Mage\Paypal\Controller\Express\Abstract.php

and search in returnAction() for:
$this->_redirect('//review');

There you have to change:
$this->_redirect('//review');


texts: Apache2 to Nginx migration failed (param?)

texts:
I'm trying to setup Nginx to evaluate its potential running Mangento on a multistore plateform.

After disabling apache, and enabling Nginx (correctly installed and configured), running the website leads to the Magento installation page (insted of the store), with the following error :

Fatal error: Call to a member function getCode() on a non-object in /app/code/core/Mage/Customer/Model/Session.php on line 71

Looks like the getCode() method is failing, because the previous object is NULL.

Any help would be reaaaaaally appreciated.

Thanks.
Sorcy


texts: Magento 2 Option Payment Action: Authorize and Capture of Payment Authorize.Net doesn't work

texts:
I try to configure Authorize and Capture for Payment Action.

But when I try to checkout with Authorize.Net payment, it still show Transaction Type: Authorization Only

I expect it to show Transaction Type is Authorize and Capture and auto-create invoice.
But now, I still create it by manual in the backend of Magento.


texts:
Using Magento 2.2.2, I was trying to add stock updates to a pre-existing setup using the official defined endpoint:

rest/V1/products/testsku/stockItems/1

with

{
  "stock_item": {
    "qty": 1234,
    "is_in_stock": true
  }
}

which wouldn't work.  Searching around, I found an example here which essentially strips the product create/update JSON right back to the bare minimum and just include the stock data:

rest/V1/products/testsku

.

{
  "product": {
    "sku": "testsku",
    "extensionattributes": {
      "stockitem": {
        "qty": 1234,
        "isinstock": true,
      }
    }
  },
 "saveOptions": true
}

I changed my stock update process to call this instead, and it works.

However, I noticed afterwards that the extensionattributes (and it's sub fields) is missing the underscore, according to the official swagger API documentation.  My product create call already includes the underscore fields when creating the item to set an initial stock quantity, yet don't seem to be working.

What's the difference - underscore or no underscore? Which is correct?  Is this a bug or an undocumented change, or are both field names valid?


texts: Magento 2.1.2 admin Store configuration page the error has been processing your request

texts:
In admin when I go to Store > Configuration the following error is showing..

Notice: Undefined index: id in /public_html/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 59


texts: magento 2 createPaypalExpressToken mutation GraphQL

texts:
I am using createPaypalExpressToken mutation for creating Paypal Express token.

Request :

mutation {
    createPaypalExpressToken(
        input: {
            cart_id: "9GXAiPDjB04H1OXOBndnrNIQwxQKFuWv"
            code: "paypal_express"
            express_button: true
            urls: {
                return_url: "paypal/action/return.html"
                cancel_url: "paypal/action/cancel.html"
            }
        }
    )
    {
        token
        paypal_urls{
            start
            edit
        }
    }
}

Response :

{
  "data": {
    "createPaypalExpressToken": {
      "token": "<PayPal_Token>"
      "paypal_urls": {
        "start": "https://www.sandbox.paypal.com/checkoutnow?token=<PayPal_Token>"
        "edit": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=continue&token=<PayPal_Token>"
      }
    }
  }
}

API response response is getting fine. But when i open URL https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=continue&token=<PayPal_Token>, I am getting This transaction has expired. Please return to the recipient's website to complete your transaction using their regular checkout flow. in paypal URL or Popup. URL working fine when generate from website.

Let me know if anyone have idea ?


texts: My website is not supported by Opera Mini so I need to display a message saying "Browser Not Supported". How do I do it in Magento? I really need this please help my, anyone from the community.


texts:
On product page, I am doing add to cart with quantity more than the allowed in cart.
Page is getting refreshed and I am seeing the error message on the page.
After that I am adding single quantity and I am getting the success message but the error message is still there.

In console, I am seeing that error message is in cookieMessages ko template and success message is in messages ko template.

How can I debug this issue?


texts:
Is it preferable to run a nightly re-index via the command line or would it be better to run it with Magerun?

(Or doesn't it really make a difference)


texts: PHP CURL netsuite API throws invalid login and login audit throws invalidSignature in netsuite

texts:
I am trying to get customers from NetSuite API in Magento. It throws error
{"type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2","title":"Invalid login attempt, for more details see Login Audit Trail.","status":401,"o:errorCode":"INVALID_LOGIN"}

I checked in the error log in Netsuite. Over there error is invalidSignature.
Please guys help me Where am I going to wrong?
I had checked the 10 times signature method process on different websites, but it still says,u the OAuth signature is invalid.
Please Help me, Developers.
If any developer has a doubt feel free to ask a question in detail
Here is code
<?php

    define("NETSUITE_URL", 'https://xxxxxxxxx.suitetalk.api.netsuite.com/services/rest/record/v1/customer/1');
    define("NETSUITE_ACCOUNT", 'xxxxxxx');
    define("NETSUITE_CONSUMER_KEY", 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    define("NETSUITE_CONSUMER_SECRET", 'xxxxxxxxxxxxxxxxxxxxxxxxx');
    define("NETSUITE_TOKEN_ID", 'xxxxxxxxxxxxxxxxxxx');
    define("NETSUITE_TOKEN_SECRET", 'xxxxxxxxxxxxxxx');

    $oauth_nonce = md5(mt_rand());
    $oauth_timestamp = time();
    $oauth_signature_method = 'HMAC-SHA1';
    $oauth_version = "1.0";

    $baseString = urlencode(NETSUITE_URL)."&".urlencode(
           "&oauth_consumer_key=".NETSUITE_CONSUMER_KEY
            ."&oauth_nonce=".$oauth_nonce
            ."&oauth_signature_method=".$oauth_signature_method
            ."&oauth_timestamp=".$oauth_timestamp
            ."&oauth_token=".NETSUITE_TOKEN_ID
            ."&oauth_version=".$oauth_version
          );

   $sigString = urlencode(NETSUITE_CONSUMER_SECRET).'&'.urlencode(NETSUITE_TOKEN_SECRET);
   $signature = base64_encode(hash_hmac('sha1', $baseString, $sigString, true));

   $auth_header = "OAuth "
          . 'oauth_signature="' . $signature . '", '
          . 'oauth_version="' . rawurlencode($oauth_version) . '", '
          . 'oauth_nonce="' . rawurlencode($oauth_nonce) . '", '
          . 'oauth_signature_method="' . rawurlencode($oauth_signature_method) . '", '
          . 'oauth_consumer_key="' . rawurlencode(NETSUITE_CONSUMER_KEY) . '", '
          . 'oauth_token="' . rawurlencode(NETSUITE_TOKEN_ID) . '", '
          . 'oauth_timestamp="' . rawurlencode($oauth_timestamp) . '", '
          . 'realm="' . rawurlencode(NETSUITE_ACCOUNT) .'"';

    $curl = curl_init();

    curl_setopt_array($curl, array(
      CURLOPT_URL => NETSUITE_URL,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 0,
      CURLOPT_FOLLOWLOCATION => true,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      // CURLOPT_FAILONERROR => true,
      CURLOPT_SSL_VERIFYHOST=>false,
      CURLOPT_SSL_VERIFYPEER=>false,
      CURLOPT_CUSTOMREQUEST => "GET",
       CURLOPT_HTTPHEADER => array(
        "Authorization:$auth_header"
      ),

    ));

    $response = curl_exec($curl);

    curl_close($curl);
    echo $response;

?>


texts: How to override default invoice pdf styling file in magento2.2.7

texts: I added the logo to the default pdf file and  i want to change the width and height and pdf height width how to do that?


texts: Redirecting to a blanck page /loginPost after fail in login

texts:
If my customer tries to login with a wrong password, he/she is getting redirected to a blank page with this URL: .../index.php/customer/account/loginPost/. I tried to change some things in login.phtml but I really don't know how to fix this.

Anyone knows how to fix this?

Thanks a lot :D


texts:
We have Magento instance with order edit extension.
And payment solution is strip.
When I'm want to add 1 more item using order edit extension I'm getting following error:

  An error occured while saving the order You cannot use a Stripe token
  more than once: tok_18RJXYKTR3xpmuE2c8unIjCS.

How to debug the above issue, I mean its related to order edit extension or strip payment method issue?


texts:
When developing a payment fee, I want to add a surcharge fee to Pdf. I found the pdf.xml config. However, I don't know how it works. Can anyone help me to explain the config pdf xml.

vendor/magento/module-sales/etc/pdf.xml

<totals>

        <total name="discount">
            <title translate="true">Discount</title>
            <source_field>discount_amount</source_field>
            <title_source_field>discount_description</title_source_field>
            <font_size>7</font_size>
            <display_zero>false</display_zero>
            <sort_order>200</sort_order>
        </total>

UPDATE:
Good explain here: Magento 2: How to Read From Configuration Tree


texts: How to override price html on product list page

texts:
I am writing a custom module for magento 2 i.e "call for price" and I want to override price html on product list page.

  I have follow the following scenario:

1.etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Pricing\Render\FinalPriceBox" type="Mymodule\Callforprice\Block\Callforprice" />
</config>

2.Block/Callforprice.php

<?php

namespace Mymodule\Callforprice\Block;
/**
 * Product price block
 */
class Callforprice extends \Magento\Catalog\Pricing\Render\FinalPriceBox
{

     /**
     * Wrap with standard required container
     *
     * @param string $html
     * @return string
     */
    protected function wrapResult($html)
    {
        if($this->getSaleableItem()->getCallforprice()): // getCallforprice() is product attribute
            return '
Call For Price
';
        else :
            return '
getData('css_classes') . '" ' .
                'data-role="priceBox" ' .
                'data-product-id="' . $this->getSaleableItem()->getId() . '"' .
                '>' . $html . '
';
        endif;
    }

}

  Any suggestion would be appreciated.

  Thanks


texts: site break after installing security patch 6788

texts:
we installed all security patches for 1.9.0.1 edition except 6788 patch.

when we are trying to install 6788 through SSH , its not working.

we downloaded the zip folder of this patch, and installed through ftp upload in demo site.

after that lot of our extensions broke down.

we have lot of extensions with "<use>admin</use> in their config.xml".

is there any solution for this?


texts: Magento get Zipcodes for a particular country and state

texts:
I am using Magento 1.9.x version for my website.

Now I am fectching the country list for storing country in a business directory.

I am able to fetch all the states of a particular country (US) when it is selected, by ajax, but now when any state is selected, I want a list(drop-down only) of zipcodes for the selected state, to appear right below the state dropdown.

edit:

My question is how to fetch zipcodes list for a specific country and state, like web api

How can I achieve that ?


texts:
I am using SMTP PRO in  Magento 1.9.  When I click "run self-test", I am getting messages

SMTP Pro Self Test Results
Sending a test email to your contact form address: abc@xyz.com from aa@xyz.com. Unable to send a test email.

Exception message was: Could not open socket
Please check the user guide for frequent error messages and their solutions.
Default templates exist.
Email communications are enabled.

Please Help me ...thank you


texts:
I need to write a question use Magento ORM applying functions at condition like this:

  SELECT * WHERE REPLACE(street, ' ', '') = 'Streetac'.

I try using regular expressions but I have problem with case sensitive.

I need a function like this: addExpressionFieldToSelect, but I need to use this function at condition.

In that the query return all this cases.

  'House 12' = 'hOuse 12' = 'house       12   ' = HouSe   12  '


texts: Magento 2.3.2 does not show Thumbnail in other store views (language)

texts:
I'm using Magento 2.3.2 with 3 store views for languages and Porto Smartwave Theme.
All Products are created as Simple Product for "All Store Views", the Thumbnails have roles assigned, but some products show the default Magento Thumbnail image in another Store View but show the actual selected Thumbnail in the other.
It seems like a random behavior, i couldn't find any pattern behind it and there is no console error or error in system, exception or debug.log
I have checked the $productImageUrl variable in /Magento_Catalog/templates/product/list.phtml
and it is the path to the defualt image in one store view and the actual correct image path in the other store view.
I've tried:

bin/magento c:f
bin/magento setup:static-content:deploy
bin/magento catalog:images:resize
and also deleted the cached images in /pub/media/catalog/product/cache but with no result.


texts: How to get Item id after programmatically add Product to Cart?(Not in observer)

texts:
I want to add a product programmatically to the cart. My product is added by using the following code. But it didn't return the quote item id. How can I get the item id? Here is my code

$id = 100;
$qty = '2';
$_product = Mage::getModel('catalog/product')->load($id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product, array('qty' => $qty));
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);


texts:
Only on the product page, when access does not load any css, the store simply runs out of style

I imported these products by CSV, is this related? can someone help me?


texts: Magento 2 customer logged in checking - in \Magento\Customer\Model\Session method isLoggedIn() always returns false

texts: I am instantiating the customer session helper (\Magento\Customer\Model\Session $customerSession) correctly, but this function always returns false, even though the customer is logged in. What am I missing here?


texts: How to set filter in a SOAP request where the SOAP Client is implemented in Plain JAVA

texts:
Before i ask the question, let me just put it this way that i have found couple of close answers to my question. But these answers are fit for the clients implemented in PHP on a server (things are a bit easier this way)

But I am using the latest set of SOAP API's to connect to Magento from an Android client written in Java. I have a set of requirements where i have to filter the products, orders by various parameters.

Unfortunately I am not able to set the filters correctly.
Below is a snippet of the SOAP request I am making in one of the cases (the error response i have posted below it).

Please help me in configuring the correct filter.

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:catalogProductList soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionId xsi:type="xsd:string">d983bbee001cff69e25fdc75b5ad3394</sessionId>
         <filters xsi:type="urn:filters">
            <!--You may enter the following 2 items in any order-->
            <!--Optional:-->
            <filter xsi:type="urn:associativeArray" soapenc:arrayType="urn:associativeEntity[]">
                **<key xsi:type="xsd:string">product_id</key>
                <value xsi:type="xsd:string">2</value>**
        </filter>
            <!--Optional:-->
            <complex_filter xsi:type="urn:complexFilterArray" soapenc:arrayType="urn:complexFilter[]">
            </complex_filter>
         </filters>
         <storeView xsi:type="xsd:string">malaysian</storeView>
      </urn:catalogProductList>
   </soapenv:Body>
</soapenv:Envelope>

Response ---

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring>Call to a member function getAttributeCode() on a non-object</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


texts:
In my Main Website, I create 2 Store name ram and shyam store and every store have 2-2 view.
I upload product in ram store and shyam store.
Now when I go to ram store view home page display all product list (also Shyam store).
Also when I go to Shyam store page display all product (also ram store).

Question:- how to disable display product of another store view. means I want to display only a particular store view product on a particular store home page.