texts: Magento - Add customer attribute to order grid

texts:
I'm trying to add a custom customer attribute to the order grid. This custom attribute borns from an extension that I had installed on magento. This special field i managed to get it in customer grid by entering this code in the Grid.php of the customer list:

$this->addColumn('agente', array(
            'header'    => Mage::helper('customer')->__('Agente'),
            'width'     => '150',
            'index'     => 'agente',
        ));

But in the Grid.php of the orders does not work and I tried everything.
The last code that I tried is this:

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),'sfoa.entity_id=main_table.entity_id',array('sfoa.email'));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

protected function _prepareColumns()
    {
        $this->addColumn('agente', array(
            'header' => 'Agente',
            'width' => '80px',
            'type' => 'text',
            'index' => 'agente',
        'filter_index' => 'sfoa.agente'));

The error that returns me in the log is always this: "Unknown column 'sfoa.agente' in 'field list', query was: SELECTmain_table. *, Sfoa.agente FROMsales_flat_order_grid AS main_table"

How else could I take this attribute and insert it into Order Grid?


texts: plugin for custom field for contact form magento2

texts:
I want to create plugin for contact form with two custom fields first-name and last-name to send email.
anyone can help with this?

Thanks in advance.

in di.xml

    <config xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="Magento\Contact\Controller\Index\Post">
         <plugin name="Convert_CustomContact_Plugin" type="Convert\CustomContact\Plugin\Post" sortOrder="10" disabled="false"  />
    </type>
</config>

In plugin

<?php

namespace Convert\CustomContact\Plugin;
use Magento\Framework\App\Request\DataPersistorInterface ;
use Magento\Framework\App\Action\Context;
use Magento\Contact\Model\MailInterface;
use Magento\Framework\Escaper;
use Magento\Framework\Translate\Inline\StateInterface;

class Post
{
    protected $inlineTranslation;
    protected $_escaper;

    public function __construct(
     DataPersistorInterface  $dataPersistor,
     Context $context,
     Escaper $escaper,
     StateInterface $inlineTranslation
    ) {
        $this->dataPersistor = $dataPersistor;
        $this->context = $context;
        $this->_escaper = $escaper;
        $this->inlineTranslation= $inlineTranslation;
    }

    public function afterExecute(\Magento\Contact\Controller\Index\Post $subject, $result)
    {
        // In the original method, dataPersistor is cleared if a message has been sent
        // so we can use it as an indicator to whether a user can be redirected somewhere else
        // or fall back to the result of the original method
         $post = $subject->getRequest()->getPostValue();

        if ($post) {
        $this->inlineTranslation->suspend();
        // $this->inlineTranslation->suspend();
        $postObject = new \Magento\Framework\DataObject();
        $postObject->setData($post);
        $error = false;
        $sender = [
            'firstname' => $this->_escaper->escapeHtml($post['firstname']),
            'lastname' => $this->_escaper->escapeHtml($post['lastname']),

            ];

        }
        return $result;
    }

}


texts: How add mask to input with knockout javascript?

texts:
I need to add a mask to postcode input (ex: 99.999-99), so I have Vendor/Theme/Magento_Checkout/web/template/form/element/zipcode.html with:

<input class="input-text col s12 zipcode" type="text" data-bind="
    value: value,
    valueUpdate: 'keyup',
    hasFocus: focused,
    attr: {
        name: inputName,
        placeholder: placeholder,
        'aria-describedby': getDescriptionId(),
        'aria-required': required,
        'aria-invalid': error() ? true : 'false',
        id: uid,
        disabled: disabled
    }" name="postcode" aria-required="true" aria-invalid="false" id="zipcode">

And my checkout_index_index.xml :

<item name="postcode" xsi:type="array">

<item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
<item name="validation" xsi:type="array">
    <item name="required-entry" xsi:type="string">true</item>
</item>
<item name="config" xsi:type="array">

    <item name="elementTmpl" xsi:type="string">Magento_Checkout/form/element/zipcode</item>
</item>

I Already have Vendor/Module/etc/zip_codes.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Directory:etc/zip_codes.xsd">

    <zip countryCode="BR">
        <codes>
            ^[0-9]{5}$
            ^[0-9]{2}\.[0-9]{3}\-[0-9]{3}$
        </codes>
    </zip>
</config>


texts: Magento 2 missing component listingToolbar

texts:
I'm getting this error in Magento 2 (after successfully migrated from 1.7.0.2):

  The requested component ("listingToolbar") is not found. Before using, you must add the implementation.

Anyone who experienced this bug?


texts: Magento2.1.9 How to apply condition in checkout shipping method?

texts: In magento2 checkout page i'm using free shipping method and i need to hide free shipping method only for non stocking customer group and rest of all customer group i want to display free shipping method.So anyone please guide me in which file i have to put condition.Please check attached image.


texts: I have a magento website Logtech . I have changed the default title and all to my site variables. But when I search in google for logtech.in it shows the title Magento Commerce.


texts: Magento 2 custom customer attributes not loading in frontend

texts:
I am trying to create a few custom customer attributes and make them usable for the customers in the frontend.

I have created a module that creates the attributes and places these attributes in the adminhtml. In the backend works like a charm.

But i want the customers to be able to insert information in these attributes theirselves.

The location i am trying to place these attributes in is in the customer/account/edit page.

This is part of the code im using in the setup/installdata.php

$customerSetup->addAttribute(Customer::ENTITY, 'child1_firstname', [
    'type' => 'varchar',
    'label' => 'Child 1 firstname',
    'input' => 'text',
    'required' => false,
    'visible' => true,
    'user_defined' => true,
    'sort_order' => 1000,
    'position' => 1000,
    'system' => 0,
]);
$attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'child1_firstname')
->addData([
    'attribute_set_id' => $attributeSetId,
    'attribute_group_id' => $attributeGroupId,
    'used_in_forms' => ['customer_account_create','adminhtml_customer', 'customer_form_edit', 'customer_edit'],
]);
$attribute->save();

And for the xml i created the customer_account_edit.xml And inserted the form/edit block here so i could rebuild this block but with the extra

<referenceContainer name="content">
    <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="Sprite_CustomerAttribute::form/edit.phtml" cacheable="false">
        <container name="form.additional.info" as="form_additional_info"/>
    </block>
</referenceContainer>

The next part is the part i am stuck. I am not sure how to go on from here. I have copied the core file to here and then i added the extra fields i want to use here. But i have absolutely no clue on how i can insert the data from the database in these fields. And how i can save them to the database using the same button.

    <?php /* @escapeNotVerified */ echo __('Child 1 firstname') ?>

        <input type="text"
            name="child1_firstname"
            id="child1_firstname"
            value="<?php echo 'need information from the custom attribute here' ?>"
            title="<?php /* @escapeNotVerified */ echo __('Child 1 firstname') ?>"
            class="input-text"
            data-validate="{required:true}"
            autocomplete="off">

I did notice that the core is using block php and another phtml file. But im not sure if i have to go the same way for these custom attributes.

Could somebody help me clear up on how i can resolve this issue and get the information of the custom attribute to show and to save it when the customer changes it?


texts: Magento2: How to add 3rd party payment getaway?

texts:
I need to integrate PayTrace 3rd party payment gateway in Magento 2.

Can you explain how to add it?

https://www.paytrace.net/developer

My Magento v2.0.17


texts: Import Database to phpmyadmin from live server

texts: I download/export the database file from live server and change domain name i.e localhost/foldername ao when i import the database to my local server phpmyadmin it gives sql import errors in queries how to resolve??


texts: How do I get image filenames to show in the product edit images tab?

texts:
I want to be able to see what image filenames are when I edit products in admin.

Something like this is what I want although the text can go anywhere, e.g. below the images, as a title tag on the images, whatever.

I have tried looking for the template page for the images tab of the admin product view page to hopefully be able to just add on the filename either as a title tag on the image or beneath the text label box. However I have got stuck.

Any ideas?


texts: Change mobile layout in responsive theme

texts: In a responsive theme for v1.9, Which file should I edit to change the default layout to 1 column, in mobile browsers?


texts:
I want to calculate the tax on the profit from a product. In Holland, when you sell second-hand products you bought without tax, you have to calculate the tax on the profit.

Is this possible within Magento? I need to set it up per product because not all products will fit in this case.


texts: How to prevent buying an item at a special price unless specified number of other items are purchased?

texts: I've managed before to ensure customers purchase x amount of items at £y each to get a discount voucher of £z. However, I now have a large range of items which are already discounted as a special price (differing amounts, so coupon not the way forward here) and I'd like to know if there's a way to make sure customers can only buy it if they purchase, let's say, 3 other products. Any ideas anyone please?


texts: Difference in response from magento swagger and postman Magento 2

texts:
I have custom API in which I am retrieving customer balance as:

use Magento\CustomerBalance\Model\BalanceFactory;
........................
........................
$model = $this->balanceFactory->create()->setCustomerId($customerId)->loadByCustomer();
$customerBalance = $model->getAmount();

In postman request is send as:

  http://127.0.0.1/rest/V1/mymodule/request/R1

and output is correct logged in customer balance.

But when I test same API in Magento swagger UI, here the Curl appears is:

  curl -X POST
  "http://127.0.0.1/index.php/rest/all/V1/mymodule/request/R1" -H
  "accept: application/json" -H "Authorization: Bearer
  nbvkrjkewuiu398hds"

which has extra index.php/rest/all/

and from response the customer balance is shown as 0 always.

What is the reason of different output on testing same API in Default Swagger and then in Postman ?

Any help will be highly appreciated!


