texts: What Magento files could be responsible for redirecting to a previous domain

texts:
I'm trying to clone a server. I have my Magento in a subfolder.
For the sake of simplicity....

www.domain1.com/store

Cloned to create...

www.domain2.com/store

My managed hosting company (Cloudways) does most of the heavy lifting, but despite following the steps below, I can't figure out why...

www.domain2.com/store
Redirects to
www.domain1.com/store

I've updated the DNS (even IPaddress/store redirects to domain1.com/store)
Made changes to the .htaccess, robots.txt, etc. I've updated the core_config_data table with the new base URLs (www.domain2.com/store). I've cleared the cache and even restarted the server.

I have also done a search for 'domain1.com/store' in all the files and in the database, and the only place I find it is in the following tables....
- catalogsearch_query
- core_email_queue
- core_session
- smtppro_email_log

Which I can't understand why those tables would affect a redirect. Can anyone confirm this?
Can anyone suggest some methods or tools to get to the bottom of this.

This is my eighth attempt over three weeks. When I ask my host for help they go ahead and just do the search and replace and I can't replicate their results. It takes them a day to respond and now they are ignoring me. Therefore it's imperative I learn how to do this myself. Please point me in the right direction.


texts: Manage Currency Rates does not import currency: Magento 1.9

texts: What could be the problem ? I can not import the currency


texts: Getting a TypeError: this.addressValidator.message is undefined after updating to Magento 2.3.5-p1

texts:
I just updated to Magento 2.3.5-p1 and when I try to checkout, I get the following error:

It seems to be caused by the Vertex Address validation but it's not even active. How do I fix  this error?

Thanks


texts: how to connect another database from magento

texts:
Is it possible to connect to another database from Magento and accessing data?

If I need to create a module, how can I create a module to access another database? Is there any tutorial which tells about the same from scratch?
Any Idea?


texts: Magento 2: why does .gitignore -- ignore all vendor files? M2 Default .gitignore

texts:
we are using the Magento default .gitignore for development.

https://devdocs.magento.com/guides/v2.3/config-guide/prod/config-reference-gitignore.html

