texts: Display config data array in a admin grid

texts:
I create a system.xml file that saves an array in the config_data table.
{"_1621473140678_678":{"shipping_method":"shipmethod1","cost":"15"},"_1621473158703_703":{"shipping_method":"shipmethod2","cost":"10"}}

This is the result it saves in the table. I can get this data by using the following function.
$shippingCosts = $this->getConfig(ConfigData::SHIPPINGCOST_XML_PATH);
            if (is_string($shippingCosts) && !empty($shippingCosts)) {
                $shippingCosts = $this->serialize->unserialize($shippingCosts);
            }

            if (is_array($shippingCosts)) {
                foreach ($shippingCosts as $shippingCost) {
                    $this->methodCost[$shippingCost['shipping_method']] = [
                        'cost' => $shippingCost['cost']
                    ];
                }
            }

Now I need to create an admin grid to display and edit this data by row. Can anyone provide a solution to this.
Thanks


texts: Unable to pull Category Description, Mage 1.9 with multiple stores,

texts:
so I am not sure how to debug this.
I can pull all information from a category but I cannot get the 'description' attribute to pull through. It just appears blank.

This doesn't work:

<?php
    ...
    $_helper    = $this->helper('catalog/output');
    $_category  = $this->getCurrentCategory();
    ...
?>

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
    <div class="category-description std">
        <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
    </div>
<?php endif; ?>

Or this:

echo $_category->getData('description');

However getName, url, getting the image, or even the custom thumbnail works but just not text fields, all other attributes I can call. I am not sure if there is a setting I am missing or something else is happening.

Any ideas?


texts: "Error while checking if topic is synchronous" on setup:upgrade

texts:
While upgrading a 2.2.8 database to 2.3.2 I got this error today:

  Schema post-updates:
  Module 'Magento_Store':
  Module 'Magento_Directory':
  Module 'Magento_Theme':
  Module 'Magento_Eav':
  Module 'Magento_AdvancedPricingImportExport':
  Module 'Magento_Rule':
  Module 'Magento_Customer':
  Module 'Magento_Amqp':
  Error while checking if topic is synchronous

It must have something to do with environment configuration because on the same DB snapshot with the same code base, it worked on a test environment.

We do not use the Magento_Amqp module at all, so there is no AMQP configuration on either system.

I looked where the error message can be thrown and found:

\Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\DataMapper::isSynchronousTopic

which can be traced back to:

\Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\Iterator::__construct

And the exception is thrown if in

\Magento\Framework\Communication\Config::getTopic()

a configuration path (topics/$topicName, from cache id communication_config_cache) cannot be found.

But now I'm lost: Why should this configuration be present in one installation and not in the other? Or why would Magento look for the configuration at all during DB schema updates?

The output suggests, that the recurring schema update (\Magento\Amqp\Setup\Recurring) of Magento_Amqp are not even started (No "Running schema recurring"), so I guess the error comes while instantiating it.

Trying to find a dependency path to the class from above, that throws the exception in its constructor:

\Magento\Framework\Amqp\TopologyInstaller
\Magento\Framework\MessageQueue\Topology\Config
\Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\Iterator

Yes! We have a trace. (but still no idea, why. I'll keep this updated)


texts: Header not show after update to magento 2.1

texts:
I had Magento 2.0.7 installation and my site worked fine.

Then recently I updated my site to Magento 2.1.0 and header section on my site is not visible now

What could be the issue.


texts: How to hide custome options in product detail page if not available

texts:
I have a supplement store that will have about 6ooo plus products but mainly because there are products with different weight that needs to be inserted one by one. I can do one product with custom options for the weight and here comes my problem.

Example:
Jumbo protein comes in 2860G, 4400G and 8800G.
There are 4 flavors, Chocolate, Vanilla, Strawberry, and coconut
All 4 flavors are available to the Jumbo 2860g and jumbo 4400G but Coconut flavour isn't available to jumbo 8800G.
How can I hide this coconut flavour when the client chooses Jumbo 8800G, and show it again if client chooses the other weights?
Basically how can I hide a custom option if not available?
As you can imagine if i get this to work it will save me tons of work and reduces my store from 6000 plus products to half.

Im using magento CE 1.8.1.0


texts: How to get product details along with transaction id after payment is done

texts:
I am using magento 1.8.
My requirement is..

I need to add some product information into my custom table after the payment is done.[when customer redirect from paypal to the our website store]

This table need to be contain product details, customer information, transaction information.
I think writing observer is good for this,
So I am not getting which observer method I need to use which is suitable for above requirement

Thanks in advance


texts:
I have product A which is composed of 2 products B and 1 product C.

The user can buy the Product A (so with product A B C ) on a page. The stock is decreased on A B C.

OR

He can separately buy the product B on a separate page. So in this case, we have to recalculate the stock of the Product A.

I don't want to have product B or C as an option on the page of product A. If a user buys product A, its inevitably B + C.

Is it possible to do that with Magento?


texts: Magento 2.2.7 - PHP Fatal error: Uncaught Error: Class 'DOMDocument' NGINX

texts:
Hello as you can see in the title:

I have nginx installed
PHP 7.1
Installed PHP-XML
Installed PHP-DOM
But still getting this problem when i for example want to clear cache.

pelase Help

PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /var/www/magento/vendor/magento/framework/Config/Dom.php:384
Stack trace:
#0 /var/www/magento/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('__construct('_createConfigMerger('Magento\\Framewo...', '_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /var/www/magento/vendor/magento/framework/App/ObjectManagerFactory.php(275): Magento\Framework\Config\Reader\Filesystem->read('primary')
#5 /var/www/magento/vend in /var/www/magento/vendor/magento/framework/Config/Dom.php on line 384


texts:
I want to use Kint to show my variables. So to install it I use composer by composer require raveren/kint

I put in my block "use \raveren\kint\Kint;" and in my template Kint::dump(1); to test but I get this error :

  Fatal error: Allowed memory size of 805306368 bytes exhausted (tried
  to allocate 132928520 bytes) in
  /Applications/MAMP/htdocs/magento2/vendor/raveren/kint/decorators/rich.php
  on line 66

Have you got an idea ? Or can you give me a better library to show PHP Objects ?


texts: M2: Issue with setup multilanguage on second domain

texts:
We have created multilanguage for multi website.

On main domain work correct, but after set second domain then impossible open website (on main domain everything is ok).

An error has happened during application run. See exception log for details. Could not write error message to log. Please use developer mode to see the message.

log:

[2019-03-22 14:18:04] main.CRITICAL: No such entity. {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity. at /home/zabezcen/domains/zabezcen.pl/public_html/vendor/magento/module-store/Model/WebsiteRepository.php:80)"} [] [2019-03-22 14:18:21] main.CRITICAL: No such entity. {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity. at /home/zabezcen/domains/zabezcen.pl/public_html/vendor/magento/module-store/Model/WebsiteRepository.php:80)"} []

update:
.htaccess

SetEnvIf Host zabezcen.com MAGE_RUN_CODE=en
SetEnvIf Host zabezcen.com MAGE_RUN_TYPE=website

update2:
For test I deleted from .htaccess

SetEnvIf Host zabezcen.com MAGE_RUN_CODE=en
SetEnvIf Host zabezcen.com MAGE_RUN_TYPE=website

Now, when I enter:
mywebsite.com then redirect to main domain mywebsite.pl ?SID=tc7cmm5bc6t884j77i1gcbdu17

But when I enter mywebsite.com/en/  Then everything works correctly

So now, how to set after open website mywebsite.com redirect to mywebsite.com/en/


texts: How to update outdated adobe flash plugin in Magento 1.9.24

texts: I am getting an issue in my website. It is giving adobe flash plugin is outdated error in Windows system so the website is stopped working.


texts: How to use ifconfig multiple times in one action?

texts:
How to use ifconfig two times in one action?

<action method="setTemplate" ifconfig="example/general/enabled">
    <template>example/catalog/product/view/examples.phtml</template>
</action>

Now I want to add another if condition in this action. I have two configuration fields.

If one is set as "yes" and the second is also set as "yes" then my template will be displayed. So how to use two if condition in a layout XML file?


texts: Bulk price updates in Magento ver. 1.9.3.1

texts:
I'm looking to do a mass price update, not by a set percentage and wondered what the easiest way to achieve this is.
obviously without possible data entry on csv file and re import.


texts: How can i change my product page infinite scroll down

texts: I need to design my product page as a infinite scroll down.


texts: Custom design - issue with date (Please enter a valid date.)

texts:
When I try to change a date for custom design, I receive the following error message. "Please enter a valid date.". I'm enclosing the image. I'm using 1.9.2 version of Magento.

any suggestions?


texts: Import - Same SKU, Separate Base Images per Store View

texts:
I am working on Magento EE 1.13 with two store views. Some products are sold in both store views. I want each store view to have a unique base image for the product. I am working with Import/Export->Import.

The "image", "small_image", and "thumbnail" product attributes all have "store view" scope.

After import, each store view shows the correct base image, but the product image for store #1 displays as a thumbnail in the media gallery for the product in store #2.

Below is the format for the csv file I am using to import. The product image paths are relative to media/import/.

sku,_store,image,small_image,thumbnail
1234,store1,/store1/1234-store1.jpg,/store1/1234-store1.jpg,/store1/1234-store1.jpg
,store2,/store2/1234-store2.jpg,/store2/1234-store2.jpg,/store2/1234-store2.jpg

What do I need to change in my import csv file to not have the other store's image appear when I view the product on the front end?


texts: Magento2 - How to filter product collection on category view

texts:
I'm trying to add filters to a product collection on the category page.

I wanted to create an observer that listens to catalog_product_collection_load_before, but I found out that the even is not fired anymore in the changelog.

How can I filter the product collection, without this observer. Should I use a plugin? Where to start?


texts: Browse only images while upload in phtml form in magento

texts:
I want to upload image file. When I click browse button. the browser window show all files.I want only image file.I tried this link https://stackoverflow.com/questions/16832255/show-only-image-files-in-input-type-file-browse-window

When I click browse button, the below browser window appears,

How to fix this...


