texts: Magento 2 get Bundle product price without currency symbol in final_price phtml

texts:
How to get Bundle Product Price without Currency symbol in magento 2 final_price.phtml file.
When I use $product->getName() It is giving the product name but when I use $product->getPrice() it is not giving any result.How Can I get the product only price (without currency symbol)


texts: Magento2.3.5 Disabled dynamic row system field

texts:
How can one add a disabled attribute to an input field in dynamic row system ref: https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/dynamic-row-system-config.html
What I've tried:
$this->addColumn('price', ['label' => __('Price'), 'class' => 'required-entry', 'disabled' => true]);

I would think that this would add the attribute disabled with value true. But it doesn't
Anyone any ideas?


texts:
I want to override below block file

/var/www/html/dg/vendor/magento/module-gift-card/Block/Sales/Order/Item/Renderer.php

I made this file

/var/www/html/dg/app/code/Drummondgolf/Orderemail/Block/Sales/Order/Item/Renderer.php

I am getting below error

  Errors during compilation:
          Drummondgolf\Orderemail\Block\Sales\Order\Item\Renderer
          Incompatible argument type: Required type: \Magento\Framework\Stdlib\StringUtils. Actual type: \Magento\Directory\Model\Currency; File:
      /var/www/html/dg/app/code/Drummondgolf/Orderemail/Block/Sales/Order/Item/Renderer.php

<?php

namespace Drummondgolf\Orderemail\Block\Sales\Order\Item;

class Renderer extends \Magento\GiftCard\Block\Sales\Order\Item\Renderer
{
   protected $_currency;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Directory\Model\Currency $currency
    )
    {
        $this->_currency = $currency;
        parent::__construct($context,$currency);
    }

    // The below function is created to get currency symbol for Gift card products
    // Jira Task No: DG-684
    // Author: Arjun
    // Date: 21, May 2019

    public function getCurrentCurrencySymbol()
    {
        return $this->_currency->getCurrencySymbol();
    }
}


texts: Magento 2.1 - How do I downgrade Algolia Search?

texts: I've been using Algolia Search for Magento 2.1 for 2 weeks. Somehow I accidentally ran the composer command and updated Algolia to version 1.10.0. Now I want to downgrade it back to version 1.8.5. Could you please show me how to do that?


texts: magento2 preference not working in Enterprise Edition 2.3.5

texts:
magento2 while overriding class using preference, its not working in Enterprise Edition 2.3.5

In checkout_cart_index.xml

<referenceBlock name="checkout.cart.crosssell">
            <action method='setCustomTemplate'>
            </action>
            <arguments>
                <argument name="type" xsi:type="string">crosssell</argument>
                <argument name="group_name" xsi:type="string">native</argument>
            </arguments>
            <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers.native" as="details.renderers">
                <block class="Magento\Framework\View\Element\Template" as="default"/>
                <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Vendor_Module::checkout/cart/product/native.phtml" >
                    <arguments>
                        <argument name="type" xsi:type="string">shoppingcart-native</argument>
                    </arguments>
                </block>
            </block>
        </referenceBlock>

In frontend/di.xml

<preference for="Magento\Checkout\Block\Cart\Crosssell" type="Vendor\Module\Block\Checkout\Cart\NativeBlock" />


texts: Multiple Billing Address for Multiple items in cart, Magento?

texts:
Magento give functionality to use multiple Shipping address.
I want to add multiple products in cart with below condition:

1. Cart has multiple items
2. Shipping Address can be different for all.
3. Billing Address can be different for all.

How can I achieve the 3rd?


texts: Element 'body' : Character content other than whitespace is not allowed because the content is 'element-only' after Magento 2.3.4 upgrade

texts:
After Magento 2.3.4 upgrade, Error is "Element 'body' : Character content other than whitespace is not allowed because the content is 'element-only'" on Product details page.

  Actually after removing below code from
  app/code/Vendor/Module/view/layout/catalog_product_view.xml file it's
  resolved.

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
      <!-- <referenceBlock name="product.info.addtocart">
           <action method="setTemplate">
               <argument name="template" xsi:type="string">Vendor_Module::catalog/product/view/addtocart.phtml</argument>
           </action>
       </referenceBlock>
       <referenceBlock name="product.info.addtocart.additional">
           <action method="setTemplate">
               <argument name="template" xsi:type="string">Vendor_Module::catalog/product/view/addtocart.phtml</argument>
           </action>
       </referenceBlock>   ---->
   </body>
</page>

Error screen:

  Now i am looking for rectification of this code because it was working
  fine in Magento 2.2.4 version but not in Magento 2.3.4

  If anyone having an idea please guide me. Thanks in Advance !!.


texts: Magento 2.3 - Product Import is still in In progress

texts:
I tried to import prices in Magento 2.3 backend. Checked data and saw no errors.

I clicked import button,
then it shows Maximum error count has been reached or system error is occurred!.

But in Import History it is still in progress.

How to cancel it? Can i delete data in import history table?


texts: how to use walk method to join two tables in magento 2

texts:
friends,
how to use the walk() method to join two tables in Magento 2
I have 2 tables and I want to join them based on some conditioning.
my present code looks like this

    $result = array();
    $model = $this->certificationModel->create()->getCollection()->addFieldToFilter('SKU', array('eq' => $sku));
    foreach ($model->getData() as $key => $value) {
        $isActive = $this->certificateModel->create()->getCollection()->addFieldToFilter('title', array('eq' => $value['Certification']))
            ->addFieldToSelect('status')->getData();
        $certificateId = $this->certificateModel->create()->getCollection()->addFieldToFilter('title', array('eq' => $value['Certification']))
            ->addFieldToSelect('id')->getData();
        if ($isActive[0]['status'] == 1) {
            $result[] = $this->certificateModel->create()->load($certificateId[0]['id'])->getData();
        }
    }
    return $result;

how I can implement walk() here
i an using this referance

thanks for help


texts:
I face this problem.

  Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Framework\Pricing\Price\Pool::__construct() must implement interface  or be null, array given, called in C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on line 111 and defined in C:\xampp\htdocs\magento\vendor\magento\framework\Pricing\Price\Pool.php:23 Stack trace: #0 C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111): Magento\Framework\Pricing\Price\Pool->__construct(Array, Array) #1 C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array) #2 C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Configu...') #3 C:\xampp\htdocs\magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(144): Magento\Framework\Ob in C:\xampp\htdocs\magento\vendor\magento\framework\Pricing\Price\Pool.php on line 23

How to solve it? Thanks in advance.


texts:
I am trying to update my checkout layout to use two columns, so the checkout fields are in the left column and the cart summary is in the right column.

In my checkout_index_index.xml, I have created two containers like:

<container htmlTag="div" htmlClass="checkout-main col-md-6">

</container>
<container htmlTag="div" htmlClass="checkout-aside col-md-6">

</container>

I am unsure how I can move the elements/items within the onepage.phtml into the correct columns?

Can anyone please advise how it is possible to update the checkout layout?

  checkout_index_index.xml

http://cnhv.co/1bq62


texts:
I need to change Magento's default decimal format. I mean, when I save '1' to a decimal field, it becomes '10000.0000' with this '.0000' in the end.

I need to change it to another format, which uses ',' instead of '.' to separate decimal (and currency) numbers.

This is the Brazilian standard and it's not being used even after changing the store language. This change should be reflected mainly in the admin side.

Thanks a lot!

PS: this is exactly the same question posted here by myself:
https://stackoverflow.com/questions/19041708/change-magento-decimal-field-format


texts:
I've configured my Magento ver. 2.2.4 to send email to customers that have registered themselves for an stock alert when the product which is "out of stock" goes to be back in stock, but when I try to do this I don't receive any message for this, it's strange because I receive message for new users, newsletter, orders ... but not for a restock of an item. I've added the cron to "*****" in the database and the default cron is running on my server.

I've seen a lot of plugins with insane prices, but it's a Magento core feature so I don't want to pay a huge amount for this.

If anyone has a solution it would be nice if you share :D

Thank you in advance for your help.


texts: Magento 2 - How to call a custom HTML file like header.html and footer.html (under Magento Email or Custom Module) in any email templates?

texts:
Create separate email header and footer for 2 different "frontend area"

for Customer
for Vendor Area (seller admin panel "not admin area")

I want separate email design for both area.

right now my email template (for New Account ) is like

{{template config_path="design/email/header_template"}}

(default email "header.html" comes through Magento_Email::email/header.html )

I want to replace header.html with my custom-header.html


texts: How dynamically price change on product page in Magento2

texts:
I am trying to update price of product on product page. So I am updating the span of price by getting product price + my additional price, but problem is when we use custom options.

Is there any event or plugin available using which I can add our price at final even after custom option.

Thank you,


texts: Is it better to remove an element of change it's css to be display: none

texts:
I've been working on some css fixes with a custom theme, both css and templates are using the same named theme so in a sense they are a pair, you wouldn't want to have the template work with anything else but the css files

while working i noticed that some css rules just have the following

display: none;

the template i am working on is the pagination so the display: none; is used to hide the Pages text, however since the css is paired with the templates it could have been just a simple as to remove the text itsefl from the template

now i am wondering, in terms of Magento, is it better to use display: none; to hide elements in a template or just remove them all together


texts: model values are not coming in response , why empty response in magento 1.9

