texts: Magento 1.8 some orders are giving white screen

texts:
After migrating from 1.7 to 1.8, i get a white screen with some orders.
If i check for page source, at the very end i have

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

  /chroot/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php
  on line 64"

I have enabled logs and in system.log i have:

2014-02-09T12:00:58+00:00 DEBUG (7): XML_ERROR: <config/>
2014-02-09T12:00:59+00:00 DEBUG (7): XML_ERROR: <config/>
2014-02-09T12:00:59+00:00 DEBUG (7): XML_ERROR: <config/>
2014-02-09T12:01:00+00:00 DEBUG (7): XML_ERROR: <?xml version="1.0"?><jstranslator></jstranslator>
2014-02-09T12:01:00+00:00 DEBUG (7): XML_ERROR: <?xml version="1.0"?><config></config>
2014-02-09T12:01:08+00:00 DEBUG (7): XML_ERROR: <config/>
2014-02-09T12:01:08+00:00 DEBUG (7): XML_ERROR: <config/>
2014-02-09T12:01:09+00:00 DEBUG (7): XML_ERROR: <config/>

I have tried to disable each module i use, but error still pops up.

I would apreciate some help.

Thank you


texts: Magento 2 Enterprise Cloud edition: How to set product as new?

texts:
I am working on a Magento 2 Enterprise Cloud Edition project and stuck in a big problem.

I want to show some products in the list of new products in the home page, but I am not able to set product as new.

I found that there is a checkbox named as Set Product as New, but when I check that checkbox and save product, the value of the checkbox is not getting saved.

Please see attached screenshot for reference:

Is this a bug in Magento 2 Enterprise Cloud Edition or am I missing something?

In Magento 2 community edition, there are 2 fields (namely Set Product as New From and Set Product as New To) to set the product as new, but in Magento 2 ECE, I could not find such fields.

Please guide me how can I set the product as new?


texts: How to get website/store id in the cms blocks/pages Magento2

texts:
I'm checking this for long time but couldn't get this.I would like to display the website id through the magento cms block/pages.Without calling it from phtml's.

Thanks in Advance.


texts: Magento 2 Add Image To cart API response object

texts:
Magento 2 how to add image url for the rest api's called V1/carts/mine & V1/carts/cartId

Please find the below screenshots.

Please suggest me thanks.


texts: Magento2 failed to open stream: Permission denied

texts:
I have an error in a Magento 2 store and I cannot fix it. On homepage appears this:

 Error filtering template: Warning: imagepng(/var/www/domain/pub/media/e**hemes/resized/frontend/e**hemes/slideshow/b/a/image-1.png): failed to open stream: Permission denied in /var/www/domain/vendor/magento/framework/Image/Adapter/Gd2.php on line 181

File permisions are 777 on media and other subdirectories, also php-gd ..installed.

image-1.png can be accessed directly on browser.

Server Centos, Nginx, PHP 7


texts: I enabled less compilation mode to client side, after that I am getting error, how can I resolve

texts:
I enabled less compilation mode from server to client side, after that I am getting error.
I tried putting magento in different modes.
and I also tried this solution but it didn't worked.


texts:
I followed this to create an invoice for an order and it worked. But the created newly invoice is marked as paid. Can I created it as unpaid?

$invoice = $order->prepareInvoice();
$invoice->register();
Mage::getModel('core/resource_transaction')
    ->addObject($invoice)
    ->addObject($invoice->getOrder())
    ->save();
$invoice->sendEmail(true, '');
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();


texts: Show attribute only if product is in category A

texts:
Hello i am working on my Magento 1.9 checkout (order review) and i want to display the attribute "color" only if the product bought is a t-shirt but not if its something else...
Here is the code i use until now - its without the category check:

<?php $_item = $this->getItem() ?>
<?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
<?php echo 'Artikelnummer: '.$_product->getResource()->getAttribute('COLOR')->getFrontend()->getValue($_product).'
'; ?>

But i have problems with the category check, my first approach was to set the category-ids and then check for them, if they match then display the attribute:

$CategoryIds = array(3,4);
$productCategory = $_product->getAvailableInCategories();
if (count(array_intersect($CategoryIds,$productCategory))) {
        $_item = $this->getItem();
$_product= Mage::getSingleton('catalog/product')->load($_item->getProductId());
echo 'Artikelnummer: '.$_product->getResource()->getAttribute('COLOR')->getFrontend()->getValue($_product).'
';
}

The problem is, that this code doesn't work - it just woun't load the last checkout step.

If someone could help me, i would be very thankfull!

Thanks,
Daniel


texts: 1.9.3 - Catalog > Manage Products > Show Price including tax (backend)

texts:
In the catalog manager and products manager the prices all show as excluding tax.

This behaviour is correct but in Australia we mostly read prices as a whole (inc tax) and break the tax out in invoices.

The front end is displaying correctly as it shows the inc tax for the price but in the admin (backend) the price shows as the ex price.
I was wanting to know if you can add another line that shows the inc price below the ex. price or comment out ex price and just show inc price.

magento 1.9.3 CE

Also have Products Manager (Advanced) installed but it follows the same behaviour.

I am not sure if this needs to be coded or if there is a configuration setting.  I have tried looking for the answer but most are concerned with the front end.

Any help would be grand.

Cheers


texts: Can we clear inventory_reservation table. Magento2.3.1

texts: I have recently upgraded to 2.3.1 and noticed that some of the salable quantities do not match the actual quantities. I make sure that there are not more pending or processing orders and that everything is complete. Is it ok to delete the reservations? Would it cause any problems?


texts: How to edit the footer panel existing in admin page of magento

texts: I want to know that how can I edit the footer panel of admin page. I could not locate any answer for that. Please help


texts: Using Magento's method="removeItem" to remove js ONLY for IE8 and below

texts:
Does anyone know why the following doesn't work for removing items from IE8 and below, but does work for adding items?

<action method="removeItem">
    <type>skin_js</type>
    <name>notforIE8.js</name>
    <params/>
    <if>lt IE 9</if>
</action>

It removes the js file in all browsers.


texts: Adding filterable attribute to layered navigation, invisible on product page

texts:
I know that you can add a drop down to your product pages with attributes like color and size.

What I would like to do is make some products on my site filterable through layered navigation without anything appearing on the product page.

For example.

Size: Full sized (100)
      Half sized (25).

  Is there a way to do this through vanilla Magento? or

  does it require some custom coding/module?


texts: magento 2 for particular products tax is not applying

texts:
In my Magento 2, tax rates are not applying for some products.

I have no issue with tax class because it's applying for other products.

Is there any setting? please help me!!


texts: Change the URL that integrations use in Magento 2

texts:
I'm Currently using Magento 2.3.4 and have a WAF setup which essentially functions as a reverse-proxy, which means that the integrations will not connect due to the site pointing to a different I.P. address.
As a workaround the WAF provider (Sucuri) has suggested setting up a subdomain on the server which points to the correct I.P address and have the integrations connect through that instead.
I have set up the subdomain now but I am not sure how to get Magento 2 to connect the Integrations to the site through the subdomain rather than the primary domain.
Does anyone know which setting I would need to change to allow this to happen?


texts: Uncaught HeadlessChromium\Exception\JavascriptException: Error during javascript evaluation: TypeError: Cannot read property 'outerHTML' of undefined

texts:
All I'm trying with the try catch block in the code below is to let the script run without having it to stop on a fatal error. Exception handling doesn't seem to work since the fatal error displays on the screen. Please point out what is with the exception handling.
    try {
    $evaluation = $page->evaluate('document.getElementsByClassName("item-views-option-color")[0].outerHTML');
} catch (Exception $ex) {
    $error_message = "***ERROR*** Either Page not found/Swatch doesn't exist on the page " . $e->getMessage();
    //echo $error_message;
}


texts: Performance problems with list.phtml? May be configurable attributes?

texts:
we have created a store (Magento 1.9.0.1) and

have heavy performance problems with category-listing and detail-pages.

we use an layered navigation and swatches - so i think there must be a problem?

We have 90% of the products are configurable products with round about 1-6 simple products in every configurable. The configurable attribute is just 1 (size) - but the attribute-set is only one for all products. The attribute-set has about 40-50 attributes (some of them filterable).

If I check the profiler - the list.phtml has about 16 seconds to load. Shown are 12 products on the category-page.

Does anybody have an idea where i could optimize something?


texts: How to count "in stock" and also "out of stock" in layered navigation as per attribute in magento 2

texts:
I am trying to show count for all products "in stock" and also "out of stocks" in sidebar.

I used bellow code but its not working.

$size = $productCollection->getSize();
$itemData[] = [
                'label' => $this->tagFilter->filter($option['label']),
                'value' => $value,
                'count' => $size
            ];


texts:
I want to preselect the checkbox based on the data but checkbox are not getting preselected not sure why.

Below is the code.

Knockout

 salesPerson: ko.observableArray([
                { itemName: 'Choice 1' ,checked:true },
                { itemName: 'Choice 2' ,checked:false}
            ]),
 chosenSalesPersons: ko.observableArray()

HTML Code

                        <input type="checkbox" data-bind="checkedValue: $data, checked: $parent.chosenSalesPersons" />


texts: How to write to Sql Server Db on sales_order_place_after trigger

texts:
I am trying to develop a module that inserts a new row in a Sql Server database (different from magento Mysql databse) with the info from the newplaced order. This is what i have so far:

in magento/app/etc/modules/Feed_Sales.xml:

<?xml version="1.0"?>
<config>
     <modules>
         <Feed_Sales>
             <codePool>local</codePool>
            <active>true</active>
         </Feed_Sales>
     </modules>
</config>

in magento/app/code/local/Feed/Sales/etc/config.xml:

<?xml version="1.0"?>
<config>
    <global>
        <models>
            <feedsales>
                <class>Feed_Sales_Model</class>
            </feedsales>
        </models>
        <events>
            <sales_order_place_after>
                    <observers>
                    <feed_sales_order_observer>
                        <type>singleton</type>
                        <class>feedsales/order_observer</class>
                        <method>export_new_order</method>
                    </feed_sales_order_observer>
                </observers>
            </sales_order_place_after>
        </events>
    </global>