texts:
I upgraded my 2.1.0 store from the Admin and the console stated it completed successfully. However my Admin and frontend are now displaying the following error:

  Fatal error: Uncaught exception 'Magento\Framework\Exception\FileSystemException' with message 'The file "/home/extende/public_html/var/generation/Magento/Theme/Model/ResourceModel/Design/Config/CollectionFactory.php" cannot be deleted Warning!unlink(/home/extende/public_html/var/generation/Magento/Theme/Model/ResourceModel/Design/Config/CollectionFactory.php): Permission denied' in /home/extende/public_html/vendor/magento/framework/Filesystem/Driver/File.php:382 Stack trace: #0 /home/extende/public_html/vendor/magento/framework/Filesystem/Driver/File.php(405): Magento\Framework\Filesystem\Driver\File->deleteFile('/home/extende/p...') #1 /home/extende/public_html/vendor/magento/framework/Filesystem/Driver/File.php(403): Magento\Framework\Filesystem\Driver\File->deleteDirectory('/home/extende/p...') #2 /home/extende/public_html/vendor/magento/framework/Filesystem/Driver/File.php(403): Magento\Framework\Filesystem\Driver\File->deleteDirectory('/home/extende/p...') #3 /home/extende/public_html/vendor/magento/framework/Filesy in /home/extende/public_html/vendor/magento/framework/Filesystem/Driver/File.php on line 382


texts: Product attribute backend_type changing from int to varchar :Magento 2.1.1

texts:
I have created one product attribute for custom sorting by InsatllData , but if am updating any field from admin the backend_type getting change from int to varchar because of that sorting getting disturbed.

Here is my InstallData.php

<?php

namespace Vendor\Productattr\Setup;

use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Type;
use Magento\Catalog\Model\Resource\Eav\Attribute;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;
    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        /* assign object to class global variable for use in other class methods */
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
         $setup->startSetup();
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        /**
         * Add attributes to the eav/attribute
       */
       $eavSetup->addAttribute(
         \Magento\Catalog\Model\Product::ENTITY,
       'sorting_attribute',
       [
       'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'Sorting Attribute',
        'input' => 'text',
        'class' => '',
        'source' => '',
        'global' => 1,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => 0,
        'searchable' => false,
        'filterable' => false,
        'comparable' => true,
        'visible_on_front' => false,
        'used_in_product_listing' => false,
        'unique' => false,
        'apply_to' => 'simple,configurable,virtual,bundle,downloadable,grouped',
        'group'=> 'General'
       ]
      );

       $setup->endSetup();
    }
}


texts: Magento 2: Difference between Models and Data Models

texts:
I'm aware that Magento 2 introduced data models as part of the service contract architecture. Data models usually implement interfaces defined in Api/Data/ of a module.

But, Magento seems to have retained the old models too.

Let's take an example to module-customer.

Data model interface defined in Api/Data/CustomerInterface.php
The above interface is implemented in Model/Data/Customer.php
The data model has all the getter and setter function for the customer variables, as one would expect
In addition to the above there is also a Model/Customer.php. This too has getter and setter function. This is more like a Magento 1 model that connects to the ResourceModel (Model/ResourceModel/Customer.php)
In Model/ResourceModel/CustomerRepository.php, various function collect data from the Magnento 1 model, transfer them to the data model, and then return the data model.

Why does one need the old model? Why can't the data model directly connect with the ResourceModel?


texts:
We try to add the invoice status column to the sales order grid.

We added the code beneath to the prepareCollection function:

$collection->getSelect()->join('sales_flat_invoice', 'main_table.entity_id = sales_flat_invoice.parent_id',array('state'));

And the code beneath to the prepareColumns function:

$this->addColumn('state', array(
    'header'    => Mage::helper('sales')->__('Invoice Status'),
    'index'     => 'state',
    'type'      => 'options',
    'options'   => Mage::getResourceModel('sales/order_invoice_collection')->addAttributeToSelect('state'),
));

We got the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_flat_invoice.parent_id' in 'on clause'

What is going wrong?


texts: Which authentication to use for a REST client with Magento 2.1?

texts:
I am due to develop a REST client (C#) which will be used for updating stock/customers/products etc. for a Magento 2.1 instance on a remote server.

I think that I should use Token based authentication for my client - namely, obtain a token based on uesrname/password and then send this token with each and every subsequent request.  See here for my motivation in using a token.

However, on reviewing nickvane's answer (for Magento 1.x) it seems that OAuth authentication was used.  This review has caused me to reconsider my initial choice of Token based authentication for Magento 2.1.

I already have some C# client code that uses token based authentication and it seems to be working well.  I have tried for about 1-2 days to get OAuth authentication working but I haven't yet succeeded.

Could somebody who has more experience in this field please advise me if I am on the right track by using token based authentication for my client?


texts: What is \Magento\Framework\DataObject do

texts:
Can anyone explain what is \Magento\Framework\DataObject do?
I use it but I don't understand its core purpose Or which tables it deals with.


texts: Magento2 (v2.2) Error Login Admin + Frontend

texts:
I'm having a lot of trouble getting an error fixed on my Magento2 installation (version 2.2). It occurs when logging in at admin (backend) or at account login on the frontend.
Please find below the entries in the log. Would anyone have a hint or clue how to solve this? Any help is highly appreciated.

Many thanks.

  -U

  [Mon Nov 06 04:24:18.998328 2017] [proxy_fcgi:error] [pid 30863:tid
  139625581967104] [client xx.xx.xx.xx:51374] AH01071: Got error 'PHP
  message: PHP Fatal error:  Uncaught Error: Class
  'Zend\Db\Sql\Expression' not found in
  /var/www/webdir/html/vendor/magento/module-captcha/Model/ResourceModel/Log.php:82\nStack
  trace:\n#0
  /var/www/webdir/html/vendor/magento/module-captcha/Model/DefaultModel.php(345):
  Magento\Captcha\Model\ResourceModel\Log->logAttempt('john')\n#1
  /var/www/webdir/html/vendor/magento/module-captcha/Observer/CheckUserLoginBackendObserver.php(61):
  Magento\Captcha\Model\DefaultModel->logAttempt('john')\n#2
  /var/www/webdir/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72):
  Magento\Captcha\Observer\CheckUserLoginBackendObserver->execute(Object(Magento\Framework\Event\Observer))\n#3
  /var/www/webdir/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60):
  Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Captcha\Observer\CheckUserLoginBackendObserver),
  Object(Magento\Framework\Event\Observer))\n#4
  /var/www/webdir/html/vendor/mag...\n', referer:
  https://www.webdir/admin/admin/index/index/key/11a9fc911e4a89d53e03d14a32dbcd76a057cfdf642ce2af4526fe4cc9339542/


texts: Dynamic display of shipping options based on customer address

texts:
I'm new to Magento and our website supports different custom shipping options, e.g. within the hour, tonight, overnight, etc.

What I want to do is if the customer is at a particular location, I have to disable certain shipping options.

E.g.

Auckland (within the hour, tonight and overnight) are available.
Wellington (overnight) is available.

Thanks in advance


texts: Store switcher gives 404 error with customer logged in and folder structure in Base URL

texts:
Did you ever face 404 Error when the customer is logged in and switching the store switch with having folder structure is Base Url?

Something like, Base Url is http://examplemagento.com/b2c/

I have noted that while switching the store it redirects to this controller Magento\Store\Controller\Store\SwitchRequest.php


texts: Magento2: URL re-write issue with prameters?

texts:
trying to re-write the url but it not hitting the target link having '?' in that .

for example:

request path: http://localhost/test/data/products

traget path : http://localhost/new/vendors?id=5&type=new

i want to achieve the above format but its giving "404: The page you requested was not found".

Note: I am able to hit the urls without "?" in it.


texts:
I have an error in the database.

The problem occured in the index, Catalog search index, and I can't reindex data.
I deleted all files in /var/locks and tried to do it manually with the command php shell/indexer.php --reindexall but I only get an error message for the above mentioned index.

Now I try to use the db repair tool.

I tried to setup a test environment but I cannot make a database dump.

When I try to make a database dump I get following error message:

  mysqldump: Got error: 145: Table './dbname/catalogsearch_fulltext' is
  marked as crashed and should be repaired when using LOCK TABLES

So, what do i do now?


texts: I want to apply custom discount of some percentage to cart total in magento 2

texts:
How to apply custom discount of some percentage like (10%,20%) of cart total once he chose use custom discount button and if he want to remove the custom discount from the cart total in front end how can i proceed.

I want to show same as apply discount code section.in frontend

thanks in advance


texts: Argument problem when passed to Model in custom extension

texts:
this model extend Magento\Framework\Model\AbstractModel called in new controller from backend grid created with a uiComponent

public function __construct(
    \Magento\Framework\Model\Context $context, //required
    \Magento\Framework\Registry $registry, //required
    \Vnecoms\BannerManager\Model\ResourceModel\Banner $resource, //required
    \Vnecoms\BannerManager\Model\ResourceModel\Banner\Collection $resourceCollection, //required
    \Vnecoms\BannerManager\Model\BannerFactory $bannerFactory, //optional
    \Magento\Store\Model\StoreManagerInterface $storeManager, //optional
    \Magento\Framework\Logger\Monolog $monolog, //optional
    array $data = []
) {
    parent::__construct($context, $registry, $resource, $resourceCollection, $data);
    $this->_storeManager = $storeManager;
    $this->_bannerFactory = $bannerFactory;
    $this->_monolog = $monolog;
    if ($storeViewId = $this->_storeManager->getStore()->getId()) {
        $this->_storeViewId = $storeViewId;
    }
}

Everything seem ok but after i clear cache, generation
Magento show error Recoverable Error: Argument 4 passed to Vnecoms\BannerManager\Model\Banner::__construct() must be an instance of Vnecoms\BannerManager\Model\ResourceModel\Banner\Collection, instance of Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult given

my di.xml

<virtualType name="Vnecoms\BannerManager\Model\ResourceModel\Banner\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">ves_bannermanager_banner</argument>
        <argument name="eventPrefix" xsi:type="string">ves_banner_grid_collection</argument>
        <argument name="eventObject" xsi:type="string">banner_grid_collection</argument>
        <argument name="resourceModel" xsi:type="string">Vnecoms\BannerManager\Model\ResourceModel\Banner</argument>
    </arguments>
</virtualType>

Tested in php 5.5.15 magento 2.02
How to fix it


texts: Magento 2 - overriden class extending overriden class not working

