texts: Coupon code discount prirority issue in magento 2

texts:
I create 2 coupon codes :
 coupontest1 which  have the discount 50$ and priority 0, and coupontest2 which  have the discount 40$ and the priority 10.

Now if a apply the first coupon code with priority 0 and then apply the second one with priority10, the second one override my coupontest1,which have priority 0 and bigger discount.

With the default Magento core, this it's possible? or it's a bug in my project?

And if  the answer it's no, how can set this? to keep the bigger discount with higher priority and the low priority not override the first one?


texts: Magento2 prevent reindex after adding product programmatically

texts:
I have made a module that adds a grouped product to the catalog. After adding some products I always have to reindex to see the changes. If I add a product via the Admin, this does not seem to be necessary.

Is there a way to only update the indexes for the added product instead of having to update all product indexes?

I have pasted the code I use to add a product below:

$product = $this->objectManager->create('\Magento\Catalog\Model\Product');
$product->setSku($iceProduct['sku']) // Set your sku here
    ->setName($iceProduct['title']); // Name of Product
    ->setDescription($iceProduct['descr_long']); // Name of Product
 //enz...
    ->save();


texts: Magento Sesson not showing message on product page

texts:
Using Wyomind Estimated Delivery Date

When I try to add too many qty then what is available for purchase it goes through and adds my message.

  if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) {
        $_product = Mage::getModel('catalog/product')->load($this->getProductId());
        $stock_item = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
        //$message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName());
        $message = Mage::helper('cataloginventory')->__('Sorry, only (%s) of item "%s" is available. Please select a new qty.', number_format($stock_item->getQty(),0),$this->getProductName());
        $result->setHasError(true)
            ->setMessage($message)
            ->setQuoteMessage($message)
            ->setQuoteMessageIndex('qty');
        return $result;
    } else {

On my local environment this bounces back on the product page and shows my error.   On my server, it bounces back and shows no message, but if I go to any other page then I see the message.

if I add

 Mage::getSingleton('core/session')->addError($message);

before the return it will show the message twice on my product page locally and once on the server.

What causes this?


texts: Checkout cart products disables randomly

texts:
I have created a website using Magento 2.2.3.

I'm facing issues with adding product to the cart.

The issue is,
I can add the product to the cart and able to checkout. But, If i want to add some other products to the cart page, the old product which i added before in the cart is disabling. I suspect that this problem happens because of cache. I'm not sure what i have missed because the console didn't show any error.

Please share your ideas to resolve this issue.


texts: Please help me to show selected image at invoice pdf same as logo

texts: I have created text fields and show their text at invoice and it's working fine. Now i want to show chosen picture also, but it is not working.


texts: Magento 2 Cart and Search Shifts in Safari when Mini Cart Expanded

texts:
Using the default Luma theme the search and cart icon shift over to the left when the mini cart is expanded when using Safari on Ipads and Macbooks.

I have been trying various CSS to fix however typing anything within inspect element in Safari seems to fix issue making it difficult to debug. So far however setting the width of .minicart-wrapper to 52px seems to fix however still doesn't look perfect.

This looks a bit messy and i was hoping someone has also experienced this and found a fix?


texts: Namespace for Exception class is not specified Magento 2

texts:
I show this error in marketplace review

  Namespace for Exception class is not specified.

Here is my code:

public function uploadFile($scope)
{
   try {
        $uploader = $this->_fileUploaderFactory->create(['fileId' => $scope]);
        $uploader->setAllowRenameFiles(true);
        $uploader->setFilesDispersion(true);
        $uploader->setAllowCreateFolders(true);

        if ($uploader->save($this->getBaseDir())) {
            return $uploader->getUploadedFileName();
        }

    } catch (Exception $e) {
        throw new $e('The file was not uploaded.', $code);
    }
    return '';
}

What is wrong with this?


texts: Remove existing WHERE clauses from $collection->getSelect()

texts:
I am trying to modify the Lifetime Sales figure on the admin landing page to include pending_payment orders. I have set up a module as follows:

class Steamdesk_Dashboard_Block_Dashboard_Sales extends Mage_Adminhtml_Block_Dashboard_Sales

And I have the following to set a suitable WHERE clause in the SQL for the collection:

$collection->getSelect()->where('main_table.state NOT IN (?)', array(
        Mage_Sales_Model_Order::STATE_CLOSED,
        Mage_Sales_Model_Order::STATE_CANCELED
    )
);

However there are already two elements in the WHERE clause array which will cause the above to be ignored, which I can see if I check $collection->getSelect() as follows:

[where] => Array
(
    [0] => (main_table.status NOT IN('canceled'))
    [1] => AND (main_table.state NOT IN('new', 'pending_payment'))
)

I know all this code is being run, but my question is how can I clear the existing attributes in the collection's generated SQL query?


texts: Magento 2 flushing cache from admin gives error

texts:
When I am trying to clear / flush the cache from admin it generates the following error

Please note, I tried the same setup in my localhost and there is no such error. Have anyone faced the similar issue before?
Magento verison : 2.3.1
php version 7.1
please note php version is same on server as well as localhost.


texts: How to call product custom attributes in custom .phtml file

texts:
I'm would like to call a products custom attributes in my own .phtml file, but having some issues with it. Any help is greatly appreciated.

I have the following code in my template/catalog/product/view.phtml file:

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('customstuff/deliveries_returns.phtml')->toHtml(); ?>

Which calls my own custom .phtml file in template/customstuff/deliveries_returns.phtml

In that .phtml file I have this code:

Delivery Times: <?php echo $_product->getshipping_times() ?>
Delivery Costs: <?php echo $_product->getdelivery_costs() ?>

I have set up custom attributes already with the attribute codes shipping_times and delivery_costs

On the front-end of my website i get the following error message: Production time:
Fatal error: Call to a member function getshipping_times() on a non-object in /home/cuffandc/public_html/app/design/frontend/mytheme/default/template/customstuff/deliveries_returns.phtml on line 11

Any help is greatly appreciated!


texts: What is a good method to handle suspected fraudulent transactions with Authorize.net?

texts:
I have a client who has, in the past, used the Saved CC payment method on their store (despite attempts to persuade otherwise) for the single purpose of having convenient access to their CC data in the case that they suspect an order may be fraudulent.

They would check each order manually, and for orders from international customers (or other apparent red-flags) they would submit an additional transaction on their CC for a small arbitrary amount ($0.50 - $2.00, say).

For very obvious reasons, this is not a recommended solution to handle these suspected fraudulent transactions.

The best I can see how this should work would end up being quite expensive for the client (for a seemingly boring "feature").

Have client sign up with Authorize.net CIM
Install Authorize.net CIM payment gateway module in Magento
Develop a custom module to allow the client to submit these fraud detecting transactions for a small amount.
Assume that the customer will opt to have their CC info saved during checkout so that CIM is available for subsequent transactions with additional communication with the client.

This seems like a fairly tall order. As it stands, I can only assume that the client will opt to continue using the Saved CC payment method since it meets his needs (though obviously introduces other security issues).

Can anyone suggest an alternative way to handle transactions such as this while at the same time minimizing the need for additional communication with the store's customer? To me, this sounds like a big can of worms.


texts: Magento 2.2 - Problem with Helper class not found in custom module

texts:
I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system.xml settings options were working correctly and all configurations can be changes in admin.

One of the system.xml fields has a custom source model, where I used the module's helper and everything was ok.

So for now I created a repository in github, and put the module so that I could use the composer (and remove it from the app/code folder). I did this by thinking of leaving the module in a way that can be replicated in other stores, so with better distribution way.

However after installing with composer (and after did all upgrade and compile di things on shell), when accessing the configuration section in the admin panel I always get the error below.

Fatal error: Uncaught Error: Class 'Vendorname\Payment\Helper\Data' not found in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Vendorname\\Payment\\...', Array)
#1 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Vendorname\\Payment\\...')
#2 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Vendorname\\Payment\\...')
#3 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('Vendorname\\Payment\\...')
#4 /Users/username/sites/vendornamem2/vendor/magento/module-config/Model/Config/SourceFactory.php(37): Magento\Fr in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

Apparently the helper is not being found in my custom field class. They follow the source model of the field in question (Mode).

<?php
namespace Vendorname\Payment\Model\Source;

class Mode implements \Magento\Framework\Option\ArrayInterface
{
    /**
    * @var \Vendorname\Payment\Helper\Data
    */
    protected $_paymentHelper;

    /**
    * Mode constructor.
    *
    * @param \Vendorname\Payment\Helper\Data $paymentHelper
    */
    public function __construct(
        \Vendorname\Payment\Helper\Data $paymentHelper
    ) {
        $this->_paymentHelper = $paymentHelper;
    }

    public function toOptionArray()
    {
        /** @var \Vendorname\Payment\Helper\Data $VendornameHelper */
        $VendornameHelper = $this->_paymentHelper;
        return [
            ['value' => $VendornameHelper::ONPAGE_MODE, 'label' => 'On Page'],
            ['value' => $VendornameHelper::IFRAME_MODE, 'label' => 'Iframe'],
            ['value' => $VendornameHelper::REDIRECT_MODE, 'label' => 'Redirect']
        ];
    }
}

The error came after simply by migrating the code from the app/code folder to the composer. Not even one character was modified in the process. Is there any helper mapping that needs to be done?


texts: Magento 2 Admin Config - Add dynamic Image field programmatically - Setoptions

texts:
I am trying to add a dynamic image field to my admin configuration tab, so far I have the field appearing but I can't save and or preview an uploaded image.

I can get this working fine with the static option from the system.xml using

<field id="imageupload" type="image" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
    <label>upload</label>
    <backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
    <upload_dir config="system/filesystem/media" scope_info="1">catalog/product/placeholder</upload_dir>
    <base_url type="media" scope_info="1">catalog/product/placeholder</base_url>
</field>

However, I'm missing something when trying to replicate this in PHP, here is what I have so far

[
  'id' => 'allergen' . $option->getValue(),
  'type' => 'image',
  'sortOrder' => ($index * 10),
  'showInDefault' => '1',
  'showInWebsite' => '0',
  'showInStore' => '0',
  'label' => 'Image for ' . $option->getLabel(),
  'backend_model' => 'Magento\Config\Model\Config\Backend\Image',
  'base_url' => ['value' => 'catalog/product/images', 'type'=>"media", 'scope_info'=>"1"],
  'upload_dir' => ['value'=> 'catalog/product/images', 'config'=> "system/filesystem/media", 'scope_info'=>"1"],
  '_elementType' => 'field',
  'path' => '<sectionId>/<groupid>'
]

The image appears to be saving via the default backend model as text and not respecting the input image value


texts: Install of Magento2 fails [ERROR] exception 'Exception' with message 'Warning: mkdir(): File ex

texts:
following error when installing Magento2. Can anyone offer any advice? New to Magento. Installing on CentOS box locally.

    [ERROR] exception 'Exception' with message 'Warning: mkdir(): File exists in /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php on line 219' in /var/www/mydomain.com/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'mkdir(): File e...', '/var/www/mydoma...', 219, Array)