(b.t.w. a similar version can be found here, but I would recommend the original from Magento: https://www.gitignore.io/api/magento2)

Question: why is the gitignore ignoring vendor/* files that may be installed and containing new/used extensions?

(we found out after installing an extension and wishing to commit the new code)

Appreciate it

References:
Magento2 - local / staging / production deployment & gitignore


texts: Magento 2: don't show "saved price" in attribute selection

texts:
when a product has a special price, I see the "saved price" (e.g. -$7.34) in the attribute selection, for example:

How can I remove it and just show the value of the attribute?

Thanks.


texts: Multiple errors are produced "SEVERE SolrCore org.apache.solr.common.SolrException: undefined field name" with a Magento 1.7/ Solr 4 integration using https://github.com/magentix/Solr/. Any SOLR experts available?


texts: InterfaceFactory: decide preference at runtime. Is it possible?

texts:
Based on runtime set variables, I want a given factory to create an instance of a class. However, I find that the only way the auto-generated factories get the concrete class is via xml <preference>.

namespace Vendor\Module\Api;
interface CustomInterface {}

namespace Vendor\Module\Model;
class First implements CustomInterface {}

namespace Vendor\Module\Model;
class Second implements CustomInterface {}

namespace Vendor\Module\Model;
class Thing {

  public function __construct(
    \Vendor\Module\Api\CustomInterfaceFactory $customObjectFactory
  ){
    $this->customObjectFactory = $customObjectFactory;
  }

  public function getCustomObject($thing){
    if($thing){
      // should return First instance
      return $this->customObjectFactory->create();
    }else{
      // should return Secong instance
      return $this->customObjectFactory->create();
    }
  }
}

The above will fail, trying to instantiate interface CustomInterface.

Am I stuck creating identical interfaces (duplicates in content, but with different names) in order to get multiple (auto-generated) factories, that will return the specific class? I mean, calling a different factory based on the above if($thing){}

I want to keep using the ObjectManager DI chain, since the objects First and Second make use of DI.

Or is there a canonical way to build a CustomFactory class?
Something like:

namespace Vendor\Module\Model;
class CustomObjectFactory {

  public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectManager
  ){
    $this->objectManager = $objectManager;
  }

  public function create($className, array $data = [])
  {
    return $this->_objectManager->create($className, $data);
  }
}

What would be the Magento2 approach?

Thanks!

PS: I get the feeling this daisy chaining of DI will turn into a Mocking nightmare...


texts:
To get error log file I enable on this menu
Configuration > Developer > Log Settings > Enabled = Yes

and create /var/log folder and set the permission 777
When I got this error page

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1337641918483

There is no file on the var/log folder
Can I know the reason why the error log file is not created and how to solver?


texts: How to show top banner on product list page

texts:
I am trying to display top banner on each category page dynamically. This banner will span whole container. I am using 2columns-left layout. So banner will have 1column layout and list page content will have 2columns-left layout.

I tried following -

<catalog_category_default translate="label">
        <label>Catalog Category (Non-Anchor)</label>
        <reference name="category.banner.info">
              <block type="cms/block" name="mystaticblock" >
        <action method="setBlockId"><block_id>6</block_id></action>
        </block>
        </reference>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content"> ...

on Block 6 i would call phtml file and show banner dynamically. But i dont  think this method will show 1 column layout for banner.

What would be the optimum way to add the banner on product list page?


texts: How do you set the theme to be used based on screen width?

texts: I have set up a child theme of our main them for mobile. In Content > Design > Configuration . I set up Design Rules to select the mobile theme if the useragent matches a known mobile device. However, I'd much rather switch to the mobile theme based on screen width. Has anyone set this up?


texts: Unable to get product attribute value store wise,

texts:
I have a magento1.x product attribute (its scope is store, and admin site defines default and store wise attribute value different)

I am trying to get its value but every time i got default store value

My collection query

$productCollections = $productCollection->joinAttribute('visibility','catalog_product/visibility','entity_id',null,'inner',$store->getId())->joinAttribute('status','catalog_product/status','entity_id',null,'inner',$store->getId());

Want get store wise value for a product attribute


texts: Blocking bots / hackers from accessing newsletter subscription

texts: I am getting massive amounts of fake newsletter subscriptions - mostly a randomly generated Yahoo email address. I've looked through the logs and there are 50+ IP addresses, seems like it's from a botnet. Anyway, does anyone have any ideas how I could stop this? Should it be done on a server level or at a codebase level?


texts:
I want to create my own custom REST API in my magento site. I am new in magento api. I have followed following tutorial to learn to put authentication for particular consumer added in magento rest consumer

http://inchoo.net/magento/configure-magento-rest-and-oauth-settings/
http://inchoo.net/magento/consuming-magento-rest-zend_oauth_consumer/

I have sat all the settings in REST-Oauth consumers,REST-Roles,REST-Attributes and user permission as per 1st tutorial

also added controller which should return be login screen as mentioned in tutorial 2

It says magento.loc/restconnect/test link will redirect you some login screen

when i fire my local controller url :
   localhost/offer/restconnect/test/

it redirects me in following which gives 404 not found :
  localhost/offer/admin/oAuth_authorize?oauth_token=47dc6c43fdc972879a761ad1370318e2

Anyone have any idea at which point i am getting wrong or which things i am missing to do.
I have used correct consumerKey and consumerSecret in TestController

Thanks :)


texts: How to handle huge sales_flat_quote tables - remove abandoned cart refuse

texts:
Situation

In our magento database we have three tables that are growing too big.

sales_flat_quote_shipping_rate: 3045MB
sales_flat_quote_address: 1688MB
sales_flat_quote: 1897MB

That's more than 6GB of data.

I've found this article on how to truncate these tables. This article only speaks of the third table.

I'm not sure about the truncating, and I prefer to delete all data older than 60 days. The article speaks of 17 million records - we have 20! If I'm correct, deleting these records won't lock the table, and I'm currently testing this on a test installation. That seems to work, and it doesn't conflict too much with the site.

Questions

I would like to know if I can use the same query for the other two tables as well?
I'm wondering what these tables are for.


texts: Magento 2 checkout index xml is not overriding

texts:
I am creating Magento 2 theme using the blank theme as the base. Now the problem is Magento 2 blank theme removing the top header, search bar, mini cart on http://www.yourdomain/checkout  page

vendor\magento\theme-frontend-blank\Magento_Checkout\layoutcheckout_cart_index.xml

they have removed using

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="true"/>
        <referenceContainer name="header.panel" remove="true"/>
        <referenceBlock name="top.search" remove="true"/>
        <referenceBlock name="catalog.compare.link" remove="true"/>
        <referenceBlock name="catalog.topnav" remove="true"/>
        <referenceContainer name="footer-container" remove="true"/>
    </body>
</page>

If I override the same theme with here it is not working. What I want is not remove those elements so I have to override XML file here

app\design\frontend\NAMESPACE\themename\Magento_Checkout\layout\checkout_index_index.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="minicart" remove="false"/>
        <referenceContainer name="header.panel" remove="false"/>
        <referenceBlock name="top.search" remove="false"/>
        <referenceBlock name="catalog.compare.link" remove="false"/>
        <referenceBlock name="catalog.topnav" remove="false"/>
        <referenceContainer name="footer-container" remove="false"/>

    </body>
</page>

I have written remove="false" to not to remove those elements from checkout.

But it is still remove theme an idea ?

I have checked after clear cache and re-indexing but not working


texts: Get child product short description based on attribute selected on parent product

texts:
I am looking to update the short description when the user selects different items in the dropdown of a configurable product.

What I am struggling to wrap my head around is how I would get the short description.

So on the frontend I have the dropdown which has the attributes for example IDs 257-259, I then have products assigned to these attributes, which are then assigned to the configurable product.

From this ID and the Configurable product ID how would I go about getting the simple product short description and assign it in an array to the attribute ID?

I can get a list of the simple product IDs with the following:

$ids = Mage::getResourceSingleton('catalog/product_type_configurable')->getChildrenIds($_product->getId());

I am already extending getJsonConfig in order to add some price variations to my page, I'd like to add the short description into the JS spConfig - I can do the following to spConfig:

'shortDescription' => $currentProduct->getShortDescription(),

But this is the parent product and not the simple one. I am looping through the options and I add the attribute ID and label to my array, but I don't know how to get X product with Y attribute that is from Z configurable.


texts:
I've been trying to add a static block to individual product pages, below the add to cart button, using "Product > Design > Custom Layout Update".

I've tried various versions of the code below, but without any success.

<reference name="content">
<block type="cms/block" name="wetsuits" before="product.info.addtocart">
    <action method="setBlockId"><block_id>wetsuits</block_id></action>
</block>
</reference>

I'm using 1.9.1.0, any help is greatly appreciated.


texts: How do I add and delete products displayed in a block on my homepage? My site runs on Magento 2.3.0

texts:
I know the location of the Block but what I don't  know yet is how to add and delete the products displayed on the block.
Thank you


texts: Magento 2 : CMS Pages/Blocks and Products Not Loading in Backend

texts:
I'm using Magento 2.2.2 with PHP 7.1.1, CentOS 7 and Nginx.

Currently in developer mode, I am working normally in Windows 10 and hosts file changed to the server IP, locally.
After pointing the domain to this server and trying to access it, everything except these section work as intended.

If I still change the hosts file to the server IP, all sections show up as intended.

Pages show the spinning wheel but no content is loaded. No error log whatsoever. No console error in the inspector aswell.

What could be happening here?


texts: Magento1: Add Discount_Amount Column in Invoice details

texts:
I want to add a new column in customer's frontend where they can see also the discount amount.

http://example.com/sales/order/invoice/order_id/11111/

I would like to add the column in this table.

Thank you!


texts: How to allow duplicate entries in admin grid

texts:
I want to show the duplicate entries in Admin Grid. that grid is created by join there tables. If any duplicate entry from my custom table, Grid returns the error as below,

  Item (Magento\Framework\View\Element\UiComponent\DataProvider\Document) with the same ID "1" already exists.

how to disable this duplicate entry check in grid/collection.php  My Collection.php is below,

<?php

namespace Webkul\Pos\Model\ResourceModel\Delivery\Grid;
use Psr\Log\LoggerInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Event\ManagerInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\Search\AggregationInterface;
use Magento\Framework\Api\Search\SearchResultInterface;
use Magento\Framework\Data\Collection\EntityFactoryInterface;
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface;
use Webkul\Pos\Model\ResourceModel\Delivery\Collection as DeliveryCollection;

class Collection extends DeliveryCollection implements SearchResultInterface  {

    protected $_aggregations;
    protected $_objectManager;

    public function __construct(
        EntityFactoryInterface $entityFactory,
        LoggerInterface $logger,
        FetchStrategyInterface $fetchStrategy,
        ManagerInterface $eventManager,
        StoreManagerInterface $storeManager,
        ObjectManagerInterface $objectManager,
        $mainTable,
        $eventPrefix,
        $eventObject,
        $resourceModel,
        $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
        $model = "Magento\Framework\View\Element\UiComponent\DataProvider\Document"
    )  {
        $this->_objectManager = $objectManager;
        parent::__construct(
            $entityFactory,
            $logger,
            $fetchStrategy,
            $eventManager,
            $connection,
            $resource
        );
        $this->_eventPrefix = $eventPrefix;
        $this->_eventObject = $eventObject;
        $this->_init($model, $resourceModel);
        $this->setMainTable($mainTable);
    }

    public function getAggregations()  {
        return $this->_aggregations;
    }

    public function setAggregations($aggregations)  {
        $this->_aggregations = $aggregations;
    }

    public function getSearchCriteria()  {
        return null;
    }

    public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria = null)  {
        return $this;
    }

    public function getTotalCount()  {
        return $this->getSize();
    }

    public function setTotalCount($totalCount)  {
        return $this;
    }

    public function setItems(array $items = null)  {
        return $this;
    }

}

My model\ResourceModel\Delivery Collectio.php is below,

<?php
 namespace Webkul\Pos\Model\ResourceModel\Delivery;

use
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection  {

    protected $_idFieldName = "order_id";

    protected function _construct()  {
        $this->_init("Webkul\Pos\Model\Delivery", "Webkul\Pos\Model\ResourceModel\Delivery");

    }

    protected function _initSelect()
    {
      parent::_initSelect();
      $this->getSelect()->join(
            ['secondTable'=>$this->getTable('sales_order_address')],
            'main_table.order_id = secondTable.entity_id','*');
      $this->getSelect()->join(
            ['thirdTable'=>$this->getTable('sales_order_grid')],
            'main_table.order_id = thirdTable.entity_id', '*');

      }

    public function setDeliveryData($condition, $attributeData)  {
        return $this->getConnection()->update($this->getTable("pos_delivery"), $attributeData, $where = $condition);
    }

}

Anyone please help me.. Thanks in Advance


texts:
magento2 We also need to have different shipping & tax for specific countrie so please given me a solution .
EG: If the Country = Germany
Tax = 15% of the cart value
If the Country = Columbia
Shipping = $40 Flat


texts: Configurable products and layered navigation

texts:
Hopefully someone can help, I'm creating configurable products for the first time, with the end goal resulting in customers being able to refine their search using layered navigation.

For example: customer chooses divan beds, and then wants to see all the beds available in king size, at the moment all the king size beds are available but only show the base price, not the price of the king size simple product price.

What we need is the results to show the customer the price of that size (which has been set in the simple products.) Some sites get around this by listing "price from" but this is not ideal.

I'm not sure if there is something we've missed or if there is some custom coding / extension required.

Thanks in advance.


texts: how to migrate Bigcommerce store in Magento2

texts:
I want to migrate Bigcommerce store to Magento2

I have check online with Litextension and carttocart extension but it's not giving 100% accurated data migrated...

If anyone have tried before, or any suggestion will be appreciated.


texts: Indexers Invalid, Constant Errors from Crontab

texts:
I use a shared hosting service and installed Magento 2.2.1 through a one-click installer in my host's control panel. After installation, I immediately saw the error: One or more indexers are invalid. Make sure your Magento cron job is running.

In an attempt to repair this error, I created cronjobs in the Cronjobs Settings of my hosting control panel, using the three commands listed in the documentation: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html (edited for privacy)

* * * * * | /usr/local/php7/bin/php /home/www/WEBSITE.com/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/www/WEBSITE.com/var/log/magento.cron.log
* * * * * | /usr/local/php7/bin/php /home/www/WEBSITE.com/update/cron.php >> /home/www/WEBSITE.com/var/log/update.cron.log
* * * * * | /usr/local/php7/bin/php /home/www/WEBSITE.com/bin/magento setup:cron:run >> /home/www/WEBSITE.com/var/log/setup.cron.log

Not long thereafter, I started being inundating with emails of the following error:

Cron: '/usr/local/php7/bin/php /home/www/WEBSITE.com/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/www/WEBSITE.com/var/log/magento.cron.log'

[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [1226] User 'DB_NAME' has exceeded the 'max_user_connections' resource (current value: 20)
[PDOException]
SQLSTATE[HY000] [1226] User 'DB_NAME' has exceeded the 'max_user_connections' resource (current value: 20)
cron:run [--group GROUP] [--bootstrap BOOTSTRAP]

To fix this error, I contacted the hosting provider's tech support, who then told me that max_user_connections is hard-coded on shared plans at 20 and it could not be altered.

This led me to go back through the documentation listed above and follow the steps in the Prerequisites, but as I do not have root access to the server, (since I'm on a shared hosting plan) I can not run commands like

crontab -u magento_user -e

So at this point I'm just lost. I'm unsure of what to do to make this work. I am still new to site administration and Magento so maybe there's something obvious I'm missing.


texts: how often that magento 2 reindex cron job run?

texts:
Anyone know how often that Magento 2 Reindex Cron job run daily?

thanks


texts: Logic/Code/Extension for adding products to wishlist along with product options

texts:
Update:
Can anyone tell me if this has been enhanced by Magento in Enterprise 1.14.1.0 edition?

I want to add the product with wishlist along with product options. And also share the product with a friend along with those options in email.

Can anyone suggest me code/logic/Extension (Enterprise Edition) for this.


texts: Magento 2 - How to validate your input with custom validation

texts:
We have created custom attribute name "username" for customers.

We need to validate the username by allowing certain characters only.

i.e. Username should contain : a-z A-Z 0-9 & .@_- only


texts:
I need to flush only block HTML of Magento 1,9

If I write

try {

Mage::app()->getCacheInstance()->cleanType('block_html');

 } catch (Exception $e) {
        die("[ERROR:" . $e->getMessage() . "]" . PHP_EOL);
 }

It's correct?


texts:
I am not able to edit Products on my Magento Backend and when I click Add Product, the proper format ie- General,Prices,Design etc doesn't appear.

I have got this issue after I installed Manthan Multi-Seller Marketplace and since then I cannot make any changes to my Products.


texts: What is the frontend Layout structure of Magento 2?

texts:
I wish to know which grid structure does magento 2 follow as in how many columns is the structure of and what is the gutter width in it.

Does anyone have documentation for magento 2 frontend designer as in what points should they keep in mind while designing.

Thank you


texts: Add a new field in form : BlackBird - ContentManager

texts:
In the _prepareForm() method of Blackbird\ContentManager\Block\Adminhtml\Content\Edit\Tab\Form
I've been adding a new field
    // Position of the current content
    $fieldset->addField('position', 'text', [
        'name' => 'position',
        'label' => __('Position'),
        'title' => __('Position'),
        'required' => true
    ]);

The field properly shows up in the admin form
He is also properly sent in the saving constructor.
Meanings if I'm checking this in Blackbird\ContentManager\Controller\Adminhtml\Content\Save
var_dump($content->getPosition());
die();
$content->save();

Then I got the value from the form, all good.
But If I let the saving process go to the end. The object is saved, bhut it looks like this new field remains empty and can't be found in the database.
What am I missing here ?


texts:
I created a form to add products in the frontend, and I've added products with all attributes, except for product image. When I save, it shows: Image does not exist. Please help me find the problem. Thanks.

My template:

    *<?php echo $this->__('Image') ?>

        <input type="file" id="<?php echo $this->getFieldId('image')?>" name="image title="<?php echo Mage::helper('core')->quoteEscape($this->getStoreLabel('image')) ?>" />

In controller:

 $product = new Mage_Catalog_Model_Product();

 $filename = $_FILES['image']['name'];
 $image = Mage::getBaseDir('media') . DS . "catalog\product" . DS . $filename;
 $product ->setMediaGallery(array('images' => array(), 'values' => array()))
            ->addImageToMediaGallery($image, array('image', 'small_image', 'thumbnail'), false, false);
 $product->save();


texts: How to move next button in checkout to sidebar and keep it's behaviour. Magento 2.3

texts:
As in question title. Button is placed in Magento_Checkout/view/frontend/web/template/shipping.html

I need to move it under sidebar section or create new button which will act the same like old one. I know how to create a new button and move it under or inside sidebar, but i don;t know how to force shipping address and shipping method validation after click on it.

The google search did not bring clear or working results.

I will appreciate any help.


texts: Magento 2.4.1 Get allowed countries country code and name programmatically

texts: We need to create a frontend option list of allowed countries within Magento 2.4.1. I tried this solution: https://magento.stackexchange.com/a/200368/80960  but this only return the country code. We need the full name and code returned.


texts: invalid backend model specified: giftcards/product_additionalprice in magento 1.8

texts:
I am using Magento 1.8 and trying to export all producta in System->Import/Export->Dataflow - Profiles.

In Profiles i choose Export All Products and Run Profile.

But it shows error as below

  Invalid backend model specified: giftcards/product_additionalprice

How can i fix this...? Or how to importing/exporting all product without using any extension...?

Thanks in advance


texts: PayPal Ipn model and automatically order state changes

texts:
First of all i will explain you about the actuall functionality:

Customer buys in shop via PayPal
Shop operators call the order from an external software (WaWi; don't know in en) and the software sets the order state to complete
Shop operators collect the money at paypal, based on their seller account, from customer
After that, Paypal sends after some time an automatic Ipn request back to magento and set the order back to pending

The thing is to prevent paypal (or Ipn Model) from setting the order from state finished back to pending.

We allready did some modifications to the class: Mage_Paypal_Model_Ipn in Mage/Paypal/Model/Ipn.php. In my opinion is there the responsible code in _registerPaymentCapture(). Here are our edits (marked with Edit):

 if ($this->getRequestData('transaction_entity') == 'auth') {
        return;
    }
    $this->_importPaymentInformation();
    $payment = $this->_order->getPayment();

    /* Edit: check if order state is complete */
    $orderStateComplete = (Mage_Sales_Model_Order::STATE_COMPLETE == $this->_order->getState());

    $orderStatusBefore = $this->_order->getStatus();
    $payment->setTransactionId($this->getRequestData('txn_id'))
        ->setPreparedMessage($this->_createIpnComment(''))
        ->setParentTransactionId($this->getRequestData('parent_txn_id'))
        ->setShouldCloseParentTransaction('Completed' === $this->getRequestData('auth_status'))
        ->setIsTransactionClosed(0)
        ->registerCaptureNotification($this->getRequestData('mc_gross'));

    /* Edit: reset state and status, if order was already complete before */
    if ($orderStateComplete) {
        $this->_order->setState(Mage_Sales_Model_Order::STATE_COMPLETE)
            ->setStatus($orderStatusBefore);
    }
    $this->_order->save();

    // notify customer
    $invoice = $payment->getCreatedInvoice();
    if ($invoice && !$this->_order->getEmailSent()) {
        $this->_order->sendNewOrderEmail()->addStatusHistoryComment(
            Mage::helper('paypal')->__('Notified customer about invoice #%s.', $invoice->getIncrementId())
        )
        ->setIsCustomerNotified(true)
        ->save();
    }

The problem is still there and i don't know where to edit the file to prevent order state changes.

greetz & thanks in advance


texts: Set default value for attribute in Setup Script in Magento 2

texts:
I have created install script to add an attribute to category.

Default value has to be set, thus 'default' => '1', is used.

InstallData.php file:

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        Category::ENTITY,
        'my_attr',
        [
            'type' => 'int',
            'label' => 'My',
            'input' => 'select',
            'default' => '1',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'required' => false,
            'sort_order' => 100,
            'group' => 'General',
        ]
    );
}