texts:
I have overriden the class Magento\Catalog\Block\Product\ProductList\Upsell with my own Company\Base\Block\Product\ProductList\Upsell.

The class Magento\Catalog\Block\Product\ProductList\Upsell extends \Magento\Catalog\Block\Product\AbstractProduct.

Now I have overridden \Magento\Catalog\Block\Product\AbstractProduct with \Company\Base\Block\Product\AbstractProduct and added a new method:

public function testAbstractMethod()
{
    echo "test abstract works";
}

I added

<?php exit($this->testAbstractMethod()) ?>

to the template of the class Magento\Catalog\Block\Product\ProductList\Upsell:

app\design\frontend\MyTheme\Base\Magento_Catalog\templates\product\list\items.phtml:

But I get:

  Invalid method Company\Base\Block\Product\ProductList\Related\Interceptor::testAbstractMethod

But if I add the method testAbstractMethod() to the original core class \Magento\Catalog\Block\Product\AbstractProduct then it works.

So it looks like only the first class is getting overriden and if this class extends another class which is overriden by dependency injection, then it wont work and load the original class?


texts: Problem with image when add block to page in admin

texts:
I have a problem with product block. I want to add block in admin to show list of product to home page, but image's path has problem, the "/" symbol was replaced with %5C

Present path:

/pub/media/catalog/product%5Ccache%5C64d10833f60a300a76b4e8c2b9c15b46%5C//b/o/botanical_interests_bean_seeds_1.png

I want to fix:

/pub/media/catalog/product/cache/64d10833f60a300a76b4e8c2b9c15b46///b/o/botanical_interests_bean_seeds_1.png

Just replace %5C by /, image will be shown. I am using windows 10


texts:
Your current PHP memory limit is 128M. Magento 2 requires it to be set to 756M or more. As a user with root privileges, edit your php.ini file to increase memory_limit. (The command php --ini tells you where it is located.) After that, restart your web server and try again.

i am trying the above but its not working for me .can anyone help me how to solve this ?


texts:
How to pass option value dynamically in Magento 2 using ko.

web/template/minicart/item/default.html

I want the loop

for(i=0;i<=5;i++){
 <option>i</option>}

But I can able to pass only static value in option

<select data-bind="attr: {
                             id: 'cart-item-'+item_id+'-qty',
                            'data-cart-item': item_id,
                            'data-item-qty': qty,
                            'data-cart-item-id': product_sku
                             }, value: qty">
                            <option>1</option>
                            <option>2</option>
                            <option>3</option>
                            <option>4</option>
                        </select>

How to do this?If anyone knows that please explain me


texts:
I can't figure out how add a product to the cart via a "querystring" with custom options in  Magento 1.8. CE I do know about the form key but that hasen't helped me yet.

Here's what I have tried! But it always goes back to the product page and tells me that I have not provided the required option.
  http://mydomain.com/checkout/cart/add/product/8/qty/2/options[1]/2/form_key/1tIQKeqKeloqlBzL/

This on the other hand takes me to the shooping cart, but it's empty when I get there.
http://mydomain.com/checkout/cart/add?product=[9]&qty=[3]&options[1]=[3]&form_key=[1tIQKeqKeloqlBzL]

Has someone solved this?


texts: How can I move my cart into my navigation instead of the header?

texts: No one seems to have the answer to this. I literally just want to move my cart from the default header position in the RWD theme into my navigation instead. How can this be done? thank you


texts: Calling Module URLs gives 404, action is always "noRoute"

texts:
I am creating my own module, and on very beginning I stuck on some problem. Calling controller actions through URL don't work.

app/etc/modules/Locatores_CpCode.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Locatores_CpCode>
            <active>true</active>
            <codePool>local</codePool>
        </Locatores_CpCode>
    </modules>
</config>

app/code/local/Locatores/CpCode/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Locatores_CpCode>
            <version>0.1.0</version>
        </Locatores_CpCode>
    </modules>
    <frontend>
        <routers>
            <cpcode>
                <use>standard</use>
                <args>
                    <module>Locatores_CpCode</module>
                    <frontName>cpcode</frontName>
                </args>
            </cpcode>
        </routers>
    </frontend>
</config>

app/code/local/Locatores/CpCode/controllers/IndexController.php

<?php
class Locatores_CpCode_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        die("whatever");
    }
}

I try to access my module through:

www.myshop.com/cpcode/index
www.myshop.com/index.php/cpcode
www.myshop.com/index.php/cpcode/index
www.myshop.com/index.php/cpcode/index/index

Through Xdebug I see that requested URLs are entering in IndexController, but action is always "noRoute".

If I hardcode $action variable in core for example:

$active = 'index';

Then controller action is triggered successfully, but of course that is no solution.


texts: Problem with method called from two observer

texts:
I have an action in order list called "SEND"(shipment) which runs smoothly and there modelA_observer salesOrderShipmentSaveBefore observer with the method and it works perfect.

I create a new action called "SEND_CUSTOM" which one observer called _modelB_observer imlementa also has a method called salesOrderShipmentSaveBefore.

The problem is that when I click on "SEND_CUSTOM" called me the two functions are executed and both codes (A and B). I disabled the observer _modelA_observer from _modelB_observer and achieve that when you click on "SEND_CUSTOM" would be executed only _modelB_observer code (fine). BUT,  when I click on the action "SEND" _modelA_observer not the code is executed and the log according to the code runs twice _modelB_observer.

I need that when the administrator click "SEND" _modelA_observer only the code is executed, and when you click on "SEND_CUSTOM" the code is executed only _modelB_observer. It is possible??

Thanks. (Magento 1.8)


texts: How I can display Links in add to cart success message?

texts:
One of my project when i'm clicking on the add to cart button it will display the success message but with links as plain html as follow-

You added Advance/Breaker Housing Screw & washer Pk/6 to your shopping cart.View CartContinue Shopping

How can I render these as clickable links.?


texts: On Dashboard amounts graph is not working in magento 1.9.4.1

texts:
We just changed our server and now on our magento dashboard orders graph is working but amounts graph is not working.

I tried many solutions like:
1. updated stats
2. reindexing
3. Changed api url to this:  const API_URL = 'http://chart.apis.google.com/chart';
and many more but nothing worked for me.

This is how the amount graph is looking on dashboard.

After adding onilab module my graph is looking like this:

Actually I think, the main problem is that it is not calculating tax,shipping and revenue for other intervals other than "This and last year interval" because for "This and last year interval", amounts graph is looking like this:


texts: Custom module phtml file for custom table data list and view like product in magento 1.9

texts:
I want to create a module example: manufacturer.
I want to give a link on the site when a user click on that a url will open like manufcaturer.php and it will show all the list of manufacturer later when a customer click on manufacturer name, it will open that manufacturer details page, Where some info about that manufacturer will be available and the  url be like: manufacture.php/manufacturer-name or manufacturer-details.php/manufacturer-name


texts: Magento Easy Responsive Banner Slider by Bassiwebs not working in magento

texts:
I am using Magento Easy Responsive Banner Slider by Bassiwebs and i can't get the banner slider on my homepage .
I have tried this code for slider .

{{block type='imageslider/imageslider' template='imageslider/imageslider.phtml'}}

But still it doesn't show the banner slider .


texts: Importing Products, Super attribute not allowing any other from that attribute be selected in admin panel?

texts:
I am having an issue with importing a defined configurable product not allowing anything from that attribute set to be selected from the admin panel. I am getting results like this

Here is an example of my configurable

Array
(
    [sku] => 63204
    [_store] =>
    [_attribute_set] => Belts
    [_type] => configurable
    [_category] =>
    [_root_category] =>
    [_product_websites] => base
    [fit_coats_jacket_sizes] =>
    [fit_vest_cruiser_sizes] =>
    [amconf_simple_price] =>
    [bag_size] =>
    [bag_type] =>
    [belt_width] =>
    [color] =>
    [cost] =>
    [country_of_manufacture] =>
    [created_at] => 2010-06-02 00:00:00
    [custom_design] =>
    [custom_design_from] =>
    [custom_design_to] =>
    [custom_layout_update] =>
    [description] => Descr
    [fabric] => Bridle Leather
    [gallery] =>
    [garment_size] =>
    [gift_message_available] =>
    [gift_wrapping_available] =>
    [gift_wrapping_price] =>
    [glove_size] =>
    [gun_scabbard_size] =>
    [has_options] => 1
    [hat_size] =>
    [image] =>
    [image_label] =>
    [inseam] =>
    [is_returnable] => Use config
    [manufacturer] =>
    [media_gallery] =>
    [meta_description] =>
    [meta_keyword] =>
    [meta_title] =>
    [minimal_price] =>
    [msrp] =>
    [msrp_display_actual_price_type] => Use config
    [msrp_enabled] => Use config
    [name] => 1" Leather Belt
    [news_from_date] =>
    [news_to_date] =>
    [options_container] => Product Info Column
    [page_layout] =>
    [price] => 52.00
    [related_tgtr_position_behavior] =>
    [related_tgtr_position_limit] =>
    [required_options] => 1
    [short_description] => Short Descr
    [small_image] =>
    [small_image_label] =>
    [special_from_date] =>
    [special_price] =>
    [special_to_date] =>
    [status] => 1
    [tax_class_id] => 2
    [thumbnail] =>
    [thumbnail_label] =>
    [updated_at] => 2014-10-14 16:42:33
    [upsell_tgtr_position_behavior] =>
    [upsell_tgtr_position_limit] =>
    [url_key] => 1-leather-belt
    [url_path] =>
    [visibility] => 4
    [weight] => 1.0000
    [qty] => 1.0000
    [min_qty] => 0.0000
    [use_config_min_qty] => 1
    [is_qty_decimal] => 0
    [backorders] => 0
    [use_config_backorders] => 1
    [min_sale_qty] => 1.0000
    [use_config_min_sale_qty] => 1
    [max_sale_qty] => 0.0000
    [use_config_max_sale_qty] => 1
    [is_in_stock] => 1
    [notify_stock_qty] =>
    [use_config_notify_stock_qty] => 1
    [manage_stock] => 0
    [use_config_manage_stock] => 1
    [stock_status_changed_auto] => 0
    [use_config_qty_increments] => 1
    [qty_increments] => 0.0000
    [use_config_enable_qty_inc] => 1
    [enable_qty_increments] => 0
    [is_decimal_divided] => 0
    [_links_related_sku] =>
    [_links_related_position] =>
    [_links_crosssell_sku] =>
    [_links_crosssell_position] =>
    [_links_upsell_sku] =>
    [_links_upsell_position] =>
    [_associated_sku] =>
    [_associated_default_qty] =>
    [_associated_position] =>
    [_tier_price_website] =>
    [_tier_price_customer_group] =>
    [_tier_price_qty] =>
    [_tier_price_price] =>
    [_group_price_website] =>
    [_group_price_customer_group] =>
    [_group_price_price] =>
    [_media_attribute_id] =>
    [_media_image] =>
    [_media_lable] =>
    [_media_position] =>
    [_media_is_disabled] =>
    [_super_products_sku] => 63204242204
    [_super_attribute_code] => color
    [_super_attribute_option] => Tan
    [_super_attribute_price_corr] =>
)