texts: Magento 2: Using Cart Based Rules to apply Free Shipping only to specific products

texts:
Hello StackExchange Magento People!

We are trying to apply Free Shipping only to specific products - products that have an attribute like "Free Shipping" = 'Yes'.

Our configuration is set such that we only have two shipping methods:
Free - which should only appear to designated products
and
Flat Rate - which should apply to the rest of the products.

We've setup the Cart Rules to apply Free Shipping with a straightforward rule of "If attribute = Free Shipping = Yes" give free shipping.

Yet, what is happening is that regular products are given the free shipping treatment when added to the cart.

Any insight or tips would be great on resolving this issue.

Thanks!

Rad


texts: Magento 2 : modules install but not showing in admin panel

texts:
Please stop me tearing what is left of my hair out.

Magento 2.2.4, two modules installed via composer. Cleared var/page_cache, var/view_preprocessed, var/cache, pub/static, generated/.
Then run :

bin/magento setup:upgrade

Modules show up fine in the list that scrolls past. Modules also list as enabled in app/etc/config.php

Then run

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

The modules show up in pub/static/adminhtml/Magento/backend/en_US and generated/code, but there is absolutely no sign of them in the admin panel itself.

What am I missing? They deploy fine on the dev site which is running the same structure.


texts:
I'm developing an extension that have custom xml/xsd configuration files. When I'm trying to load extension url, it's giving me following error:

Warning: DOMDocument::schemaValidate(): Invalid Schema source in /var/www/html/mage202/vendor/magento/framework/Config/Dom.php on line 290

Example:

in customconfig.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Ktpl_Customconfig:etc/customconfig.xsd">
    <mynode1>HELLO</mynode1>
    <mynode>HELLO 2</mynode2>
</config>

in customconfig.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="config">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="mynode1" type="xs:string" maxOccurs="10"/>
                <xs:element name="mynode2" type="xs:string" maxOccurs="10"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

in SchemaLocator.php class

namespace Ktpl\Customconfig\Model\Table;
use Magento\Framework\Module\Dir;

class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
{
    /**
     * Path to corresponding XSD file with validation rules for merged config
     *
     * @var string
     */
    protected $_schema = null;

    /**
     * Path to corresponding XSD file with validation rules for separate config files
     *
     * @var string
     */
    protected $_perFileSchema = null;

    /**
     * @param \Magento\Framework\Module\Dir\Reader $moduleReader
     */
    public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader)
    {
        $etcDir = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Ktpl_Customconfig');
        $this->_perFileSchema = $etcDir . '/customconfig.xsd';
    }

    /**
     * Get path to merged config schema
     *
     * @return string|null
     */
    public function getSchema()
    {
        return $this->_schema;
    }

    /**
     * Get path to pre file validation schema
     *
     * @return string|null
     */
    public function getPerFileSchema()
    {
        return $this->_perFileSchema;
    }
}

How can I create custom xml file and read data from this custom xml file?


texts: Can not update quote_id field of "quote_item" table magento 2

texts:
I want to assign items added to cart by one customer to the other customer's cart.

For this I see two tables responsible for holding that data. One is table named "quote" and other is "Quote_item".The customer in which I want to transfer the cart item already has a quote created on quote table. so I thought changing the quote_id of that customer on quote_item table would do the trick.

Let me explain by example:

Let us assume we have two customer with quote id 1 and 2.
Customer 1 added a product to the cart so on quote_item table the item will be saved with quote id 1. so if I could change the quote id of that item to 2 than that product will be assigned to customer 2.

I tried it by manually changing to the database and it worked. But When I tried to update that table programatically than it couldn't update the row. I think there is some kind of dependencies that I couldn't figure out.So I hope if someone could help me figure it out.

Below is the update code that I have written.