The problem is that later when I use $cat->getMyAttr() I can get this only when I have set it to true or false in admin panel and saved settings. Otherwise I get just null.

In other words default value is not being set during setup of the module.
How to set default value that will be set to all the categories with setup script?


texts:
I am trying to override the the catalog widget template found in this directory:

/vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/grid.phtml

I copied the grid.phtml file to:

mytheme/Magento_Catalog_Widget/templates/product/widget/content/grid.phtml

But this hasn't worked and the widget I have put on my page is still pulling in the default template. Any ideas? I am pretty sure I am using the right directory as all other template files I have overridden have worked fine. Tried flushing the cache and no joy.

I noticed the code the wysiwyg generates for the widget on the page references a template file. I presume this is still overridden?

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_count="4" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Combine`;s:10:`aggregator`;s:3:`all`;s:5:`value`;s:1:`1`;s:9:`new_child`;s:0:``;]s:4:`1--1`;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Product`;s:9:`attribute`;s:12:`category_ids`;s:8:`operator`;s:2:`==`;s:5:`value`;s:2:`32`;]]"}}


texts: if attribute MSRP is greater than PRICE echo MSRP

texts:
I would like to have a condition that MSRP be only displayed when the value is greater than the price in my store.

I've played around and managed to get this to work:

<?php if($_product->msrp<price): ?>
 <?php echo $this->__('MSRP: ') ?> <?php echo Mage::helper('core')->currency($_product->getMsrp(),true,false); ?>
         <?php endif; ?>

However, on products that the MSRP is not present displays as 0$ and also displays for products that have a higher price than MSRP.

How can I display the MSRP: and the MSRP value when the price is lower?


texts:
In Magento 2.1.7 when arrive to the payment checkout there is a line for the terms: I accept the terms and conditions but there is no checkbox.

When I click on pay button it displays an error message that I have to accept the terms, but I can't accept them without checkbox!

In

magento_root/vendor/magento/module-checkout-agreements/view/frontend/web/template/checkout/checkout-agreements.html

can see the code:

            <input type="checkbox"
                   data-bind="attr: {
                                'id': 'agreement_' + agreementId,
                                'name': 'agreement[' + agreementId + ']',
                                'value': agreementId
                                }"
                   data-validate="{required:true}" />

                <button type="button"
                        class="action action-show"
                        data-bind="click: function(data, event) { return $parent.showContent(data, event) }"
                        >

                </button>

            <button type="button" class="action action-show"
                    data-bind="click: function(data, event) { return $parent.showContent(data, event) }">

            </button>

but in the web there is:

            <button type="button" class="action action-show" data-bind="click: function(data, event) { return $parent.showContent(data, event) }">
                I accept terms and conditions
            </button>

So all the code that references the checkbox input is missing.

I have configured in admin panel -> stores/terms and conditions the terms with status enabled and applied automatically.

I have configured in admin panel -> stores/configuration/sales/order/payment process options the terms and conditions enabled.

As I configured the terms and conditions in both places it should display the checkbox, but there is no checkbox.

Is like the ko if: ($parent.isAgreementRequired($data)) is false always.

I cleared the cache several times: php bin/magento cache:flush

I reindexed: php bin/magento indexer:reindex

I made a setup upgrade, setup di compile and setup deploy static but still no checkbox.

Finally I tried disabling all the terms and conditions, but still can't pay. Not sure what's happening as the code of the checkout remains untouched yet.


texts: Magento 2 OAuth API - Consumer key has expired

texts:
I've created an integration in System->Extensions->Integrations and allowed all access.

I'm using Postman to test the API, but I'm getting error:

  Consumer key has expired.

I've tried cache:clear, setup:upgrade, reauthorising the integration


texts:
So recently we've noticed a problem with newly created products within our magento site.  It is a configurable product with multiple sizes and colors associated to it. We have full inventory for the product, it displays correctly on the product page you can add it to your cart which is great.  But, once the product is in the cart it displays an error message under the product "The requested quantity for "item name" is not available, selected option(s) or their combination is not currently available.

I have checked inventory, it has 200, it is enabled and in stock but for some reason the cart won't check right.

It's not only happening to new products but it's happening to products that have been established but we add a new color to the item and we see the same problem.

images attached to show both front end and back end. (note: image in the cart does not reflect actual product but displays configurable image)

Thank you


texts: How can i migrate website from Magento1 to Magento2 with in short time?

texts:
Actually in my magento store orders are placed frequently so i only can make my site in maintenance mode for 6 to 7 hours.

My issue is there are approx 50000 orders and 30000 customers and too many products so i migrate my magento store using UBER Them Tools and it takes 2 days which are not right choice so is there any other method which are fast suitable for migration.


texts: Fixing magento email form in contacts page

texts:
When I receive an email in my inbox, the from field is always the same. It looks like that's because it uses the senders name from the general contact email.

I'd prefer this to be the name field value. Can someone tell me how to do this?


texts: Why is my checkout in my multi store setup behind the url "/default/"?

texts:
We have an API plugin and I'm currently testing it with multiple store fronts, but I've noticed that it gets put behind the URL part /default/ instead of just starting at the "root" of the url. The same goes for the /checkout/onepage, this becomes /default/checkout/onepage.
Why is this and how can I disable it?


texts: window.on 'load', function not useable with require JS loaded file

texts:
I am trying to use $(window).on('load', function(){}); in file that is being pulled into my template with require JS, but no matter how i configure the JS, it will not execute.