texts:
public function ws_getPunchForApp($custid,$page=1,$size=10){

    if(Mage::getSingleton('customer/session')->isLoggedIn()){
        }
        else{
            $res["error"] = "Invalid request";
            return $res;
        }

        $res = $punchCollection = array();
        $res = array();

        $custoid = Mage::getSingleton('customer/session')->getId();

        if($custoid == $custid)
        {   $current = date('Y-m-d');
            //$custid= Mage::getModel('manager/asmtracker')->load($punch->getManagerId());

            $PunchData = Mage::getModel("manager/asmtracker")->getCollection()
                                                          //   ->addAttributeToSelect('*');
                                                           ->addFieldToFilter('manager_id', array('eq' => $custid))
                                                           ->addFieldToFilter('punch_in_time', array('eq' => $intime))
                                                           ->addFieldToFilter('punch_out_time', array('eq' => $outtime))
                                                           ->addFieldToFilter('in_coordinates', array('eq' => $outlocation))
                                                           ->addFieldToFilter('out_coordinates', array('eq' => $intime))
                                                           ->addFieldToFilter('status', array('eq' => $punchstatus))
                                                           ->addFieldToFilter('create_at', array('eq' =>$current));

            $PunchData->setCurPage($page)->setPageSize($size);
            $totalPage = $PunchData->getLastPageNumber();

            print_r($PunchData);
//echo json_encode($PunchData);
            if(!empty($PunchData))
            {
                $i=0;
                foreach ($PunchData as $punch)
                {
             $custid= Mage::getModel('manager/asmtracker')->load($punch->getManagerId())->getData();
                  $punchCollection[$i]['manager_id'] = $custid;

             $intime = Mage::getModel('manager/asmtracker')->load($punch->getPunchInTime())->getData();
                    $punchCollection[$i]['punch_in_time'] =$intime;

             $outtime = Mage::getModel('manager/asmtracker')->load($punch->getPunchOutTime())->getData();
                    $punchCollection[$i]['punch_out_time'] =$outtime;

             $inlocation = Mage::getModel('manager/asmtracker')->load($punch->getInCoordinates())->getData();
                    $punchCollection[$i]['in_coordinates'] =$inlocation;

             $outlocation = Mage::getModel('manager/asmtracker')->load($punch->getOutCoordinates())->getData();
                    $punchCollection[$i]['out_coordinates']   = $outlocation;

             $punchstatus = Mage::getModel('manager/asmtracker')->load($punch->getStatus())->getData();
                    $punchCollection[$i]['status'] =$punchstatus;

             $create_at = Mage::getModel('manager/asmtracker')->load($punch->getCreateAt())->getData();
                    $punchCollection[$i]['create_at'] =$punch->getCreateAt();
                    ++$i;
                }
                $res['code'] = 200;
                $res['punchdata'] = $punchCollection;
                $res['totalpage'] = $totalPage;

            }else
            {

                  $res['code'] = 200;
                  $res['asmtracker'] = 'ok';
            }
        }else
        {
            $res['code'] =400;
            $res['msg'] ='Unable to process your request...';
        }
        return $res;
    }


texts:
I got this error:

Fatal error: Call to a member function getPrice() on null in /home/.../public_html/vendor/magento/module-checkout/Block/Shipping/Price.php on line 71

So, after reading this solution here I altered this file:

/app/design/frontend/Package/Theme/Magento_Checkout/Block/Shipping/Price.php

However, I still keep getting the same error:

Fatal error: Call to a member function getPrice() on null in /home/.../public_html/vendor/magento/module-checkout/Block/Shipping/Price.php on line 71

Which makes me think that Magento2 is ignoring my Block in Magento_Checkout, and defaulting back to Magento2's own core code.

How can I solve this issue (without editing the core code).

Is there something I need to do to register this Block?

Before I get asked:

I have deployed:

php bin/magento setup:static-content:deploy

I have re-indexed:

php bin/magento indexer:reindex

I have cleared the cache:

php bin/magento cache:clean
php bin/magento cache:flush

And Magento 2 is in the painfully slow developer mode.

I have made alterations to the view files in /app/design/frontend/Package/Theme/Magento_Checkout/view/frontend/templates/... and these have all worked fine. They are not being ignored, only /app/design/frontend/Package/Theme/Magento_Checkout/Block is being ignored.

I think my problem here might be related, I have made changes to XML Layout for Magento_CatalogSearch but these changes are being ignored, and the default XML Layout is being used instead.


texts: Simple Product attribute value is Visible on admin panel but shown empty on frontend

texts:
I am having a weird problem. I have a delivery method attribute and it is filled by values. When I want to get that attribute for simple products I see it on 90% of the products and there is no problem. But for the rest I can not see that attribute value. I did print the simple product out which does not show the value and the attribute is really empty. But when I check it on Admin panel for the very same product I see that it is selected. To be sure I select it again and save it but still no value shown on frontend only for some of the products.

Is there anyone who had the same problem and who knows the solution of that?

I am using Magento 1.7.2 and attribute settings are OK since I am getting the value for most of the products.


texts: Can not excute command line in magento 2.1 with xampp php 7.0.6 on window

texts:
I have installed magento 2.1.0 with latest xampp window 7.0.6. The strange thing is I can not run command line after successful installation magento 2.1. It happens due to wrong PHP_VERSION_ID (on commandline it shows : 50519) even I install xampp php 7.0.6.

Do you have any idea to fix it ? Thanks

On web interface, it shows 70006, but on command-line interface it shows 50519


texts: hreflang for 2 storeview with different URL

texts:
We have insert this code in the header.phtml to have on all web page:

    <?php
    $groupId = Mage::app()->getStore()->getGroupId();
    $collection = Mage::getModel('core/store')->getCollection()->addFieldToFilter('group_id', $groupId);
    foreach ($collection as $store) {
            echo '<link rel="alternate" href="' . preg_replace('/\?.*/', '', $store->getCurrentUrl()) . '" hreflang="' . $store->getCode() . '"/>' . "\n";
    }
    ?>

It is working good, the only problem is it list 2 same URL and we have 2 different URL for all page/category/product

What appears:

    <link rel="alternate" href="http://example.com/index.php/parts/battery.html" hreflang="fr_ca"/>
    <link rel="alternate" href="http://example.com/index.php/parts/battery.html" hreflang="en_ca"/>

Whate we want to be displayed:

    <link rel="alternate" href="http://example.com/index.php/pieces/batteries.html" hreflang="fr_ca"/>
    <link rel="alternate" href="http://example.com/index.php/parts/battery.html" hreflang="en_ca"/>

How to do that?


texts: Paypal Standard Order Status Shows Pending Payment paid payment

texts:
recently I changed Email Associated with PayPal Merchant Account  since that i am facing an issue.
  order status pending payment however customer paid payment with paypal
i am using System->Configuration->Payment Methods->PayPal Standard


texts: save config payment method button doesno work 1.9.2.2

texts:
i tried installing paytabs to magento 1.9.2.2 the save config button on the payment method page doesnot work. it doesnot pop up error and nothing happens.
i tried diabling paytabs extension. still it is the same


texts: Protection of variable from concurrent access

texts:
I am writing a REST API. In this API I am using a bearer token. This token has a longer expiry time. i.e., several minutes and should be reused until it expires. My REST API may get called concurently from several clients. Whenver, the totken is close to expiry, I need to generate again and store it in a global variable.
Requirement is to delay a function call or fail, when token is being generated. I came across the following topic. Wanted to know whether there is a better method something like mutex in C.
Currency HTTP Requests
Here is my pseduo code:
// lock
if (isset($this->token) == false || ($this->token_expiry_time - time()) < 60) {
    $this->token = $this->generateToken()
}
// unlock
//use token


texts: How to get the TaxClassId from an order item?

texts:
As described in the title of this question, I don't understand why Magento 1.9.3.0 doesn't save the taxClassId information. Any idea?

$orders = Mage::getModel('sales/order')
            ->getCollection()
            ->addAttributeToSelect('*');

foreach ($orders as $order) {
    $theItems = $order->getAllVisibleItems();
    foreach ($theItems as $product) {
        echo $product->getTaxClassId();
    }
}

Thanks


texts:
How to create a popup model in magento 2

when click a custom "add to quote" button i need a popup model like  with  product details

Expected like:


texts:
I am trying to point a php SoapClient at http://me.com/api/?wdsl and when I call $soap->login(), I get:

"PHP Fatal error: Uncaught SoapFault exception: [Sender] DTD are not supported by SOAP in ..."

I have tried adding options to the SoapClient constructor but nothing works. Any ideas?  My code is as follows:

<?php

ini_set("soap.wsdl_cache_enabled", "0");

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

$mageUrl    = 'http://me.com/api.php?type=soap&wsdl=1';
$mageUser   = 'XXXXX';
$mageApiKey = 'XXXXX';

$soap = new SoapClient($mageUrl,
        array( 'soap_version'=>SOAP_1_2, 'trace'=>1,     'user_agent'=>'SoapMasterFlex',
        'login' => 'XXXXX', 'password'=>'XXXXX',
'trace' => 1, 'exceptions' => true
));

var_dump($soap);

echo $soap->__getLastResponse();

try {
$sessionID = $soap->login($mageUser, $mageApiKey);
}
catch (SoapFault $soapFault) {
    var_dump($soapFault);
    echo "Request :
", htmlentities($soap->__getLastRequest()), "
";
    echo "Response :
", htmlentities($soap->__getLastResponse()), "
";
}

Maybe someone could try making something like this work on their install?


texts: How we can get cross sell products in cart graphQl

texts:
We are trying to fetch cross sell products for Cart GraphQL below is our cart query
    cart(cart_id: "WOmTvENRZPd6FxVIsAHkTC1WZ5fFwDrr") {
      items {
        id

        product {
          cross_tier_id
          name
          sku
          stock_status
          __typename
          small_image {
            url
          }

        }
        prices {
          price {
            value
          }
        }
        quantity

      }

      prices {
        grand_total {
          value
        }
        discounts {
          amount {
            value
          }
        }
        subtotal_excluding_tax {
          value
        }

      }

    }

  }


texts: Magento 2 checkout - add a custom field between shipping address and shipping method

texts:
I'm trying to add a custom field in between the shipping address and shipping method sections. And I want values of this field to be stored in both quote and sales_order tables ultimately. This is something similar to adding an "order comment" field but this field should appear right after the shipping address section and before the shipping method section.

I went through Magento dev guides on how to add a custom field and a custom form to the checkout and implemented a solution to a certain extent.

What I have done so far:

Updated the checkout_index_index.xml layout, added a new uiComponent (a container) under the item "shippingAddress".
Added the element (field) I require inside the container.
Override the /js/view/shipping.js and shipping.phtmlin my custom module.
Invoked the above made container inside shipping.phtml in between checkout shipping address and shipping method (something similar to adding a new static form)

Now the field I want is being rendered on the onepage checkout exactly where I want. But I have met with below problems.

How to access the value of the custom field I have added above? I'm trying to save the value to a shippingAddress extension attribute. I added a mixin to setShippingInformationAction inside that try to do the below

shippingAddress['extension_attributes']['custom_field'] = shippingAddress.customAttributes['custom_field'];

But above code actually fails since the element is not in the shipping-address-fieldset. I might be able to get the value through the window element. But is there a way to access this through Magento?

Is there a way to save the value of this element in local cache storage (Magento_Checkout/js/checkout-data) so the value will persist even after a page refresh?


texts: I am a beginner. Could you please tell me how to get the current category ID on the magento2 category page? I want to show a specific banner in a specified category


texts: Do Magento2 support braintree payment method with google pay and apple pay

texts: How can i configured Apply pay and Google pay with magento2 using braintree


texts: Magento 2 Enterprise: Elasticsearch Indexing Issue

texts:
I have configured elasticsearch properly. I have tested the connection which result me success message.

The issue I am facing is I am not able to see products in my catalog category frontend. When I tried to look into the index created in elasticsearch I found it blank.

When I reindex I get this error

Design Config Grid index has been rebuilt successfully in 00:00:06
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search indexer process unknown error:
illegal_argument_exception: Illegal dynamic template parameter: [match_mapping]
Product/Target Rule index has been rebuilt successfully in 00:00:00
Target Rule/Product index has been rebuilt successfully in 00:00:00
Sales Rule index has been rebuilt successfully in 00:00:00

Whats this

 Catalog Search indexer process unknown error:
    illegal_argument_exception: Illegal dynamic template parameter: [match_mapping]

Why am I getting this error when using with elasticsearch. Is there something I have to map?


texts: What is the purpose of using quote_id_mask Table?

texts: What is the purpose of using quote_id_mask Table ?


texts: Login Does Not Work Because of Subdomain Cookie

texts:
We have a multi site/store which is on a subdomain level (Magento v1.14.1.0):

main.com
store1.main.com
store2.main.com

Logging in without the main.com frontend cookie enables the login in store1.main.com. However, if main.com is visited, another frontend cookie is created with the same value of the other store cookie.

frontend | somehashvalueofthecookie | .main.com
frontend | somehashvalueofthecookie | .store1.main.com

I tried to set the value in Cookie Domain setting in Magento Admin > General > Session Cookie Management per store but it does not have an effect.

There's an accepted answer here Can't login to second store on subdomain but it didn't do the trick. I already removed the third-party extensions.

Any idea? Thank you.


texts: Add to Cart via AJAX - should I add a configurable product with options or a simple product?

texts:
I have been trying to work out the correct way to add a configurable product to the cart via a custom end point.

$cart->addProduct($product, $params);

I want to know if it is okay for $product to be a simple product, or whether it is more correct for it to be the configurable product with the correct configurable attributes. Is there any difference, or advantage to either approach? Is it wrong to add a simple product to the cart like this, when it actually has a configurable product parent?


texts: Integrity constraint violations when inserting data

texts:
I have a basic table that I've added through my module. This table simply holds a product ID and a JSON string.
I am running an observer method via CRON. This method loops through the product collection and inserts a new row for each product that meets some basic conditions.
When I run the cron process, I can watch the table start to populate with data. After a couple dozen inserts, the table will truncate and start over trying to insert data. It never completely inserts all the rows. I will get the typical error:

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity
constraint violation: 1062 Duplicate entry '1444' for key 'PRIMARY''
in ...

The entry ID that shows as duplicate changes each iteration I run. I have logged the product IDs in this method (without doing inserts) and there are no duplicated values.
Of note is that my method does truncate the table before it inserts data, but this happens at the very beginning and not inside the loop.
1. Why am I getting duplicate entry violations when there are no duplicates?
2. When the cron process returns the error, is it attempting to re-run the same method again, which triggers my table truncate?

Sample Code:
public function updateTable() {
    $resource = Mage::getSingleton('core/resource');
    $table = $resource->getTableName('my_table');

    $write = $resource->getConnection('core_write');
    $write->truncate($table);

    $products = Mage::getModel('catalog/product')->getCollection();
    $products->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));

    foreach ($products as $product) {
        $sizesIn = array();
        $options = $product->getProductOptionsCollection();
        foreach ($options as $option) {
            $sizesIn[$optionTitle] = array();
            $sizes = array();
            foreach ($option->getValues() as $value) {
                if ($value->getCustomoptionsQty() > 0) {
                    $sizes[$value->getTitle()] = $value->getCustomoptionsQty();
                }
            }
        }
        $json = json_encode($sizesIn);
        // product_id = INT(10)
        // option_json = TEXT
        $data = array(
            'product_id' => $product->getId(),
            'option_json' => $json
        );
        $write->insert($table, $data);
    }

}

Table setup
<?php

$installer = $this;
$installer->startSetup();

$table = $this->getConnection()
    ->newTable('my_table')
    ->addColumn(
        'product_id',
        Varien_Db_Ddl_Table::TYPE_INTEGER,
        12,
        array(
            'unsigned' => true,
            'nullable' => false,
            'primary'  => true
        ),
        'Product ID'
    )
    ->addColumn(
        'option_json',
        Varien_Db_Ddl_Table::TYPE_TEXT,
        array(
            'nullable' => true,
            'default'  => null
        ),
        'Option JSON'
    );

$installer->getConnection()->createTable($table);
$installer->endSetup();


texts: How to get magento wishlist product list block on my custom phtml file?

texts:
I want to get my wishlist product list block actually available in wishlist landing page,

How to get this wishlist block in my custom phtml file?


texts: How to create a configurable product made of simple products in Magento 2?

texts:
I'd like to create a configurable product, a T-Shirt with different colors and size for example.
After following this tutorial http://www.webmull.com/magento-2-create-configurable-product/
It seems that the configurations are only virtual products and I didn't manage to get simple products, meaning no shipment possibility.

Do someone know a way to get around this?


texts:
I have created on configuration product, Price change on base 5 different attributes
( country, size, width, depth and metal) Product is based on ring.

Problem i am facing is that due to this 5 attribute structure. I must have to create lots of simple product, 1000 around.  country X size X width X depth X metal =1000 around

I don't think client will going to accept this flow, he will not going to create 1000 simple product.

Can anyone has better idea?


texts: Quantity in checkout shopping cart doesn't work properly for Magento

texts: On live server the cart is working correctly. I change the quantity of a product in the cart then I push the "Update cart" button and all works fine. I transferred the site another domain and the cart quantity doesn't work anymore. As I change the quantity of a product and click the button the quantity remains the same. If I go back and try to add the same product to the cart, even if I specify a different quantity like 10 and not 1, in the cart only 1 item is added every time I click on "add to the cart" button and not 10 as specified. I cannot figure out where's the problem. I excluded my custom theme and rolled back to the default theme and the problem persist. this site other functionality work fine.


texts: How add div after image block in Magento 2?

texts:
I want to add custom div after image block of product view page. In that div I will add custom html like add any text, image etc.

Anyone have idea how we add custom div by plugin or observer?


texts: Display parent category products in subcategory page

texts:
Let's say I have a simple categories tree like this one :

Category 1

Subcategory 1.1
Subcategory 1.2
...
Subcategory 1.675

Some products should be visible for all subcategories, without having to manually select the 675 subcategories. I'd like to only assign these products to Category 1. Then, when I go to Subcategory 1.675 page, I should see products directly assigned to Subcategory 1.675, but also those assigned to Category 1.

How to get this behavior ? A module, or some custom code to change product listing query ?


texts: Add inline style to element in XML Magento 2

texts:
How do I apply an inline style to an element in an XML layout file in Magento 2?

<container name="header.container" as="header_container" label="Page Header Container" htmlTag="header" htmlClass="header" before="main.content"/>

I am looking to add inline styles to the header element above, but I cannot find any reference on how to do this, I tried htmlStyle and this does not appear to work.


texts:
In my template I iterate over a collection of 4 simple products. Each time I call

$this->getChildHtml('myblock', false)

Depending on the settings of the simple products there is always another content that should be loading.
But only the first block is correct. The other blocks have always the same content as the first one.

I use no magento cache to develop.
What magic is magento using here?


texts: How to set price to be £9.99 including VAT at 20%