</config>

in magento/app/code/local/Feed/Sales/Model/Order/Observer.php:

<?php
class Feed_Sales_Model_Order_Observer{
    public function __contruct(){

    }

    public function export_new_order($observer){

        $server = 'Example,3320;'
        $link = mssql_connect($server, 'sa', 'password');

        if (!$link) {
            die('Something went wrong while connecting to MSSQL');
        }

        $event = $observer->getEvent();
        $order = $event->getOrder();
        $order_no = (string) $order->getRealOrderId();
        $order->loadByIncrementId($order_no);
        $items = $order->getAllVisibleItems();
        $query = "INSERT INTO Order  (id,customerName,address, etc) VALUES
            ('$order_no', Values to pass)";
        $result = mssql_query($query,$link);

        foreach($items as $i):
            $query = "INSERT INTO OrderItem (orderNumber,name,price,quantity)     VALUES
                ('$order_no',Values to pass)";
            $result = mssql_query($query,$link)
        endforeach;
    }
}
?>

I also need help in knowing how can i access all the details from $order so I can send them to the apropriate fieldsin my database, and the details of $i for the same purpose.


texts: Call layer filter in Custom Design in Category

texts: I need some custom list file so i used in this way. Here how to call filter. This is 1column.phtml


texts: Magento 2 : Add tooltip to shipping methods

texts:
Can I add a tooltip to each shipping method in Magento 2? If so, how?
I need to display additional information to each shipping method say place of origin. I cannot seem to add a column to the shipping methods. I do not need to save this information to the database.

Is there a way to display some information when we shipping method is chosen?

Any help would be greatly appreciated. Thanks!


texts:
since the magentocommerce board isn't available for new topics I give it a try on StackExchange.

Today we received an order from a "blocked" country (not allowed via country options). Our customer entered a valid, allowed shipping address but an address from a "not allowed" country for the billing-address. My questions is: can we fully deny (shipping- and billing-address) orders from "not allowed" countries or is there something just misconfigured?
The main problem with such a behaviour is, that we just have a tax-table for allowed countries, disallowed countries will get an incorrect, tax-free, bill.

We're using Magento CE 1.8.1.0.

Thanks in advance.


texts: how to convert custom page url like pageurl.html in magento 2?

texts:
I have a custom module page url like this: www.example.com/style/index/content/id/19/
I want to convert this url like this:  www.example.stylecontent.html with same content.
I have tried url rewrite but not getting success. can anyone help me to create this one?

I don't want to use admin url rewrite.

I am using this code:
ma


texts: Change Shipping Method based on weight and destination

texts:
I couldn't find a good solid answer for my scenario so forgive me if this has been asked. (I googled and checked the suggested questions when asking)

Anyways, I have a client that wants anything over 10 ounces to be USPS Priority Mail, and any international order to only show USPS Priority Mail International. All the options are highlighted in the back end and I am kind of stumped as this doesn't seem like an issue I was really hired to deal with...

Regardless, is there some way I can use table rate shipping or something so that I can do something similar to this psuedo code:

if weight greater than 10 ounces
shipping method = USPS Priority

if destination NOT in US
shipping method = USPS Priority International

To be honest, I don't even know the difference between shipping methods. (Who physically mails things nowadays? :P ) But, that's what the client wants, can anyone point me in the direction of accomplishing this?

Much thanks in advance! :)

EDIT: On some larger orders, USPS doesn't even show up as an option during checkout. Is it because of weight?


texts: Pdf Packing Slip - add subtotal for simple product

texts:
I need to display the prices of the purchased products on the packing slip. I managed to display it for bundle products, but for the simple products it's always showing $0,00.

I was trying to do the same as in the onvoice pdf, cause there it works. So I was using the same call as in \app\code\core\Mage\Sales\Model\Order\Pdf\Items\Invoice\Default.php where it says :

    // draw item Prices
    $i = 0;
    $prices = $this->getItemPricesForDisplay();
    foreach ($prices as $priceData){

        /* draw Subtotal */
        $lines[$i][] = array(
            'text'  => $priceData['subtotal'],
            'feed'  => 520,
            'align' => 'right'
        );
        $i++;
    }

The getItemPricesForDisplay()function is defined within app\code\core\Mage\Sales\Model\Order\Pdf\Items\Abstract.php. So I used the same code for getting the prices in the app\code\core\Mage\Sales\Model\Order\Pdf\Items\Shipment\Default.php but it's always returning 0,00.

Why is that? Do I have to change something or do it completely different to get the price of that product in the packing slip?


texts: How to change the position of a product in a category

texts:
As the title says, i want to change the position of a single product in category. The only think i have found is this method setPostedProducts. But it sets for all products, which is useless for me. Because it will take a long time until i get respons.
The code looks like this now.
foreach($o["categories"] as $cats) {
        $cat = $cats;
        if(isset($this->categoryList[$cat["path"]]) && !empty($this->categoryList[$cat["path"]])) {

            try {
                $category = $this->catRepo->get($this->categoryList[$cat["path"]]);
                $productPositions = $category->getProductsPosition();

                $productPositions[$product->getId()] = $cat["position"];

                $category->setPostedProducts($productPositions);
                $this->catRepo->save($category);
            } catch(\Exception $e) {
                $this->logger->info("error updating category position for " . $sku);
                $this->logger->info($e->getMessage());
            }
        } else {
            continue;
        }
    }

This method updates the position for all products.


texts: Which is the best module to import/export automatically with cron

texts:
I am looking for a module which can permit me import & export by creating or updating if exist already :

- product
- customer
- stock
- attributes of product (import only)
- categories (import only)

Using a cron for importation and exportation.
Can you advice me for the best module import/export update and create with cron compatible with Magento 1.9 and version 2

Thanks


texts: magento 1.9 CE error when duplicating a product

texts:
When I use the method to duplicate an object sometimes I get this error message, the product is created:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-0-0-1-4-24884-0' for key 'KEY', query was: INSERT INTO `etpq_catalogrule_product` (`rule_id`,`from_time`,`to_time`,`website_id`,`customer_group_id`,`product_id`,`action_operator`,`action_amount`,`action_stop`,`sort_order`,`sub_simple_action`,`sub_discount_amount`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

This is how I duplicate a product and I associate it to a configurable:

try {
    $configurable = Mage::getModel( 'catalog/product')->load( '2456' );
    $childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds( $configurable->getId() )[0];
    $id= $childIds[0];
    //duplicate this product
    $child = Mage::getModel( 'catalog/product' )->load( $id );
    //echo 'chid: ' . $child->getId() . '<br />';

    $duplicated = $child->duplicate();
    // reload duplicated
    $duplicated = Mage::getModel( 'catalog/product' )->load( $duplicated->getId() );
    $duplicated
        ->setDescription( 'dummy' )
        ->setName( 'dummy - ' . $configurable->getName() )
        ->setTitle( 'dummy - ' . $configurable->getName() )
        ->setStatus( Mage_Catalog_Model_Product_Status::STATUS_DISABLED )
        ->setSku( 'dummy-' . $configurable->getSku() );
    $duplicated->save();

    $childIds[] = $duplicated->getId();
    Mage::getResourceSingleton('catalog/product_type_configurable')->saveProducts( $configurable, $childIds );
    $configurable->setData( 'status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED );
    $configurable->getResource()->saveAttribute( $configurable, 'status' );
    return TRUE;
}
catch ( Exception $e ) {
    Mage::log( $e->getMessage() );
    return FALSE;
}


texts:
Is there a direct link to the sample data for CE 1.9.1/1.9.2?

I'm trying to download it directly to the servers using wget but the links on http://devdocs.magento.com/guides/m1x/ce18-ee113/ht_magento-ce-sample.data.html are broken and the normal download page has a user interface that hides the link.

My local internet connection is slow enough for the download to take about 20 minutes and the upload will probably take well over an hour.


texts:
When I do a GET request on a product, M2 returns some custom attributes that I have no interest in, such as 'is_recurring'. Is it possible to 'disable' a custom attribute so it does not appear in product GET requests?

Thanks!


texts: Set Shipping Address via Magento 2 REST API

texts:
I have a JS application where I create a cart object with items and an associated gift-message. I would like to set the shipping (and billing) address for the order and am using the following endpoint:

POST /V1/carts/mine/shipping-information

However it asks me for the following two fields in addition to the address.

"shippingMethodCode": "string"
"shippingCarrierCode": "string"

Where do I get these codes from?

The request is:

{
   "addressInformation": {
      "shippingAddress": {
         "city": "New York City",
         "country_id": "US",
         "firstname": "someone",
         "lastname": "something",
         "postcode": "11756",
         "region_code": "NY",
         "street": [
            "address01",
            "address02"
         ],
         "telephone": "1111111111"
      },

     "shippingCarrierCode": "usps"
     "shippingMethodCode": "free"
   }
}

The explicit error is:

{
  status: 404,
  data: Object
    message: "Carrier with such method not found: %1, %2"
    parameters: Array[2]
      0: "usps"
      1: "free"
}

I have looked at

Stores > Configure > Sales > Shipping

but do not see these codes. When I try to request the codes using

GET /V1/carts/mine/shipping-methods

It tells me I need to set an address first.

As a follow up, is there any resource out there that provides some best-pracitices when it comes to using the Magento 2 REST API to perform a cart checkout order?

Thanks for all the help and pointers


texts: Currency not correctly converting when using currency switcher

texts:
I am following below reference to use currency dropdown in my project.

http://inchoo.net/magento/how-to-add-currency-selector-to-magentos-header/

Currently in my site both default and base currency is set to Indian Rupee .

Let's say there is a product of ₹60, if I change currency to USD using switcher, price should be showing $0.90, instead it is showing as ₹3976.20 which is multiplied with currency rate.

Any hints?

I am using Magento 1.9.2

Screenshots1:

Screenshots2:


texts: How to get option_id of an option by label? (magento 2)

texts:
I want to get the option_id of one of the options on an attribute, but I only know the label of the option (by label, I mean the 'value' column in eav_attribute_option_value).

How can I get it?

Right now I have the following code:

/**  @var \Magento\Catalog\Model\Product\Attribute\Repository $productAttributeRepository */

$options = $productAttributeRepository->get('treadwidth')->getOptions();

foreach ($options as $option) {
    var_dump($option->getValue());  // option_id
    var_dump($option->getLabel());  // value
}

In other words, it is possible for me to loop through each option and check if the option_id matches the one I want, but I wan't to do this directly. Is it possible?


texts: Magento2 : Child theme catalog module layot xml is not overrided

texts:
I have created two themes first is parent and second is a child to change the design of product page.

I want to set different layout for some product layout so I have created the child themes. A child theme inherits from its parent theme.

I have to override the layout in a child it is taking on parent layout it is not taking the child theme layout.

Please give an idea if anyone gets this.

Following is the theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Child themes</title>
     <parent>Magento/Parent</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

And i want to change the catalog_category_view.xml layout for child theme. All the templates files are overwriting but layout file are not working.


texts: Add content to second column on "Contact Us" page

texts: I've been editing the standard magento contact us page.  Mine is using the 2-column-left.phtml template being called through the contacts.xml.  On my contact page the standard form is being populated in column 1, but the second column isn't being used.  How would I go about adding some basic html content to that second column?


texts:
I had configured magento tax for EU countries.
Now my client wants the same taxes applied for all countries in the world.

There is a faster way to set a dafault tax rule for all countries than create a specific rule for each country?


texts: I want to create dependent custom options with each custom option, where after clicking on the button, it will open popup and drop-down options and their values will be available to add, excluding current option and its values! I have created popup and options there. I did this from custom options provider file, and the component file is added to create options, but now I want to exclude current option from dropdown.


texts:
Is there a way to have back end model for group of fields in system.xml

I need to validate two fields. But their validations rules depends on each other.

Thanks.


texts: Magento 2: How to override footer CSS class in Blank theme?

texts:
I've already extended some styles from Blank theme, however I haven't been able to override styles from class:

.footer.content ul > li

In my theme, I created a custom block in the footer. I can see in firebug that my CSS rules are loaded, however they are not applied since the default magento class .footer.content ul > li takes priority over my styles.

If I disable the styles in firebug from .footer.content ul > li then my styles are applied.


texts: How to allow AUTO height in Mage::helper('catalog/image')->init($product, 'image')->resize(); Function?

texts:
How to allow AUTO height in resize function?

Mage::helper('catalog/image')->init($product, 'image')->resize();


texts:
We are having a URL issues

For Example -

If Title = Bose® SoundLink™ 10 Wireless Music System

Then URL = bose-soundlink-10-wireless-music-system

But in our new website URL is - boser-soundlinktm-10-wireless-music-system

We need Bose® = bose and SoundLink™ = soundlink

How to exclude ® ™ signs in URL

Please suggest!

Thanks


texts: Magento2 REST API - Cannot create cart/quote for customer

texts:
I am building a shoppingcart using the Magento2 Rest API and I want to create a cart for a customer and (if not logged in) for a guest.

For guest carts is it working:

  Create a guestcart:

  POST /V1/guest-carts returns :cartId

  Get guestcart:

  GET /V1/guest-carts/:cartId returns cartObject

Fine so far, but for a customer who is logged in (using a customerToken) it doesn't work:

  Create a customercart (using the customertoken):

  POST /V1/carts/mine returns [message] => Cannot create quote

So i tried this workaround (using API token) but it returns the same message:

  Create a customercart (using the API token):

  POST /V1/customers/:customerId/carts returns [message] => Cannot create quote

I get the same result for different customers.

Does anyone has a clue?

Using Magento 2.2.5

TRACE

0 [internal function]: Magento\Quote\Model\QuoteManagement->createEmptyCartForCustomer(3)

1 /vendor/magento/module-webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)

2 /vendor/magento/module-webapi/Controller/Rest.php(239): Magento\Webapi\Controller\Rest->processApiRequest()

3 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))

4 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent(dispatch, Array)

5 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))

6 /generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)

7 /vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

8 generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()

9 /vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()

10 index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))


texts: "Fatal error: Call to a member function getSummaryHtml() on a non-object in Abstract.php on line 319"

texts:
Fatal error: Call to a member function getSummaryHtml() on a non-object in /usr/local/apache2/htdocs/app/code/core/Mage/Catalog/Block/Product/Abstract.php on line 319

/**
 * Get product reviews summary
 *
 * @param Mage_Catalog_Model_Product $product
 * @param bool $templateType
 * @param bool $displayIfNoReviews
 * @return string
 */

public function getReviewsSummaryHtml(Mage_Catalog_Model_Product $product, $templateType = false, $displayIfNoReviews = false)
{
    if ($this->_initReviewsHelperBlock()) {
        return $this->_reviewsHelperBlock->getSummaryHtml($product, $templateType, $displayIfNoReviews);
    }

    return '';
}


texts:
I have a product that needs to have two drop-downs. I have it set up like this in admin:

However when it renders on the page, both of the drop-downs have the values from each other. Is this normal behaviour? I can't find anyone else experiencing this same issue. If I change one of them to checkboxes then the values are correct. It only seems to be happening when there are multiple drop-downs.


texts: How to disable stock management for one of the assigned sources on a product? Multi Source platform setup

texts:
I am running a multi-source setup on Magento 2.3 platform.
I create two different stock sources and assigned them to a product in my catalogue as such:

I would like to disable stock management for "Stock Source 1", however, keep the stock management for "Stock Source 2". Is this possible with out the box Magento functionality? "Advanced Inventory" settings seem to be global rather than per stock source.


texts: Storing multi-value custom product attribute

texts:
I have a custom attribute for my products called 'car_model'. This is a multi-value field. Now I try to create a synchronization script to synchronize this data between Magento and another system. I start off with getting all products:

ini_set('display_errors',1);
require('app/Mage.php');
umask(0);
Mage::app();

$collection = Mage::getModel('catalog/product')->getCollection();

//fetch name and orig_price into data
$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('car_model');
$products = array();
foreach ($collection as $product) {
    $product = Mage::getModel('catalog/product')->load($product->getId());

    $product_id = $product->getId();
    $sku = $product->getSku();
    $product_name = $product->getData('name');
    $model = $product->getAttributeText('car_model');

    $products[$sku] = array('product_id'=>$product_id, 'model' => $model, 'modified' =>  false, 'product' => $product);
}

The $model variable contains the correct (text) values, so no problem there.

Then I do some hocus pocus to get what needs to be updated which resulted in the following code to save the products:

foreach($products as $sku=>$product) {
    if($product['modified']) {
        $attr = $product['product']->getResource()->getAttribute('car_model');
        //$models = array();
        foreach($product['model'] as $m) {
            $option_id = $attr->getSource()->getOptionId($m);
            //$models[$option_id] = $m;
            $product['product']->setData('car_model', $option_id);
    //       $product['product']->addAttributeUpdate('car_model', $option_id);
        }
       try {
            //$product['product']->setData('car_model', $models);
            //$product['product']->addAttributeUpdate('car_model', $option_id);
            //$product['product']->save();
            $product['product']->getResource()->saveAttribute($product['product'], 'car_model');
            echo "Set product " . $product['product_id'] . " " . $sku . " to " . implode(",",$product['model']) . "
";
       } catch(Exception $e) {
            echo 'failed updating product ' . $product['product_id'] . ' with message: ' . $e->getMessage() . '
';
       }
    }
}

As you can see from the commented lines I tried many different things, but it doesn't want to save the attributes correctly. From what I understand I need to call setData('car_model', $option_id) multiple times for all values. When I retrieve the product after saving though, I only get one value returned.

Furthermore, when I go to the backend, the values are not selected. I tried reindexing and clearing the cache (also emptying var/cache), but this doesn't make any difference. It seems like a basic thing to do, but somehow I don't get it to work. Any thoughts?


texts:
I have created a module which has a Tests.php file.

I wanted to run this execute() method from Tests.php class to be executed once every Day.

I have created a Corn job, But it is Not Executing as expected, please check my code and point me where I am missing.

Please let me know how I can call the Method from a

  app\code\Autosynch\synchProduct\registration.php

<?php /**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Autosynch_synchProduct',
__DIR__
);

  \app\code\Autosynch\synchProduct\etc\crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="custom_cronjob" instance="Autosynch\synchProduct\Cron\Tests" method="execute">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>

  \app\code\Autosynch\synchProduct\Cron\Tests.php

<?php
namespace Autosynch\synchProduct\Cron;
use \Psr\Log\LoggerInterface;

class Tests {
    protected $logger;

    public function __construct(LoggerInterface $logger) {
        $this->logger = $logger;
    }

/**
   * Write to system.log
   *
   * @return void
   */

    public function execute() {
        $this->logger->info('Cron Works');
    }

}

Here is the database snapshot.


texts: I want to display my custom module table data in front page (Magento 2)

texts:
<?php

namespace WebQillaModule\FinalModule\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $setup->getConnection()
            ->addColumn(
                $setup->getTable('first_table'),
                'Date',
                 \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
                null,
                'Post Date'
            );

        $setup->getConnection()
            ->addColumn(
                $setup->getTable('first_table'),
                'Logo',
                 \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                null,
                'Post Logo'
        );

        $setup->endSetup();

    }
}

I added these new 2 new fields in my table first table how to show these in front end page of this custom module


texts: Mail is not received and this error shows in log

texts:
I'm using Dotmailer with Magento 2.2.2

exception 'Zend_Mail_Protocol_Exception' with message 'Connection timed
out' in /var/www/theuniquestore/lib/Zend/Mail/Protocol/Abstract.php:277


texts: Magento 2 Varnish cache compilation failed

texts:
I configuring the Varnish cache in Magento 2.3(CE), for that I've gone through the below link.