The odd part is, this code will execute fine when placed in <script> tags in the phtml, so i know it's not an issue with the JS itself.

In my template file i have this code:

<script type="text/x-magento-init">
{
    "*": {
        "Magento_Cms/js/tester": {}
    }
}
</script>

And i know this is calling in the correct JS file, as i have tested the console.log inside and outside the $(window).on('load', function(){});. When i hit the page, tester 1 always prints, tester 2 does not. Inside the JS file i have:

define([
    'jquery'
], function ($) {
    'use strict';
    console.log('tester 1');
    $(window).on('load', function(){
        console.log('tester 2');
    });
});

If i take this code and put it in the template file itself, it always prints:

<script>
    require([
        'jquery'
    ], function ($) {
        'use strict';
        $(window).on('load', function(){
            console.log('tester 1');
        });
    });
</script>

So the logical conclusion would be that there is an issue with require JS loading in this JS file, but how could i track this down and test to see why this is not loading correctly?


texts: How to remove / hide instructions from magento shipping lable (Fedex , USPS)

texts:
I dont want that instructions in shipping lable, So please kindly help to achieve this.

I dont want any message after the line. like

"For FedEx"
"After Printing this lable"
"Warning"
"For USPS"
"Instructions


texts: How to pass extra parameter to mail function from magento

texts:
I want to send extra parameter to  mail function in  magento. I didn't find any raw mail function in magento, can any one help me where I will get that function.

mail($to, $subject, $message, $headers, 'Iwantopassthis@test.com'); // I want to pass 5th parameter


texts: Magento2: load attribute using attribute code

texts:
I am using the below code to load the attribute using attribute code but it's not working:-

protected $_attribute;

public function __construct(
   ...
   \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection $attribute,
   ...
) {
   ...
   $this->_attribute = $attribute;
   ...
   }

   $existingAttribute = $this->_attribute
            ->addFieldToFilter('attribute_code', $attributecode)
            ->load()
            ->getFirstItem();
        echo '
'; print_r($existingAttribute); echo '
';

Can any one help me in this.
It's working fine as below in magento 1

$existingAttribute = Mage::getModel('eav/entity_attribute')->getResourceCollection()
            ->addFieldToFilter('attribute_code', $attributecode)
            ->load()
            ->getFirstItem();
        echo $existingAttribute->getId();
        echo '
'; print_r($existingAttribute); echo '
';

Thanks for help in advance;


texts: How to fix magento 2.3 openlog() security error

texts:
This is my error. How to fix this?

  main.CRITICAL: Warning: openlog() has been disabled for security
  reasons in
  /vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php on line
  62


texts: Modifying child block using Custom Layout Update XML

texts:
I am currently using a CMS Block to add more details on my product page. I had the following block (product_custom) added inside catalog.xml:

<catalog_product_view translate="label">
    <!--- ... --->
    <reference name="content">
        <!--- ... --->
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
            <block type="cms/block" name="product.info.custom" as="product_custom">
                <action method="setBlockId">
                    <block_id>product_custom</block_id>
                </action>
            </block>
        </block>
    </reference>
</catalog_product_view>

Now, I want other products to show different content, so I created another block (product_custom2) and use Design > Custom Layout Update:

<reference name="content">
    <block type="catalog/product_view">
        <block type="cms/block" name="product.info.custom" as="product_custom">
            <action method="setBlockId">
                <block_id>product_custom2</block_id>
            </action>
        </block>
    </block>
</reference>

Unfortunately, the product page is showing previous block instead of the new one.
Did I miss something on the custom layout xml? Or is it not allowed?
And what would possibly the best solution to this one?

Thanks for the replies.


texts: I am trying to build an ecommerce site and I'm stuck on how to import bulk products on magmi, after searching through the web i have  not found a clear walk-through on how to setup magmi and use it to import products to my magento store, I hope someone here can lead me the way, thank you in advance


texts: How to create custom 403 error page in magento2

texts:
How can I create a custom error pages in my Magento 2 site. For example this pages: 500, 401, 403, and 404.

I tried for create block:

 $layout = $this->_view->getLayout();
 $block = $layout->createBlock('Training\Test\Block\Test');
 $this->getResponse()->appendBody($block->toHtml());

But not working return error

  Catalog Layer has been already created

Below is my Controller

    class View{
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
        PageFactory $resultPageFactory,
        \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->toolbar = $toolbar;
        $this->resultPageFactory = $resultPageFactory;
        $this->resultForwardFactory = $resultForwardFactory;
        $this->url = $url;
    }

    public function beforeExecute(\Magento\Catalog\Controller\Category\View $category)
    {

        $product_limit = $category->getRequest()->getParam('product_list_limit');
        $available_limits = $this->toolbar->getAvailableLimit();
        if(!in_array($product_limit, $available_limits) && !empty($product_limit))
        {
            /*$norouteUrl = $this->url->getUrl('noroute');
            $category->getResponse()->setRedirect($norouteUrl);
            return;*/
            return $this->resultForwardFactory->create()->forward('noroute');
        }
    }
}

In that I want to replace return $this->resultForwardFactory->create()->forward('noroute'); with my custom error page URL


texts: How to show all category and their subcategory in menu in magento2

texts: I want to show all category in the menu and on the mouse-over their subcategories will be shown. Right now it is showing only one subcategory in menu. No category and subcategory are showing inside menu.


texts: Font files cannot be loaded when using CDN in Magento?

texts:
When I use CDN for my Magento site, there is a problem that font files cannot be loaded? I don't know why it does happen.
Is there any solution to overcome this issue?


texts: How to get the quantity of color options of each configurable product

texts:
I need to know the number of color options of each configurable product in a list. I get them like this:

    $productAttributeOptions = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);

//in this case the attribute color that I needed is in [0] position
$available_colors = sizeof($productAttributeOptions[0]["values"]);

if ($available_colors >1):
    //custom code
endif;

The problem is that for one product works fine, but for 20 or more it is really slow, it takes too long to load each page of products list.

Is there a fastest way to do it? I see that my way is not a really good way.


texts:
Magento ver. 2.3.3

Choose a few allowed countries.

Then go to Customer Address Edit Form in Admin area.

Country dropdown is not as we expected.

If I just use 1 country none will show up if you chose more then it will just take countries from the top.

Anyone had this issue ad anyone solve it?


texts:
I set Magento After Login redirection No

System > Config > Customer > Costumer Redirect Customer to Account Dashboard after Logging in > NO

It's working fine in Mozila Browser It redirect to Previous page and top link also changed Login into Logout

But In Chrome Browser It redirect to Previous page but top link it doesn't change once i manually reload the page then only it change into Logout.

I delete

var/cache
var/session

But no changes. How do i fix it


texts: Logic for creating Configurable products with lots of configuration

texts:
i need an information. I have got an eCommerce that sell configurable print of photos and paintings.
For every attributes we have got lots of configuration:
-Size (around 10 different size)
-Color (around 10 different size)
-Frame (4 different types)
And he has got lots of painting.
The problem is that Magento2 looks like that is not able to manage all this configuration because for every product it will create over 400 product for every configurable one.
What is the best to manage this kind of products?
best regards
Francesco


texts: An error has happened during application run. See exception log for details godday windows hosting

texts:
I have uploaded Magento 2.1.7 on godaddy windows shared hosting.

I uploaded all files and restore database from localhost but this error happened.

please help me.


texts:
I have created a custom column for associated products (basically every simple product will have that column under "associated products" tab of configurable product). I store information of this field/column into an attribute which belong to configurable product instead of each simple product.

Below is the code for adding a column;

config.xml

<core_block_abstract_to_html_before>
     <observers>
        <something>
          <class>namespace_JsonProductInfo_Model_Observer</class>
          <method>addPositionColumn</method>
        </something>
     </observers>
</core_block_abstract_to_html_before>

Oberver.php

public function addPositionColumn(Varien_Event_Observer $observer)
{
    $block = $observer->getEvent()->getBlock();
    if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid) {
        if (!$block->isReadonly()) {
            $block->addColumnAfter(
                'position_simple',
                array(
                    'header'     => Mage::helper('jsonproductinfo')->__('Position'),
                    'type'      => 'input',
                    'name'      => 'position_simple',
                    'index'     => 'position_simple',
                    'sortable'  => false,
                ),
                'name'
            );
        }
    }
}

With above code I am able to add the column into a require grid. And I am also able to save the information which I put inside that column (which is basically an attribute). The only problem I am facing is, I am unable to display the stored information into that column again (If I edit the product). I have also created another observer of type eav_collection_abstract_load_befor but no luck so far.
Below is the code for it:

config.xml

<eav_collection_abstract_load_before>
    <observers>
        <jsonproductinfo>
            <class>namespace_JsonProductInfo_Model_Observer</class>
            <method>addPositionToCatalogProductCollection</method>
        </jsonproductinfo>
    </observers>
</eav_collection_abstract_load_before>

Observer.php

public function addPositionToCatalogProductCollection($observer)
{
    $collection = $observer->getEvent()->getCollection();
    if (!isset($collection)) {
        return;
    }
    $collection->addAttributeToSelect('position_simple');
}

I would be grateful if someone can point to the mistake or guide me how can I display back that information again into that column.

EDIT

And here is the code which creates the "postion_simple".

$this->addAttribute(
    'catalog_product',
    'position_simple',
    array(
        'group'             => 'General',
        'type'              => 'varchar',
        'input'             => 'hidden',
        'backend'           => '',
        'frontend'          => '',
        'label'             => 'Simple Position',
        'class'             => '',
        'source'            => '',
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible'           => true,
        'required'          => false,
        'user_defined'      => true,
        'default'           => '',
        'searchable'        => false,
        'filterable'        => false,
        'comparable'        => false,
        'visible_on_front'   => false,
        'visible_in_advanced_search'   => false,
        'unique'            => false,
        'apply_to'          => Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE,
        'is_configurable'   => false,
    )
);


texts: Problem with add an attribute to Customer in magento 2