$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$quoteItemModel = $_objectManager->create('Magento\Quote\Model\Quote\Item');
//filter the product with same quote id
        $productCollection = $_objectManager->create('Magento\Quote\Model\ResourceModel\Quote\Item\Collection')->addFieldToFilter('quote_id',$quoteId);
            if($products = $productCollection->getData()){
                foreach ($products as $product) {
                    $itemId = $product['item_id'];
                    $data = array();
                    //just putting a static value to check if the data gets updated
                    $data['quote_id']='2';
                    //updating the quote_item table
                    $quoteItemModel->load($itemId)->addData($data);
                    try {
                        $quoteItemModel->setId($itemId)->save();
                        echo "Data updated successfully.";

                    } catch (Exception $e){
                        echo $e->getMessage();
                     }
                    }

I know the code works perfectly with other custom tables.But in this case it is not updating the data.
Its gives below error:

  Fatal error: Call to a member function getStoreId() on null in
  E:\xampp\htdocs...\vendor\magento\module-quote\Model\Quote\Item\AbstractItem.php
  on line 144

When I checked that file. The function is:

 public function getProduct()
    {
        $product = $this->_getData('product');
        if ($product === null && $this->getProductId()) {
            $product = clone $this->productRepository->getById(
                $this->getProductId(),
                false,
                $this->getQuote()->getStoreId()
            );
            $this->setProduct($product);
        }

I don't understand what it has to do with the update of table quote_item.I think there is some foreign key constraints or some dependency which is why it is not letting me update the quote_id of quote_item table.

Can some genius mind please help me out here or clearify what could have possibly gone wrong?

Actually I searched the whole internet and also posted question on stackoverflow about the migration of customer cart from one customer to another but still I haven't got a perfect working solution for it.

If someone could help me on this, it would be greatly appreciated.

Thanks.


texts: Meta Descriptions - Item Count Appearing on Search Engines

texts:
For category pages, when displayed on search engines, there is an "item count" that is displayed before the meta description.  I fear this may be hurting our click through rates.

Is there a way to disable this?

Is there a reason not to?

I've included a screenshot of Google results below.


texts: Contact form Emails are not working in magento 1.7

texts:
I am not receiving any emails from the contact form. SMTP details are correct, I am able to receive sales emails.

Checked in the source but could not figure it out.

By the way I am using Magento 1.7.0.2 and theme is ultimo.


texts: Load resource models without using deprecated getResource

texts:
I'm using Magento\Newsletter\Model\ResourceModel\Subscriber::loadByCustomerData
Code is like this
 /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */

 [...]

 $subscriber = $this->subscriberFactory->create();

 $array = $subscriber->getResource()
     ->loadByCustomerData($customer);
 [...]

I spotted that getResource is @deprecated because resource models should be used directly which makes sense.
What would be the correct way to do this without using deprecated code?


texts: Can't see product images in admin, also missing Browse Files and Upload Files

texts:
I can see all product images at the store level, but can NOT see any images in the admin area! Furthermore when I create a new product under admin, the "Browse Files..." and "Upload Files..." buttons are also missing.

I checked the var/log/system.log and see the following error each time i go to view the image tab:

2016-08-19T13:38:08+00:00 CRIT (2): Not valid template file:adminhtml/base/default/template/media/uploader.phtml

Could this be a file/folder permission issue?

Has anyone seen this issue?

Missing "Browse Files..." and "Upload Files..." buttons

This is what I see!
It's missing "Browse Files...", "Upload Files..." buttons and none of the  images are showing up.

NOTE: New Discovery
Looking at the error log, I realized folder media/ and files media/editor.phtml and media/uploader.phtml do not exist! So I got them from the original Magento 1.9.1. and placed them under /app/design/adminhtml/default/default/template/.

The images showed up, But I am still missing the the "Browse Files..." and "Upload Files..." buttons.

Now I am trying to figure which files or folders are missing, to bring that functionality back.

Solved the disappearance of the buttons issue also.
While searching I found this link and found out that I am also missing another folder and it's content. skin/adminhtml/default/default/media/ which contained the 3 files flex.swf, uploader.swf and uploaderSingle.swf.  Once I copied this folder the buttons appeared.

Also pursuant to the above mentioned article media folder should exist in the following folders:

  skin/adminhtml/default/default
      /app/design/adminhtml/default/default/template/system/config/system/storage
      /js/tiny_mce/plugins/
      design/adminhtml/default/default/template/


texts:
I noticed that some of my product images are missing.  After exporting the products, I see that a lot of my images have been renamed with a _1, _1_1, _1_2, etc.  There are actually quite a few in the series.

I use a lot of the images for the same products, so it makes sense that it is making a new image for every product (I guess), but a lot of the images have 0 bytes when I check through my ftp site, hence the reason why some images are not showing up.

Can I go through and delete all of the _* from the file names so that all products that share an image will only use the original image?

If so, what's the best way to do this?  I am new to Magento and learning as I go along.  The company that built my site is a no longer in the picture so I am having to learn everything from scratch and do myself.

I can export the entire database but have never uploaded it and am hesitant to do so for fear of screwing up everything.

Any help/suggestions would be greatly appreciated.


texts: Magento 2: How can dynamically display Name of Tax Rule on product page

texts:
To display Name of tax rule on the product details page I creat a module through this link (Magento 2: How can display Name of Tax Rule on product page). And it's working successfully check below images
Now I want it dynamically, which means,I created two tax rules for two stores US and IN, I need while customers click on  US-tax rule or IN-tax rule on the product page, the price automatically calculate accordingly. check below images product price change on the selected stores.
1> default store product price is $60.00
2> when select **US store product price $64.95**
3> when select **IN store product price $63.00**
now I want above changes of price on click of US-tax rule and IN-tax rule.


texts:
Using it on magento version 2.3.1
I guess I am missing something if someone can help would be great!
I am trying to add country code column in the sales.

So far I've done the following:

  I have added in sales_order_grid.xml

<column name="code">
 <argument name="data" xsi:type="array">
 <item name="config" xsi:type="array">
 <item name="filter" xsi:type="string">text</item>
 <item name="label" xsi:type="string" translate="true">Code</item>
 </item>
 </argument>
 </column>

  Created folder in app/code/Vendor/ExtendGrid/Module/ResourceModel/Order/Grid/Collection.php

<?php
    namespace Vendor\ExtendGrid\Model\ResourceModel\Order\Grid;
    use Magento\Sales\Model\ResourceModel\Order\Grid\Collection as OriginalCollection; use Vendor\ExtendGrid\Helper\Data as Helper;

        class Collection extends OriginalCollection {

        protected function renderFiltersBefore()  {
        $joinTable = $this->getTable('directory_country_region');
        $this->getSelect()->joinLeft($joinTable, 'main_table.region_id = directory_country_region.region_id', ['code']);        parent::_renderFiltersBefore();
    }

}

?>

Created folder app/code/Vendor/ExtendGrid/etc/di.xml

      Vendor\ExtendGrid\Model\ResourceModel\Order\Grid\Collection

Now I can see the new column code in sales but seems like I have missed something and cannot get the date from the DB table


texts: How do i restrict the user to only using 8 numbers in the telephone field on checkout?

texts:
I am trying to force the user to use numbers in the field limiting them to 9 numbers (no more and no less). I've found that that the XML file path for the checkout page is
 *\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml and the code related to the phone is as follows:

 <item name="min_text_length" xsi:type="number">11</item>
 <item name="max_text_length" xsi:type="number">11</item>
 <item name="validate-number" xsi:type="number">1</item>

And now i want to add a validation similar to the min_max_length that would refuse to accept any further input past 9 numbers


texts: Fix duplicate entries in customer tables

texts:
Having a bit of a nightmare trying to fix a messed up mg_customer_address_entity_varchar table.
When I exported customers with dataflow from an old store to a new one, I didn't realize that somehow two columns (Shipping Company and Billing Company) had been duplicated several times across multiple customers, seemingly at random.
So now when existing customers place a new order, they are often seeing a wrong company name in their address.
Unfortunately I have no way of knowing which company name actually belongs to which customer.
The only thing I can think of doing is to completely remove all Shipping Company and Billing Company entries from the database.
I am not very good with phpMyadmin and I'm worried about going and manually deleting entries, especially in bulk, as I might accidentally render the whole table useless or cause errors in the admin.
Can anyone suggest a safe way to remove all Shipping Company and Billing Company entries without causing any unwanted behavior? It has to be done in bulk in the database as there are literally hundreds of such duplicate entries, so I can't do it one by one in the admin.
Many thanks for any help!


texts: How to save two entries in one table row in Magento 1.9?

texts:
I have to save In and Out timing of customer and their In and Out location, I want to save all the data in one row.

I am getting status 1/0 1== In DATA, 0== Out DATA, but how to save it in the same row?

Here are both my In and Out functions:

public function ws_pushPunchInData($custid,$intime,$inlocation,$device_id,$status,$create_at)

{
    //Mage::log("intime: ".$intime.", outTime: ".$outtime.", create_at: ".$create_at, null, 'punchinout.log', true);
    $res = $data = array();
    $res['code'] = 400;
    $res['msg'] = "Invalid request";
    if ($custid)
    {
        $current = date('Y-m-d H:i:s');
        try
        {
            $data = array(
            'manager_id' => strval($custid),
            'punch_in_time' =>$intime,
            'in_coordinates' =>strval($inlocation),
            'device_id' => strval($device_id),
            'status' => strval($status),
            'create_at' => $current;

            $smodel = Mage::getModel("manager/asmtracker")->setData($data)->save();

            $res['code'] = 200;
            $res['msg'] = 'Successfully updated';

        }catch(exception $exception)
        {
            $res['msg'] = 'Unable to process';
        }
    }
    return $res;
}
 public function ws_pushPunchOutData($custid,$outtime,$outlocation,$device_id,$status,$updated_at)

{
    //Mage::log("intime: ".$intime.", outTime: ".$outtime.", create_at: ".$create_at, null, 'punchinout.log', true);
    $res = $data = array();
    $res['code'] = 400;
    $res['msg'] = "Invalid request";
    if ($custid)
    {
        $current = date('Y-m-d H:i:s');
        try
        {
            $data = array(
            'manager_id' => strval($custid),
            'punch_out_time' =>$outtime,
            'out_coordinates' =>$outlocation,
            'device_id' => strval($device_id),
            'status' => strval($status),
            'updated_at' => $current);

            $smodel = Mage::getModel("manager/asmtracker")->setData($data)->save();

            $res['code'] = 200;
            $res['msg'] = 'Successfully updated';

        }catch(exception $exception)
        {
            $res['msg'] = 'Unable to process';
        }
    }
    return $res;
}


texts: How to mock a core method by phpunit in magento 2

texts:
I have a piece of code that looks like this
$noRouteIdentifier = $this->scopeConfig->getValue(
                    'web/default/cms_no_route',
                    \Magento\Store\Model\ScopeInterface::SCOPE_STORE
                );
                $noRouteDelimiterPosition = strrpos($noRouteIdentifier, '|');
                if ($noRouteDelimiterPosition) {
                    $noRouteIdentifier = substr($noRouteIdentifier, 0, $noRouteDelimiterPosition);
                }
                $customRedirectionUrl = $this->url->getUrl($noRouteIdentifier);
                $this->_messageManager->addError("invalid contact form");
                return $this->resultRedirectFactory->create()->setPath($customRedirectionUrl);

How I can mock data for the last line return $this->resultRedirectFactory->create()->setPath($customRedirectionUrl);
the $this->resultRedirectFactory belongs to \Magento\Framework\Controller\Result\RedirectFactory class
I have tried mock it in setUp() like this but it not work
It returns an error: Method name matcher is already defined, cannot redefine
$this->resultRedirectFactory =
            $this->getMockBuilder(\Magento\Framework\Controller\Result\RedirectFactory::class)
                ->disableOriginalConstructor()->getMock();

        $this->resultRedirect = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class)
            ->disableOriginalConstructor()->getMock();

        $setPath = $this->resultRedirectFactory->expects($this->any())
            ->method('create')
            ->willReturn($this->resultRedirect);

        $setPath->method('setPath')->willReturn('/');

the constructer
// SUT
        $this->model = $this->objectManager->getObject(
            Index::class,
            [
                'context' => $this->contextMock,
                'customerSession' => $this->session,
                'resultPageFactory' => $resultPageFactoryMock,
                'resultRedirectFactory' => $this->resultRedirectFactory,
                'resultRedirect' => $this->resultRedirect
            ]
        );


texts:
At magento checkout, when the user has already got registered address, it comes with a select to choose between the registered address or choose a new address.

How would I change this so that when the checkout was loaded, regardless of whether the client has a registered address or not, the "new address" was checked and the fields opened for typing?


texts:
I want to flush the cache by code and I tried these in my test folder:

<?php
include '/var/www/myfolder/mage_classes.php';
Mage::app()->getCacheInstance()->flush();

or

Mage::app()->getCache()->clean();

none of them cleared the cache I also used

try {
    $cacheTypes = Mage::app()->useCache();
    foreach ($cacheTypes as $type => $option) {
        Mage::app()->getCacheInstance()->cleanType($type);
    }
} catch (Exception $e) {
    Mage::log($e->getMessage());
}

also in my back end admin all cache options are enabled

and again no result when I run this code no error willl be shown and it seems that it will run but with no effect


texts:
I have a URL that looks like this:

  site.local/wheel-tyres/tyres.html?find=aprilia-af-1-futura-1989-4729&sid=T80yDaUX1a

I'm trying to get it to look like this:

  site.local/wheel-tyres/tyres/aprilia-af-1-futura-1989-4729/

I found this post on StackOverflow and tried to implement with amendments I though would work, but the page 500s now.

DirectoryIndex index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteRule ^*.html/(.*)$ /*.html?url=$1 [L,QSA]

This code was added to the pub/.htaccess file.

How do I go about getting the find param into a readable url?


texts: Module throwing error and setup:upgrade not working after I enabling my custom module

texts:
I have developed a custom module and it is working fine in Magento 2.1.6 in my local system.
But when am trying to enable my module in Magento 2.1.6 in my client's server then Magento throwing an error like:

  Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 6 Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 6 in /public_html/vendor/magento/framework/Config/Reader/Filesystem.php:160 Stack trace: #0 /public_html/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator)) #1 /public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader.php(69): Magento\Framework\Config\Reader\Filesystem->read('global') #2 /public_html/vendor/magento/framework/App/ObjectManager/Environment/Developer.php(77): Magento\Framework\App\ObjectManager\ConfigLoader->load('global') #3 /public_html/vendor/magento/framework/App/ObjectManagerFactory.php(1 in /public_html/vendor/magento/framework/Config/Reader/Filesystem.php on line 160

When trying to run setup:upgrade I got another error:

  There are no commands defined in the setup namespace

I have searched many articles but unable to find the solution.

I am using PHP Version 7.0.21 and Magento 2.1.6.

Please help me to solve this.


texts: Need to show full CMS page list in system configuration. each store With their respective pages

texts:
Need to show the full CMS page list in the system configuration.

I used

<source_model>adminhtml/system_config_source_cms_page</source_model>

It shows everything. But when going to store individually, it shows all pages which are not related to that store. I want it to shows only pages related to that store.

So I need source model seperately for the  store.


texts: Magento2 core javascript object in custom javascript

texts:
i would like to access the javascript object for the product custom options and need to change the price of the custom option.
I have found below data for the custom options.

<script type="text/x-magento-init">
    {
        "#product_addtocart_form": {
            "priceOptions": {
                "optionConfig": {"1":{"1":{"prices":{"oldPrice":{"amount":1,"adjustments":[]},"basePrice":{"amount":1},"finalPrice":{"amount":1}},"type":"fixed","name":"Option1-1"},"2":{"prices":{"oldPrice":{"amount":2,"adjustments":[]},"basePrice":{"amount":2},"finalPrice":{"amount":2}},"type":"fixed","name":"Option1-2"},"3":{"prices":{"oldPrice":{"amount":3,"adjustments":[]},"basePrice":{"amount":3},"finalPrice":{"amount":3}},"type":"fixed","name":"Option1-3"},"4":{"prices":{"oldPrice":{"amount":4,"adjustments":[]},"basePrice":{"amount":4},"finalPrice":{"amount":4}},"type":"fixed","name":"Option1-4"}}},
                "controlContainer": ".field",
                "priceHolderSelector": "[data-role=priceBox]"
            }
        }
    }
</script>

My concern is that how can i access the optionConfig from the above object. So I can modified it before magento change update price and then magento will update price accordingly.

I have created the below javascript widget.

define([
    'jquery',
    'underscore',
    'mage/template',
    'priceUtils',
    'priceBox',
    'priceOptions',
], function ($, _, mageTemplate, utils) {
    'use strict';
    var globalOptions = {
        qtyFieldSelector: 'input.qty',
    };
    $.widget('mage.fixedprices', $.mage.priceOptions, {
        options: globalOptions,
        /**
         * @private
         */
        _create: function() {
            console.log('hey, fixedprices is loaded!')
            //bind click event of elem id
            this.element.on('change', function(e){
                console.log('change ME!');
            });
            this.element.on('change', this._onQtyFieldChanged.bind(this));
        },

        _onQtyFieldChanged: function onQtyFieldChanged(event) {
            console.log("Magentoins fixedPrices", this.options);
        }
    });

    return $.mage.fixedprices;

});

