texts:
i have a problem with the validation in my website http://makemydrink.com/ for onepage checkout. in the front page when user click on ckeckout at the bottom line, they will get an error saying "Minimum purchase must be 500" and once they enter the next  onepage checkout page.Here at the bottom they can change their selection and if they click on the place order.. The value in checkout bottom field and review your order field doesn't match... so can anybody help me how to refresh the review your order div when customer remove their selection in checkout at bottom link in onepagecheckout page this page.

this is my review.phtml code.

<?php echo $this->__('Review Your Order') ?>

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

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

        <button type="submit" title="<?php echo $this->__('Place Order') ?>" class="button btn-checkout" onclick="fnGoToCheckout1(url);checkout.save(); return false;" id="God"><?php echo $this->__('Place Order') ?></button>

                <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Submitting order information...') ?>" title="<?php echo $this->__('Submitting order information...') ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>

I'm not getting the solution please.

i can remove the cache in my browser but customers can't do. i want to refresh the review your order div each time when i delete an order from checkout in bottom link.i.e, when customer delete an one product, it'll show an alert "are you sure u want to remove? on pressing ok or cancel i want to refresh the review your order div in review.phtml page..

Please help me.


texts: Extending Error handler using plugin method is not working

texts:
I need to save errors in my database. So I am trying to extend Error Handler in my custom module using plugin method. But it is not working. Here is my code

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\ErrorHandler">
        <plugin name="BridgeErrorNotificationErrorHandler" type="Bridge\ErrorNotification\Plugin\ErrorHandlerPlugin" sortOrder="10"/>
    </type>
</config>

ErrorHandlerPlugin.php

<?php
namespace Bridge\ErrorNotification\Plugin;

class ErrorHandlerPlugin
{
    protected $errorPhrases = [
        E_ERROR => 'Error',
        E_WARNING => 'Warning',
        E_PARSE => 'Parse Error',
        E_NOTICE => 'Notice',
        E_CORE_ERROR => 'Core Error',
        E_CORE_WARNING => 'Core Warning',
        E_COMPILE_ERROR => 'Compile Error',
        E_COMPILE_WARNING => 'Compile Warning',
        E_USER_ERROR => 'User Error',
        E_USER_WARNING => 'User Warning',
        E_USER_NOTICE => 'User Notice',
        E_STRICT => 'Strict Notice',
        E_RECOVERABLE_ERROR => 'Recoverable Error',
        E_DEPRECATED => 'Deprecated Functionality',
        E_USER_DEPRECATED => 'User Deprecated Functionality',
    ];

    public function afterhandler($errorNo, $errorStr, $errorFile, $errorLine)
    {
        if (strpos($errorStr, 'DateTimeZone::__construct') !== false) {
        // there's no way to distinguish between caught system exceptions and warnings
          return false;
        }

       $errorNo = $errorNo & error_reporting();
       if ($errorNo == 0) {
         return false;
       }

       $msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
       $msg .= ": {$errorStr} inn {$errorFile} on line {$errorLine}";
       $msg .= "  just for testing";
       throw new \Exception($msg);
    }
}

To test this I am just adding $msg .= "  just for testing"; in message.


texts:
I want to add a new SOAP API similar to shoppingCartShippingMethod() so that I can pass the shipping rate to the SOAP call to set the shipping rate. This is needed for integration with other ordering systems where the shipping rates are dynamic.

However, each shipping method requires implementing collectRates() but I am not sure how to pass the arguments in the SOAP call to that method.

