texts: Adding a custom dynamic block to checkout

texts:
I need to add 2 custom blocks, one on the cart page (below the totals) and one on the checkout complete page. I've searched the net and can find no information on how I can do this. These blocks will contain custom js and need to interact with a custom model. I know how to write the modules required but I'm stuck with the XML and where I should place the templates/layout.

Can someone please give me a very short example (the equivalent of a 'hello world' that displays a block on the cart page)?


texts:
Mage_Sales_Model_Quote_Item Object ( [_eventPrefix:protected] => sales_quote_item [_eventObject:protected] => item [_quote:protected] => Mage_Sales_Model_Quote Object ( [_eventPrefix:protected] => sales_quote [_eventObject:protected] => quote [_cacheTag:protected] => quote [_customer:protected] => Mage_Customer_Model_Customer Object ( [_eventPrefix:protected] => customer [_eventObject:protected] => customer [_errors:protected] => Array ( ) [_attributes:protected] => [_addresses:protected] => [_addressesCollection:protected] => [_isDeleteable:protected] => 1 [_isReadonly:protected] => [_cacheTag:protected] => customer [_resourceName:protected] => customer/customer [_resource:protected] => [_resourceCollectionName:protected] => customer/customer_collection [_dataSaveAllowed:protected] => 1 [_isObjectNew:protected] => [_data:protected] => Array ( [website_id] => 1 [entity_id] => 2 [entity_type_id] => 1 [attribute_set_id] => 0 [email] => vaibhav.ahalpara@brainvire.com [group_id] => 1 [increment_id] => [store_id] => 1 [created_at] => 2014-12-31T22:04:47-08:00 [updated_at] => 2015-01-01 06:24:25 [is_active] => 1 [disable_auto_group_change] => 0 [firstname] => Vaibhav [lastname] => Ahalpara [password_hash] => 7104e363950a3001347bfb592061ba9a:IbYSYS9uHK34kq6hZQJN3SxcGnv8MyZk [created_in] => English [default_billing] => 1 [default_shipping] => 1 [tax_class_id] => 3 ) [_hasDataChanges:protected] => 1 [_origData:protected] => Array ( [website_id] => 1 [entity_id] => 2 [entity_type_id] => 1 [attribute_set_id] => 0 [email] => vaibhav.ahalpara@brainvire.com [group_id] => 1 [increment_id] => [store_id] => 1 [created_at] => 2014-12-31T22:04:47-08:00 [updated_at] => 2015-01-01 06:24:25 [is_active] => 1 [disable_auto_group_change] => 0 [firstname] => Vaibhav [lastname] => Ahalpara [password_hash] => 7104e363950a3001347bfb592061ba9a:IbYSYS9uHK34kq6hZQJN3SxcGnv8MyZk [created_in] =>

how can i get value of attribute like

[lastname] => Ahalpara

how can i echo value of [lastname]


texts: how to call a grid file in form.xml in magento2

texts:
Hello everyone I want to call the grid file which is located below path

  Magneto\PopupQuestion\Ui\Component\Listing\Column\Products in form.xml

Who to write the class for it I have written like this item name="class" xsi:type="string"Magneto\PopupQuestion\Ui\Component\Listing\Column\Products</item>

But no output is coming.


texts: Query for counts of items on open-orders (1.9.x)

texts:
Does anybody have a query handy, or point me in the best direction for what tables to query, directly, to get a summary of.

{magento product ID, my SKU, qty of that product} on orders with status {Pending, Hold}.  I do not care about what orders they are associated with, customers, etc.

I have a whole set of programs that look at our ERP system, point of sale system, inventory reserve system and look at product availability and via API turns products with low qty off in Magento - works great, but these are not "magento aware" of new orders on the web and we do not process our web sales in real time, but I would like to add my open orders on my website into my availability counts and algorithms.


texts: How to show product custom image attribute on detail page in magento 2?

texts: I have created custom image attribute for the product. Now I want to show this image below the product price on the detail page.


texts:
How can a third party developer add a jQuery library to Magento 2?

While Magento 2 includes a version of jQuery in their frontend themes, the jQuery object is not immediately available in the global namespace.  I belive this is because Magento 2 uses RequireJS to pull in jQuery, and RequireJS won't load a module file until its needed.

This presents a problem for jQuery plugins. Normally, I'd include a plugin with HTML that looked something like this

<script type="text/javascript" src="http://magento-1-9-2-2.dev/js/commercebug/jquery-ui-1.8.custom/js/jquery.cookie.js"></script>

This, however, is not possible with Magento 2.  Because the jquery.cookie.js file defines the jQuery plugin by using the global jQuery object, it will fail in Magento 2 with a jQuery is not defined error.

How should a front end developer include a standard jquery plugin library in Magento 2's front end application?


texts: Magento 1.9 How to add custom field in checkout registration form

texts:
I have a question for my magento version 1.9.3.6, I create a module to add a custom field in Customer Registration Form and Checkout Registration Form.

config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Webcomnet_Field>
      <version>1.0.0</version>
    </Webcomnet_Field>
  </modules>
  <global>
    <helpers>
      <field>
        <class>Webcomnet_Field_Helper</class>
      </field>
    </helpers>
    <models>
      <field>
        <class>Webcomnet_Field_Model</class>
        <resourceModel>field_mysql4</resourceModel>
      </field>
    </models>
    <resources>
      <customerattribute1550847105_setup>
        <setup>
          <module>Webcomnet_Field</module>
          <class>Mage_Customer_Model_Entity_Setup</class>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </customerattribute1550847105_setup>
      <customerattribute1550847105_write>
        <connection>
          <use>core_write</use>
        </connection>
      </customerattribute1550847105_write>
      <customerattribute1550847105_read>
        <connection>
          <use>core_read</use>
        </connection>
      </customerattribute1550847105_read>
    </resources>
  </global>
</config>

install code:

    <?php
$installer = $this;
$installer->startSetup();

$installer->addAttribute("customer", "cod_univoco",  array(
    "type"     => "varchar",
    "backend"  => "",
    "label"    => "Codice Univoco",
    "input"    => "text",
    "source"   => "",
    "visible"  => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => ""

    ));

        $attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "cod_univoco");

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
        $attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100)
        ;
        $attribute->save();

$installer->endSetup();

Then I edited the files "register.phtml" to show the field in registration form, the file "form/edit.phtml" to show the field in edit form in customer account section and the file "billing.phtml" to show the field in checkout registration form.

The module works fine for the customer registration form and the edit form, the problem is in the checkout form, the field appear but if I insert a value that value is not saved.

What can I do? Thanks


texts:
Magento has a compilation mode in which you can compile all files of a Magento installation in order to create a single include path to increase performance.

Links for magento compilation mode:

http://www.magentocommerce.com/wiki/modules_reference/english/mage_compiler/process/index
http://alanstorm.com/magento_compiler_path

In my current shop setup, I have already configured apc to be used as an opcode cache, and am leveraging its performance gains. http://www.aitoc.com/en/blog/apc_speeds_up_Magento.html

My question are the following:

1) Is there any advantage of using apc over magento compilation mode, or vice versa? I have a dedicated server for magento, and am looking for maximum performance gains.

2) Will it be useful to use both of these togather? Why, or why not?


texts: What are the rules that govern which entity "wins" in the case of conflicting URL paths

texts:
If multiple entities (e.g. a category, a product, a CMS page and a module frontname) all attempt to use the same SEF URL, what is the algorithm or process that Magento uses to decide which will be saved in core_url_rewrite with the desired request_path, and which will have suffixes appended to resolve the conflict (e.g. 'sale-123.html').

To ask the question another way, if a CMS page and category both ask for 'sale' as their URL, which will win?


texts: Magento 2 - Override Reorder controller and skip some items from reorder

texts:
I have to skip some items when the customer does Reorder. For this, I have overridden the controller Using Plugin.

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Controller\AbstractController\Reorder">
        <plugin name="reorder" type="MyModule\MyReorder\Plugin\Reorder" sortOrder="1" />
    </type>
</config>

  Controller File

<?php

namespace MyModule\MyReorder\Plugin;

use Magento\Framework\Registry;

class Reorder
{
    /**
     * @var \Magento\Checkout\Model\Cart
     */
    private $cart;
    /**
     * @var \Magento\Sales\Controller\AbstractController\OrderLoaderInterface
     */
    private $orderLoader;
    /**
     * @var Registry
     */
    protected $_coreRegistry;

    public function __construct(
        \Magento\Sales\Controller\AbstractController\OrderLoaderInterface $orderLoader,
        \Magento\Checkout\Model\Cart $cart,
        Registry $registry
    ) {
        $this->_coreRegistry = $registry;
        $this->orderLoader = $orderLoader;
        $this->cart = $cart;
    }
    public function aroundExecute(
        \Magento\Sales\Controller\AbstractController\Reorder $subject,
        $result
    ){
    }
    public function afterExecute(
        \Magento\Sales\Controller\AbstractController\Reorder $subject,
        $result
    ) {
        $order = $this->_coreRegistry->registry('current_order');
        $cart = $this->cart;
        $reorderid =  $order->getIncrementId();
        $quote = $cart->getQuote();
        $quote->setReOrderId($reorderid);
        $cart->save();

        return $result;
    }
}

Please help me how to skip product with some ID in around Method.


texts:
Suppose i have array like this
[
    ['suplier1']
    ['suplier1']
    ['suplier1']
    ['suplier2']
    ['suplier2']
    ['suplier3']
    ['suplier3']
    ['suplier4']
]

And I want to create html element dynamically like below using loop

     Supplier 1
     Supplier 1
     Supplier 1

     Supplier 2
     Supplier 2

     Supplier 3
     Supplier 3

     Supplier 4

How can i do this ?
Note : i am implementing this stuff in knockout, i have added extension attribute of supplier in shipping method and i want to display supplier wise shipping method


texts: Magento single sign on from different servers

texts:
I have Magento running on one server and I would like to check from a different server, same domain, different subdomain, whether a customer is logged in. Basically customers log in to Magento and once I know they are logged in I would like to allow them to automatically log in to the site on my other server where I am not using php. Is there a way after I retrieve the Magento cookie to then ask Magento, using the API perhaps, whether the session is valid and the customer is currently logged in?

