texts: Password Meter Info not showing required info in Magento 2.3.1

texts:
We are facing a strange behavior on the registration page of Magento 2.3.1

This is how it should work with the Password Meter: https://potatocommerce.com/blog/how-to-configure-password-meter-in-magento-2

But in our shop, it only shows Password Weak, Medium or Strong or very Strong, but not the field below with necessary info on how customer should apply password (Minimum lenght of this field must be greater or equal etc...)

Does anyone out there know, how I can make this field make show up as per https://potatocommerce.com/blog/how-to-configure-password-meter-in-magento-2 maybe even with this color view there...?


texts:
I'm developing a Magento Store, I bought a custom theme and a lot of the theme content goes into the DB (eg. the content of the footer or menus). How should I proceed to deploy changes that I made locally to production?

I tried to run app:config:dump but such changes aren't saved into the config.php file.

The only thing that I can think of is to dump the entire database and upload to production. But this would overwrite my production DB. Which isn't good.


texts: need clarification about adding extension to magento

texts:
i am using Magento 2.0 version,To add extension i need Magento connect under Admin Panel.

After logging in to magento admin panel ,i am not able to get "magento connect" under System module.

So if anybody knows about this things,pls give a reply.


texts:
I'm trying to customise my theme but only a few variables seem to be displayed on my web page. I'm not sure that I am using the variables in vendor/magento/theme-frontend-luma/web/css/source . Any help would be much appreciated.

My .less file

@oh-my-blue:#FFC0CB;
@green:#7CFC00;
body
{
background-color:@oh-my-blue;  <-- Works
border-color:@green;            <-- Doesn't Works
link__color:@green;              <-- Doesn't Works

}


texts: Magento2 Product Edit Invalid Form Key. Please refresh the page?

texts: Magento 2.2.2 Product Edit with More than 25 options on Custom Options gets error Invalid Form Key. Please refresh the page? Can anyone help how to solve this issues?


texts:
I'm trying to get MSRP Product Prices in cart/checkout pages.
The price returned by the following code is always zero.

foreach ($quote->getAllVisibleItems() as $item) {
    $product = Mage::getModel('catalog/product')->load($item->getId());
    $_msrpPrice = Mage::helper('core')->currency($product->getMsrp(),true,true);
    var_dump($_msrpPrice);

}

Any alternatives?


texts: Access OrderRepositoryInterface interface from cron job

texts:
I need to call API after user place order.

My issue is when my event method called after placing order it initializes variables as shown in the constructor.

public function __construct(
OrderRepositoryInterface $OrderRepositoryInterface , ScopeConfigInterface
$scopeConfig
) {
    $this->orderRepository = $OrderRepositoryInterface;
    $this->scopeConfig = $scopeConfig;
    $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
        ->get('Magento\Framework\App\ResourceConnection');
    $connection = $this->_resources->getConnection();
    $table = $this->_resources->getTableName('order_fullfill');
}

But when I am calling a method from cron job suppose init(), how would I initilize $this->orderRepository and $this->scopeConfig.

function init()
{
    $this->orderRepository = $this->ObjectManager->get('Magento\Sales\Api\OrderRepository');

    $this->scopeConfig = \Magento\Framework\App\Config\ScopeConfigInterface\objectManager::getInstance();
    $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
        ->get('Magento\Framework\App\ResourceConnection');
    $connection = $this->_resources->getConnection();
    $table = $this->_resources->getTableName('order_fullfill');
}

Thanks


texts: Magento 1: how to change the first parameter in cron method

texts:
Here's an interesting one that I learnt today.

I have a module that calls the following method via cron:

public function test($test = false, $test2 = false, $test3 = null, $test4 = array())
{
    if (!$test) {
        $test = Mage::getStoreConfig('path/to/config');
    }
    /*
     * Rest of the method
     */
}

Basically, the first parameter $test is used by me to make some tests to force the value.

Never worried too much about until I found out today that this condition was not working when the cron was triggered:

if (!$test) {
    $test = Mage::getStoreConfig('path/to/config');
}

After making some tests I found this bit of code in Mage/Cron/Model/Observer.php in the _processJob method:

$callback = array($model, $run[2]);
$arguments = array($schedule);
/* More code here */
call_user_func_array($callback, $arguments);

And $schedule is an instance of Mage_Cron_Model_Schedule. So the first parameter of my method is always set when the cron job is processed.

Two questions here:

why does Magento send the cron schedule object as a parameter to the cron job method ?
how to avoid that behavior / fix my method without changing its signature ?


texts: Multistore not working after upgrading from 2.3.5-p1 to 2.4.2

texts:
I have a multistore webshop with multiple websites and languages.

I upgraded from 2.3.5-p1 to 2.4.2 via composer
Changed the PHP-version form 7.3.27 to 7.4.15
Replaced the htaccess files for the other websites with the version that came with Magento 2.4.2

After upgrading the extra websites (not the default one) are redirected to de the default scope of the defult website.
One of my index.php files of the non-default websites:
    <?php

require realpath(__DIR__) . '/app/bootstrap.php'; // path of root magento bootstrap.php
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = '*WebsiteCode*';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);

My .htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

I checked the websitecode and it is the correct one.
I checked the settings in the backend under Stores => Configuration => General => Web, the correct URL's are still there.
I use symlinks for the folder app, lib, pub and var.


texts: Magento - Set default value for attribute field

texts:
I created a new customer attribute with the select tag and the various options. When I try to create a new customer, this field returns the vacuum to me as the default value.

I want to force the default option in the select field of the attribute with the php. How can I do?

The module with which I create custom attributes for customers is called "Manage Customer Attributes Extension"

Thanks


texts: The use of "function setData ()" in the blocks on CMS pages

texts:
I can not understand why variable transmission does not work, when the block is called, the display categories on the home page.
in the template file I pass a variable to a different template file

list.phtml

<?php $this->getChild('icon_labels')->setData('product', $_product); ?>
<?php echo $this->getChildHtml('icon_labels', false); ?>

if you go into the category of a direct link, then everything works, but if you call category, for example, on the home page

{{Block type = "catalog / product_list" template = "catalog / product / list.phtml" category_id = "52" toolbar_block_name = "product_list_toolbar"}}

I receive an error that Fatal error: Call to a member function setData () on a non-object in \ list.phtml on line

why this error, I can not understand ..
I would be grateful for your help. Thank.


texts:
I just configured my message queues to run via RabbitMQ, but I don't know the schedule and frequency of these processes.

How could I check the schedule and change the number of processes to be executed?


texts: Magento 2 Knokout.js remove element define in differen template file

texts:
I want to remove html element from template file using knockout.js code.
I have write my code in shipping.js which is getting called on checkout page.
In shipping.js under  i have defined my variable hideShippingHtml: ko.observable

     return Component.extend({
        hideShippingHtml: ko.observable(false),
       isVisible: ko.observable(quote.isVirtual()),
        quoteIsVirtual: quote.isVirtual()

           ......
     }),

on frontend in shipping.html template i called it for the div i want to remove

Method 1:

Jackson Villey

Method 2:

Jackson Villey

Method 3:

Jackson Villey

In console getting error that :  ReferenceError: hideShippingHtml is not defined  seems like data-binding error.

What could be the issue?  Any help would be appreciated!


texts: How to Update Group Price Programmatically Without Product Object Save

texts:
To save group price for the products, the following works for me.

$product->setData('group_price', $group_pricing_data);
$product->save();

However, it takes a while for mass updating products. The faster way to save only attributes via saveAttribute() does not seem to work on group price.

$product->setData('group_price', $group_pricing_data);
$product->getResource()->saveAttribute($product, 'group_price');

Is it because group_price is not EAV like the other attributes, and if so, is there any other way to just save only group pricing?


texts: Magento 2.3.2 Object doesn't support property or method 'registerDataModifier'

texts:
I have updated my site from 2.3.1 to 2.3.2. In doing some testing I have found that on checkout in IE it just hangs. The reason is this error in the console-

SCRIPT438: Object doesn't support property or method 'registerDataModifier'
captcha.js (44,21)

And here is that code-

  //Add captcha code to coupon-apply request.
                setCouponCodeAction.registerDataModifier(function (headers) {
                    if (self.isRequired()) {
                        headers['X-Captcha'] = self.captchaValue()();
                    }
                });

This is core Magento 2.3.2 code, it is not an extension. I have not made any changes or modified the code. It works fine in both Chrome and Firefox. What is the best way to resolve this?


texts: Magento checkout says there was an error processing your order. Please contact us or try again later

texts:
I have problem with checkout, when i click to place order from magento onepage checkout it says

  "There was error processing your order, please try again later."

I don't know why this is happening. Tried changing log folder permissions and clearing the cache but not worked. This is my exception.log.

2017-01-03T13:32:19+00:00 ERR (3):
exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'The value of attribute "SKU" must be unique' in /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Model/Config.php:1354
Stack trace:
#0 /home1/elements/public_html/drsilver.in/dr/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('eav/entity_attr...', 'The value of at...')
#1 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Eav/Model/Entity/Abstract.php(661): Mage::getModel('eav/entity_attr...', 'The value of at...')
#2 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Eav/Model/Entity/Abstract.php(830): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/validat...', Array)
#3 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Catalog/Model/Product.php(189): Mage_Eav_Model_Entity_Abstract->validate(Object(Mage_Catalog_Model_Product))
#4 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(1078): Mage_Catalog_Model_Product->validate()
#5 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->quickCreateAction()
#6 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('quickCreate')
#7 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home1/elements/public_html/drsilver.in/dr/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /home1/elements/public_html/drsilver.in/dr/index.php(83): Mage::run('', 'store')
#11 {main}
2017-01-03T13:32:28+00:00 ERR (3):
exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'The value of attribute "SKU" must be unique' in /home1/elements/public_html/drsilver.in/dr/app/code/core/Mage/Core/Model/Config.php:1354
Stack trace:
#0 /home1/elements/public_html/drsilver.in/dr/app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('eav/entity_attr...', 'The value of at...')


texts: magento 1.9 correct way to extend Mage_Adminhtml_Catalog_ProductController

texts:
y'all.  What is the best way to achieve this epic feat of intellectual prowess?

Is this a good start?