texts:
I created a module in this way:
I created a vendor folder "Test1" Then I created a module folder "AddCustomerAttr" then a folder inside the module "etc" and inside "etc" I put module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Test1_AddCustomerAttr" setup_version="0.0.2">
</module>

Then I created registration.php:

 \Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE, 'Test1_AddCustomerAttr',
__DIR__
);

Then I created "Model" folder and "Attribute" folder inside it and then I created 3 folders inside "Attribute":
"Backend" "Frontend" and "Source"

Inside of each folder, I created a file Attribute.php

/Backend/Attribute.php:

 namespace Test1\AddCustomerAttr\Model\Attribute\Backend;

 class Attribute extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
 {
 /**
 * Validate
 * @param \Magento\Catalog\Model\Product $object
 * @throws \Magento\Framework\Exception\LocalizedException
 * @return bool
 */
public function validate($object)
{
    $value = $object->getData($this->getAttribute()->getAttributeCode());
    if ( ($object->getAttributeSetId() == 10) && ($value == 'wool')) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('Bottom can not be wool.')
        );
    }
    return true;
}
}

/Frontend/Attribute.php:

 namespace Test1\AddCustomerAttr\Model\Attribute\Frontend;
 class Attribute extends \Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend
 {
 public function getValue(\Magento\Framework\DataObject $object)
 {
    $value = $object->getData($this->getAttribute()->getAttributeCode());
    return "<b>$value</b>";
}
}

Then I created a Setup folder inside module folder and I put file InstallData.php inside it:

InstallData.php:

namespace Test1\AddCustomerData\Setup;

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

class InstallData implements InstallDataInterface
{
  private $eavSetupFactory;

  public function __construct(EavSetupFactory $eavSetupFactory)
  {
      $this->eavSetupFactory = $eavSetupFactory;
  }

  public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
  {
      $eavSetup = $this->eavSetupFactory->create();
      $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'test_attribute',
        [
            'group' => 'General',
            'type' => 'varchar',
            'label' => 'Test Attribute',
            'input' => 'select',
            'source' => 'Test1\AddCustomerAttr\Model\Attribute\Source\Material',
            'frontend' => 'Test1\AddCustomerAttr\Model\Attribute\Frontend\Material',
            'backend' => 'Test1\AddCustomerAttr\Model\Attribute\Backend\Material',
            'required' => false,
            'sort_order' => 50,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'is_used_in_grid' => false,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => false,
            'visible' => true,
            'is_html_allowed_on_front' => true,
            'visible_on_front' => true
        ]
    );
  }

}

Then I run command

php bin/magento setup:upgrade

But no change occurred in customer page!

I did these modules on Product Model and It correctly worked!

I also tried these instructions: https://www.mageplaza.com/magento-2-module-development/magento-2-add-customer-attribute-programmatically.html
But still I don't know what is the problem and it didn't work too.


texts: Magento 1.7 - SEO URLs - Rewrite URL in Sitemap for Products

texts:
we have Magento 1.7 in use.
We would like to read our SEO URL for the products from the database. We have found that the attributes for "url_key" do not match the URL from the sitemap of Magento.
How can we find the correct SEO URL for the product? In the table "core_rewrite_url" a product sometimes has up to 80 URLs. Unfortunately, we could not find any clues in the table which is the current valid URL for the sitemap.
Maybe you have an idea how we can find the correct SEO URL for the product?
Regards


texts:
I'm attempting to add a new payment module that pings the Authorize.net SIM method. It can go out and process the information. Authorize.net will relay the information back to the module. There is a problem on the validate function:

public function responseAction() {
    if($this->getRequest()->isPost()) {
        $post_array = $this->getRequest()->getPost();
        $orderId = $post_array['x_invoice_num'];
        $method = 'creditcard-'.$post_array['x_trans_id'];
        switch($post_array['x_response_code']){
            case 1:
                $order = Mage::getModel('sales/order')->load($OrderId, 'increment_id');
                $payment = $order->getPayment();
                $Carddata=array(
                    'method' => $method,
                    'cc_type' => $post_array['x_card_type'],
                    'cc_number' => $post_array['x_card_number'],
                    'cc_amount' => $post_array['x_amount']
                );
                Mage::log($payment_method, null, 'carddata.log');
                $payment->addData($Carddata); //Here is the problem.
                $payment->save();
                $validated = true;
                break;
            case 2:
                $errorCode = 'Declined';
                $errorMsg = $post_array['x_response_text'];
                break;
            case 3:
                $errorCode = 'Error';
                $errorMsg = $post_array['x_response_text'];
                break;
            case 4:
                $errorCode = 'Held for Review';
                $errorMsg = $post_array['x_response_text'];
                break;
            default:
                $errorCode = 'Error';
                $errorMsg = $post_array['x_response_text'];
                break;
        }

        if($validated) {
            // Payment was successful, so update the order's state, send order email and move to the success page
            $order = Mage::getModel('sales/order');
            $order->loadByIncrementId($orderId);
            $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Gateway has authorized the payment.');
            $order->sendNewOrderEmail();
            $order->setEmailSent(true);
            $order->save();
            Mage::getSingleton('checkout/session')->unsQuoteId();
            Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure'=>true));
        }
        else {
            // There is a problem in the response we got
            $this->cancelAction();
            Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/failure', array('_secure'=>true));
        }
    }

The error is on $payment->addData($Carddata); it returns 'Fatal error: Call to a member function addData() on boolean'. Any ideas on how to successfully add the returned data to the Payment object?

Thanks!


texts: Override custom module phtml by another custom module

texts:
I've a malfunctioning module that needs to be overwritten in some parts. I would like to create a custom module that fixes that module instead of making changes in a theme as suggested in magento docs. The problem is that I'd rather keep my fixing module next to bad one so I can easily reuse it in another projects.

Another way is to remove malfunctioning phtml by layout.xml in a custom (fixing) module and replace that file with one of my own.

Which way is better and should be performed in cases like mine?


texts: How to make color coding view in magento grid for different option

texts:
I have listing of seller. There are four options:

pending
approved
reject
deleted

I want in the grid a column like in indexers for pending it show line green.
On rejected it show red whole line.

pending on_________________________________________________________________________________green
Rejected  ____________________________________________________________________________________red

Just i want to make color code on grid view.
I need to know that how can i make this like , i want.


texts:
After a data migration, everything works besides my admin customer page. When I click I get an exception error. When contacting the author of the data migration tool he said I need to delete the is_contact attribute. I went into the database and deleted it. Went ahead and cleared the cache and ran setup upgrade and the attribute came back in the database. Thought I made a mistake, deleted again, and it came back again. How do I delete it? I am on Magento 2.2.3 EE.

Edit: Removed in the EAV Attribute table.


texts: how to pass user data ( name, adress, etc ) from shipping step to my custom step?

texts:
I need to show user information on my custom step, i tried to use quote object which stores this information, but i can't understand how to pass it only when information is already set to quote, how to trigger function only after navigation to my custom step.
How to check that user is navigated to my custom step to call a function which will be get data from quote?


texts: Magento1 - Missing core/session at event sales_order_save_before

texts:
I need to pass 2 Vars from a controller to the order.
So I create a controller where i persist values at the Mage::getSingleton('core/session').

I also create an event and its observer method:

<events>
            <sales_order_save_before>
                <observers>
                    <xyz_facebook_add_userdata_to_order>
                        <class>Xyz_Facebook_Model_Observer</class>
                        <method>addFacebookMessengerUserDataToOrder</method>
                    </xyz_facebook_add_userdata_to_order>
                </observers>
            </sales_order_save_before>
        </events>

The Controller with an event Action method:

public function eventAction()
    {
        $aFBInput = json_decode(file_get_contents('php://input'), true);
        $sUserRef = $aFBInput['entry'][0]['messaging'][0]['optin']['user_ref'];
        $sSubscriptionTimestamp = $aFBInput['entry'][0]['messaging'][0]['timestamp'];

        Mage::getSingleton('core/session')->setXyzFacebookSubDateTime($sSubscriptionTimestamp);
        Mage::getSingleton('core/session')->setXyzFacebookUserRef($sUserRef);
        $this->getResponse()->setHeader('HTTP/1.0','200', true);
    }

As you see i set the custom var setXyzFacebookSubDateTime and setXyzFacebookUserRef.

If I Log this values out, I can see the values in my logfile!
But if I save the order in the checkout, the values in the observer method are empty.

public function addFacebookMessengerUserDataToOrder(Varien_Event_Observer $observer)
    {

        /**
         * @var $order Mage_Sales_Model_Order
         */
        $order = $observer->getEvent()->getOrder();
        $coreSession = Mage::getSingleton('core/session');

        $sSubscriptionTimestamp = $coreSession->getXyzFacebookSubDateTime();
        $sUserRef = $coreSession->getXyzFacebookUserRef();

        $order->setData('xyz_facebook_user_ref', $sUserRef);
        $order->setData('xyz_facebook_subscription_dateime', $sSubscriptionTimestamp);

    }

the vars $sSubscriptionTimestamp, $sUserRef are empty!

Whats wrong??


texts: Magento 1.8.1 limitation for creation of stores, products and categories

texts:
I have Magento 1.8.1 with 5 websites, 40 store group and 2 store views for each store groups, which is working but I am getting it is slow.

Now I need to create over 500 store groups and 2 store views for each store groups(1000) on this.

My Question are :

What is the limit of creating store groups, views, products, categories.?
If I provide a huge server than can I add more store groups, views and all?
What you suggest about creating 500 store groups.?


texts:
In xml, how can I remove tab of order in sales/order/history? Can't find the referenceBlock

I just need to remove this tab, not the link. To be precise, I'm using an API that will replace this table.

Edit :

When you go to /sales/order/history, usualy you have a table with the history of your order. I need to remove this table


texts:
I have an error on bin/magento setup:di:compile on my module:

  MiBPHP Fatal error:  Cannot declare class
  A\Cust\Block\Adminhtml\Product\Edit\Tab\Options\Option because the
  name is already in use in
  /var/www/html/magento2/app/code/A/Cust/Block/Adminhtml/Product/Edit/Tab/Options/Option.php
  on line 7

My Files :

etc/module.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="A_Cust" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Option" type="A\Cust\Block\Adminhtml\Product\Edit\Tab\Options\Option" />
</config>

A\Cust\Block\Adminhtml\Product\Edit\Tab\Options\Option.php

    <?php
    namespace A\Cust\Block\Adminhtml\Product\Edit\Tab\Options;

    use Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Option;

    class Option extends Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Options\Option
    {
        /**
         * Class constructor
         */
        public function _construct()
        {
            parent::_construct();
            $this->setTemplate('Magento_Catalog::product/edit/options/option.phtml');
        }

        public function getTemplatesHtml()
        {
          ...
        }

        public function getOptionValues()
        {
          ...
        }

    }

Thank you for your help,


texts: How to create offline payment method like PurchaseOrder, COD etc

texts:
Trying to create a simple offline payment method in Magento 2.3. After Magento 2.2, the abstract class

  \Magento\Payment\Model\Method\AbstractMethod

has been deprecated, so I can't use it. Also, I am not connecting to the payment gateway. So, I am not sure whether to create Facade/Adapter for the same. Anyone can please help me on that ?


texts: Create a new dropdown field in admin side custom module and its options should come from another custom module's table?

texts:
I am using Magento1.9.2.4
I want to add 4 field one of them id selectbox.
And I want to load the options for that from another custom module's table,
How can I achieve this.
And yes I want to save the 3 other fields value in other custom table.
Please Suggest how can I do this.


texts:
i have a Smile_Gdpr module in vendor that have a sections.xml
This it's content:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="smile_gdpr/consent/save">

    </action>
    <action name="catalog/account/login">

    </action>

    <action name="customer/account/logout">

    </action>
</config>

In my module insert an override of this file, into

  app/code/MyVendor/MyModule/etc/frontend/sections.xml

It's possible deleted some action (in my case name="customer/account/logout")?


texts:
We have webstore with 4 different countries which are different store views in admin.
At the moment urls are as follows: domain.com/en-us, domain.com/fr, domain.com/cz-cz etc

Client requires that one of the store views must resolve to on clean domain.com. This applies also for all content pages, products and categories of this store view, so all urls of this store view MUST NOT contain /store-view/ part in URL


texts:
Can I show json data I pull from some api in admin grid? Currently I tried to create varien data collection. But its not working. Any help is highly appreciated.

class Company_Module_Block_Adminhtml_Poll_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

    protected function _prepareCollection()
    {
        $collection = new Varien_Db_Collection();
        if ( Mage::registry('json_data') )
        {
            $data=json_decode(Mage::registry('json_data'));
            foreach ($data as $row) {
                $rowObj = new Varien_Object();
                $rowObj->setData($row);
                $collection->addItem($rowObj);
            }
        }
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }
    protected function _prepareColumns()
    {
        $this->addColumn('id', array(
            'type'=>'text',
            'index'=>'id',
            'header'=>$this->__('Print Id')
        ));
        $this->addColumn('customer_email', array(
            'type'=>'text',
            'index'=>'customer_email',
            'header'=>$this->__('Customer Email')
        ));
        return parent::_prepareColumns();
    }
}