Thank you in advance for your time.


texts:
Can somebody tell me where is the path of the file that connects backend custom styling ( customize theme design ) with frontend?
or how to connect backend theme design customize option with frontend?


texts: Delete a configarables simple product from cart in observer

texts:
I'm currently able to change the way the cart works by updating the qty value in the cart, i do this by first deleting the item before it is re-added using the checkout_cart_product_add_before observer.
Here is my observer class (the simple products work but the configurable products do not delete)
<?php
namespace XX\XX\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use \Magento\Checkout\Model\Session as CheckoutSession;
use \Magento\Checkout\Model\Cart;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;

class DeleteAndReAddFromCart implements ObserverInterface {
    protected $request;
    protected $_cart;
    /** @var CheckoutSession */
    protected $checkoutSession;
    protected $configurableproduct;
    public function __construct(\Magento\Framework\App\RequestInterface $request, cart $cart, CheckoutSession $checkoutSession, Configurable $configurableproduct) {
        $this->_cart = $cart;
        $this->request = $request;
        $this->checkoutSession = $checkoutSession;
        $this->configurableproduct = $configurableproduct;
    }
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $info = $observer->getInfo();
        $order = $observer->getEvent()->getOrder();
        $product = $observer->getProduct();
        $productId = $observer->getProduct()->getId();
        $prodtype = $observer->getProduct()->getTypeId(); //is configarable or simple
        $info = $observer->getInfo();
        $items = $this->_cart->getItems();
        $itemCount = count($items);
        if ($itemCount > 0) {
            if ($prodtype != 'configurable') {
                foreach ($items as $item) {
                    if ($prodtype != 'configurable') {
                        if ($item->getProduct()->getId() == $productId) {
                            $itemId = $item->getItemId();
                            $item->isDeleted(true);
                            $this->_cart->save();
                        }
                    } else {
                    }
                }
            } else {
                $product2 = $observer->getProduct();
                if ($product2->getTypeId() == "configurable") {
                    $configClass = $product2->getTypeInstance();
                    $childProduct = $configClass->getProductByAttributes($info['super_attribute'], $product2);
                    $productIdd = $childProduct->getId();
                    //the above id is the correct id of the simple product
                    $c = $this->_cart;
                    $childProduct->isDeleted(true);
                    $c->removeItem($childProduct->getId())->save();
                    $this->_cart->save();
                }
            }
        }
    }
}

its the code below this condition