#1 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php(219): mkdir('/var/www/mydoma...', 504)
#2 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php(198): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('/var/www/mydoma...', 504)
#3 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(88): Magento\Framework\Filesystem\Driver\File->createDirectory('/var/www/mydoma...', 504)
#4 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(247): Magento\Framework\Filesystem\Directory\Write->create('.')
#5 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(264): Magento\Framework\Filesystem\Directory\Write->openFile('install.log', 'a+')
#6 /var/www/mydomain.com/setup/src/Magento/Setup/Model/WebLogger.php(114): Magento\Framework\Filesystem\Directory\Write->writeFile('install.log', '#8 /var/www/mydomain.com/setup/src/Magento/Setup/Model/Installer.php(327): Magento\Setup\Model\WebLogger->log('Starting Magent...')
#9 /var/www/mydomain.com/setup/src/Magento/Setup/Controller/Install.php(97): Magento\Setup\Model\Installer->install(Array)
#10 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#11 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#13 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#16 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#17 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#18 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#20 /var/www/mydomain.com/setup/index.php(31): Zend\Mvc\Application->run()
#21 {main}


texts: Add products to shopping card that doesn't exist in magento database...via 3rd Party

texts:
We have a third party software to configure single products to one final product. The final product should be bought via magento. We don't want to import each single product into Magento and the final product is different with each customization.

Is it generally possible to add the final product with descriptions to the magento shopping cart, checkout and save this as an order without having the concrete product in the database?

Example: Create a dummy product in Magento, with the Number: 10001, but the price and the description is saved within each order.

In the Database:

  100001 - Customized Dummy Product - No Price - No Description

In the Order:

Order 1

  Number: 100001 - Name: My Product - Price: $99,00 - Description: Single Product 1, Single Product 2

Order 2

  Number: 100001 - Name: My Product 2 - Price: $199,00 - Description: Single Product 2, Single Product 5


texts:
According to gtmetrix.com, I need to specify image dimensions on /media/catalog/product/cache/1/thumbnail/300x300/......

I know what I need to do; in that I need to add 'width="300" height="300" but I can't find where I need to add this to? I tried app/design/frontend/THEME/template/catalog/product/view.phtml but no luck.

Any ideas?


texts: How to increase character limit of text field in Magento 2?

texts:
I have one attribute named "Features". Values for this attribute are coming from Lightspeed pos and input type for this attribute is a text field. Light speed doesn't provide a text area for this attribute.

I want to increase the character limit for this field in the admin. Right now the limit is 255 chars. So, how can I increase this limit?


texts: What does $quote->getIsSuperMode() mean in magento?

texts:
I see a function isSuperMode() which is called on quote and quote item objects.
Can anyone tell me what isSuperMode() means in that case?

I found the code in:

checkQuoteItemQty function at class Mage_CatalogInventory_Model_Observer
Also in _initItem function at class Mage_Sales_Model_Quote_Address_Total_Subtotal


texts:
magento connection host use beter perform 127.0.0.1 or localhost?

<connection>
  <host><![CDATA[127.0.0.1]]></host>
...


texts:
In my magento project, I have a requirement where I need to change the user entered query text to something else based on some calculations.

For example, if the user has entered "ABC" in the Global search text field, then

I need to change it to "XYZ" and show the results related to the modified query text i.e "XYZ".
and also the popular terms which are being generated based on the query text should not get modified by the new query text.

User entered text      product collection results      Popular terms/suggestions
=================      ==========================      =========================
ABC                    XYZ                             ABC

I tried to achieve the above by doing many things but didn't get success. One of my attempts is overriding prepare() function in Mage_Catalogsearch_Model_Query Class.

public function prepare()
{
    Mage::log("I am in overriden prepare function");
    if($this->getQueryText() == "ABC"){
        $this->setQueryText("XYZ");
    }
    Mage::log($this->getQueryText());
    if (!$this->getId()) {
        $this->setIsActive(0);
        $this->setIsProcessed(0);
        $this->save();
        $this->setIsActive(1);
    }
    return $this;
}

In the above function, though I am able to change the query text by using setQueryText,  I am getting the result product collection based on the user entered query text instead of modified query text.

PS: the above function is just an example of how I am trying to achieve it.

EDIT:

I actually need to do some calculations based on the passed query string. To be precise, I need to look for a colon : in the query string and if there is colon then split the string. After splitting, pass the second part of the string as query string, if and only if the first part of the string is a "category name" or "show" or "some other valid strings choosed by me".


texts: Magento 2.3.1 Get Allowed Countries by storeview

texts:
It seems in Magento 2, we can only configure Allowed Countries per WEBSITE or STORE. but not STOREVIEWS.

I found this solution https://magento.stackexchange.com/a/245401/26668, where we can add Allowed Countries to STOREVIEW directly to the table core_config_data

The problem is, it doesn't seem that I can get the Allowed Countries programmatically.
I have tried following,
use Magento\Directory\Model\AllowedCountries;

public function __construct(
    AllowedCountries $allowedCountries
)
{
    $this->allowedCountries = $allowedCountries;
}

 $allowedCountries = $this->allowedCountries->getAllowedCountries("default",0);

Which works fine, and it returns allowed countries for default website to me.
but if I want to get allowed countries of a specific storeview that has store ID 12, for example,
$allowedCountries = $this->allowedCountries->getAllowedCountries("stores",12);

it gives me an error.
"Warning: Invalid argument supplied for foreach() in /home/websites/public/vendor/magento/module-directory/Model/AllowedCountries.php on line 66"

Any ideas on how to get allowed countries by store view?


texts:
I’m having a strange issue when it comes to new customer registration. After filling out the sign up form I get a “Cannot save the customer.” error - however the account is created successfully and the record is stored in Magento.

I think this issue start when i changed welcome email. but i replaced welcome email with original one. but still this issue is not fixed.

Welcome email is not receiving to customer

I’ve scoured the forums and all I can find is that people have similar issues with Mailchimp but I’m not using that extension.

Has anyone got the solution ? Please help.


texts: How to add a new div below search bar in the header by creating new module? Magento 2.1.5

texts:
I need to add a new div at the bottom of the header. I am using magento 2.1.5.

I want to do this by creating a new module. I checked lots of tutorials. I am able to add a div to the top of the header but not in the bottom. Here is my code:

view/frontend/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="header.container">
        <container name="header.containertwo" as="header_containertwo" label="Page Header Container"  htmlTag="header" htmlClass="header-mini-container" after="header.panel.wrapper"/>
    </referenceContainer>
    <referenceContainer name="header.containertwo">
        <block class="Magento\Framework\View\Element\Template" name="header.mini.container" template="Header_CustomDiv::test.phtml" after="header.panel.wrapper"/>
    </referenceContainer>
</page>

view/frontend/template/test.phtml

Text Here

The above code adds a div to the top of the header, however I want it at the bottom as in image.

Here is the header html code:

            Toggle Nav

            Logo here

Search

                Search form  here

        .
        .
        .
        .
        .

                Sign In

Create an Account

                My Cart

After adding the move tag as mentioned by Dinesh Yadav  :

<move element="header.mini.container" destination="header.panel.wrapper" after="-" />