require_once("mage/Adminhtml/controllers/Catalog/ProductController");
class Company_adminhtml_Catalog_ProductController extends Mage_AdminhtmlCatalog_ProductController{
    ....
}

From that point, what else must be achieved?


texts:
I have solve a quite weird problem:

Frontend (product category or search results)

  Item (Magento\Downloadable\Model\Link) with the same ID "1240" already exists.

  (with a huge error stack)

(Once I figured out which products caused the error):
Backend, product page:

  Warning: Illegal string offset 'is_in_stock' in vendor/magento/module-catalog-inventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php on line 87

Having check downloadable_link table, which has a unique index on link_id, there was no duplicates.

In this case, reindexing causes no error and solves nothing.


texts: Magento 2.3: Forward to another URL without redirecting

texts:
I'm writing a module that will accept any Magento URL with /discount/COUPON_CODE appended to the end, set the code in a cookie for later use, and then forward to the URL minus the discount part.

So, for example, https://store.url/page/path/discount/COUPON_CODE would eventually load the page that would have been found at https://store.url/page/path.

The tricky part is that I can't do a 300 redirect (that would have been easy.) I want to actually forward to the appropriate controller/action internally so that the discount code URL remains intact. I'm having a really hard time figuring out how to do this.

Right now, I have a plugin for FrontControllerInterface with a beforeDispatch method that examines the URL, and if a discount code is found, sets it in a cookie. At the end of this method, I was hoping to strip /discount/COUPON_CODE from the URL and then continue dispatching using the modified URL, but I'm not sure this is the right approach (if it is, I can't figure out how.)

Does anyone have an idea of how I might accomplish this? I can see that there are ways I can dispatch a specific controller or action using a custom router, but I can't figure out how to match an arbitrary URL to the correct controller and action once I've modified it.


texts: Admin order Item remove Product by coupon code not updating grand total

texts:
I am trying to remove Product by applying zero price coupon code its working fine but Grand total is not updating on apply the coupon code . its working if I click on update items button.

I have added 2 products test1 => price : $100 & test2 => price => $10
On apply coupon code, test2 is removed from order item from admin but grand total is showing $110 its should show $100 only . if i click on update button its showing correct one.

what I want on apply coupon code it should show the $100

<adminhtml>
        <events>
            <sales_quote_item_set_product>
                <observers>
                    <namespace_additionalproduct_order_observer>
                        <type>singleton</type>
                        <class>additionalproduct/observer</class>
                        <method>addProduct</method>
                    </namespace_additionalproduct_order_observer>
                </observers>
            </sales_quote_item_set_product>

            <salesrule_validator_process>
                <observers>
                    <namespace_removeproduct_order_observer>
                        <type>singleton</type>
                        <class>additionalproduct/observer</class>
                        <method>removeProduct</method>
                    </namespace_removeproduct_order_observer>
                </observers>
            </salesrule_validator_process>

        </events>
    </adminhtml>

Observer.php

        public function addProduct($observer)
        {

            $hessSkuTwentySeventeen = '2017MiniCollection';
            $hessSkuServiceFee = 'ServiceFee';
            $added = false;
            $quote = $observer->getQuoteItem();
            $product = $observer->getProduct();

            if ($product->getSku() == $hessSkuTwentySeventeen) {
                $addProduct = Mage::getModel('catalog/product');
                $addProduct->load($addProduct->getIdBySku($hessSkuServiceFee));

                foreach ($quote->getQuote()->getAllVisibleItems() as $item) {
                    if ($item->getProduct()->getSku() == $hessSkuTwentySeventeen) {
                        $added = true;
                        break;
                    }
                }

                if (!$added) {
                    $quote->getQuote()->addProduct($addProduct);
                }
            }
        }

        public function removeProduct($observer){
            $hessSkuServiceFee = 'ServiceFee';

            if ($observer->getRule()->getCouponCode() == 'removeproduct') {
                $quote = $observer->getQuote();
                foreach ($quote->getAllVisibleItems() as $item) {
                    if ($item->getProduct()->getSku() == $hessSkuServiceFee) {
                        $quote->deleteItem($item);

                    }
                }
            }

        }


texts: 500 error after running bin/magento setup:upgrade

texts:
I'm working on my first Magento2 site. The site was live and working until I went to install this CustomShippingPrice extension.

After enabling the module using Magento module:enable Mageside_CustomShippingPrice and running the Magento setup:upgrade command, the following error start to appear:

Next

 Magento\Framework\Exception\LocalizedException: Invalid block type:
 catalog/product_list_random in
 /var/www/html/store/vendor/magento/framework/View/Layout/Generator/Block.php:263

I have the same code and database running on my local machine without issue following the same steps.

I've tried clearing and flushing the cache and deleting my Magento var/ folder and restarting the web server, same error. I also tried running with the --keep-existing option, no luck.

Reverting the site to a backup prior to running setup:upgrade returns the site to normal operation. This leads me to believe the issue is not related to the database.

The web server is an Amazon Linux instance if it matters.

Please help me troubleshoot this issue.


texts: Problem installing amazon-pay-module using composer for magento 2

texts:
I am trying to install a website from server to localhost. When I run the command composer update in git-bash then I get the following error.

=> Screenshot :

All the other modules got installed properly but amazon-pay-sdk-php is causing issue.
I have checked several threads similar to this issue, found many answers but none worked in my case.

=> composer.json file :

{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.11",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"require": {
    "magento/product-community-edition": "2.1.12",
    "composer/composer": "@alpha",
    "magepal/magento2-customshippingrate": "^1.3",
    "mestrona/magento-module-categoryredirect": "^2.1",
    "amzn/amazon-pay-and-login-with-amazon-core-module": "1.2.5",
    "amzn/login-with-amazon-module": "1.2.5",
    "amzn/amazon-pay-module": "1.2.5"
},
"require-dev": {
    "phpunit/phpunit": "4.1.0",
    "squizlabs/php_codesniffer": "1.5.3",
    "phpmd/phpmd": "@stable",
    "pdepend/pdepend": "2.4.0",
    "fabpot/php-cs-fixer": "~1.2",
    "lusitanian/oauth": "~0.3 <=0.7.0",
    "sebastian/phpcpd": "2.0.0"
},
"config": {
    "use-include-path": true
},
"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"
    },
    "psr-0": {
        "": "app/code/"
    },
    "files": [
        "app/etc/NonComposerComponentRegistration.php"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
        "Magento\\Tools\\": "dev/tools/Magento/Tools/",
        "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
        "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
        "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
    }
},
"minimum-stability": "alpha",
"prefer-stable": true,
"repositories": [
    {
        "type": "composer",
        "url": "https://repo.magento.com/"
    }
],
"extra": {
    "magento-force": "override"
}

}

I understand the error message that composer is looking for "amzn/amazon-pay-and-login-with-amazon-core-module" and it could not find it but then what should I use in place of the above module name.

So basically my question is how I can install amazon pay and login module on localhost. Should I change "amzn/amazon-pay-and-login-with-amazon-core-module" to different module name as composer could not find any module with above name, or if there is any other method.

If anyone have any idea then please guide me in the right direction. I am really stuck into it.


texts: Resolved - Admin Grid Redirects to Front End Page Instead of Backend

texts:
I took steps according to this article but the newly created link displays the "text block" on the front-end instead of back-end.
http://alanstorm.com/magento_admin_controllers/

Can anyone help me understand what's the problem?
Greatly appreciate your help guys!


texts: setup:static-content:deploy fatal errors on XAMPP Windows7