if ($product2->getTypeId() == "configurable") {

condition thats not working, the simple products above it successfully remove from cart.


texts: n98-magerun.phar not working - PHP Fatal error: Class 'Phar' not found

texts:
I can't execute n98-magerun.phar, I get PHP Fatal error: Class 'Phar' not found.

I am using PHP 5.5.14 (cli)

Any hints how to solve this?


texts: Magento 2 - How to Disable cart only for a specific store view?

texts:
I need to hide/remove cart only for PROFESSIONAL ENGLISH store view.

Store structure on attached image.

Is this possible?


texts: Links in static block don't show or work

texts:
In my category I call a static block to left sidebar from category custom update XML

 <reference name="left">
       <block type="cms/block" name="kat_maerke" before="-"><action method="setBlockId"><block_id>kat_maerke</block_id></action></block>

When I add links in the block "kat_maerke" it does not even show or work in frontpage left sidebar

Block shows the link code - but nothing on frontpage

Saturday Night Sweater

How to solve this??? Is there anything that blocking the link?
Please help - Thanx


texts: How to hide price for out of stock products in all Magento pages.(product pages and category pages)


texts:
Okay, I have two domains pointing towards the one server a '.com' and a .cymru.

At first the .cymru domain was the main domain and .com the alias for it and I want to make the .com the main domain. in plesk its not possible to do this without creating a new webspace.

So I removed .com as the alias and gave it its own webspace and cloned the site into its httpdocs.

At first I pointed it to the same database and then changed the base urls to .com in the mga_core_config_data table. It still redirects to the .cymru domain.

So I decided to clone the database so I could test it without messing with the .cymru site. It too defaults and redirects the .com to the .cymru site.

I followed information in the article below

Magento Redirects to Old Website regardless of what changes are made!

I have cleared all caches and restarted the server.

I tried removing the database connection and then a used new browser and got the magento welcome page, as soon as I reconnected back to the database it redirected to the .cymru again.

I am at a loss, server stuff really isnt my strong point, can anyone help please?

Thanks


texts:
I need to Defer merged css using JavaScript. Is there any possibilities to defer merged css. Example code i want to do.
    <noscript id="deferred-styles">
      <link rel="stylesheet" type="text/css" href="https://xxxx.xx/static/version1xxxx/_cache/merged/f64d21109ccdd1dc8924b35f2614e40f.min.css"/>
    </noscript>

<script>
  var loadDeferredStyles = function() {
    var addStylesNode = document.getElementById("deferred-styles");
    var replacement = document.createElement("div");
    replacement.innerHTML = addStylesNode.textContent;
    document.body.appendChild(replacement)
    addStylesNode.parentElement.removeChild(addStylesNode);
  };
  var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
      window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  if (raf) raf(function() { window.setTimeout(loadDeferredStyles, 0); });
  else window.addEventListener('load', loadDeferredStyles);
</script>


texts: add block related.phtml and assign other collection to it

texts:
I have a list_search.phtml when searching It goes to list_search.phtml and I wrote some functionality for that which is fine, I included this in catalogsearch.xml:

 <reference name="content">
 <block type="catalog/product_list" name="search_result_list" template="catalog/product/list_search.phtml">
 </reference>

the location of list_search.phtml:

app\design\frontend\enterprise\default\template\catalog\product\list_search.phtml

I want to search iphone-4 and then see all related products for that so I included this one too:

<block type="enterprise_targetrule/catalog_product_list_related" name="catalog.product.related" as="relatedProducts" template="targetrule/catalog/product/list/related.phtml">
                <action method="setColumnCount"><columns>3</columns></action>
                <block type="enterprise_targetrule/catalog_product_item" name="catalog.product.related.item" template="targetrule/catalog/product/list/related/item.phtml" />
            </block>

and in list_search I am calling the block:

<?php  $itemBlock = $this->getChildHtml('relatedProducts');?>

fortunately I made sure and now I have this block which I wanted:

\app\design\frontend\enterprise\default\template\targetrule\catalog\product\list\related.phtml

and I have problem here that

Fatal error: Call to a member function getData() on a non-object in /var/www/app/code/core/Enterprise/TargetRule/Block/Catalog/Product/List/Abstract.php on line 148

the collection which I have in list_search is $this->getLoadedProductCollection(); and it is different than the collection of related products so it cause me problem do you know how I can solve this problem?

the line is this:

$behavior = $this->getProduct()->getData($this->_getPositionBehaviorField());

the problem is that $this->getProduct is NULL

I guess the solution should be to set the collection on this line:
$this->getChildHtml('relatedProducts');
something like

$this->getChildHtml('relatedProducts')->setData('collection',$collection)
I dont know how to do that!

I have read links to help me but I don't know what to do in my case
link1
link2

Thank you


texts: magento : search results redirects to live site

texts: when iam searching results in search box in my local site it redirects to live site,if results found.If not it is in local site only.why its happening


texts: In my admin panel css is not working. If I use internal css in inspect element than its work and its working fine in localhost also.


texts: where is the Request/Response format for soap - Magento 2

texts:
Here I can found the entire rest service and its request and response and url it would be helpful if I got the same for SOAP

Can anyone suggest please?


texts: How to get multiselect attribute value of a product in magento 2

texts:
I have created multiselect custom attribute for product. See https://prnt.sc/sp7wgn
I want to display the selected option value on frontend using phtml file.
How can i do that??


texts: Magento Grand Total without taxes in 1.9 with PHP7

texts:
We're working in a 1.9 & php7; detected this issue with paypal suspect fraud (due the difference amount).

All correct in frontend (apply taxes); but in checkout and calculation, magento uses the grand total without taxes.

Actual wrong order calculation:

Product price without taxes + shipping with taxes = total amount to payment

Switch to php5 and calculation is correct.

Some idea?

Thanks!


texts:
I'm trying to improve the LCP (core vitals) of my product page.
I'm using latest 2.4.1 Magento version.
Although LCP are quite good on homepage and category page (1.7s & 1.4s), it is very bad on product page (3,1s to 3,7 s), and we aim at a CLP of 1.2, or near this figure.
The very best result I get is 3,1s.
All images, JS, CSS are already optimised, using WebP, defering JS, using critical css.
Even on a clean M2 with demo data, the LCP is bad.
As anyone succeed in improving this CLP ?
Thanks !


texts:
I'm trying to get color to appear on the product tile that a visitor hovers over. So far I've only been able to affect the link itself and not the entire tile.

list.phtml

<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif;?> "onclick="setLocation('<?php echo $_product->getProductUrl() ?>')">

css

.products-grid li.item  a:hover { background-color: #d1d1d1; color:#fff;}

Now, searching I've found that the a:hover will only activate the actual link. I tried to encase the li class into a div

and dropped the a:hover in the css but I'm just not getting the result I want.

How can I make the product tile change color when a user hovers over it?

EDIT: This is the current effect:


texts: Magento 2 - How to add a required checkbox to the checkout by using uiComponents?

texts:
I try to add a new checkbox for the user agreements.
The checkbox is showing in the checkout fine, but it is not required.
Whats the official way to make it required?
THEME\Magento_Checkout\layout\checkout_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="sidebar" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="additional" xsi:type="array">
                                             <item name="children" xsi:type="array">
                                                <item name="checkboxes" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="user_agreement_checkbox_container" xsi:type="array">
                                                            <item name="component" xsi:type="string">Magento_Checkout/js/view/additional/user_agreement</item>
                                                            <item name="description" xsi:type="string" translate="true">Accept User Agreement</item>
                                                            <!--<item name="dataScope" xsi:type="string">amcheckout.additional.user_agreement</item>-->
                                                            <item name="provider" xsi:type="string">checkoutProvider</item>
                                                            <item name="checked" xsi:type="boolean">false</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

THEME/Magento_Checkout/js/view/additional/user_agreement
define([
    'jquery',
    'Magento_Ui/js/form/element/single-checkbox'
], function ($,  SingleCheckbox) {
    'use strict';

    return SingleCheckbox.extend({
        defaults: {
            valueMap: {
                'true': true,
                'false': false
            }
        }
    });
});


texts: how i can get the row values by clicking button in that table using jquery magento 2

texts:
<td data-th="<?php /* @escapeNotVerified */echo __("Quote Id")?>" class="col quoteid">
                                        <?php /* @escapeNotVerified */echo $quote->getId(); ?>

  if I click on accept button, I want to get first row (value)

  here is I tried but I'm getting more empty spaces and ("\n") and (,)
  like this


texts: How To Add Product Option of configurable product To Wish List in magento and show selected on product page

texts:
I want to add product option in magento wishlist.
And when we click on product it will show selected on product page.
I search extension for this but i did not not found this.
My need is to saved wish list with product option and show selected option on product page....How can this possible....or any extension for this


texts: Product ID Conflicts - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

texts:
I am having major issues with payment on one of my customers websites, for example when you go through PayPal Express on the confirmation page were the customer chooses there shipping method they get error "Please specify a shipping method".

I believe what is causing this is when I imported orders using a third party extension to this website, it did not update the order ID increment and keeps conflicting all the time, I have tried to update this in the database without much luck. If someone could point me in the right direction I would be really grateful.

Heres an error we got emailed.

Payment transaction failed.
Reason
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100000109' for key 'UNQ_SALES_FLAT_ORDER_INCREMENT_ID',
query was:
INSERT INTO `sales_flat_order` (
   `state`, `coupon_code`, `protect_code`, `shipping_description`,
   `is_virtual`, `store_id`, `customer_id`, `base_discount_amount`,
   `base_grand_total`, `base_shipping_amount`,
   `base_shipping_tax_amount`, `base_subtotal`, `base_tax_amount`,
   `base_to_global_rate`, `base_to_order_rate`, `discount_amount`,
   `grand_total`, `shipping_amount`, `shipping_tax_amount`,
   `store_to_base_rate`, `store_to_order_rate`, `subtotal`,
   `tax_amount`, `total_qty_ordered`, `customer_is_guest`,
   `customer_note_notify`, `customer_group_id`, `quote_id`,
   `base_shipping_discount_amount`, `base_subtotal_incl_tax`,
   `shipping_discount_amount`, `subtotal_incl_tax`, `weight`,
   `customer_dob`, `increment_id`, `applied_rule_ids`,
   `base_currency_code`, `customer_email`, `customer_firstname`,
   `customer_lastname`, `customer_middlename`, `customer_prefix`,
   `customer_suffix`, `customer_taxvat`, `discount_description`,
   `global_currency_code`, `order_currency_code`, `remote_ip`,
   `shipping_method`, `store_currency_code`, `store_name`,
   `x_forwarded_for`, `customer_note`, `created_at`, `updated_at`,
   `total_item_count`, `customer_gender`, `custbalance_amount`,
   `is_multi_payment`, `base_custbalance_amount`, `hidden_tax_amount`,
   `base_hidden_tax_amount`, `shipping_hidden_tax_amount`,
   `base_shipping_hidden_tax_amnt`, `shipping_incl_tax`,
   `base_shipping_incl_tax`, `gift_message_id`
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
   ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
   ?, ?, ?, ?, ?, ?, ?, ?, ?, '2015-03-12 19:44:28', '2015-03-12 19:44:28',
   ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)

I am using Magento 1.9


texts: Grouped Product vs Downloadable Product (or simple product)

texts:
Ive got an issue where grouped products are not being recognized as the same thing as the downloadable product being added to the cart which makes different cart items instead of just increasing the quantity on the last cart item.

So just to explain that a bit more:

Grouped Product (sku: dog-stuff)

Downloadable Product linked to group product (sku: dog-bone)

I then programmatically add dog-bone to the cart..

My Cart shows:

dog-bone from grouped product
dog-bone from downloadable product

Hopefully that makes sense.   Im trying to get them to group as the same cart item with a quantity of 2 instead of seperate items..

Here is my code to add product to cart..

    $sku = isset($_POST['sku']) ? $_POST['sku']:null;
    if(is_null($sku)){
        echo json_encode(false);
        exit;
    }
    $storeId = Mage::app()->getStore()->getId();
    $product = Mage::getModel('catalog/product')->load(Mage::getModel('catalog/product')->getIdBySku($sku))->setStoreId($storeId);
    $qty = 1;
    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $item = $quote->addProduct($product, $qty);
    $quote->save();


texts:
For some reason, all the sudden I noticed the grand total price was the same as my shopping cart product price. So basically something that should say 3.96 in the cart is a lot more. It's adding the tax to my product price in the cart summary.

Was there a setting that I apparently missed??


texts: 2.3.3: How would I stop the anchor/scroll on the product details tabs?

texts:
I would like to prevent the horrible snapping of the product details tabs and can't seem to figure out where it is coming from? I tried removing the link in the details.phtml and it still snaps so I'm assuming it isn't an anchor and is some JS. Thanks.

For me the tabs have been converted into an accordion:

            <?php foreach ($detailedInfoGroup as $name) :?>
                <?php
                $html = $layout->renderElement($name);
                if (!trim($html)) {
                    continue;
                }
                $alias = $layout->getElementAlias($name);
                $label = $block->getChildData($alias, 'title');
                ?>

                    <?= /* @noEscape */ $label ?>

                    <?= /* @noEscape */ $html ?>

            <?php endforeach;?>


texts: Magento2: How to get Reset password link in custom email template

texts:
How to get Reset password link in the custom email template?
I am able to get a token like this -

$customToken = $this->_userHelper->generateResetPasswordLinkToken();
$reset_password_link = $baseUrl.'customer/account/createpassword/?token='.$customToken;

but when click then getting a message like this "Reset password link has expired"


texts: Parent product id of a product using Magento soap v2 api

texts: I am using Magento SOAP V2 api to access sales order info using soap client implemented in java. Is there a way to get the parent item id of a item ordered. Simply I want to get the configurable product associated with the simple product.


texts: When to use Mage::getSingleton() in my custom module/Ext

texts:
theoretically i know about Mage::getSingleton() & differences b/w
Mage::getSingleton() and Mage::getModel()

but my question is that in my custom
module when to use Mage::getSingleton(){Normally i used Mage::getModel() on lots of places}.

Please let me understand with example(if possible, please share a small custom modules having Mage::getSingleton()).


texts: Migrating from Shopify: Manual or Migration Tools?

texts:
The company I work at has been using Shopify for about 3 years. Due to expanding business requirements, we want to migrate to Magento 2. With Shopify, the site is running with workarounds so it has stability issues.

I found several tools that provide data migration services - LitExtension, Cart2Cart, etc. Since they cost money, I'm thinking if it's more practical to have certain entities (e.g. customers, orders) migrated with the tool and others (e.g. products) done manually.

Question: Is there any known issue whereby the automated and manually migrated data fail to link to each other?

My assumption is that regardless of migration method of each entity, when in Magento, I'm able to see Customer A (auto migrate) purchased Product B (manual import). Is that assumption true?

Same goes if all products/customers/orders are manually migrated; is it correct that the data link will be retained? I would like to clarify on this for analysis and reporting purposes.


texts: Additional CSS for sub-categories using Layout Updates

texts:
I'm working on a site that has a design for parent categories and a different design for sub-categories. The only difference, at the moment, is the CSS. The sub-category has CSS that overrides the parent category's CSS.

I realize I could use the Layout Update XML, but would prefer to make it easier for the end user by just selecting a Layout from the drop-down. I tried creating my own layout, but the page layouts are only containers and catalog_category_view.xml applies to all categories.

Is there a way to create a new Layout that also updates the CSS? Thanks!


texts: Error saving programmatically created categories when flat categories enabled

texts:
I've been creating categories programmatically for a few years with no issues.  Since the volume of categories has increased to a point where there is a significant performance degradation building menus, I need to enable flat categories, but am now getting an error when this option is turned on.  I've truncated and reindexed the catalog_category_flat_store_1 table just to be safe, but I'm getting a foreign key failure off of catalog_category_entity.

Here's the error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`DBNAME`.`mage_catalog_category_flat_store_1`, CONSTRAINT `FK_MAGE_CAT_CTGR_FLAT_STORE_1_ENTT_ID_MAGE_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `mage_catalog_category), query was: INSERT INTO `mage_catalog_category_flat_store_1` (`store_id`, `display_mode`, `include_in_menu`, `is_active`, `is_anchor`, `landing_page`, `name`) VALUES (?, ?, ?, ?, ?, ?, ?)

And the code that is generating the error:

$parentCategory = Mage::getModel('catalog/category')->load($parent);  //load the parent category
$newCategory = Mage::getModel('catalog/category');
$newCategory->setStoreId( $parentCategory->getStoreID() );
$newCategory->setName(utf8_encode($name));
$newCategory->setIsActive(1);
$newCategory->setIsAnchor(0);
$newCategory->setDisplayMode('PAGE');
$newCategory->setPath($parentCategory->getPath() );
$newCategory->setLandingPage($GLOBALS['subcategoryBlock']);
$newCategory->setData( "include_in_menu",0 );
try {
    $newCategory->save();
} catch (Exception $e) {
    $e->getMessage());
}

Any suggestions on how to resolve the issue?  The exact same code works fine if flat categories is turned off.


texts:
I'm having quite some troubles hosting my Magento website. I've always ran websites (Joomla, Wordpress) on shared hosting. However, for this Magento website they advised a VPS.

After quite some work (PHP memory size was too low, etc.) the website does load, but I am unable to access the admin area:

Fatal error: Call to undefined function curl_setopt() in /var/www/elly/lib/Varien/Http/Adapter/Curl.php on line 87 Call Stack: 0.0001 637816 1. {main}() /var/www/elly/index.php:0 0.0014 708040 2. Mage::run() /var/www/elly/index.php:87 0.0032

Can anyone help me out solving this?

I've got another question:
After adding a article to my shopping list, pages won't load anymore. Look for an example on: http://bit.ly/1cvXGKa

E.g.: Add an article from this page (http://bit.ly/HlmNAZ) by hovering it and clicking on 'In winkelwagen'.

Could someone help me out with this?


texts:
In default our Magento2 installation shows the shipping costs (screenshot) in the cart (even for unkown/not logged in users). We would like to not show the shipping costs in the calculation in the cart, but I can't find any configuration for it.

So the problem is not the "Estimate Shipping Costs" box, but the fact that the shipping costs need not be added until the checkout.

If I look in the source I do see this comment <!-- ko if: isExcludingDisplayed() --> around the <tr> for said shipping costs, which leads me to believe there is a setting to turn it off at this point.

But where? How? I could hide it with CSS/rip it out of the HTML, but that doesn't affect the calculation.

FYI: We have set up a single Shipping Method with Tablerates


texts: Load custom product detail page instead of default in Magento 2

texts:
I am trying to remove default product detail page content, can i load custom phtml file for product detail page along with the image?

I need to remove all the default blocks of product detail page and show only my template content.

Is that can be done? Because i need to custom code in that template file to interact with external api with the product id.

How this can be achieved? Please anyone suggest me.


texts: Remove Trailing Slash from Footer Links added via addLink

texts:
I have added several links in my layout.xml like this:

<action method="addLink" translate="label title">
     <label>XYZ</label>
     <url>xyz</url>
     <title>XYZ</title>
     <prepare>true</prepare>
</action>

These links will include a trailing slash while my sitemap will include them without the trailing slash. Since all other links in my store have no trailing slash, I am wondering, why links added via addLink will do. Is there a way to remove these trailing slashes?
I tried modifying Mage\Core\Block\Abstract.php and Mage\Core\Method\Url.php to remove trailing slashes from all URLs but some ajaxFunctions will not work anymore if I do so, so I am looking for a way to only remove them from the addLink function.


texts: How to add content to registration form? Magento 2.2

texts: just trying to figure out how I would go about adding content to the account registration form for one of our Magento 2.2 stores. I see the PHTML file located in vendor/magento/module-customer/view/frontend/templates/form/register.phtml but I am not sure where I need to copy this to make changes.


texts: Unable to log in to Magent 2 backend - login times out

texts:
I am unable to log in to my admin panel, the login keeps timing out whatever I do. Our test system had the same problem but a reboot solved the problem this time nothing seems to help.
I use varnish and nginx. I have the following error in the log:

2020/04/16 09:25:05 [error] 819#819: *1859 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 85.203.44.29, server: domain.us, request: "POST /domainadmin/admin/index/index/key/d6d372ad21c94d34761ce46c523430b8df2fe764ed9e7c8d902198396d6fb066/ HTTP/1.1", upstream: "http://127.0.0.1:80/domainadmin/admin/index/index/key/d6d372ad21c94d34761ce46c523430b8df2fe764ed9e7c8d902198396d6fb066/", host: "domain.us", referrer: "https://domain.us/domainadmin/admin/index/index/key/d6d372ad21c94d34761ce46c523430b8df2fe764ed9e7c8d902198396d6fb066/"

Anyone seen this before?


texts: No price field at backend on my custom shipping method

texts:
I am using webkul shipping module to moderate my shipping method, here I have no backend field to put the shipping price into. I'll bellow put my php class. Where should I implement the backend shipping price field to be available to customize from backend admin.

<?php
namespace Webkul\Customshipping\Model;

use Magento\Quote\Model\Quote\Address\RateResult\Error;
use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Carrier\AbstractCarrierOnline;
use Magento\Shipping\Model\Carrier\CarrierInterface;
use Magento\Shipping\Model\Rate\Result;
use Magento\Shipping\Model\Simplexml\Element;
use Magento\Ups\Helper\Config;
use Magento\Framework\Xml\Security;

class Carrier extends AbstractCarrierOnline implements
CarrierInterface
{
const CODE = 'wkcustomshipping';
protected $_code = self::CODE;
protected $_request;
protected $_result;
protected $_baseCurrencyRate;
protected $_xmlAccessRequest;
protected $_localeFormat;
protected $_logger;
protected $configHelper;
protected $_errors = [];
protected $_isFixed = true;

public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory
$rateErrorFactory,
\Psr\Log\LoggerInterface $logger,
Security $xmlSecurity,
\Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory,
\Magento\Shipping\Model\Rate\ResultFactory $rateFactory,
\Magento\Quote\Model\Quote\Address\RateResult\MethodFactory
$rateMethodFactory,
\Magento\Shipping\Model\Tracking\ResultFactory $trackFactory,
\Magento\Shipping\Model\Tracking\Result\ErrorFactory
$trackErrorFactory,
\Magento\Shipping\Model\Tracking\Result\StatusFactory
$trackStatusFactory,
\Magento\Directory\Model\RegionFactory $regionFactory,
\Magento\Directory\Model\CountryFactory $countryFactory,
\Magento\Directory\Model\CurrencyFactory $currencyFactory,
\Magento\Directory\Helper\Data $directoryData,
\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,
    \Magento\Framework\Locale\FormatInterface $localeFormat,
    Config $configHelper,
    array $data = []
) {
    $this->_localeFormat = $localeFormat;
    $this->configHelper = $configHelper;
    parent::__construct(
        $scopeConfig,
        $rateErrorFactory,
        $logger,
        $xmlSecurity,
        $xmlElFactory,
        $rateFactory,
        $rateMethodFactory,
        $trackFactory,
        $trackErrorFactory,
        $trackStatusFactory,
        $regionFactory,
        $countryFactory,
        $currencyFactory,
        $directoryData,
        $stockRegistry,
        $data
    );
}
protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
{
}

public function getAllowedMethods()
{
}

public function collectRates(RateRequest $request)
{
    $result = $this->_rateFactory->create();

    /*store shipping in session*/
    $method = $this->_rateMethodFactory->create();
    $method->setCarrier($this->_code);
    $method->setCarrierTitle('Arpico testing shipping');
    /* Use method name */
    $method->setMethod($this->_code);
    $method->setMethodTitle('Arpico testing shipping');
    $method->setCost(250);
    $method->setPrice(250);

    $objectManager =
    \Magento\Framework\App\ObjectManager::getInstance();
    $cart = $objectManager->get('\Magento\Checkout\Model\Cart');

    $subTotal = $cart->getQuote()->getSubtotal();
    $grandTotal = $cart->getQuote()->getGrandTotal();
    $store = $cart->getQuote()->getStore()->getId();

    return $result;
}

public function proccessAdditionalValidation(\Magento\Framework\DataObject $request) {
    return true;
}
}


texts: How to run command prompt in Godaddy for installing porto theme?

texts:
I am using Porto theme in localhost. I am using following commands to run Enable Theme for Currently Active store.

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

Now, we are going to live the website by using GoDaddy hosting.

In localhost, I am using the composer.

I have connected Putty with my IP successfully.

But, It is asking for Passphrase for key.


texts: Magento order email sending to wrong customer..?

texts:
I am working on one of E commerce magento site. Where I occur one error. When customer place order they have not receive the order mail. Instead of that order mail goes to previous customer

  Ex. If customer place order on date 2 jan 2016, the mail goes to 27
  oct 2015 customer

I checked the core_email_queue and core email_queue_recipient tables of Database. In which order get deleted from core_email_queue but same order message_id data present in core_email_queue_recipient table.

Please can any one help me to solve out this query because I confused in core_email_queue functionality and cron job performing functionality with it.


texts: Calling Description & Short Description into phtml

texts:
Still learning my feet with magento2. I've found the phtml file I want to call the description and short description from but I've been unable to find the calls needed.

Would it be safe to assume it's the same, different, or a better solution?


texts: Pub/media css was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff in magento 2

texts:
I set up Magento 2 localhost migrated from the server.

  but when load frontend showing like this

Pub/media CSS was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff in Magento 2

how I can fix this

Magento ver 2.2.6

ubuntu 18.04

PHP 7


texts: Magento 2.3 Customer Account Create 404 errors with FPC enabled

texts:
Customer account link broken after crawl. Run site check in woorank.com. Customer account create link will throw 404 error. Works fine when FPC is disabled. This issue has been pending for a long time. Does this mean this is not critical to Magento? Is there a workaround or patch for this issue?

https://github.com/magento/magento2/issues/20255


texts: Magento 2 - Validate input number and allow only two digits after decimal point and submit form via AJAX

texts:
Code Snippet

<form data-mage-init='{"validation": {}}' data-hasrequired="<?php echo __('* Required Fields') ?>" name="vendor" method="POST" id="vendor" autocomplete="off">

        <?php echo __('Enter Height:')?>
        <input type="text"
               id="height"
               name="height"
               placeholder="Please enter numeric value only"
               data-validate="{required:true, 'validate-number':true}" class="input-text form-control input-md">
            <button type="submit" class="action primary" id="calculateTotalSubmit" name="calculate-total-submit"><?php echo __('Calculate Total')?></button>

    </form>

I have given input value required true and validate-number, although it is validating required field input before form is post, it is not validating the required number and showing validation message after form is post. How could I add below validations using Magento 2 form validation rules

As you can see in image, it shows number validation message but form is also submitted.

Using this script to submit form via ajax, validation is not working

Before form post, validate-number and allow only two digits after
decimal point before form is submitted?


texts:
Currently my Magento store (ce-1.9.0) has all its products in parent folders. For each product it will have 2 urls:

From the Homepage = mysite.com/product-page
From the Category Page = mysite.com/category/product-page

My problem is I need to only have the category url and not the URL straight from the homepage.

I know I can do the opposite (don't have category version, only homepage) by setting the Use Categories Path for Product URLs option to No in the admin system but there is no way of doing what i want.

I came across this link when searching the Q&A's but the link it points to is no longer valid and it looks like it was a previous magento version (1.5) not for the one i am using - ce-1.9.0


texts:
I've been trying to disable the welcome email for users who login to my Magento webshop for the first time. After some debugging and back-end configuration changes I couldn't quite figure out how to do this.

The important thing I don't want to happen is that the user wont receive the confirmation email with his username and password.


texts: Cannot change swatches value in Magento 2

texts:
I am trying to display magento's swatch renderer in my module and it succeeds but the problem shows up. When I click on the swatch to change the weight there is no change, I try to reload the page and one of my two views will get the event of changing the swatch value maybe both are ok. receive change event. I tried to fix the error in different ways but it was not effective.

this is how I call swatch
$swatchesRender = $block->getLayout()->createBlock('Magento\Swatches\Block\Product\Renderer\Listing\Configurable')->setTemplate('Magiccart_Magicproduct::product/listing/renderer.phtml');

                            <?php
                                $_productNameStripped = $block->stripTags($_product->getName(), null, true);
                            ?>
                            <?php
                                $categoryIds = $_product->getCategoryIds();
                                $categoryId  = count($categoryIds) ? current($categoryIds) : 0;
                                $category    = $categoryId ? $this->getCategory($categoryId) : '';
                                echo $category ? '
getUrl() . '">' . $category->getName() . '
' : '';
                            ?>

                                <a class="product-item-link"
                                   href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>">
                                    <?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>

                             <?php echo $swatchesRender->setProduct($_product)->toHtml() ?>

                             <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?>

                            <?php if ($showDescription):?>

                                    <?= /* @escapeNotVerified */ $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>

                            <?php endif; ?>

If you don't understand I say imagine that this is the page load
load 1 : category list in module click change swatch === > ok
         best seller list in module click change swatch === > no
load 2 : category list in module click change swatch === > no
         best seller list in module click change swatch === > ok
load 3 : category list in module click change swatch === > ok
         best seller list in module click change swatch === > ok
load 4 : category list in module click change swatch === > no
         best seller list in module click change swatch === > no


texts: Magento 2: Validate error from review form on product page does not translate

texts:
The message 'Please select one of each of the ratings above.' is not translating, when you try to add a review without choosing the stars.

The form is located in the file form.phtml

vendor/magento/module-review/view/frontend/templates

And the validation error is shown like this

    <input
        type="radio"
        name="ratings[<?php /* @escapeNotVerified */ echo $_rating->getId() ?>]"
        id="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>"
        value="<?php /* @escapeNotVerified */ echo $_option->getId() ?>"
        class="radio"
        data-validate="{required:true, messages:{required:'Please select one of each of the ratings above.'}}"
        aria-labelledby="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_rating_label <?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>_label"
/>

I tried to change it with

data-validate="{required:true, messages:{required: <?php __('Please select one of each of the ratings above.') ?> }}"

But it's not working.

How can I translate this validation error?


texts: Why is my catalog configuration page blank?

texts:
In my admin, my catalog configuration page is completely blank. I have not edited any of the code for this page. I do have a custom frontend theme installed, however.

I have already flushed set the caches under System > Cache Management, reset browser cache, and checked the admin page in question in another browser.

I am using Magento 2.2.1.


texts:
i want to add custom image to category add and save that image , how can i do it  i am able to add custom text file with below code:

<?php
$installer = $this;
$installer->startSetup();

$attribute1  = array(
    'type' => 'varchar',
    'label'=> 'Image Path',
    'input' => 'text',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);

$installer->addAttribute('catalog_category', 'image_path', $attribute1);
$installer->endSetup();
?>

but i want to add input type image and save that image pls guide


texts: Magento 1.9.2 Navigation menu not working on live server but working on local server

texts:
I have a strange problem. I am working on Magento 1.9.2 locally on XAMPP Server. Everything was working properly on locahost or 127.0.0.1 including the navigation menu which we create by the help of adding categories.  Root categories -> Sub Categories.
Yesterday, i have uploaded my website to live testing server. Everything is working properly except the nav menu at the top is not working which contains the categories. I am trying to solve this problem since long time but nothing helped.  i am using RWD theme with custom folder in it. I use Custom folder to customize the website which is a proper way to do customization.
I have used one extension named WP_Custom_Menu from official magestore. I have tried disabling and enabling this extension on live server but nothing happen. If anyone have encountered this issue ever or know how to fix it. please provide me guidance.


texts: Change Magento 1.9 Availability message depends on qty

texts:
I would like to change the Availability message in product page depends on qty. So far I tried a couple of methods but no change at all. One of them is :
<?php if($product_page_type == 'sticky_left_right' || $product_page_type == 'wide_grid'): ?>
                <?php if (($_product->isAvailable()) && (id($_product->getQty() <= 0))): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

                <?php elseif (($_product->isAvailable()) && (id($_product->getQty() == 0))): ?>

<?php echo $this->__('Availability:') ?> <?php echo "hello" ?>

                <?php else: ?>

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

                <?php endif; ?>
                <?php if($sku = $_product->getSku()): ?>

<?php echo $this->__('SKU:') ?> <?php echo $sku; ?>

                <?php endif; ?>
                <?php if ($this->canEmailToFriend()): ?>

<a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>"><?php echo $this->__('Email to a Friend') ?>

                <?php endif; ?>

But changing qty of product not change at all in front end.
What I am doing wrong?


texts: Magento 2: How to call a command from a Controller?

texts:
I have created a command and now I need to call it from a controller. How to do it?

This is the command:

class CleanVarnish extends Command
{
    protected function configure()
    {
        $this->setName('varnish:clean')
            ->setDescription('Clean Varnish command line');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('sudo /usr/bin/varnishadm "ban req.url ~ "/" "');
    }
}


texts: Add some information in additional_options of quote_item_option table while adding item to quote while creating order from backend

texts:
I want to add some information in additional_options of quote_item_option table while adding item to quote while creating order from backend. For this purpose I need an event that called after adding item in quote from backend.

FYI it is saving in info_buyRequest right now.


texts: Magento2: custom options import using CSV

texts:
I am working on CSV import to create a custom option for Products
I am facing the issue with the error

  Notice: Undefined index: type in
  /var/www/html/home/vendor/magento/module-catalog-import-export/Model/Import/Product/Option.php
  on line 1134

I already created Products (Configurable products)

I want to add a custom option to them I am importing my sample CSV link below
csv link


texts: Get plain value from custom variable in php with objectManager

texts:
I want to get a plain value from custom variable (defined on admin) in php with objectManager.

storeID is in $order->getStore()->getId()

Custom Variable Code is 'mycustomvar'

why does following code not work?

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $variables = $objectManager->create('Magento\Variable\Model\Variable');
    if ($var = $variables->getResource()->getVariableByCode('mycustomvar', true, $order->getStore()->getId())) {
        $value = 'defined';
//      $value = $variables->getData('plain_value');
    } else {
        $value = 'undefined';
    }

It looks like $var contains the array with the values of mycustomvar, but I'm not sure.

How can I pass $var to getData('plain_value')?  Or is there a better way to get 'plain_value'?

Classes I was looking into are

Magento\Variable\Model\Variable

Magento\Variable\Model\ResourceModel\Variable

PS I understood objectManager is not the preferred way, but I need to get this working here

PPS Magento 2.1


texts: Magento 1.7 using category as Top Navigation at the same time sub-navigation to other menu

texts: How do I add the category as Top Navigation and at the same time it's a sub-navigation under different Top Menu. I'm using Magento 1.7. I'm not losing hope for this. I know someone here can help. Thanks!


texts: How to create a custom block from billing.phtml

texts:
I would like to add a new block in the customer registration, edit and billing forms. This block will contain a dropdown control where the customer can select if he wants to register as a company or as an individual.

At first, I edited billing.phtml and added the following:

<li class="fields">
    <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('mynamespace/mymodule/customer/widget/registeras.phtml')->toHtml(); ?>
</li>

This is working fine, but instead of using 'core/template', I would like to create my custom typed block.

I wrote this in the config:

<config>
    <modules>
        <Mynamespace_Mymodule>
            <version>0.0.1</version>
        </Mynamespace_Mymodule>
    </modules>
    <global>
        <blocks>
            <mymodule>
                <class>Mynamespace_Mymodule_Block_Widget_Registeras</class>
            </mymodule>
        </blocks>
        ...
    </global>
</config>

Then I created the class of my block:

class Mynamespace_Mymodule_Block_Widget_Registeras extends Mage_Customer_Block_Widget_Abstract
{
    public function _construct()
    {
        parent::_construct();

        // default template location
        $this->setTemplate('mynamespace/mymodule/customer/widget/registeras.phtml');
    }

    /**
     * Get current customer from session
     *
     * @return Mage_Customer_Model_Customer
     */
    public function getCustomer()
    {
        return Mage::getSingleton('customer/session')->getCustomer();
    }
}

Now I replaced:

$this->getLayout()->createBlock('core/template')->setTemplate('mynamespace/mymodule/customer/widget/registeras.phtml')->toHtml(); ?>

by this:

<?php echo $this->getLayout()->createBlock('mynamespace_mymodule/widget_registeras')->setObject($this->getQuote()->getCustomer())->toHtml(); ?>

But it's not working. Here is the error I get:

  exception 'Mage_Core_Exception' with message
  'Invalid block type:
  Mage_Mynamespace_Mymodule_Block_Widget_Registeras' in
  E:\myworkspace\magento\app\Mage.php:595 Stack trace:
  0 E:\myworkspace\magento\app\code\core\Mage\Core\Model\Layout.php(495):
  Mage::throwException('Invalid block t...')
  1 E:\myworkspace\magento\app\code\core\Mage\Core\Model\Layout.php(437):
  Mage_Core_Model_Layout->_getBlockInstance('mynamespace_my...', Array)
  2 E:\myworkspace\magento\app\code\core\Mage\Core\Model\Layout.php(472):
  Mage_Core_Model_Layout->createBlock('mynamespace_my...',
  'widget_register...')
  ...

I could not understand why magento adds 'Mage_' to the class name.

I also tried to load it using the layout and getChildHtml() but I could not get it work better.

Any help would be appreciated.

Thank you


texts: Hide price for guest users in magento 2.3.2

texts: Hide price in website and in cart for user not logged in Magento 2.3.2


texts:
Is there any methods to know which type of page i have with an url ?

I would like to know with a page .html if it s a product page , a category page , cms page or home ?
And i would like to know also what is the productid, the categoryid, or the cms page id associate to the html url :)

Thanks a lot by advance

Thomas


texts:
I'm for my simple product added dropdown custom options. Now i want set default value in dropdown (one, two, three, four, five), defauld value should be: five and on default display also in checkout and ordrer rewiew. How i can do this better?

Thanks


texts: can't add child block by reference in custom layout file (solved)

texts:
I'm trying to add new block to billing form in my custom layout file. I've debugged method getFileLayoutUpdatesXml from Mage_Core_Model_Layout_Update and i see that my file is loaded. I have the following file

newsletteronbillingform.xml

<?xml version="1.0"?>
<layout>
    <checkout_onepage_index>
        <reference name="checkout.onepage.billing">
            <block type="company_newsletteronbillingform/newsletter" name="checkout.onepage.billing.extra" template="newsletter/billingform/checkbox.phtml" />
        </reference>
    </checkout_onepage_index>
</layout>

When i add this directly in layout checkout.xml then works correctly

        <block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml">
            <block type="page/html_wrapper" name="checkout.onepage.login.before" as="login_before" translate="label">
                <label>Login/Registration Before</label>
                <action method="setMayBeInvisible"><value>1</value></action>
            </block>
            <block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml">
                <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
                <block type="company_newsletteronbillingform/newsletter" name="checkout.onepage.billing.extra" template="newsletter/billingform/checkbox.phtml" />
            </block>

            <block type="cms/block" name="checkout_login_info_guest">
                <action method="setBlockId"><block_id>checkout_login_info_guest</block_id></action>
            </block>
            <block type="cms/block" name="checkout_login_info_register">
                <action method="setBlockId"><block_id>checkout_login_info_register</block_id></action>
            </block>

        </block>

What am I doing wrong?

[SOLUTION]

The reason was my oversight... :) I had doubly declared block "checkout.onepage.billing". After removing unnecessary second block it works correctly. Thx for help.