texts:
I notice that in the release notes for Magento 1.8.0 (http://www.magentocommerce.com/knowledge-base/entry/ce-18-later-release-notes) it says the following:-

"Specifying that prices display in the web store excluding tax and setting a 20% tax rate (or discount rate) now calculates the grand total correctly. It is now possible to have grand totals in amounts like 6.99, 9.99, or 99.99—regardless of the currency units used in the web store. "

But, it does not say how to achieve this?

I have a store where the prices are entered ex VAT. VAT is 20% - and this is then applied to the product price and the Including VAT price shown on the front end.

I wish to have a final including VAT price for a product being £9.99

But - if I enter 8.32 in the admin Price - it results in 9.98 on the front end. If I enter 8.33 it results in 10.00 on the front end.

How do I achieve the £9.99 price that the release notes say is now possible with a Tax rate of 20%?

Cheers


texts: Magento 2 setup:upgrade Change Dark Blue Color

texts:
Silly questions, but a feasible one.

Where can you change the system color for setup:upgrade from the CLI or anything really using that awful dark blue.

You can never read it unless there is an error. Be a lot nicer to see what's populating especially when you add new modules without being 3 inches from the screen just to verify it's there.


texts: Add custom attributes to Add Product Page without use Attribute Set

texts:
I want to add 2 attributes are following to Add Product Page in Magento2 without use Attribute Set.
Thank in advance!


texts: Disable add to cart button on specific products

texts: On the product page, I want to disable add to cart button on specific products.


texts:
We're updating our website. We need the home page to basically have no background and we're loading images on them. You can see how this works in the images.

Current Home Page:

Has white background
Products page has white background

New Home Page:

Has no background
Products Page needs white background

I know it's a css thing, but can't seem to figure out what I need to do.


texts: How To Add Extra Multiple Image Attribute Backend Product Form - Magento 2

texts:
How Can Add Extra image upload attribute in Backend form Like Screenshot.

I Follow this link "magento 2 how to upload images and videos in custom module" but not working.

Not use in custom module use in product form.


texts: Magento 2 :How to override Magento\Sales\Model\Order\Email\Sender.php model?

texts:
Is their any way we can override Magento\Sales\Model\Order\Email\Sender.php model in magento 2 module ?
I have created below files
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Sales\Model\Order\Email\Sender" type="Mod\Sales\Model\Order\Email\Sender" />
</config>

app/code/Mod/Sales/Model/Order/Email/Sender.php

I have added log in
protected function prepareTemplate(Order $order)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/prepareTemplate.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('$templateId');

but log did not generated.
Any thoughts ?


texts: Hiding Shipping Method for current Logged in/Guest user if a condition method

texts: I'm using Magento 2.1. Currently, I'm having two shipping methods. One is UPS and another is Flatrate. If my product's attribute returns true, I want to hide Flatrate shipping method from frontend only, for Logged in/Guest User and if the product's attribute returns false I have to hide the UPS shipping method. How can I write the code for the same in my custom module.


texts:
I tried to run Magento 2.1.1 in my server but it seems that my checkout page isn't displaying anything, just header and footer.

Some error is generated:

  Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
  to allocate 826253 bytes) in
  /home/ourshop/public_html/migrate/vendor/magento/framework/View/Result/Page.php
  on line 311


texts:
I am with magento 2.3.4,
and I want to capture the information:

product

order

client

I would also like to know how I can print the data on the console.
I am using the observer when ordering
checkout_onepage_controller_success_action
I am trying to capture the information from the observer but nothing shows me
<?php
namespace Nasser\Integracion\Observer;
use Magento\Framework\Event\ObserverInterface;
class Test implements ObserverInterface{

protected $_logger;
protected $requester;
protected $messageManager;
public function __construct(
    \Psr\Log\LoggerInterface $logger,
     \Nasser\Integracion\Helper\Requester $requester,
     \Magento\Framework\Message\ManagerInterface $messageManager
)
{
    $this->_logger=$logger;
    $this->requester=$requester;
    $this->messageManager = $messageManager;
}
public function execute(\Magento\Framework\Event\Observer $observer){
 $data = $observer->getEvent()->getData();
 $this->_logger->info('Data', $data);
// $this->messageManager->addNotice(__('Hola este'));
 $erpId = $this->requester->createPedido([]);
}}

I hope you can help me


texts: Magento2 custom theme suddenly stops working

texts:
First I have installed a third party theme Third/customtheme (its parent theme is Third/maintheme) and parent of Third/maintheme is Magento/blank  on my Magento2 installation, then using Third/customtheme as parent, I have created my own custom theme Anshu/mytheme.
It was working well and I did some template modifications and all are working fine.
Then, to do some css styling modifications, I copied below from parent theme.
app/design/frontend/Anshu/mytheme/Magento_Theme/layout/default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/styles.css" />
    </head>
</page>

app/design/frontend/Anshu/mytheme/web/css/styles.css

.header .logo{width: 100%;}

And after this mytheme stops working and now when I am seeing the page source files are are coming from the parent theme i.e. Third/customtheme.


texts: Magento : How Can We Mail a File From Frontend

texts:
In my website, I have an option to choose a file.

I want file to be mailed to a particular email-id.

Screenshot of the file upload screen

I want to have a button which should mail selected file to a particular email-id.

How can I achieve this ?


texts: Magento 2 EE has customer attribute option, I want to know what are the segments and how add attributes to desired places ?


texts: Magento 2 - Send processed data from Controller to PHTML

texts:
I am working on a simple custom module, where the user can input height and the weight/BMI will be shown as output on form submit. On clicking the submit button user will be redirected to different controller/action. Below is the code

        <form name="height" method="POST" action="<?php echo $block->getFormAction() ?>">

                <?php echo __('Enter Height:')?>
                <input type="text" id="calculateTotalInput" name="calculateTotalInput" class="form-control input-md">
                <input type="submit" id="calculateTotalSubmit"  name="calculate-total-submit" value="Calculate Total">

            <?php if(isset($weight && $bmi)){ ?>

                <?php echo __('Height:')?> <input type="text" value="<?= $weight ?>" name="weight" class="form-control input-md" readonly="">
                <?php echo __('BMI:')?> <input type="text" value="<?= $bmi ?>" name="weight" class="form-control input-md" readonly="">

            <?php } ?>
        </form>

Screenshot

Block File

<?php

namespace Magento2\HelloWorld\Block;

use \Magento\Framework\View\Element\Template;
use \Magento\Framework\View\Element\Template\Context;

class Index extends Template
{

    public function __construct(Context $context, array $data = [])
    {
        parent::__construct($context, $data);
    }

    /**
    * Retrieve form action
    *
    * @return string
    */
    public function getFormAction()

        return $this->getUrl('helloworld/result/result', array('_secure' => $this->getRequest()->isSecure()));
    }

}

Controller File

<?php

namespace Magento2\HelloWorld\Controller\Result;

use \Magento\Framework\App\Action\Action;
use \Magento\Framework\Controller\ResultFactory;

class Result extends Action
{

    public function execute()
    {

        $post = $this->getRequest()->getPostValue();

        if ($post) {

            //retrieve height
            $calculateTotalInput = $post['calculateTotalInput'];

            //calculate weight/bmi
            $weight = ($calculateTotalInput * 2)/2.5 //some calculations
            $bmi    = ($calculateTotalInput * 2)/3.5 //some calculations
        }
        // Render the page
        $this->_view->loadLayout();
        $this->_view->renderLayout();
    }

}

How do I pass & display $weight and $bmi value in phtml file ?
Best practice to pass values from controller to phtml ? Using block
or without block and if yes, then HOW?
How do I pass an array containing multiple values from a controller to
phtml via JSON?
What is the difference between Jsonfactory and Pagefactory and when
to use?


texts: Getting this error in my contactformpage

texts:
Hi I am facing the following problem. Currently using Magento 2.3.3
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value 'Assignment1\crudform\Block\ContactForm' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'. Line: 821
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value 'Assignment1\crudform\Block\ContactForm' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'. Line: 821
and here is my code
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Assignment1\crudform\Block;

use Magento\Framework\View\Element\Template;

/**
 * Main contact form block
 *
 * @api
 * @since 100.0.2
 */
class ContactForm extends Template
{
    /**
     * @param Template\Context $context
     * @param array $data
     */
    public function __construct(Template\Context $context, array $data = [])
    {
        parent::__construct($context, $data);
        $this->_isScopePrivate = true;
    }

    /**
     * Returns action url for contact form
     *
     * @return string
     */
    public function getFormAction()
    {
        return $this->getUrl('crudform/index/post', ['_secure' => true]);
    }
}


texts:
I have upload a 2.0.1 site to our production server and all is good apart from a number of the Admin Pages.

ie .

  Sales > Orders are missing the Table headers styling.

Can anyone suggest a solution as to why this is happening and a fix please.

Correct Local Copy

Remote copy missing the Table Headers


texts: Call getMinimalPrice() on a single product entity with tier prices

texts:
I want to display the minimal tier price on my product page and wherever I load my product model. I am using the basic function to get price data:

$this->getPriceHtml($product, true);