texts: Magento 2 "Recoverable Error: Argument 2 passed" when trying to define model in constructor

texts:
I am trying to define 2 models inside controller constructor to use it later inside execute function. This is my code:

namespace Company\Modul\Controller\Adminhtml\Index;

use Magento\Backend\App\Action;

class Save extends \Magento\Backend\App\Action
{

protected $dataProcessor;
protected $appEmulation;
protected $filterProvider;

public function __construct(
    \Magento\Store\Model\App\Emulation $appEmulation,
    \Magento\Cms\Model\Template\FilterProvider $filterProvider,
    Action\Context $context,
    PostDataProcessor $dataProcessor)
{
    $this->dataProcessor = $dataProcessor;
    $this->filterProvider = $filterProvider;
    $this->appEmulation = $appEmulation;
    parent::__construct($context);
}

public function execute()
{
    $data = $this->getRequest()->getPostValue();
    $this->appEmulation->startEnvironmentEmulation(1);
    //some more code...
    $this->_redirect('*/*/');
}
}

I am getting this error:

  Recoverable Error: Argument 2 passed to Company\Module\Controller\Adminhtml\Index\Save::__construct() must be an instance of Magento\Cms\Model\Template\FilterProvider, instance of Magento\Backend\App\Action\Context given, called in C:\wamp\www\magento2b\var\generation\Company\Module\Controller\Adminhtml\Index\Save\Interceptor.php on line 14 and defined in C:\wamp\www\magento2b\app\code\Company\Module\Controller\Adminhtml\Index\Save.php on line 16

What am I doing wrong, what would be a proper way to access filterProvider?


texts: Help with Magento 2 extension conflict for configurable product swatches

texts:
I am using two extensions which both appear on the product page (configurable product with swatches):

MagicZoomPlus - for image zoom ability
Amasty Out of Stock notifications - for the ability to allow customers to sign up to be notified when a particular option, which is currently out of stock, becomes available. When clicking on such an out of stock option, the extension causes an email sign up form to appear for this notification.

The issue is that the Amasty extension is not being called when clicking on an option when the MagicZoomPlus extension is enabled.

I am far from proficient in Magento 2 code, but I believe the issue arises from the MagicZoomPlus extension's layout override below:

<referenceBlock name="product.info.options.wrapper">
        <block class="MagicToolbox\MagicZoomPlus\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="Magento_ConfigurableProduct::product/view/type/options/configurable.phtml"/>
        <block class="MagicToolbox\MagicZoomPlus\Block\Product\Renderer\Configurable" name="product.info.options.swatches" as="swatch_options" before="-" />
</referenceBlock>

The second block above seems to override the default Magento 2 block for swatches which the Amasty Out of Stock extension needs to work:

<referenceBlock name="product.info.options.wrapper">
        <block class="Magento\ConfigurableProduct\Block\Product\View\Type\Configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="Magento_ConfigurableProduct::product/view/type/options/configurable.phtml"/>
</referenceBlock>

How can this be solved? I have at this for quite some time so any help you can provide would be most useful and sincerely appreciated.

Thank you for your time and expertise.


texts: Modify custom attribute value before place order

texts:
I have a custom attribute that is placed in the Billing Address section. Now there's a condition that I only need to save the first 200 character of my custom attribute text box. Is there an event or observer that will intercept this request before proceeding to save/place order? So basically on the checkout page after inputting the text in my custom attribute when user click the Place Order button I want to check this input first if it's beyond the limit then I will trim the text. How do I do this?
Update:
When I tried to intercept the request under Magento\Checkout\Api\GuestPaymentInformationManagementInterface I was able to view the personal_message custom attribute that I'm looking at. But when I try to save or change the value it didn't allow me. How can I override it?
<type name="Magento\Checkout\Api\GuestPaymentInformationManagementInterface">
    <plugin name="validate-billing-information" type="Vendor\Module\Plugin\Checkout\BillingValidation"/>
</type>

And this is the code I was trying to overwrite
public function beforeSavePaymentInformationAndPlaceOrder(
    \Magento\Checkout\Api\GuestPaymentInformationManagementInterface $subject,
        $cartId,
        $email,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
) {
   $billingAddress->setPersonalMessage("This is an overwritten message");
   $billingAddress->save();
}