After importing a csv with contents like the pastebin below. What am i doing wrong? I've been struggling with this for hours?

http://pastebin.com/neUxKy2g


texts: Integrity constraint violation: 1062 Duplicate entry for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME'

texts:
I've created a custom module that includes a script (InstallData.php) that adds a new attribute to an existing attribute group (Product Label):
'group' => 'Product Label'

However, when I enable the module and run setup:upgrade, I receive the following error:
Installing data... SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '10-Product Label' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME', query was: INSERT INTO `eav_attribute_group` (`attribute_set_id`, `attribute_group_name`, `sort_order`, `attribute_group_code`) VALUES (?, ?, ?, ?)

If I run the following database query I can see that there are two records with the group name 'Product Label', however I don't see these
as duplicates as they belong to attribute set 10, and 4 respectively.
MariaDB [max]> select attribute_group_name, attribute_set_id from eav_attribute_group where attribute_group_name = 'Product Label';
+----------------------+------------------+
| attribute_group_name | attribute_set_id |
+----------------------+------------------+
| Product Label        |                4 |
| Product Label        |               10 |
+----------------------+------------------+
2 rows in set (0.00 sec)

Furthermore, I'm unable to delete these records as it will cause the attributes that are currently under those attribute labels to lose their current values.
Does anyone know what may be causing this issue? I have verified that the InstallData.php script works, by adding the attribute to the default group, this issue only occurs when adding the attribute to the attribute group 'Product Label'.


texts: Magento 1.9 Google Custom Search Form - CSS Help

texts:
Using Magento 1.9 with Google Custom Search - and RWD theme. Everything looks good on mobile, but when I resize the desktop window, the "GO" button on my search form gets cut off. I have tryed everything to figure out whats happening here. Can anyone help? Here is the link to the site to see the problem:

www.drmaxpowers.com


texts: How to send order detail in another server when user place order?

texts:
I am trying to create observer on event sales_order_save_after but the event can't connect observer method. Please help me i am helpless?

My xml file:

<?xml version="1.0"?>
<config>
   <modules>
        <Jeweldroship_Checkoutcomments>
            <version>0.1.0</version>    <!-- Version number of your module -->
        </Jeweldroship_Checkoutcomments>
    </modules>
    <frontend>
     <events>
       <sales_order_save_after>
         <observers>
            <jeweldroship_checkoutcomments>
                <type>singleton</type>
                <class>jeweldroship_checkoutcomments/observer</class>
                <method>salesOrderSaveAfter</method>
            </jeweldroship_checkoutcomments>
         </observers>
       </sales_order_save_after>
     </events>
    </frontend>
</config>

My Observer.php

<?php
class Jeweldroship_Checkoutcomments_Model_Observer
{
    public function salesOrderSaveAfter($observer) {
         $resource = Mage::getSingleton('core/resource');
         $writeConnection = $resource->getConnection('core_write');
         $sql = "insert into mg_order_log set order_id='1',created=".time();
         $writeConnection->query($sql);
         echo "Product has been imported successfully.";
    }
 }
?>


texts:
I need to remove global messages. I did put following to local.xml

<remove name="global_messages" />
<remove name="messages" />

but messages still appear. I also tried to comment out following lines in page.xml

<block type="core/messages" name="global_messages" as="global_messages"/>
<block type="core/messages" name="messages" as="messages"/>

which also did not work. Notice messages still appear. Where are the messages still coming from if commented out in page.xml?
and Yes, I did flush Magento cash.


texts: How to update value and label in attribute REST API Magento2

texts:
I have an attribute manufacturers, it has a value, I want to select them and change which I need using Rest API

I tried sending a request like this

  http://magengree/rest/V1/products/attributes/manufacturer/1/options

i got this Response

Response {
    "message": "Request does not match any route."
}

How can I do that ?


texts: How to set value for radio button in EAV attribute of product type?

texts:
We can add simple boolean Radio buttons as EAV attribute in install schema by this code:

    "type"     => "int",
    "backend"  => "",
    "label"    => "Test",
    "input"    => "boolean",
    "source"   => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
    "visible"  => true,
    "required" => true,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => ""

But if we want to add more than two options or other than 'Yes'/'No' Type then how to achieve this. I guess this could be in source attribute but have no idea how return the options in custom file i.e. to which file extends or implements and which function need to be used. I am unable to find the answer anywhere else. Thanks


texts: Magento Update CMS Pages / Blocks Programmatically

texts: I need to update the store view of all my CMS Pages and Static Blocks programmatically, but I have been unable to find any solution for the same. Is there any option available through code, or should I do the same using MySQL.


texts: magento 2 admin redirect loop after multistore configuration

texts:
Installed Magento 2 locally successfully locally on MAMP. Added a second store and edited .htaccess and index.php accordingly for a multistore environment.

I then edited the Base URL and Secure Base URL for store 1 to the new url and the admin now goes in a redirect loop.

So when I try to log in to the admin, example: admin.com/admin_12345, it tries to redirect to the store 1 url store1.com/admin_12345 and ends up being a continuous loop until the browser fails.


texts: How to get custom option value and title from ids in magento 2

texts:
How to get product custom option value and title from ids, I have following ids

[0] => stdClass Object
        (
            [option_id] => 3283
            [option_value] => 8893
        )

i want to get title of option_id(id) and value of option_value(id)


texts: Issue in override admin block in magento 2

texts:
I have override Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Items.php file, Its overided, When I am executing process, system calling respective _beforeToHtml() function from my file.

But at the end of function here is a line of code  -  return parent::_prepareLayout();
That creating issue I think because on the page it's showing nothing. And also not giving any error.

Here is code  -