When this is called on the product collection (such as a category page) it works fine. When I call getPriceHtml on a product model instance (loaded with Mage::getModel('catalog/product')->load($id), if I dump the product data then getData('minimal_price') does not exist.

I'm thinking that when loading the collection,

 ->addMinimalPrice()

is added to the collection, but this is missing from the single entity load. Therefore my question is, do I need to include some other method/helper/model when loading product in order for the minimal price to also be loaded?


texts: Remove Cart Items Automatically Magento 2

texts:
I'm having a trouble with my Magento 2 store. I need to clear all items of users carts programmatically.

If user don't purchase his cart, it'll be cleaned.

Do you have any idea of how can i do that?

Thanks


texts: Magento 2.2.3 Group Product display out of stock in frontend side

texts:
I have created one group product and assign simple product in that.
All simple product qty and status is enable.
But group product display out of stock and not display Add to Cart button


texts: Magento 2 - Best way to check if the current category is child

texts:
I want to change the design of my store depends of the categories and subcategories.

I need to check if the current category is subcategory and if is subcategory then display something there.

I made this before in Magento 1.9 with the getLevel function:

$isLevel3 = $_category->getLevel() == 3;
if ($isLevel3) {

how I can get the Level in Magento 2 version?

Thank you

Edit:

I get the subcategories level in Magento 2 like this:

$_category  = $block->getCurrentCategory();
         $categoryFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
         $categories = $categoryFactory->create()
                ->addAttributeToSelect('*')
                ->setStore($store)
                ->addFieldToFilter('is_active', '1')
                ->addFieldToFilter('include_in_menu', '1')
                ->addAttributeToFilter('level',3);
        $last = count($categories);
        $_category  = $block->getCurrentCategory();
        foreach ($categories as $ficategory):
                if($ficategory->getLevel() == 3) {
                    $mydiv = "subcategory";
                }
        endforeach;

But how I can check if the current category is Level 3?


texts: Multiple Regions in Customer Registration Form

texts:
We need to add a US/Canada <option> element before region_id to select US or Canada in the Registration Form, and change the region_id <option> element based on if the user selects either using javascript. Here is the current template, which looks similar to the magento default:

    <?php echo $this->__('State/Province') ?> *
    <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
       <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
    </select>

    <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />

In the Admin panel under System -> Configuration -> General, Countries allowed are United States and Canada. If I can pull these both separately into a javascript array then switching them will be much easier. How can I accomplish this?

Edit: Just had an idea for this, is it possible to detect if the visitor is in US/Canada based on $_SERVER environment variables to auto select a region to populate State/Providence once and not involve javascript?


texts: How to add new/custom module to magento admin?

texts: In here I have not experience with building a custom modules to magento admin panel. So I need to know useful links or tips to build that.


texts: Reading existing entities with multiple conditions

texts:
I can get data from database by calling model factory in controller.

class Index extends \Magento\Framework\App\Action\Action{

protected $_entityFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \My\Module\Model\EntityFactory $entityFactory
){
    $this->_entityFactory = $entityFactory;
    return parent::__construct($context);
}

public function execute(){
    $entity = $this->_entityFactory->create();

    // get data where entity_id = 1
    $entity->load(1);

    // get data where entity_name = Rizki
    $entity->load('Rizki', 'entity_name');
}

Now, i want get data with multiple condition. I have tried

$entity->load(['Rizki', 'entity_name'], ['Bandung' => 'address'])

But it gives me error Exception #0 (Exception): Notice: Array to string conversion.


texts: How to secure magento store with password protected with htacess?

texts: My site is running on the server .I want to make it password protected by using htacess but i am confused about the htacess file location


texts:
I'm trying to get all parent categories except root category from the collections returned using Mage::getModel('catalog/category');

My code :

$_category = Mage::getModel('catalog/category');
    $_categories = $_category
                    ->getCollection()
                    ->addAttributeToSelect(array('name', 'image', 'description'));

    foreach ($_categories as $_category){
        print_r($_category);
        die(0);
        echo $_category->getName().'<>';

}

Output is :

Mage_Catalog_Model_Category Object (
    [_eventPrefix:protected] => catalog_category
    [_eventObject:protected] => category
    [_cacheTag:protected] => catalog_category
    [_useFlatResource:protected] =>
    [_designAttributes:Mage_Catalog_Model_Category:private] => Array (
        [0] => custom_design
        [1] => custom_design_from
        [2] => custom_design_to
        [3] => page_layout
        [4] => custom_layout_update
        [5] => custom_apply_to_products
    )
    [_treeModel:protected] =>
    [_defaultValues:protected] => Array ()
    [_storeValuesFlags:protected] => Array ()
    [_lockedAttributes:protected] => Array ()
    [_isDeleteable:protected] => 1
    [_isReadonly:protected] =>
    [_resourceName:protected] => catalog/category
    [_resource:protected] =>
    [_resourceCollectionName:protected] => catalog/category_collection
    [_dataSaveAllowed:protected] => 1
    [_isObjectNew:protected] =>
    [_data:protected] => Array (
        [entity_id] => 1
        [entity_type_id] => 3
        [attribute_set_id] => 0
        [parent_id] => 0
        [created_at] => 2013-09-14 12:39:35
        [updated_at] => 2013-09-14 12:39:35
        [path] => 1
        [position] => 0
        [level] => 0
        [children_count] => 45
        [name] => Root Catalog
    )
    [_hasDataChanges:protected] => 1
    [_origData:protected] => Array (
        [entity_id] => 1
        [entity_type_id] => 3
        [attribute_set_id] => 0
        [parent_id] => 0
        [created_at] => 2013-09-14 12:39:35
        [updated_at] => 2013-09-14 12:39:35
        [path] => 1
        [position] => 0
        [level] => 0
        [children_count] => 45
        [name] => Root Catalog
    )
    [_idFieldName:protected] => entity_id
    [_isDeleted:protected] =>
    [_oldFieldsMap:protected] => Array ()
    [_syncFieldsMap:protected] => Array ()
)

May be I need to add an extra attribute for this? Any other idea please share


texts: how to setup different languages in magento 2.1.6 version

texts:
I have a doubt regarding language setup. My default language is ENGLISH and I need to add ARABIC language along with ENGLISH.When we click on ARABIC language same store view with the same theme will be translated to ARABIC from ENGLISH.

Firstly I created Arabic Store view in the admin panel. And theme will be selected for particular store view in the edit of language store view. What is the next process?

Will you please send me any idea and the way to setup language?


texts: Filter product attributes by name with PHP?

texts:
Is it possible to get a products attributes collection and filter that by name? I want all attributes of a product that end with _whatever.

Possible?


texts: Magento 2 get database prefix on install data

texts:
How to get database table prefix on install data? It is showing "table or view not found".

<?php

namespace ...;

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

class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

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

    /**
     * {@inheritdoc}
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

            $setup->getConnection()->query("INSERT INTO `sales_order_status`(`status`, `label`) VALUES ('test','Test')");

        $setup->endSetup();
    }
}

It is giving error 'table or view not found'


texts: Magento 2 Category Tree With Multiselect and Text box in Custom Page

texts:
I am looking solution to get a Category tree on a custom page and parallel a text box, where the admin user could add some text and in parallel, he can select multiple categories. After adding text and selecting categories, there should be a save button so he can save this data in a custom table.
Please suggest how this can I do, I am not getting any solution for the category tree.
If anybody has an idea, please share me to implement it.


texts:
I've been building a form lately, on a CMS Page. But something strange happens, when I add the following HTLM :

<input class="input-text" type="text" name="code" placeholder="My text here"/>

and hit "Save" then the page is displayed correctly. However, if I want to add in another edit for that CMS Page, then when showing the code (via the "Show/Hide Editor" button), then my placeholder is gone.

Does anyone know what's going on here?


texts: Magento 2.1 EntityManager getList without Collection

texts:
From my understanding, the classic Magento Models will be deprecated in favor of the new EntityManager.

Loading and Saving Simple Objects is no problem so far, but currently, I'm stuck with loading Lists of DB entities.

So my question is: How can I load a List of Entities without utilizing the Collection Resource Model?

As far as I have come it seems that this is simply not implemented yet, since there are no db operations for such task https://github.com/magento/magento2/tree/develop/lib/internal/Magento/Framework/EntityManager/Db


texts: Price filter - override default behaviour to not subtract 0.01 from maximum price

texts:
I have installed the Layered Navigation SEO extension from Catalin (http://www.magentocommerce.com/magento-connect/layered-navigation-seo.html) and I have noticed an issue which manifests itself with the price slider functionality of this extension.

Magento's default behaviour with price filtering is to create ranges, and all these ranges, except the uppermost one, have the maximum price set to 0.01 lower than the beginning of the next range.

What this means is that with the aforementioned extension, although you select whole numbers in the slider (and the filter it adds to the URL has these whole numbers), Magento still subtracts 0.01 from the maximum price. This is especially not desirable when the user has just set a minimum price as it has the effect of hiding any products at the top of the range too.

To attempt to resolve this, I changed the range label value returned by Magento by overriding the _renderRangeLabel() function in app\code\core\Mage\Catalog\Model\Layer\Filter\Price.php - but this still actually filters with the maximum value subtracted by 0.01.

I have tried to identify where this value is subtracted for the search, but have been unable to identify it. Does anyone know the best way to resolve this?


texts: How to Set Product video url Programitically in magento2.2?

texts:
I have created a script for import CSV products everything's working perfect but one issue is product video url not set.

<?php
use \Magento\Framework\App\Bootstrap;
include('app/bootstrap.php');

// add bootstrap
$bootstraps = Bootstrap::create(BP, $_SERVER);
$object_Manager = $bootstraps->getObjectManager();

$app_state = $object_Manager->get('\Magento\Framework\App\State');
$app_state->setAreaCode('frontend');

$set_product = $object_Manager->create('\Magento\Catalog\Model\Product');

try{
     $set_product->setWebsiteIds(array(1));
     $set_product->setVideoUrl('youtub.com/magento');
     $set_product->save();
}
catch (\Exception $e) {
    echo $e->getMessage();
}

But it's not working.


texts: Magento 2 how to get Purchase Point from order collection factory?

texts:
I'm trying to get order purchase point (store where it was purchased), I have tried this:
$order->getPurchasePoint();

It did not work, any ideas?
here is my code
 public function execute()
    {

        $date = date('m-d-Y');
        $filepath = 'export/orders-'.$date.'.csv';
        $this->directory->create('export');
        $stream = $this->directory->openFile($filepath, 'w+');
        $stream->lock();

        $header = ['Id', 'Status','Store'];
        $stream->writeCsv($header);
        $collection = $this->getOrderCollection();

        foreach ($collection as $order) {
            $data = [];
            $data[] = $order->getId();
            $data[] = $order->getStatus();
            $data[] = $order->getPurchasePoint();
            $stream->writeCsv($data);
        }

    }

    public function getOrderCollection()
    {
    $collection = $this->orderCollection->create()
    ->addAttributeToSelect('*')
    ->setOrder('created_at','desc');
    return $collection;
    }


texts: Multiple Websites - which data is shared?

texts:
I need your help.

I want to create a second store in my current Magento setup. I want to use this second store only in the backend, because b2b orders are inserted manually. Usually I can switch between different views in Magento to only view the data for a specific store view (e.g in the products section this is the case)

I am bit confused now, because I set up a second website, with a store and storeview. The storeview is set to Status to "Deactivated" because I will not use it on the frontend.

Questions:

However, when I see it correctly the orders and customers are showed in the backend for both Websites. I can select a customer which has been registered in the B2C Store and insert an order for the b2b store. The orders are also shown together regardless if they have been placed for website 1 or website 2. Is this correct, that two websites share customer and order data?
I also can use the same catalog of the b2c store (Root Catalog) but have to enter the products twice. Correct? I will have different products in both stores but also some of the b2c products are also available in the b2b store - so I have to enter these products twice, correct?

Thanks for clarification!


texts: What controller is called when category is clicked from top menu in Magento 2

texts:
I want to know which controller is called when I click on category from the top menu bar.
For eg : When I click on Men it opens page with url http://127.0.0.1/Magento21/men.html. But I don't see any controller name in the url.
What controller is called in here?


texts: Cart summary_count not updated when "add to cart" is pressed

texts:
I'm using the following code to show the total number of items in a users cart:

It works and shows the correct number of items, but when "add to cart" is pressed and the item is added the value isn't update unless the page is refreshed.
Any idea what I'm doing wrong?


texts: How to add the configurable product to Cart from list page itself

texts:
In magento 1.9.2.2, Iэve enabled the configurable swatches for the attribute color in product list page. But when I click add to cart button, it redirects to product details page. From there when I select the color and add the product to cart it is added to cart. I want to add it directly from list page without coming to product details page and selecting it.

Here is my code to add it directly to cart from list page,

<?php if($_product->isSaleable() ): ?>

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>

<?php elseif($_product->isConfigurable() ): ?>
    <?php $options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct()); ?>
            <?php
            foreach($options['attributes_info'] as $key => $value){

<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>

            }
            ?>

<?php else: ?>

<?php echo $this->__('Out of stock') ?>

<?php endif; ?>

But it is redirecting to details page. Where have I went wrong? Someone please help


texts: required fields are required but not displayed on shipping address

texts:
Im using magento 2.3.3, when I try to submit chekout order, it does not show some fields and it gives me:

Please check the shipping address information. "firstname" is required. Enter and try again. "lastname" is required. Enter and try again. "city" is required. Enter and try again.

please help


texts: Magento 2.1 Enterprise Edition: CMS hierarchy nodes where page_id is NULL

texts:
I have noticed an odd issue with Magento 2.1 EE where we end up with hierarchy nodes as part of the Magento EE CMS hierarchy feature which do not relate to any page_id, see the attached screenshot below. This seems quite nonsensical to me, as these nodes essentially represent the position of pages in the page hierarchy.

Due to this, I am having some issues on the (custom) front-end which tries to utilize these nodes under the assumption that they all relate to a page. Furthermore, this issue also extends to the Magento 2 hierarchy manager in the back-end, which throws exceptions when trying to insert a page into the hierarchy when (usually unique) request_url + store id is already taken up by a broken entry.

Now, what I don't get is how these entries exist. We have not modified the node insert logic at all, so I am leaning to say that this is a core bug, but I have no proof at this moment. I was wondering if anyone else has experienced this issue or if other users of the Enterprise Edition CMS Page Hierarchy may also find similar broken entries via SELECT * FROM magento_versionscms_hierarchy_node WHERE page_id IS NULL;.

Any shared experiences and hints are appreciated, if it's indeed a core bug I would want to forward it to the Magento team, but I am kind of missing the exact point in the logic where this issue occurs.


texts: Unit test case for custom module REST API

texts:
I wanted to write unit test case for custom REST API in magento2.

I have already gone through the : http://devdocs.magento.com/guides/v2.0/get-started/web-api-functional-testing.html

I am getting confused as the code example in the link above is written in Magento's namespace. Can anyone tell me how I can write unit test for testing the API's?


texts: Autocomplete works on second refresh in Magento2.2.5?

texts:
Autocomplete is not working after first page load, works only on second refresh.

I don't know what is the issue.

Here is my code.

<?php
$url = "http://code.jquery.com/ui/1.10.0/jquery-ui.js";
?>
<script>
   require.config({
       map: {
           '*': {
               'storemanage':  '<?php echo $url ?>'
           }
       }
   });
</script>
<link href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel ="Stylesheet">
<script>
    <?php
    $zipdata = array();
    $zipval = array();
    $zipdt = array();
        foreach ($storeCollection as $key => $value){

            if ($value['lat']==0 || $value['lon']==0){
                continue;
            }
            $lab = $value['name'].', '.$value['city'].', '.$value['state'].', '.$value['zip'];
            $zipdata[]  = $lab;
            $val = $value["store_id"];
            $zipval[] =  $val;
            //$zipdt[] =  {"value":$val ,"label": $lab};
        }
        if(count($zipdata) > 0){ ?>
            require(['jquery', 'storemanage'], function(jQuery, storemanage){
                jQuery(document).ready(function(){

                    var zipdata = <?php echo json_encode($zipdata); ?> ;
                    var zipval = <?php echo json_encode($zipval); ?> ;
                    var i;
                    var zipdt = Array();
                    for (i = 0; i < zipval.length; i++) {
                      zipdt[i] = {"value": zipdata[i] ,"id": zipval[i]};
                    }
                    //console.log('zipdt',zipdt);
                    //zipdt = data;
                     jQuery( "#retailer" ).autocomplete({
                        source: zipdt,
                        //autoFocus: true,
                        select: function (event, ui) {
                            var value = ui.item.value;
                            var label = ui.item.id;
                            jQuery("#retailerid").val(label);

                        },
                        change: function(event, ui) {
                                  if((ui.item === null)){
                                    jQuery("#retailer").val("");
                                  }
                              },
                    });
                });
            });
        <?php } ?>
</script>

Any help would be appreciated.


texts: Original price in Sales Order not appearing

texts:
I have Magento 1.7x Installed

I have a concern if someone can guide me if I have setup something wrongly...

I have Product X with Price 100 and Special Price 80

When Customer place the order, it charge custoemr 80 Rs. for obvious reasons but when I look into order through admin panel, it's not showing 100 (which is MRP) anywhere nor customer can see how much discount he got in his order or his "My account" section!

I thought this would be by default functionality available but unfortunately I am not getting it.

Any suggestions will be appreciated!


texts: Non-admin backend user can't reset users passwords

texts:
Hi I am having n issue where users in the admin panel that don't have full admin privileges cannot reset frontend users passwords.

It asks for the "Admin Password" to reset them and ideally I would like "Moderators" to be able to do this.

Has anyone seen a workaround on this I had a Google and came up with nothing!


texts: Editing theme's less files doesn't reflect in the website

texts:
I'm new to Magento. I have recently purchased a Magento theme from Themeforest, I found that there are no .css files there, instead there are only .less files, so I edited them but nothing happens in the website, nothing at all! Is there any specific command I have to run?
 And what is the right way to edit theme's stylesheet in Magento?
- Magento v2.2.3
- Mode: Default Mode.


texts: How to implement Cloudways CDN on Magento2

texts:
I have a website which is hosted on Amazon AWS EC2 and Domain is on 123-reg, I have pointed domain via AMAZON Elastic IP, Please see attached image, Now i want to setup CDN only for static files.
How to do that? Do I need to point whole DNS on cloudways?


texts:
I'm studying to get FE certification and I'm trying to add a link to top.links block adding this code to local.xml:

<action method="addLink" block="top.links">
            <label>shop</label>
            <url>http://google.com</url>
            <title>test</title>
        </action>

Although it works properly, I can't find any reference or example using the "block" parameter inside the "action" tag. Anyone knows which parameters are allowed in the action tag? thanks


texts: Show star rating on Catalog list page Magento 2

texts: I want to show product star rating for all the products even if there is no rating available


texts: Complete order of Stripe payment, get refund

texts:
I got some message like this in my email:
Payment Transaction Failed
Reason
Delivery date is required. Please select delivery date and proceed.
Checkout Type
onepage
Any help would be appreciated!


texts:
I have installed the Inchoo_Stripe extension which I found in https://github.com/Inchoo/magento2-Inchoo_Stripe and follewed this tutorial: http://inchoo.net/magento-2/implementing-payment-gateway-magento-2/ .

I have created a test account in stripe. Got an API key.
After lots of search on internet managed to get it on frontend. I used a test credit card info as:

card no: 42424242424242
cvc: 123
expiry date: some future year and month.

as I click place order I get error as follow:


texts:
My icons eg add to cart as well as arrows on moving banners have disappeared.
Please refer to the pic attached (product3). How do I make it right?

Thanks


texts: How can I execute a extension from the vendor’s bin folder?

texts:
Hi I install a  extension magerun2 using composer which is install in vendor . now how I can execute it from vendor as on root director it is showing no command found

Manual for this is https://github.com/netz98/n98-magerun2

Install with Composer
Require Magerun within the Magento (or any other) `project and you can then execute it from the vendor’s bin folder:`
composer require n98/magerun2
# ...
./vendor/bin/n98-magerun2 --version
n98-magerun2 version 1.3.2 by netz98 GmbH


texts: Magento 2.3.0 add custom JS in theme, using require js

texts:
I want to add a custom js - pricing.js in my theme folder using require js

I call the script in defaultheadBlock.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="//fonts.googleapis.com/css?family=Open+Sans:400,600,300" src_type="url" />
        <css src="//fonts.googleapis.com/css?family=Rubik:300,400,500|Covered+By+Your+Grace" src_type="url" />
        <css src="bootstrap/bootstrap.min.css" />
        <css src="css/slick.min.css" />
        <css src="css/magnific-popup.css" />
        <css src="font/icont-fonts.min.css" />
        <css src="css/style.css" />
        <css src="css/animate.css" />
        <css src="css/labs.css" />
        <css src="css/masonry.css" />
        <css src="css/custom.css" />
        <script src="js/pricing.js" />
    </head>
</page>

Also added the code in require-config.js

var config = {
    paths: {
        "bootstrapminify":  'Magento_Theme/js/bootstrap.min',
        "slick": 'Magento_Theme/js/slick.min',
        "tonyMenu":'Magento_Theme/js/tonyMenu',
        "sliders": 'Magento_Theme/js/sliders',
        jquery_bridget: 'Magento_Theme/js/jquery-bridget',
        "isotope": 'Magento_Theme/js//isotope.pkgd.min',
        countdown_pl: 'Magento_Theme/js/countdown/jquery.plugin.min',
        countdown_cd: 'Magento_Theme/js/countdown/jquery.countdown.min',
        "calculator_home": 'Magento_Theme/js/pricing'
    },
    "shim": {
        "bootstrapminify": { deps :['jquery'] },
        "slick" : { deps :['jquery'] },
        "tonyMenu" : { deps :['jquery', 'slick'] },
        "sliders" : { deps :['jquery', 'slick'] },
        jquery_bridget : { deps :['jquery'] },
        isotope : { deps :['jquery', 'jquery_bridget'] },
        countdown_pl : { deps :['jquery'] },
        countdown_cd : { deps :['jquery', 'countdown_pl'] },
        "calculator_home": { deps :['jquery','bootstrapminify'] }
    },
    deps: [
        'Magento_Theme/js/theme'
    ]
};

but after chcking the code I found the script is being called but on clcking the pub/static/ url is not found  error.

enter link description here


texts:
1: there is product detail, a block appears which shows content from /themefile/a.phtml

only when user is online i can see path while enabling developer mode from admin

but when i am not logged in ,i can not see that block and also content of that file /themefile/a.phtml

i am unable to find it where it is defined or written in such large codebase , i looked in theme's catalog.xml but could not find any such refernce to that .

how can i find it , i am stucked from whole day , can any one help me how can i located it ??..


texts: Change background color Magento 2 header panel and compile less on Staging server

texts:
In /app/design/frontend/MyThemeName/my-theme/web/css/source/_theme.less I added  @header-panel__background-color: @color-green-green1;

To change the background color of the header panel (I have a child-theme based on Luma theme).

After I made changes in _theme.less I did on my Local environment:

rm -R pub/static/*
php bin/magento setup:static-content:deploy nl_NL

But the only way to see my changes is when I go to my Magento Admin panel and Flush Static Files Cache in the admin panel.

1) Is there a method to do this using command line only?

(anyway locally my changes are visible now)

Now I commit _theme.less and push it to my remote repository. From this remote repository I pull _theme.less into my Staging server and run the following commands, to compile my less on the Staging server:

rm -R pub/static/*
bin/magento setup:static-content:deploy nl_NL

2) But I can't get my changes visible in the front-end on the Staging server? What do I have to do?


texts:
Can any one please tell me what is the difference between automating through MTAF and normal Selenium + TestNG?

What can I achieve from MTAF which I can't achieve using Selenium+ Java+ TestNG ?

Thanks for your help


texts: Magento 2 - Change text direction of "Regular Price"

texts:
I have just migrated from Magento 1.9 to Magento 2 with the standard luma theme.
For all my products with a special price, it displays like this:

I have created a new theme based on the luma theme so that I don't make changes to the core files.
How do I reconfigure this line so that it doesn't have a break on each word?
It would be better if it was just on one line.
Thank you.


texts: Magento 2 REST API - Creating cart price rule is not working

texts:
I'm trying to create a cart price rule via REST API but always get error 400 Bad request with message: Specified request cannot be processed.
I even try to use minimum request body (only required fields) on a fresh Magento installation to ensure no extension causes the error but still no luck. There's no log in exception.log to investigate.
I still can use REST API for other things, just creating sale rule is not working.
Please anyone can tell me what am I doing wrong. Below is my request detail. My Magento version is 2.3.3. Thanks.
POST /rest/v1/salesRules
{
  "rule": {
    "name": "Test API",
    "website_ids": [
      1
    ],
    "customer_group_ids": [
      0,1,2,3
    ],
    "uses_per_customer": 0,
    "is_active": true,
    "stop_rules_processing": false,
    "is_advanced": true,
    "sort_order": 10,
    "discount_amount": 1000000,
    "discount_step": 1,
    "apply_to_shipping": false,
    "times_used": 0,
    "is_rss": true,
    "coupon_type": "NO_COUPON",
    "use_auto_generation": false,
    "uses_per_coupon": 0
  }
}


texts: Magento 2 .Woff blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

texts:
Have a Magento 2.3 on Nginx. Trying to set up Cloudfront for /pub/static/ on subdomain like https://static.mydomain.com.

Base URL for Static View Files is https://static.mydomain.com.
Getting error for all files .woff:

Access to font at has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Get net::ERR_FAILED

Ngnix magento settings for /static/

location /static/ {
location ~ ^/static/version {
    rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}

location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
    etag on;
    if_modified_since exact;
    add_header Pragma "public";
    add_header Cache-Control "max-age=31536000, public";
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,X-CustomHeader,Keep-Alive,User-Agent,Origin,Referer,X-HTTP-Method-Override,X-Accept-Charset,X-Accept,Accept,Access-Control-Request-Method,Access-Control-Request-Headers,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
    add_header X-Frame-Options "SAMEORIGIN";
    expires +1y;

    if (!-f $request_filename) {
        rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
    }
}

location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
    add_header Cache-Control "no-store";
    add_header X-Frame-Options "SAMEORIGIN";
    expires    off;

    if (!-f $request_filename) {
       rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
    }
}

if (!-f $request_filename) {
    rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
}

add_header X-Frame-Options "SAMEORIGIN";

}

Still doesnt work. What Am I doing wrong here? Thanks


texts: How do I upload a 3D model image for a product in Magento 2?

texts: I want to upload 3D model image of a product that will be visible on frontend in product page.In magento 2.3, we can only upload image/video, but I want to upload 3D model for product also.Please anyone help me....!


texts: Hide current flag from language selector

texts:
Our shop has two store views. One is Dutch the other is English. We use the following code to show the flags to choose a view.

<?php if (count($this->getStores()) > 1): ?>

            <?php foreach ($this->getStores() as $_lang): ?>
                <?php $selected = $_lang->getId() == $this->getCurrentStoreId() ?>
                <a class="lang-flag<?php $selected && print ' selected' ?>" href="<?php echo $_lang->getCurrentUrl() ?>">
                    <img src="<?php echo $this->getSkinUrl('images/flags/' . $_lang->getCode() . '.png');?>"
                        alt="<?php echo $this->htmlEscape($_lang->getName()) ?>">

            <?php endforeach ?>

<?php endif ?>

Now we want to hide the flag for the current language. Because you don't need to see that. How can we create this?


texts: Resolved - Custom Module Layout File Doesn't Work - Magento 1.9

texts:
For some reason the layout file of my module stopped working, please help!

This is the module's layout file at ...

\app\design\frontend\rwd\default\layout\productcomment.xml

<layout>
   <catalog_product_view>
      <reference name="product.info">
          <block type="catalog/product_view_attributes" name="product.comment" as="additional" template="productcomment/productcomment.phtml">
                <action method="addToParentGroup"><group>detailed_info</group></action>
                <action method="setTitle" translate="value"><value>Product Comments</value></action>
          </block>
      </reference>
   </catalog_product_view>
</layout>

The same block in catalog.xml in the same directory works well (COMMENTED LINES):

<catalog_product_view translate="label">
    Catalog Product View (Any)

    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
            <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml">
                <block type="core/text_list" name="product.info.media.after" as="after" />
            </block>
            <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
                Alert Urls
            </block>

            <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>

            <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
                <action method="setColumnCount"><columns>6</columns></action>
                <action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
            </block>

            <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />

config.xml

<frontend>
    <layout>
        <updates>
            <productcomment module="Cpstest_ProductComment">
                <file>productcomment.xml</file>
                <file>adminproductcomment.xml</file>
            </productcomment>
        </updates>
    </layout>
</frontend>


texts:
Mage::registry('current_category')->getId();

This is not working for homepage . This it returns null. for this in Home page. (Not home Category).


texts: How do I get my product pages to all have the one column layout?

texts:
I only use simple products. Some of my product pages are set to one column and some are set to 2 columns right. I want all of them set to one column. I have a child theme that uses the catalog_product_view.xml. I have used to move blocks around, and everything works. I added layout="1column" to the page so it looks like this

page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"

And it doesn't work. I have flushed the cache but it hasn't made any difference. How can I set all product pages to just use one column layout?


texts:
My problem:

I am attempting to write a small Knockout JS app within Magento 2, I'm struggling to initialise the app as when I use ko.applyBindings(AppViewModel, document.getElementById("koTest")); it breaks the Knockout used by Magento and throws this error:

Uncaught Error: You cannot apply bindings multiple times to the same element.

I suspect it's because of:

I suspect this is because Magento 2 already uses ko.applyBindings() within app/code/Magento/Ui/view/base/web/js/lib/knockout/bootstrap.js. And as that doesn't specify a node I can't use ko.applyBindings again.

If I don't use ko.applyBindings(AppViewModel, document.getElementById("koTest")) in my code then my app doesn't initialise.

This makes me think I need to somehow use the ko.applyBindings() in knockout/bootstrap.js but I've no idea how, can anyone help? I have little experience with Knockout.

My Code

First name:

Last name:

Full name:

First name: <input data-bind="value: firstName" />

Last name: <input data-bind="value: lastName" />

Full name: <input data-bind="value: fullName" />

    <button data-bind="click: capitalizeLastName">Capitalise</button>


texts: Qty problem for bundle product Magento 1.9

texts:
I have one bundle product, and in that product default quantity is 1

But when am trying to add that product in cart getting this error

  This product is available for purchase in increments of 10 only

in

  app/code/core/Mage/CatalogInventory/Model/Stock/Item.php

Does anyone know what can be wrong here??
Many thanks


texts:
I have created a custom shipping module and have defined collectRates() and other functions in the module.

I also have onepage checkout enabled. In that page this new shipping module is not getting called. The shipping amount is coming blank.

What do I have to do to get my checkout page and my cart page to automatically call this module to show the right shipping price?

I am using Magento 1.9.2

My carrier class is:

<?php

// app/code/local/Envato/Customshippingmethod/Model
class Shopez_Customshippingmethod_Model_Demo
    extends Mage_Shipping_Model_Carrier_Abstract
    implements Mage_Shipping_Model_Carrier_Interface
{
    protected $_code = 'shopez_customshippingmethod';

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
        $result = Mage::getModel('shipping/rate_result');
        $result->append($this->_getDefaultRate());
        return $result;
    }

    public function getAllowedMethods()
    {
        return array(
            'shopez_standard' => 'Delivery Based on Cart Subtotal',
        );
    }

    protected function _getDefaultRate()
    {
        $rate = Mage::getModel('shipping/rate_result_method');

        $rate->setCarrier($this->_code);
        $rate->setCarrierTitle($this->getConfigData('title'));
        $rate->setMethod($this->_code);
        $rate->setMethodTitle('Delivery Based on Cart Subtotal');
        $rate->setPrice($this->getConfigData('price'));
        $rate->setCost(0);
        return $rate;
    }

    protected function _getStandardRate()
    {
        /** @var Mage_Shipping_Model_Rate_Result_Method $rate */
        $rate = Mage::getModel('shipping/rate_result_method');

        $rate->setCarrier($this->_code);
        $rate->setCarrierTitle($this->getConfigData('title'));
        $rate->setMethod('large');
        $rate->setMethodTitle('Delivery Based on Cart Subtotal');
        $rate->setPrice(1.23);
        $rate->setCost(0);
        return $rate;
    }

}