texts:
According to the official doc, there is a gift card feature available in Magento 2.3
But when I go through the Admin Panel (catalog->products), There is no product created as a gift card as mentioned in Step 1 (https://docs.magento.com/m2/ee/user_guide/catalog/product-gift-card-create.html).

Still, I am confused so, I had to google Many blogs out of which some say it was there in an earlier version & some say still there in version 2.3. Also, I have checked the official doc which link is mentioned above. Can someone help me out to sort my confusion? Also, If it is not by default then anyone can recommend good plugin(Free/paid) for the same.

Thanks


texts: M2 Product import problems using multiple images per product

texts:
I am trying to import a csv file. But there is one error I do not understand and I do not know how to get over it.
The error message is the follwing:

  Product Type is invalid or not supported in row(s): 2,.... (many more rows are affected but all are built the same way)

The affected fields in the csv look like this:

Is this the wrong approach in M2? Should I use the additional_images field instead?


texts: Permanently delete phishing tools in Magento

texts:
My site was affected by guruincsite. I installed a backup, updated to the latest version of Magento and updated with all security packages. Also, I checked that nothing is referred to these tools or database files.

Google Safe Browsing the site has put me back as "not dangerous" but it still appears in the poster Google Chrome on dangerous place. As I read, I like McAfee continues to detect high-risk site. I hope you can guide me and help me because most do not.

The domain is as follows http://goo.gl/dSdniv


texts: How to secure a product URL in config.xml?

texts:
Lets say, I have a product, its URL is: http://www.whatever.com/my-url-key. How can I secure it? I tried:

<secure_url>
    <product>/my-url-key</product>
</secure_url>

This did not work.

Thanks!


texts: How can i execute an Observer after a controller Action?

texts: I need to execute my observer just after an actionController end or when paymentMethod is saved on database.


texts: How to Sort Product collection by Price?

texts:
I want to get the max price of all products using product collection.
I tried the below but it didn't work

$collection = $this->_productFactory->create()
            ->getCollection()
            ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('status', 1)
            ->setOrder('price', 'ASC')
            ->addAttributeToFilter('visibility', 4)
            ->getFirstItem();

        print_r($collection->getPrice());

How to get max price and min price of products from product collection in magento 2?


texts: Configuring Magento 2.3 MSI (Multi Source Inventory) with Multiple Stocks

texts:
I am trying to configure Magento MSI with Multiple Stock for a single Sales Channel but it only allows me to assign single stock to a sales channel. Based on Magento's documentation, this is how it is expected to work. Is there a way I can modify this behavior to have multiple stocks assigned to a single sales channel?
https://docs.magento.com/user-guide/catalog/inventory-stock.html
Below is my scenario. I have three Vendors and each has its own warehouse. At a time, it only allows assigning Sales Channel to just one stock which is below screenshot is Vendor 1.

Thanks for your help!


texts:
Everything used to be working fine. Lately, whenever I try to login to the admin panel, I am getting this error. I tried to google it but couldn't find anything that could help me resolve the issue. I tried this Stack Overflow link, The output of the test script was:

array(1) {
 [0] => object(Mage_Core_Model_Config_Element)#93 (0) {
 }
}

Again I didn't know what it meant. However when I refresh the admin panel link after this error is thrown, it takes me to the admin panel. What went wrong here?

Warning: get_class() expects parameter 1 to be object, boolean given
in mywebsite/app/code/core/Mage/Core/Model/App.php on line 1359

->0 [internal function]: mageCoreErrorHandler(2, 'get_class() exp...', '/chroot/home/sh...', 1359, Array)
->1 mywebsite/app/code/core/Mage/Core/Model/App.php(1359): get_class(false)
->2 mywebsite/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(false, 'check', Object(Varien_Event_Observer))
->3 mywebsite/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('admin_session_u...', Array)
->4 mywebsite/app/code/core/Mage/Admin/Model/Session.php(132): Mage::dispatchEvent('admin_session_u...', Array)
->5 mywebsite/app/code/core/Mage/Admin/Model/Observer.php(73): Mage_Admin_Model_Session->login('admin', 'password', Object(Mage_Core_Controller_Request_Http))
->6 mywebsite/app/code/core/Mage/Core/Model/App.php(1357): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
->7 mywebsite/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
->8 mywebsite/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
->9 mywebsite/app/code/core/Mage/Core/Controller/Varien/Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
->10 mywebsite/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
->11 mywebsite/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
->12 mywebsite/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
->13 mywebsite/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
->14 mywebsite/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
->15 mywebsite/app/Mage.php(684): Mage_Core_Model_App->run(Array)
->16 mywebsite/index.php(83): Mage::run('', 'store')
->17 {main}


texts:
I need to get product attributes for product items in Order. How can I do this?
I got order details per one order from below line of code and I used loop to cycle through every order.

$orderObj = $objectManager->create('Magento\Sales\Model\Order')->load($orderID);

I need to get certain attribute value from each item in the order. I tried getAllvisibleitems as follows,

$items =$orderObj->getAllVisibleItems();

but it doesn't include data for the attributes. For example I need to get value from attribute manufacturer,

How can I get manufacturer of each item in the order?


texts: Where in the code is validation being requested for customAttributes when placing order

texts:
Setup:  Customer has an account and is logged in, but there are no default billing and shipping addresses assigned.  A custom attribute has been added and isrequired when defining in setup module. The Customer is presented with an address form.  This form presents and validates the custom attribute. Customer clicks next, place order screen appears showing address form with all fields, including custom attribute.  Customer clicks place order, error appears stating  naming the custom attribute and informing that it is a required field.
The error is created in the magento eav/model within the validateValue function of text.php Ive tried to trace starting from  the Magento_Checkout js/model and action place.order modules and ending in the service urls pointing to fuction getPaymentInformation in checkout/model/PaymentInformationManagement.php but cant seem to find the line of code that is responsible for requesting this validation.  The attribute is validated upon entry in all the address forms, so I dont really need it to be validated at place order.  This custom attribute works fine in other cases such as guest user, or logged in user that has entered default addresses.  Its just this one case.  It seems to be a Magento problem, during my troubleshooting I have been able to print out the class and my coustom attribute with its values are present.
I would like this line of code where I can just ignore the validation in this particular case.


texts: How to display configurable product swatches when product is Out of stock

texts:
I have a configurable products with few sizes, let's say : 123, 160, M, S, L, XL

When I put products M and S on qty 0, which means it is out of stock, then sizes disappear form the swatches option.

I was expected to see also out of stock products with a special class and to be non clickable, but  out of stock products disappear.

I found a solution and I will post my answer. Maybe that will help someone.


texts: Add arguments to block via layout update

texts:
In the catalog_product_view.xml ofthe Magento_Catalog module there's this block
<block class="Magento\Catalog\Pricing\Render" name="product.price.final">
    <arguments>
        <argument name="price_render" xsi:type="string">product.price.render.default</argument>
        <argument name="price_type_code" xsi:type="string">final_price</argument>
        <argument name="zone" xsi:type="string">item_view</argument>
    </arguments>
</block>

I have a catalog_product_view.xml in my own theme's layout folder, which is adding some additional blocks and moving or removing some others.
Now what I need to do is to add more arguments to the price block, but without changing anything else. So no moving, now changing of the original arguments etc.
Just adding for example:
<argument name="some_param" xsi:type="boolean">true</argument>
<argument name="another_param" xsi:type="boolean">false</argument>

How do I do that? What do I need to put in my layout file.


texts: How to copy my Related Products to Upsell Products

texts:
i- need to change relaeted products in upsell products .
any suggestion how to do fast ?
our shop have more than 35k products
now we have create related products but we need to change in upsell


texts: Magento 2 Error while saving product with customizable options when more than 2 options

texts:
I am facing below error:

Recoverable Error: Object of class Magento\Catalog\Model\Product\Option could not be converted to string in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3102

While creating product with configurable option, I saved it, but after that when I edit product and resave it, it shows above mentioned error.

  Magento Version: 2.3.1

Please help me..!!


texts:
FPC is activated on the site. When I switch the store view on the Home page the Category page changes the language but the switcher remains unchanged.
The store code is added to the cookie correctly.
If you go to the Login page, the switcher changes its status, but when you go back to the Homepage, the status changes to incorrect
How do I resolve this bug?

I really need help with this.
Magento 2.3.2
It is possible to buy modules if required


texts:
After Magento2.2.6 Installation,getting this error. Even assign 777 permission.

  1 exception(s):
  Exception #0 (Magento\Framework\Exception\FileSystemException): The path "frontend/Magento/luma/en_US/requirejs-config.js:///home/vnsmenco/public_html/pub/static/" is not writable


texts: Magento 2 How to duplicate Categories with Assigning all products and children categories

texts:
I am looking for a solution to duplicate category including all settings, products and all children categories.

I have researched on the forum and found some extensions which are paid.

https://marketplace.magento.com/mageside-module-duplicatecategory.html

Can anybody help to achieve this by programmatically or suggest for a free module?


texts:
I have a Sales Rep module with 2 levels

Sales rep
Manager

The commission is calculated from margin as %
cost-sales price
I need to add one more level Team Manager and also need to give him a commission of percentage as of other levels
Can you help do it?


texts: How to change custom image on change of configurable product option change

texts:
I need change custom images (not product image) change on change of configurable product option change.

For that, I will create new product image attribute and assign those images to this newly created attribute. On product detail, I can load that image from that newly created attribute code.

Now when configurable product option changes, I want to change those images also. By default only product image changes in the gallery section.

If anyone knows how to do this then please let me know.

Detail explanation:

I have a custom requirement as follow.

On the configurable product detail page, I need child product image slider other than which comes in Magento default product slider. This is because website selling sunglass, specs, and frames.

Now on main product slider (default Magento), we are displaying e.g. sunglass. When you change color from the drop-down (configurable product) sunglass image automatically change as per default Magento functionality.

But in the new slider (child product image slider) which I will add, in that slider model image comes with wearing that sunglass. So when the color change from drop-down e.g select Blue color so 2 images will be changed.

sun glass image. The blue sunglass display in product image slider (default Magento functionality)
New slider image. now model image display with wearing blue sunglass.

For the new slider, I will upload the appropriate image in child product with custom attribute (Media type attribute) so I can display in the new slider.

But I do not know how to change that image when change option.
I hope now you understand what I am trying to say and why I need. Still, you have any question then please let me know.

************************** Display extra image code *******************

<?php
$_product = $block->getProduct();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_children = $_product->getTypeInstance()->getUsedProducts($_product);

foreach ($_children as $child)
{

    $_product12 = $objectManager->create('Magento\Catalog\Model\Product')->load($child->getID());
    $attrImage = $_product12->getData('test');   // "test" is my custom attribute
    if(isset($attrImage) && $attrImage != '' )
    {
        $productImageAttr = $_product12->getCustomAttribute( 'test' );
        $productImage = $this->helper('Magento\Catalog\Helper\Image')
        ->init($_product12, 'test')
        ->setImageFile($productImageAttr->getValue());?>
        <img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($_product12->getTitle()) ?>" />
<?php

    }
}
?>