Do I need to save the shipping rate in a session (even though it's through the API) so that collectRates() can retrieve the rate?


texts:
When saving products in magento through custom scripts I have always had to add the following:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

Otherwise you get a wierd error from eav/config model about an invalid argument foreach.

Can anyone explain why products can only be saved under the admin store id? and if this code i have been using is in fact the best way to deal with it?


texts: Delete all entries in a custom table programatically

texts:
I'm using magento 2, I created some tables that I fill with entries then I want to delete all those entries at once.
I want the solution to use Magento repository abd without using a foreach. Something like deleteAll for example.
Thanks alot.


texts: Routing : how to specify a controller and a method for a specific URL?

texts:
How could I give the controller's name (class name) and its method in routes.xml from a plugin ?

for insance, I have two front routes, and I would like them to point to :

  in the file MyCompany/MyModule/Controller/MyPath/Index.php : method foo()

and

  in the file MyCompany/MyModule/Controller/MyPath/Index.php : method bar()

Here is the routes.xml file

  etc/frontend/routes.xml

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

Update :

I used Qaisar Satti's suggestion :

  in index.php :

public function execute() {//InputInterface $input, OutputInterface $output)
{
    $route = $this->getRequest()->getRouteName();
    $this->$route(); //this will call foo_route() or bar_superroute()
}

protected function foo_route() {
    $params = $this->request->getParams();
    //do some awesome things
}

protected function bar_superroute() {
    $params = $this->request->getParams();
    //do some other super awesome bar things
}


texts: IP Admin url returning 404 error after succesfull installaion

texts:
Deployed magento on linux machine. I cant able to access front-end and admin after successful installation.

store ip:  http://52.187.32.74/rahhams

store admin ip:  http://52.187.32.74/rahhams/admin_msp8sn

Php version: 7.0.


texts: Magento 2: How to remove "Did you mean" section from search page?

texts:
I am using Elasticsearch as search engine, but I want to hide the section where it says Did you mean and Related search terms:

Is there a way to do this?
Thanks in advance


texts: Magento2 custom redirection is not working

texts:
I tried below code but page is not redirecting

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$redirect = $objectManager->get('\Magento\Framework\App\Response\Http');
$redirect->setRedirect('Your path....');

Please, anyone help me.


texts: Magento 2: How to get last order details in a custom phtml page?

texts: I need to get last order details in a custom phtml page


texts: Magento2 : Change order of Tabs on Product Page

texts:
I'm trying to change the order of the tabs on the product page in Magento 2. Default is Details|More Information|Reviews.

I tried:

Vendor/theme/Magento_Catalog/layout/catalog_product_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="product.info.description" destination="product.info.details" after="-" />
    </body>
</page>

But that doesn't work, and thats the recommended way for moving elements. I was able to move the tabs out of the tab area and into other areas, as well as add new tabs, but I cannot control the order of the tabs.

My guess is that it has something to do with group="detailed_info"; It looks like Magento grabs the layout elements with this attribute in the XML and loops through through it to create the tabs.

Is there a way to change the order of tabs without rewriting the module?


texts: Unable to move element from one parent to another in magento 2.1 layout

texts:
I am trying to move minicart-wrapper into page-wrapper, right now it is in the parent(header). What i have done so far,

  Path where i am over riding magento core module in my extended theme, my parent theme is luma:

Magento/app/design/frontend/classic/classic_theme/Magento_Checkout/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="minicart.wrapper" destination="page.header" after="-"/>
    </body>
</page>

  Path of the default module that i am over riding in my theme:
  Magento/vendor/magento/module-checkout/view/frontend/layout/default.xml

I am following this (Rearrange elements)
http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html

I am confused how if they are referring to element by class or something else. I am doing it using class in my code.

Please help!!! Thanks in advance.


texts:
When using sales_order.info I get two values in the shipping_address for region/state.

In the output I can see both [region] and [region_id]. Is it possible to get region_code using any of these values? Reason is that I need to send iso_code for Region/state.


texts: Update Magento Review form action for https

texts:
Within the review form on my store you can see:

action="<?php echo $this->getAction() ?>".

This generates a http link that breaks our secure page load.

My question is where is the getAction() function declared/built, and is it possible to update for compliance with https?


texts:
I've created a custom order attribute in my extension's setup script like this:

$setup->addAttribute('order', 'my_custom_attribute', array(
    'type' => 'varchar',
    'input' => 'text',
    'label' => 'My Custom Attribute',
    'global' => 0,
    'visible' => 1,
    'required' => 0,
    'user_defined' => 1,
    'default' => '',
    'visible_on_front' => 0,
));

When I look into eav_attribute table in the DB after running this script I can see that a new entry has been created with the options listed above and assigned to the entity_type_id of 4, which is the sales/order entity model in this installation.

Now when I do the following, I get an empty result:

$order = Mage::getModel('sales/order')->load(90);
$order->setData('my_custom_attribute', 'test');
$order->save();

$order = Mage::getModel('sales/order')->load(90);
echo $order->getData('my_custom_attribute'); // NULL

Is there a step that I'm missing here?


texts: How to check whether Cart contain any nominal(isRecurring) item Magento

texts:
How to check whether Cart contain any nominal(isRecurring) item in Magento.

I have found one function isRecurring but i don't know how to use this function in cart. Can anyone know any other code(function) to check nominal item in cart ?

Thanks in advance


texts: What is the purpose of the transaction failed email?

texts: I am just looking for some clarification on the purpose of the transaction failed email. Are these supposed to be setup to email the customer that their transaction didn't go through after they have checked out?  I didn't think magento would let you complete a shopping cart if there were errors.


texts: New Order Email Template for each Product type in Magento

texts:
I wanted customization.I have Simple,Downladable and Virtual Products in my Magento Store and I need three New order email template one for each product type.

Like if my customer order virtual product i need to send virtual product's new order email template in the email.similarly for the simple and the Downloadable.

I needed this customization.Is it Possible in Magento.

Please Help Me.

Thanks


texts: Magento 2: Using nginx -- All Static Assets are 404

texts:
I'm trying to install Magento 2 using the Laravel Homestead project.  Laravel Homestead provides a virtual machine based around nginx.  I have nginx successfully serving Magento 2 application pages.  However, nginx is not serving static asset files.  They all 404.

curl -I 'http://magento-php7.dev/static/frontend/Magento/luma/en_US/mage/calendar.css'
HTTP/1.1 404 Not Found
Server: nginx/1.9.9
Date: Wed, 03 Feb 2016 22:13:29 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Frame-Options: SAMEORIGIN

I think what's happening in nginx is skipping the pub/static/.htaccess file that makes the static asset serving application work.  If I make a direct call to the URL that pub/static/.htaccess redirect to, the asset serves successfully

http://magento-php7.dev/static.php?resource=frontend/Magento/luma/en_US/mage/calendar.css

Does anyone know how to get this working?  This page on the nginx wiki makes it sound like nginx doesn't support .htaccess -- but the root .htaccess/mod_rewrite is working fine. (it may be homestead is providng magic for this -- I just don't know nginx well enough to know)


texts:
I am using magento 2.1 with the ultimo theme. I was customizing the login page which was not avaialable as a module in the theme.

So I go to vendor and changed the login page setting like text and placement of new register and old customer login place.

I want to ask is it okay to change these files . I know after the changes I have to compile so that these changes make it to the pub.

But in the vendor what should be done for the best practice.

P.S the path is /vendor/magento/module-customer/view/frontend/templates/newcustomer.phtml


texts: Error in file... which I already deleted - how can I fix this?

texts:
I installed an extension which causes some troubles so I decided to load a backup. I got an error message Base table or view already exists:1050 Table 'desktopnotification' already exists, so I just deleted the database since it was unimportant. But I still get the error massage. What can I do now?

This is how the trace look like:

Trace:
#0 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.2')
#2 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.2')
#3 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#6 D:\wamp\www\magentocustmod\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#7 D:\wamp\www\magentocustmod\index.php(87): Mage::run('', 'store')
#8 {main}


texts:
I need to set Open Graph price grouped product in <head> section.

I can get price of simple product in this way:

<meta property="og:price:amount" content="<?php echo $_product->getPriceHtml($_item, true) ?>">

and it works well. But... how can I get price of grouped product (the price of the product associated with the lowest price)?


texts: Magento 2 Product Page Not Loading Correctly

texts:
New to Magento 2 and just did a fresh install and must have set something wrong, perhaps in the rewrite url.

I have a single subcategory called Test and 1 product called product1.

This product is in the Test category and shows up fine on the nav and within the catalog page, but is blank when I select the product detail page.

url www.domain.com/product1.html

When I manually change the url to www.domain.com/test/product1.html it works fine.

Can someone point me in the right direction?

Configuration -> Web -> Base URL's look like this:

Base URL www.domain.com
Base Link URL www.domain.com
Base URL for Static View Files Blank
Base URL for User Media Files Blank


texts: Magento 2 - run function if order is marked complete?

texts:
I need to submit the following information to a third-party. I've started working on a PHP file (outside of Magento 2) to get the data from the Magento database but I'm having issues getting custom attribute text at the moment and I understand using the API is probably the way to go but I can't seem to get it working.

How can I create a function that runs as soon as I mark an order as complete? This would enable me to send the ID of the order that is marked complete to the third-party.


texts: Two customs attributes, only one is saved in the database

texts:
I added two custom attributes in the order and quote table.

One is delivery_date : the delivery timeslot chosen by the user.
The other is additionnal_information

The two rows are created but only one of them (delivery_date) is filled when an order is submitted. The other is NULL

If I try this in the observer : mage::log($order->getAdditionnalInformation()), it returns something

Does someone knows why ?

My install script :

<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("order", "delivery_date", array("type"=>"varchar"));
$installer->addAttribute("quote", "delivery_date", array("type"=>"varchar"));
$installer->addAttribute("order", "additionnal_information", array("type"=>"varchar"));
$installer->addAttribute("quote", "additionnal_information", array("type"=>"varchar"));
$installer->endSetup();

My config file (only the global part) :

<global>
    <events>
        <sales_quote_save_before>
            <observers>
                <save_before>
                    <type>singleton</type>
                    <class>CoursierPrive_Transport_Model_Observer</class>
                    <method>saveQuoteBefore</method>
                </save_before>
            </observers>
        </sales_quote_save_before>
        <checkout_type_onepage_save_order>
            <observers>
                <delivery_date_observer>
                    <type>singleton</type>
                    <class>CoursierPrive_Transport_Model_Observer</class>
                    <method>saveCustomData</method>
                </delivery_date_observer>
            </observers>
        </checkout_type_onepage_save_order>
    </events>
    <fieldsets>
        <sales_convert_quote>
            <delivery_date>
                <to_order>*</to_order>
            </delivery_date>
            <additionnal_information>
                <to_order>*</to_order>
            </additionnal_information>
        </sales_convert_quote>
        <sales_convert_order>
            <delivery_date>
                <to_quote>*</to_quote>
            </delivery_date>
            <additionnal_information>
                <to_quote>*</to_quote>
            </additionnal_information>
        </sales_convert_order>
    </fieldsets>
     <resources>
        <transport_setup>
            <setup>
                <module>CoursierPrive_Transport</module>
                <class>Mage_Sales_Model_Resource_Setup</class>
            </setup>
        </transport_setup>
    </resources>
</global>

And my observer :

<?php
class CoursierPrive_Transport_Model_Observer
{
    public function saveCustomData($observer)
    {
        $event = $observer->getEvent();
        $order = $event->getOrder();
        $timestamp = Mage::getSingleton('core/session')->getData('delivery_date');
        $additionnalInformation = Mage::getSingleton('core/session')->getData('additionnal_information');
        $order->setAdditionnalInformation($additionnalInformation);
        $order->setDeliveryDate($timestamp);
    }

    public function saveQuoteBefore($observer)
    {
        $post = Mage::app()->getFrontController()->getRequest()->getPost();

        if(isset($post['field']['delivery_date']))
        {
            $var = $post['field']['delivery_date'];
            Mage::getSingleton('core/session')->setData('delivery_date', $var);
        }
        if(isset($post['field']['additionnal_information']))
        {
            $var = $post['field']['additionnal_information'];
            Mage::getSingleton('core/session')->setData('additionnal_information', $var);
        }
    }
}
?>


texts: Magento 2: How to add multiselect dropdown field on my Home Page

texts:
I'm new in Magento 2 and I have created a custom module.  Now I want to add multi-select dropdown field in my module's front template on my home page.

How to add a multi-select dropdown, please?


texts: Magento 2 create ajax request from out of magento

texts:
I wanna create Ajax request from empty HTML with jQuery.
I do like this

$.ajax({
    url: "http://****.com/rest/V1/integration/admin/token?username=***&password=****",
    type: "POST",
    success: function (d) {
      alert(d);
    }
  });

but always I get error

Access to XMLHttpRequest at 'http://localhost:8000/rest/V1/integration/admin/token?username=magento&password=magento2' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I know I should add some header before send request but jquery does not support headers.
Anyone gets this error?


texts: why button not showing in custom theme in magento 2?

texts:
when i go customer login and customer module and custom_module related
  pages

  button is not showing

when i move a mouse over that button  the button
is showing

how to solve this css color issue

  when untick the default css in inspect element
  button color is showing
  how i fix this..???


texts: How to know "sales_order_place_after" event is captured in Magento 2?

texts:
I have done this so for:

app\code\Vendor\Extension\etc\events.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="sales_order_place_after">
<observer name="vendor_sales_order_place_after" instance="Vendor\Extensoin\Observer\SendEmail" />
</event>
</config>

And at: app\code\Vendor\Extension\Observer\SendEmail.php

namespace Vendor\Extension\Observer;

class SendEmail implements \Magento\Framework\Event\ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
 $order = $observer->getEvent()->getOrder();
 echo $orderId = $order->getId();
 $comment = $this->getRequest()->getParam('comment');
 print_r("Catched event succssfully !"); exit;
}
}

But noting happens and I go to success page as usual. How to know event is captured or is there some other way to achieve it?


texts: Magento 2 I want to set a custom price of a product programmatically but only for this one session

texts:
I have a little problem because I first add some products into the cart -> this is working. But I also need to change the price of this products I add. The problem about that is, that I only want to change the price for this session. Afterwards the price should be the same as before.

(EDIT) One other idea would be to add a custom temporary discount price but not a discount of coupon code in the controller. Any Idea?

I tried this two solutions already:
https://magento.stackexchange.com/a/216111/82120

https://webkul.com/blog/magento2-set-custom-price-of-product/

But none of them did work.

This is my code at the Moment:

Controller.php:

<?php
namespace MassiveArt\ShoppingCart\Controller\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\Data\Form\FormKey;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\Product;

class Index extends Action
{
    protected $formKey;
    protected $checkoutSession;
    protected $cart;
    protected $product;
    public function __construct(
       Context $context,
       \Magento\Checkout\Model\Session $checkoutSession,
         JsonFactory $resultJsonFactory,
       FormKey $formKey,
       Cart $cart,
       Product $product) {
            $this->checkoutSession = $checkoutSession;
            $this->formKey = $formKey;
               $this->resultJsonFactory = $resultJsonFactory;
            $this->cart = $cart;
            $this->product = $product;
            parent::__construct($context);
    }
    public function execute()
    {

        try {
             $result = $this->resultJsonFactory->create();
           $productId = $this->getRequest()->getParam('productId');
           $amount = $this->getRequest()->getParam('amount');
           $test = $this->getRequest()->getParam('test');
           if($test == "set"){
               $allItems = $this->checkoutSession->getQuote()->getAllVisibleItems();
               foreach ($allItems as $item) {
                   $itemId = $item->getItemId();
                   $this->cart->removeItem($itemId);
               }
            }
               $params = array(
                    'form_key' => $this->formKey->getFormKey(),
                    'product' => $productId,
                    'qty'   => $amount,
            );
              $product = $this->product->load($productId);

            // Here I want to change the price

            $product->save();
              $this->cart->addProduct($product, $params);
              $this->cart->save();
                $result->setData(['message' => __("Product is added in cart")]);
            return $result;
       } catch(\Exception $e) {
               $result->setData(['error' => __($e->getMessage())]);
               return $result;
         }
 }
}

If you need to have any more information to solve this answer, please let me know.