https://www.emiprotechnologies.com/technical_notes/magento-technical-notes-60/post/magento2-install-and-configure-varnish-cache-with-https-in-ubuntu-641

So based on this, I have done everything in my localhost. Moreover, I am not using any HTTPS & SSL.

Now my localhost URL as follows: http://127.0.0.1:8080.

Then using the following commands, I am checking the Varnish status

sudo service varnish restart - working fine
sudo service varnish status - Error: VCL Compilation failed

For your further reference herewith I've attached the error screen.

Currently Installed Varnish Version


texts: Change translated strings from language file

texts:
first time I'm using Magento2 and I had to change the default language of frontend to Greek.

I followed the guide from Mageplaza Installing via composer and after I deployed, it worked like a charm. The issue is that some strings are translated a bit weird and I wanted to change the translations for them. I cant find where I could override those translations with my own strings. I thought that deploying the file would create a .csv file somewhere inside the project and the only one I find is the one inside vendor/ folder ( which obviously I wont edit ) and the one at /app/design/frontend/Smartwave/porto/i18n/el_GR.csv which overrides the strings from Theme.

How I could override the translations from the ./vendor/mageplaza/magento-2-greek-language-pack/github_contributions.csv and ./vendor/mageplaza/magento-2-greek-language-pack/el_GR.csv


texts: What's the better way to set an initial customer increment id?

texts:
This SO Question has two answers:

Set the AUTO_INCREMENT for the customer_entity table.
Set the increment_prefix and increment_last_id for the customer entity in the entity_store table.

The second seems more correct (or at least more internally consistent with Magento), but it doesn't seem to work as far as I can tell. I've tried it multiple times with different configurations (with store_id 0, store_id 1 and setting the increment_per_store in eav_entity_type to 1 for customer), but each time I register as a new customer that customer's increment_id remains NULL and the entity_id increments from 1.

I'm reasonably sure the AUTO_INCREMENT approach will work, but given the fact that the increment_last_id works for order numbers, the second approach has a number of upvotes and seems more Magento-like I'd like to understand if that answer is more correct and I'm just doing it wrong.


texts: Error in Magento 2.1.5 Component Install

texts: I am installing a magento 2 extension for the first time while installing it continuesly saying Update is already in progress. I am not sure what is the problem. Magento cron is set properly and readiness check is passed


texts: how to create custom layout page in custom theme

texts:
I want to create a custom page layout in my custom theme.
I have created a custom theme named "ktheme" with a parent theme. I created cutome_home.xml in the layout folder but I am just getting a blank home page.

How can I get the header to display on the home page?


texts: Programmatically Remove Associated Products From Grouped Product

texts:
I have a grouped product and am looking to remove all associated products from it programmatically. I tried using a similar method as one would use for a configurable product found here:

How to remove associated products from configurable product?

But there is no comparable saveProducts() method for grouped products because there is no resource 'catalog/product_type_grouped'. I've tried to follow the saveAction method used in Adminhtml/controllers/catalog/product/ProductController, but haven't found the piece of code that saves the associated products selected in the admin form.

Could anyone point me in the right direction?


texts: How to access widget configuration options in Block class?

texts:
Although there's a similar question asked, it doesn't have an answer as the comment there refers to a question which has a comment that shows how to access the admin panel configuration parameters in the template file which works fine for me (i.e. $this->getData('config_param_name');).
The issue is that the $data array injected in the Block class constructor is empty when inserting it via Magento admin -> Content -> Widgets -> Add widget -> Layout update while it has the Widget configuration options (widget options in admin panel) when the widget is inserted via Content -> Page -> (select page) -> Insert widget as tested via xdebug.
I need to check against the configuration options in the Block class and do conditional logic, so accessing the parameters from template file is too late in the call stack.
<?php

declare(strict_types = 1);

namespace Company\SomeWidget\Block\Widget;

use Magento\Framework\View\Element\Template;
use Magento\Cms\Api\PageRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Widget\Block\BlockInterface;

class SomeWidgetBlock extends Template implements BlockInterface
{
    /** @var string  */
    protected $_template = 'Company_SomeWidget::template.phtml';

    protected $_param1;

    protected $_param2;

    /** @var PageRepositoryInterface */
    protected PageRepositoryInterface $_pageRepository;

    /** @var SearchCriteriaBuilder */
    protected SearchCriteriaBuilder $_searchBuilder;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        PageRepositoryInterface $pageRepositoryInterface,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        array $data = [] // <-- This is empty when widget is inserted via layout update
    ) {
        parent::__construct($context, $data);

        $this->_pageRepository = $pageRepositoryInterface;
        $this->_searchBuilder = $searchCriteriaBuilder;
        $this->_param1 = $this->getData('param_1');
        $this->_param2 = $this->getData('param_2');
    }
}


texts:
I want to set the cookie lifetime in my phtml file.

I am using the following code:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cookieManager = $objectManager->get('Magento\Framework\Stdlib\CookieManagerInterface');
$cookieMetadataFactory = \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory::getInstance();
$cookie_lifetime = (90 * 60);//90 days
$cookie_metadata = $cookieMetadataFactory->createPublicCookieMetadata()->setDuration($cookie_lifetime);
$cookieManager->setPublicCookie('cookie1', 'value', $cookie_metadata);

I get this error:

  Call to undefined method
  Magento\Framework\Stdlib\Cookie\CookieMetadataFactory::getInstance()

So, is there no getInstance method? What can I use instead?


texts: Magento 1.8.x: Validate 'Add to Cart' Button on Category View

texts:
I'm trying to add form validation on the category view and to show error message on the category page.

Currently, if there's an error it will redirect you to the product view page and display the error.

For example, if you try to add more Qty of a product than is available from the category view, it will redirect you to the product view with the following error message:

  The requested quantity for "X Product" is not available.

How would I perform this validation and display error message on the Category view without redirecting to Product view?

Here is my current code in list.phtml to add product to cart:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form">
    <input type="number" class="required-entry" name="qty" id="qty" value="1" min="1" max="<?php echo $stock ?>" />
    <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button medium primary" onclick="this.form.submit()">Add to Cart</button>
</form>


texts: How to pass url in this format - https://test.com/test/test.html/15?

texts:
I have a dropdown on Menu bar called Offers. In that 3 options are there
1. 15%
2. 2%
3. 3%
On onchange I want to sent current URL alongwith parameters.
Suppose current url = https://test.com/test/test.html

I have passed url in this format
https://test.com/test/test.html?param=15

1) But I want to pass url in this format - https://test.com/test/test.html/15
I tried in this format i.e https://test.com/test/test.html/15 but it is redirecting to index.php page.

2) Is this is the right way to pass parameters - https://test.com/test/test.html?param=15


texts: How does Magento 2's GraphQL implementation parse Schema Directives?

texts:
So in my company we're stuck with Magento 1 (and will be for at least a few more years) and we're using its SOAP API for our internal systems, but we're facing the issue of slowness and duplicate endpoints for returning different set of data.
As a result, I'm currently experimenting with a GraphQL extension for M1 using the webonyx/graphql-php package and I want to make it usable in other different extensions, and since Magento 2 already has GraphQL support I was using it as a resource to learn how it's implemented, so far I'm really liking it and I understood a lot, but It's been a few days already that I'm stuck in directives parsing. I know that M2 "stitches" the schema.graphqls of all modules and parses it as a one schema (in lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader.php), but I can not find any code that looks to be parsing the directives. Right now I'm getting a Unknown directive "<directive name>" error which makes sense, but I wanna know how it is implemented in M2 before trying my own way.
I would appreciate if any one can help or guide me to the direction where I should be looking.
Thanks in advance


texts: How to include custom customer attribute in to magento admin customer grid?

texts:
I added customer mobile no while customer register in the registration page.

The created mobile no is attribute stored in eav_attribute table with entity_type_id 1.

I tried to add these field in the admin grid view on the customer page.

I edit the grid.php file and adding these lines to grid.php

$this->addColumn('Telephone', array(
        'header'    => Mage::helper('customer')->__('Telephone'),
        'width'     => '100',
        'index'     => 'billing_telephone'
    ));
$this->addColumn('mobile', array(
        'header'    => Mage::helper('customer')->__('Mobile'),
        'width'     => '100',
        'index'     => 'mobile'
    ));

The label is shown in the view after Telephone, but the value for the mobile no is not retrieved in the grid.
How can i retrieve the value of mobile number in the grid?


texts: Magento 2 display sum of 2 column value of same record

texts:
I am creating grid using ui component.
I'm creating it successfully.

But i want to display sum of two column in single field
something like, I have 2 column (stotal , rtotal),
so i want to display sum of stotal and r total in one custom column called total.

Anyone have solution for this?


texts: Magento 2 Website taking too much time to load?

texts:
I have created a website using Magento 2.1.12, after that, I have added some categories and products from the Magento backend.

Is it taking too much time to load the front site as well as the admin portal?

Is anyone having the solution to reduce the loading time?

Thanks in advance!.


texts:
I extended Magento_Catalog in a custom theme and added the following block:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="product.info.main">
            <block class="Magento\Framework\View\Element\Template" name="lvluplink" after="product.info.price" template="Magento_Catalog::customline.phtml" />
        </referenceContainer>

</page>

the template:

<?= __('Custom Button') ?>

The link shows up in the store, but clicking the link does nothing. I am running Magento 2.3.4 in developer mode and have run:

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:clean
bin/magento cache:flush


texts: Magento 2: Exclude Google ReCaptcha for specific forms

texts:
We are using Google ReCaptcha for signup forms. We have created some more custom forms for which we would like to exclude the validation. Currently the re-catpcha is not showing in the form but on submit it gives error message "Invalid ReCaptcha validation"
The form is added as a CMS page where it includes the {{block}}


texts:
I just create a custom module on Magento 2.0.7.
I have a block that reads a custom folder
Example:

$files = scandir('_product_updates');

And everything works.
Now, I create a cron, that should read the same folder. I have the same code there:

$files = scandir('_product_updates');

But the cron is throwing an exception :

  'ErrorException' with message 'scandir('_product_updates'): failed to
  open dir: No such file or directory

Why, I can read like this on a block, but not in a cron?

My module structure:

The folder with files, that I want to read is outside the module, in the same level that app folder.

Any clue?


texts: HomePage not loading sometimes properly magento 2

texts:
Homepage renders like this sometimes, js merged, cache flushed dont know whats going on.

Link to the website, 911customtest.com
If loads properly load it on private browser.


texts:
I have an observer for sales_order_save_before

The custom message shows when the user is logged in, but throws the generic message if they are a guest. Does anyone know why this is happening?


texts: Paypal Standard payment not redirecting to Magento Success page after Payment complete

texts:
I am facing problem with paypal standard payment.

Everything is fine until success page. When customer complete payment. Then paypal is not redirecting to Magento success page. It is still is in Paypal page. But charging from customer Paypal account and no payment information is coming to Magento backend and it is showing order as pending.


texts: Events not dispatched in frontend / unable to observe a frontend event

texts:
I'm trying to observe the catalog_product_collection_load_before event so that I can filter out products with a certain attribute on the frontend (whether a product is discontinued). I am able to observe the event in the adminhtml scope, but not frontend. Code as follows:

etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Jps_ProductDiscontinuation>
            <version>0.0.1</version>
        </Jps_ProductDiscontinuation>
    </modules>
    <global>
        <models>
            <jps_productdiscontinuation>
                <class>Jps_ProductDiscontinuation_Model</class>
            </jps_productdiscontinuation>
        </models>
        <events>
            <catalog_product_collection_load_before>
                <observers>
                    <jps_productdiscontinuation>
                        <class>jps_productdiscontinuation/observer</class>
                        <method>filterOutDiscontinued</method>
                        <type>singleton</type>
                    </jps_productdiscontinuation>
                </observers>
            </catalog_product_collection_load_before>
        </events>
    </global>
</config>

/Model/Observer.php:

class Jps_ProductDiscontinuation_Model_Observer {
    public function filterOutDiscontinued(Varien_Event_Observer $observer) {
        Mage::log("Event observed ~ jps 7/21/2017");
        $collection = $observer->getEvent()->getCollection();
//        $collection->addAttributeToFilter('discontinued', array('eq' => 'yes'));

        return $this;
    }
}

I don't believe it's an issue with my code because I logged the output of the dispatchEvent method in Mage.php while loading a category list on the frontend and catalog_product_collection_load_before was never dispatched, only in admin. This is on a dev server with settings that might vary slightly from production. Any idea what might suppress the event on the frontend or some sort of event related setting that might be related?

Edit: the event is dispatched and dispatch is confirmed through logging dispatchEvent().

Update: Per @sv3n's advice I installed Firegento and determined that the observers were not actually recognized. Through changing:

<class>jps_productdiscontinuation/observer</class>

to:

<class>Jps_Discontinuation_Model_Observer</class>

I was able to get them to appear in the Firegento observer list, but they're appearing under the incorrect module. Magento thinks they're part of the Netzarbeiter_GroupsCatalog2 module in the community code pool when they're part of their own module in the local code pool.


texts: css issue so much space in the footer of the site

texts:
please visit link : http://hotwhelstoys.com/

in the footer ,you can see so much empty space is present.

I want to remove the footer space.

please help me what css i have to use to remove this footer space


texts: Pass Variable And Output In Custom Email Template

texts:
I am trying to pass data into my email template, something like this:
['catalogue_url' => 'http://url.html']

I am struggling to access and output it in the email, I have tried the following:

Test 1: {{var $catalogue_url|raw}}

Test 2: {{var $catalogue_url}}

Test 3: {{var $catalogue_url}}

Test 4: {{var catalogue_url}}

Test 5: {{catalogue_url}}

My email sending code:

    $transport = $this->_transportBuilder
        ->setTemplateIdentifier($code)
        ->setTemplateModel($model)
        ->setTemplateOptions([
            'area' =>  $area,
            'store' => $this->storeManager->getStore()->getId(),
        ])
        ->setTemplateVars(['data' => $data])
        ->setFrom($sender)
        ->addTo($to)
        ->getTransport();

    $transport->sendMessage();

I will try with $data.catalogue_url now.

What is wrong with this?


texts: Magento login not working properly with FPC

texts:
I have a block on the header with welcome message and user name to show only if a user logged in . I'm using lesti fpc extension when fpc enabled and logged into a customer account and go back to home page but message block on the header is not showing as I'm logged in. but in some inner pages and it will also disappear if I refresh a page several times .

How can I solve this issue? do I have hole punch this block if yes how to do it as it involve sessions ?


texts:
Currently I´m using Luma Theme and I want to stick with that but I want to change my header, like fred perry site: https://www.fredperry.com/eu/

But I can´t find the header file to change it

Can someone help?

Thanks in advance


texts: How to call custom jquery after authorized-net response magento 2

texts:
I want to set custom jquery after got the response from authorized.net in magento.

I'm trying with this code

define(
[
    'uiComponent',
    'Magento_Checkout/js/model/payment/renderer-list'
],
function (
    Component,
    rendererList
) {
    'use strict';
    rendererList.push(
        {
            type: 'authorizenet_directpost',
            component: 'Magento_Authorizenet/js/view/payment/method-renderer/authorizenet-directpost'
        }
    );
    /** Add view logic here if needed */
    return Component.extend({});
}
);

I want to set jquery after got the authorized.net payment method form. i think this response come from

 Magento_Authorizenet/js/view/payment/method-renderer/authorizenet-directpost

files. can you please suggest how to set my jquery ?


texts: Why magento 2.1.9 not sending confirmation email after successful password reset?

texts:
In magento2 - after reset password conformation mail not send.

We have default functionality in Magento 1.x  but how is it possible in Magento 2.x?

Thanks in advanced.


texts:
Hi I have a form posting information to a page which will then place an order as a guest with what is in the current sessions basket but I am having some issues.

I get the error:

  Please check shipping address information. Please enter the first
  name. Please enter the last name. Please enter the street. Please
  enter the city. Please enter the telephone number. Please enter the
  zip/postal code. Please enter the country.

I have done a var_dump of the shipping and billing addresses and they look fine my POST is passing the info correctly. Can anyone spot what might be wrong?

  $checkout = Mage::getSingleton('checkout/type_onepage');
  $checkout->initCheckout();

  $checkout->saveCheckoutMethod('guest');

  $firstname = $_POST["firstname"];
  $lastname = $_POST["lastname"];
  $emailaddress = $_POST["email"];
  $confirmemailaddress = $_POST["cemail"];

  if(isset($_POST['tel'])):
    $telephone = $_POST['tel'];
  else:
    $telephone = "Not Applicable";
  endif;

  if(isset($_POST['postcode'])):
    $postcode = $_POST['postcode'];
  else:
    $postcode = "Not Applicable";
  endif;

  if(isset($_POST['addr1'])):
    $street1 = $_POST['addr1'];
  else:
    $street1 = "Not Applicable";
  endif;

  if(isset($_POST['addr2'])):
    $street2 = $_POST['addr2'];
  else:
    $street2 = "Not Applicable";
  endif;

  if(isset($_POST['city'])):
    $city = $_POST['city'];
  else:
    $city = "Not Applicable";
  endif;

  $billingAddress =  array (
    'firstname' => $firstname,
    'lastname' => $lastname,
    'email' => $emailaddress,
    'street' => Array(
        '0' => $street1,
        '1' => $street2
    ),
    'city' => $city,
    'postcode' => $postcode,
    'country_id' => 'GB',
    'telephone' => $telephone,
  );

  $shippingAddress =  array (
    'firstname' => $firstname,
    'lastname' => $lastname,
    'email' => $emailaddress,
    'street' => Array(
        '0' => $street1,
        '1' => $street2
    ),
    'city' => $city,
    'postcode' => $postcode,
    'country_id' => 'GB',
    'telephone' => $telephone,
  );

  $checkout->saveBilling($billingAddress, true);

  $checkout->saveShipping($shippingAddress, true);

  $checkout->saveShippingMethod('freeshipping_freeshipping');

  $checkout->savePayment(array('method'=>'free'));

  $checkout->saveOrder();

  foreach( Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection() as $item ){
   Mage::getSingleton('checkout/cart')->removeItem( $item->getId() )->save();
  }


texts:
This may be a beginner question.

In order to get a model I use:

  Mage::getModel(folder/file);

I tried the same with a block (something like getBlock) but it keeps giving me an error.

Is there any other way to access a block? Which is the correct way to do it?

Thanks.


texts: Magento 2: Static block image upload not working

texts:
I am using Magento 2.3 I am unable to upload image static block. It will show insert file instead of image.

I don't know what is the problem here


texts:
At the moment tier prices are running perfectly at single products.
But when I'm trying to print tier price at cross-sell products, the price does not shows up.
It just don't echo anything out.

The php code I am trying to use is the following.

<?php foreach ($_crossSellProducts as $_item): ?>
 <?php $_item = Mage::getModel('catalog/product')->load($_item->getId()); ?>
 <?php echo $_item->getTierPriceHtml() ?>
<?php endforeach; ?>

Am I missing something maybe? :)

Regards


texts: order confirmation emails are not working for admin & buyer

texts:
we are not getting order confirmation email to admin account, also for buyer.
but registration email is working for buyer.

2016-05-23T16:30:05+00:00 ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/site/public_html/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 /home/site/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/site/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/site/public_html/app/code/core/Mage/Core/Model/Email/Queue.php(241): Zend_Mail->send()
#3 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#4 /home/site/public_html/app/code/core/Mage/Cron/Model/Observer.php(325): call_user_func_array(Array, Array)
#5 /home/site/public_html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#6 /home/site/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#7 /home/site/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#8 /home/site/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#9 /home/site/public_html/cron.php(75): Mage::dispatchEvent('default')
#10 {main}

we entered email address in Send Order Email Copy To under Sales emails