texts:
When ever I run bin/magento setup:static-content:deploy it outputs the following error:

  Super13@Stone MINGW32 /d/xampp/htdocs/magento2-2.1.14 $ php
  bin/magento setup:static-content:deploy Requested languages: en_US
  Requested areas: adminhtml, frontend Requested themes:
  Magento/backend, Magento/blank, Magento/luma, Rahul/Theme1 PHP Fatal
  error:  Uncaught TypeError: Argument 15 passed to
  Magento\Deploy\Model\Deploy\LocaleDeploy::__construct() must be of t
  array, null given, called in
  D:\xampp\htdocs\magento2-2.1.14\lib\internal\Magento\Framework\ObjectManager\Factory\AbstractFacto
  on line 111 and defined in
  D:\xampp\htdocs\magento2-2.1.14\app\code\Magento\Deploy\Model\Deploy\LocaleDeploy.php:177
  Stack trace:
  0 D:\xampp\htdocs\magento2-2.1.14\lib\internal\Magento\Framework\ObjectManager\Factory\AbstractFactory.php(111):
  Magento\Deploy
  Deploy\LocaleDeploy->__construct(Object(Symfony\Component\Console\Output\ConsoleOutput),
  Object(Magento\Translation\Model\Js\Con
  bject(Magento\Framework\View\Asset\Minification),
  Object(Magento\Framework\View\Asset\Repository),
  Object(Magento\Framework\View RepositoryFactory),
  Object(Magento\RequireJs\Model\FileManagerFactory),
  Object(Magento\Framework\RequireJs\ConfigFactory), Objec
  to\Framework\App\View\Asset\Publisher),
  Object(Magento\Framework\View\Asset\Bundle\Manager), Object(Ma in
  D:\xampp\htdocs\magent
  14\app\code\Magento\Deploy\Model\Deploy\LocaleDeploy.php on line 177

  Fatal error: Uncaught TypeError: Argument 15 passed to
  Magento\Deploy\Model\Deploy\LocaleDeploy::__construct() must be of the
  ty y, null given, called in
  D:\xampp\htdocs\magento2-2.1.14\lib\internal\Magento\Framework\ObjectManager\Factory\AbstractFactory.ph
  ne 111 and defined in
  D:\xampp\htdocs\magento2-2.1.14\app\code\Magento\Deploy\Model\Deploy\LocaleDeploy.php:177
  Stack trace:
  0 D:\xampp\htdocs\magento2-2.1.14\lib\internal\Magento\Framework\ObjectManager\Factory\AbstractFactory.php(111):
  Magento\Deploy
  Deploy\LocaleDeploy->__construct(Object(Symfony\Component\Console\Output\ConsoleOutput),
  Object(Magento\Translation\Model\Js\Con
  bject(Magento\Framework\View\Asset\Minification),
  Object(Magento\Framework\View\Asset\Repository),
  Object(Magento\Framework\View RepositoryFactory),
  Object(Magento\RequireJs\Model\FileManagerFactory),
  Object(Magento\Framework\RequireJs\ConfigFactory), Objec
  to\Framework\App\View\Asset\Publisher),
  Object(Magento\Framework\View\Asset\Bundle\Manager), Object(Ma in
  D:\xampp\htdocs\magent
  14\app\code\Magento\Deploy\Model\Deploy\LocaleDeploy.php on line 177

This is with Magento 2.1.1 , XAMPP,Windows7.


texts: how do I determine what cache tag is used for a block?

texts:
I have a block that uses addLink to create a checkout link in the header, to get the URL it uses a custom function $helper->getCheckoutUrl() ($helper being a utility helper created by someone else) which does a condition check to return what URL we need for the checkout link, the conditions are

If Rewrite Checkout links are enabled
    return result from parent::getCheckoutUrl();
else if Precheckout is Available
    return result from Mage::getUrl('precheckout', array('_secure'=>true));
otherwise return result from Mage::getUrl('onestepcheckout', array('_secure'=>true));

to determine if Precheckout is avaliable we use these checks

if items in cart = 0 and user is a guest and module is enabled
    if minimum order limit set and cart total > minimum order limit
        return true
    else if minimum order limit is not set
        return true
otherwise return false

Effectively what we are doing is that if the user is a guest and meets the conditions to go into the checkout we want to redirect them to a pre-checkout page where we ask for either their email, to make an account or to log into their own account

while testing I noticed that the URL is getting cached, as such if I’m a guest and had an item in my cart then go to a page (say a category or CMS), the checkout link in the header is our pre-checkout link however when I remove the item, and return to the page I was once on it retains how pre-checkout link yet if I got to a page that hasn't been visited (as such hasn't been cached) it's the correct link, pages with the pre-checkout link only change if we wipe out the cache (not just a refresh of every cache though the backend)

Now I want to look up what cache tag is set for the block that calls the addLink


texts: Magento duplicate content issue with multistore

texts:
I have multi-store websites with store code enable in URL. As google will consider the product content as duplicate on case of multi-store with store code for same product.How can I resolve this issue ? Store code must required for multi-store.

Is there any way that there is store code enable from admin but on frontend without store code product will load with that particular store ?


texts:
I am trying to to create the curl request but it is not working. It is giving the error

Uncaught Error: Class 'Custom\Rma\Helper\Varien_Http_Adapter_Curl' not found

Code

$header = array(
                "cache-control: no-cache",
                "content-type: application/json"
            );
        $request = json_encode($sfData);
        $url = "url_here";
        $options = array(
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $request
        );
        $curl = new Varien_Http_Adapter_Curl();
        $curl->setOptions($options);
        $curl->write(Zend_Http_Client::GET, $url, '1.0');
        $response = $curl->read();
        $err = $curl->error();
        if ($err) {
            return false;
        } else {
            return true;
        }
        $curl->close();

As i want to change my code according to the ECG so i have converted the PHP curl functions to above code. And this code is not working.


texts: How to alter catalog_product_flat column types

texts:
A website I manage requires prices to have 5 decimals. I went ahead and modified at least a dozen file/tables altogether to be able to achieve this. But ('cause there's always a but) there seems to be a problem with catalog_product_flat_X.

Let me explain : for prices on the front, most of the time, it's come down to calling Mage_Catalog_Model_Product->getPrice(), which, as I understand it, will look for the price in the flat tables (if you have flat tables enabled). The issue is with the reindexing of data.

If my flat table has a price with the format DECIMAL(12,5), hitting the "Reindex" link on the "Reindex flat data" line will ALTER the flat table and put it back to DECIMAL(12,4).

After searching for quite an extented amount of time, I came accros a function in
app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php
which is called prepareFlatTable($storeId). This function then calls convertOldColumnDefinition($column) on every column of the flat table (in this case).

Finally, when looking at this function in
app/code/core/Mage/Catalog/Model/Resource/Helper/Abstract.php
it seems to be converting every decimal and numeric like so :

case 'decimal':
case 'numeric':
        $length = $proposedLength;
        $type = Varien_Db_Ddl_Table::TYPE_DECIMAL;
        break;

in which $proposedLength is the result of this :

$definition = trim($column['type']);
if (!preg_match('/([^(]*)(\\((.*)\\))?/', $definition, $matches)) {
    throw Mage::exception(
        'Mage_Core',
        Mage::helper('core')->__("Wrong old style column type definition: {$definition}.")
    );
}

$proposedLength = (isset($matches[3]) && strlen($matches[3])) ? $matches[3] : null;

I don't quite understand what's going on here, I'd put something hardcoded in there but I don't want to interfere with the normal process of all the indexers.

Can anyone enlighten me on this matter and offer me a solution?


texts:
How do I set noindex for the filter pages?

I have a little dupilicate content issue and no have an ajax navigation but I want to set noindex follow fpr the pages to get them out of google,

Any ideas how to add the meta tag to these pages ?

example URL www.example.com/furniture/wardrobes.html?cat=34&price=asc

I have used google Parameters to crawl NO URLs with the parameters and enabled Rel= Can to orginal pages

Thanks.


texts: what is the difference between entity id and increment id in sales_order table

texts: which id should be used for order status update. How should the status be updated?


texts: How to redirect on success page using controller in magento 2?

texts:
I am getting orders data after place order using Ajax and pass it to the controller and then save that data into a database. The data saved successfully in the database but unable to redirect to success page from the controller. Anyone help me to solve this issue.

Thanks in advance.


texts: Magento extension install - Dependancy error

texts:
I am installing an extension I have written and published to the Magento Marketplace, but I get an error when installing from the store that makes no sense.

  Check Component Dependency

  We found conflicting component dependencies. Hide detail

  Command "update" failed: Loading composer repositories with package
  information Updating dependencies (including require-dev) Your
  requirements could not be resolved to an installable set of packages.

  Problem 1
  - The requested package magento/product-community-edition could not be found in any version, there may be a typo in the package name. Problem
  2
  - Installation request for oddware/shipsterconnect 100.1.36 -> satisfiable by oddware/shipsterconnect[100.1.36].
  - oddware/shipsterconnect 100.1.36 requires magento/module-sales 100.1.* -> no matching package found.

  Potential causes:
  - A typo in the package name
  - The package is not available in a stable-enough version according to your minimum-stability setting see
  https://getcomposer.org/doc/04-schema.md#minimum-stability for more
  details.

  Read https://getcomposer.org/doc/articles/troubleshooting.md for
  further common problems.

  For additional assistance, see component dependency help .

I don't understand what the error about the community module is at all, it makes no sense and is not in my composer.json.  And the module-sales makes even less sense, as that module is installed;

"magento/module-sales   Magento_Sales   100.1.8"

And this is the composer.json in my extension;

{
  "name": "oddware/shipsterconnect",
  "description": "Oddware module for exporting to Shipster",
  "require": {
    "php": "~5.0|~6.0|~7.0",
    "magento/module-sales": "~100.0|~101.0",
    "magento/module-shipping": "~100.0",
    "magento/module-backend": "~100.0"
  },
  "type": "magento2-module",
  "version": "100.1.37",
  "repositories": [
    {
      "type": "composer",
      "url": "https://repo.magento.com/"
    }
  ],
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "OddWare\\ShipsterConnect\\": ""
    }
  }
}


texts:
Please tell me where I should put anything that I need.
I just want to add checkbox in register to accept conditions and terms (check-box must be checked).

How i can do it?


texts: Can a product's attribute store several values for the same product or do I have to do something else (Magento 1.9)?

texts:
I will explain with general terms the situation:

I have some products which should have 1-8 values for the same attribute and in the same product.
For example:

SKU 55720,

Name of Attribute: Norm,

Value of Norm: [ISO4567, ESI8909, RA4545],

Then I will develop a module for filter where the customer will be able of filter products that meet his selection. (very simple)

Then my issue/doubt is:
Can an attribute store multiple values for a same product?
If not, what would you do?

I have thought that if only can store one value, I can add multiple values if I separate them using commas, and in consecuense, when I develop the module, I will check if a product has one or more of the values searched.


texts: How can i add a telephone field at the time of customer registration form in magento 2?

texts:
There are an option is required selected
Please go to stores=> configuration => customer configuration and enable mobile number.

So let me know if is there anywhere else I need to change?
Thanks in Advance.


texts:
I've a problem to include Masonry JS to my Magento 2.2

I've a custom theme in app/design/frontend/CustomVendor/CustomTheme
In this folder I've a web/ folder and inside I've requirejs-config.js

var config = {

    map: {
        '*': {
            'masonry' : 'js/masonry.pkgd.min'
        }
    },

    deps: [
        "js/custom-masonry"
    ]

};

In this same folder I've js/ folder. Inside I've custom-masonry.j

require([
    'jquery',
    'masonry',
    'domReady'
], function ($, domReady, masonry) {

    console.log("custom-masonry.js");

    domReady(function() {

        console.log("domReady");

        $('.contents-items').masonry({
            columnWidth: 200,
            itemSelector: '.content-items'
        });

    });

});

Console show me that

I think the problem is when jQuery is loaded and it's loaded before my Masonry.


texts: Magento 2 : shipped items not appearing in email template

texts:
{{layout handle="sales_email_order_shipment_items" shipment_id=$shipment_id order_id=$order_id}}

is used to render shipped items in email template but no items appear in email template.
I had also set "is_legacy" to 1 in email_template table.
Any thoughts, what can be the issue ?
I am using Magento/2.4 (Enterprise)


texts: Uploading a module(.zip file:)- Guidance_Simplepage-master.zip

texts: I want to add this module named Guidance_Simplepage.  How do I add Guidance_Simplepage-master.zip(downloaded from GitHub Repository) into my Magento.  Kindly guide.


texts: Magento2: Mixin is undefined on deploying static content

texts:
I have created several mixins in my custom theme within the file "_mixins.less", these work locally and are loaded properly from my other less files. However, when I want to deploy static content I get the following compilation error:

Compilation from source: /var/projects/**project**/magento2/vendor/magento/theme-frontend-blank/web/css/email-fonts.less

Compilation from source:
frontend/GetNoticed/**project**/en_US/css/email-fonts.less
.anim-fade is undefined in /var/projects/**project**/magento2/var/view_preprocessed/css/frontend/GetNoticed/**project**/en_US/css/source/_theme.less

This only happens when it tries to compile less files from parent themes ( Luma or Blank ). I also get the same error in my Firebug console on the product page, within the gallery.css file.

The function .anim-fade doesn't do more than adding a simple transition effect:

.anim-fade(@element; @duration) {
  transition: @element ease-in-out @duration;
  -webkit-transition: @element ease-in-out @duration;
  -moz-transition: @element ease-in-out @duration;
  -o-transition: @element ease-in-out @duration;
}

Which works fine on all elements that use this. My _sources.less file looks like this:

@import '_mixins.less';
@import '_variables.less';
@import (reference) '_extends.less';
@import '_theme';
@import '_typography.less';
@import '_layout.less';
@import '_tables.less';
@import '_messages.less';
@import '_navigation.less';
@import '_tooltips.less';
@import '_loaders.less';
@import '_forms.less';
@import '_icons.less';
@import '_buttons.less';
@import '_sections.less';
@import '_pages.less'; // Theme pager
@import '_actions-toolbar.less';
@import '_breadcrumbs.less';
@import '_popups.less';
@import '_price.less';
@import '_bootstrap.less';
@import '_fonts.less'; /* theme fonts */
@import '_header.less'; /* theme heading */
@import '_homepage.less'; /* page specific styling */
@import '_checkout.less'; /* custom checkout styling */
@import '_productgrid.less'; /* products-grid search results */
@import '_product.less'; /* products-grid search results */
@import '_sidebar.less'; /* sidebars pages */

I'm absolutely clueless why it's doing this, all my other mixins are compiling just fine. I've tried renaming the mixin from "fade-transition" to "lib-fade-transition" to "anim-fade", but this didn't help.

Hoping to find answers here, thanks in advance!


texts: Failed to load the "Magento_Msrp/js/view/checkout/minicart/subtotal/totals" component

texts: Magento 2 this error happen loading checkout page how to fix this


texts: How to generate an adminhtml page secret key

texts:
I'd like to generate a link to an adminhtml page from within a script in my html directory.

I have read this question on Stackoverflow: Magento: generating url for a backend action (with key)

This works for me if I generate such a key from within an extension controller. The key generated from within my html directory script however does not work correctly and throws me to the dashboard when applied.

Edit: The redirect works 100% if the user is not logged in - i.e it directs the user to my module page 100% accurately.

However, if the user is already logged in, it redirects them to the dashboard due to the conflicting session.

I believe I need to somehow "switch" sessions, but I haven't managed to do so yet. I have taken a look at this post:

Check if Admin is Logged in Within Observer

Unfortunately it still redirects to the dashboard.

Any ideas?


texts: Is Magento2 EE a right solution for 100M of products?

texts:
We are in the middle of our decision making process to go with Magento2 or develop our own solution. We have around 90M products and want to know if Magento2 EE is a right platform to support this number of products or we should write our own solution ?

Any helps will be appreciated.


texts:
I'm trying the following code to access product list

$client = new SoapClient('http://magentohost/api/soap/?wsdl');
$session = $client->login('apiUser', 'apiKey');
$result = $client->call($session, 'product.list');
$client->endSession($session);

But this is throwing the following error -

  Fatal error: Uncaught SoapFault exception: [2] Access denied.

Can anyone help me to resolve this error ?.


texts:
Hello I want to add these files to .gitgnore in order to clean the server
how can I do that
The files are
robots.txt
robots/

.gitgnore is on project directory
Sorry I am still beginner at that
Thanks in advance


texts: magento2 widget collection sort by array

texts:
I have a custom widget and in the phtml file I get the product collection through the method $collection = $block->getProductCollection();

To sort that collection according to an array containing the skus I use the following code:

$productIds = implode (", ", $productIdsarray);
$collection->getSelect()->order(new \Zend_Db_Expr("
    if (FIELD (`e`.`sku`, {$productIds}) = 0,1,0),
    FIELD (` e`.`sku`, {$productIds})"
 ));

but when I get the items in the collection

$items2 = $collection->getItems();
foreach ($items2 as $_item2) {
    echo $_item2->getSku(). ":" . $_item2->getName(). "->".
        . $_item2->getPriceInfo()->getPrice('final_price')->getAmount()->getValue()
        . "<br/>";
}

They do not come with the order that I have suggested. I think that when you get the items you call the getProductCollection() method again and that's why you don't respect the order.

How can it be solved?

Thank you


texts: Magento 2 - Get color attribute based on its size attribute of product

texts:
I am trying to get the color attribute based on the size attribute.

public function getSize($product)
{
    $_attributes = $this->getAllowAttributes();
    $result = array();
    foreach ($_attributes as $_attribute){
         $result[] = $_attribute->getProductAttribute()->getAttributeCode();
    }
    $size = $product->getResource()->getAttribute($result[0])->getFrontend()->getValue($product);
    if ($size == "No" || is_null($size)) {
        $size = '';
    }

    return $size;
}

This will display size attribute of product. But I want to display its related color like this:
Size-1 / Color-1
Size-1 / Color-2
Size-1 / Color-3
Size-1 / Color-4
Size-2 / Color-1
Size-2 / Color-2
Size-2 / Color-3
Size-2 / Color-4
Size-3 / Color-1
Size-3 / Color-2
Size-3 / Color-3
Size-3 / Color-4

My view page looks like:

    <?= $block->escapeHtml($block->getSize($product)); ?>
    <?php //foreach ($_attributes as $_attribute): ?>
    <?php if ($product->isAvailable()): ?>
        <?= /* @escapeNotVerified */ __('In stock') ?>
    <?php else: ?>
        <?= /* @escapeNotVerified */ __('Out of stock') ?>再入荷通知
    <?php endif; ?>

Is there any method to get like this?

Thanks in advance.


texts: How to create Magento Order programatically in Amazon M2epro

texts:
I want to create magento order from Amazon M2Epro Extension in magento 2.

I am able to create Order Object but not sure how can I call Controller function CreateMagentoOrder()

Git Link - https://github.com/m2epro/magento2-extension

Controller path - https://github.com/m2epro/magento2-extension/blob/master/Controller/Adminhtml/Amazon/Order/CreateMagentoOrder.php

Code -

$id = '9302';
$amazonobj = $objManager->get('\Ess\M2ePro\Model\Amazon\Order');
$order = $amazonobj->load($id);
print_r($order->getData());

$order->createMagentoOrder();  // Not Working

Anyone please explain how to call controller function from external php script.


texts: Add Text Input on MassAction and Receive it in Controller - Magento2 Product Grid

texts:
I am trying to create a MassAction which accepts the Text Input and not Drop Down like Update Status which brings DropDown of Enable and Disable. Can someone please provide me correct XML file and PHP to get the action data?

Technically, I am trying to update Price of Multiple Product via MassAction with Formula. Please find attached Image for desire result.


texts: Magento Search returns no product after 1.9.3.1 upgrade

texts:
I've just upgraded my store from 1.9.3 (which had a glitch in the search that showed all products when searching) to 1.9.3.1, and now the search shows no products.

What I've tried:

Roolback the file app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php to version 1.9.3 and 1.9.2.4
Cleared Cache
Reindexed
Changed folder permissions

When I retore the files from version 1.9.3 the search start "working" again (showing all the products)

The only search module I use is one that show proviews of the products, and this module is working fine.

Thanks all!


texts: Magento 2 : Error while adding product programatically On Observer Event `catalog_product_save_after`

texts:
I am trying to add product programmatically on catalog_product_save_after observer.

Basically what i try to achieve is create a Duplicate Sample product of current product if PRODUCT-SKU-sample does not exist otherwise Update the price of PRODUCT-SKU-sample Sample product.

Update

Can i use Plugin or interceptor instead of using Observer to create Sample Product on Save Product Event ?

  File : Namespace/Modulename/Observer/Catalog/ProductSaveAfter.php

$_product = $observer->getProduct();
$isSampleOrderEnabled = $observer->getProduct()->getData('enable_sample_order');

if($isSampleOrderEnabled == 1){

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $store = $objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore();
    $_mediapath = BP.'/pub/media/'. 'catalog/product' . $_product->getImage();
    $imageUrl  =  $store->getBaseDir(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).'catalog/product' . $_product->getImage();

    $getProduct = $objectManager->get('Magento\Catalog\Model\Product');
    $sampleSkuExists = $getProduct->getIdBySku($_product->getSku().'-sample');

    $sampleProductPrice = $observer->getProduct()->getData('sample_price');
    if($sampleSkuExists == FALSE) {

        $product = $objectManager->create('Magento\Catalog\Model\Product');
        try {
            $product->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array
                    ->setAttributeSetId($_product->getAttributeSetId()) //ID of a attribute set named 'default'
                    ->setTypeId('simple')
                    ->setCreatedAt(strtotime('now'))
                    ->setSku($_product->getSku().'-sample') //SKU
                    ->setName($_product->getName()."-sample")
                    ->setWeight(4.0000)
                    ->setStatus(1)
                    ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
                    ->setVisibility(1)
                    ->setPrice($sampleProductPrice)
                    ->setMetaTitle($_product->getMetaTitle())
                    ->setMetaKeyword($_product->getMetaKeyword())
                    ->setMetaDescription($_product->getMetaDescription())
                    ->setDescription($_product->getDescription())
                    ->setShortDescription($_product->getShortDescription())
                    ->setStockData(
                        array(
                           'use_config_manage_stock' => 0, //'Use config settings' checkbox
                           'manage_stock'=>1, //manage stock
                           'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                           'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
                           'is_in_stock' => 1, //Stock Availability
                           'qty' => 99999//qty
                        )
                    );

            echo "BEFORE SAVING THE NEW PRODUCT";
            $res = $product->save();
            echo "AFTER SAVING THE NEW PRODUCT";

            var_dump($res);
            echo $product->getEntityId();
            // Save the new Sample Product ID to original product Attribute.
        } catch (Exception $e ) {
            echo    $e->getMessage();
        }
    } else {
        echo "UPDATE CODE GOES HERE";
    }
}

I cant get past $product->save();. Code execution stop right there without any notice/error.

Checked all the log files. there is no relevent information there as well.


texts:
I am trying to access Magento Connect Manager it is not opening, it is showing blank page. What am I supposed to do?

Please help


texts: Why are so many PHP functions disallowed in the Magento ECG Coding Standard?

texts:
The Magento ECG Coding Standard seems to be (at least kind of) official as standard for Magento 1 extensions:

https://github.com/magento-ecg/coding-standard

But I don't understand the reasoning behind all rules, and the code sniffer rules with their messages alone do not help much. Is there any detailed documentation about the standard? I know the common best practices and the developers guide but cannot find anything specific about these coding standards.

What troubles me most is the strictness about not using PHP functions.

For example: Why is every single file system related PHP function forbidden?

I guess, you are supposed to use Varien_Io_File, Varien_File_Object etc. but even the core developers are not aware of all the Varien classes and you often find things like in Mage_ImportExport_Model_Import_Adapter_Csv:

    $this->_fileHandler = fopen($this->_source, 'r');

So, the core is not the best example, as often.

Other IMHO questionable forbidden functions:

mb_parse_str
parse_str
parse_url
base64_decode

yeah, it's used in backdoors but banning eval should be enough and there are legit use cases, like encoding binary data. And other than json_decode (which is not forbidden) there is no core helper available for this.

Source: https://github.com/magento-ecg/coding-standard/blob/master/Sniffs/Security/ForbiddenFunctionSniff.php

Essentially, my question boils down to: Where is this standard documented? And/or is there a list of "things to use instead of these native PHP functions"?


texts: After login redirect a customer to a cms page if customer belongs to a particular group

texts:
I want to redirect a customer to a cms page if customer belongs to a particular customer group.

In config.xml:

            <customer_login>
                <observers>
                    <after_customer_login>
                        <class>Namespace_Module_Model_Observer</class>
                        <method>afterCustomerLoggedIn</method>
                    </after_customer_login>
                </observers>
            </customer_login>

In Observer.php:

public function afterCustomerLoggedIn(Varien_Event_Observer $observer)
{
    $customer = $observer->getCustomer();
    Mage::log("Yes customer is logged in." , null, "my.log");

    $groupId = $customer->getData('group_id');
    $group = Mage::getModel('customer/group')->load($groupId);
    $customer_group = $group->getCode();

    if($customer_group == "My_group")
    {
        $redirect_url = Mage::getUrl('mypage');
        Mage::app()->getFrontController()->getResponse()->setRedirect($redirect_url);
    }

}


texts: Installing PHP Modules in Docker for 2.3.4 Upgrade

texts:
I've been working on upgrading my local environment from 2.2.10 to 2.3.4, but can't figure out how to install the extra PHP modules for the new version (ie: sodium) using Docker. I was previously using PHP 7.1, but just rebuilt my containers with 7.3. They're up and running with no problem, but how do I go about adding the modules? I tried running sudo pecl install -f libsodium which I thought would work, but because sodium wasn't added to the php.ini file it wasn't able to pick it up. I haven't been able to even find the .ini file inside the container, and am really at a loss here. The next thing I tried was adding it into the PHP Extensions line in docker-compose.yml, but this seems to break the ability to even run bin/magento from inside the container.

Fyi I'm new to magento and docker, so I might be missing something obvious here. Thanks in advance for any help


texts: How to display categories and subcategories in layered navigation magento2?

texts:
These are Categories List in admin:

If I click Shop then I want to display categories and sub-categories in layered navigation filter.

How can I achieve this functionality?


texts: Can I use the URL Rewrite feature to redirect an entire subfolder using a wildcard?

texts:
Here's my problem. We switched to Magento from a Volusion site. In our Volusion site we had over 100,000 parts in our database with a url structure  like this. All of our parts were in the product-p folder. I want to redirect everything in that sub folder to our new parts section  here on our Magento site by using some sort of wildcard like *. I've tried tried in it using the URL rewrite feature as well as trying to manually code this directly into our .htaccess file. I've tried everything I can think of and I'm not getting anywhere.

Please help!


texts: How to add remove item from wishlist link on product page in Magento 2.3?

texts:
I want to add remove item from wishlist button on product page if product already added in Magento 2.3
How can I do this?


texts: Discount amount is not showing on cart page

texts:
In cart page (mysite.com/checkout/cart), there is a section that shows as Summary. In this section, usually displayed as,
a section to Estimate Shipping and Tax and after that, sections for

Subtotal
Discount
Tax

amounts. But in my site, the discount is not displayed. How can I display the discount amount and code as default magento 2 do?
I tried checking checkout_cart_index.xml but cannot find any abnormalities.

Can please someone help me?


texts:
For our search provider we need a custom xml feed to export category content. So I was thinking of going the advanced profile route. Basically, what I want to create:

<item><content_type>category_content</content_type>
  <g:id>6_nl</g:id>
  <title>My interesting info</title>
  <description>This category if filled with interesting information</description>
  <link>https://mywebsite/mycategory</link>
</item>

Is there a way to do that? So far all my searches end up with people trying to export product, but this is already covered by the plugins.


texts: Magento 2 - How to add a custom field in admin/sales/order/view

texts:
How can I add a custom field to admin/sales/order/view?
I'm trying to add a tracking number field to the sales order view.
The tracking number must be saved in the db.


texts: I'm importing products from 1.7 into 1.9 but the product id #s have changed. How do I fix this?


texts: In magento 2 how to edit the phtml file?

texts:
In magento 2 I need to edit topmenu.phtml file. So I copied the topmenu.phtml file from:

vendor/magento/module_theme/view/frontend/templates/html/topmenu.phtml

into:

app/design/frontend/<vendor_name>/<theme_name>/Magento_Theme/templates/html

and edited the file inside my theme module directory. But nothing changed. Someone please help me if am wrong.

  Note: I have inherited Blank theme by copying all modules from vendor/magento/theme-frontend-blank into my theme directory.


texts: Delete store view programmatically in upgrade script

texts:
I want to delete a store view programmatically. Looking at Mage_Adminhtml_System_StoreController::deleteStorePostAction(), this is pretty easy (shortened code a little bit):

$model = Mage::getModel('core/store')->load($id);

if ($model->getId() && $model->isCanDelete()) {
    $model->delete();
    Mage::dispatchEvent('store_delete', array('store' => $model));
}

I want to put this code into a data upgrade script so that the deletion will be executed automatically.

The problem is that while executing the upgrade scripts in data/ Magento only calls event observers configured in the global area (see Magento Structure Updates vs. Data Updates). Certain observers like enterprise_cms and enterprise_search for the event store_delete_after are defined in the adminhtml area so they won't get executed. The store view deletion won't be handled like a deletion executed in the backend.

How do you handle operations like this? Load additional event areas yourself in the upgrade scripts (I'm afraid of that)? Don't do data modifications like that in the upgrade script but put your magical scrips in a sacred hidden place and execute it manually?


texts:
How can I create a price list that is live on the website in Magento 1.9.1.1 using Ultimo Theme v 1.14.1?

We want to show all the products with their respective price on one page.


texts: Magento 2 Block ordering/moving: how to get of element name(or elements list) and destination elements name to move the element

texts:
May be this is not new to you, but have to ask this because of i cant get most answer what i want So asking as new.

<move element="minicart" destination="panel-header" before="header-links" />

This is the scenario what I have to get the element name or destination name like,

go to store > configuration > Advance >developer > Debug > Enabled
Template Path Hints for Storefront > ON IT.
See the TEMPLATE LINK go to the template in vender > magento > module directory > view ..... layout > default.xml and see for file name get the name.

ANY OTHER solution TO GET name?


texts: Magento not recognizing theme package `rwd`

texts:
I updated a Magento install from 1.3 to 1.9 and worked out most of the kinks (getting the page to display required indexing site, etc)

But it is not recognizing the rwd theme package

It sees the package (it will let me set the package as default).. if you try and use a package that does not exist the config will not save, but it is not using the theme in the front end

compilation is disabled
version is 1.9.1

Update

I am an idiot, the cms pages all had a default template set (not sure why or how), so this was a non issue


texts: Magento 2 - Plugin - afterGetPrice() - not working in backend

texts:
I have a plugin running afterGetPrice(). This is working correctly in the frontend but does not work in the admin area.
I have placed my di.xml in the following locations:

<moduleDir>/etc/frontend/di.xml
<moduleDir>/etc/adminhtml/di.xml

The content of these di.xml files is:

adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Product">
        <plugin name="sulman-product-model-admin" type="Sulman\Test\Plugin\ProductPlugin" sortOrder="1" />
    </type>
</config>

frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Product">
        <plugin name="sulman-product-model-frontend" type="Sulman\Test\Plugin\ProductPlugin" sortOrder="1" />
    </type>
</config>

My Plugin code is:

<?php
namespace Sulman\Test\Plugin;

class ProductPlugin
{
    protected $objectManager;

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

    public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result)
    {
        return 123.45;
    }
}
?>

It all looks OK but it's not changing the price in the admin.

Any ideas?

(all cache etc cleaned, content deployed, etc etc)


texts: Modify customer created_at date using customer_save_before event

texts:
I am trying to update the customer created_at (customer since) date due to some weird issues but not able to do so.
I have used the following code:

Registering Event:

<frontend>
    ...
    <events>
        <customer_save_before>
            <observers>
                <magepsycho_customer_customer_save_before>
                    <type>singleton</type>
                    <class>magepsycho_customer/observer</class>
                    <method>customerSaveBefore</method>
                </magepsycho_customer_customer_save_before>
            </observers>
        </customer_save_before>
    </events>
    ...
</frontend>

Observer Model:

public function customerSaveBefore(Varien_Event_Observer $observer)
{
    $event      = $observer->getEvent();
    $customer   = $event->getCustomer();

    if ($customer->isObjectNew()) {

        //@fix for date issue where day and months are interchanged (esp if registered by bots)
        //get magento UTC date
        $mageDate = $customer->getCreatedAt(); //but this value is always empty
        $mageMon  = date('m', strtotime($customer->getCreatedAt()));
        $mageDay  = date('d', strtotime($customer->getCreatedAt()));

        //get pure UTC date
        $currentMon = date('m');
        $currentDay = date('d');

        if ($currentDay != $mageDay || $currentMon != $mageMon) {
            //set the fixed date
            $fixedDate = now();
            $customer->setCreatedAt($fixedDate);
        }
    }
}

But main issue is $customer->getCreatedAt() is always empty.
Not sure if the event is triggered earlier then the date is set.


texts: How to change the new attribute to the top of near by short description

texts:
I just create a new attribute on magento 1.9.2, but i have one problem...
How can i put this attribute "Product status**" on the top  near by short description?

as u can see it in the picture


texts: How to add 2 input fields in one row using UI component

texts:
I want to add 2 inputs field in one row using the UI component in my custom module.
The field is about telephone so I want to have 2 textboxes, 1 asking for country code and another asking for a telephone number.

Somewhat like the attached screenshot.


texts: How do you remove the transit time from USPS shipping methods?

texts:
Shipping quote from USPS display something like:

  Priority Mail 1-Day $6.60

What's the proper way to change that so it only displays as "Priority Mail"?


texts: Magento2 - how to automatically create UpgradeData, UpgradeSchema based on existing table(s)

texts:
Who knows is there any tools, modules or whatever to convert existing table dump and structure into UpgradeData, UpgradeSchema?
Why? For example you created complicated settings stored in DB and you want to apply it to another installation along with your module to initialize it during installation. There is no way to build UpgradeData manually without any error or typo if it is big enough.

Yes, I know, I can insert it from sql file, but it is not always suitable


texts:
i'm using Magento 2.3.4 and i want some product URL is using different URL from URL rewrite,because i already created a custom frontend page for this product:
for example
getProductUrl() => http://baseurl.com/sku.html into getProductUrl() => http://baseurl.com/custom/product/page/id/5


texts:
Magento 2 use less/php lib to compile less to css
first run time i created my style named style.less in theme directory(web/css). Magento 2 compiled my file to pub/static/frontend/VendorName/ThemeName/en_US/css/style.css then I edit style.less browser reload nothing change
How to apply new change on style.less when edit file? command dev:css:deploy not work


texts: How to create menu and it's controller in magento 2

texts:
I want to add my custom menu in admin and also want to add related controller for that.

So how can I do that?


texts: How to get post data variables from textbox after submition a form in magento

texts:
How do I get data of post variables ? Like if I post form with post method then I can get it with $_POST or not

this is my form

<form id="orderapproval-item-form" class="orderapproval-hidden" action="<?php echo $this->getDeclineUrl(); ?>" method="post">
    <input type="text" name="message" class="orderapproval-disabled" value="<?php echo $this->__('Enter decline reason'); ?>" id="decline" />
    <input type="submit" value="<?php echo $this->__('Decline'); ?>" onclick="namet()" />
  </form>

in phtml file i have added a form with post method i want to data variable of this form

I am using code this on same page

$this->getRequest()->getPost('field_name');

but i am not getting data


texts:
I have a class in my custom module that needs to handle various AJAX requests as well as a typical Magento request. I am using AngularJS on the front end.

Angular will submit request parameters in JSON format, so if you have a simple call such as:

$http.post('/mymodule/mycontroller/myaction', {param1: 'foo', param2: 'bar'});

You cannot simply use $this->getRequest()->getParams() to get param values. Instead you need to use file_get_contents(php://input) to get the raw input string which you can then json_decode or do whatever you need to to access the request params.

See: https://stackoverflow.com/questions/15707431/http-post-using-angular-js

As I said, my custom class needs to handle both AJAX requests from Angular as well as normal Magento requests (or even AJAX requests from jQuery). The problem is handling the parameters in a consistent fashion.

How can I normalize the request from Angular so that Magento still has access to $this->getRequest()->getParams()?


texts: Transactional Email Change Logo not working

texts:
I'm trying to change the logo of the transaction email. But upon changing of logo it's not displaying the preview of the uploaded image. So now I tried to preview using the inspector and below is what I got

So if I click the preview tab this is what it looks like. Based from the request params it's an AJAX so I'm expecting it to be in JSON format but it's returning an HTML format as shown below

I was expecting a preview of the uploaded image to be displayed but I can't see anything. I already made all folders 777 (I know it's not safe but just want to make it work for now).

Any solution or fix with this? BTW I'm using a vagrant box although I know this is not the issue. I checked the logs both the server and application logs but there are no error.


texts: Fatal error: Call to a member function getAllVisibleItems() on null in /src/app/code/local/ITC/JLimoPayment/Model/Payment.php on line 87

texts:
When I load my layout I catch exception. My layout :

<?xml version="1.0"?> <layout version="0.1.0"> <agentdeposit_success_success>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/finalizeorder.js</name></action>
        </reference>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="agentdeposit/success" name="agentdeposit_success" template="agentdeposit/success_form.phtml" />
        </reference>
    </agentdeposit_success_success> </layout>

My controller:

<?php
class Payment_AgentDeposit_SuccessController extends Mage_Checkout_Controller_Action
{

    public function successAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

and my block:

<?php
class Payment_AgentDeposit_Block_Success extends Mage_Payment_Block_Form_Container
{

    protected $_quote;

    public function __construct()
    {
        parent::__construct();
    }

    public function _prepareLayout()
    {
        parent::_prepareLayout();
        return $this;
    }
}

My exception on the photo.
I broke my head. What it can be?


texts: Header Links showing beyond search box and minicart beyond navigation !! Magento 2.3.5-p1

texts:
When a customer is signed in the header links (My account, My Wish List, SIgn Out) are displayed beyond the search box . See the image attached .
I've noticed that there is an element.style {z-index:100} if I change that to 1001 the dropdown is displaying correctly but I can't figure it out where this element.style is coming from . Can somebody point me out where to look for ? Need to mention that this is not happening just in my theme is happening in Luma theme as well . I'm using magento 2.3.5-p1 .
Also I have same problem for minicart. The pop up message when you delete a product from minicart is displayed beyond header. The z-index is 902 and if I change it to a bigger value then is ok.
Is there any javascript or where is this element.style{z-index: 1000 / 902 } coming from .


texts:
I have created an attribute for image as "billede_hover" ,
See Admin screen-short below,

When i am upload image,
And also noted in media folder create billede_hover but it's alway empty,

Please suggest

I am using below code but it's not working

<?php echo $this->helper('catalog/image')->init($_product, 'billede_hover')->resize(400,300); ?>


texts: Creating a new folder for Images uploading in Magento admin panel

texts:
Currently, we are using the version Magento 2.2.6. We would like to create a new folder for the images with the admin panel as per the below image.

But the popup for creating a new folder hides behind the page-wrapper which is in the screenshot.

The popup is only displaying when we close the page wrapper.

I have tried to make this work by using CSS but with no success.

Could anyone please help me to get this work?

Looking forward to your reply.


texts: How to resize the magento 2 product images

texts: I need to resize the magento2 product images to  150px *  150 how can we achieve this


texts: Magento 2 guest checkout - shipping first name last name pre-filled randomly - how to make it blank

texts:
I have the problem that the fields first name and last name of guest checkout are populated already with data which is not the clients data. How can I set that it is blank? Does anyone have an idea why the fields first name and last name are pre-filled on the first hand? Using Magento 2.3.3
Thank you very much already.


texts: Magento2: What are the differences between Elasticsearch and Solr?

texts:
This is one of the questions in the Magento 2 Certified Solution Specialist exam study guide. I know that the Elasticsearch and Solr are two of the most popular open source search engines and Magento Enterprise Edition (EE) version 2.x enables you to configure either of them as a catalog search engine (Solr is deprecated in Magento 2.1 and will not be supported in 2.2).

Based on magento docs each can do the followings:

Solr:

  Faceted search
  Dynamic clustering using SolrCloud
  Database integration

Elasticsearch:

  Elasticsearch performs quick and advanced searches on products in the catalog
  Elasticsearch analyzers support multiple languages
  Supports stop words and synonyms
  Indexing does not impact customers until reindex is completed
  Elasticsearch returns search results based on the last generated index until the new one has been completely indexed so there’s no
  disruption to customers
  Accurate, performant, scalable
  Works well out of the box
  Easy to horizontally scale
  Supports real-time data and analysis
  Can be used as a document-oriented data store
  Applications in framework beyond search—reporting, personalization, performance, and storage

So here is my question: As they both were built on top of the Apache Lucene open source platform, so their functionalities should be similar. Is there any main differences between Elasticsearch and Solr? What was the main problem of the Solr that now is deprecated in Magento 2.1 and will not be supported in 2.2 ?


texts: How to relabel/translate a Payment Method on Sales Order page

texts:
Task

I'm trying to translate "Check / Money order" to "Quote" in the Backend of Magento 2. This label is displayed on the Sales > Order screen after taking a payment with this method.

Tried Methods

So I've updated the following fields/files, but they don't have any effect on this particular instance.

Updated en_US but this only affects the translation under Configuration > Sales > Payment Methods
Updated the Title, which only affects the store view


texts:
Is there any way to show DOB (Date Of Birth) field in guest checkout page?

I saw this question, but with it we have to create and set the dob field in quote with InstallSchema.php file, and I know that customers have DOB field, and in Stores > Config > Sales > Customers >Name and Address Options there's an option to show DOB field, is there any way to use this field instead to create a new one?

Thanks in advance.


texts:
Our site is currently running in PHP 5.4 with Magento 1.9. I want to migrate the site to the latest version of Magento along with PHP 7.
We have created & used a lot of custom modules & using a custom theme.
What is the best & easiest way to migrate the code & data?
Also, I've come across official "code migration" tool, but it is leading to 404 page. Is this link outdated? Is there any new document available for code migration?
Thanks in advance.


texts: Is there a way to retroactively add attribute_sets to simple products?

texts:
All of the products in my store are created automatically by our stock control programme, which means that they are created as simple products with no attribute_sets.
I now want to create configurable products to associate some of the individual simple products to. For example we have gloves of different sizes in stock and I have created an attribute_set of glove sizes and created a configurable parent product so customers can choose size from a dropdown which will then pick the associated child product.

Is there a way I can do this without having to recreate the simple products?


texts: Using an new attribute for the product name Magento 1

texts:
In my grouped products I Need the Title of my products to be shorter so I have made a custom attribute with the attribute code table_name (label: Table_name).

I found this is the line of code which generates the name that is displayed in the table

        <?php echo $this->htmlEscape($_item->getName()) ?>

So, I thought just changing this would get the job done as I have below

        <?php echo $this->htmlEscape($_item->getTable_name()) ?>

When I var_dump the products I can see the table name is displayed in the products like

["short_name"]=> string(11) "Extra Small"

So I know the attribute is being called but how do I pull the short now out of the product to display?

But no luck. What am I doing wrong and how can I get the attribute table_name to display instead of the attribute Name?

Thank you


texts: How can I call a block method from a script file?

texts:
I'm running a script off my root directory, http://www.example.com/my_script.php.

Within this script, I am trying to call a function from Mage_Catalog_Block_Product_Abstract:

public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '')
{
    $type_id = $product->getTypeId();
    if (Mage::helper('catalog')->canApplyMsrp($product)) {
        $realPriceHtml = $this->_preparePriceRenderer($type_id)
            ->setProduct($product)
            ->setDisplayMinimalPrice($displayMinimalPrice)
            ->setIdSuffix($idSuffix)
            ->toHtml();
        $product->setAddToCartUrl($this->getAddToCartUrl($product));
        $product->setRealPriceHtml($realPriceHtml);
        $type_id = $this->_mapRenderer;
    }

    return $this->_preparePriceRenderer($type_id)
        ->setProduct($product)
        ->setDisplayMinimalPrice($displayMinimalPrice)
        ->setIdSuffix($idSuffix)
        ->toHtml();
}

How can I call Mage::Catalog_Block_Product_Abstract::getPriceHtml from within my script file? I've tried:

Creating an object using Mage::getBlockSingleton('catalog/product_abstract')->getPriceHtml

Which results in this error:

Fatal error: Call to a member function getPriceHtml() on a non-object

Class inclusion

Like this:

include('../app/code/core/Mage/Catalog/Block/Product/Abstract.php');
$catalog_block = new Mage_Catalog_Block_Product_Abstract();

Which results in:

Fatal error: Cannot instantiate abstract class Mage_Catalog_Block_Product_Abstract

Because it is an abstract class.

Is it possible for me to do this somehow?


texts: How to add a check box to a simple product?

texts:
I was looking for the similar questions, but did not find any that carried a similar goal.

My goal is add a check box that will appear on each product page from one category, that has simple products only. Before a customer will be able to click on BUY s/he will have to pick option1 or option2 from this box. This option has to appear in the information about the order.

This should not turn a simple product into a configurable product.

I am using Magento 1.7.0.2


texts: How to remove some fields from the filter

texts:
I have all my attribute fields in the filter selection.
I would like to have only a few fields in the filter selection.

How can I remove all my unneeded fields ?

Thanks,

Noemi.


texts: Magento 2 custom shipping method set default shipping price as text which 0

texts:
is it possible to set default shipping price as text in my custom shipping method
look like

$method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod($this->_code);
            $method->setMethodTitle($this->getConfigData('name'));
            $shippingPrice = 'my text';
            $method->setPrice($shippingPrice);
            $result->append($method);


texts: Create many simple products with similar attributes at once

texts:
I'm having major product overload just doing 1 out of 99 and I'm not even done yet.

We have a product that comes in 99 flavors. Each of the 99 flavors have the same attributes. We have 5 bottle sizes, 6 nicotine levels, and 4 VG/PG levels. It basically makes a TON of "simple products" for just this one flavor alone.

Is there any plugin that can do it all the attributes at once (like on one page) or some kind of "generator" that can make a text file and just load that?


texts: How to add a field using xml from existing fieldset created using php

texts:
I have a module where I'm overriding some of it's feauture to match what I need. So everything is working but I need to add an editor wysiwyg field into the existing form using an xml (uicomponent) but the module built the forms using php (setField & renderer).

Is there a way I can do this? becaue I really have to be able to create an additional field using xml and not php.

Thanks


texts: How to make a specific script run only once in the lifetime of an extension

texts:
The requirement is that I want to execute a script upon the installation of my extension. But I want to make sure that it runs only once and then never again.

I tried doing this via Setup Resources. But apparently, it runs not only when the user installs the extension but also when the clears the cache and other actions etc.

Setup.php

class My_Module_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
{
    function __construct($arg)
    {
        # Code that I want to run only once
        parent::__construct($arg);
    }
}

Is there a specific way to achieve this without having to write stuff to the database?


texts: Magento 2: How to fix google merchant crawl error Page not found(404)

texts:
I am getting google merchant crawl error Page not found(404).

Is anyone have an idea about this?

Thanks


texts: How To Display Placeholder Image In Category

texts:
How to give Condition For Category Image ?
If Category Image Has Not Exist Then Display Placeholder Image/Thumbnail.

How to Write If Else Condition For That?

Code

 <?php
    $category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
    $categories = $category->getCollection()
            ->addAttributeToSelect(array('name', 'thumbnail'))
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($category->getChildren())
    ?>

        <?php foreach ($categories as $category): ?>

                <a href="<?php echo $category->getUrl() ?>"><img src="<?php echo Mage::getBaseUrl('media') . 'catalog' . DS . 'category' . DS . $category->getThumbnail() ?>" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
                <?php echo $category->getName() ?>

        <?php endforeach; ?>

I M uses for :

<?php if($category->getThumbnail()): ?>
    <img id="slide-img-1" src="<?php echo $this->helper('catalog/image')->init($category, 'thumbnail')->resize(135, 135); ?>" />
<?php endif; ?>


texts: How to get the wistlist_item_id in magento2

texts:
How to get the wistlist_item_id for particular customerId and productId in magento2?

Thanks.


texts:
I am working on a magento custom module
 , and trying to test if the emails are sent properly , the module sends emails after 48 hours of an event , how do i modify the magento date time to test if the module is sending the mails .


texts: how to display product attribute in product list Magento 1.9.1.0

texts:
I'm trying to display size shoes attribute for each product in product list (something like a native configurable swatches ) , But I got all sizes on the top of the page instead of getting them under each product name . Is there any way to create dynamic block and append it for each product or another alternative ?

I create a module and I'm using an observer to handle the collection , I don't like to have a bunch of code in list.phtml

my code is the following :
observer.php

<?php
class Campany_Swatches_Model_Observer extends Mage_Core_Model_Abstract
{
public function productListCollectionLoadAfter(Varien_Event_Observer $observer)
{
        $collection = $observer->getCollection();
        $helper = Mage::helper('Campany_swatches');
        $products = $collection->getItems();

        /* @var $product Mage_Catalog_Model_Product */
        foreach ($products as $product) {
             $helper->getAttributes($product);

         }
    }
}

helper Data.php

<?php
class Campany_Swatches_Helper_Data extends Mage_Core_Helper_Abstract
{
    private $_html;

    public function getAttributes($_product = false)
    {
        if($_product->isConfigurable()){
        //get attributes
           $attributes = $_product->getTypeInstance(true)->getConfigurableAttributes($_product) ;
           if(count($attributes)){
                foreach($attributes as $att){
                    $pAtt = $att->getProductAttribute();
                    //get the  product children
                    $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
                    $frontValues =array();

                    if ($pAtt->getFrontendLabel() == "Shoe Size"){
                        foreach($allProducts as $p){
                             //check stock, status, ...
                             //do not show unsaleable options
                        if(!$p->isSaleable()) continue;
                            $out=$p->getAttributeText($pAtt->getName());
                            $frontValues[$out]=$out;
                        }

                        $this->_html = '
';
                        $this->_html .= '
';
                        $this->_html .='
';
                        $this->_html .= implode('

', $frontValues);
                        $this->_html .='

';
                    }
                }
            }
        }

    return $this->_html;

    }


texts: Get full size and resized images in the same loop in media.phtml

texts:
I'm working with the new Magento default responsive theme (RWD).

On product view page I need to get the url of full size dimensions images.

In catalog/product/view/media.phtml I find

<?php
        $i=0;
        foreach ($this->getGalleryImages() as $_image):
            $_imageUrl = $this->helper('catalog/image')
                              ->init($_product, 'image', $_image->getFile())
                              ->keepFrame(false)
                              ->constrainOnly(true)
                              ->resize(1200);
    ?>
        <img id="image-<?php echo $i; ?>"
             class="gallery-image"
             src="<?php echo $_imageUrl; ?>"
             data-zoom-image="<?php echo  $_imageUrl; ?>" />
    <?php
        $i++;
        endforeach;
    ?>

As I said, I need to add one data attribute of  tag with the url of full size image so I try this way

<?php
    $i=0;
    foreach ($this->getGalleryImages() as $_image):
        $_imageUrl = $this->helper('catalog/image')
                          ->init($_product, 'image', $_image->getFile())
                          ->keepFrame(false)
                          ->constrainOnly(true)
                          ->resize(1200);

        $_imageUrl_full = $this->helper('catalog/image')
                          ->init($_product, 'image', $_image->getFile());

?>
    <img id="image-<?php echo $i; ?>"
         class="gallery-image"
         src="<?php echo $_imageUrl; ?>"
         data-zoom-image="<?php echo  $_imageUrl; ?>"
         data-zoom-image-full="<?php echo  $_imageUrl_full; ?> />
<?php
    $i++;
    endforeach;
?>

...but I get the same image url (the full size one) for both "data-zoom-image" and "data-zoom-image-full".

I also try to clone the $_image object but no result.

Any advice?

P.S. I saw the question Issue with getting product image but I'm looping through media gallery images and not between products. My objective is to get different sized images and not different product images. And Last, as I said, I try to clone the $_image with no luck.


texts: Words divide by particular number to get time on PHP

texts:
I need php code to get following kind of condition.

222 words -> 1:00; 444 words -> 2:00 ;22200 words -> 100:00 - we must put seconds aswell if number of words is more than 222

on 333 words -> 1:30

on 777 words ->3:30

to be easier, if number of words is less than 222, put only seconds, so for 111 -> 0.30

How can I get this kind of value in php ?


texts: Best strategy for product data changes in production

texts:
I've been looking at ways to incorporate product data changes (creation, updation, deletion) into a production environment other than performing them through the admin interface. Couldn't find any resources that talked about these in particular.

I'm using a git & modman based workflow for extensions. I have a module that configures the store(admin settings, store information, themes etc.) through setup scripts. Data setup scripts are an option. But, I'm not sure of the memory implications when loading hundreds of products through a data setup script.

I can think of the following options (I might be missing some):

Use a custom script / dataflow profile for initial bulk product data import (when setting up the store) and data setup scripts for later additions/modifications
Use data setup scripts for both initial bulk product import and subsequent creations/modifications
Use the excellent Aoe_Import module by AOEpeople for intial bulk product data import and data setups scripts thereafter

What is the best practice for pushing data to production environment for a large single shop (not a magento hosting scenario where each client would want more flexibility over their data) ?


texts: Magento Programmatically Re-Authorize Orders

texts:
We recently had a major issue in our installation of Magento, over 500 orders were placed and successfully authorized, but did not save their information in the additional_information field in the table sales_flat_order_payment.

As such, when we try to capture the payment via authorize.net, it sends all null values to them. They return the response "invalid expiration date".

What I need to do is re-authorize (NOT capture) all of these orders programatically. How would one go about this without creating new orders?

Would re-authorizing orders even fix this?

Is there a way to programatically make the additional_information column not have a null value?


texts: can anybody help me with Magento test automation framework integration with net beans and running test scripts through net beans IDE.


texts: Magento 2.2.4 : image not showing in product page

texts:
I haven't the image of the product on my product page, but I have it inside category page.

I also have the link of the image if I go into html code through developer console.

I tried to flush cache of catalog, magento cache and browser cache but I have no result.


texts: How move shippingAddress to shipping method - Magento 2

texts: How to transfer the delivery address - add it to each item with delivery in checkout? Better implemented through html template or XML layout?


texts: Magento 1.9 custom module version not upgrading?

texts:
Am trying to upgrade a module. The core_resource table is not updating and sql resource is not running. I have tried lots of possibilities.

My config.xml

 <modules>
  <ITwebexperts_Request4quote>
        <version>2.2.0.20180430</version>
    </ITwebexperts_Request4quote>
 </modules>

My upgrade script name

  mysql4-upgrade-2.2.20170523-2.2.0.20180430.php

current row in core_resource

   request4quote_setup | 2.2.20170523 | 2.2.20170523

please help me out


texts: Magento 2 set block template in layout vs in block

texts:
There are two ways to set a blocks template.
Either in the block using

$this->setTemplate('Vendor_Module::template.phtml');

or in layout

<block class="Vendor\Module\Block\BlockName" name="myblock"template="Vendor_Module::template.phtml"/>

Which way would be the best way to set a blocks template or what are the advantages/disadvantages of both?


texts: How can i solve the error : PHP Strict Standards: Declaration of CustomImportExport_Export::export()

texts:
I get error during export product,

Error : (error_log)

[15-Jul-2016 12:24:04 UTC] PHP Strict Standards:  Declaration of CustomImportExport_Export::export() should be compatible with Mage_ImportExport_Model_Export::export() in /home/giritra/public_html/export_product.php on line 1047


texts: Magento 2.3: how to fix blank admin page not rendering

texts: I have installed magento 2.3 latest version, But I never login in admin panel.


texts: Magento 1.9 : Programmatically created cart not showing on frontend

texts:
I have below code to create cart and addProduct :

$quote = Mage::getModel('sales/quote')->setStoreId(1);
$quote->assignCustomer($customer);
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => 1)));
$quote->save();