`

namespace Customcode\Productserialno\Block\Sales\Adminhtml\Order\Invoice\Create;

class Items extends \Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Items
{
    protected function _beforeToHtml()
    {
        $onclick = "submitAndReloadArea($('invoice_item_container'),'" . $this->getUpdateUrl() . "')";
        $this->addChild(
            'update_button',
            'Magento\Backend\Block\Widget\Button',
            ['class' => 'update-button', 'label' => __('Update Qty\'s'), 'onclick' => $onclick]
        );
        $this->_disableSubmitButton = true;
        $submitButtonClass = ' disabled';
        foreach ($this->getInvoice()->getAllItems() as $item) {
            /**
             * @see bug #14839
             */
            if ($item->getQty()/* || $this->getSource()->getData('base_grand_total')*/) {
                $this->_disableSubmitButton = false;
                $submitButtonClass = '';
                break;
            }
        }
        if ($this->getOrder()->getForcedShipmentWithInvoice()) {
            $_submitLabel = __('Submit Invoice and Shipment');
        } else {
            $_submitLabel = __('Submit Invoice');
        }
        $this->addChild(
            'submit_button',
            'Magento\Backend\Block\Widget\Button',
            [
                'label' => $_submitLabel,
                'class' => 'save submit-button primary' . $submitButtonClass,
                'onclick' => '',
                'disabled' => $this->_disableSubmitButton
            ]
        );
        try{
        return parent::_prepareLayout();
        } catch(Exception $e){ echo $e->getMessage();die;}
    }
}

Here I override only "onclick" value of 'submit_button'.

Plz, let me know what I am doing wrong.

Thanks


texts:
The current website running on Magento 2.2.4 CE and we have enabled varnish cache.

How do we know if varnish cache is working or not in Magento 2?

Please advise?


texts: Magento EE upgrade from 2.1.11 to 2.3.2 Error

texts:
I have upgraded the Magento version from Magento EE 2.2.11 to 2.3.2 via composer after the upgrade is completed I am running the below command

php bin/magento setup:upgrade

I am getting the below error.

  Notice: Undefined index: column in
  /var/www/html/TTM/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php
  on line 196

Any answer?


texts: Want to get meta_title ( Page Title in category )

texts:
I want to add to get page title in title tag (of head )
i tried

<?php if ($_category->getMetaTitle()):?>
    <?php echo $_helper->categoryAttribute($_category, $_category->getMetaTitle(), 'meta_title') ?>
<?php else: ?


texts: Magento 2 local development incredibly slow, on powerful mac

texts:
When I say slow, I'm talking about over 3 minutes to load the customer signup page, which doesn't even do a db call!
I have a 2015 imac with 32gb ram, and a 50% empty ssd.
I'm not using any VM, just apache installed with Homebrew, and php 7.2, with 8092M of memory allocated. I updated the memory in both php.ini and .htacess file.
I have all caches enables, css/js minification turned off.
I disabled the browser cache, because I'm doing js work this week.
I'm getting almost nothing done here, because of how slowly requests come through.
Any ideas? I figured that not using a VM would be better, right?


texts: Magento 2 New Module not appearing in admin Disable Modules Output

texts:
I am new to M2, and just adding a new module to a local devbox environment using PhpStorm IDE.  I've created the module several ways, rather, several modules, each a different way:

Magento 2 Code Generator
Pestle
Magicento 2

Each time, after I create the module I run:

bin/magento module:status

The module appears as a disabled module, great!

I run: bin/magento module:enable Newvendor_Newmodule

If I rerun module:status it now appears as enabled

I run: bin/magento setup:upgrade

So far so good, but when I look in admin Stores -> Configuration -> Advanced -> Advanced  the module is NOT in the list... what?

I have cleared cache (several times), disabled the modules, re-enabled them, created new ones... I cannot figure out why they do not appear in admin, but the magento CI "sees" them?

I noticed this while I was trying to debug a simple M2 Frontend Controller Tutorial from Alan Storm.  It seems like I must be doing something wrong, but I'm not sure what?

Example of Module contents (inside of app/code/Vendor/Testmodule/)

registration.php

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

etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Testmodule" setup_version="0.0.1" >
</module>


texts:
I can't find the correct code to check if my Magento 2 site is visited by Mobile.
These are the two codes that I tried in the header.phtml file in my custom theme but they don't work:

$userAgent = $this->getRequest()->getHeader('useragent');
$server = $this->getRequest()->getServer();
$isMobileDevice = \Zend_Http_UserAgent_Mobile::match($userAgent, $server);
if($isMobileDevice) {
    echo 'is mobile';
}

if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($_SERVER['HTTP_USER_AGENT'],0,4))) {
    echo 'questo è mobile';
}

How can i do? Thanks


texts:
Currently on my site I offer 5 methods of shipping:

3 - 5 day shipping , recorded delivery , special next day , courier , special saturday.

By default 3 - 5 day delivery is charged at 4.50 unless the order is greater than £70 then they get this for free. I have a shipping rule set up for this.

This issue I am having when the total value is over £200 then the user qualifies for free courier but the option checks by default but doesn't change it to free it just shows the price next to it?

Forgot to add I am using webshopapps matrix rates


texts:
Required database backup files with theme.

I have build custom theme but need to get all static block data as well as cms pages database script and other required layout updates with theme deployment.

Note: no need to get all database. only required tables and static block, cms pages and layout updates need for theme Deployment.

Any help welcome and get +1 if some help i will get.


texts:
How to Remove SID query from Magento 2.1.2 URLs

I have already tried following solution but din't work for me
How to remove SID (session ID) from URL in Magento 2
How to remove SID from URL?
http://inchoo.net/dev-talk/remove-sid-from-magento-urls/
https://www.acunetix.com/vulnerabilities/web/php-session-use_trans_sid-enabled


texts: Checking if customer is logged in only working on account pages

texts:
So, I followed the steps in the 2nd answer (by Miroslav Petroff) on this question: How can i check whether user is logged in or not in magento 2.0

The if statement only works correctly when viewing pages like Wishlist, My Account, Cart, etc. Currently on the Homepage, Catalog pages, Product pages, and possibly others, my if statement is returning 'not-logged-in'.

if ( $helper->isLoggedIn() ):
echo ' logged-in';
else:
echo ' not-logged-in';
endif;

Anyone ideas what might make these pages return different results?


texts: Best way of implementing part exchange sale on magento?

texts:
I'm building an online shop using Magento framework which will provide part exchange sales. Customer will select a product from catalog and finally he will place an order. Shop manager will go thrugh the order details and contact the customer to complete the order. Customer will decide to give back his old product as part - exchange for the order. We need to inform customer on invoice that part exchange took place and his order was discounted by eg. USD 100.

Best way of doing this is product with custom and negative price, but this is not allowed in Magento.

Is there any other way to achieve that ?


texts: Group and count orders by custom delivery date attribute

texts:
I have a custom attribute delivery_date set for my orders however I want to create a collection that groups all these dates together and tells me the order count for each date. I have attempted with something like below and other methods however not having much like in returning anything:
$orders = $this->_orderCollectionFactory->create()->addAttributeToSelect('*')->addFieldToFilter('delivery_date', array('gteq' => $fromDay))->getSelect()->columns(['count' => new \Zend_Db_Expr('COUNT(delivery_date)')])->group('delivery_date');

How can this be achieved?


texts: Product collection sort order by custom skus string, when the sku has a hyphen in it, it will result a error

texts:
Product collection sort order by skus could use $collection->getSelect()->order(new /Zend_Db_Expr("FIELD(e.sku, $skus)")); (Magento 2: Order product collection by the order string(skus, ids etc) given, not DESC or ASC), but when sku has a hyphen in it, it will result a error like below.

Example:

$skus = "24-MB04,24-MB01";
$collection->addAttributeToSelect('*')
        ->addAttributeToFilter(
            'sku', array('in' => $skus)
        );
$collection->getSelect()->order(new /Zend_Db_Expr("FIELD(e.sku, $skus)"));

Result:

Error filtering template: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'MB04' in 'order clause', query was: SELECT `e`.*, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e` LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (`e`.`sku` IN('24-MB04', '24-MB01')) ORDER BY FIELD(sku, 24-MB04,24-MB01)

Obviously, the hyphen(-) in the sku(24-MB04) result the Unknown column 'MB04' in 'order clause' error, because when the sku doesn't have hyphen(-) in it, the codes work well, so how to fix the problem?


texts: We're building a Magento site for a client, but we've bumped into a major issue. The client is asking us to install a FedEx shipping module, but we can't integrate it with our store as they have informed us that FedEx don't ship in our country.


texts: Static block store_url is appending a session id placeholder in url

texts: Using a url in static block like this {{store url=door-machinery.html}} and getting this on the end ?<!--%20fpc%20session_id_placeholder%20-->. Any idea what's causing this and how to resolve?


texts: Unable to install any extension using magento connect manager No Answer?

texts:
I have installed a fresh magento 1.9 on my vps running with nginx. My root folder of magento is /var/www/abc.hello.com/datazone/ and also set ownership as www-data as user and www-data as group (www-data nginx user). every thing goes fine while installing magento, did not show any permission error.

After installing magento, I go to admin pane system -> magento conncet -> magento connect manager, did not show any permission error on magento connect manager then i try to install
"PageCache powered by Varnish" with Magento Connect 2.0 key, i paste the extension key to install, then clicked on proceed to install. In magento connect manager console at bottom it show

checking dependencies of packages
starting to download Varnish_Cache-4.0.5.tgz ...
...done: 34,730 bytes

It does not further move to installation process.

Is the problem of my installation? or permission problem ? or some think else ? I am unable to install any extension due to this big problem. I am new in magento :) Thanks in Advance.


texts: block type="core/template" template="template.phtml" for specific category

texts:
I'm using a cms block as  homepage's new products.

In this block I can choose from which category it show me products ( from all categories, only from category n°1, only from category n°2 ecc. )

I want to use this block also into the category n°1 and I want to display here only products from this category.. How can I do this?


texts: Magento 2 : Show custom table data in grid

texts: I have created a form and the data of that form is saving in a custom table. Now I want to create a grid in admin which shows the saved data in that table. Please help


texts: Ignore controller or action in ReferrerUrl - Magento 1.9