texts: Magento : Wrong price cart exeeding stock 1.9.3.4

texts:
Whenever you try to change quantity from the cart and that quantity is not available in the inventory, unit price is wrong.

Example: I add Product A in the cart (simple product), first time I choose a quantity 1 from product detail page.

After that, I decide to change cart quantity to 3 and press Update button in the cart. In my inventory there are only 2 stock units of Product A.

Magento throw correctly a notice that is not possible to add 3 stock units in the cart for Product A but if you see under the unit price column, its price has been changed.

With a quantity of 2, unit price is 41,50 Euro, with a quantity of 3 unit price become 18,59 Euro. If I change quantity to 4, unit price become 9,37 Euro. So every time quantity is changed, it seems that unit price has been recalculated for some reason.

Is there a logical explanation to this strange behaviour?

Magento installed version: 1.9.3.4


texts: Create product viewable by only specific customer or customer group

texts:
I want to add a product that can be viewed only by a specific customer or group of customers via Rest API

Can anyone tell me how can I achieve this?

Any help would be appreciated.

Thanks in advance..!


texts:
I'm working with magento 1.9.2.4 on my local computer, I'm using XAMPP.

Everything is running fine on the front end and on the backend, the only problem that I'm having is that when I'm using magento connect manager (mysite.com/downloader) the url is not working properly.

I'm able to access the downloader but when I try to do something the url just loops, like this mysite.com/downloader/?A=settings and if I click something again the url will be like this mysite.com/downloader/?A=settings?A=settings and take me back to home.

It just loops and keep adding the click to the url and never refreshing the page. I did some changes on the .htaccess and nothing seem to be working.


texts:
I am working on Magento 2.2.5, where I put an home page.

The html of the home page is using bootstrap 4, to make it responsive an full width. What works well when seeing that html in isolation.

Now, when the respective html is put in the static home page, using the admin, and I see it in the store home page, then it is not full width.

This given Mangeto set a maximum width for the container of whole home page content, between the navigation bar and the footer.

The question, is... How can I make the home page content full width? without making the whole site full width.  The obvious thought is to find the style of the respective container and make it full width, and conditionally just make it for the home page.... but I just can not find the right file to modify.

I am extending the Theme Magento blank.

Any help, or hint about the right phtml or style to overwrite, will be appreciated!


texts: How to expose a custom field from sales_order table to rest api?

texts:
I have a custom field delivery_type in sales_order table. I am accessing order using rest api but this field is not present in response.

Requested api: http://localhost/default/rest/default/V1/orders/2

As suggested here I have added etc/api2.xml with following content in a custom module but it is not making any difference to order response.

<?xml version="1.0"?>
<config>
    <api2>
        <resources>
            <order>
                <attributes>
                    <delivery_type>Delivery Type</delivery_type>
                </attributes>
            </order>
        </resources>
    </api2>
</config>

Edit: If I add this attribute in extension_attributes.xml and sales_order_load_after event as mentioned here I'm able to get this when I load a single order at rest/default/V1/orders/2 but this attribute is not visible in order collection at /rest/default/V1/orders?<search_criteria_here>


texts: Receive Magento Logo when getting product image

texts:
I am learning Magento and I am trying to create a slider which show products' images. I am ok with the JS slider but I have problem when trying to get product images. I have tried these codes:

<?php
$productModel = Mage::getModel('catalog/product');
$product_1 = $productModel->load(1);
$name = $product_1->getData('name');
$description = $product_1->getData('description');
echo $name . '
';
echo $description . '
';
echo $product_1->getImageUrl();
?>

The product's name and description are ok. But the image URL seems not right: http://hellomagento.dev/media/catalog/product/cache/1/image/265x/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg
It's a Magento logo in gray color.

I have upload image for the product already.

Please help! Thank you!


texts: can not use store.list soap api method in magento 1.5

texts:
i am not able to list stores using soap method 'store.list'. i am using magento 1.5. Any help would be highly appreciated.

Below is my code to retrieve list of stores.

Thanks.

$client = new SoapClient('localhost/api/soap/?wsdl');
$session = $client->login('user', 'password');
$result = $client->call($session, 'store.list');
print_r ($result);

ERROR -

Fatal error: Uncaught SoapFault exception: [3] Invalid api path.
Stack trace:
#0 /var/www/magento15/storeapi.php(11): SoapClient->__call('call', Array)
#1 /var/www/magento15/storeapi.php(11): SoapClient->call('a62836877247bba...', 'store.list')
#2 {main}
  thrown in test.php on line 11


texts: How can i change email template outer background color magento 2.4.1

texts:
I want to change outer background color of email template.So let me know how can i change background color. In which file i can change background color
screen-shot : https://www.screencast.com/t/9F2EakX4RZ
Thanks


texts: How can get invoice pdf using rest api in magento2

texts:
I  setup module of pdf using this link.  https://github.com/netz98/N98_WebapiRestPdf
I use this method for print pdf
url: http://127.0.0.1/jaipur/rest/V1/invoices/6
Method: Get
Using this method received  only invoice detail not pdf file.Please suggest how to get invoice pdf.


texts:
I have read Styles debugging guide for M2 and can't seem to find the correct way to start debugging LESS. I have setup Grunt and browser to show original sources for less. But the original source shows the following path:

pub/static/frontend/vendor/theme/en_EN/css/source/lib/module.less

Instead of

app/design/frontend/vendor/theme/Magento_module/web/css/source/module.less

Did I forget to configure something via Grunt? I have followed the guide step by step.


texts: Magento 1.9: Change currency symbol as superscripted in whole magento site

texts:
I need to change currency symbol as super scripted to price value. I have checked this and this but it changes formats on a particular pages or price instances.

I want to change in throughout my whole frontend site. Currently it shows as

I want to display it as

Please guide.


texts:
I am trying to learn Magento hard and although I have good understandig of OOP and programming ,still struggling.I am following tutorials ,do the same as there and got errors ,which is very dissapointing.I made module ,this is my config.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Foggyline_HappyHour>
            <version>1.0.0.0</version>
        </Foggyline_HappyHour>
    </modules>
    <global>
        <models>
 <foggyline_happyhour>
 <class>Foggyline_HappyHour_Model</class>
 <resourceModel>foggyline_happyhour_resource</resourceModel>
 </foggyline_happyhour>
 <foggyline_happyhour_resource>
 <class>Foggyline_HappyHour_Model_Resource</class>
 <entities>
 <user>

foggyline_happyhour_user

 </user>
 </entities>
 </foggyline_happyhour_resource>
 </models>
 <resources>
 <foggyline_happyhour_setup>
 <setup>
 <model>Foggyline_HappyHour</model>
 </setup>
 </foggyline_happyhour_setup>
 </resources>
    <blocks>
 <foggyline_happyhour>
 <class>Foggyline_HappyHour_Block</class>
 </foggyline_happyhour>
 </blocks>
 </global>
    <frontend>
        <routers>
            <foggyline_happyhour>
                <use>standard</use>
                <args>
                    <module>Foggyline_HappyHour</module>
                    <frontName>happyhour</frontName>
                </args>
            </foggyline_happyhour>
        </routers>
    </frontend>
</config>

In the Model folder I have first User.php :

<?php

class Foggyline_HappyHour_Model_User extends Mage_Core_Model_Abstract
{
   protected $_eventPrefix      = 'foggyline_happyhour_user';
   protected $_eventObject      = 'user';

   protected function _construct()
   {
       $this->_init('foggyline_happyhour/user');
   }
}

in Model/Resuource/User.php :

<?php

class Foggyline_HappyHour_Model_Resource_User extends Mage_Core_Model_Resource_Db_Abstract
{
   protected function _construct()
   {
       $this->_init('foggyline_happyhour/user', 'user_id');
   }
}

and Model/Resuorce/User/Collection.php :

<?php

class Foggyline_HappyHour_Model_Resource_User_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
   public function _construct()
   {
       $this->_init('foggyline_happyhour/user');
   }
}

Also there is some init script for the database ,I don't know whether this is problem with database or something like this?

in my controller I have this function :
public function testAction(){
        $obj=Mage::getModel('foggyline_happyhour/user');
        var_dump($obj);
     }

page is just crashing with this code ,if I put capital letters 'Foggyline_Happyhour ,page is not crashing and show bool(false) ,which should mean nothing is instantiated,how do I fix this mess is the big question ? I am using Linux btw


texts: how to disable Shipping Method magento 2 Checkout

texts: I want to hide shipping method from my checkout page. I am working on a custom theme. I tried to removing shipping method through XML but didn't work that. Is there any way to hide this?


texts: How do I check is product in my wishlist?

texts: Can I check if a product is in my wishlist? If yes, how?


texts:
I am working in a project where I need to fetch the tax rates which will be implement on products. But on product creation we assign Tax class. And I am not getting the relation between the Tax rates and Tax class.

Anyone who can exlpain the relation b/w rates and class? And how to fetch the tax-rate which will be applicable on the product.


texts: Product import causes duplicated SKU for simple products

texts: We are importing new products into magento as a scheduled cron job. Inside the code we internally calls the FireGento\FastSimpleImport module to perform the import action. This module actually calls the default magento product import features.  Sometimes we can see there are a lot of simple products being created with Same SKU. Any Idea about this problem?


texts: Magento2 : Add Password strength meter in login form

texts:
How to add Password strength meter in customer login form?