texts: Error in my admin: System > tools > support > system backups

texts:
Unable to create backup due to missing required bash tools: lsof

What does this mean and how do i fix it?

I've just migrated from AWS where I was using Apache to RackSpace and now I'm using NginX. That's the only difference between my builds for the most part. I migrated all the files and the DB over. Additionally, I deleted all instances of the redis module.

I read that you could yum lsof in ssh and i tried it, it seemed to enable. I'm still throwing the error in my admin panel.


texts:
I have implemented the ajax cart update following this. But the issue is when I enter the max qty for a product it does not shows any error. (which is Magento default behavior, should show a popup).But when I reload my page that error shows up.
Does anyone know about this?
default behavior:

custom after making it ajax based.

define([
'jquery',
'Magento_Checkout/js/action/get-totals',
'Magento_Customer/js/customer-data',
'Magento_Customer/js/action/update-shopping-cart'
], function ($, getTotalsAction, customerData,submitCart) {

$(document).ready(function(){
    $(document).on('change', 'input[name$="[qty]"]', function(){
        var form = $('form#form-validate');
        $.ajax({
            url: form.attr('action'),
            data: form.serialize(),
            showLoader: true,
            success: function (res) {
                var parsedResponse = $.parseHTML(res);
                var result = $(parsedResponse).find("#form-validate");
                var sections = ['cart'];
                $("#form-validate").replaceWith(result);
                customerData.reload(sections, true);
                var deferred = $.Deferred();
                getTotalsAction([], deferred);
            },
            error: function (xhr, status, error) {
                var err = eval("(" + xhr.responseText + ")");
                console.log(err.Message);
            }
        });
    });
});

});