I am getting optionConfig as null.


texts: Magento 2 make product attribute available in QuoteItem

texts:
Working on a modification to shipping in Magento 2 and need to have a conditional based on a product attribute which is not currently exposed. How can this be done?

In my Shipping class, I can get access to the product in these two ways (productFactory is passed into construct of class):

$allItems = $request->getAllItems();
foreach ($allItems as $item) {
    //First way
    $desiredAttribute = $item->getData('desiredAttribute');
    $desiredAttribute = $item->getDataByKey('desiredAttribute');
    $productData = $item->getData();
    //Second way
    $product = $this->productFactory->create()->load($item->getId());
    $desiredAttribute = $product->getData('desiredAttribute');
    $desiredAttribute = $product->getDataByKey('desiredAttribute');
    $productData = $product->getData();
}

Neither have the custom attribute visible. I tried setting the attribute available for Promo code = Yes, but that still does not work. Can definitely see some data about the product such as dimensions and such which would be expected at this point. I can see in the $product object a protected array called _attributesByCode which does display this, however accessing the attribute by key is not working. Thanks in advance.

Final solution leveraging the XML from the answer below my code ended up looking something like this:

$allItems = $request->getAllItems();
foreach ($allItems as $item) {
    $desiredAttribute = $item->getProduct()->getDesiredAttribute();
}

If this attribute is a set of options it will return the optionId which you can use to get the optionText if need be by some additional code.


texts: Magento 2: Display price from and to next to product listing

texts:
Can anyone tell me how to make it so when you have a product with multiple prices inside such as configurable products it shows the price range on the product listings rather than just the lowest price?

I noticed that it does it on this Magento 2 demo right at the bottom for the Yoga kit. Yet when I have a product with different size options and hence different prices it only ever shows the lowest price in the listings and you don't see the different prices until you click through to the product... I am using Magento 2.0.2 presume this is a setting somewhere?


texts: How to move element to main content from sidebar in Magento2 checkout custom tab?

texts:
How can I move this element from sidebar to the custom tab in Magento 2 on checkout page?

        <form data-bind="submit: navigateToNextStep" novalidate="novalidate">

                    <button data-role="opc-continue" type="submit" class="button action continue primary nextBtn">

                    </button>

        </form>


texts: Magento2 post to products/SKU changes website

texts:
I am using Magento 2.1.2 and when I update tier price information using the REST api, the product in website value is modified.

For instance, I issue a POST request on /{website}/V1/products/{sku}/group-prices/{customerGroupId}/tiers/{qty}/price/{price} my Tier prices are OK but the product is being added to other website it was not part of before the tier price update.

Am I doing anything wrong ?


texts: New customer groups - which settings do I need to update to use these groups?

texts:
Last week I created new customer groups because I installed an extension that needed them. Today I found out that a shopping cart price rule didn't work. It turned out that price rules are linked to customer groups, and I didn't change the price rule for the new customer groups.

I solved this problem, but this made me think: what else uses customer groups that will not work anymore now I use those new groups?


texts: Remove block from layout XML in Magento 2

texts:
In Magento 1 I could remove a block added by a layout file by adding this in my layout-block

<remove ="block_id_here" />

How can I do the same for Magento 2?
As a practical exercise, let's say I have my own module from which I want to remove the dashboard block from the admin dashboard page.
The block is added from app/code/Magento/Backend/view/adminhtml/layout/adminhtml_dashboard_index.xml using this:

<referenceContainer name="content">
    <block class="Magento\Backend\Block\Dashboard" name="dashboard"/>
</referenceContainer>

I assume I need to create the file view/adminhtml/layout/adminhtml_dashboard_index.xml in my module, but what do I need to put in it?


texts: Magento 2.3.5p2 - Invalid security or form key. Please refresh the page after installing banner slider

texts:
I downloaded BannerSlider from GitHub and pasted the files into the  app> code> Magestore. in the admin panel, it showing the manage options but when I click it says
Invalid security or form key.
Please refresh the page.
I tried changing max input vars to 10000 in php.ini file but no change.
Can anyone help me I am new to Magento I am using PHP 7.3.2.


texts: Magento 2: Call backend before display payment method on checkout page

texts:
I have my custom payment my_offsite_custom_payment method and onepage-checkout page modified in xml file below.

Before I display that payment method on checkout page I need to get extra data from backend to check what other options have merchant. After getting that data from backend I need to display it with that Payment option.

Could anybody help me to achieve that?

checkout_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <head>
        <css src="Custom_Payment::css/offsite-custom.css" />
    </head>
    <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="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="billing-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="payment" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="renders" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="payment-custom" xsi:type="array">
                                                                    <item name="component" xsi:type="string">My_Payment/js/view/payment/custom</item>
                                                                    <item name="methods" xsi:type="array">
                                                                        <item name="my_offsite_custom_payment" xsi:type="array">
                                                                            <item name="isBillingAddressRequired" xsi:type="boolean">true</item>
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>


texts: In magento 2 during checkout when i enter address it says entered invalid address

texts:
when i see log it shows
'result' =>
     (object) array(
     'HighestSeverity' => 'ERROR',
     'Notifications' =>
    (object) array(
       'Severity' => 'ERROR',
       'Source' => 'prof',
       'Code' => '1000',
       'Message' => 'Authentication Failed',
    ),
     'Version' =>
    (object) array(
       'ServiceId' => 'crs',
       'Major' => 10,
       'Intermediate' => 0,
       'Minor' => 0,
    ),
  ),
) [] []


texts: How to show array in email template file?

texts:
In my controller file:

$vars = array('product_name' => $data['productname'],
                'sku' => $data['sku'],
                'qty' => $data['qty'],
                'customprice' => $model1->getInquiryPrice(),
                'options' => $option,

                );

echo "
"; print_r($vars); die;

Output:

Array
(
    [product_name] => testing demo custom image
    [sku] => demo
    [qty] => 2
    [customprice] => 34.0000
    [options] => Array
        (
            [color] => red
            [length] => 12
        )

)

Email template file (inquiry.html):

Path: app/locale/en_US/template/email/inquiry.html

                                Product Name
                                Sku
                                Quantity
                                Price
                                options

                                {{var product_name}}
                                {{var sku}}
                                {{var qty}}
                                {{var customprice}}
                                 {{var options}}

var product_name,var sku,var qty, var customprice is showing the correct output, but var options is not showing correct output in email template file.

Output:

                                Product Name
                                Sku
                                Quantity
                                Price
                                options

                                testing demo custom image
                                demo
                                2
                                23.0000
                                Array


texts: Where should I edit in order to setup product weight with 2 decimals. Now the weight it showed in format as: 13.000 kilos. Those 3 zeros are useless.


texts:
I am looking at limiting customers to buying 1 bundle product at a time.

Is there a way of setting "Maximum Qty Allowed in Shopping Cart" for a bundle product.

I want to do this without limiting the individual products, so customers can buy as many of them separately.

Any ideas if this is possible, if so how do I implement this?


texts: How to insert data in custom coloumn in sales_creditmemo_item table from \Sales\Controller\Adminhtml\Order\Creditmemo\Save.php? magento 2

texts: Basically I manually created custom column in my database named as item_number Now I want to insert data into this column from app\code\company\Sales\Controller\Adminhtml\Order\Creditmemo\Save.php and the purpose of this column is that it will store the item number of each item. As sales_creditmemo_item inserts data or stores data of each item of the order so I would like to add item Number of that item into item_number column in sales_creditmemo_item table.I have been referring to  app\code\company\Sales\Model\Order\CreditMemo\Item.php, vendor\magento\module-sales\Controller\Adminhtml\Order\CreditmemoLoader.php and app\code\company\Sales\Api\Data\CreditMemoItemInterface.php but it is confusing me to implement. But It would be really helpful for me to continue my learning about magento 2 backend concepts if anyone could point any suggestion or advice. Thanks and cheers