Above code creating corresponding rows in quote tables, but when I'm checking on frontend cart page for same customer then I'm getting Cart is empty on cart page.

But when I try to addproduct in existing cart which is created from frontend using below code :

$quote = Mage::getModel('sales/quote')->load($cartId);
$quote->assignCustomer($customer);
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => 1)));
$quote->save();

then the programmatically added product is coming on frontend.

Why this is happening?


texts: Extending product attribute dropdown value settings popup

texts:
I need to add a new tickbox to the "Settings" popup of a product attribute of value "dropdown".
An image of the popup is below.

Does anyone know how to extend this from module?


texts: Magento2 Missed Required Arguement httpContext in parent::__construct call

texts:
I have a custom Module with a file in Block/Wishlist/prouctoptions.php

The contents of the file are like this:

<?php
namespace Myweb\CustomArt\Block\Wishlist;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Catalog\Model\ProductFactory;

class ProductOptions extends \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Info
{
    protected $_productloader;
    public function __construct($_productloader, $context) {

        $this->_productloader = $_productloader;
        parent::__construct($context);

    }
    /**
     * Retrieve form action
     *
     * @return string
     */
    public function getIndexAction()
    {
            // companymodule is given in routes.xml
            // controller_name is folder name inside controller folder
            // action is php file name inside above controller_name folder

         return '/customart/index/index';
        // here controller_name is manage, action is contact
    }

}