texts: Is there any way to add JS/CSS to footer page?

texts: I have a custom requirement to add a specific JS and CSS related to website's footer. Is there any way in Magento by which I can add it in footer section ?


texts: The "loggedAsCustomer" section source isn't supported. - Magento 2.3

texts: I have updated my Magento version from 2.2.5 to 2.3.3 so Now when I go to any page on the front side so I am getting this "The "loggedAsCustomer" section source isn't supported." error in customer-data.js.


texts: Invalid entity supplied on getCollection

texts:
I made setted up a custom model but I'm stuck on getCollection methods which results in Invalid entity supplied

My setup:

IndexController.php

Mage::getModel('custom/customerobject')->getCollection();
// this is where the error happens

Resource/Customeobject/Collection.php

class Unreal_Custom_Model_Resource_Customerobject_Collection extends Mage_Eav_Model_Entity_Collection_Abstract
{
    /**
     * Resource initialization
     */
    protected function _construct()
    {
        $this->_init('custom/customerobject');
    }

}

config.xml

  <models>
        <custom>
            <class>Unreal_Custom_Model</class>
            <resourceModel>unreal_resource</resourceModel>
        </custom>
        <unreal_resource>
            <class>Unreal_Custom_Model_Resource</class>
            <entities>
                <statusobject>