texts: Warnings are logged in to var report in magento 2

texts:
We are using Magento ver. 2.1.3, when browsing website, error report is generated with full of warnings and website is halted with Error log records.

I have added below code in Index.php but not working.

error_reporting(E_ERROR | E_PARSE);

These warnings are from core modules for example

  Warning: array_merge(): Argument #2 is not an array in
  vendor\magento\module-page-cache\Model\Layout\LayoutPlugin.php on line
  71

If we solve one, then it is logged with new one.
Can any one suggest me how can i solve this ?
How the core code does exists with warnings ?


texts:
In my module i have an sql script, the module runs but the setup script is not executed. From core_resource table I have nav_setup | 0.1.1 | 0.1.1 but table is not installed?

I have created log from Mage_Core_Model_Resource_Setup class _getAvailableDbFiles() method and it is returning my module

$filesDir   = Mage::getModuleDir('sql', $modName) . DS . $this->_resourceName;

result: C:\xampp\htdocs\magento1131\app\code\local\ICS\NAV\data\nav_setup

config.xml

<global>
 <models>

                <resourceModel>nav_resource</resourceModel>
                <nav_resource>
                    <class>ICS_nav_Model_Resource</class>
                    <entities>

throttle

                    </entities>
                </nav_resource>

        </models>

        <resources>
            <nav_setup>
                <setup>
                    <module>ICS_nav</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </nav_setup>
            <nav_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </nav_write>
            <nav_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </nav_read>
        </resources>
</global>

my sql script:

<?php

$installer = $this;

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('nav_throttle')};
CREATE TABLE {$this->getTable('nav_throttle')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `last_api_call` timestamp NULL,
  `minute_throttle` float NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='api limit';
");

$installer->endSetup();


texts: Magento 1.9 does available stock/qty change when product is added to cart?

texts:
I have a store where I selle unique products, so every product has a quantity of 1. When the order is placed, the quantity is decreased to 0 and the product changes to out of stock and it's no longer available. This is correct.

My issue is that if the product is already in the cart of a user (the order is not placed yet, the user has only added the product into cart) it cannot be added to the cart by another user. So:

user A adds product to the cart and does NOT proceed to place order
user B tries to add the same product to the cart but magento doesn't let him because there is no quantity available

So my question is:

is the quantity decreased when the order is placed or when the product is added to cart?
is there a way to have the quantity available always, until one of the users finally places the order?

Thanks


texts: How to create custom Module Development in magento 2 from Scratch?

texts:
How to create Custom Module Development from scratch in magento 2 with following point.

1.How to Create Module

2.How to Install and Upgrade Database

3.How to Create Module,view and Controller Layers

4.How to Test Integration of all module components

6.How to create  Magento CLI command

7.How to Configure scheduled task in Magento 2

8.How to create  Menu entry

9.How to Create ACL resource

How to Implement web API in Magento with custom table

11.How to create Custom Grid In admin

How to create Form Using UI component and save and redirect to Grid

I would like to share source code with all guys


texts:
I created my custom module under local the name is MyTest/ProductsData, what I need to do is to create the new router so I've been created the IndexController.php and my config.xml, and I already activated my custom module and I checked under system->configuration->advanced which is enabled, the URL I'm trying to test is http://example.com/magento/MyTest/index/ or http://example.com/magento/index.php/MyTest/index/index and any other possible URLs also I tried them, all will go to 404 page and I cannot find any solution to solve this problem :( I really appreciate if any of you can help me out with this.

IndexController.php

<?php

class MyTest_ProductsData_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
         echo 'me';
    }

    public function addAction()
    {
        echo 'Test add Action';
    }
    public function deleteAction()
    {
        echo 'Test delete Action';
    }
}

and config.xml file,

<?xml version="1.0"?>
<config>
    <modules>
        <MyTest_ProductsData>
            <version>1.0.0</version>
        </MyTest_ProductsData>
    </modules>
    <global>
        <helpers>
            <mytest_productsdata>
                <class>MyTest_ProductsData_Helper</class>
            </mytest_productsdata>
        </helpers>
    </global>
    <frontend>
        <routers>
            <MyTest>
                <use>standard</use>
                <args>
                    <module>MyTest_ProductsData</module>
                    <frontName>MyTest</frontName>
                </args>
            </MyTest>
        </routers>
    </frontend>
</config>


texts: How to Show Color Swatches with most Recent View Products in Magento 2

texts:
I want to show color swatches with the most recent products in magento2
in my home page, most recent products are showing now I want to show color swatches with it


texts: Magento 2.1.9 - CSS files not being merged

texts:
I'm running Magento 2.1.9 on nginx 1.8.1
In Stores - Configuration - Advanced - Developer under CSS Settings
I've selected:

Merge CSS Files: yes
Minify CSS Filey: no

Then I'd flush my Magento cache.

php bin/magento setup:static-content:deploy

My shop is in production mode but I still see my CSS files:

<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/mage/calendar.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/bootstrap/css/bootstrap.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/bootstrap/css/bootstrap-theme.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/owl.carousel/assets/owl.carousel.css" />

19 CSS files in total.
Is it possible to merge them somehow?


texts: How to get total number of pages in list.phtml

texts:
In magento 1.9.2.3 at the category of products I have two toolbars.
At top toolbar I need only "Previous" and "Next" link.
At the bottom toolbar I need "Total of Pages", "1, 2, 3 ... n-th nubmer of pages with link", and "Previous" and "Next" link.
I create my new theme and template.
From list.phtml I can get the block of pager.phtml with this code:

 <?php echo $this->getToolbarBlock()->getPagerHtml() ?>

But I need to obtain diferite template of pager.phtml for top-toolbar and for bottom-toolbar, how can I add a new template of pager.phtml?


texts:
I am using magento 2.2.6. i have two payment mode. that is "now"  or "later". if later is selected, then after placing order, it will remain save in cart, and if now is selected, then order is placed even if older order is tracked in cart. all the order have separate id.

It is like for multiple order i will pay one time only.

How i will achieve this.someone please help.


texts: Missing column in Shopping Cart Table in magento 2

texts:
Here is my snapshot:

The row of "Angel Light Running Short" does not having column stock.

And then I tried to empty my app/code/Company/ModuleName/view/frontend/templates/cart/item/default.phtml

and then it become like this:

My question is why "Angel Light Running Short" does not uses default.phtm ?

How to add a new column to "Angel Light Running Short" ?


texts: How to move cart items in checkout from sidebar to main container under payment methods

texts:
I want to move the cart items and the cart summary from the sidebar into the main container under the  payment methods in order to show the customer all items first, before he can place the order.

Especially in the mobile version of the checkout, the user is not shown the items in the cart before he places the order. Only if the user presses on the cart button at top, he can check the items.

Does anyone knows how I can move the items in the sidebar into the
main container?


texts: Delete row from table once user click on Add to cart

texts:
When user remove the Previously added item from cart, than it will be removed from Database table : sales_flat_quote_item_option, i need similar feature.

Question : once Registered user click on custom button "save design" in product view page , we are creating new row in my_designs table and creating new product and saving product information in database.

once customer click on "add to cart" for that product, we want to remove that product information from "my_designs" table. we want to delete that row.

we are using below code to add the product to cart

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php $collections = $this->getCollection(); ?>

<?php $_product = $this->getProduct(); ?>

<?php $buttonTitle = Mage::helper('core')->quoteEscape($this->__('Add to Cart')); ?>

<?php foreach ($collections as $key => $product) {

    echo $product->getName().'
';
?>
<form action="<?php echo  Mage::helper('checkout/cart')->getAddUrl($product);?>" method="post">

<button type="submit" title="<?php echo $buttonTitle ?>" class="button btn-cart" >

    <?php echo $buttonTitle ?>

</button>

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

</form>

<?php

}
?>


texts: Disable COD if subtotal is greater then xxxx amount

texts:
How can I disable the Cash on delivery option on checkout page, if the order subtotal is greater then a specific amount ?

Thanks !


texts: How can I create a conditional for checkout messages?

texts:
<?php if ($messages = $this->getMessages()): ?>
        <?php foreach ($messages as $message): ?>
            <p class="item-msg <?php echo $message['type'] ?>">
                * <?php echo $this->escapeHtml($message['text']) ?>
            </p>
        <?php endforeach; ?>
        <?php endif; ?>

I need to edit the cart item messages as represented in the image above. Its rendered by the code below it. I need to remove the "order today..." message if the second item renders. I also need to change the color of the backordered phrase.


texts: Magento MSRP price not showing on category

texts: i am using magento 2.3.0 i enabled MSRP price from admin setting and from attribute i enable display on product page and showing in attributes list but not showing on product page in area where is it should


texts: Magento 2: Create extra tab with info on product detail page

texts:
I'm struggling with a Magento 2 issue here. With Venustheme Cropshop installed I'm trying to add an extra tab with listed info to de product detail page. Please check the below image:

I already saw Trần Đăng Phong's question, but that one is solved with code. It seems more logical to fix it within the admin. That SHOULD be possible right?

I managed to add a list of attributes (Fats, Carbs, etc.) in an attribute set (Nutritionfacts), but it pops-up under the "more info"-tab. I'd like this info to show in a new tab "Nutrition facts".