While running the command setup:di:compile I am getting the error like:

Missed required argument httpContext in
parent::__construct call. File:
 /public_html/app/code/Myweb/CustomArt/Block/Wishlist/Productoptions.php
Total Errors Count: 1

What I am missing here?


texts: What is difference on both Object manager?

texts:
What is difference on both and how will i understand to where should i use any one of these ?

\Magento\Framework\ObjectManagerInterface

\Magento\Framework\App\ObjectManager::getInstance()

if i use

\Magento\Framework\App\ObjectManager

In constructor then.


texts: What's the most appropriate extension for a simple affiliate program?

texts:
I'm not sure if "best extension" type questions are allowed here, but I'll give it a shot.  The requirements are pretty simple:

Customers get a link that they can share
Purchases made through affiliate links get tracked
Customers get store credit for referrals
Non-customer affiliates (think: bloggers) can also get a tracking code for referrals
Payouts will be made manually to bloggers (as opposed to store credit for customers).
Nothing much needed on the frontend, will pop some basic FB sharing in, etc.
Licensed for Enterprise Edition

Affiliates by aheadWorks looks pretty good, but I wasn't sure if there were other good options out there.
UPDATE: Affiliates by aheadWorks doesn't appear to support customer credit for referrals, but rather only the "blogger" use case I mentioned above.
UPDATE 2: MageWorld's Affiliate Pro 3 looks pretty good.  I'm not sure if it will allow me to only offer store credit to customers, as opposed to also allowing them to actually make withdrawals.
UPDATE 3: The Referral Bonus and Reward System by BelVG seems to have the minimal feature set that I'm looking for actually.