But doing this throws an error of
webapi-5f6f60228b3a3; Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`homestead_goodgifts`.`quote_address`, CONSTRAINT `QUOTE_ADDRESS_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES


texts:
I have a problem with sending the Welcome Mail after confirmation.
It is the translated standard welcome mail we have created in transactional emails (backend) and then configured on store view scope.

It´s always send in german (store_id=1) which is our default storeview.
I have already debugged it and ran into code/core/Mage/Adminhtml/controllers/CustomerController.php l.351 where the welcome mail gets send and the getSendemailStoreId() seems to be the code where it always returns store_id=1, as it seems to be null first and then loading the default/first element of the store-id array that gets loaded somehow.

I tried to get the correct store_id based on customer, but it seems that getStore() and getData() on customer-object are not containing the correct ID and the only place where I could find the correct one was in $customer-> _data['store_id'] (not in "data" !), but i could not get it out there !

I hope someone can help me to fix this strange behaviour.
Thank you !


texts: How to generate a Buy It Now url for products?

texts:
I am aware of the default Add to cart url (/checkout/cart/add?product=[id]&qty=1), however I also want a Buy it now url that will add to cart then redirect the user to the checkout page (e.g. /checkout/onepage/).

A co-worker suggested echo $_product->getData('buyitnowurl') but that just generates the product's url.


texts:
I added one discount method using Shopping Cart Price Rules. It is active for 13th June 2014 to 25th June 2014.

But now I have to disable the price rule as per the below.

That mean

If the order has placed on 15th of June and Delivery falls on 28th , then there is no discount.
If the order has paced on 15th of June and Delivery falls before 26th, then discount is there.

How to do this with admin panel? Or am I need to do any coding?


texts: Crons not reindexing the indexer after setting all

texts:
I checked the crontab and it is showing me the correct entries. link
I checked the cron_schedule table and it is creating and scheduling
indexers. link
I checked the bin/magento indexer:status and it is showing me the
Ready status
update.log output in magento/var/log is WARNING: Update is already in progress. here

But still when I login to magento admin System > Index Management, here is the status. Some indexers are showing last updated date one month ago. What's going wrong? Issue facing on ver Magento2.1.7


texts: Magento 2: "Unable to locate element: .page-header .admin-user" when running FTF

texts:
I try to run Functional Testing Framework. When I run tests:

vendor/bin/phpunit

I see that new Firefox window is launched, .../admin/admin/ page is opened and login form is appeared on the page. But authentication is not performed. I see this error in the selenium server logs:

14:21:06.806 INFO - Executing: [get current url])
14:21:06.812 INFO - Done: [get current url]
14:21:06.835 INFO - Executing: [execute script: return document['readyState'], []])
14:21:06.850 INFO - Done: [execute script: return document['readyState'], []]
14:21:06.854 INFO - Executing: [execute script: return document['readyState'], []])
14:21:06.864 INFO - Done: [execute script: return document['readyState'], []]
14:21:06.870 INFO - Executing: [find element: By.cssSelector: .page-header .admin-user])
14:21:07.478 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: Unable to locate element: .page-header .admin-user

There is no '.page-header' element on the login page:

What I need to do to run functional tests using FTF?


texts: Is there any way to get the admin path for a given installation? Most of the time is /admin, but I want to know if there is a certain way to get the path of the admin programmatically.


texts:
I'm migrating data from magento 1.9.2.1 to magento 2.0.2, when it gets to step EAV.I 'm getting the following error:

  [ERROR]: Incorrect value:
  Magento\Bundle\Model\Product\Attribute\Source\Shipment\Type in:
  eav_attribute.source_model for attribute_code=shipment_type

I double checked the values in the old and new. they match exactly.I tried to ignore and didn't work for this in the class-map.xml.

Any Ideas on this?


texts: Saving a Quote Since Save() is Deprecated

texts:
I have created a new attribute for quotes and orders in Magento 2.1.5.

I have an observer that sets the value for this attribute based on a session variable (indentOrder).

The code I have is working:

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Logger\Monolog;
use Magento\Quote\Model\Quote;
use Wildcard\IndentOrders\Model\IndentOrders;

class QuoteSaveObserver implements ObserverInterface
{
    protected $indentOrders;

    protected $logger;

    public function __construct(IndentOrders $indentOrders, Monolog $logger) {
        $this->indentOrders = $indentOrders;
        $this->logger = $logger;
    }

    public function execute(Observer $observer)
    {
        // Check if is indent order or not
        if ($this->indentOrders->isIndent()) {
            $indentOrder = 1;
        } else {
            $indentOrder = 0;
        }

        /** @var Quote $quote */
        $quote = $observer->getQuote();

        $quote->setIndentOrder($indentOrder);
        $quote->save();
    }
}

I am concerned with the deprecation of the Magento\Quote\Model\Quote::save() method for future updates.

I have read Here that I should be using Module Service Contract. I read the link on that answer but it didn't make any sense as to how I can use this for my scenario.

Looking into the Magento_Sales code I can see that there is a model called QuoteRepository that contains a save method but this takes a \Magento\Quote\Api\Data\CartInterface as a parameter:

public function save(\Magento\Quote\Api\Data\CartInterface $quote)
{
    if ($quote->getId()) {
        $currentQuote = $this->get($quote->getId(), [$quote->getStoreId()]);

        foreach ($currentQuote->getData() as $key => $value) {
            if (!$quote->hasData($key)) {
                $quote->setData($key, $value);
            }
        }
    }

    $this->getSaveHandler()->save($quote);
    unset($this->quotesById[$quote->getId()]);
    unset($this->quotesByCustomerId[$quote->getCustomerId()]);
}

Can someone let me know if i am on the right track for this and help me with how to use the above method? With the same strength, can someone please let me know if I am way off track and help to put me on the correct one?


texts: Magento 2 : How to add placeholder text to street fields in checkout?

texts:
In back-end I've set the street address to have 3 lines.

I'd like to put a different placeholder in each field:

Street
Building / Apartment
Area

This way user can enter data in a more structured way.

A similar question can be found here:

Magento 2 - How to affect street address in checkout forms with layout xml/ui arguments

However the answers does not provide a solution to include placeholders in street address fields.

What I want to achieve is setting a different placeholder for each street address field.

My code:

app/code/Jsp/Placeholder/etc/module.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="Jsp_Placeholder" setup_version="2.0.0" />
</config>

app/code/Jsp/Placeholder/registration.php :

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
  \Magento\Framework\Component\ComponentRegistrar::MODULE,
  'Jsp_Placeholder',
  __DIR__
);

app/code/Jsp/Placeholder/etc/di.xml :

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="Magento\Checkout\Block\Checkout\AttributeMerger">
    <plugin name="shippingAddress" type="Jsp\Placeholder\Plugin\Checkout\Block\Checkout\AttributeMerger\Plugin"/>
  </type>
</config>

app/code/Jsp/Placeholder/Plugin/Checkout/Block/Checkout/AttributeMerger/Plugin.php :

<?php
namespace Jsp\Placeholder\Plugin\Checkout\Block\Checkout\AttributeMerger;
class Plugin {
  public function afterMerge(\Magento\Checkout\Block\Checkout\AttributeMerger $subject, $result)
  {
    if (array_key_exists('street', $result)) {
      $result['street']['children'][0]['placeholder'] = __('Calle y número exterior');
      $result['street']['children'][1]['placeholder'] = __('Interior / Edificio / Depto.');
      $result['street']['children'][2]['placeholder'] = __('Colonia');
    }
    return $result;
  }
}


texts: Can anyone help in removing trailing slash in magento 2?

texts:
I have added a module and requested with URL. Google is automatically adding a trailing slash to the URL. Can anyone help me resolve this in magento 2?

Should I remove this or make it work in magento 2?


texts: Magento 2.2.5 - Admin Panel has 503 Service Unavailable page under Content. Changes made to it are not reflected

texts: Magento 2.2.5 - Admin Panel has 503 Service Unavailable page under Content=>Pages. I updated this page but the changes are not reflected. Is Magento using this page or not?


texts: How to get a form value in order process?

texts:
I have created a new small module to add a checkbox on last step of order process:

The value will transfer over payment JSON:

In the generated PaymentExtensionInterface I have the getter and setter methods:

<?php
namespace Magento\Quote\Api\Data;

/**
 * ExtensionInterface class for @see \Magento\Quote\Api\Data\PaymentInterface
 */
interface PaymentExtensionInterface extends \Magento\Framework\Api\ExtensionAttributesInterface
{
    /**
     * @return boolean|null
     */
    public function getTestCheckboxValue();

    /**
     * @param boolean $testCheckboxValue
     * @return $this
     */
    public function setTestCheckboxValue($testCheckboxValue);

But the question is how can I get the value in the event "sales_order_save_commit_after" in an other module like this class?

<?php

use Magento\Sales\Api\Data\OrderInterface;
use Magento\Payment\Observer\AbstractDataAssignObserver;
use Magento\Quote\Api\Data\PaymentInterface;
use Magento\Payment\Model\InfoInterface;

class Test extends AbstractObserver
{
    protected $_request;

    public function __construct(
        \Magento\Framework\App\RequestInterface $request
    ) {
        $this->_request = $request;
    }

    protected function _execute(\Magento\Framework\Event\Observer $observer) {

        $order = $observer->getData('order');


texts: How to Remove Shipping Title Brackets () in cart summary in magento 2

texts: how can i remove that shipping title () in magento 2


texts: Magento2 add a custom javascript file to admin pages

texts:
How can we add a custom script to administration pages in Magento2?

How to load custom module js file in magento 2?
Seems to work well for the frontend pages.

Is it possible to do the same for admin pages?

Thanks!


texts: Is it safe to change max_execution_time?

texts: Is it safe to change max_execution_time to something like 300? Why magento 2 need this gigantic max_execution_time (18000 = 5 hours) first place?


texts: Checkout Gone after Moving Magento files

texts: I moved my magento store from silversalesusa.com/magento to the root directory silversalesusa.com  Got all the base URLs and main .htaccess file changed. When I add a product to the cart and click checkout, the checkout screen is not displaying. Any ideas? Thanks!


texts: To set a payment method for a shopping cart using soap Api in Android

texts:
I am getting an error such

  SoapFault - faultcode: '1071' faultstring: 'Payment method data is empty.' faultactor: 'null' detail: null

Please could   anyone  help me

   SoapObject customerEntity1 = new SoapObject(NAMESPACE,"shoppingCartPaymentMethodEntity");
       // customerEntity1.addProperty("po_number","null");
        customerEntity1.addProperty("method","paypal_standard");
       // customerEntity1.addProperty("cc_cid","null");
       //customerEntity1.addProperty("cc_owner","null");
       //customerEntity1.addProperty("cc_number","null");
       // customerEntity1.addProperty("cc_type","null");

        request = new SoapObject(NAMESPACE, "shoppingCartPaymentMethod");
        request.addProperty("sessionId", sessionId);
        request.addProperty("quoteId", quoteId);
        request.addProperty("paymentMethod", customerEntity1);
        request.addProperty("storeId",0);
        env.setOutputSoapObject(request);

        env.setOutputSoapObject(request);
        androidHttpTransport.call("", env);
        Boolean customerAddressAdded1 = (Boolean) env.getResponse();

        Log.d("shoppingCartPayment", customerAddressAdded1.toString());


texts:
I am currently struggling through my first magento project and it seems to be leaving me with asking more questions than it has answered.

My current hurdle is adding default data to a child table.

I have two tables user and preferences I have created these by adding them directly to the database (for simplicity sake)

My plan is that when a user is added to the user table, then the preferences are all automatically set (for them to edit at a later time).

So far I have learnt how to add data to a table, but i'm struggling with:

As I am using more than one table should I use Magento's EAV way creating tables?
If simply adding two separate tables is acceptable how do I update the preferences table when the user table has been added to?
To keep with best practices where should my code go for adding to a table and extracting from a table (helpers, models etc...)?

WHAT I HAVE TRIED

I added the prefcentreoptions node and table to my config

        <prefcentre_resource>
            <class>Ps_Prefcentre_Model_Resource</class>
            <entities>
                <prefcentre>

prefcentre

                </prefcentre>
                <prefcentreoptions>

prefcentreoptions

                </prefcentreoptions>
            </entities>
        </prefcentre_resource>

I added prefcentreoptions.php to the model folder

I added prefcentreoptions.php to the resource folder

I added a prefcentreoptions folder in the resource folder and added collection.php to that

I then tried to use

$prefs = Mage::getModel('prefcentreoptions/prefcentreoptions');

$prefs->setData('prefcentre_id', 1);

An error was thrown saying

Call to a member function setData() on a non-object

What have I done wrong

EDIT

After changing

$prefs = Mage::getModel('prefcentreoptions/prefcentreoptions');

to

$prefs = Mage::getModel('prefcentre/prefcentreoptions');

the script move onto another error

Fatal error: Call to a member function beginTransaction() on a non-object in /Users/myname/Sites/magentoDevTest/app/code/core/Mage/Core/Model/Abstract.php on line 313

what information have I not provided to the script for it to continue?

(just incase it makes a difference)

The database i am writing to only requires one column to be completed the rest of the information will have default values which will be added


texts: Magento 2.3 Topmenu override declaration error

texts:
Declaration of _getHtml

Should be compatible with Magento\Theme\Block\Html\Topmenu::_getHtml(Magento\Framework\Data\Tree\Node $menuTree, $childrenWrapClass, $limit, array $colBrakes = Array)


texts:
I want to get min and max value of a product attribute(as width of a carpet) from database in order to create a slider range on my layered navigation filter, do you know which table stock those informtaion?
Thank you


texts: modifying the QTY input box function in the cart

texts:
I've managed to remove the QTY box from the Product page but I'm looking to remove all instances of it as my business model is based on only having one of each product

Is it possible to set it in a way that the user can't change the value? I understand that you can limit it in the back end but is it possible to have it fixed and not an input box?


texts: Notice: Array to String Conversion Magento 2.1.14

texts:
<select id="report_sitioweb" name="sitioweb" title="Sitio Web" class=" required-entry _required select multiselect admin__control-multiselect" data-ui-id="uploadattributes-attributes-edit-form-fieldset-element-select-sitioweb" multiple="multiple" aria-required="true">
        <?php
            $stores = $this->getStoreData();
            foreach ($stores as $key => $value) {
                echo '<option value="',$key,'">',$value,'</option>';
            }
            ?>
        </select>

Help me! please!


texts:
I Posted this question on stack overflow, not sure how to move it.

i googled this and couldn't find an answer. I'm trying to link to the product description section in magento, see screenshot below.


texts: Magento bundled product dynamic price missing (after 1.5 to 1.9 upgrade)

texts:
I recently upgraded my magento from 1.5.x to 1.9.x (with all the security patches).

When I went to create a new bundled product, I noticed that the Prices tab looks different from a fresh install of magento 1.9. On the upgraded magento, I do not see the "dynamic" price option, instead I see just a singled field for RRP.

Upgraded Magento

Fresh Magento Install

I initially thought it was due to some module I was using, so I tried disabling local modules and it did not help, I still could not see the "dynamic price" option in bundled product creation screen.

I also tried restoring the orignal "adminhtml" theme/skin and it did not help.

Any idea what might be wrong?

Here is a list of "enabled" modules on my magento: http://pastebin.com/raw.php?i=Vat1En6s


texts: Mageto2 : how to create a cms page and get complete url for the same ?

texts: I want to get the complete url of specific page(CMS). How did we get a custom URL link in Magneto2 suppose CMS page is 'about-us'?


texts: How can I differentiate between product creation and saving existing products?

texts: I want to create an observer that will execute some code when a new product is added. However, it seems that catalog_product_save_before, catalog_product_save_after and catalog_product_save_commit_after will all fire when an existing product is being saved. Is there an event that will fire exclusively for new products or alternatively a way to differentiate between an existing product being saved and a new one being created with the previously mentioned events?


texts: access violation: 1142 SELECT command denied to user 'xxxx_user'@'localhost' for table 'catalog_product_option'

texts:
When I tried to add product from product details page, it showing a popup message

  'Can not add this item to the shopping cart'.

Then when I go to list page it showing a MySQL violation error message.

=> I tried to rename local.xml file and again install a magento with same database.

=> Used database repair tools

=> changed php.ini memory limit values.

=> Update all products and it's attribute

But still facing same issue, Can you please suggest me what exactly happen?

Product detail page link : https://boilerplatecodes.com/laminath/zrich-40805.html


texts:
I'd been testing a Magento site on my server standalone using sendmail, as well as with certain SMTP providers.  What I've found when using Magento standalone is that the emails get a low spam rating from spamassassin, mainly for two reasons:

Emails are sent without a plain text version of the html
STYLE_GIBBERISH, nonsense found in html

I'm not sure how exactly to get past these two issues.  I had found an old post on the Magento forums in Google's cache suggesting that Magento was aware of the plain text issue with email sends, but I couldn't find any information on if it was ever addressed or how to actually get past the issue.  I'm also not sure what's causing the STYLE_GIBBERISH flag to get thrown for the html (when I send emails through SMTP providers like Google Apps or Mandrill, that error doesn't get thrown).

For clarification, my MTA is sendmail, the webserver is Apache, running on an Amazon Linux instance (which is basically CentOS).

Any help or thoughts on addressing the problem would be greatly appreciated, thanks very much!


texts: Magento 2.1.6 Cannot show more than 1000 products in frontend category pages

texts: I have a category with more than 10k products But in front-end shows only 999 products in category page.


texts: Magento 2 - Store wise description very hard to manage

texts:
I have 1000s of products and there are 3 different stores.

Product descriptions are stored on store level. So everytime I need to update any description I have to update it on all store levels.

Is there any other way of update description that when I update on one store it will update on all other stores too?

Thanks


texts: Tax Amount Mismatch on Reorder From Admin

texts:
I am working in Magento 1.14
I found an bug
When using the 'reorder' feature within magento admin, tax is calculated differently.
The  original order has 10.25% tax and reorder has 6.25% tax. Tax should always match original order.

How it's working behind the screen ?
Where to check the tax
calculation for this ?

Any thoughts ?


texts: How to assign simple product images to configurable product in magento 1

texts:
I made this code for assigning simple product detail to configurable product but in this code, I can not set the image so please help me on that

<?php
require_once('app/Mage.php');
umask(0);
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$_productCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('type_id', array('eq' => 'simple'))
    ->addAttributeToFilter('status', array('eq' => 1));
foreach ($_productCollection as $_product)
{
    $id = $_product->getId();
    $simpleProduct = Mage::getModel('catalog/product')->load($id);
    $configProduct = Mage::getModel('catalog/product');
    $configProduct
    ->setWebsiteIds($simpleProduct->getWebsiteIds())
    ->setAttributeSetId(4)
    ->setTypeId('configurable')
    ->setSku(str_replace(" ","",$simpleProduct->getSku()."_new"))
    ->setName($simpleProduct->getName())
    ->setWeight($simpleProduct->getWeight())
    ->setStatus(1)
    ->setTaxClassId($simpleProduct->getTaxClassId())
    ->setVisibility($simpleProduct->getVisibility())
    ->setPrice($simpleProduct->getPrice())
    ->setCost($simpleProduct->getCost())
    ->setSpecialPrice($simpleProduct->getSpecialPrice())
    ->setSpecialFromDate($simpleProduct->getSpecialFromDate())
    ->setSpecialToDate($simpleProduct->getSpecialToDate())
    ->setDescription($simpleProduct->getDescription())
    ->setShortDescription($simpleProduct->getShortDescription())
    ->setMediaGallery($simpleProduct->getMediaGallery())
    // ->setImage($simpleProduct->getImage())
    // ->setSmallImage($simpleProduct->getSmallImage())
    // ->setThumbnail($simpleProduct->getThumbnail())
    ->setStockData(array(
        'use_config_manage_stock' => 0,
        'manage_stock' => 1,
        'is_in_stock' => 1,
        )
    )
    ->setCategoryIds($simpleProduct->getCategoryIds())
    ;
    try
    {
        $configProduct->save();
    }
    catch (Exception $e)
    {
        Mage::log($e->getMessage());
        echo $e->getMessage();
        exit();
    }
}


texts: How to setup Magento 2.x with Asynchronous Messaging using Docker

texts:
We wanted to setup Magento 2.x with Asynchronous Messaging using Docker.
Previously we did the docker setup for Magento 2.x(Synchronous).
We have tried to search for a relative reference for Asynchronous Messaging setup on our Docker VM, but couldn't find anything.
Could you please share some reference which can help us with the setup.
Appreciate your help.
Thanks!


texts: Do not want to see disabled products when creating an order from admin end

texts:
When you click on a customer in "manage customers" and then "create order", my client does not want to see the disabled products come up in the list for products to add to order. Any idea how I would go about changing this? Or at least some file location hints, lol.

I'm editing the following per below advice.

 protected function _prepareCollection()
    {
        $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
        /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
        $collection = Mage::getModel('catalog/product')->getCollection();
        $collection
            ->setStore($this->getStore())
            ->addAttributeToSelect($attributes)
            ->addAttributeToSelect('sku')
            ->addStoreFilter()
            ->addAttributeToFilter('type_id', array_keys(
                Mage::getConfig()->getNode('adminhtml/sales/order/create/available_product_types')->asArray()
            ))
            ->addAttributeToSelect('gift_message_available');
            ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
        Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collection);

        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

As you can see I added ->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); but am getting following error:

  Parse error: syntax error, unexpected T_OBJECT_OPERATOR in
  /home/ab71714/public_html/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php
  on line 109


texts: Magento 2 Thumbnails missing in store view (language)

texts: I'm using Magento 2.3.1. We have 3 store views for multi language. One store view (German language) doesn't display category thumbnails correctly. The other do not have any problems. We tried reindexing, rebuild static content, clear cache. On the product pages the images are OK, the problem is only on the category pages. Any ideas?


texts:
I just installed Magento 2.1.14 (fresh install) and the admin backend works fine, but the storefront gives an error, when looking into the error report, I get the following error message:

  Class Magento\Persistent\Model\Persistent\ConfigFactory does not exist

I tried looking this up, but found no real solution. Also the installation tutorial gives no help.


texts: Magento 1.9: How to sort product list by alphabetically A ,B, C,D ... to Z

texts:
How to sort product by alphabetically in product list page in magento 1.9

I want to display sorting like below image