<item name="authentication" xsi:type="array">
    <item name="sortOrder" xsi:type="string">1</item>
    <item name="component" xsi:type="string">Magento_Checkout/js/view/authentication</item>
    <item name="displayArea" xsi:type="string">authentication</item>
    <item name="children" xsi:type="array">

        <item name="errors" xsi:type="array">
            <item name="sortOrder" xsi:type="string">0</item>
            <item name="component" xsi:type="string">Magento_Checkout/js/view/authentication-messages</item>
            <item name="displayArea" xsi:type="string">messages</item>
        </item>
    </item>
</item>
...
...

      <input type="password"
             class="input-text"
             id="login-password"
             name="password"
             data-bind="attr: {autocomplete: autocomplete}"
             data-validate="{required:true}"
             autocomplete="off"/>


texts:
I want to modify the search facility so that queries are more strict (narrowed).

For example:

Audi A8 2008 searches for: Audi AND A8 AND 2008 (not: Audi OR A8 OR 2008)

How can I achieve that?


texts: Why does Magento store a rounding delta when calculating taxes

texts:
In the model tax/Sales_Total_Quote_Tax, there is a method _deltaRound() that rounds a price. It adds a small delta, to stop nondeterministic behaviour when rounding 0.5.

/**
 * Round price based on previous rounding operation delta
 *
 * @param float $price
 * @param string $rate
 * @param bool $direction price including or excluding tax
 * @param string $type
 * @return float
 */
protected function _deltaRound($price, $rate, $direction, $type = 'regular')
{
    if ($price) {
        $rate = (string)$rate;
        $type = $type . $direction;
        // initialize the delta to a small number to avoid non-deterministic behavior with rounding of 0.5
        $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0.000001;
        $price += $delta;
        $this->_roundingDeltas[$type][$rate] = $price - $this->_calculator->round($price);
        $price = $this->_calculator->round($price);
    }
    return $price;
}

But it stores a delta. If it cannot find such a stored delta, it makes one up. Why? As tar as I can tell, this leads to different results with identical operations.

Let's say we have a $price of 3.595, and we do not have a cached $delta. As we go through the method, we will obtain $delta = 0.000001. We then get $price = 3.595001, which rounds to 3.60, so we have a new $delta of -0.004999. And we return 3.60.

Except now we have a delta so let's do it again, with $price = 3.595. $price = 3.595 - 0.004999 = 3.590001

Which if we round, we get 3.59. Different answers.

It seems to me that any rounding algorithm used should at least give the same answer every time it is run with the same arguments, but not this time.


texts: Magento 2 : There is Different Class for When User Logs Out Due to Inactivity

texts:
I need to redirect customer to a different URL when is logged out automaticly.

I made a prefence for Magento\Customer\Controller\Account\Logout but it looks like, when the customer is logged out due to inactivity my prefrence does not run.


texts: How to configure multiple table rate and multiple type shipping?

texts:
I am using magento 1.7. I am failing to configure multiple table rates with multiple types of shipping and I don't want to buy any extensions.

  Mainland UK   Estimated Delivery  Postage & Packing
 Free Delivery
    Orders over £50
    2-5 days    FREE
 Orders Under £50
    2-5 days    £2.95
 Two Day Delivery
    48 hrs if ordered before 1pm    £3.95
 Express Next Day 1pm
    if ordered before 1pm   £6.95
 Saturday Delivery
    next available Saturday £12.95

  International
Western Europe Postage & Packing £7.95
Rest of Europe 'Tax Free' Postage & Packing £9.95
USA & Canada 'Tax Free' Postage & Packing £14.00
Middle East & Africa 'Tax Free' 5- 10 days from dispatch Postage & Packing £14.00
Far East & Australasia 'Tax Free' Postage & Packing £14.00

Here are my shipping criteria if you have any suggestion or any free extension that will be helpfull to configure this shipping price.


texts: Magmi's Datapump API Update changes nothing, Create works fine

texts:
The two code examples that they provide for the API both involve creating new products. I've gotten this to work fine, creating hundreds of thousands of new products with it with no issues.

Now when it comes time to update something (via either update or create mode), for example mass updating a bunch of product's visibility, or their image, nothing happens. It says it successfully runs, but none of the changes actually happen. Is there anything different that you need to do to update an existing product? Here's one example of what I would run:

$dp=Magmi_DataPumpFactory::getDataPumpInstance("productimport");
$dp->beginImportSession("test_ptj","update",new TestLogger());
$product=array("sku"=>$productsku,"visibility"=>"Catalog");
$dp->ingest($product);
$dp->endImportSession();

That doesn't work on any products I run it through though. Logger says it updated them, but it's not reflected when I view the products in the back-end (after indexing). Any ideas?


texts: Custom Customer Attribute filter on search criteria Magento 2.1.8

texts:
I am trying to get customer collection based on email_id and my custom customer attributes i.e phone_code and mobile_number.

When I only add email filter getList return's customer array object but when I add my custom filter of mobile_number and phone_code attribute it return's 0 element error.

So is there any way we can use custom customer attributes in Search Criteria.

My Sample code:

$customerRepository = $this->_customerRepositoryInterface;

$email[] = $this->_filterBuilder
->setField('email')
->setValue($row[5])
->setConditionType('eq')
->create();
$phonecode[] = $this->_filterBuilder
->setField('phone_code')
->setValue($row[7])
->setConditionType('eq')
->create();
$mobile[] = $this->_filterBuilder
->setField('mobile_number')
->setValue($row[11])
->setConditionType('eq')
->create();

$searchCriteria = $this->_searchCriteriaBuilder
->addFilters($email)
->addFilters($phonecode)
->addFilters($mobile)
->create();

$customerCollection = $customerRepository->getList($searchCriteria)->getItems();


texts: How to access a current url of a magento cms pages which is created from admin panel?

texts:
http://magento.com/cms-page-identifier?a='jfls'&b='jhdgfjsd'

I want access a query parameter (a and b values from url) in a magento cms page. Can some body help me the {{}}  directives to print this value in cms pages.


texts:
How many years Magento 2 certificate is valid?
How much time it will take to prepare for Magento 2 exam?
If Magento upgraded to magento 3 4...then the certificate is acceptable or not?


texts: Download of "Samples" of downloadable products restricted by group

texts:
i'm building an e-commerce web site with different types of products.

I have many downloadable products like documents, images, videos but all of them are available for download for free.

I do not want the users have to go to the checkout process to download so i'm thinking to use the "Samples" section to let them download what they want.

But now i want that only some Particular group can download this material.

Now i would like to ask you: Is it possible to restrict the "Samples" download only for particular group?

Thank you very much and any suggestion is really appreciated


texts: How do I configure Magento to connect to a remote database?

texts:
I am trying to set up a local repo of Magento on Windows that will connect to a remote database running on CentOS. The CentOS server has the full LAMP stack and Magento installed and running. The local Windows machine has Apache, PHP and Magento installed. All I was to do is change my local.xml file on the Windows machine to point to the remote database running on the CentOS server. I changed the local.xml file to point to the server IP with the magento db user/pass, but I keep getting the following error:

SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I can SSH to the CentOS database, but I can't figure out how to make Magento connect to it. Any ideas?


texts: How to get product categories for a product in a specific store with REST?

texts:
from the documentation, in order to get the product categories for a product the request url looks like this:

http://www.bla.bla/magento/api/rest/products/{productid}/categories

I have tried several combinations for filtering with store including the following:

http://www.bla.bla/magento/api/rest/products/{productid}/categories/store/{storeid}

Any feedback most welcome.


texts: Edit sidebar items in first-level categories

texts: I am using magento 1.8 and I want to customize sidebar items in first-level categories. for example, I don't want the filters in first-level category page, But it should be in the lower level categories. Is there anyway to implement this?


texts:
Hopefully I'm asking the right question. I followed a great tutorial by Excellence and got AJAX cart functionality. Everything works great, except one thing.

After adding the product to cart, I return a new sidebar via:

$this->getLayout()->getBlock('cart_sidebar')->toHtml() and encode that via json