texts: How do I call the Instance of an Extended Model

texts:
Fatal error: Uncaught TypeError: Argument 1 passed to FDB\FreeSamples\Helper\SampleCategories::__construct() must be an instance of FDB\FreeSamples\Model\Checkout\Type\Onepage, instance of Magento\Checkout\Model\Type\Onepage\Interceptor given,

Model

namespace FDB\FreeSamples\Model\Checkout\Type;

class Onepage extends \Magento\Checkout\Model\Type\Onepage
{
}

I am attempting to the load class in a helper:

public function __construct(
        \FDB\FreeSamples\Model\Checkout\Type\Onepage $onePage
    ) {
        $this->_onePage = $onePage;
        parent::__construct($context);
    }


texts: Magento 2 - checkout page loading but not stoping

texts:
when ever i click next for check out page

some time still loading

some times shows empty page

How i can fix this....


texts: I want to show current menu path to users in Magento. it will good if I can show it under top menu. How i can show user the navigated path to current page?


texts:
After login redirect to previous page all page it's working fine but i am using custom url for shopping cart page so it redirect to my account page. How to fix it

                        <?php if(Mage::getSingleton('customer/session')->isLoggedIn()){ ?>
                        <?php
                        $customer = Mage::getSingleton('customer/session')->getCustomer();
                        $cusname = $customer->getFirstname().' '.$customer->getLastname();
                        $name = substr($cusname,0,18)."..";
                        ?>
                        <a href="<?php echo Mage::getUrl('customer/account'); ?>"><?php echo "Hi "."$name"  ?> &nbsp;

<a href="<?php echo Mage::getUrl('customer/account'); ?>">Profile

<a href="<?php echo Mage::getUrl('sales/order/history'); ?>">Order

<a href="<?php echo Mage::getUrl('wishlist'); ?>">Wishlist

<a href="<?php echo Mage::getUrl('newsletter/manage'); ?>">Newsletter

<a href="<?php echo Mage::getUrl('review/customer'); ?>">Review

<a href="<?php echo Mage::getUrl('customer/account/logout'); ?>">Logout

                        <?php } else { ?>
                        <a href="<?php echo Mage::getUrl('customer/account/login'); ?>">Login / Register
                        <?php } ?>


texts:
My post of an attribute is not working anymore (it has worked, checked git history).

    {
        "attribute":{
        "attribute_code":"some_other_stuff",
            "is_html_allowed_on_front":true,
            "frontend_labels ":[
             {
                 "store_id":1,
                "label":"Component type"
             },
             {
                 "store_id":2,
                "label":"Component type"
             }
          ],
          "frontend_input":"select",
          "is_visible_on_front":true,
          "scope":"global",
          "options":[]
       }
    }

it returns

    {
        "message": "Invalid value of \"%value\" provided for the %fieldName field.",
        "parameters": {
            "fieldName": "frontend_label",
            "value": null
        }
    }

Any help is appreciated


texts:
I am new to Magento, and i just installed a clean build in CPanel.

My content overview in backend won't load.

Pages, blocks and widgets overview is not showing any results, even though i just saved a page, and cleared cache.

As you see here, no pages are getting fetched. (Pages have been added, and can be viewed in the frontend, if going to the URL i added to the page.)

No errors in console neither.

What can the problem be?


texts: Update Product Attribute through Import Tool using csv - ERROR: keep creating new same sku number - magento 2

texts:
I'm try to update a product attribute called "custom_stock_status". I have put together a csv file, with 2 columns like this, and import the file using import behavior "add/update", but it keeps creating the same sku number, even-though the sku p1,p2,p3 are already exists in the backend.
Everytime i try to import the csv file again, it create another SAME sku number in the backend.

sku | custom_stock_status
p1    coming soon
p2    coming soon
p3    coming soon


texts:
I'm having problems with encoding, my store is so configured:

And in my php code:

$client = new SoapClient($url, array('trace' => 1, 'encoding'=>'UTF-8'));
$session_id = $client->login($username, $password);
$result = $client->customerCustomerList($session_id);
var_dump($result);

But the customer's name is with character problems:


texts: How to join shipping address to customer collection?

texts:
I want to join default shipping address to customer collection.

if shipping address is not available  need to join billing address in place of shipping address.

For an example

customer_id email shipping address fields

s@gmail.com     shipping info
g@gmail.com     shipping info
k@gmail.com  billing info

here customer-3 does not contain default shipping address .so i need to replace with default billing address(assumed customer contain default billing address.)

$collection = Mage::getResourceModel('customer/customer_collection')
    ->addNameToSelect()
    ->addAttributeToSelect('email')
    ->addAttributeToSelect('created_at')
    ->addAttributeToSelect('group_id')
    ->joinAttribute('shipping_prefix', 'customer_address/prefix', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_firstname', 'customer_address/firstname', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_middlename', 'customer_address/middlename', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_lastname', 'customer_address/lastname', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_suffix', 'customer_address/suffix', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_company', 'customer_address/company', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_street', 'customer_address/street', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_postcode', 'customer_address/postcode', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_city', 'customer_address/city', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_country_id', 'customer_address/country_id', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_region', 'customer_address/region', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_telephone', 'customer_address/telephone', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_fax', 'customer_address/fax', 'default_shipping', null, 'left')
    ->joinAttribute('shipping_vat_id', 'customer_address/vat_id', 'default_shipping', null, 'left');


texts: More information tab on product page missing after update to 2.3.5?

texts:
After updating from Magento 2.1 to Magento 2.3.5, I noticed that the More information tab is missing in the product page. The Details tab is still there.  I also checked the attributes which should be sown and they are set the same as in the old shop, where the tab is shown.

I disabled my custom theme and its still happening.

How could I the tab visible again?

Thanks!


texts: How can I stop Google Chrome from Autofilling form data on checkout?

texts: The issue is only happening on Google Chrome. I need to stop Chrome from Autofilling the customers address. Can anyone help?


texts: How to assign cart data in order Magento 2?

texts: I am successfully save custom data in cart using checkout_cart_product_add_after event in "quote_item_option" table Now i want to save this data in order and display in order section in admin panel.


texts:
I'm new to magento and I have some troubles. I've managed to filter products by style or color, which are configurable products, but I can't figure out how to filter by size, where products are simple products.

Here's the code I use for style and color:

    if (isset($_GET['style'])) {
        $this->addAttributeToFilter('style', array('eq' => $_GET['style']));

    if (isset($_GET['solid'])) {
         $this->addAttributeToFilter('solid', array('eq' => $_GET['solid']));
     }

I get attributute name and ID from URL. My filter show styles and color only if they are available for products inside the filtered category, but it always show all sizes and when I try to filter any of them, nothing is returned. Also, there is a problem when I select for example more than 1 style to filter. I should get 2 products with two styles, but instead I get only one (first one).


texts: Magento site is not working with www in url

texts:
I have a website which is working fine. There is a footer link to access media files. It was working fine But i changed the media files to new files, but with the same name. Then this page is not working when the url loads with www. with www old content is loading in the page. Without www new content is loading in the page.

Since i did not do any other files changes i am confuse what is wrong here.

Can anyone please help me. Thank you.


texts: I've changed cache management to disable and i have worked for a while after that I've changed to cache enable by the time im getting above error, guys can anyone help me to fix this issue.


texts:
I need to remove the telephone as required in Magento for this I have followed some tutorial and make some changes first I just copy the abstract.php to local folder and comment the line

if (!Zend_Validate::is($this-&gt;getTelephone(), 'NotEmpty')) {
    $errors[] = $helper-&gt;__('Please enter the telephone number.');
}

after that i have removed all the validation class from billing.php and shipping .php and then in database eav_attribute table make required option to 0 and removed the validation rule from customer_eav _attribute table but after doing all these things i'm getting an alert box by saying

  Telephone is required value telephone length must be greater than 1
  character


texts:
I have seen lot of posts, but didn't get proper answer to create new order from an existing orders at magento.

Concept is create an order from an existing orders by copying all elements/object from of that existing. There are no depends on cart session model or quote.

Have seen that recurring profile have that type concept ?

Can any one give me a solution for create  order from existing  order ?


texts: Image Background Gets Black after installing patch SUPEE-9767

texts:
I have installed patch SUPEE-9767 on 1.9.2.1 store, Now the new products images is having a black color around it. I attached a sample product image.

I have tried this fix

Watermark get black background when transparent

but the problem is after I update the new code in Validator/Image.php I cannot upload images from the admin, I can use the browse button and click Upload but after that it's just showing 'uploading' forever

Would some one advice me how to fix this issue


texts: Custom admin grid Excel XML export - result contains no rows data, only columns names

texts:
I created custom admin grid in my module. And CSV Export for it works fine, but Excel XML Export does not contain any rows data

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet">
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"></OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"></ExcelWorkbook>
<Worksheet ss:Name="transactions_listing.xml">
<Row><Cell><Data ss:Type="String">Transaction ID</Data></Cell><Cell><Data ss:Type="String">Customer Name</Data></Cell><Cell><Data ss:Type="String">Amount</Data></Cell><Cell><Data ss:Type="String">Comment</Data></Cell><Cell><Data ss:Type="String">Created At</Data></Cell></Row>
</Worksheet>
</Workbook>

So, there are only column names in it

Any ideas why's that?


texts: how to override product grid listing magento 2

texts: I have added the sequence Magento catalog to my module. I also copied the content of grid_listing, but i can't see the override working. Where i am wrong please.


texts: disable add to cart for product with price 0

texts:
I was able to print a div when the price is 0 in this way

<?php if ($this->getProduct()->getFinalPrice()==0) : ?>

    CALL NOW 123336541

<?php return; ?>

how do I disable add to cart when the price is 0?


texts:
1 Question: How do I send my attachment with the other data?

2 Question: Is there any way I can get the uploaded file and change the name to the email and the schedule of the uploader?

This code save my attachment

Function

        $_UP['pasta'] = '/aplic/www/html/media/uploadcontato/';

        $_UP['caminho'] = '/media/uploadcontato/';

        $_UP['extensoes'] = array('jpg', 'png', 'gif', 'pdf', 'txt', 'doc', 'docx');

        $_UP['renomeia'] = false;

        if(filter_input(INPUT_POST, "btnSubmit")){
        if ($_FILES['attachment']['error'] != 0) {
        }
        $extensao = strtolower(end(explode('.', $_FILES['attachment']['name'])));
        if (array_search($extensao, $_UP['extensoes']) === false) {
        }
        if ($_UP['renomeia'] == true) {
          $nome_final = md5(time()).'.jpg';
        } else {
          $nome_final = $_FILES['attachment']['name'];
        }
        if (move_uploaded_file($_FILES['attachment']['tmp_name'], $_UP['pasta'] . $nome_final)) {
          $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
          $query = "INSERT INTO contato (`nome`,`caminho`) VALUES ('".$nome_final."', '".$_UP['pasta']."')";
          $connection->query($query);
        } else {
        }

And this send email

Function

$post = $this->getRequest()->getPost();
if ( $post ) {
    $translate = Mage::getSingleton('core/translate');

    $translate->setTranslateInline(false);
    try {
        $postObject = new Varien_Object();
        $postObject->setData($post);

        $error = false;

        if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
            $error = true;
        }

        if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
            $error = true;
        }

        if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
            $error = true;
        }

        if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
            $error = true;
        }

        if ($error) {
            throw new Exception();
        }
        $mailTemplate = Mage::getModel('core/email_template');

        $mailTemplate->setDesignConfig(array('area' => 'frontend'))
            ->setReplyTo($post['email'])
            ->addBcc($post['email'])
            ->sendTransactional(
                Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
                Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
                Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
                null,
                array('data' => $postObject)
            );

        if (!$mailTemplate->getSentSuccess()) {
            throw new Exception();
        }

        $translate->setTranslateInline(true);

        Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
        $this->_redirect('*/*/');

        return;
    } catch (Exception $e) {
        $translate->setTranslateInline(true);

        Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
        $this->_redirect('*/*/');
        return;
    }

} else {
    $this->_redirect('*/*/');
}

}