texts:
Is it possible  to put a bundle item inside another bundle item?
i have 2 products, each with their own options.. lets call it product A and B but the two items are compatible, You can insert A into B, but as i said A has its own options.

is this possible in magento? or do i need an extension for it?


texts: Get Only one website details in admin section Product Grid page

texts:
I am working on magento extension, i check this code is written in grid.php file for product listing.

Mage::getModel('core/website')->getCollection()->toOptionHash()

When print_r this then it is given me array of website like

Array ( [1] => Website1 [14] => Website2 )

but i want this function should written only one one website. In which manner i change this line so that it give me single website details.

Example: $website_id = 14;

Then i place this variable into this line then it gives me details of that variable website only like,

Array ( [14] => Website2 )

Function line of module is ,


texts: When i post a URL to Facebook I get html code showing in the post

texts:
When I post a link to Facebook I get the HTML code of the title showing in the post. As per this screenshot : http://prntscr.com/e858be

Can anyone advise why and if there is a way to stop this from happening ?

I am using Magento 2. The site is http://www.cellar2door.com/ and the link I was posting was http://cellar2door.com/thorn-clarke-terra-barossa-cabernet-sauvignon.html


texts: Change getFinalPrice () function magento

texts:
Good afternoon guys! I wonder if it is possible and what is the file (path) to change getFinalPrice () function in magento, because I need to add some fixed calculations about the product.