HOWEVER when the product is a configurable, it pulls the configurable image, not the associated. Yet, when I refresh the page (and it doesn't use my custom ajax controller), it pulls the correct image ($this->getProductThumbnail).

In my xml, I have:

  <block type="checkout/cart_sidebar" name="cart_sidebar" as="cartExplorer" template="checkout/cart/sidebar.phtml" before="-">
    <action method="addItemRender">
      <type>configurable</type>
      <block>checkout/cart_item_renderer_configurable</block>
      <template>checkout/cart/sidebar/default.phtml</template>
    </action>
</block>

Without the  tag, it never pulls the associated image, so I believe that's the key. So I think if I can somehow add that action to my php code that grabs the layout block, I'll be set. I just don't know how to do that.

Thanks for any assistance!


texts: Magento 2.0.X Authorize.net Direct Post keeps on showing loading after clicking place order

texts:
I am working for Magento 2 right from its first version. Till now for payments i have used only Paypal Express Checkout. But now there is requirement to integrate Authorize.net direct post. And i have tried to integrate it using sandbox credentials.

Now when i am on checkout page selecting Authorize.net to make payments by using sandbox sample card number e.g. : - American Express Test Card: 370000000000002 , When i click on place order it keeps on showing loader. But if i can see in admin panel under Sales > Order m It shows the order that i have just placed.

I have searched allot and found some people have posted the same issue , but they have also mentioned the PHP version as 7.0.x where they are getting issue.
e.g here

But i am using PHP Version 5.6.20 and also I have got this issue first with Magento 2.0.6 version. Now i have done fresh Magento 2.0.7 installation on new server, but the issues is still there

My admin panel configuration settings for Authorize.net are

Test Mode  : Yes

Gateway Url : https://secure.authorize.net/gateway/transact.dll

I have even tried with

https://test.authorize.net/gateway/transact.dll

Transaction Details Url : https://api2.authorize.net/xml/v1/request.api

Debug : Yes

Now when i have checked debug.log

it is saying

[2016-05-27 12:35:03] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://example.com/authorizenet/directpost_payment/place/","invalidateInfo":{"tags":["catalog_category_3","catalog_category"],"mode":"matchingAnyTag"},"is_exception":false} []
[2016-05-27 12:35:03] main.DEBUG: array (
  'request' =>
  array (
    'x_version' => '3.1',
    'x_delim_data' => 'FALSE',
    'x_relay_response' => 'TRUE',
    'x_test_request' => 'TRUE',
    'x_login' => '****',
    'x_method' => 'CC',
    'x_relay_url' => http://example.com/authorizenet/directpost_payment/response',
    'x_type' => 'AUTH_CAPTURE',
    'x_fp_sequence' => '2',
    'x_invoice_num' => '000000002',
    'x_amount' => 5.0099999999999998,
    'x_currency_code' => 'USD',
    'x_tax' => '0.00',
    'x_freight' => '5.00',
    'x_first_name' => 'Dinesh',
    'x_last_name' => 'Saini',
    'x_company' => '',
    'x_address' => 'test',
    'x_city' => 'California',
    'x_state' => 'Alabama',
    'x_zip' => '90001',
    'x_country' => '',
    'x_phone' => '1234567890',
    'x_fax' => '',
    'x_cust_id' => '',
    'x_customer_ip' => '122.173.244.114',
    'x_customer_tax_id' => '',
    'x_email' => 'dineshs@test.com',
    'x_email_customer' => '1',
    'x_merchant_email' => '',
    'x_ship_to_first_name' => 'Dinesh',
    'x_ship_to_last_name' => 'Saini',
    'x_ship_to_company' => '',
    'x_ship_to_address' => 'test',
    'x_ship_to_city' => 'California',
    'x_ship_to_state' => 'Alabama',
    'x_ship_to_zip' => '90001',
    'x_ship_to_country' => '',
    'x_po_num' => '',
    'x_fp_timestamp' => 1464352503,
    'x_fp_hash' => '27827498413496cd9ad6ed247e9688f3',
  ),
) {"is_exception":false} []

Can anyone please help , is there anything wrong in my configuration or i have tried with something else.


texts: How to increment a column based on another column (max value) in a different table in Magento

texts:
I need to update a column based on another column (max value) in a different table in Magento. If the updated value is not greater than the max value then update other wise not.
By Updating I meant it includes a arithemetic operation, eg Increment.

How to do it in Magento Way instead of writing a Mysql query ?


texts: how to show out of stock on product image if the salable quantity is 0 in magento 2.3

texts:
I want to show out of stock tag on products image if their salable quantity is 0 in Magento 2.3

sorry for my bad english.


texts:
I am trying to fetch all categories with filter, but it throws following error :

  1 exception(s): Exception #0
  (Magento\Framework\Exception\LocalizedException): Invalid method
  Magento\Catalog\Model\Category\Interceptor::addFieldToFilter

And i have also tried with addFieldToFilter and addAttributeToFilter but still it says invalid method.
I want all categories filter with Display mode.
Please Help!


texts: Magento 2 : Overriding model gives gateway error

texts:
I am trying to override a core model on magento 2 the path of the file is this

/vendor/magento/module-company/Model/Role/Validator.php

I added this override to my module's di.xml

<preference for="Magento\Company\Model\Role\Validator" type="OSE\Company\Rewrite\Magento\Company\Model\Validator" />

AM i doing this correctly?


texts: not join product and custom table magento 1

texts:
public function getProductFinalPrice($observer)
 {
     $collection = $observer->getEvent()->getCollection();
     $resource = Mage::getSingleton('core/resource');
     $collection->getSelect()->join(array('membership' => $resource->getTableName("membership/membership")), "main_table.membership_product = membership.membership_id", array('membership.discount','membership.discount_type','membership.membership_id'));
 //........
 }

Note: membership_product is

 $setup = new Mage_Eav_Model_Entity_Setup('catalog_setup');

 $setup->addAttribute('catalog_product', 'membership_product', array(
    'group'   => 'General',
    'type'   => 'int',
    'input'   => 'select',
    'label'   => 'Membership',
    'backend'   => '',
    'frontend'  => '',
    'source'   => 'membership/entity_attribute_source_membership',
    'visible'   => 1,
    'user_defined'   => 1,
    'used_for_price_rules'  => 1,
    'position'   => 2,
    'unique'   => 0,
    'default'    => '',
    'sort_order'   => 103
));

  Unknown column 'main_table.membership_product' in 'on clause'


texts: How import product multiselect attributes with profiler?

texts: How I can import multiselect attributes. I think I need create new advanced dataflow profile, but I don't know how...


texts: Magento2 Checkout : How to display Braintree Credit card details on Custom step "Review"

texts:
I've added a new checkout step "Review" & using Braintree credit card method.

On review step, I need to display user entered cc details like last4digits, expirationMonth, expirationYear.

As Braintree uses "Hosted fields" concept I'm not able to fetch these details through normal flow.

Braintree uses iframe for cc section.
Any suggestions or help on this is appreciated!

Thank you!


texts: Payment method not showing for free product with paid shipping

texts:
I am a developer and stocked on this issue.

I can not see payment method with when i place a free product with paid shipping method.

Please help me.


texts: Multiple Add to Cart Button from External php site using product id

texts:
I have tried url method http://domain.com/checkout/cart/add?product=72&qty=1 for adding magento product to cart from external php website but it looks like this method is not working.

I want to have a add to cart button for around 3 products from a single page using may be product id or sku. How can I accomplish this without having to go to magento product view page. I just want 1 quantity with no custom options. I also wish there was a way to apply coupon code automatically.


texts: Magento 2: what is the search_engine.xml? How to declare a new search engine?

texts:
Some of you may have noticed the presence of the following file app/code/Magento/Search/etc/search_engine.xml:

<?xml version="1.0"?>
<engines xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_engine.xsd">
    <engine name="mysql">
        <feature name="synonyms" support="true" />
    </engine>
</engines>

My assumption is that this file is somehow declaring the search engine to be used (mysql here).

So here are my questions:

How is that file exactly being used in Magento 2?
Can one declare a different search engine by creating a search_engine.xml file? If so, is there anything else to declare a new search engine?
Is it somehow related to the search_request.xml file?


texts: magento community extension update problem

texts:
I created a paid community extension with version 1.0.0, and in this moment I have an upgrade for it with version 1.0.1. I add this version in Magento Store at http://www.magentocommerce.com/magento-connect/extension/extension_version/ but not shown in admin panel after I press "Check for Updates" button.

Thank you very much


texts: Catalog Price rules are not carried over to the shopping cart and checkout

texts:
I'm having troubles with Catalog Price rules. I have a rule that says YY% discount on products of manufacturer "X" for all members of customer-group "resellers"

I save and apply the rule (and cron is running so it updates every day), yet it does not work as expected.

The discount correctly shows on the product page, yet once you add the product to the cart, it reverts back to the original price, and this is the same for the actual checkout.

Yet if I create an order from the backend for the same customer, the discount is correctly applied...

Both the cart and the checkout use the stock base/default .phtml files for display of products/price/tax etc...

I've been experiencing this issue with Magento 1.8x, and just upgraded to 1.9.0.1 and still the same issue.


texts: Observer for event on Checkout button click of Minicart Magento 2

texts:
I want to create observer for event which is responsible to send data from minicart to checkout.

Please suggest event name.

I have already tried:

  checkout_cart_update_items_before

and

  controller_action_predispatch_checkout_index_index


texts: Magento 2 update default customer address data programmatically

texts:
I want to update customer default billing address and I tried following code:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$address = $objectManager->get('\Magento\Customer\Model\Address')->load($customerData->getPrimaryBillingAddress()->getEntityId());
$address->setCustomerId($customerId);
$address->setPostcode('452009');
$address->setId($customerData->getPrimaryBillingAddress()->getEntityId());
$address->save();

Can anyone please help?


texts:
First of all, did quite some research, but could not find the best solution in this case.

For SEO reasons, we need to add a fixed prefix (with a slash) to all product URLs.

Product URLs now look like the following:

shopdomain.com/product-name.html

Expected result is to me URLs look like this:

shopdomain.com/car/product-name.html

Is there, by any chance, a standard Magento way for doing this? If not, what would be a possible workaround for this situation?

Any help or guidance is much appreciated.


texts:
Is possible to display monthly payment by product?

For example:

product 1
10$/month
For 24 months

Thanks!


texts: placeOrderAction does not set order with the default status according to configuration in magento2

texts:
I have created a new payment method.

In system configuration, I have set that the new order status as Pending, however, when I place the order, the new order is created in Processing status.

Here is my system.xml code.

   <system>

            <group id="zipcodpayment" translate="label" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                Custom Payment
                <field id="active" translate="label comment" sortOrder="1" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    Enable
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="title" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    Title
                </field>
                <field id="order_status" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    New Order Status
                    <source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
                </field>
                <field id="allowspecific" translate="label" type="allowspecific" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                    Payment from Applicable Countries
                    <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
                </field>
                <field id="specificcountry" translate="label" type="multiselect" sortOrder="41" showInDefault="1" showInWebsite="1" showInStore="1">
                    Payment from Specific Countries
                    <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                    <can_be_empty>1</can_be_empty>
                </field>
            </group>

    </system>

Please help.


texts: When using Magento 2 the admin panel buttons are un-responsive

texts:
After changing the password and language the admin panel buttons no longer worked (were un-responsive). In trying to fix this issue I did the following,

Removed the pub/static folder
Ran php bin/magento cache:clean and php bin/magento cache:flush
Next I ran php bin/magento setup:di::compile then php bin/magento setup:static-content:deploy -f

After doing this the style for the site has gone and the links still no longer work. What can I do to fix this?


texts: Show Tax Amount but don't include in SubTotal & Grand Total

texts:
i need help regarding Magento 1.9.2, i want to show the Tax amount but don't want to include in SubTotal and in GrandTotal amount.

i have already play around with Tax Settings
admin-->System-->Configuration-->Sales-->Tax-->Shopping Cart Display Settings

But still no Result. i have also visit similar question's post on this Forum or any other forums but all in vain.

Please have look on the image below

Anyone Please help to purpose any solution.

Thanks.


texts:
I have a customer group store_admin. If a customer belongs to store_admin, he should be able to view the orders placed by other customers.

I am unable to find out where does Magento check for logged in customer and how does it restrict access.

Any help would be appreciated. Thanks!


texts: magento2 : retrieve images path of a product programmatically?

texts:
I'm using this code to retrieve all products "out of stock" and export them in a csv so I can use the "import" tab (behavior delete) to clean old products.

$productCollection = $obj->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$collection = $productCollection
            ->addAttributeToSelect('*')
            //->setPageSize(700) //Selecting 500 products pour TEST plus rapide
            ->load();
echo "sku" . ';' . "name" . ';' . "mgs_brand" . ';' . "urbmag_season" . "\n";
foreach($collection as $product){

    $productType = $product->getTypeId(); // regarde si CONFIGURABLE

    if ($productType == "configurable" AND !$product->isAvailable()) { // CONF + OUT OF STOCK
    $productSku = $product->getSku();
    $productName = $product->getName();
    $productBrand = $product->getAttributeText('mgs_brand');
    $productSeason = $product->getAttributeText('urbmag_season');
        echo $productSku.';'.$productName.';'.$productBrand.';'.$productSeason."\n";

        $children = $product->getTypeInstance()->getUsedProducts($product); // simple associés
        foreach ($children as $child) {
      $childSku = $child->getSku();
      $childName = $child->getName();
            echo $childSku.';'.$childName.';'.$productBrand.';'.$productSeason."\n";
        }
    }
}

I like to add a column with the media path so I can delete images associated to the product. I'm looking for the command like $productImages = $product->getXXXXXXXXXXX();


texts: Order grid filter on the basic of custom attribute

texts:
This lines of code return the order collection, but I don't known which hierarchy of file. Where I can put this lines of code?
What I am should use a plugin, preference or else?   and how tom implement in my custom module?

   $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
   $orderDatamodel = $objectManager->get('Magento\Sales\Model\Order')->getCollection();
    foreach($orderDatamodel as $orderDatamodel1){
        $getid =  $orderDatamodel1->getData('increment_id');
        $orderData = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($getid);
        $getorderdata = $orderData->getData();
        $orderItems = $orderData->getAllVisibleItems();
        foreach($orderItems as $orderItems){
           echo '
', var_dump($orderItems->getData()),'
';
        }
    }


texts: M1.9 set value for custom product attribute

texts:
I need to set a new value to a custom product attribute.

I want this to happen when a new product is created. The default value of the attribute is 0, I need to set it to 1.

I have an event observer for catalog_product_load_after.

<?xml version="1.0"?>
<config>
    <modules>
        <Schott_ShowQuoteAtZero>
            <version>1.0.0</version>
        </Schott_ShowQuoteAtZero>
    </modules>
    <global>
        <events>
            <catalog_product_load_after>
                <observers>
                    <Schott_ShowQuoteAtZero_Observer>
                        <type>model</type>
                        <class>schott_showquoteatzero/observer</class>
                        <method>showQuoteButtonAtZeroPrice</method>
                    </Schott_ShowQuoteAtZero_Observer>
                </observers>
            </catalog_product_load_after>
        </events>
    </global>
</config>

Here is my observer

class Schott_ShowQuoteAtZero_Model_Observer
    {
        public function showQuoteButtonAtZeroPrice(Varien_Event_Observer $observer)
        {
            $product = $observer->getEvent()->getProduct();
            $product->setData('quotemode_conditions',1);
            $product->save();
        }
    }

It does not change the attribute value. Can anyone help?


texts: Magento 2.3: Hovering MegaMenu Not Working

texts:
I previously had Porto Megamenu which i had disabled and, I added Amasty MegaMenu Extension, followed the provided steps, but the megamenu doesn't seams to be working on hover, i need a pointer where should i need to look, I don't seam to found the solution anywhere. After enabling the menu wasn't appearing i used help from here: Magento 2 : Menu does not appear on home page.
Here is the project url: https://beta.naseejkw.com/


texts: Magento 2.1.7 "Ghost" exports triggered by magento?

texts:
In the last few days, my Magento instance started some exports automatically without any of the admin users triggering it.
Background
I rewrote the export logic to make it run in the background, so if an admin user starts an export via the admin ui, a value is written into the config database. Then a cronjob runs the export task in the background and sends an email, when the job is done. This was done because we have over 20000 products which the browser couldn't handle.
The original export logic is still there, the only difference is that the export isn't done in the browser, it's the done the background.
The last few days, I got some random emails that the export job is done, but no one was triggering it so we have two possibilities:
1) someone has access to the admin ui and starts the exports without me knowing it:
I checked the access logs and admin_sessions on the database, there were no "sketchy" sessions and no admin/export urls called in the time the exports were happening, therefor i don't think that's the cases
2) magento starts the exports by itself: is this possible? is there any (cron)job or task, the starts exports in the magento instance? I run the normal cron jobs, so nothing special there.
Any ideas what I'm missing? Where are those exports coming from?