texts: problem creating admin panel option for custom extension magento

texts:
I am trying to create a Custom slider extension which has option of change settings and uploading images from admin panel I followed many tutorial available online but nothing has worked So can Anyone help in this problem to create admin option for my slider. Here is the file which I have coded now

Code for my app\etc\modules\Sequester_Custommodule.xml file
<?xml version="1.0"?>
<config>
    <modules>
        <Sequester_Custommodule>
        <active>true</active>
        <codePool>local</codePool>
        </Sequester_Custommodule>
    </modules>
</config>

And code in my app\code\local\Sequester\Custommodule\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Sequester_Custommodule>
            <version>0.1.0</version>    <!-- Version of module -->
        </Sequester_Custommodule>
    </modules>
    <frontend>
        <routers>
            <custommodule>
                <use>standard</use>
                <args>
                    <module>Sequester_Custommodule</module>
                    <frontName>custommodule</frontName>
                </args>
            </custommodule>
        </routers>
         <layout>
            <updates>
                <custommodule>
                    <file>custommodule.xml</file> <!-- Our layout file name-->
                </custommodule>
            </updates>
         </layout>
    </frontend>
    <global>
        <blocks>
            <custommodule>
                <class>Sequester_Custommodule_Block</class>
            </custommodule>
        </blocks>
    </global>
</config>

And code for app\code\local\Sequester\Custommodule\controllers\IndexController.php

<?php
class Sequester_Custommodule_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }

}

And code in app\code\local\Sequester\Custommodule\Block\Custommodule.php

<?php
class Sequester_Custommodule_Block_Custommodule extends Mage_Core_Block_Template
{
    public function myfunction()
    {

        echo "hello World";

    }
}

And code for my app\design\frontend\rwd\default\layout\custommodule.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addCss"><stylesheet>css/jquery.bxslider.css</stylesheet></action>
            <action method="addJs"><script>customslider/jquery.bxslider.js</script></action>
            <action method="addJs"><script>customslider/slider_custom_script.js</script></action>
        </reference>
    </default>
    <cms_index_index>
        <reference name="content">
            <block type="custommodule/custommodule" name="custommodule" template="custommodule/custommodule.phtml" />
        </reference>
    </cms_index_index>
</layout>

And in my Template file I called the slider images statically from skin folder but I want to give an option of uploading images from admin panel and this images will store in database table and then I want to fetch this images to used for slider .

I am first time trying to build a extension So please anyone can help me in any help will be appreciated


texts: Strange issue: Magento 2.2: Wrong placeholder for password field in checkout page

texts:
I have got a strange issue in Magento 2.2 (I have checked in Magento 2.2.3zzz and Magento 2.2.4).

When a non-logged in user enters email in the checkout page, it checks the existence of email and if the record is found, Magento shows the password field for login.

The placeholder for the password field shows optional, but when the user tries to login without entering a password, the validation fails and it shows "This is a required field." validation error.

Is this default problem in Magento or I have checked out a wrong repository?


texts: How to remove block conditionally in magento 2 using xml layouts

texts: The requirement is to remove some default blocks when my custom module is enabled. So how could I remove this blocks using the admin setting configuration values. I am not creating a block that should be shown based on configuration. I want to remove already added block in default layouts.


texts: Add column to order grid get error in customer page

texts:
I tried to add 2 new columns (shipping's company and billing's company) to orders page using a plugin,
but i got an error when trying to view customer's orders in customer page.

This is my plugin function

public function afterGetReport($subject, $collection, $requestName)
{
    if ($requestName !== 'sales_order_grid_data_source') {
        return $collection;
    }

    if ($collection->getMainTable() === $collection->getResource()->getTable('sales_order_grid')) {
        try {
            $orderAddressTableName           = $collection->getResource()->getTable('sales_order_address');
            //$directoryCountryRegionTableName = $collection->getResource()->getTable('directory_country_region');
            $collection->getSelect()->joinLeft(
                ['soat' => $orderAddressTableName],
                'soat.parent_id = main_table.entity_id AND soat.address_type = \'shipping\'' ,
                 [
                    'company_shipp' => 'company'
                ]
            );
            $collection->getSelect()->joinLeft(
                ['soat1' => $orderAddressTableName],
                'soat1.parent_id = main_table.entity_id AND soat1.address_type = \'billing\'',
                 [
                    'company_bill' => 'company'
                ]
            )->where();

         } catch (\Zend_Db_Select_Exception $selectException) {
            // Do nothing in that case
            $this->logger->log(100, $selectException);
         }
     }

     return $collection;
 }

My be my code is wrong to get both billing and shpping company in 2 custom columns,
But i got error
This is the error Column 'customer_id' in where clause is ambiguous, can i override the where in my function but how to get the customer?

  Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[23000]: Integrity    constraint violation: 1052 Column 'customer_id' in where clause is ambiguous,    query was: SELECT COUNT(*) FROM sales_order_grid AS main_table
      LEFT JOIN ggg_flags_order_flag AS amflags_column_1 ON    main_table.entity_id = amflags_column_1.order_id AND   amflags_column_1.column_id = 1
      LEFT JOIN ggg_flags_order_flag AS amflags_column_2 ON main_table.entity_id = amflags_column_2.order_id AND amflags_column_2.column_id = 2
      LEFT JOIN ggg_flags_order_flag AS amflags_column_3 ON  main_table.entity_id = amflags_column_3.order_id AND   amflags_column_3.column_id = 3
      LEFT JOIN ggg_flags_order_flag AS amflags_column_4 ON main_table.entity_id = amflags_column_4.order_id AND amflags_column_4.column_id = 4
      LEFT JOIN ggg_flags_order_flag AS amflags_column_5 ON main_table.entity_id = amflags_column_5.order_id AND amflags_column_5.column_id = 5
      LEFT JOIN ggg_flags_order_flag AS amflags_column_6 ON main_table.entity_id = amflags_column_6.order_id AND amflags_column_6.column_id = 6
      LEFT JOIN ggg_flags_order_flag AS amflags_column_7 ON main_table.entity_id = amflags_column_7.order_id AND amflags_column_7.column_id = 7
     LEFT JOIN ggg_flags_order_flag AS amflags_column_8 ON main_table.entity_id = amflags_column_8.order_id AND amflags_column_8.column_id = 8
      LEFT JOIN ggg_flags_order_flag AS amflags_column_9 ON main_table.entity_id = amflags_column_9.order_id AND amflags_column_9.column_id = 9
      LEFT JOIN ggg_flags_order_flag AS amflags_column_10 ON main_table.entity_id = amflags_column_10.order_id AND amflags_column_10.column_id = 10
      LEFT JOIN ggg_flags_order_flag AS amflags_column_11 ON main_table.entity_id = amflags_column_11.order_id AND amflags_column_11.column_id = 11
   LEFT JOIN sales_order_address AS soat ON soat.parent_id = main_table.entity_id
      LEFT JOIN sales_order_address AS soat1 ON soat1.parent_id = main_table.entity_id  WHERE (soat.address_type = 'shipping') AND (soat1.address_type = 'billing') AND (**customer_id** = '11617')


texts: How to remove country field from My Account address?

texts:
I tried,

For time being I am working on vendor folder later I will override custom module.

vendor/magento/module-customer/view/frontend/templates/address/edit.phtml

I removed country field from phtml file. It got removed from form but while saving I am getting countryId is required field error message.


texts: Magento 2 how do show cart summary in sidebar.additional

texts: I need to show products my customer already have in the cart in sidebar.additional with name products in the cart, qty, price (each product), and total cart. Something like order summary in onepage. how i do this?


texts: Unable to login first time to admin after installing Magento2

texts:
New installation of Magento2 on Ubuntu, the homepage and admin page loads, but doesn't accept the user/pass entered. There's no error message displayed either. Tried:

different browsers, clearing cache & cookies
timezone is correctly set on server.
resetting password directly from db

UPDATE admin_user SET password = MD5('NEWPASSWORD') WHERE username = 'ADMINUSERNAME';

Any help would be appreciated.


texts:
When you're overidding css, specifically scss in a theme, is it better to copy all the scss files to the new theme and make edits in those,
or create just one new custom scss file that contains the overrides?

Thanks!


texts:
I have a Magento store installed on localhost over WAMP server. I'm using Magento 1.7.

I need to do a table whose first column contains all the products from all the orders. I can't manage to get the product names; I found that there is more than one way to get product names from previous orders in Magento, but I'm not sure if I'm coding it properly.

My code for doing so is:

<?php
    $_orders = $this->getOrders();
    foreach ($_orders as $_order)
    {
        $items = $_order->getAllItems();
        foreach($items as $item) {$name = $item->getName();}
        echo $name;
    }
?>

Any ideas on what is wrong? Maybe I'm missing something or there is a better way to code it?

Any ideas/comments are much appreciated :-)


texts: I have made a trial magento site http://abhimanu.colourentice.com/magento and added some products from the backend. I had tried every possible solution on many sites but the problem does not solved "Enabled, Quantity and In stock". Is there anything i can do for it? I am new to magento and looking for some help.


texts: How to update Knockout using PHP window data with Ajax? - Magento 2.1

texts:
I have the following code which is working fine.
I want to update coupon Name, Description and Amount based on a coupon code name change.

This is my php file

use Magento\Checkout\Model\ConfigProviderInterface;

class CheckoutCouponDescriptionProvider implements ConfigProviderInterface
{
    protected $couponDescription;
    protected $couponName;

    public function __construct(
        \CompanyName\ModuleName\Block\Coupon $couponDescription,
        \Magento\Checkout\Block\Cart\Coupon $couponName
    ){
        $this->couponDescription = $couponDescription;
        $this->couponName = $couponName;
    }
    public function getConfig()
    {

        $config = [];
        $config['couponCouponName'] = $this->couponName->getCouponCode();
        $config['couponDiscountAmount'] = $this->couponDescription->getDiscountAmount();
        $config['couponDiscountDescription'] = $this->couponDescription->getDiscountDescription();

        return $config;
    }
}

and this is my discount.js file

define(
    [
        'jquery',
        'ko',
        'uiComponent',
        'Magento_Checkout/js/model/quote',
        'Magento_SalesRule/js/action/set-coupon-code',
        'Magento_SalesRule/js/action/cancel-coupon'
    ],
    function ($, ko, Component, quote, setCouponCodeAction, cancelCouponAction) {
        'use strict';

        var totals = quote.getTotals(),
            couponCode = ko.observable(null),
            isApplied,
            couponCouponName = ko.observable(null),
            couponDiscountAmount = ko.observable(null),
            couponDiscountDescription = ko.observable(null);

        if (totals()) {
            couponCode(totals()['coupon_code']);
        }

        isApplied = ko.observable(couponCode() != null);

        return Component.extend({

            initialize: function () {
                this._super();
                this.couponCouponName(window.checkoutConfig.couponCouponName);
                this.couponDiscountAmount(window.checkoutConfig.couponDiscountAmount);
                this.couponDiscountDescription(window.checkoutConfig.couponDiscountDescription);
                },

            defaults: {
                template: 'Magento_SalesRule/payment/discount'
            },
            couponCode: couponCode,
            couponCouponName: couponCouponName,
            couponDiscountAmount: couponDiscountAmount,
            couponDiscountDescription: couponDiscountDescription,

            /**
             * Applied flag
             */
            isApplied: isApplied,

            /**
             * Coupon code application procedure
             */
            apply: function() {
                if (this.validate()) {
                    setCouponCodeAction(couponCode(), isApplied);
                    console.log(couponCouponName());

                }
            },

            /**
             * Cancel using coupon
             */
            cancel: function() {
                if (this.validate()) {
                    couponCode('');
                    cancelCouponAction(isApplied);
                    console.log(couponDiscountDescription());
                }
            },

            /**
             * Coupon form validation
             *
             * @returns {Boolean}
             */
            validate: function () {
                var form = '#discount-form';

                return $(form).validation() && $(form).validation('isValid');
            }
        });
    }
);

edited few lines in .js file so it's more correct


texts: Add checkbox to toggle custom fee to checkout

texts:
What I am trying to do is exactly this module:
https://github.com/sivajik34/Custom-Fee-Magento2
This module adds custom fee to magento 2 and it also adds a checkbox to the checkout page. When the customer ticks the checkbox, it adds the custom fee to the cart. If not then the custom fee won't be added.
Could someone explain how it works in the Custom-Fee-Magento2 module. I can add the custom fee to my module but don't understand how to handle the checkbox functionality.
I am thinking of when ticking the checkbox, I use jquery to listen to that event then add a flag "isCheckboxChecked: true" to the Magento Session. And based on that boolean, I can decide whether or not to add the custom fee. But I don't know how to use jquery to modify the magento session.
This is the js file:
https://github.com/sivajik34/Custom-Fee-Magento2/blob/master/Sivajik34/CustomFee/view/frontend/web/js/view/checkout/shipping/custom-fee.js
This is the HTML containing the checkbox:
https://github.com/sivajik34/Custom-Fee-Magento2/blob/master/Sivajik34/CustomFee/view/frontend/web/template/checkout/shipping/custom-fee.html


texts:
I'm trying to send an email with payment information when the order is established with an offline payment method. Normally, Magento is sending the email when the payment is checked but I need to send an email when the order is placed and its status is "pending_payment".
Have somebody been working on this functionality and could give me any advice to reach it?
My Magento version is 2.3.5-p1


texts: Error during installation pdf generator extension via ssh