texts:
I have some issue with redirectReferrer().
When I add a product in cart, I do it with ajax (call : http://wwwww.ww/quickview/product/add).

Until here, everything is ok, but, if I want to remove product from my cart, the deleteAction() redirect me to http://wwwww.ww/quickview/product/add with the method

$this->_redirectReferer(Mage::getUrl('*/*'));

Is it possible to ignore a whole Controller or just an Action in
_redirectReferer, without any modification in the `deleteAction()??

I tried this Mage::getSingleton('customer/session')->setNoReferer(true);, but it doesn't seem to work.


texts:
I want to change Magento short by drop down in

Please suggest me


texts: How to get the items orders by the customer in the order collection?

texts:
I need to get the collection of orders with the the items ordered by using the customer ID. But I am not getting the items ordered in my collection. Please help.

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $order = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->addAttributeToFilter('customer_id', $captinId)->setOrder('entity_id',$direction)->setPageSize($pageSize)->setCurPage($currentPage);
                $orderResult = $order->getData();
return $orderResult;


texts: How can i set auto cache and reindex using cron

texts: I need to set magento all cache and magento reindex automatically, how can i done by using cron.


texts: update and data: elems in shipping-address/list.html

texts:
I've created a module to customise some of the functionality of the checkout in Magento 2.

In the template I'm using to override app/code/Magento/Checkout/view/frontend/web/template/shipping-address/list.html I would like to create and access a new element called addressSummary which just needs to be a concatenation of address().firstname & address().company.

<!-- ko foreach: { data: elems, as: 'element' } -->
    <li data-bind="click: selectAddress, visible: !isQuoteAddressLocked" class="action item">
        <!-- ko text: address().firstname --><!-- /ko --> <!-- ko text: address().company --><!-- /ko -->
        <!-- ko text: address().addressSummary --><!-- /ko -->
    </li>
<!-- /ko -->

I can add them easily with <!-- ko text: address().firstname --><!-- /ko --> <!-- ko text: address().company --><!-- /ko -->  but I need to have them in a single property so I can hopefully filter them later.


texts: CAPTCHA form not visible, after applying theme

texts:
I'm using magento 2.2, I've enabled Admin-Panel -> Store -> Customers -> Customer Configuration -> CAPTCHA and enabled it for following forms: "Create user", "Login", "Forgot password".

The "Login" case:
The captcha works well on default theme (LUMA theme).But when I'm using another theme, the Captcha image (or the Captcha form with message and image) is not showed up, and I'm ending up with "Incorrect CAPTCHA".

I tried to find any related forum thread about this, but I wasn't able to find something that is well described.
I checked all file permissions and those are OK, I've checked magento logs no exception there.

My theme has the following structure:
        /app/code
        /app/design/frontend/Theme_name/some_name/

This contain (beside others folders and files like /etc and so on) a theme.xml file that point to the parent_theme folder
    /app/design/frontend/Theme_name/parent_theme

On the parent_theme I have the
        /parent_theme/Magento_Customer/layout            - this contains "customer_account_login.xml" which is almost identical with the one from -> customer_account_login.xml  and to what I have on Magento-CE-2.2.2-2017-12-11-09-19-32/vendor/magento/module-customer/view/frontend/layout/customer_account_login.xml

From  what I could understand here will fill with the captcha form.

<container name="customer.login.container.before" htmlTag="div" htmlClass="col-sm-6 col-xs-12" before="-">
                    <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml">
                        <container name="form.additional.info" as="form_additional_info"/>
                    </block>
</container>

     parent_theme/Magento_Customer/layout/templates/form/login.phtml    - which is similar to [login.phtml][1]

In this file I have the getChildHtml('form_additional_info') ?>, only design is different.

I tried everything, I also overwrite those file with default one (from https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Customer/view/frontend/), design was changing but Captcha form wasn't showing up.

I tend to think that my theme is missing something, I read somewhere that captcha layout should be overwrite in order to make it visible but no detailed on how to do that.

Can someone who hit this problem, or has experience on making themes let me know what I'm missing?

Thanks,


texts:
In my registration form I need to add the Country field.
I would like to use the built-in countries dropdown of Magento. Via backend it is not possible to add it. How should I add it?


texts: How do I change the footer links in Magento's iPhone theme?

texts:
As you all know, Magento comes with a built-in iPhone theme for implementing a mobile theme to your ecommerce site. I understand for the most part on how to customize it. However, I cannot get the footer to change at all. The footer just has a link for "Contact Us" and that's it. I cannot find anywhere on how to customize the footer links to what I want. Does anyone have experience with this?

Feel free to browse to www.shademountainarmory.com on a mobile device and you'll see what I mean.


texts: Magento 2: What is purpose of .php_cs file?

texts:
The .php_cs file can be found on the root of the Magento installation.
I'd like to know how can I use it as well.


texts: Header Block not displaying in magento 2

texts:
https://www.nishatre.com/ is the live url for my website. ALl of a sudden my header block has disappeared.. Can anyone kindly help how to bring back the header block?

my header code -

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * @var \Magento\Theme\Block\Html\Header $block
 */

$welcomeMessage = $block->getWelcome();

$_config = $this->helper('Sm\Shiny\Helper\Data');
$headerStyle = $_config->getThemeLayout('header_style');
$compile_less = $_config->getAdvanced('compile_less');
$login_customer =  $block->getLayout()->createBlock('Magento\Customer\Block\Account\Customer');

if($login_customer->customerLoggedIn()){
    $loggedin = 'loggedin';
} else{
    $loggedin = '';
}

include (dirname(__FILE__).'/header-style/'.$headerStyle.'.phtml');
if( $compile_less ){
    include (dirname(__FILE__).'/compile_less.phtml');
}
?>

<?php
    if($_config->getAdvanced('show_newsletter_popup')){
        echo $block->getChildHtml('form.subscribe.popup');
    }
?>

<?php if($_config->getGeneral('menu_ontop') == 1){ ?>
    <script type="text/javascript">
        require([
            'jquery'
        ], function ($) {
            $window = $(window);
            if($('.header-bottom').length){
                menu_offset_top = $('.header-bottom').offset().top;
                function processScroll() {
                    var scrollTop = $window.scrollTop();
                    if ( scrollTop >= menu_offset_top) {
                        $('.header-bottom').addClass('menu-on-top');
                        $('body').addClass('body-on-top');
                    } else if (scrollTop <= menu_offset_top) {
                        $('.header-bottom').removeClass('menu-on-top');
                        $('body').removeClass('body-on-top');
                    }
                }
                processScroll();
                $window.scroll(function(){
                    processScroll();
                });
            }
        });
    </script>
<?php } ?>


texts: Problem programmatically saving url_key for category

texts:
I am using Magento CE 1.9.1.0.  I can't seem to get the category URL key to save properly.  If I add the category through the admin panel, everything works fine.  But I am trying to add the categories programatically.

The problem is that the url_key that I am setting is being ignored, and a differnet url_key is being generated based on the name of the category.

$storeId = 3; // my store ID
$parentId = 18; // the root category ID
$category = Mage::getModel('catalog/category');
$category->setName('Contact Us');
$category->setIsActive(1);
$category->setDisplayMode('PRODUCTS');
$category->setIsAnchor(0);
$category->setStoreId($storeId);
$parentCategory = Mage::getModel('catalog/category')->load($parentId);
$category->setPath($parentCategory->getPath());
$category->setUrlKey('customer-service-contact-us');
$category->setIncludeInMenu(false);
$category->save();
$savedCategoryId = $category->getId();
$category = Mage::getModel('catalog/category')->load($savedCategoryId);
var_dump($category->getUrlKey());
// I get 'contact-us' instead of 'customer-service-contact-us'

I expected to get 'customer-service-contact-us' for the url key, but instead I'm getting the auto-generated url key 'contact-us'.

Any insight would be greatly appreciated.  I've tried disabling all 3rd party modules, but the problem still happens.


texts: UK Catalog, Goods excluding VAT - rounding issues on front end display

texts:
On Magento2  (v2.0.7)

We are storing catalog values without tax. We want the front end display to show £9.99 inc tax - as the UK tax-inclusive product price.

I enter the prices ex-VAT in the backend, and have front-end display price+tax.

Question: What value do i have to enter to get a price of £9.99 (front end)?
Answer: £9.99/1.2 (VAT @ 20%) = £8.325

So i have to put £8.325 into the back end so that:

£8.325*1.2 = £9.99.

OK - so i do that......

But Magento only seems to store the price to 2DP. - so it stores

£8.33 (rounded up without me wanting it to)

so taking Magento's £8.33

£8.33*1.2 = £10.00 (displayed on front-end) <--- BUT I WANT 9.99!!

because to achieve a £9.99 inc VAT price you need to store £8.325 - 3DP, but Magento 2 doesn't.


texts: Magento filter on new colunm on catalog_product grid not working

texts:
I'm trying to add a column on the catalog_product grid on magento 1.9.0.1.
I want my column to contain the number of images of each product.

I have created an extension for that.

In config.xml

<catalog_product_collection_load_before>
    <observers>
        <event_sales_order_grid_collection_load_before>
            <type>singleton</type>
            <class>Group_Module_Model_Observer</class>
            <method>catalogProductGridCollectionLoadBefore</method>
        </event_sales_order_grid_collection_load_before>
    </observers>
</catalog_product_collection_load_before>
<core_block_abstract_prepare_layout_after>
    <observers>
    <add_column_product_by_categ_nbr_image>
        <type>singleton</type>
            <class>Group_Module_Model_Observer</class>
        <method>addNbImagesColonne</method>
        </add_column_product_by_categ_nbr_image>
    </observers>
</core_block_abstract_prepare_layout_after>

In observer.php :

public function addNbImagesColonne($observer){
            $block = $observer->getEvent()->getBlock();

            if(get_class($block) == 'Mage_Adminhtml_Block_Catalog_Product_Grid'){
                $block->addColumnAfter('nbrImages', array(
                        'header'    => "Number of images",
                        'width'     => '100px',
                        'index'     => 'nbImage',
                        'type'        => 'text',
                        'filter_index' => 'cpemg.nbImage',
                ), 'status');
            }
        }
public function catalogProductGridCollectionLoadBefore($observer)
    {

        $collection = $observer->getCollection();//get the collection

        $collection->calculateSizeWithoutGroupClause = true;//Correct the number of row return
        $select = $collection->getSelect();

        $select->joinLeft(
                array('cpemg' => Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_media_gallery')),
                'cpemg.entity_id=e.entity_id',
                array(
                        'nbImage' => new Zend_Db_Expr(' COUNT(cpemg.value_id)'),
                )
        );
        $select->group('e.entity_id');

    }

My column is working fine but when I try to filter products by the number of image, I have no error print and my grid does not show.

Could you tell me where my mistake is ?


texts: New order email confirmation not being sent

texts:
I have upgraded my website to 1.9.1 and now my customers are not receiving order confirmation email.

I tried sending through the admin panel but nothing happens, also no update email is being received.


texts: Magento 2 How to override "\vendor\magento\module-checkout\view\frontend\web\js\view\billing-address.js" in our custom module?

texts:
I want to disable "New Address" option from billing address drop down. here i got the code to disable it.

we just need to comment the below code : addressOptions.push(newAddressOption); and it will disable the option. but I need to override this file in my custom module and need to comment that code.

How can i override "billing-address.js" in my custom module?

Thanks.


texts: Magento2 swatch-renderer.js:1184 Uncaught TypeError: Cannot read property 'updateData' of undefined

texts:
I am getting swatch-renderer.js:1184 Uncaught TypeError: Cannot read property 'updateData' of undefined error on product details for some products. While debugging notice that I am getting an error to line gallery.updateData(imagesToUpdate); in swatch-renderer.js And because of that swatch.initialized trigger not working for some products.

I have searched a lot but fail to get the correct answer.

Please suggest another way to solve this conflict


texts:
I need to get a cross sell by website.

In Magento 1.9 you only get the related products by one website but for example the product XXXX exist por website A and C and this product have related products distinct in website A and C.

How can I get it?

Thank you!.


texts: Paypal Payment Pro Hosted not working with One Step Checkout

texts:
During checkout process when order is placed with Paypal Payment Pro Hosted, without asking any credential it successfully placed the order. The problem with the one step checkout extension. With magento default checkout,payment hosted is working fine.

For Debug,I gone through these steps and found every thing is already present.

The themename/template/checkout/onepage/review/info.phtml must
    include the following call, after the list of shopping cart items:

<?php echo $this->getChildHtml('items_after'); ?>

The corresponding layout file themename/layout/onestepcheckout.xml must
include the items_after block referenced above. So, the following
should appear within the checkout_onepage_review section of
onestepcheckout.xml:

<block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label"><label>Items After</label></block>

Once these two steps are done, the
frontend/base/default/template/paypal/hss/js.phtml file will be
automatically rendered in the review stage of the onestep checkout.

But still facing the problem.

Thanks


texts: Magento Coupon codes although deleted already, doesn't allow to create coupon with same code again

texts:
I am not sure if it's some kind of core-logic(unknown to me) or a bug maybe, but even though I have already deleted a coupon-code rule from "Shopping Cart Price Rules", when I search in the "salesrule_coupon" table the deleted coupon code, it still shows up.

What happens due to above scenario is that if I try to recreate the coupon-rule with same code, it doesn't allow me to do so and shows below message:

Coupon with the same code already exists.

Please enlighten me anyone and let me know how to delete coupon-rule with code completely and uniquely, so I can create coupon with same code again.

My magento version is ce-1.9.0.1


texts: Suggestion for a Magento Startup MultiStore Project

texts:
This is my first Magento project, and I am trying my level best to learn as early as possible, but still some doubts arise for which I need some guidance from Magento Experts.

In this project I am going to sell Grocery items, but some items are not available at some cities, so I plan to start the web site asking the customer their zip code and accordingly available products will display for that zip code area.

Initially I am starting with 1 city but within 1 month I will expand this for major 5 cities and gradually increase by states.

I welcome any suggestions for -

How can I get the a pop like shown in attached image when website open, initially I will take only 1 state, 1 city and multiple zip code for that city.

Depending on the city only available products should display.
Example- X product is available for City_1, City_4 and city_9 only, so only X   should come on product page for these 3 cities or for other cities it should display "Not Available".
Depending on the distance how to set shipping charge.

It will be very appreciable if you experts hold my finger show me the right way to move.


texts: Magento 2 : Added field for video, music ( mp4 , mp3) upload in admin form

texts:
I try to upload image, video or music player, for that I use $uploader->setAllowedExtensions(['mp4', 'mp3', 'jpg', 'jpeg', 'gif', 'png' ]);
, but it doesn't work. Anyone have idea about this problem? Any help would be appreciated.


texts:
My customer complaint they do not receive the email order. So I have to manually send them the invoice from the admin account.

What cloud be the issue?


texts: How to convert raw PHP Join Query into Magento Join Query

texts:
How to convert raw php LEFT JOIN query in to magento query?
What is Magentos syntax for?

Here is my query:

SELECT fieldsmanager_orders.value,sales_flat_order_address.entity_id
FROM fieldsmanager_orders
LEFT JOIN sales_flat_order_address ON fieldsmanager_orders.entity_id = sales_flat_order_address.entity_id;


texts: Add custom fields to Shipping Cart Price Rule and Catalog Price Rule

texts: I want to add one boolean field in each of Promotion Rule. Please can anyone suggest me how to proceed and which Model/Block need to be overridden.


texts: How To Change Base currency for a multi store site

texts:
How can I change the Base currency for a multi store site, currently I have a site with two store different currencies, and different payment gateway that requires the base currency to be set to this own country's base currency. But the Magento admin only allows me to set base currency on Default and does not give me the option to change the base currency on the other store.

How can I have base currency set according to store?

I am using Magento CE 1.9.2.4


texts: I want to edit the field of this column which exists in the sales order view edit billing address I want to know from which file this code is coming.


texts: Magento 2 - Database transaction for multiple model / resource model objects?

texts: If I have a logic that involve updating multiple model objects which will update a few tables in database, how to provide a database transaction to ensure the data integrity?


texts: Display Newsletter POP UP when customer leave page issue

texts:
We will show newsletter popup when customers leave the site Instead of showing popup on customers visit the site:

When customer is going to close the website?
When customer is going to go to another website?

How to do this.
Thanks.


texts: Magento2 Convert Images to Responsive for entire site

texts: Magento2 How can I convert entire website images to Responsiveas Google Page speed is recommending Images to be of proper size in Mobile


texts: Magento 2.3.4 not installed in windows, wamp server shows 500 internal server error

texts:
MAgento 2.3.4 not installed in windows, wamp server shows 500 internal server error
wamp server details
Apache/2.4.23 (Win64)
PHP/7.3.14 Server at 127.0.0.1 Port 82


texts: Configure Grunt to watch the overrided vendor module css - Magento2

texts:
I have included this module into my project via composer require:
https://github.com/JakeSharp/ProductSliderM2

This module has three css files that are being added to each page by the vendor/jakesharp/module-productslider/view/frontend/layout/default.xml handle:

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

Eeach css files have .less representatives in this folder:

vendor/jakesharp/module-productslider/view/frontend/web/css/.

I want to override:

vendor/jakesharp/module-productslider/view/frontend/web/css/slick.less .

I have added the slick.less file in my custom theme which has blank theme as parent:

app/design/frontend/Myvendor/mycustomtheme/JakeSharp_Productslider/web/css/slick.less

Configured my dev/tools/grunt/configs/themes.js to watch this file also, by:

mycustomtheme: {
    area: 'frontend',
    name: 'Myvendor/mycustomtheme',
    locale: 'ro_RO',
    files: [
        'css/styles-l',
        'css/styles-m',
        'JakeSharp_Productslider/css/slick' // <--- adding this line
    ],
    dsl: 'less'
}

When I clean var/* and pub/static/* folders and ask for this css file:

http://mysite.lh/static/frontend/Myvendor/mycustomtheme/ro_RO/JakeSharp_Productslider/css/slick.css

The file is loaded as expected, by compiling the .less from mycustomtheme instead the one from vendor/ .

But when I do grunt exec:mycustomtheme I receive this error:

Processed Area: frontend, Locale: ro_RO, Theme: Myvendor/mycustomtheme, File type: less.
-> css/styles-l.less
-> css/styles-m.less
>> [Magento\Framework\Exception\FileSystemException]
>>   The "/var/www/html/mysite/" file doesn't exist or not a file
>>
>>
>>
>> dev:source-theme:deploy [--type="..."] [--locale="..."] [--area="..."] [--theme="..."] [file1] ... [fileN]
>> Exited with code: 1.
Warning: Task "exec:mycustomtheme" failed. Use --force to continue.

Aborted due to warnings.

So the static deploy feature follows magento fallback mechanism but I am not capable on making grunt understanding the same thing and watch the slick.css file.

Many thanks for reading this long post!
Any help appreciated,

Thanks!


texts:
We have a template product with a sku of hcyb which has product information in the global scope and also for a sample store.  Here is the coding for that part:

$temp_prod_id = Mage::getModel( 'catalog/product' )
        ->getCollection()
        ->addAttributeToFilter( 'sku', 'hcyb' )
        ->load()->getFirstItem()->getId();

$template = Mage::getModel( 'catalog/product' )
        ->load( $temp_prod_id );

$newProduct = $helper->duplicateProduct($template);
$newProduct->setStoreId($storeId);

What that does is create a new series of EAV values so that $storeId is a new record.  What I WANT to do is make it so that the store_id for the template's store scope, when copied over, is changed, not adding the product to another store.

Can someone explain the process involved in this?  Apparently setStoreId is not the way to do this.


texts: You did not sign in correctly or your account is temporarily disabled. In Magento 2 Admin panel Token

texts:
I am getting this error

  "You did not sign in correctly or your account is temporarily
  disabled"

during generating admin token in magento 2.1.12.

But admin panel is login with same username and password.

I don't know what is issue.Please Help.


texts:
I do not understand what this error is and how it was produced ? I think it happend after I set up

SetEnv  MAGE_PROFILER   "html"

and after that I removed that line from the .htaccess file. And everything went to crap... I really do not understand why did the whole system broke... really...

In the result of this neither the frontend nor the admin is working.. as expected. Does anyone has a clue ? ?

PHP Fatal error:  Interface 'Magento\\Framework\\ObjectManagerInterface\xfc\xff\xff\xff'
not found  in /var/www/html/magento_dev/vendor/magento/framework/ObjectManager/ObjectManager.php on line 15


texts:
Magento 1.9.2.3
Extension Causing error: Ameex Admin Activity Logger (Commerce Bees)
Error in system.log - over and over again

  Full error: ERR (3): Notice: Uninitialized string offset: 0  in
  /MyServerInfo/public_html/app/code/community/Ameex/Adminlog/Model/Observer.php
  on line 27

Code from line 27 of Observer.php:

$currentId = $request->getParam($dynamicValues[0]);

Full section of code that seems related to this error:

$adminlog = Mage::getModel('adminlog/adminlog');
        $dynamicValues = $this->_getDynamicValues($controllerName);
        $currentId = $request->getParam($dynamicValues[0]);
        $storeId =  $request->getParam('store');
        $store = Mage::getModel('core/store')->load($storeId);

Otherwise the extension seems to work fine, but I would like to stop this error occurring. First of all because I'm not sure what it could be doing that I don't see and because it's filling up my system.log file and I don't like errors.
I contacted Extension creator, but there has been no response in several weeks.
Any help would be appreciated.


texts: I am beginner in Magento, I want to add csv file for attributes, as we have 500 attributes, so we can not upload it 1 by 1 because it takes time. Please suggest me simple way to upload attributes by using csv file?


texts: magento2 set default shipping adress in checkout

texts:
After checkout page is loaded and customer is loggedin I need to set default shipping adress like a screen.

Is in magneto2 settings for this or it needs to create extension?


texts: Show price with customer group vat on product page

texts:
I created an user group, it is associated with a different tax class ("reduced") compared to standard clients.

When I open a product  (I'm logged in as a user of the "reduced" fee), I see the price with the standard fee.
But if I add product to cart, I see the right price, with the reduced fee.

To show the price in use product:

<?php echo $_coreHelper->formatPrice($_product->getFinalPrice(),false,false);?>

How do I show the correct price also in the product?


texts: Magento 2.3.1 - Configurable products auto select first option

texts:
how I can auto select the first associated product in configurable product on Magento 2.3.1.

Thank you


texts: Change Products Images Dimensions in Catalog List Magento 2.1.6

texts:
I need to change the size of the images shown in the LIST format, but leaving the GRID format like this.
The first image shows how the page is currently in LIST mode.
The second image shows how I would like the products to be displayed
And the third image shows how the GRID is, I don't want to edit it!
First Image

Second Image

Third Image

I would appreciate your help! Thanks!


texts:
why can this be happening? it seems like i have space for the picture to be larger, and if i click on it it does open up pretty large.

so why such a small preview?


texts: Magento Controller Dispatch doesn't render

texts:
I followed this tutorial: blog.baobaz.com/en/blog/magento-module-create-your-own-controller but it doesn't work for me. My files:

/app/etc/modules/Baobaz_Arithmetic.xml

<?xml version="1.0" ?>
<config>
<modules>
    <Baobaz_Arithmetic>
        <active>true</active>
        <codePool>local</codePool>
    </Baobaz_Arithmetic>
</modules>
</config>

/app/code/local/Baobaz/Arithmetic/etc/config.xml file:

<?xml version="1.0" ?>
<config>
<modules>
    <Baobaz_Arithmetic>
        <version>0.1.0</version>
    </Baobaz_Arithmetic>
</modules>
<frontend>
    <routers>
        <arithmetic>
            <use>standard</use>
            <args>
                <module>Baobaz_Arithmetic</module>
                <frontName>arithmetic</frontName>
            </args>
        </arithmetic>
    </routers>
</frontend>
</config>

/app/code/local/Baobaz/Arithmetic/controllers/IntegerController.php

<?php
 class Baobaz_Arithmetic_IntegerController extends Mage_Core_Controller_Front_Action {
  public function multiplyAction(){
    echo "Respect my authoritah";
  }
 }
?>

I cleared the cache. When calling (...).com/arithmetic/integer/multiply I get 404 page. I run Magento 1.8.1.

How to fix this?


texts: Exclude specific frontend URL from https://

texts:
I have a Magento website and have enabled https:// across the whole site by configuring the unsecure Base URL. The site also uses the following API URL which CANNOT be https, but because of the config settings is redirects to https:

http://www.domain.com/index.php/api/v2_soap/index/?wsdl=1

Is there a way that I can exclude certain URLs from using secure URLs?


texts: Generic Class override and Problems for others Grid

texts:
Actually i had override the generic class to filter the orders for sales order grid.

<preference for="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" type="VendorName\ModuleName\View\Element\UiComponent\DataProvider\DataProvider"/>

It create problem for me in others grid like invoice grid , Shipment grid etc

My code is there for filter order

 protected function searchResultToOutput(SearchResultInterface $searchResult)
    {
        $arrItems = [];
        $arrItems['items'] = [];
        foreach ($searchResult->getItems() as $item) {
            $itemData = [];
            foreach ($item->getCustomAttributes() as $attribute) {
                $itemData[$attribute->getAttributeCode()] = $attribute->getValue();
            }
            $arrItems['items'][] = $itemData;
            $arrItems['totalRecords'] = $searchResult->getTotalCount();
        }
        //custom code//
        $currentUser=$this->getCurrentUserId();
        $seller_order_arr = [];
        foreach ($arrItems['items'] as $row) {
            if ($row['current_seller_id'] != null){
                if (in_array($currentUser, explode(",", $row['current_seller_id']))){
                    $seller_order_arr[] = $row;
                }
            }
        }
        $arrItems['items'] = $seller_order_arr;
        $arrItems['totalRecords']=$this->getTotalOrder($seller_order_arr);
        // end custom code//
        return $arrItems;

    }

These lines of code work perfectly order filter as i neend. But create problem for other grids. it can be solve by 2 way.

1 ) To put if() condition for custom code it should true if request come from Sales>Order and false if request come from other pages invoice or shipment  how can get order page URL for making codition.

2 ) Second is don't override the generic class . Try to filter order array an others way . In Which class::method we can filter orders array like i filter inDataProvider class.

Please guide me which is better in my case and how do that .
Thanks in advance


texts: Pricing rule : Percent of product price discount

texts:
I want to set up a "buy more save more" rule in Magento where one gets a 20% discount for every 150USD spent in a specific set of product categories.

Is it possible to make sure products from excluded categories are not taken into account in the "spend 150USD" condition rule ?

Any help will be appreciated

Thanks
Quentin


texts: Magento2: How to add custom mass action with pop up though UI

texts:
I need to add custom mass action , but when you click on mass action option i need one pop up instead of redirecting to action url

that is custom js for my custom mass action

can any one help me on that


texts: Unable to add my brands into Breadcrubms section

texts:
I have a Magento system with the Shopper theme installed, my client wants me to add a link for the Brand name inside the breadcrumbs title, for example inside the product details page i have a product called 'Kids Toys from Kids Category', the client asks me to make the words 'Kids Category' linkable to the brand name which is 'Kids Category', i already have a plugin for the brands, to do so i added this code inside the ShopByBrand.xml plugin  file :

<reference name="breadcrumbs">
   <block type="shopbybrand/productinfo" name="shopbybrand_productinfo" template="shopbybrand/info.phtml"/>
</reference>

This block will add the brand details for the desired product and it is working fine for other blocks such as alert.urls, but in my case it is not working, could someone help me in that? i need only to have the assigned product brand in the Breadcrumbs section, i know this is little stupid task but this is what the client wants!


texts:
I have written some code in less which is wrongly calculated its bug or something that I do wrong.

Orignal Code

 .main-class{
       .page-title-wrapper{
         width: calc( 100% - 45px );
       }
 }

Expected result

 .main-class  .page-title-wrapper{
     width: calc( 100% - 45px );
 }

Result That I got

 .main-class  .page-title-wrapper{
     width: calc( 55%);
 }


texts:
I'm trying to login in a Magento site with curl against a form like this:

<form action="http://www.example.com/es/customer/account/loginPost/" method="post" id="login-form">
<input name="form_key" type="hidden" value="9CR1ydcbOTl9p31r" />

        Email address
        <input type="text" name="login[username]" value="" id="email"/>

        Password
        <input type="password" name="login[password]" id="pass" title="Password" />

With this script, I get the form_key value and sent the login request, with a powershell script in this way:

$formkey = curl.exe -c cookie_urban -s http://www.example.com/es/customer/account/login | Select-String -Pattern ‘value="([A-Za-z0-9]{16,})"‘ | %{$_ -replace '        <input name="form_key" type="hidden" value="', ''} | %{$_ -replace '" />', ''}

curl.exe --cookie "user_allowed_save_cookie=%7B%221%22%3A1%7D" --referer http://www.example.com/es/customer/account/login --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" -b cookie_urban -L -H "Origin: http://www.example.com" --data-urlencode "form_key=$($formkey)&login[username]=email@gmail.com&login[password]=password&send=" http://www.example.com/es/customer/account/loginPost > result.html

The parameters that you see are taken by the developer console of my browser. The problem is that when I click on result.html I can't see that I logged in, why? If you have an explanation please tell me. If you have a solution with another language, tell me!
Thanks in advance


texts: Deploy Magento 2.2.4 : @copyright__background-color is undefined

texts:
After I deploy it has reported such an error:

Compilation from source: vendor/magento/theme-frontend-blank/web/css/styles-l.less
variable @copyright__background-color is undefined in file /aht/www/pt/uto_sofaandbed/var/view_preprocessed/pub/static/frontend/Demo/demo/en_US/Magento_Theme/css/source/_module.less in _module.less on line 439, column 40
437|     body {
438|         .ie9 & {

Compilation from source: /aht/www/pt/uto_sofaandbed/vendor/magento/theme-frontend-blank/web/css/styles-m.less
variable @copyright__background-color is undefined in file pub/static/frontend/Demo/demo/en_US/Magento_Theme/css/source/_module.less in _module.less on line 263, column 36

[Magento\Framework\Exception\FileSystemException]
Cannot read contents from file "pub/static/frontend/Demo/demo/en_US/css/styles-l.css" Warning!file_get_contents(pub/static/frontend/Demo/demo/en_US/css/styles-l.css): failed to open stream: No such file or directory


texts:
How to enable or disable log in magento2, basically my question is about enable and disable logging system in magento2, how we can do that, also I want to know how to generate custom log in magento2?

Thanks


texts: In Magento1, how do you establish where the translations csv file is to be uploaded?

texts: I have my translate.csv file ready to upload into a Magento setup. So we are changing words from Magento default like Tax to be VAT instead. I understand different setups will have this file uploaded in different locations? I thought it would be app/design/frontend/theme/default/locale/en_US but that's not working for me.


texts: how to add fonts path in default_head_blocks.xml file magento 2 custom theme?

texts:
Actually i am trying to add fonts path in default_head_blocks.xml file
  magento 2 custom theme.

  I added fonts files in app/design/vendor/theme/web/fonts. I am trying to
  get this path.


texts:
what is the name of the event that I can trigger after adding a product to the cart ?

I need this :

The customer adds a product to his cart
Intercept the event
thanks to the result of and API, add some product for free to the cart


texts: What is example.com/rss/catalog/notifystock/ for?

texts:
I've noticed in some server logs that alot of bots are trying to guess admin login credentials via this route.

I hope one of you can tell me what this rss feed is used for and why admin credentials are needed.


texts: Increase max products view per page on 'Manage Products' menu

texts:
On Catalog -> Manage Products (Magento 1.8.1)

I want to see 300 or 400 products per a page but magento allow only 200 products per a page

How can I make I can select more options for number of products per a page?


texts:
When I try to add a field to filter on my magento 2.2.4 quote collection, the quote are not arranged in the right order.

$customerId  = $this->_customerSession->getCustomer()->getId();
            echo $customerId; // 2
            $collection = $this->collection->create();
            $collection->addFieldToFilter('customer_id', customerId);

This code reverses my last two ids (121 is after 120).

But this :

        $customerId  = $this->_customerSession->getCustomer()->getId();
        echo $customerId;
        $collection = $this->collection->create();
        echo "<pre>".print_r($collection->getData(), true)."</pre>";

Is giving me the right order. But i need to filter $collection by customer_id. How do I do that ?


texts: How to Show Admin Label in drop down fillter on product grid?

texts:
Admin: When we add any product attribute(Type Drop-Down) in the filter on the product list at that time default store value is showing in filter drop-down options so I want to show admin label value instead of the default store value.
See attached screenshot for more information

I have check admin configuration but not found anything
does anyone have idea how this is possible?


texts: Can you continue to add products whilst in production mode

texts:
I currently have Magento 2.1 running on a dedicated server. I have never change the "mode" since installation so I believe I'm still in default mode right now. So far i have installed a theme successfully and have added just over 650 products and am still going strong :-). I have multiple suppliers for the products I sell, so what I would like to do is add all products from my main supplier and go "live" by disabling maintenance mode and changing my Magento installation to "production mode". Not sure if this is the correct approach?

After switching to production mode and going live I'll still have a lot of products to add from my other suppliers. So my questions are:

Is it fine to continue adding new products whilst in production mode or should all products be added now in default/developer mode?
What exactly do people mean when they say that your still "developing your store" do they mean installing a theme, adjusting file system permissions, customizing front end with CSS and adding products/categories? or do they mean coding actual php modules? (which is what I assume "developer mode" is for)


texts:
I have a website in Magento 1. I want to limit the credit card purchase to $2000 per customer, per week. If the amount goes over $2000, then they don't see the credit card or the PayPal option, they can only see the bank transfer option.

Is there any way to achieve this.


texts: Magento 2.3.4 does not complete index broken by Catalog Search indexing

texts:
Running bin/magento indexer:reindex
results in the following error:
Catalog Product Rule index has been rebuilt successfully in 00:00:00
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\InventorySalesApi\Api\StockResolverInterface in /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Invento...', Array)
#1 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Invento...')
#2 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Invento...')
#3 /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Amasty\\Shopby\\M...')
#4 /var/www/vhosts/blueridge.co in /var/www/vhosts/blueridge.co.uk/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

Can do with help here?
Thanks