Hope someone can help.


texts:
I install Magento 2 on IIS 7, it is working good, but on home page and all other pages including admin panel
a JavaScript error occurred

the error is :

  NetworkError: 404 Not Found - http://localhost:8080/pub/static/frontend/Magento/luma/en_US/js-translation.json"
  SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
  $.mage.translate.add(JSON.parse(string));

then I explore location
/pub/static/frontend/Magento/luma/en_US/ and found that the file is there
when open the file it is contain just two square bracket [].

then i delete my old magento store and setup with new magento store with second level  domain.
but still problem is not fixed, but another issue arise my admin penal stopped work.!
now the error look like

  NetworkError: 404 Not Found -
  http://www.m2.com/pub/static/frontend/Magento/luma/en_US/js-translation.json"
      SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
      $.mage.translate.add(JSON.parse(string));

i dont know why magento show that file is not found, because it is already there

I already delete folders in pub/static directory and then re-run the deploy command from cmd

php bin/magento setup:static-content:deploy

but it is not work for me.
is magento support IIS 7 ?
is problem occurred due to iis ?


texts: Magento 2 - Extend Extension Layouts and Templates

texts: Is there a way to extend the layout and template files of an extension?  Say I have an extensions file located at app/code/<vendor>/<extension/view/frontend/layout or a file located at app/code/<vendor>/<extension/view/frontend/templates, how would I extend/override those files in my own custom theme?


texts: how to scan magento on localhost for virus infection?

texts:
We have a Magento Project on local server and we want to upload it to Live server.
But we want to first have a complete scan on our local server for any virus infection.

It is a matter of urgency.
Any help would be appreciated.


texts: What is "data-action" attribute is added for in 1.9.0.0

texts:
Studying the diff of 1.9.0.0 I noticed that some templates of base/default package gained data-action attribute (see here). However I didn't found any usage of it in JS files.

Is there any reason this attribute was added? My first guess was there is some HTML5 feature I'm not aware of that is using data-action but quick googling showed nothing.


texts: How to add custom html class to "Sign Out" button in magento 2

texts: How to add custom HTML class to "Sign Out" button in magento2


texts: My website is being forward to another URL off the search engine links

texts:
When you type my website in the address bar you make your way to our website.  But if you Google or Yahoo us and click on the link they provide as a search result you get forwarded to another URL that has nothing to do with us.

I've searched Magento admin-dashboard high and low with no success.  I've tried the URL redirects with no luck.

Any idea to figure out?

Thanks in advance.

-John.


texts:
I have been in the process of building a simple frontend for Magento, but stopped because the API only allow access to products, categories, orders and customers, and I would at least also need Brands.
Is there a plugin or other way I can get the information I need via a REST endpoint?
If I upgrade to Magento 2, would that help?


texts: Magento 2 custom field not exists in request

texts:
I have added a custom row builder using phtml (template) to product creation form.
However, when I submit the form, it does not send my custom input values to the server.
my phtml file is like the below:

                <?php echo $block->escapeHtml(__('Name')) ?>
                <?php echo $block->escapeHtml(__('Value')) ?>
                <?php echo $block->escapeHtml(__('Action')) ?>

                        <?php echo $block->escapeHtml(__('Number of properties exceeded')) ?>

                    <button id="add-property" type="button" class="btn btn-primary">

                        <?php echo $block->escapeHtml(__('Add Property')) ?>
                    </button>

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


texts:
I have to product : ProductA and ProductB.

I want to hide ProductB from the catalog and show it only on the ProductA page.

But, the user can't add to cart the ProductB if the ProductA is not added in the cart.

How do I do this things ?


texts: how to insert flash video in magento cms page

texts:
How to insert flash video in magento cms page.  I tried inserting video in the wyswyg editer. but it shows only a white background.
I want to show a promotional video on about us page


texts: I am using Athlete Package in Magento 1.8.1.0. I would like to know the location of template of Quick View button which I get when I hover mouse on any Product.


texts: Magento 2 checkout page, change zip code text field to dropdown and populate values

texts:
In Magento 2 checkout page, I have to convert zip code/Postal code text field to drop down.

Drop down portion is done, but I am not able to display the options (drop down values) under the drop down.

  Magento_Checkout\layout\checkout_index_index.xml for postcode field change looks like below:

<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="steps" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="shipping-step" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shippingAddress" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shipping-address-fieldset" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="postcode" xsi:type="array">
                                                            <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
                                                            <item name="options" xsi:type="array">Sm/Multe/Model/Config/Source/Options</item>
                                                            <item name="config" xsi:type="array">
                                                                 <item name="formElement" xsi:type="string">select</item>
                                                                 <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </item>
        </argument>
    </arguments>
</referenceBlock>

  Model\Config\Source\Options code is like below:

<?php
namespace Sm\Multe\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class Options implements ArrayInterface
{
    /**
     * @return array
     */
    public function toOptionArray()
    {
        $options = [
            0 => [
                'label' => 'Please select',
                'value' => 'sa'
            ],
            1 => [
                'label' => 'Option 1',
                'value' => 'sasa'
            ],
            2  => [
                'label' => 'Option 2',
                'value' => 'sasasa'
            ],
            3 => [
                'label' => 'Option 3',
                'value' => 'sasa'
            ],
        ];

        return $options;
    }
}

I am new to Magento, please let me know what I am doing wrong.


texts: Magento 2.0.15 Paypal Upgrade for Magento 2.1.7

texts:
I am bit confused. I am on Magento 2.1.7 and I received a notification regarding new upgrade to 2.0.15 which contains an important security update for Paypal IPN.

So I need to know if version 2.1.7 already has that PayPal patch or there is any other patch available for 2.1.7.

Any help would be appreciated.


texts: On save CMS page or CMS block gives 404 on admin side if content has image src

texts:
Facing strange issue while saving CMS page or CMS block on admin side.
If Content of the page or block having image tag then on save it gives 404 error: Page not found.
<img src="{{media url=&quot;Chrysanthemum.jpg&quot;}}" alt="" />

Checked following points

Running Magento 2.3.6 with PHP 7.3

Disabled WYSIWYG editor completely from system configuration

Tried this option - Use Static URLs for Media Content in WYSIWYG

Checked pub folder permission with 775 and 777

pub folder having .htaccess by default

Web server rewrites is enabled on server level

Ran those upgrade/di:compile/s:s:d -f command multiple times

Also using the adminer i tried to update the direct db entry then also facing the same issue.

Any known issue which may be related to MySQL or some other?


texts: Load function of a custom model uses incorrect primary key for loading

texts:
Inside a custom module, I have created a model for table teacher_table having the primary key teacher_id.

After instantiating TeacherTableFactory class, I tried to load a record by using primary key.

$teacherItem = $this->teacherFactory->create();
$teacherItem->load(1);

Then, it throws column not found exception. While debugging found out that the load function executes an sql query having where clause on other than primary key column of teacher_table.

Why the load function is using teacher_table_id (generated one) instead of teacher_id (specified in InstallSchema.php)?

Note: teacher_table_id has been used by the load function. There is no such column in teacher_table.


texts: Use other payment methods when paying for Recurring Profiles

texts:
I want to allow my customers to be able to pay for their nominal items (recurring profile/ subscription)using different payment methods. As of now, my store only uses PayPal for these kinds of transactions.

1.) How can I allow my users to pay for their nominal items using different payment methods? (Credit/Debit Card, Load, Bank Transfer, etc)

2.) If there is an extension for this, what is your recommendation?

Thank you for your response.
I am using Magento 1.9.2.3

How can I allow customers to have options on what payment method theycan use when paying for Recurring Profiles?


texts: How to add custom Info from my custom table in account information admin panel ? Magento 2

texts:
With ui component i can't add my custom data in there , maybe has a alternative ?
I added the Customer Account Status, but I did it through InstallData.php, but I need to show there the text from the custom table

InstallData.php

    <?php
namespace CustomersState\AccountState\Setup;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    private $customerSetupFactory;

    public function __construct(
        CustomerSetupFactory $customerSetupFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerSetup->addAttribute(Customer::ENTITY, 'customer_states', [
            'label' => 'Customer Account Status',
            'input' => 'select',
            'required' => false,
            'sort_order' => 100,
            'visible' => true,
            'system' => false,
            'type' => 'varchar',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => true,
            'option' => ['values' => ['Active', 'Suspend', 'Vacations']],
        ]);
        $setup->endSetup();
    }
}


texts: If I override a template in core Magento 2, could it be removed when upgrading to future versions of Magento 2?

texts:
For my personal shoping website I am trying to override some of the XML and PHTML files of default luma theme.  I am just eding the vendor/theme-frontend-luma folder directly.

Just want to know when I do the Magento upgrade in the future will my custom changes will be wiped off?


texts: Magento2 /bin/sh: /home/appleserver2/public_html/magento2/var/log/update.cron.log: No such file or directory

texts:
i have delete magento2 installation by directly deleting the directory and database. however i am getting email in every second and the mail content is as below

/bin/sh: /home/appleserver2/public_html/magento2/var/log/update.cron.log: No such file or directory

how can i stop these emails or how can i delete these cron jobs


texts:
I started developing a theme for Magento 2.2.0 and now I have to use some external javascript libraries both in my theme and my modules.

So what is the best solution to prevent loading the same library twice?

Should I create a new Module containing my javascript libraries and refernce them in my other modules?

EDIT:

For example I have a Module which requires a specific library like swiper.js.
So I would require it somehow with My_Module/path/to/swiper.js.
But if I have another Module with the same dependency My_Module2/path/to/swiper.js it now is loaded twice?