texts: Mass action tree drop down issue in magento2

texts:
I am trying to create a custom drop down option in Action section in the sales order Grid.
The main gold is to bring custom Option(Assign to User) in Action Drop down.
Then once Assign to user is clicked it should list all available users in next drop down. so if any user is selected then the selected order should assign to that particular user.
I have used this code so far. but I am not getting my custom option in the Action drop down.
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
    <massaction>
        <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/grid/tree-massactions</item>
        </item>
        </argument>
        <action name="assigned_user_id" class="Vendor\Module\Ui\Component\Listing\MassActions\DynamicAction">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">assigned_user_id</item>
                    <item name="label" xsi:type="string" translate="true">Bulk Assign</item>
                    <item name="assigned_user_id" xsi:type="object">Vendor\Module\Ui\DataProvider\UserActions</item>
                </item>
            </argument>
        </action>
    </massaction>
   </listingToolbar>
</listing>

Vendor\Module\Ui\Component\Listing\MassActions\DynamicAction.php
 <?php
 namespace Vendor\Module\Ui\Component\Listing\MassActions;
 class DynamicAction extends \Magento\Ui\Component\Action
{
   /**
    * @inheritDoc
   */
  public function prepare()
  {
     $config = $this->getData('config');
     if(isset($config['assigned_user_id'])) {
         $this->actions = $config['assigned_user_id']->getActions();
     }
      parent::prepare();
   }
 }

Vendor\Module\Ui\DataProvider\UserActions.php
<?php
namespace Vendor\Module\Ui\DataProvider;

use Magento\User\Model\ResourceModel\User\CollectionFactory;
use Magento\Framework\UrlInterface;

class UserActions
{
protected $collectionFactory;
protected $urlBuilder;

public function __construct(CollectionFactory $collectionFactory,
UrlInterface $urlBuilder)
{
    $this->collectionFactory = $collectionFactory;
    $this->urlBuilder = $urlBuilder;
}
public function getActions()
{
    $actions = [];
    $users = $this->collectionFactory->create();
    foreach($users as $user) {
    $actions[] = [
        'type' => $user->getUserName(),
        'label' => $user->getName(),
        'url' => $this->urlBuilder->getUrl('*/*/assignUser', ['user_id' =>
    $user->getId()]),
    ];
    }
   return $actions;
   }
}

Please someone look into it and help me to resolve this issue.


texts: Cron Job Magento 2.2 fail - Class 'IntlDateFormatter' not found in

texts:
System set up:

Magento 2.2
PHP version 7.1.13 fastcgi with Intl installed
Ubuntu 16.04.2 LTS
Plesk version: 17.0.17

Elements to the cron set up

magento.cron.log
update.cron.log
setup.cron.log

Using plesk to schedule cron to the relevant domain on the server

magento.cron.log = error
update.cron.log = works
setup.cron.log = error
magento.cron.log = error

  PHP Fatal error: Class 'IntlDateFormatter' not found in
  /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on
  line 111

Some queries suggest removing; from; extension=php_intl.dll

as I cannot directly edit the php.ini (1&1 VPS server) I need to check this will work or any other suggestions?

just to add: setup.cron.log = error. this is without an error notice but I assume that as magento.cron.log is in error it won't work because of that.


texts: Magento 2 pager not working custom collection

texts:
In My custom Collection Pager not working
Index.php

<?php

namespace Test\CustomProduct\Block\Index;

class Index extends \Magento\Framework\View\Element\Template {
    protected $_coreRegistry = null;
    protected $_collectionFactory;
    protected $_productsFactory;

   public function __construct(
       \Magento\Backend\Block\Template\Context $context,
       \Magento\Framework\Registry $registry,
      \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory,
        \Magento\Reports\Model\ResourceModel\Product\CollectionFactory $productsFactory,
       array $data = []
   ) {
       $this->_collectionFactory = $collectionFactory;
       $this->_coreRegistry = $registry;
       $this->_productsFactory = $productsFactory;
       parent::__construct($context, $data);
   }

   public function _prepareLayout()
   {
       return parent::_prepareLayout();
       $this->pageConfig->getTitle()->set(__('Best Seller'));

       if ($this->getBestSellerData()) {
            $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager','vlc.history.pager')->setAvailableLimit(array(5=>5,10=>10,15=>15,20=>20));
            $pager->setLimit(5)->setShowPerPage(true);
            $pager->setCollection($this->getBestSellerData());
            $this->setChild('pager', $pager);
            $this->getBestSellerData()->load();
        }
        return $this;
   }
   public function getPagerHtml(){
        return $this->getChildHtml('pager');
    }

   public function getBestSellerData(){
       $collection = $this->_collectionFactory->create()
                    ->setModel('Magento\Catalog\Model\Product')
              ->setPageSize(100)
                    ->setPeriod('month');
                    //->setPeriod('day');
                    //->setPeriod('year');

       return $collection;
   }

   public function getMostviewdData(){
        $currentStoreId = $this->_storeManager->getStore()->getId();
        $collection = $this->_productsFactory->create()
        ->addAttributeToSelect(
            '*'
        )->addViewsCount()->setStoreId(
                $currentStoreId
        )->addStoreFilter(
                $currentStoreId
        );
        $items = $collection->getItems();
        return $collection;

    }

    public function getNewProductCollection(){
        $collection = $this->_productsFactory->create()
        ->addAttributeToSelect('*')
        ->setPageSize(5);
        /*Add you filters here as suggested by Amit and and Manashvi */
        return $collection;
    }

}

.phtml

<?php /* Best Seller Collection */?>
    <?php
        $bestSeller =  $block->getBestSellerData();
        //echo count($bestSeller);?>

Best Seller Collection.....

            <?php foreach ($bestSeller as $value) {?>

<?php echo $value['product_name'];?>

            <?php } ?>

<?php /* Best Seller Collection */?>
<?php if ($block->getPagerHtml()): ?>

<?php echo $block->getPagerHtml(); ?>

    <?php endif ?>


texts: Depending on the dimensions / ratio of the product page image, I'm sometimes left with images with a large white band above and below the image – especially on 'landscape' shaped images. Is there a way to make the product page gallery 'wrap' the image and not show any white space above / below the image?


texts: Redirection to Admin Customer Edit (with key) from a frontend controller

texts:
I'm trying to make a redirection from one of my module to Admin > Manage Customer > Edit.

Mage::app()->getResponse()->setRedirect(Mage::helper("adminhtml")->getUrl("adminhtml/customer/edit/", array("id"=>$customer_id)));

The URL called seems to be good, with a url key. But this URL leads to a 302 response and auto-redirect me to the dashboard.

In fact it seems that the generated URL is different from the real URL : the keys are not the same for both of them, which explains why I'm redirected I guess.

If I disable the keys in URL from admin, the redirection is ok.

Can you help me with this problem ?
Thank you very much.


texts: No shipping or Payment showing in Admin for new users

texts:
When creating an order in Admin we are experiencing the issue where there is no option for shipping or payments. This seems to happen only when creating a new user.

There is no other consistent pattern.

(2) websites
(5) customer groups

Default customer is assigned to default store and the consumer group.


texts: How inline edit work in admin ui-components grid magento2?

texts:
Can you please briefly explain how inline edit work in admin ui-components grid in Magento2.

Please explain controller, interface, and model.


texts: How can you map a virtual column in magento 2.4.1?

texts:
I have just upgraded to Magento 2.4.1 that REQUIRES you to use Elasticsearch as the search engine instead of MySql.
In the previous setup (Magento 2.3.2) I had a custom sort by a discount in the listing pages (a plugin that was overriding Toolbar.php):
public function aroundSetCollection(
    \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
    \Closure $proceed,
    $collection
) {
    $currentOrder = $subject->getCurrentOrder();
    $result = $proceed($collection);
    $subject->getCollection()->addAttributeToSelect('*');
    $currentDirection = $subject->getCurrentDirection();

    if ($currentOrder) {
        if ($currentOrder == 'discount') {
            $nameExpr = new \Zend_Db_Expr('(`price_index`.`price`- `price_index`.`final_price`) / `price_index`.`price` as discount');
            $subject->getCollection()->getSelect()->columns($nameExpr);
            $subject->getCollection()->getSelect()->order('discount DESC');
        }
    }

    return $result;
}

This worked really well, but since the upgrade the custom sorting does not do what it should and when I check the exception log I get this error:
main.CRITICAL: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [discount] in order to sort on","index_uuid":"BGhEoDllTtW8tOxJ7IJ8Ww","index":"andrei9000_product_1_v4"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"andrei9000_product_1_v4","node":"DGa694tHR0q9bh5qTUc55g","reason":{"type":"query_shard_exception","reason":"No mapping found for [discount] in order to sort on","index_uuid":"BGhEoDllTtW8tOxJ7IJ8Ww","index":"andrei9000_product_1_v4"}}]},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [discount] in order to sort on\",\"index_uuid\":\"BGhEoDllTtW8tOxJ7IJ8Ww\",\"index\":\"andrei9000_product_1_v4\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"andrei9000_product_1_v4\",\"node\":\"DGa694tHR0q9bh5qTUc55g\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"No mapping found for [discount] in order to sort on\",\"index_uuid\":\"BGhEoDllTtW8tOxJ7IJ8Ww\",\"index\":\"andrei9000_product_1_v4\"}}]},\"status\":400} at /home/www/site/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632)"} []

I just need a hint as to how I can map a virtual column so that Elastisearch can search by it


texts: Magento 2.3.2 checkout success page Create an Account Button Not Display

texts:
I am working on a Magento 2.3.2. In checkout success page, The Create an Account button is not display.

I have checked all files but it is not disabled in any files.

How to solve this one. Please tell me.

I have checked into the whole project but no any 'checkout.registration' field is removed into the file. Please check below screenshot:

Thanks in Advance


texts: Catalog Rules reset discounts during indexing

texts:
We have about 15K products and 500 catalog rules. What's been happening is that during the application of rule changes or new rule creation we've noticed that the front-end temporarily looses discounts on products causing customers to see an increase in prices, even when in cart.