Thank you!


texts: Magento website transfer from server to local

texts:
I am transferring my website from a server to local. I did all database setting in local.xml file and change the url in core_config_data table.

But it showing me some error.

Decoding failed: Syntax error

Trace:
#0 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Helper\Data.php(659): Zend_Json::decode('', 1)
#1 C:\xampp\htdocs\lalco\app\code\community\MT\RevSlider\Model\Slider.php(246): Mage_Core_Helper_Data->jsonDecode(NULL)
#2 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Model\Abstract.php(226): MT_RevSlider_Model_Slider->_afterLoad()
#3 C:\xampp\htdocs\lalco\app\code\community\MT\RevSlider\Block\Slider\Preview.php(34): Mage_Core_Model_Abstract->load('3')
#4 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Abstract.php(919): MT_RevSlider_Block_Slider_Preview->_toHtml()
#5 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
#6 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#7 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#8 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('preface', true)
#9 C:\xampp\htdocs\lalco\app\design\frontend\mtcolias\lalcostore\template\page\1column.phtml(57): Mage_Core_Block_Abstract->getChildHtml('preface')
#10 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Template.php(241): include('C:\\xampp\\htdocs...')
#11 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template->fetchView('frontend\\mtcoli...')
#12 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template->renderView()
#13 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#14 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#15 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout->getOutput()
#16 C:\xampp\htdocs\lalco\app\code\core\Mage\Cms\Helper\Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#17 C:\xampp\htdocs\lalco\app\code\core\Mage\Cms\Helper\Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(SkyMagento_Redirect_IndexController), 'lalco-home-page')
#18 C:\xampp\htdocs\lalco\app\code\core\Mage\Cms\controllers\IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(SkyMagento_Redirect_IndexController), 'lalco-home-page')
#19 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Cms_IndexController->indexAction()
#20 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#21 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#22 C:\xampp\htdocs\lalco\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#23 C:\xampp\htdocs\lalco\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#24 C:\xampp\htdocs\lalco\index.php(92): Mage::run('', 'store')
#25 {main}