statusobject

                </statusobject>
            </entities>
            <entities>
                <customerobject>

customerobject

                </customerobject>
            </entities>
        </unreal_resource>
    </models>

sql script used to create table

if(!$installer->getConnection()->isTableExists($installer->getTable('custom/customerobject')))
{
    $customerObjectTable = $installer->getConnection()->newTable($installer->getTable('custom/customerobject'))
    ->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
            'unsigned' => true,
            'nullable' => false,
            'primary' => true,
            'identity' => true,
            ), 'ID')
        ->addColumn('email', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
            'nullable' => false,
            ), 'Email')
        ->addColumn('password', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
            'nullable' => true,
            ), 'Password')
        ->addColumn('firstname', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
            'nullable' => false,
            ), 'FirstName')
                ->addColumn('lastname', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
            'nullable' => false,
            ), 'LastName');
    $installer->getConnection()->createTable($customerObjectTable);
}

Please help me out here because I have no idea where to start

Thanks


texts: Form key not updating on each refresh in magento 2

texts:
For a specific reason, I have to create FormKey in my controller but it is not re generate on browser on each refresh.

FormKey generated but not updating. It showing the same key every time.

I am following below article.

https://www.ashsmith.io/magento2/tip-getting-a-form-key-in-your-template/


texts: Magento : Disable Shipping Methods based on custom attribute for product

texts:
I created a custom attribute for products in admin panel for shipping Information having values "Yes" or "No"

If value is "No" then need to hide (disable) shipping method for the particular product.
If value is "Yes" then need to show shipping method for the particular product.

On a cart page (template\checkout\cart.phtml), I put the condition that if shipping is set "No" (for particular product) then no need to show shipping and if "Yes" then show shipping form.

Its working good but on "Placing a order", I am getting shipping error saying that "Please fill shipping details".

I am confused what I need to do.
I hope, anyone can solve my problem.
Please help me out.

Thanks


texts: unable to access a product in addtocart html file

texts:
I created a addtocart.phtml wit fly effect. This is working fine in product view page.

But in product listing page I am unable to get the product details. I mean in product view page if print echo '<pre>'; print_r($_product); I can get product details but in listing page I am unable to get.

listing page code as below:

confix.xml

<block type="catalog/product_list" name="product_list.addtocart" as="addtocart" template="catalog/product/list/addtocart.phtml"/>

in product listing page

<?php if($_product->isSaleable()): ?>
     <?php echo $this->getChildHtml('addtocart') ?>
<?php endif; ?>

in addtocart.phtml

<?php
      echo '<pre>'; print_r($_product);
die; ?>


texts: Local.xml, can it be used for .phtml also?

texts:
Just a general question regarding using a local.xml file in Magento.

I'm now using it to hold my layout modifications, however I read somewhere that it can also be used to hold modifications to your template (phtml) files. Is that true? If so, how would you do it? Can't seem to find any info on this in the Magento (CE) Documentation.


texts: Magento 2: Migrating a Module's system.xml Configuration

texts: Are there any automated tools for converting a Magento 1 module's system.xml file to the new Magento 2 format?  I took a look at the existing code-migration tools, and they don't (seem to?) do this for you.


texts:
When opening up a product page (example.com/store/women/catalog/product/view/id/215/) in a new session and using the standard add to cart, my product gets dropped and says the shopping cart is empty. However, once a ?SID= is assigned I am able to add the product to the cart. I am using Lesti::FPC.

Form action before getting an SID:

  action="http://example.com/store/women/checkout/cart/add/uenc/aHR0cDovL3ByaW9yaXR5b3V0Zml0dGVyLmNvbS9zdG9yZS93b21lbi9jYXRhbG9nL3Byb2R1Y3Qvdmlldy9pZC8yMTUvP1NJRD1jYWUwNjU4ZWNiNjkxNTdjZDczMzZkNTllY2E0MmJmMg,,/product/215/form_key/Dij9pPXAwRBzAywH/?<(!)--
  fpc session_id_placeholder -->"

Form action after getting an SID:

  action="http://example.com/store/women/checkout/cart/add/uenc/aHR0cDovL3ByaW9yaXR5b3V0Zml0dGVyLmNvbS9zdG9yZS93b21lbi9jYXRhbG9nL3Byb2R1Y3Qvdmlldy9pZC8yMTUvP1NJRD1jYWUwNjU4ZWNiNjkxNTdjZDczMzZkNTllY2E0MmJmMg,,/product/215/form_key/Dij9pPXAwRBzAywH/

They are the same besides the fpc session_id_placeholder


texts:
During article import of a custom import profile (Dataflow - Profiles) I get this error for all rows:

Skipping import row, required field "sku" is not defined.

I have mapped "sku" => "artnr" (Field Mapping) but it looks like he does not use this, even I have Original Magento attribute names in first row set to No.

If I rename the column in my csv file and set Original Magento attribute ... to Yes it works. (He complains about empty type instead)

Same problem with normal Import: "Can not find required columns: sku". I changed column name from artnr to sku and stored the file as utf8.

Columns look like this at the moment:

store;websites;attribute_set;type;category_ids;sku_wrong;has_options;name;weight;image;small_image;thumbnail;url_key;url_path;package_content;unit;sku;price;manufacturer;status;tax_class_id;visibility;gesamtrabatt;description;short_description;gift_message_available;qty;min_qty;use_config_min_qty;is_qty_decimal;backorders;use_config_backorders;min_sale_qty;use_config_min_sale_qty;max_sale_qty;use_config_max_sale_qty;is_in_stock;low_stock_date;notify_stock_qty;use_config_notify_stock_qty;manage_stock;use_config_manage_stock;stock_status_changed_automatically;use_config_qty_increments;qty_increments;use_config_enable_qty_increments;enable_qty_increments;product_name;store_id;product_type_id;product_status_changed;product_changed_websites
"";"";"Default";"";"";"";"0";"Br&ouml;tchen";"";"?";"?";"";"";"";"";"St&uuml;ck";"10412";".24";"";"";"";"";"0";"Artikel f&uuml;r die Demonstration von Folgeartikel.";"";"";"";"";"";"";"0";"";"1";"";"";"";"";"";"";"";"";"";"";"";"";"";"0";"Br&ouml;tchen";"";"";"";""


texts: New products are not showing in new order in backend

texts:
I created 2 new product in backend that are not visible individually because I only want to use them for a particular order.
But when I go in backend at Sale->Order->new order those products do not appear. Do I need to reindex the related catalog index or what am I doing wrong? Product is in stock and was an qty on invetory bigger than 0.
I hope it's a faster solution because the reindex takes me ages - I have more than 150k products on my application.
Any help is welcomed :)


texts: How To Add Block Outside of Magento_Theme?

texts:
<container name="container" label="header-container" as="header-container" htmlTag="div" htmlClass="container">
            <container name="header-options" label="header-options" as="header-options" htmlTag="div" htmlClass="header-options">
                <block class="Magento\Framework\View\Element\Template" name="language.select" template="Magento_Theme::html/header/language-select.phtml"></block>
                <block class="Magento\Framework\View\Element\Template" name="distributor.search" template="Magento_Theme::html/header/distributor-search.phtml"></block>
                <block class="Magento\Framework\View\Element\Template" name="contact.link" template="Magento_Theme::html/header/contact-link.phtml"></block>
                <block class="Magento\Framework\View\Element\Template" name="top.search" template="Magento_Search::form-mini.phtml"></block>
            </container>
        </container>

Im trying to add the magento top.search into my header however I am struggling to get it to show, all other blocks within Magento_Theme are working just unable to add the Magento_Search::form-mini.phtml?

Can anyone advise where I am going wrong?

Thanks


texts: How to set the locale (en_US") of Magento2 (I/F Locale) by using command line

texts:
I have installed magento 2.0.7 with CentoOS 7 / Apache 2.4.6 / PHP 7 / MariaDB 10. After applying the Japanese locale to "Interface Locale" under Account Setting (refer the link below), I get "HTTP ERROR 500" for accessing the admin console.

Link: Magento 2 - How do I change the locale of admin backend?

Found that the Japanese locale installation was incomplete. Consequently, I need a help for restoring the "en_US" locale by updating DB or Coding.

Please help me to resolve this issue by  providing the steps to change the locale with using command line.
Many thanks in advance.


texts: Customer Admin Shopping Cart only displays 20 items

texts:
I'm running Magento 1.9.2.4 and when I go to view a customers shopping cart in admin, it only lists up to 20 items, even though the header bar of the cart says 30 items (for example).

Can someone point me to the place in the application where I can modify this to make sure all cart line items are displayed?


texts: v1.6.0 - CreateShipment SOAP v2 call ships all items

texts:
We want to update orders with shipment details from an external system. We have successfully done the basics, but need to be able to partially ship orders.

The API description appears to allow for this, http://www.magentocommerce.com/api/soap/sales/salesOrderShipment/sales_order_shipment.create.html and specfically:

Notes: The array of orderItemQty is used for partial shipment. To create shipment for all order items, you do not need to specify these attributes.

However the API appears to ignore this. It doesn't seem to matter if we populate it with all the items and 0 out the ones we don't want shipped or just exclude them entirely.

Has anyone else encountered this problem or had to create partial shipments via the API before?

Thanks


texts: How to add a custom field to the frontend customer registration form in magento 2?

texts:
How to add following below fields to the fronted customer registration form.

1.company
2.Address
3.street
4.city
5.state
6.country
7.zip code
8.phone no
9.federal tax id


texts:
There seem to be a few similar questions out there but I am struggling to find one that relates to what I need.

I have a custom module that has a View controller. A sample URL would be:

/our-stores/index/view/id/2

I would like to change this to something similar to:

/our-stores/this-is-a-store
or /this-is-a-store.html
or /our-stores/view/this-is-a-store

I'm sure you get the idea.

I have tried adding a url redirect as follows:

$store_url = str_replace(' ', '-', $store_model->getStoreTitle());
Mage::getModel('core/url_rewrite')
                    ->setIsSystem(0)
                    ->setOptions('RP')
                    ->setIdPath($store_url)
                    ->setTargetPath('our-stores/view/index/id/' . $store_model->getId())
                    ->setRequestPath($store_url)
                    ->save();

This seems to partially work; if I go to /this-is-a-store it goes to the correct page by changes the URL in the address bar back to /our-stores/index/view/id/2

Can anyone please help me with a nice, clean way of achieving what I need?

If you need anything off me, please ask and I will provide.


texts: How to get ordered product image from getAllVisibleItems()

texts:
I have to display an image of the ordered product.
I am using getAllVisibleItems() to get all the details of my order.

From where I can get my ordered product image.


texts:
I'm trying to update my Magento front-end theme from the marketplace. I'm getting PHP version error (along with some other error).

below is the screenshot of the errors I am a getting.

I checked phpinfo(), My server is configured with PHP 7.0.27. I hope Magento-2 is compatible with this PHP version. Please help me on this errors.


texts: Can't enable my Module, Unknown Module error

texts:
my site is up so now I wan't to get into the back end to make some custom imports of products trough mysql.

Now I'm following the PHP Road-map, and wanted to make a testmodule, the problem is I stumble upon an error I can't seem to fix.

Here's the folder structure

Here's my composer located at the root of the module

Here's my registration located at the root of the module

Here's my module located at root/etc

And here' the error

Cache Management is disabled.


texts: Checkout not working in Magento 1.9.0.1 patched

texts:
In the last step of the onepage checkout the order is not placed.
An error alert appears instead. I presume it's related to one of the patches released in the last months, the problem has been there for at least two months.
Magento has been patched pretty regularly through ftp.
In the log folder this exception appears: https://jpst.it/G4kQ .
I can't figure out the problem, any help is appreciated.


texts: SOLVED: How do I sort configurable product super attributes on import? (M1)

texts:
My theme and business requirements stipulate that the super attributes for configurable products be presented in a specific order. While this can be changed in the Admin while editing a product by drag-and-dropping the attributes around, I want to be able to control this during import by CSV.

I found that Mage_ImportExport_Model_Import_Entity_Product_Type_Configurable::saveData hard codes the position property for super attribute in catalog_product_super_attribute here:

$superAttributes['attributes'][$productId][$attrParams['id']] = array(
    'product_super_attribute_id' => $productSuperAttrId, 'position' => 0
);

How can I allow this to be ordered on import?


texts: How validate all coupon code rules using custom validations?

texts:
I am using REST API and want to validate coupon code, whether it is applicable or not.

I have no checkout/session and no quote. I just have cart data and user checkout information.

What I actually want to achieve is, whenever I apply coupon code, it should only accept if it passes all the validations, all the conditions, and all the action rules defined inside the shopping cart price rule.

What is the proper way to validate the coupon code against all its rules ?

How should this be implemented ?

What are the alternatives ?


texts:
I am trying to install magento 2.3.0 on localhost i am getting following issue.

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/html/m230/vendor/magento/framework/Filesystem/Directory/Write.php on line 35


texts: How to setup Free shipping promotion rule for only products from specific categories over $200

texts: Row total from only eligible categories should be considered for the $200. .row  totals from other categories should not be added for $200 calculations


texts: How to export all categories, products, cms pages etc to another magento installation?

texts:
We have two magento installation for the same shop. One is named live and the other is named staging.

How can I mirror all products and categories from live with staging?

Do I have to export / import the whole database?


texts: How to add customer login form in header and footer in magento 1.9?


texts: Adding image option in custom option magento 1.9

texts: In custom option is a drop-down option with an SKU etc... What I want to know is, is it possible to add image field in magento 1.9


texts: How to add store multiselect to magento system configuration?

texts: I have a scenario where i need to be able to select magento stores like this from the system configuration section.


texts: magneto2 No 'Access-Control-Allow-Origin' header is present on the requested resource

texts:
i am creating one payment module,
i want to send data to api

but when ajax call from js file it give error

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://migs.mastercard.com.au/vpcdps. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."

my ajax code is like below

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<?php
$title = 'ANZ Payment';
$vpcURL = 'https://migs.mastercard.com.au/vpcdps';

$data = array("vpc_Version" => 1,
    "vpc_Command" => 'pay',
    "vpc_AccessCode" => '6447E199',
    "vpc_MerchTxnRef" => '100001',
    "vpc_Merchant" => 'TESTANZTEST3',
    "vpc_OrderInfo" => 'VPC Example',
    "vpc_Amount" => 100,
    "vpc_CardNum" => '5123456789012346',
    "vpc_CardExp" => '2105',
    "vpc_CardSecurityCode" => '123',
    "vpc_TicketNo" => '',
);

?>

<button id="payment" style="margin: 100px;font-size: 100px">
    PAY NOW
</button>

<script>
    $(document).ready(function(){
        $("#payment").click(function(){

            var transactionPayload = {
                "vpc_Version": 1,
                "vpc_Command": 'pay',
                "vpc_AccessCode": '6447E199',
                "vpc_MerchTxnRef": '100001',
                "vpc_Merchant": 'TESTANZTEST3',
                "vpc_OrderInfo": 'VPC Example',
                "vpc_Amount": 100,
                "vpc_CardNum": '5123456789012346',
                "vpc_CardExp": '0521',
                "vpc_CardSecurityCode": '123',
                "vpc_TicketNo": ''
            };
            vpcURL = 'https://migs.mastercard.com.au/vpcdps';

            console.log(vpcURL);
            console.log(transactionPayload);

            $.ajax({
                type: 'POST',
                data: transactionPayload,
                url: vpcURL,
                dataType: "text",
                crossDomain: true,
                async: false,
                success: function (response) {
                    alert('success');
                    alert(response);

                },
                error: function (err) {
                    alert('error');
                    console.log(err);
                    messageContainer.addErrorMessage({message: 'An error occurred on the server. Please try to place the order again.'});
                    fullScreenLoader.stopLoader(true);
                }
            });

        });
    });
</script>


texts: How can i import simple_links and downloadable_links of downloadable products?

texts:
i want to import downloadable products, which have multiple sample_links and downloadable_links, My Magento app is multi store site.
like i have 7 multistore/multilingual, each product belongs to different or same stores the title and description of each product is different with each store.
so once import a single product i am doing like this:
sample code

So how can i add the sample_links and downloadable_links for downloadable products?


texts: Problem with product image cache after upgrade

texts:
I'm new to Magento. I have just upgraded from 1.8.1.0 to 1.9.3.2. Something with the product image cache is not working. On my checkout page I get a long list of 404 Not Found errors for cached product images. See image below for more details. I see no errors in Apache error log, nor in var/log/system.log. What can I do? I have emptied the image cache. Can I somehow trigger a manual rebuild for the image cache?

I followed all suggestions from Magento not rebuilding product image cache but none solved the problem.

If it's relevant, Magento's cron job is currently not running on this machine since it is a development environment. Could that cause the problem? Maybe the image cache is triggered by a cron job?

A look in the requested folder shows that the 500x500 directory is missing:

$ ls media/catalog/product/cache/1/image/
38x  75x

A screenshot from my browser console when visiting the checkout page:

Edit 1

The web server has all permissions to the cache directory in media/catalog/product and its sub directories:

$ ll media/catalog/product/
...
drwxrwxrwx  3 www-data  www-data 4096 May 24 09:47 cache
$ find media/catalog/product/cache/ -maxdepth 2 -ls
    5898242    4 drwxrwxrwx   3 www-data www-data     4096 May 24 09:47 media/catalog/product/cache/
    5898243    4 drwxrwxrwx   5 www-data www-data     4096 May 24 09:55 media/catalog/product/cache/1
    5898289    4 drwxrwxrwx   4 www-data www-data     4096 May 24 09:47 media/catalog/product/cache/1/image
    5900914    4 drwxrwxrwx   3 www-data www-data     4096 May 24 09:55 media/catalog/product/cache/1/small_image
    5898271    4 drwxrwxrwx   4 www-data www-data     4096 May 24 09:47 media/catalog/product/cache/1/thumbnail

Edit 2

After updating to 1.9.3 images in fronted not loading from cache describes the same problem, but no solution was provided and I cannot comment on the question since my current reputation is too low.

Edit 3

The original images seems to be in place. I managed to find the URL to the original images by looking at the URL for the cached images.


texts: how to send data to ajax from controller

texts:
here is my phtml file

check_delivery.phtml

<script>
require([
    'jquery',
    'mage/mage'
], function ($) {
    var dataForm = $('#check-delivery-form');
    dataForm.mage('validation', {});
    var dataFormMessage = $('#check-delivery-form .message');
    dataFormMessage.removeClass('success').removeClass('error').hide();
    $('.action-check-delivery').on('click',function () {
            var formData = new FormData();
            formData.append('postcode', $('#check-delivery-form input[name="postcode"]').val());
            $.ajax({

                url: '<?php echo $this->getUrl('checkDelivery/postcode/check',['id'=> $product->getId()]) ?>',
                data: formData,
                processData: false,
                contentType: false,
                showLoader: true,
                type: 'POST',
                dataType: 'json',
                success: function (response) {
                    dataFormMessage.removeClass('success').removeClass('error').hide();
                    dataFormMessage.addClass(response.type).html(response.message).show();
                }
            });
            return false;
    });
});
</script>

now here is my controller

Index.php

<?php
namespace Learn\CheckDelivery\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;

    protected $_pincodeFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory,
        \Learn\CheckDelivery\Model\PincodeFactory $pincodeFactory
        )
    {
        $this->_pageFactory = $pageFactory;
        $this->_pincodeFactory = $pincodeFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        $pincode = $this->_pincodeFactory->create();
        $collection = $pincode->getCollection();
        foreach($collection as $item){
            echo "<pre>";
            print_r($item->getData());
            echo "</pre>";
        }
        exit();
        return $this->_pageFactory->create();
    }
}