Is this even normal behaviour?

Given the rules takes almost 45' to complete indexing it is almost unacceptable to have these issues.

Magento version 2.2

Thanks


texts: Magento 2 ui component form without database table

texts:
I want to add a UI component form in the admin panel. It is just sending email, no need of database storage. I want to redirect to my form when I click my menu "Send Coupon".
I have tried the below UI component XML. But it shows "Not registered handle coupon_email_data_source" error

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">coupon_email.coupon_email_data_source</item>
            <item name="deps" xsi:type="string">coupon_email.coupon_email_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true"> Information</item>
        <item name="config" xsi:type="array">
            <item name="dataScope" xsi:type="string">data</item>
            <item name="namespace" xsi:type="string">coupon_email</item>
        </item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
    </argument>
    <dataSource name="coupon_email_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument>
            <argument name="name" xsi:type="string">coupon_email_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">id</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
    </dataSource>
    <fieldset name="base_fieldset">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="label" xsi:type="string" translate="true"> Details</item>
            </item>
        </argument>
        <field name="id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Coupon</item>
                    <item name="formElement" xsi:type="string">input</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers Magento2.1.9

texts:
I am getting Server sent charset unknown error during setting up magento 2.1.9 on localhost.

PHP version - 5.6 or 7.1,
MySQL version - 8.0

I tried to add in my.cnf

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

but it is not working.

Is there any other fix for the issue?


texts: Render product view into without full product view controller request

texts:
Is it possible to render the product view block/template without either performing an ajax request or full product request?

I would like to do something similar to:

$productViewHtml = Mage::app()->getLayout()->createBlock('product.info')->setProduct(1)->toHtml();

For starters, this code doesnt work, therefore i need to resolve that.  But the main problem i can see are that different product types require different layout handles which are set in the controller.  I can not find any way to achieve.


texts:
So I just finished uploading my product feed in the Magento admin side. The feed went through just fine. The only issue now is that not all my products are showing.

I uploaded 834 products and only 12 are showing up. It's as if it is not showing the different pages to flip through to show the rest of the products. The first thing that comes to mind is the theme but everything seems fine to me there. Any ideas or suggestions?


texts:
I'm looking for solution of how to make the product always have a static URL with category name, no matter from what category I entered. I want URL to always look like this:

http://example.com/category/subcategory/product-name

But instead, I'm getting a bunch of URL's:

http://example.com/product-name
http://example.com/category/product-name
http://example.com/category/subcategory/product-name

I know that I can add canonical URL tag, but it's not an option in this case.

Thank you, any suggestions about from where should I start are very welcome!


texts: Fatal error: Class 'Mage_Inchoo_Orders_Helper_Data in Magento 1.9?

texts:
I am using inchoo order extension in magento 1.9 and it's throwing this fatal error

Fatal error: Class 'Mage_Inchoo_Orders_Helper_Data' not found in /opt/lampp/htdocs/vitadeals/app/Mage.php on line 547

config.xml

<?xml version="1.0"?>
 <config>
<modules>
    <Inchoo_Orders>
        <version>0.0.0.1</version>
    </Inchoo_Orders>
</modules>

<global>
    <models>
        <inchoo_orders>
            <class>Inchoo_Orders_Model</class>
            <resourceModel>inchoo_orders_resource</resourceModel>
        </inchoo_orders>
    </models>

    <resources>
        <inchoo_orders_setup>
            <setup>
                <module>Inchoo_Orders</module>
            </setup>
        </inchoo_orders_setup>
    </resources>

    <blocks>
        <inchoo_orders>
            <class>Inchoo_Orders_Block</class>
        </inchoo_orders>
    </blocks>

    <helpers>
        <inchoo_orders>
            <class>Inchoo_Orders_Helper</class>
        </inchoo_orders>
    </helpers>
</global>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <inchoo_orders before="Mage_Adminhtml">Inchoo_Orders_Adminhtml</inchoo_orders>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Data.php

<?php
class Inchoo_Orders_Helper_Data extends Mage_Core_Helper_Abstract
{

}

and from here helper function class is calling.

$helper = Mage::helper('inchoo_orders');

Please help guys.


texts: How to check if Magento Shopping Cart Price Rule Conditions have been met

texts:
Really struggling with this. I'm trying to see if the conditions of a 'Shopping Cart Price Rule' have been met directly on the 'View Cart' page. If so, I want to add a product automatically to the cart.

I have been trying different methods using:

Mage::getModel('salesrule/rule')->load($id)->getConditions();

with the rule ID being 18, then echoing to see if it worked, no such luck yet.

I'm trying to make it so I can at least see if the conditions have been met before I try to automatically add a product to the cart.

Something along the lines of:

if (product conditions have been met) {
automatically add product to cart
}

I have already seen this How to check if shopping cart price rule applied to quote, however that is showing rules that have already been applied, rather than rule that 'could' be applied.

Any help would be much appreciated.

James


texts:
I'm setting up a Magento 2.1.3 site, first time using M2.

I'm having issues setting up my crontab to re-index etc., looking online it seems that it is a fairly common problem although all of the obvious fixes I found online did not work for me.

Info:
Dedicated Server, OS CentOS 6.9, Plesk Onyx 17.0.17

PHP CLI: 5.4.45, Plesk Set PHP: 7.0.18

I've setup the cron info following the DevDocs as seen:
http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg

However this of course did not work, so delving deeper into it, I then tried manually running the cron job such as:

./magento indexer:reindex

And I get a PHP Parse error:

PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/vhosts/DOMAIN/httpdocs/ts_store/vendor/magento/framework/App/Bootstrap.php on line 411

Upon searching, the only issues I can find similar relating to the PHP Parse error are people struggling to install M2 and have been no help for me.

Is anyone able to suggest anything to help?

UPDATE

I am now running PHP 5.6 CLI.
However I am still experiencing issues, If I force the reindex using: ./magento indexer:reindex
The reindex works, however when I setup the cron its not working and I get an undelivered email with an error station permission denied:

/bin/sh: /var/www/vhosts/DOMAIN/httpdocs/ts_store/var/log/setup.cron.log: Permission denied


texts: Is CE 1.9.0.1 compatible with MySQL 5.7?

texts: My web host is currently planning to upgrade all servers from MySQL 5.6 to 5.7 next week (and just informed us today for the first time). I have done a little digging and have not found any real clarification if CE 1.9.0.1 runs on 5.7 or not, and from what little I have found, I am leaning towards the side of it not being compatible. So my question becomes, does anyone have any experience with 1.9.0.1 and MySQL 5.7 and if so, what precautions do I need to take, or is this just going to be a bumpy ride?


texts:
I have two store views in my shop, German and English.

In my English store view, my product slider shows products as "sale" (the pink eye-catcher):

And in the German store view it's shown as "Verkauf" but I want to change that, also to "Sale".

I use the language pack, maybe I must change the translation, but where?


texts: How to override catalog price render file

texts:
I want to make a modification with the price shown in catalog view page so i have to modify _toHtml() in module-catalog\pricing\render.php I am not sure what is the best way to do that.

for example, for listing page, i used a plugin for the aftergetProductPrice() function of catalog\Product\ListProduct.php


texts:
I have an old website that runs magento 1.3 and i'm trying to move it to another server, but I can't find the system requirements of magento 1.3.

IT's currently using php 5.2, I'm wondering if it would work with magento 5.6?...


texts: What is the recommended way for checking if the full-page-cache is enabled?

texts:
How should I check if enabled and then invalidate the Magento full page cache?

I've found references that check if it is enabled using Magento\PageCache\Model\Config->isEnabled() and then invalidating it using Magento\Framework\App\Cache\TypeListInterface->invalidate(Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER)

The method Magento\PageCache\Model\Config->isEnabled() seems to be marked as deprecated.

What would be the new recommended way?


texts: When using default rwd theme why is there nothing inside my language switcher?

texts: I have installed the theme and all I get is a blue line? Where is the text/language switcher?


texts:
if (url) {
    new Ajax.Request(url,
    {
      method: 'post',
      parameters:{onverifyphone:$('onverifyphone').value},
      onSuccess: function(transport) {
                  var response = "1234";

                 '<?php
session_start();
                  $_session['xyz']=response;?>';

                  alert(<?php echo $_session['xyz'];?>);

                  return true;
                  }
    });
    }
});

Event.observe('verify','click',function(){
     '<?php session_start();?>';
     alert('<?php echo $_session['xyz'];?>');

return true;

});

===========================

On first alert is 1234
while on verify button even it shows [object Object]
[]1


texts: Magento 2 Rounding Tax Calculation Issue

texts:
I use Magento 2.3.5p1 with catalog prices without tax. I have issue with tax rounding on storefront.
Example calculation.
I get following result on Magento storefront for 21% vat;
45.45 * 1.21 = 54.99

But it must be €55.00 (imported order from feedmanager). I don't know where i make a mistake.


texts: CE1.9.2 - Filter Orders collection on hasInvoices()

texts:
I've separated this from another question I had asked before. How would I be able to filter the sales/order collection on hasInvoices() and ensure that there is no balance due to pay? I'd like to avoid doing this in the iteration step and hopefully save performance hits.

$orders = Mage::getModel('sales/order')
    ->getCollection()
    ->addAttributeToFilter('status', array('complete','processing'));

foreach ($orders as $order) {
    if (($order->hasInvoices()) && ($order->getTotalDue() == 0)) {
        echo $order->getIncrementId() . "\n";
    }
}

The code above does work, but I think it would be much better to iterate through an already filtered collection.


texts: faster way to update attributes/ update product programmtically with stock data in Magento 2?