I am new on the magento. It takes my lots of time .please help me to find the solution

Thanks in Advance


texts: Magento 2 How to get all active shipping methods?

texts:
My magento version is 2.1.0. How can i get all active shipping method list?

Any help would be highly appreciate


texts:
I've taken over a project from someone else and am having trouble fixing a bug on the checkout/cart page. When an item is added and you're redirected to domain.com/checkout/cart when you try to remove the item, the page seems to reload but the item is still there until you manually refresh. Sometimes have the same issue with adding an item, won't appear until you refresh the page.

I've tried debugging in app/design/frontend/rwd/<theme>/template/checkout/cart.phtml but when trying to var_dump($this->getItems()) the page hangs and eventually crashes. I'm trying to see at what point the system recognises that items have been added/removed. How else can I go about outputting the items currently in the cart?

I have the other code that is generally linked to update not working

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php echo $this->getChildHtml('form_before') ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
    <?php echo $this->getBlockHtml('formkey'); ?>

It seems to be able to retrieve getItems() but unable to dump the returned data.

<?php foreach($this->getItems() as $_item): ?>
    <?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>


texts: dev.example.com Frontend Login Creates Sessions for example.com (Can't login)

texts:
I have two Magento 1.9.0.1 sites. One on example.com and one on dev.example.com

Production:

Cookie Path: (none)

Cookie Domain: example.com

Development:

Cookie Path: /

Cookie Domain: dev.example.com

I've cleared the /var/session/ directory from the development site, cleared the /var/cache/ directory, and removed any any all *.example.com cookies from my browser. As soon as I hit the homepage of the development site I get new cookies for both example.com and dev.example.com

The problem is that this is causing the famous "Can't login on the frontend" bug. Magento is seeing both cookies and cookies it should be reading.

Things I've tried to do to debug:

Checked Default vs Website vs Store settings. The development server always has dev.example.com for it's settings, while the production server always has example.com
Checked the frontend for iframes or other content loading example.com from dev.example.com Chrome Inspector shows nothing loading the production domain from the development site.
I've also checked the usual stuff, like making sure that the form_key is present, etc. This is definitely an issue of Magento creating a session/cookie using the wrong domain name.


texts: Remove label and value Tax from cart magento 2.1

texts:
i have a problem!
Necessity to delete label and value tax in to cart and checkout.
I not found the .phtml file to remove this.


texts: cart price rules collection filter with store id not working in magento1.x

texts:
cart price rules collection filter with store id not working in magento1.

$rules = Mage::getModel('salesrule/rule')
       ->getCollection()
       ->addStoreFilter($storeId);

OR

$rules = Mage::getModel('salesrule/rule')
       ->getCollection()
       ->setStoreId($storeId);

Both not working.
anyone have idea about store filter?


texts:
I have tons of cached files in var/cache/mage--... folders that are named like this:
BLOCK_EAAA81C2B03F53B9841775345609AD7DFA54C002_168_FINAL_PRICE_LIST_CATEGORY_PAGE_EUR_20210322_1_1_5
The file content has really long list of some policies and then price-box div html at the end.
They are big files and can take for example 100mb of space each. What might generate such files?


texts: Product Add to cart before I want to set Product custom option values in Magento2.2

texts:
I want to add product to cart with some product already create custom option values put. So what happen current magento create new product in cart while same product different custom options or values. I need same product but values increment.

Product in already created 2 custom options and not required so Add to cart before I want to put both custom options custom values. thanks


texts: Error While Compiling Magento 2 admin page module

texts:
I'm getting error while compiling the Magento 2 admin module. The error which I'm getting is

  Fatal error: Class Tutorial\SimpleNews\Controller\Adminhtml\News
  contains 1 abstract method and must therefore be declared abstract or
  implement the remaining methods
  (Magento\Framework\App\ActionInterface::execute) in
      /Applications/XAMPP/xamppfiles/htdocs/MagentoTest/app/code/Tutorial/SimpleNews/Controller/Adminhtml/News.php
  on line 60

Here is my code:

    <?php

namespace Tutorial\SimpleNews\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Tutorial\SimpleNews\Model\NewsFactory;

class News extends Action
{
    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry;

    /**
     * Result page factory
     *
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $_resultPageFactory;

    /**
     * News model factory
     *
     * @var \Tutorial\SimpleNews\Model\NewsFactory
     */
    protected $_newsFactory;

    /**
     * @param Context $context
     * @param Registry $coreRegistry
     * @param PageFactory $resultPageFactory
     * @param NewsFactory $newsFactory
     */
    public function __construct(
        Context $context,
        Registry $coreRegistry,
        PageFactory $resultPageFactory,
        NewsFactory $newsFactory
    ) {
       parent::__construct($context);
        $this->_coreRegistry = $coreRegistry;
        $this->_resultPageFactory = $resultPageFactory;
        $this->_newsFactory = $newsFactory;
    }

    /**
     * News access rights checking
     *
     * @return bool
     */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Tutorial_SimpleNews::manage_news');
    }
}


texts: Restrict product quantity drop down value

texts:
In all my product have 100 inventory, i want to display drop down in view page. I used below mention code

    <label for="qty"><?php echo $this->__('Quantity') ?></label>
    <select class="input-text qty" name="qty" id="qty">
<?php $i = 1 ?>
<?php do { ?>
<option value="<?php echo $i?>">
<?php echo $i?>
<?php $i++ ?>
</option>
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()) ?>
</select>

But problem is it showing all 100 i need only 10 product in that drop down