texts: Add custom fields for Order Line Items in Magento via module

texts:
I want to add custom order line items in Magento via module

I just found one link:

http://www.webcenter.co.in/how-to-add-custom-fields-for-order-line-items-in-magento

But here we have to do changes in code how can I do it via module.

Basically I want to add custom text field to product detail page and save its value to be available in checkout and order detail in admin.


texts:
A quick question with regards to the csv which needs to be created for implementing these rules.

I have a basic rule where for example shipping to Belgium for one item starts at £3.00
Then for every extra item the total goes up by £1.00

So in the csv the item # of items field would be:

Then shipping price is £3.00
Then shipping price is £4.00
Then shipping price is £5.00

And so fourth. However when the quantity is met in the check out (the user have item number over 3 in this example) the shipping price will stay at £5.00

What I need is this £1.00 per item rule on however many items are added to the order.
Is there any way to achieve this rather than just adding many more rows to the csv file with a high cap?


texts: Getting error while reindexing in magento2

texts:
While re indexing in magento2 getting below error

Fatal error: Uncaught TypeError: Return value of Magento\PageBuilder\Model\Stage\Preview::isPreviewMode() must be of the type boolean, null returned in /var/www/html/Project/vendor/magento/module-page-builder/Model/Stage/Preview.php:132