texts:
I have this code but Anybody tell me faster way to update products.
This below code takes much time. So  any alternative solution for to save product in fast way and Can I also put sleep function at end of the for loop to less consume memory ?
Thank you
  public function updateProducts(){

        foreach($productIds as $productId){
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
            $product = $objectManager->create('\Magento\Catalog\Model\Product');
            $product->load($productId);
            $product->setSku('my-sku'); // Set your sku here
            $product->setName('Sample Simple Product'); // Name of Product
            $product->setStatus(1); // Status on product enabled/ disabled 1/0
            $product->setWeight(10); // weight of product
            $product->setVisibility(4);
            $product->setPrice(100); // price of product
            $product->setStockData(
                                    array(
                                        'use_config_manage_stock' => 0,
                                        'manage_stock' => 1,
                                        'is_in_stock' => 1,
                                        'qty' => 14
                                    )
                                );
    $imageUrl = "https://example.com/img1.jpg";
    $tmpDir = $this->getMediaDirTmpDir();
    $newFileName = $tmpDir . baseName($imageUrl);
                        $result = $this->file->read($imageUrl, $newFileName);
                        if ($result) {
                             $_product->addImageToMediaGallery($newFileName,array('small','thumbnail','base'), $imageType, true, false);
                        }
            $product->save();
          unset($product);
        }
}
    protected function getMediaDirTmpDir(){
            return $this->directoryList->getPath(DirectoryList::MEDIA) . DIRECTORY_SEPARATOR . 'tmp';
        }


texts: Removing some tabs on account page not working

texts:
I have created this file :

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/>
        <referenceBlock name="downloadable_customer_products_list" remove="true"/>
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
    </body>
</page>

in the following folder : app/design/frontend/Magento/MyTheme/Magento_Customer/layout/customer_account.xml.

But this doesn't work. any idea what's am I missing ?
I have tried to :

magento cache:clear & magento cache:flush
magento setup:upgrader & magento setup:di:compile.

None above solutions are working and the tabs like newsletter,product-list,prodcuts-reviews is still appear.

Here is my code structure look like :

 ▾ [✗]app/
  ▾ [✗]design/
    ▾ adminhtml/
    ▾ [✗]frontend/Magento/Aura/
      ▸ etc/
      ▸ i18n/
      ▸ layout/
      ▸ Magento_Catalog/
      ▾ [✗]Magento_Customer/layout/
          [✹]customer_account.xml
      ▸ Magento_Newsletter/email/
      ▸ Magento_Theme/
      ▸ media/
      ▸ web/
        composer.json
        registration.php
        requirejs-config.js
        theme.xml

As you can seeon the Magento_Customer/layout there is some xml file where I put the code above.


texts:
I have a doubt on Magento2 as we can see it is rising up and themes started coming up of magento version 2.

But i have a confusion of whether it is stable to use in development projects, or it is currently not recommended for development projects.

Like it may have bugs that are sill need to get fixed, i want to confirm that can i start using it for my clients.

I am talking about Magento2 CE.


texts: Magento 2 Pagination, from page 2 no results found

texts:
I have an issue on my production site running magento 2.3.3, results of pagination from the page 2 and above don't show any results to be more clear:

https://mywebsite/products?p=1 -> function correctly.
https://mywebsite/products?p=2 -> no products could be found.
...
https://mywebsite/products?p=4 -> no products could be found.

The problem is not only on the product category page but for everywhere pagination is used (for search as well).

I can't reproduce the issue locally any idea how I can debug or solve this issue ?


texts: How the "magento setup:store-config:set --base-url" command exactly works?

texts:
I was thinking that such command was the same as setting the Base url from the Magento admin panel, from Configuration / Store / Web / Base Urls, but after some try it seems it is not the same.

When I set the Base url field from the Magento's Admin Panel, it writes this row inside the core_config_data table, with scope = default:

| scope   | path                   | value                 |
-----------------------------------------------------------|
| default | web/unsecure/base_url  | <base-url-value>      |

When I set the base-url with the CLI:

magento setup:store-config:set --base-url "<new-value>"

it deletes the previous row and adds another row, with scope = websites

| scope    | path                   | value                 |
------------------------------------------------------------|
| websites | web/unsecure/base_url  | <new-value>           |

Now, if I go back to the admin panel, I don't see the new value but I see a default value {{base_url}} within the Base url field.

Finally if I set again the value from the Magento's Admin Panel and I save it, it creates another row inside the table with scope = default. And from now I could have two rows with two different base-url inside the database (and I'm a bit worried about this).

Since setting the wrong base-url could make the website unavailable, I would like to have things clear in mind.

What is the difference between these two methods and what is the proper way to set the base-url for a simple Magento e-commerce with only one store?

I can guess it have something to do with multi-store configurations, but I still do not understand how..

Also, is there not a command line to set the base-url with scope = default (as I was setting it from the admin panel)?

The Magento's documentation doesn't help me very much:

  --base-url

  Base URL to use to access your Magento Admin and storefront in any of the following formats:

  http[s]://[host or ip]/[your Magento install dir]/. Note: The scheme (http:// or https://) and a trailing
  slash are both required. [your Magento install dir] is the
  docroot-relative path in which to install the Magento software.
  Depending on how you set up your web server and virtual hosts, the
  path might be magento2 or it might be blank. To access Magento on
  localhost, you can use either http://127.0.0.1/[your Magento install
  dir]/ or http://127.0.0.1/[your Magento install dir].
  {{base_url}} which represents a base URL defined by a virtual host setting or by a
  virtualization environment like Docker. For example, if you set up a
  virtual host for Magento with the host name magento.example.com, you
  can install the Magento software with --base-url={{base_url}} and
  access the Magento Admin with a URL like
  http://magento.example.com/admin.

Still I don't get where is the difference with the Admin Panel's Base url field.


texts: Magento 2: How to change Weight field for DHL Shipping Method [SOLVED]

texts:
For Product apart from Magento Field Weight, we have another Attribute Called

Total Weight.

Every product has this attribute. So when user will select DHL Shipping Method, instead of Product's weight field I need to use my Total Weight attribute.

How to achieve this? Need to override from

  magento\vendor\magento\module-dhl\Model\Carrier.php & _getAllItems() function?


texts: Pre select configurable product in magento 2 PDP

texts:
Hi I want whenever someone opens configurable product page with size and color the first child should be preselected
how to achieve this I am using latest Magento 2 version


texts: Calling to custom block from cms page display blank page

texts:
I've created a custom block, however when calling the block from cms page displays nothing. Even the content of cms page does not displat that is above the call to custom block

Here is How i'm calling the block

{{block type="brandproducts/brandproducts"  template="brandproducts/brandproducts.phtml"}}

Custom Block Code is As Follows

Block File

<?php
// app/code/local/Compx/Brandproducts/Block/Recentproducts.php
class Compx_Brandproducts_Block_Brandproducts extends Mage_Core_Block_Template {
  public function getBrandProducts() {
    // call model to fetch data
    $arr_products = array();
    $products = Mage::getModel("brandproducts/brandproducts")->getBrandProducts();

    foreach ($products as $product) {
      $arr_products[] = array(
        'id' => $product>getId(),
        'name' => $product->getName(),
        'url' => $product->getProductUrl(),
      );
    }

    return $arr_products;
  }
}
?>

Model File

<?php
// app/code/local/Compx/Brandproducts/Model/Brandproducts.php
class Compx_Brandproducts_Model_Brandproducts extends Mage_Core_Model_Abstract {
  public function getBrandProducts() {
  $products = Mage::getModel("catalog/product")->getCollection();
                $products->addAttributeToSelect('*')
                //->setOrder('entity_id', 'DESC')
                ->setPageSize(5);
    return $products;

  }
}

?>

Config file

<?xml version="1.0"?>
<config>
  <modules>
    <Compx_Brandproducts>
      <version>1.0</version>
    </Compx_Brandproducts>
  </modules>
  <global>
    <blocks>
      <brandproducts>
        <class>Compx_Brandproducts_Block</class>
      </brandproducts>
    </blocks>
    <models>
      <brandproducts>
        <class>Compx_Brandproducts_Model</class>
      </brandproducts>
    </models>
  </global>
</config>

This just outputs blank. If i remove the custom block placeholder from cms page, other static content loads fine

I've been calling direct template files from other pages and that just works fine,  like {block type="core/template" .. }  however not works at all with custom block

It just display nothing, not even print_r or echo strings

Template File

  <?php
// app/design/frontend/compx_package/compx/template/brandproducts/brandproducts.phtml

print_r("hi 123");

//exit;
$products = $this->getBrandProducts();
?>

Brand Products

  <?php if (is_array($products) && count($products)) { ?>
    <?php foreach($products as $product) { ?>

        <a href="<?php echo $product['url'] ?>"><?php echo $product['name'] ?>

    <?php } ?>
  <?php } ?>

xml file under app/etc directory

/app/etc/modules/Compx_Brandproducts.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Compx_Brandproducts>
            <active>true</active>
            <codePool>local</codePool>
        </Compx_Brandproducts>
    </modules>
</config>


texts: 301 Redirects dont work with index.php in OLD URLs

texts:
I moved my old store to magento, Im using 1.9.2 CE Magento. Old store was up and running for years and I didnt want to loose SEO URLs, so when I try to do 301 redirects, Im facing a problem.

If old URL has index.php in it, then instead of redirection to new URL, magento redirects to homepage.

I tried doing this with Magento default URL rewrites, with a third party extension and tried it with htaccess as well.  Always the same result.

for example:

Following code in .htaccess

Redirect 301 /index.php?main_page=product_info&products_id=161 http://domain.com/catalogsearch/result/?q=sku-161 --- This redirects to homepage (Doesnt work properly)
Redirect 301 /main_page=product_info&products_id=331 http://domain.com/catalogsearch/result/?q=sku-331 --- This redirects to new URL (Works Properly)

Problem is that, all my old URLs do have index.php? in it, so I need to make it work somehow.

Any ideas?

Thank You :)


texts: Magento 2 Too many password reset requests even when password reset protection is disabled

texts:
I logged in as administrator to Magento backend and trying to reset password for some customers.

I have disabled password protection from Configuration -> Customers -> customer configuration. so it look like this in my admin,

I have cleared cache. But I still get the same error "Too many password reset requests, please wait and try again".

What did I miss?