In Magento2 I can require jquery and any other core library from anywhere but the documentation says you shouldnt put js into mageroot/lib/web/js.


texts: Magento API to import external data into Magento database

texts:
Are there Magento API to import massive external data (products) from a third-party application into Magento database programmatically?
If they exist, what are they and how can I find them?
Since I am a beginner to Magento, would you please be so Kind to give me detailed information?
Thanks in advance


texts: how to set different themes for diferent users in magento

texts:
how to set different themes for diferent Logged In  users in magento?

consider customer with email id 1@gmail.com is logged in, he will see theme with red color,
while the customer logged in with 2@gmail.com will see theme with blue color
or even i want to set the complete different shop look for different customers

Please post only working stuff which may be tested as i need it in hurry.

thanks


texts: Create Custom report in admin using Magento 2.1.9

texts: I want to create a custom report using the custom table section in the admin under the reports menu. COuld you please help me out.


texts:
I just upgraded magento 2.3.5 to 2.4.1 . Its completed successfully and i did changed search engine form "mysql" to "elasticsearch" and now its showing error when i run : bin/magento setup:upgrade

Your current search engine, 'Elasticsearch 2', is not supported. You
must install a supported search engine before upgrading. See the
System Upgrade Guide for more information.

I have installed and configured elasticsearch like below :
{
  "name" : "test-pc",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ixBumh5mSbSdZkxTFZNErg",
  "version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Anybody have any idea whats going wrong here ?


texts:
As per my client requirement i have crated a custom theme, in that the home page error message have a alignment issue.

I need my error message top to the label.

For your information i attached the screen shot.


texts: Magento 2 : Save Custom Attribute to sales_orders Table

texts:
I have added a custom attribute for storing additional emails for customers.

By default, when an order is placed, the customer_email field in sales_order table is taking from the email field from customer_entity. However, I need the customer_email field to use my custom attribute.

How can I do this?


texts: Multi website Magento store (2.2.6) 404-error on /pub/media on one store

texts:
I created a multi stores magento setup on 2 subdomains:

domain1.example.com (contains magento 2 files)
domain2.example.com (alias)

I aliased the domain2 to domain1 and redirect to the correct store based on domain name in the index.php on domain1 as done here.

I setup the correct BaseURLS and everything seems to work.

When I was testing a product and added the product to the 2nd store it would show everything except for the image.

On closer inspection the 2nd store cannot seem to find (404 errors) anything in the /pub/media folder (this includes styles.css and the images in the customer folder):

Everything in the /pub/static will load fine!

I did some more testing and basically it's based on the filetype:

I uploaded some test files:

domain1.example.com/pub/media/test.txt -> works
domain2.example.com/pub/media/test.txt -> works
domain1.example.com/pub/media/test.png -> works
domain2.example.com/pub/media/test.png -> NOT WORKING: 404-error
domain1.example.com/pub/media/test.css -> works
domain2.example.com/pub/media/test.css -> NOT WORKING: 404-error

So it seems something goes wrong with rewriting, but I cannot seem to find the source.

I tried deploying, resfreshing and recaching etc.
Tried changing permissions (but shouldn't make difference if other filetypes DO work).
Tried deleting the .htaccess, no difference.

Been trying to figure it our for almost a day now, any help would be greatly appreciated!

UPDATE:
Using the first domains MEDIA folder in the Store configuration fixes the issue!


texts: I have 4 store view. In this store view i have products. Store view differ in the names of products. I want to fetch product only from one storeview. Now i can fetch product from main, first store view. How can i switch store view to fetch product from second store view where product have different name.


texts: Magento cannot override Mage_Payment_Model_Method_Cc.php file

texts:
I am trying to override Payment/Model/Method/Cc.php file but it's not able rewrite. can you please any one check my script.

config.xml:

<?xml version="1.0"?>
<config>
   <modules>
      <Naveed_Abbas>
        <version>0.1.0</version>
      </Naveed_Abbas>
   </modules>
<global>
    <models>
       <payment>
            <rewrite>
                <method_cc>Naveed_Abbas_Model_Payment_Method_Cc</method_cc>
            </rewrite>
       </payment>
    </models>
  </global>
</config>

Naveed/Abbas/Model/Payment/Method/Cc.php :

<?php
  class Naveed_Abbas_Model_Payment_Method_Cc extends Mage_Payment_Model_Method_Cc {

    public function isAvailable($quote = null) {
         Mage::log("Canel Order",null,'isAvailable-test-1.log');
        return $this->getConfigData('cctypes', ($quote ? $quote->getStoreId() : null))
        && parent::isAvailable($quote);
    }
  }


texts:
I have a Magento 2.1.10 store. I have imported all the products and categories. Now the product url is

  http://www.exaple.com/samplecategory/sampleproduct.html

But I want the URL as

  http://www.exaple.com/samplecategory/sampleproduct

For this I have done the following steps

Stores->configuration->Catalog
Removed .html from both fieldsProduct URL Suffix ,Category URL Suffix .
Saved the config ,reindexed and cleared cache.

But it didn't removed the html from url

Then I have tried this solution
https://github.com/magento/magento2/issues/3679#issuecomment-311075725

It works for all categories and some products. Now few Products have url like this
http://www.exaple.com/catalog/product/view/id/140/s/water-dispenser/category/43/

How can I make these URL as http://www.exaple.com/samplecategory/water-dispenser ?


texts: custom checkout_submit_all_after observer not working

texts:
I am trying to write observer.for reference i am following below tutorial
http://franklinstrube.com/blog/magento-event-observers/ . but my custom observer i not getting triggered. I am using Magento ver. 1.8.1.0 CE

my app/code/local/sv/ConnectInfusion/etc/config.xml file is as follows

<?xml version="1.0"?>
<config>
    <modules>
        <sv_ConnectInfusion>
            <version>1.0.0</version>
        </sv_ConnectInfusion>
    </modules>
    <global>
        <models>
            <ConnectInfusion>
                <class>sv_ConnectInfusion_Model</class>
            </ConnectInfusion>
        </models>
        <events>
                <checkout_submit_all_after>
                    <observers>
                        <awesome_example>
                            <class>sv_ConnectInfusion_Model_Observer</class>
                            <method>SyncWithInfusion</method>
                        </awesome_example>
                    </observers>
                </checkout_submit_all_after>
            </events>
        </global>
</config>

My Observer file is

app/code/local/sv/ConnectInfusion/Model/Observer.php

class sv_ConnectInfusion_Model_Observer {
    /**
     * This function is triggered by a Magento observer declared
     * in etc/config.xml
     *
     * @param Varien_Event_Observer $observer
     */
    public function SyncWithInfusion($observer)
    {
        // Your magic code goes here...
        $event = $observer->getEvent()->getControllerAction()->getFullActionName();

        Mage::log('Event Fired: ' . $event);
        Mage::log('yeah i am in observer !! it works' , null , 'mylog.log');
        die();
    }
}

and my app/etc/modules/sv_ConnectInfusion.xml file is as follows.

<?xml version="1.0"?>
<config>
    <modules>
        <sv_ConnectInfusion>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Checkout/>
                <Mage_Sales/>
                <Mage_CatalogInventory/>
            </depends>
        </sv_ConnectInfusion>
    </modules>
</config>

what i am doing wrong? I tried by changing the xml files, adding <depends> , i also tried to move the code in community directory but still no luck.


texts: cron_schedule does not update to "running" causing same job to restart repeatedly

texts:
Magento (1.9.2.1) does not appear to be setting any of the cron jobs as "running". This is causing issues where a long-running process is being restarted repeatedly every five minutes - the below job has had the executed_at field updated three times - at 10:35, 10:40 and 10:45.
With Magento setting the status as "running" this is not an issue as Magento will ignore it during the next run of the cron, however because the status is not updated this long-running job is started multiple times and times-out with the message "Too late for the schedule", which I understand as meaning the cron job has exceeded it's 15 minute execution time.
| schedule_id | job_code        | status  | created_at          | scheduled_at        | executed_at         | finished_at |
+-------------+-----------------+---------+---------------------+---------------------+---------------------+-------------+
| 25494       | my_cron_request | pending | 2020-07-06 10:35:19 | 2020-07-06 10:35:00 | 2020-07-06 10:45:15 | NULL        |

So, my question is:
How do I get Magento 1.9 to mark a cron job as "running" and to ignore "running" jobs on subsequent cron calls?
update:
The code to mark a cron job as running is broken in 1.9.2.1. I had to update it to 1.9.3.0:
app/code/core/Mage/Cron/Model/Schedule.php

From:
public function tryLockJob($oldStatus = self::STATUS_PENDING)
{
    return $this->_getResource()->trySetJobStatusAtomic($this->getId(), self::STATUS_RUNNING, $oldStatus);
}

to
public function tryLockJob($oldStatus = self::STATUS_PENDING)
{
    $result = $this->_getResource()->trySetJobStatusAtomic($this->getId(), self::STATUS_RUNNING, $oldStatus);
    if ($result) {
        $this->setStatus(self::STATUS_RUNNING);
    }
    return $result;
}

This change now records a cron job as "running" after it's started, but the scheduler does not exclude the job_code when searching for "pending" jobs. This is leading to jobs being started over and over:
| schedule_id | job_code        | status  | created_at          | scheduled_at        | executed_at         | finished_at |
+-------------+-----------------+---------+---------------------+---------------------+---------------------+-------------+
| 25664       | my_cron_request | running | 2020-07-06 12:20:47 | 2020-07-06 12:20:00 | 2020-07-06 12:25:15 | NULL        |
| 25665       | my_cron_request | running | 2020-07-06 12:20:47 | 2020-07-06 12:21:00 | 2020-07-06 12:35:17 | NULL        |
| 25670       | my_cron_request | running | 2020-07-06 12:20:47 | 2020-07-06 12:26:00 | 2020-07-06 12:40:23 | NULL        |
| 25675       | my_cron_request | running | 2020-07-06 12:20:47 | 2020-07-06 12:31:00 | 2020-07-06 12:45:16 | NULL        |
| 25680       | my_cron_request | running | 2020-07-06 12:20:47 | 2020-07-06 12:36:00 | 2020-07-06 12:50:22 | NULL        |

For context, the first job above has been running for over 30 minutes.
How to ignore "running" jobs on subsequent cron calls?


texts: Customer not able to login and place order

texts:
I was looking for solution to my problem.

We are using Magento 2.2.3 version and one of our customer facing problem when he logged in, His not able to purchase due session destroying every time he refresh page or going on next page.

As I found error {"message":"No such entity with customerId = "} in browser console on url

https://myshop.com/customer/section/load/?sections=&update_section_id=false&_=1545041906558

I try to edit customer information from admin panel where ever time I got error about State/Province. "State/Province" length must be equal or less than 20 characters."

We are facing this issue for only 1 customer, there is no problem with other customer.

Some notes on customer.

This customer has 11 addresses in address book.
This customer was able to place order suddenly facing this issue now.

Any hints, guidelines are appreciated


texts: I have set a new custom attribute called actiekorting with a value of 25% on a product. It shows perfectly in detailed product page. But when I'm trying to copy the same line on a different page (overview page of products) I get the following fatal error: Call to a member function productAttribute() on a non-object in etc..


texts: How to save different versions of a Block in Magento EE FPC by adding session parameters?

texts:
I want to save and get different versions of a block output, based not only on different get parameters. I want to add session parameters (customer attribute) as caching parameter.

I checked the different cache processors and see only cookie values and GET params are set. I tried to overwrite it but i failed multiple times.

The version of current system is Magento 1.14.1 Enterprise Edition.

Any help is appreciated.


texts: addFieldToFilter with like removing some characters in query

texts:
I have saved a url in the db. The url is: http://localhost/magento/index.php/electronics/cameras.html?cat=25&price=-100

$url = Mage::getSingleton('core/session')->getStateUrl();
$filterstate = Mage::getSingleton('core/session')->getFilterState();
$inc= 1;
  foreach($filterstate as $key=>$value):
    if($inc==1){ $searchurl = $url."?".$key.'='.$value;}
    if($inc!=1){ $searchurl.= '&'.$key.'='.$value; }
   $inc++;
  endforeach;

when i search for the field in the db with my collection

$detect_duplicate = Mage::getResourceModel('savesearch/savesearch_collection');
$detect_duplicate->addFieldToFilter('content', array('like' => $searchurl));
echo $detect_duplicate->getSelect();

The result i got is

SELECT `main_table`.* FROM `savesearch` AS `main_table` WHERE (content LIKE 'http://localhost/magento/index.php/electronics/cameras.html''cat=25&price=-100')

For some reason the ? is emptied. But when i replace it with other characters like * the result was

SELECT `main_table`.* FROM `savesearch` AS `main_table` WHERE (content LIKE 'http://localhost/magento/index.php/electronics/cameras.html*cat=25&price=-100')

Can someone suggest a fix for this. I should able to search for a URL in Db to avoid duplication.


texts:
My website uses version 1.7 and in fact I would like to add a column in the view of commandes.my config file:

<?xml version="1.0"?>
  <config>
   <modules>
      <Digitgold_AddColumnInfoPaiement>
         <version>1.0.0</version>
      </Digitgold_AddColumnInfoPaiement>
  </modules>
  <global>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_grid>Digitgold_AddColumnInfoPaiement_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </adminhtml>
    </blocks>
  </global>
</config>

and this is my class :

class Digitgold_AddColumnInfoPaiement_Adminhtml_Block_Sales_Order_Grid extends  Mage_Adminhtml_Block_Sales_Order_Grid
{

 public function __construct()
 {
    parent::__construct();
    $this->setId('sales_order_grid');
    $this->setUseAjax(true);
    $this->setDefaultSort('created_at');
    $this->setDefaultDir('DESC');
    $this->setSaveParametersInSession(true);
  }

protected function _prepareColumns()
 {
    $this->addColumn('payement', array(
        'header'=> Mage::helper('sales')->__('Mode de Paiement'),
        'width' => '120px',
        'index' => 'payement',
         ));
}
}

the problem is header appears only of the admin and below is all white.


texts: Magento 2 display configurable product Price Range in product page

texts: I want to display the price range for configurable products on the product page.


texts: How to Apply and Revert Magento Patches in localhost?

texts: How do I apply and revert Magento Patches on Windows localhost?


texts: Magento 1 : Add additional product with extra price on product page?

texts:
I am working on magento 1.9 community edition website.

I want to add a feature in product page such as additional product at extra cost.

Such as if there is a dress worth 500₹ and a belt option is given at product page so that when clicked on that checkbox the additional value ( already assigned ) is added to final.


texts: How to override newsletter phtml file in magento2

texts:
I'm currently working on Magento 2.1 theme. I'm trying to change the newsletter template and want to change it in our theme.

I have copied the subscribe.phtml file from

[ROOT]/vendor/magento/module-newsletter/view/frontend/templates

to

[ROOT]/app/design/frontend/[Package]/[Theme]/Module_Newsletter/templates

and make the require changes but they are not reflecting on browser.

Although I have tried with Magefan_Blog extension the phtml override works correctly.

Also I have clean/flush cache and deploy the content again but still not get refection.

Any one have idea about the issue, please suggest.


texts: Magento 2 : After upgrade to Magento 2.2.8 version

texts: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ResourceModel\Product\Collection::addIsSaleableAttributeToFilter()


texts: Magento 2 add CMS block under discount code section on the checkout page

texts:
I want to add third party JS code and HTML on the checkout page under discount code section.

To add it under discount code first in Checkout_index_index.xml file I have added following code.

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" 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="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                         <item name="billing-step" xsi:type="array">
                                             <item name="children" xsi:type="array">
                                              <item name="payment" xsi:type="array">
                                                 <item name="children" xsi:type="array">

                                                    <item name="afterMethods" xsi:type="array">
                                                             <item name="children" xsi:type="array">
                                                                 <item name="discount" xsi:type="array">
                                                                     <item name="children" xsi:type="array">
                                        <item name="cms-block" xsi:type="array">
                                            <item name="component" xsi:type="string">VendorName_ModuleName/js/view/cms-block</item>
                                            <item name="sortOrder" xsi:type="string">10</item>
                                        </item>
                                       </item>
                                         </item>
                                         </item>
                                         </item>
                                         </item>
                                          </item>
                                         </item>
                                      </item>
                                   </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Using that code it's not showing under discount code section. If I remove the following 2 lines from the above code then it adds the custom CMS block after the payment method section.

              <item name="discount" xsi:type="array">
                          <item name="children" xsi:type="array">

Is there any way we can add CMS block exactly under the discount code section?

Any help would be appreciated!


texts: i want to create a reference id to every order created

texts:
I want to create a reference id for every order generated on my portal and show the same reference id on my shipping slip, I am using below code

$attribute  = array(
        'type'          => 'text',
        'backend_type'  => 'text',
        'frontend_input' => 'text',
        'is_user_defined' => true,
        'label'         => 'reference',
        'visible'       => true,
        'required'      => false,
        'user_defined'  => false,
        'searchable'    => false,
        'filterable'    => false,
        'comparable'    => false,
        'default'       => ''
);
$installer->addAttribute('order', 'custom_reference', $attribute);

I will be thankful.


texts: Magento 2: How to display sibling categories as child(sub) category?

texts: I have all the categories as parent categories, now i want to display all parent category as sub category. is there any way?


texts:
When updating the configuration for the fields of a widget, old fields are still being shown even though have they been removed. Cache has been completely flushed but they still appear. Are widget fields cached somewhere?

At first I thought that maybe the widget was pulling the values from the instance of the widget that had already been placed within the CMS page. However, I've also attempted to insert the widget into blank CMS page and the outcome is the same.

I've searched through my config to find the label text of the fields that are still showing up even though they've been deleted and I come up with zero results.


texts: Magneto2 is facing issue in data migrate process M1 to M2

texts:
I have data migated orders, products and customers using migration tools form M1 to M2 then some products are deleted from backend. Home page design also distarct after migration process and addition attribute created from backend as well.
How can i resolve this issue?
Any one give the solution about this error.


texts:
I have a normal B2C store. Now I would like to add B2B users to this shop.

How do I create a second user registration form for B2B users?

Users created here should automatically be added to a B2B user group but need a manual activation.

I found many extensions around this topic but the turn the shop into B2B online shops, like hiding prices. Maybe this will do the trick, not sure how to configure it for what I need...

Update

I created a CMS page for the b2b login and added the login form:

{{block type ="Mage_Customer_Block_Form_login" template="customer/form/login.phtml" }}

With a copy of login.phtml I can create a custom login.

How do I change the customer group for user registration here? Also it would be nice to disable the account after creation.

Update 2

I removed the CMS page and created a new module with b2b page containing a block for login and a copy of the customer register block. I also copied and modified the createpostAction().


texts:
I want to send a custom mail to customer if the Paypal payment has been failed using IPN module.

In short in Paypal IPN module from where I can identify paypal payment has failed over there I can set custom mail.