Do anybody know what isPreviewMode work for in pagebuilder?


texts: Get custom attribute for customer while creating order in backend magento 2

texts:
I have created a custom attribute for customer https://prnt.sc/tb68lv
The values are getting saved in the database. i have cross checked it again after opening the customer for edit and the values were present.
But when i create an order for a customer, i found this field to be blank in Account information tab. https://prnt.sc/tb6f1k
How can i get the value of this field already displayed like email and other info.
Please help


texts: Magento 2 - get cache url of media gallery images of product

texts:
This is my code for get cache url of images:
$images = $_product->getMediaGalleryImages();
foreach($images as $child){
            echo '"'.$child->getUrl().'"';
}

Result expected: pub/media/catalog/product/cache/1cd59219f95f9c415e6b76e445689a097/J/K/JK791735.jpg

Result obtained: pub/media/catalog/product/J/K/JK791735.jpg
How can i do?
Thanks


texts:
I want to load my media/images from multiple cdn path to decrease the download time of my category/product pages.

Currently there is only one field to enter the base media url. Any plugin or any useful tips on this will be a great help.

My requirement is i should be able to give more than one base media url paths from Magento admin. (I know how to give more fields there).This is not my real problem. But I would like to tweak my Magento to load media assets from those base media urls i have configured in admin.