texts:
I am trying to install a pdf generator extension but Iihave an error ``(via composer)` from here: Github

I run below command:

>composer require eadesignro/module-pdfgenerator

then ask me about token then I generated the github token and typed.  I received the information that the token is correct and then the error:

  [RuntimeException]
  Failed to clone git@github.com:EaDesgin/magento2-pdf-generator2.git, git wa
  s not found, check that it is installed and in your PATH env.

  sh: git: command not found

anyone know how to solve it ?


texts: Debugging "Invalid return type" in generated code?

texts:
Is there a way to track down this error report?
stdClass Object
(
    [0] => Invalid return type
    [1] => #0 /home/maxxcou1/public_html/mag2/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#1 /home/maxxcou1/public_html/mag2/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()
#2 /home/maxxcou1/public_html/mag2/index.php(42): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#3 {main}
    [url] => /mag2/admin/amasty_paction/massaction/index/key/2f2b5793ff8167eb1d271f50b9837540854828b56d8a0e963069d44d700586af/
    [script_name] => /mag2/index.php
)

This occurs if I replace categories with Amasty extension, but it seems the problem is somewhere else. Tested extension on nearly plain magento and it works ...
Any ideas how to find the method, that causes Invalid return type?


texts: Magento 2.4 Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver does not exist

texts:
After upgrading to magento 2.4 from 2.3.5-p1 and running setup:di:compile, the following error occurs:
In ClassReader.php line 43:

  Class Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver does not exist

In ClassReader.php line 36:

  Class Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver does not exist

To track down the issue, I tried php bin/magento dev:di:info "Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver" and got the following:
DI configuration for the class Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver in the GLOBAL area

Preference: Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver

Constructor Parameters:

In ClassReader.php line 26:

  Class Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver does not exist

dev:di:info  <class>

I disabled all third party modules, and I have elasticsearch enabled. Not sure what else i can do besides trying a clean install of Magento 2.4. Is there anything further I can do to troubleshoot this?


texts:
I tried to reindex using SSH. Here is one of the commands I used -

php -f indexer.php --reindexall

and here is the result which i am getting -

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

  --status <indexer>            Show Indexer(s) Status
  --mode <indexer>              Show Indexer(s) Index Mode
  --mode-realtime <indexer>     Set index mode type "Update on Save"
  --mode-manual <indexer>       Set index mode type "Manual Update"
  --reindex <indexer>           Reindex Data
  info                          Show allowed indexers
  reindexall                    Reindex Data by all indexers
  help


texts: No Payment method available when Total is 0

texts:
My Subtotal was US$218.00.
I tried to checkout using Store Credit and Rewards points.
Reward point balance: $1.31
Store Credit Balance: $216.69
after only applied the Reward point tick my Total reduce to US$216.69 [218.00-1.31]
remaining balance covered by using a store credit.
When store credit balance exactly same as total, didn't show any payment method. but store credit greater than total, then showed the order Place Option.
Note : I Enabled Zero Subtotal Checkout Module
If Store Credit balance,
216.69 - didn't show Place Order Option

216.70 - showed Place Order Option

Please Check attached Screenshots


texts: Observing a generic event, but ignoring most instances

texts:
Is it bad practice to listen for a common event, but then to filter out all but a tiny number of those events?

As an example, say I want to modify a particular block. I can listen for the core_layout_block_create_after event, filter out the particular block I'm interested in and make my changes. However, this seems really inefficient if the block I'm working with is only loaded infrequently, because its on an obscure page. The core_layout_block_create_after event can be fired up to 60 times on some pages, which will incur the overhead of the observer function call and my filtering logic, just for those events to be ignored.

I've been examining the core code for guidance, but cannot see any event filtering. Observers in the core code either listen for very specific events that are fired infrequently, or if they listen for a more frequently fired generic event, they take action every time its fired rather than filtering out only the version of the event they are interesting in.

Thinking about it, if you were a core developer who had written an observer that listened for a generic event and filtered out all the versions you weren't interested in, then you could just go and add a specific event to the core code which met your needs. This might explain why the core observers don't appear to filter events.

Reviewing the core code also shows that some really common generic events, such as core_layout_block_create_after, core_abstract_load_after, catalog_category_load_after and core_collection_abstract_load_after are never listened for by core code. The only reason for these events to exist is to provide places for third party code to hook into. The generic nature of these events must mean that core developers anticipated third party developers filtering out the versions of the events they were interested in.

Whilst my instinct is to use observers when possible and never override core files because of the potential for future conflicts, I'm wondering if there are occasions where overriding an obscure core block would be the better choice.


texts: Changing Custom theme color in Magento 2

texts:
MY custom theme extends Magento Blank theme.Following this link,
http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css-practice.html
I added _theme.less in my css/source folder & placed the code provided on above link in it.Flushed the cache.
But still changes are not reflecting on my site.

Am I missing something?


texts: Set all associated product not visible individually

texts: how can I set all associated products in a group product be set 'not visible individually' in bulk?


texts:
Using Magrento 2.3
Admin back-end 404 Error after saved.

  404 Error Page not found.

Need to refresh can save everytime, how to fix it? Thank you


texts: How to Change the position of breadcrumbs in list page?

texts:
I want to display the breadcrumbs in list page alone to display inside the grid exactly just above the toolbar.

So I entered this line of code:

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

just above the line :

<?php echo $this->getToolbarHtml() ?>

in app/design/frontend/<package>/<theme>/template/catalog/list.phtml.

But nothing is getting displayed.

I want to change the position of breadcrumbs only in list page.
Why the above procedure not working. Is there anything wrong to use getChildHtml() to call block like this?


texts: Empty Attributes values shows NO, N/A and NA - How can i hide no data attribute

texts: Some of my attributes has no data, but shows as na, n/a and no. How can i remove that.


texts: Magento CE and SUPEE-8967 filename implies EE?

texts:
I need to patch a Magento CE installation with [SUPEE-8967]

  https://magento.com/tech-resources/download?_ga=2.17348479.775257066.1494499183-1580976029.1489398169#download2005

The downloaded file is named PATCH_SUPEE-8967_EE_1.13.1.0_v1-2017-05-02-04-21-21.sh.

That EE worries me: how can I be sure that this will work on CE too and it's not a SNAFU from the release team?


texts:
I run several websites with a "responsive" template. The thing is, the template is not really responsive....(And the developpers have dropped support on it...)
the mobile stylesheet seems completely messed up. You can see by yourself on https://www.oxyform.be.
Is there a way to fix this ? (other than set up a new theme :/ )
Thank you for guiding me.


texts: Image Uploader in Dynamic Rows Ui Component not saved since Magento 2.3.3

texts:
I made a module using dynamic rows component with imageUploader field inside. I was able to upload my image on the Magento 2.3.2, but since the new release (2.3.3), I can't pass the valideFileId() method in the class \Magento\Framework\File\Uploader.

If I take a look at the valideFileId() method, here is what I see :

private function validateFileId(array $fileId): void
    {
        $isValid = false;
        if (isset($fileId['tmp_name'])) {
            $tmpName = trim($fileId['tmp_name']);

            if (preg_match('/\.\.(\\\|\/)/', $tmpName) !== 1) {
                $allowedFolders = [
                    sys_get_temp_dir(),
                    $this->directoryList->getPath(DirectoryList::MEDIA),
                    $this->directoryList->getPath(DirectoryList::VAR_DIR),
                    $this->directoryList->getPath(DirectoryList::TMP),
                    $this->directoryList->getPath(DirectoryList::UPLOAD),
                ];

                $disallowedFolders = [
                    $this->directoryList->getPath(DirectoryList::LOG),
                ];

                foreach ($allowedFolders as $allowedFolder) {
                    if (stripos($tmpName, $allowedFolder) === 0) {
                        $isValid = true;
                        break;
                    }
                }

                foreach ($disallowedFolders as $disallowedFolder) {
                    if (stripos($tmpName, $disallowedFolder) === 0) {
                        $isValid = false;
                        break;
                    }
                }
            }
        }

        if (!$isValid) {
            throw new \InvalidArgumentException(
                __('Invalid parameter given. A valid $fileId[tmp_name] is expected.')
            );
        }
    }

This private method is called from the _setUploadFileId() which is called in the constructor.

Here is this method on Magento 2.3.2:

 private function _setUploadFileId($fileId)
    {
        if (is_array($fileId)) {
            $this->_uploadType = self::MULTIPLE_STYLE;
            $this->_file = $fileId;
        } else {
            if (empty($_FILES)) {
                throw new \Exception('$_FILES array is empty');
            }

and now on Magento 2.3.3:

private function _setUploadFileId($fileId)
    {
       if (is_array($fileId)) {
            $this->validateFileId($fileId);
            $this->_uploadType = self::MULTIPLE_STYLE;
            $this->_file = $fileId;
        } else {
            if (empty($_FILES)) {
                throw new \DomainException('$_FILES array is empty');
            }

Here is the data that I send:

array(5) {
  ["name"]=>
  string(9) "image1.jpg"
  ["type"]=>
  string(10) "image/jpeg"
  ["tmp_name"]=>
  string(26) "/private/var/tmp/phpbPsgJz"
  ["error"]=>
  int(0)
  ["size"]=>
  int(72987)
}

Here is how I get my data:

$result = $this->imageUploader->saveFileToTmpDir($imageId);

imageUploader being the class \Magento\Catalog\Model\ImageUploader

My tmp_name is "/private/var/tmp/phpbPsgJz"

I run my project on Mac Os.
Thanks for your help.


texts: Long Running Admin Page Requests Blocking Other Requests

texts:
If I'm logged into Magento's backend and perform some task that takes a long time (global search on large catalogs, long running dataflow, etc), my web browser will refuse to load other admin pages in that browser only.  Why does this happen, and is there any known science for workarounds?

That is, if I

Log into Magento's dashboard page
Open a second tab with any Magento admin page
Perform a long running global search (simulated with a call to sleep(30) at the start of globalSearchAction) in the first tab
Attempt to reload the second tab

Expected Behavior: Second tab loads with page contents immediately

Actual Behavior: Second tab only loads once the long running global search completes

Does anyone know, specifically, why this happens?  (My guess is Magento admin console requests lock some resource Magento needs to bootstrap, but I don't know what that is)

Does anyone know of a fix/workaround?


texts: Add value to Magento 2 email sales template

texts: I'm using m2epro and need to add to the email subject channel order ID which is coming from eBay. I can see this variable under payment/additional_fields/channel_order_id. What will be the exact line to add it? I'm using {{var payment/additional_fields.getchannel_order_id}} but doesn't work. Please help. Thanks!


texts: how to add custom data with product name in invoice email

texts:
i want to add brand name with product name in invoice email. when i check the email/order/invoice/item.phtml.i see this .

<?php echo $this->getItemHtml($_item) ?>

how to change to get my required data. any help will be appreciated.


texts: Magento2: How to compile custom payment module

texts:
I am new to magento, currently working on a custom payment module created by another Developer. I am facting hard time to understand module.

This module has A drop-down List before placing order, But I change the option, it is not Displaying updated list, I could see old List.

I have tried below

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

But non of this worked. i whated to know how I can compile the module.

Please check this question I Could not able to Fix this problem.


texts: Getting payment information from outside magento as on order view page

texts: I want to get the payment information for the related payment method as in the order view page "payment information" tab. I want to run custom query outside Magento to get these information.


texts: get all disabled products in current category

texts:
How do I get all disabled products in the current category

<?php
    $categoryIds = array(956);//category id
    $products = Mage::getResourceModel('catalog/product_collection')
    ->addCategoryFilter(Mage::getModel('catalog/category')->load($categoryIds));
    $collection = Mage::getModel('catalog/product')->getCollection()
        ->addFieldToFilter('entity_id', array('in' => $products->getAllIds()))
    ->addAttributeToSelect('*');
 ->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_DISABLED);

?>


texts: Magento 2 How to change the Tracking Information Shipment # to Order # in Tracking Popup

texts:
The tracking popup shows shipment # and I want to change it to the order number. I have found this answer for Magento 1:
$_order = Mage::getModel('sales/order')->load($this->getOrderId());

But I don't know how to use this in Magento 2.
Can someone tell me how to use it?


texts: Magento 2 - How to add custom css files into the head?

texts:
In Magento 1.x, I can add the CSS files into the head using the helper
  like below code.

<reference name="head">
    <action method="addCss"><stylesheet helper="module/helperclass/helperfunction"/></action>
</reference>

  Anyone know how to do this in Magento 2?


texts: Saving custom product attribute from edit page in Magento 2.1

texts:
I've created a custom menu item for the product edit page, and now I'm trying to save it.

The string "theducksflyatmidnight" appears nowhere in the database after saving. I've also stepped through my save-product observer with a debugger, and I can't find "theducksflyatmidnight" anywhere within the product object.

I've been studying some Vendor/Module/Setup code in Magento 2 core. Do I have to specify my custom attribute there? And then it will be saved upon saving the product?


texts: Magento 2: change the design of minicart and cart popup

texts:
I am having png image. It should be act us mini-cart and i need to change the design of cart popup.

I don't know the paths for that.


texts: Desactivate Symlinks in Magento 2 for Docker

texts:
I'm trying to install a Magento 2 instance in a Docker context.
The problem is that symlinks are not allowed in this context.

Is there any alternative to symlinks ? Or maybe, is there a way to desactivate them ?

Thank you in advance.


texts: Enable 'Use in Advanced Search' option of product attribute for only one multi-site

texts:
Reposting this question in a more appropriate SO site.
I am using Magento 1.6.2 and has configured multi-site to run different shops.
I tried to add custom attribute to products but the new attribute shows up on Advanced Search page for all multi sites.
I want the new custom attribute to be available only for one multi-site.
AFAIK, 'Use in Advanced Search' option of attribute property does not allow me to disable it for specific stores.
Is there a way to enable 'Use in Advanced Search' selectively for a multi-site?
Looking at code it seems like the attribute list is generated by getAttributes() inside Mage_CatalogSearch_Model_Advanced class.
I could see there is a addStoreFilter inside Mage_Catalog_Model_Resource_Product_Collection but I cant figure out how to create/use such a filter for Mage_Catalog_Model_Resource_Product_Attribute_Collection
From Mage_CatalogSearch_Model_Advanced

public function getAttributes()
{
    /* @var $attributes Mage_Catalog_Model_Resource_Eav_Resource_Product_Attribute_Collection */
    $attributes = $this->getData('attributes');
    if (is_null($attributes)) {
        $product = Mage::getModel('catalog/product');
        $attributes = Mage::getResourceModel('catalog/product_attribute_collection')
            ->addHasOptionsFilter()
            ->addDisplayInAdvancedSearchFilter()
            ->addStoreLabel(Mage::app()->getStore()->getId())
            ->setOrder('main_table.attribute_id', 'asc')
            ->load();
        foreach ($attributes as $attribute) {
            $attribute->setEntity($product->getResource());
        }
        $this->setData('attributes', $attributes);
    }
    return $attributes;
}

Any help would be greatly appreciated. Thanks.


texts: Checkout style state / country dropdown select

texts:
I want to add a style to the country or state dropdown in the checkout page, how I can add a style for the option on :hover for example?

.opc-index-index .opc-wrapper-opc .form-list select {
    -moz-appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 1) url("../img/down_arrow.png") no-repeat scroll right 5px center;
    border: 1px solid #d8d8d8;
    color: black;
    font-family: "Muli",sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 4px;
    max-width: 100%;
    padding: 12px 20px;
    width: 100%;
}

.opc-index-index .opc-wrapper-opc .form-list select:focus{
background: rgba(212,212,212,1) url("../img/down_arrow.png") no-repeat scroll right 5px center;
color: white
}

.opc-index-index .opc-wrapper-opc .form-list select:focus{
background: rgba(177,177,177,1) url("../img/down_arrow.png") no-repeat scroll right 5px center;
color: white
}

Product view page:

*<?php echo $_attribute->getLabel() ?>

    <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>

            <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
                <option><?php echo $this->__('Choose an Option...') ?></option>
              </select>


texts: How can i use code from other pages into current page?

texts:
a question what can be useful to know is
how to use code from other pages into the current page you
are working on?

e.g. I want to echo the total product count of the search query on
list.phtml

Currently the product count is used in the pager/toolbar.phtml:

<?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?>

Now when i try this in list.phtml it's not working.
 How can i get that to work?


texts:
On the product detail page I need to use the price for calculation. How can I get the price and use it for calculation?

For example; $product_price / 12 = $outcome


texts: How we can transfer the Database data to magento 1.9 to Magento 2 stable. As lots of tool available but did not find any useful detail about migration. Does any one tried to migrate data. What kind of step need to perform. I tried Ubertheme tool but did not work


texts: Magento 2.4.2 Elasticsearch Error: main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query

texts:
Elasticsearch not working with main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query. I have tested the connection in the backend and it's showing successfull. But on the front-end in the catalog search, no result is showing. I have checked in exception.log and the following error is showing:

main.CRITICAL:
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed
to create query: {   "bool" : {
"must" : [
{
"terms" : {
"visibility" : [
"3",
"4"
],
"boost" : 1.0
}
}
],
"should" : [
{
"match" : {
"_search" : {
"query" : "sams sams",
"operator" : "OR",
"prefix_length" : 0,
"max_expansions" : 50,
"fuzzy_transpositions" : true,
"lenient" : false,
"zero_terms_query" : "NONE",
"auto_generate_synonyms_phrase_query" : true,
"boost" : 2.0
}
}
},
{
"match" : {
"name" : {
"query" : "sams sams",
"operator" : "OR",
"prefix_length" : 0,
"max_expansions" : 50,
"fuzzy_transpositions" : true,
"lenient" : false,
"zero_terms_query" : "NONE",
"auto_generate_synonyms_phrase_query" : true,
"boost" : 2.0
}
}
}, ..........................   }\ }","index_uuid":"fMJ-vmT5Qu2_9PX3yJvMsw","index":"digi_live_product_1_v6","caused_by":{"type":"number_format_exception","reason":"For
input string: \"sams sams\""}}}]},"status":400} at
vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"}
[]

I have tried every possible way like restart elastic search and reindex Magento but not working.
Magento version: 2.4.2
Elasticsearch version: 7.6
Any help is much appreciated!!


texts: Saving custom payment field data in magento 2 through plugin not working,

texts:
I am trying to save my custom field data through plugin but it's not working.

Plugin Class

namespace Vendor\Module\Model\Checkout;

class PaymentInformationManagementPlugin {

    protected $paymentMethodManagement;

    public function __construct(
        \Magento\Quote\Model\QuoteFactory $quote,
        \Magento\Quote\Api\PaymentMethodManagementInterface $paymentMethodManagement
    ) {
        $this->paymentMethodManagement = $paymentMethodManagement;
        $this->quoteManagement = $quoteManagement;
    }

    public function beforeSavePaymentInformation(
        \Magento\Checkout\Model\PaymentInformationManagement $subject,
$cartId,
        \Magento\Quote\Api\Data\PaymentInterface $paymentInformation
    ) {
        //$paymentInformation->getData('extension_attributes');
        $extenstinAttributes = $paymentInformation->getExtensionAttributes();
        $taxCode = $extenstinAttributes->getTaxCode();

        $paymentInformation->setExtensionAttributes($taxCode);
        $this->paymentMethodManagement->set($cartId, $paymentInformation);

        return true;
//        var_dump($taxCode);exit;
//        $quote=$this->quote->create();
//        $quote->getPayment()->setData('tax_code',$taxCode);
//        return $paymentInformation;
    }

}

extenstion_attribute.xml

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

di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Model\PaymentInformationManagement">
        <plugin name="save-in-quote-payment" type="Vendor\Module\Model\Checkout\PaymentInformationManagementPlugin" sortOrder="12349"/>
    </type>
</config>

Can anyone please help me on this.


texts:
I've read through a lot of the posts about 404s after installing SUPEE 6788 and really have tried to replicate the steps for this extension (GTSpeed) but I have been unable to action the correct steps to get this working.

I hope someone can help me?

I used the SUPEE 6788 tool and it identified the following :

Found route tag 'gtspeed'. Original route XML:

<gtspeed>
   <use>admin</use>
   <args>
      <module>GT_Speed</module>
      <frontName>gtspeed</frontName>
   </args>
</gtspeed>

To be replaced with:

<adminhtml>
   <args>
      <modules>
         <gtspeed before="Mage_Adminhtml">GT_Speed_Adminhtml</gtspeed>
      </modules>
    </args>
</adminhtml>

So I went ahead and did the above change to config.xml

Then it also identified:

ERROR: /home/psadmin99/public_html/ps-test/app/code/community/GT/Speed/controllers/Adminhtml does not exist! This module's admin routes must be corrected manually.

So I made the following folder and put the file that was once in the controllers folder into this new folder:

/app/code/community/GT/Speed/controllers/Adminhtml/gtspeed/InfoController.php

But I'm not sure what to do next?

Any help would be greatly appreciated!!!


texts: Tax duplication and incorrectly displayed

texts:
Every now and then it seems I get a tax duplication issue. I ship within Canada so I have all provinces and territory rules setup for my taxes.

After a few purchases, what ends up happening is that the taxes for 1 province will be displayed multiple times and then sometimes display taxes for another province as well.

Example:

For the province of Quebec the TPS and TVQ are to be displayed, but for some reason GST-BC and PST-BC are being displayed and showing inaccurate calculations; however the calculations for the TPS and TVQ are actually the correct total.

The other strange issue is that the same break downs are reflected under the Sales order leading me to the Magento database.

If I go into the database and delete all references to TVQ and TPS in (sales_order_tax) then all subsequent orders have the correct break down. Old orders that were not from the province of Quebec (TPS and TVQ) are lost however.

What steps can be performed to keep this from happening?

Is this a known issue?


texts: Magento 2: how to programatically set free shipping from an observer?

texts:
I need to set free shipping in observer, under certain very specific conditions. I can't have free shipping enabled in the back end because customers shouldn't be able to select it.

I already tried these things with no success:

1) set free shipping on address directly in observer. It changes to true but on next call it reverts back to false(0) when checked with getFreeShipping

$address = $quote->getShippingAddress();
$address->setFreeShipping(true);

2) Magento\Quote\Model\Quote\Address:985 requestShippingRates method. Hard-code

$request->setFreeShipping(true);

3) Magento\Quote\Model\Quote\Address\FreeShipping:16 Replace return false with true. This method looks unfinished by the way.

4) Magento\Quote\Model\Quote\Address\Total\Shipping:159. Hard-code:

$address->setFreeShipping(true);

It's equivalent to attempt number 3.

None of these worked. I would appreciate any suggestions. What can I try next? Which class to override?

This is a 'duplicate' of Magento 1 questions:

How to set a custom free shipping amount for each quote?
Programmatically set free shipping from an observer


texts:
I seem to be struggling to grasp Magento 2 dependency injection with blocks, every time I try to extend a block that isn't \Magento\Framework\View\Element\Template I end up with errors.

I want to create a block that extends the very basic block class of Magento\Theme\Block\Html\Header\Logo - everything works fine until I try dependency injection within the construct method:

<?php

namespace Creare\Test\Block\Header;

class Logo extends \Magento\Theme\Block\Html\Header\Logo
{

    protected $_creareHelper;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Creare\Seo\Helper\Data $creareHelper,
        array $data = []
    )
    {
        $this->_creareHelper = $creareHelper;
        parent::__construct($context, $data);
    }
}

As soon as I try to inject my helper class (or anything else for that matter, I get a stack trace starting with the following error:

Recoverable Error: Argument 2 passed to Magento\Theme\Block\Html\Header\Logo::__construct() must be an instance of Magento\MediaStorage\Helper\File\Storage\Database, array given, called in /Users/adammoss/PhpstormProjects/Magento2/app/code/Creare/Test/Block/Header/Logo.php on line 17 and defined in /Users/adammoss/PhpstormProjects/Magento2/app/code/Magento/Theme/Block/Html/Header/Logo.php on line 33

If I add the same dependencies to my __construct as the file I'm extending from it works, but surely that's a backwards way of doing things as the point of class inheritance is that I absorb all of the parent's methods and properties?

I think I just need a basic 101 explanation from someone on extending from classes and using DI with Magento 2. Any help much appreciated!


texts:
I have found that the less files are not compiling in my custom theme. at all. originally I discovered the problem when I made changes to my _extend. less file and no changes occurred, but now I have found that none of the .less files in my app/...web/source/CSS folder are compiling after the first loading of my website.

After downloading a fresh backup, I immediately made some changes to the CSS before opening the website online. this worked, but any consequent changes had no impact. I reversed the changes I had made and re-loaded the page by opening a new window. This reverted my original change, but any time after this no change is evident.

I am using xampp, with Magento 2.3.0 installed.

I have tried every fix found on this website and regular stack overflow, including clearing the cache, var folders and more using both commands and straight-up deleting the folders.

Please help.


texts:
I have a Magento 2 Installation in which everything appears to be working fine except products will not add to the cart. The add to cart button appears to do nothing at all. I am getting the following error in console from knockout.js file line:3012

Uncaught TypeError: Unable to process binding "css: function (){return { empty:cart().summary_count == 0} }"
Message: cart is not a function

Has anyone experienced anything similar? I cannot find any documentation on similar issues with Magento2.

Thanks


texts: Discount on grouped product in magento 2

texts: I am using magento 2.3.5. and I created one group product with a combine of 3 simple products. now I want to give an offer of a group product. so how I can create the promotion for the group product?


texts:
I have downloaded and installed the latest version of Magento 2 on my localhost, i have made a custom theme and now my problem is that i can't change any css ! I have created my css file in /app/design/frontend/Vendor/Themename/web/css/style.css and included it in Vendor/themename/Magento_Theme/layout/default_head_blocks.xml like this:

    <?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">
    <head>
        <css src="css/style.css" />
    </head>
</page>

After this I tried this command:

php -dmemory_limit=6G bin/magento setup:static-content:deploy ro_RO

I got this in the console:

    Running "less:themename" (less) task
File pub/static/frontend/Vendor/themename/ro_RO/css/styles-m.css created: 284.76
kB → 491.43 kB
File pub/static/frontend/Vendor/themename/ro_RO/css/styles-l.css created: 51.08 k
B → 90 kB

Done, without errors.

Still nothing on frontend, i tried this command too:
    grunt less:themename
No changes on frontend. Does anybody have an idea why this is not working ?


texts: Using multiple repositories in same session causing a loss of data

texts:
I have the following code that should create 2 simple products and a product relation. When adding a link via the link repository it seems to get rid of the stock from a product. This is not just limited to link repositories; adding a website via the website repository also has the same effect.

Code I'm using is similar to the below but correctly pushed through the constructor in my case.

Does anyone have any ideas of how to get around it / or can see if I'm doing anything wrong?

    /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
    $productRepository = $this->_objectManager->create('\Magento\Catalog\Api\ProductRepositoryInterface');

    /** @var \Magento\Catalog\Api\Data\ProductLinkInterface $productLink */
    $productLink = $this->_objectManager->create('\Magento\Catalog\Api\Data\ProductLinkInterface');

    /** @var \Magento\Catalog\Api\ProductLinkRepositoryInterface $productLinkRepository */
    $productLinkRepository = $this->_objectManager->create('\Magento\Catalog\Api\ProductLinkRepositoryInterface');

    for($i = 1; $i <= 2; $i++ ) {
        /** @var \Magento\Catalog\Api\Data\ProductInterface $product */
        $product = $this->_objectManager->create('\Magento\Catalog\Api\Data\ProductInterface');
        $product->setSku('test_sku_' . $i);
        $product->setName('Test Product ' . $i);
        $product->setAttributeSetId(4);
        $product->setPrice(5);
        $product->setTypeId('simple');

        /** @var \Magento\CatalogInventory\Api\Data\StockItemInterface $stockItem */
        $stockItem = $this->_objectManager->create('\Magento\CatalogInventory\Api\Data\StockItemInterface');
        $stockItem->setIsInStock(true);
        $stockItem->setQty(50);

        /** @var \Magento\Catalog\Api\Data\ProductExtensionFactory $productExtensionFactory */
        $productExtensionFactory = $this->_objectManager->create('\Magento\Catalog\Api\Data\ProductExtensionFactory');
        $productExtension = $product->getExtensionAttributes();
        if ($productExtension === null) {
            $productExtension = $productExtensionFactory->create();
        }

        $productExtension->setStockItem($stockItem);
        $product->setExtensionAttributes($productExtension);

        $productRepository->save($product);
    }

    // If the code is exited here; the products are created with stock.

    // Related products one and two
    $productLink->setSku('test_sku_1');
    $productLink->setLinkedProductSku('test_sku_2');
    $productLink->setLinkType('related');
    $productLink->setLinkedProductType('simple');
    $productLink->setPosition(1);
    $productLinkRepository->save($productLink);


texts:
Is there a way to block a user, when he constant enter a search query?
I mean in a inhuman kind of way (say 10 hits per sec).

Thanks!


texts: sectionLoadUrl error while updating cart price total Magento 2

texts:
I am updating the cart total price dynamically without page reload.
I wrote code in js file

require(
[
    'Magento_Checkout/js/model/cart/cache',
    'Magento_Checkout/js/model/cart/totals-processor/default',
    'Magento_Checkout/js/model/quote'
],
function (cartCache, totalsProcessor, quote) {
    var form = jQuery('#discount-coupon-form');
    jQuery.ajax(
        {
            type: "POST",
            url: form.attr('action'),
            data: form.serialize(),
            success: function (response) {
                console.log(response);
                cartCache.clear('cartVersion');
                totalsProcessor.estimateTotals(quote.shippingAddress());
            }
        }
    );
 }
)();

But i get this error in my chrome console,

customer-data.js:89 Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined
at Object.getFromServer (customer-data.js:89)
at Object.reload (customer-data.js:353)
at totals.js:26
at Object.execCb (require.js:1650)
at Module.check (require.js:866)
at Module.<anonymous> (require.js:1113)
at require.js:132
at require.js:1156
at each (require.js:57)
at Module.emit (require.js:1155)

How to fix this.


texts: Move store to alternative location on same server

texts:
I want to move my store to a different location on the current server and keep it accessible for myself only. I will launch a new store at the same time.

The problem I have is that I cannot seem to access the store after creating a clone/duplicate (with new database), because it always redirects to the live store. (I don't want to take the live store down before I get the it to work as described above).

After duplicating the store to domains/www.mydomain.com/newlocation/ I have changed the domain in DB core_config_data and cleared all cache and sessions in \var. Still it keeps redirecting. Would make sense if the .htaccess would have something to do with it, but even after completely making it empty it still redirects. I'm out of ideas...


texts: Configurable Product stays on "in stock"

texts:
I'm working with Channable and my configurable products need to go to "out of stock" when the simple products are sold out.

But the still be on "in stock".
At the catalog configuration, the quantity is on 0.

Does anyone know where I can change it?


texts:
Print Address / Shipping Label For Magento 2

We searched the module for address label print and we found the mls print module. We saw the good reviews on their site and purchased that module.

After purchasing the module there code is not user interface and total decoded. There is no chance to add the some extra code.

That module is showing the licence error and that module functionality is not working on my cloud server. So we raised a ticket to support team and they suggested to change the some vendor files. So we asked the same thing to support team but there is no response. We requested the refund still there is no response. So there is no chance to give this review. Please check this before purchasing MLX modules

https://www.mlx-store.com/faqs/how-to-fix-compile-magento-source.html


texts:
I know this is not a technical question but i didn't find and better place to ask.

Basically we have a client who is intending to build a website for 16 countries. He is asking for multiple website.

I have dealt with multiple website in magento previously but they were just 3-4 websites. Here i need to deal with 16.

Can anyone please tell me what challenges will be faced especially the database. Can someone point out the pros and cons of it.


texts: Import new custom less files after grunt configuration

texts:
I am using grunt tool for magento server-side less preprocessing.

I have created _extend.less file following directory structure for my custom less compilation

  app\design\frontend\Vendorname\themename\web\css\source\ _extend.less

After all necessary configurations of grunt I managed to compile my own less files with the grunt command

grunt less:themename

Now everything works perfectly except when I am trying to add new .less file into _extend.less through @import directive grunt doesn't publish it's symlinks to

  pub\static\frontend\Vendorname\themename\en_US\css

For example after I import _custom_button.less in _extend.less with

@import '_custom_button.less';

Now everytime I add new files with @import I have to run the commands.

grunt clean:themename
grunt exec:themename

So this workflow is conflicting when working with developers as it cleans everything in pub\static\frontend\Magento\themename\en_US
directory.So that is the problem.I don't want to run clean command again.

Can I do anything for that?


texts: Having upgraded Magento via connect manager from 1.9.2.4 to 1.9.3.1 ALL was good and patched. I installed a search extension and site looked distorted, I quickly rolled back and files and database. Now I can't update because it says the version is already 1.9.3.1. But backend shows 1.9.2.4 and is missing the patches included in 1.9.3.1


texts: hide cms block on checkout page if customer logged in

texts:
I want to hide my CMS block if customer is logged in. This is how my block is added to OPC page via local.xml file.

<opc_index_index>
    <reference name="content">
        <block type="cms/block" name="cart_sinup" before="_">
            <action method="setBlockId">
                <block_id>signup</block_id>
            </action>
        </block>
    </reference>
</opc_index_index>

Note: I cannot use <customer_logged_in> because I want this only in opc_index_index page.