texts: Cant see newly added attribute in product edit page

texts:
I've added a new attribute in

  admin > Catalog > Attributes > Manage Attributes

but I did not add it to an attribute set as it will not be required on the frontend.

However now I can't see this newly created attribute when I go to edit a (simple) product anywhere?

Magento 1.9

Help appreciated, thank you


texts: How to JOIN TABLES with WHERE clause in Magento 1.9?

texts:
I want to join two tables, the customer_entity, and customer_entity_varchar. but I have no idea how to do it. This is my current query:

Let's assume I the entity_id is 5 and attribute_id is 139.

$customerCollection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*')->getSelect()->join( array('varchar'=> 'customer_entity_varchar'), 'varchar.entity_id = main_table.entity_id', array('varchar.attribute_id'))->addAttributeToFilter('entity_id', array('eq' => '5'))->addAttributeToFilter('attribute_id',array('eq' => '139'));

Below is the query I want to achieve.

SELECT attribute_id, entity_id FROM customer_entity INNER JOIN customer_entity_varchar ON customer_entity.entity_id = customer_entity_varchar.entity_id WHERE customer_entity.entity_id = 5 AND customer_entity_varchar.attribute_id = 139

I am stuck with this. I am using Magento 1.9.


texts: how to set shipping days for each country magento 2

texts:
How does the logistics delivery time of the magento 2 website be set to change with the country/region?
For example, when the user chooses the United States, the standard express (free) logistics time is chosen to be 7 - 12 days. If choose the UK, the standard express (free) logistics time varies change from 7 to 20 days.
At the same time, in addition to the standard express (free) mode of transport, add one more DHL delivery method, DHL shipping costs need to pay separately $ 9.99. And DHL's delivery time also changes with country/region.
I want to know is the magento 2 backend have this feature?
If not, is there a corresponding plugin?
Like this casetify.com below:


texts:
After editing some language files all admin buttons stopped working.

If I try to clear my cache nothing happens when I click at the button related to it.

Does someone know how to fix this?
Many thanks in advance.


texts: I want to call an observer on reorder to get the order id.suggest me some solution.


texts: how to change customer login page into 2 column page

texts:
I am using Facebook connect and like plugin

On Login or Create an Account page, i want two columns page. currently its one column

<reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
    <reference name="customer_form_login">
        <block type="verticalmenu/verticalmenu" after="-" name="ma.verticalmenuleft" template="magentothem/verticalmenu/verticalmenuleft.phtml" />

        <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml">
            <action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
                <template>facebookfree/login.phtml</template>
            </action>
        </block>
    </reference>
</customer_account_login>


texts: Magento 2 - can't change the zip code in order

texts:
I have a very strange issue in Magento 2 orders. In some orders the first number in the zip code is removed automatically. For example 07716 will be 7716. So the zero was dropped.

I try to edit the zip code in the orders but is not work.

How I can fix this?

Thank you


texts: Serializable Fields in Magento Collections

texts:
In my resource model I have defined a field as serializable (see property $_serializableFields in Mage_Core_Model_Resource_Db_Abstract): Magento handles automatically serialization/unserialization of the contents when loading data from the database and before saving the object.

This works perfectly, but when I iterate over a collection of those objects, the field contents are not unserialized automatically. I tried with $collection->walk('afterLoad') but soon realized that unserializeFields() is triggered in the resource model load(), and not in afterLoad() like I first thought. What is the best practice in this case? How do I get this field unserialized automatically? I can of course reload the object in my loop, doing something like $object = $object->load($object->getId()), but I was wondering if there is a smarter way to achieve this.


texts: Sort product collection by Latitude and Longitude

texts:
I need to sort product collection by latitude and longitude in product listing and search page.

Explanation:

I have two product attributes Latitude and Longitude. All product has single Latitude and Longitude. Now on product listing page we need to sort product collection by current latitude and longitude.

Suppose my current location latitude is 36.778259 and longitude is -119.417931, In product listing page All product with latitude 36.778259 and longitude -119.417931 has to display first in list page and other near by latitude and longitude products should display respectively and so on. I guess we need to use Google Map API for doing it but not sure how do I do it.

Please provide me some solutions. Any help would be appreciated! Thanks!