texts: When I go to my site it shows " Sorry, your Website is in work". My question is how I can do that this is not there and all can see my site.


texts: Grunt workflow, problems with watch task and reloading

texts:
I've been trying to get the "grunt watch" task running combined with livereload but unfortunately I'm not able to get a working solution. I've read the magento devdocs but running a combination of the various tasks does not result in a working solution.

Attempt 1:
When running grunt clean and then grunt watch, changing my less files will not trigger the compilation of the less files

Attempt 2:
When running grunt clean, grunt exec and then grunt watch, changing my less files will trigger the compilation of the less files, then livereload will actually reload the page but I'm still looking at the old CSS (before my less changes).

If I run a grunt clean after the above, the new css will actually become visible within the browser (after reloading manually).

my themes.js contains my own template's configuration:

allesvoorjeolie: {
      area: 'frontend',
      name: 'jpl/allesvoorjeolie',
      locale: 'en_US',
      files: [
        'css/styles-m',
        'css/styles-l'
      ],
      dsl: 'less'
    }

And the file which I'm actually changing is:

/app/design/frontend/jpl/allesvoorjeolie/web/css/source/_theme.less


texts: Magento Connect: cannot connect to the host

texts:
Managing a site in Magento, Magento Connect Manager after login takes me to this error:

  cannot connect to the host
  magento.nameofthesite.domain-owned-by-old-maintainer

The site has been moved from one host to another one and the old developer has been changed