any help on this is appreciated thanks in advance


texts: how to make grid text filter use equal instead of like?

texts:
<column name="plate">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="editor" xsi:type="array">
                        <item name="editorType" xsi:type="string">text</item>
                        <item name="validation" xsi:type="array">
                            <item name="required-entry" xsi:type="boolean">true</item>
                        </item>
                    </item>
                    <item name="label" xsi:type="string" translate="true">Plate</item>
                </item>
            </argument>
        </column>

this will generate a SQL using like, but I want to make sure plate='qwef123' is used instead


texts: How to get recently viewed products by Customer Id in Model file Magento 2?

texts: Create Recently Viewed Products for Model file in Magento 2 ?


texts: Magento 2 Project How to setup in git via local

texts:
i have magento 2 project and i want to setup in local via git
and after setup how to run git command like commit , push or else
any tutorial or video available for that ?
Thanks!!


texts: Magento 2.1.7 Create Shipping label popup in Order grid view

texts:
I am using Magento 2.1.7 inbuilt Fedex Create Shipping label in our client website. Is it possible to bring the "Create Shipping Label" side popup in Sales Order grid view? Currently, this button is showing after selecting View link of the particular order in order grid and then select Shipments ->Then have to choose to Create a shipping label.

Or else how to add a button in sales order grid view table and selecting that has to open the order details in a new window and make active the shipments tab to process the shipment fast.

Thank you.


texts:
I have Magento 2.3.4, I have set all pricing as Including Tax, I have added pricing in products Including Tax, everything is works fine, just one issue is in Admin Dashboard page “Last Orders” section which is showing wrong order Total value. Its showing only base vale (Without Tax, Without Shipping etc…) but I want to show its same value as showing Sales -> Orders listing page. I have set 10% TAX.
Here I have attached both shots for Orders listing and Dashboard:
159 = 144.55 + 14.45 (Tax)
409 = 371.82 + 37.18 (Tax)
449 = 408.18 + 40.82 (Tax)
78.90 = 62.73 + 6.27 (Tax) + 9.90 (Shipping)
549 = 499.09 + 49.91 (Tax)
So I want to show final total on dashboard orders. See attached screenshots.


texts: Add additional price to the catalog listing - Magento 2.2

texts:
I have two needs for this requirement, both to show an additional price on the storefront catalog grid.

One is to show an inc. VAT figure, the other (for another site) is to show a price per square meter. I've put a very rough example below. I have the attributes created and set to be available on the storefront.

I'm not an accomplished Magento developer, but if I know what file to edit I can amend it in a theme and have done for other requirements.

I don't know whether I am getting the terms wrong, but I can't find a guide on how to do this anywhere. I have searched!

If anyone can help, or point me in the right direction I'd be very grateful.

Thanks!

Aaron


texts: How to install and Configure Varnish in Magento 2?

texts:
How to configure varnish in magento 2?

Selecting Varnish Cache in Stores Configuration is enough?


texts: The image cannot be removed as it has been assigned to the other image role?

texts:
I am using Magento 2.1.4 unable to remove the image while removing it noticing "The image cannot be removed as it has been assigned to the other image role".
How can I overcome this?
I have searched on Google but didn't get any proper result and fix for this could you please provide me any suggestions.
Thanks in advance


texts:
Show category with images in homepage Magento2

http://ibnab.com/en/blog/magento-2/magento-2-frontend-how-to-call-category-collection-on-home-page

This article working fine but I need to show category image.How to fetch category images also

I am using $category->getImageUrl();

but its not working


texts: How to add recently products slider in magento2?

texts:
0
I am using Magento 2.4.2. I have added recently viewed products widget in the product details page. Here I want to add slider using swiper. But slider is not working for recently viewed products. JS is loading before the html file.
Here is the file path where content is rendering for the section: [Vendor]/[Theme]//Magento_Catalog/web/template/product/list/listing.html
I have tried with this link as well. Magento 2 - How to apply Slick Slider to Recently Viewed Widget
But slider is not working for this section. When I added demo slider in the same page its working. But only for this recently viewed products section not working. How to do this? please suggest solution for this.

Thanks.


texts:
Can anyone provide a working example for creating a visual swatch (or even a text swatch) attribute as part of a setup script.

I've tried the example on Magento 2 create custom swatch attribute programmatically but it doesn't work for me.

The issue I've ran into there is that the the attribute repository cannot find the new attribute that was created. I tried putting some cache clearing in between but no luck.

Thanks.


texts: Magento CRITICAL Site Down: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

texts:
I changed the password in Magento admin panel and cleared the cache via the dashboard. Then my website went completely offline, only to display the multiple lines of text with the 2 exceptions mentioned.

It seems as though the database information within env.php might be encrypted because it has an additional array.

env.php file:

'crypt' =>
array (
  'key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (//not real key)

The following is the error log received when trying to access site:

  Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [1045]
  Access denied for user 'root'@'localhost' (using password: YES)

  Exception #1 (PDOException): SQLSTATE[HY000] [1045] Access denied for
  user 'root'@'localhost' (using password: YES)

I'm a non-tech guy with novice experience with web development. Any help would be appreciated!


texts: Theme is not displaying category products

texts:
I have a problem with my theme, the only thing i need is to display category products (products from one category, just one to be exact) and i really can't make it work.

This should work, because i found it with google and it worked for someone:

{{block type="catalog/category_view" template="catalog/category/view.phtml" category_id="7"}}

But it's not working for me, for some reason my theme doesn't seem to be working like this and I get the error:

Fatal error: Call to a member function getMetaTitle() on a non-object in /app/code/core/Mage/Catalog/Block/Category/View.php on line 44

changing the "block" to "widget" (it seems this theme works with widgets)

{{widget type="catalog/category_view" template="catalog/category/view.phtml" category_id="7"}}

removes the error but doesn't show anything.