texts:
I am trying to create a new account for guest checkouts and assign the order to that account i have an observer for sales_order_place_after and creates an account through this code, it works and the account is created but the order is not saved to the account am i missing something? (Magento 1.8.1.0)

    $order = $observer->getEvent()->getOrder();
    $autoregister_array["customerSaved"] = false;
    $email = $order->getCustomerEmail();
    $firstname  = $order->getCustomerFirstname();
    $lastname  = $order->getCustomerLastname();
    $customer = Mage::getModel('customer/customer');
    $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email);
    if (!$customer->getId()) {
        $randomPassword = $customer->generatePassword(12);
        $customer->setId(null)
            ->setSkipConfirmationIfEmail($email)
            ->setFirstname($firstname)
            ->setLastname($lastname)
            ->setEmail($email)
            ->setPassword($randomPassword)
            ->setConfirmation($randomPassword)
            ->setPasswordConfirmation($randomPassword);
        $customer->save();
        Mage::getSingleton('customer/session')->loginById($customer->getId());
        $order->setCustomerId($customer->getId());
        $order->setCustomerIsGuest(0);
        $order->save();
    }


texts:
I am usign Magento 1.7. I have a store with thousands of products, but I only need to keep some of them. I have a list of the names of the products that I need to keep.

Which is the best way to only have the products I want in my store?

Should I delete all the other products? Which would be the best way to do so?
Should I just disable all the other products? Is there a way to do so programmatically? It is not practical to disable some thousands of products.

I don't have the list of SKU's by the moment. I only have the list of product names.

I am still a bit new to Magento and don't fully know how it works. Any help will be much appreciated.


texts: 403 error while installing Magento - is the install guide correct?

texts:
I am following the installation directions on the Magento site at http://www.magentocommerce.com/knowledge-base/entry/install-privs-before and right after changing the file permissions to 600 for files and 700 for directories, I am faced with a 403 Forbidden error (with no surprise as I'm restricting access to the general public) when I go to the install page and the root Magento directory (it's in a subfolder).

I have followed the directions just as they are listed and even chowned the install directory for the apache user which I had to look up (it's a shared hosting environment so it was just my username.)

find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;

While I'm pretty sure this could be easily fixed with changing the permissions to 755 for directories and 644 for files, I am very curious as to why the installation guide would tell me change them to 600 for files and 700 for directories, when that simply doesn't work.

I'd like to keep this process secure as possible as it is for a client and stick with what Magento recommends.  But why would they recommend something that doesn't work?

Is there something I am missing?  Is there a more secure way to install Magento?


texts: Magento2 : Pop up on page load in magento home page

texts:
I thought there would be some support for the pop up in the Magento but did not succeed. I want to show the Email subscription popup on the page load on the home page.
The second thing is I am not using bootstrap so that .modal could not work in this case. Any suggestions on how can I achieve this?
Also, I want the default newsletter functionality in that popup. I tried to search the newsletter fields in the code but not succeeded.
Any kind of help would be much appreciated.


texts: Magento2 require tage breaks list.phtml page

texts:
I am trying to get jquery to work in the list.phtml file . I have jquery working on the product detail page within a this same jquery require tag. However when I put it on the list.phtml file it makes the entire page load all misaligned and full of other issues in the console I am presented with a require not defined error?

Here is the code I am trying to use.

<script>
   require(['jquery'], function ($)
   {
       $(".tocart").click(function()
       {
          dataLayer.push({
                          'event': 'addToCart',
                          'ecommerce': {
                          'currencyCode': 'USD',
                          'add': {
                                   'products': [{
                                   'name': "<?php echo "$google_item_name $google_item_name_2 $google_item_name_3";?>",     // Name or ID is required
                                   'id': '<?php echo "$google_sku";?>',                      // Name or ID is required
                                   'price': '<?php echo "$google_price";?>',                // Insert product price
                                   'brand': '<?php echo "google_site_owned_by_name";?>',                // Insert product brand
                                   'category': '<?php echo "$category_name";?>',          // Insert product category
                                   'quantity': '1',           // Insert product quantity
                                   'site': '<?php echo "$google_sitebeing_viewed";?>'   // Insert site that product belongs to (e.g. site1, site2, site3)
                                    }]
                                  }
                            }
                         });
           });

       });
 </script>


texts: 1.9.2 completely inconsistent order email problem

texts:
We have a VPS running litespeed with four website frontends on CE 1.9.2.

It is experiencing really inconsistent new order email problems. Sometimes the email goes. Sometimes it doesn't - that's close to 50/50, we then have outliers where the order email sends two or three times.

Most times when the email doesn't send automatically, I can manually queue another email and it will send on schedule, although sometimes I have to do that twice to get a success.

Looking at the exception log on the failures we are getting a fairly generic looking exception:

ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/magento/public_html/lib/Zend/Mail/Transport/Sendmail.php:137

Stack trace:
#0 /home/magento/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/magento/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/magento/public_html/app/code/core/Mage/Core/Model/Email/Queue.php(239): Zend_Mail->send()
#3 [internal function]: Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#4 /home/magento/public_html/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#5 /home/magento/public_html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#6 /home/magento/public_html/app/code/core/Mage/Core/Model/App.php(1357): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#7 /home/magento/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#8 /home/magento/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#9 /home/magento/public_html/cron.php(77): Mage::dispatchEvent('default')
#10 {main}

Please help, we have run out of ideas.


texts: Magento Native Application in iOS/Android

texts: I want to create a native app in iOS/android using the magento web application. Is there any way to achieve this?


texts: Data migration tool: is it possible to exclude specific websites/stores (and all of their related settings, products, etc.) from the migration?

texts:
I have a Magento 1 website with a bunch of legacy websites (stores) which haven't been used for years but which still contain a bunch of old products/settings/etc.

I'm migrating to Magento 2 but don't want to migrate the old stores.

What's the best way to exclude these old stores and only migrate the store(s) I need?

Obviously I would want to exclude not only the store data itself but all of the product associations and store-specific settings related to the old stores.


texts: Getting validation error on checkout billing tab for custom attribute

texts:
I have added two custom attribute named as country_code and mobile. And added those fields in
        app\design\frontend\base\default\template\persistent\customer\form\register.phtml

And the fields are reflecting on register page and working good. Please note that I haven't added these fields in
    app\design\frontend\base\default\template\checkout\onepage\billing.phtml

But when I try to complete my checkout I got an alert box saying that

  "Country Code" is a required value., "Mobile Number" is a required
  value.

So I added those field in billing.phtml just to check the behavior. But this time I also got the same alert box. Refer below screens.

Hope I explained clearly. Suggest what goes wrong here.


texts:
I get:

  General system exception happened
  Additional data: URL key for specified store already exists.

error when trying to import products with csv.

my csv file is passing check data process but when I press import button I get this error.

Is there any sugetion for this problem?


texts: Nested collapsible elements: initialize a collapsible inside of content for another collapsible

texts:
Having a

data-mage-init='{
"collapsible":{
    "collapsible": true,
    "openedState": "opened",
    "multipleCollapsible": true,
    "header": ".parent__collapsed",
    "content": ".parent__expanded"

}}'>

inside of the parent__expanded I need to initialize another collapsible element saying

data-mage-init='{
"collapsible":{
    "collapsible": true,
    "header": ".child__collapsed",
    "content": ".child__expanded"

}}'>

However, nothing happens on the child, while moving it out of the parent's content perfectly works.


texts: How to export products in google feed format from phpmyadmin magento 2

texts:
I want a text file with all the products with below columns:
id, title, description, link, image_link, availability, price, sale_price

How can I export this data from phpMyAdmin?

I am using Magento 2.3.3

Please any suggestions?


texts: Magento 2 All Bundle Product Show Out Of Stock On PDP

texts: In my magento 2 store show all bundle product OUT OF STOCK.


texts: Replace customers account creation fields [M2.3.3]

texts:
I would replace two fields in customer account creation :

First Name should become Account Number
Name Prefix should become Company Name

And these two fields must appear in orders export...

If you have any hints to help me..

Thanks !


texts: Is there a way reverse the order of Step4 and Step5 in One Page Checkout?

texts:
We're implementing a new payment method. This payment method works differently than others in that when you select this method in Step4 (Payment Information), it displays a <form> which has its own submit button. This form is created via JavaScript (we include a  that creates the form in our .phtml file) and has fields for Card #, Name, CVV, etc). This form's action="" points to the payment gateway. So when the form is submitted, it calls the payment gateway, which processes the payment, then calls our success action to inform us of the processing result.

As you may notice, this is problematic because all this happens inside Step4 of the Checkout, before even the "Place Order" button of Step5 (Order Review) is displayed.

So is there a way reverse the order of Step4 and Step5? Or maybe have this custom form appear in Step5 instead? Or, is it safe to just hide Step5 altogether since the payment is already handled in Step4?

We're very new to Magento so we'd really appreciate suggestions on how to go about this.


texts: What is Magento AWS Hosting? Features of Magento Hosting?

texts:
I want to set up my system using Amazon Web Services as a hosting provider. Can anyone help me with the following:

What is a good starting point for setting up an AWS box?

How can I configure AWS to work with Magento?

Please help me


texts:
We are using magento 1.9. In that

How to get ordered product count not order qty of product. I want to how many product is there in that order?

I am using this but it showing ordered qty only

 <?php
        $_order = $this->getOrder(); //call the order
        echo $order_qty = floor($_order->getData('total_qty_ordered')); //get qty of all items rounded to full number (without 3.0000 or so)
        //echo $order_qty;
    ?>


texts: Is it possible to automatically set all products with a price = 0 to be out of stock?

texts:
We are trying to figure out if there is a Magento setting or another way of making sure that any products on our e-commerce site that are uploaded with a price of 0 are set to out of stock, so then they will not be visible on the front end

I have already found the setting that Sets out of stock products to be disabled,

So I'm trying to figure out how to make all products with price = 0, set to out of stock