texts: Sending shipment mail when shipment is printed (not created)

texts:
Magento 2.3.3
I am trying to send the shipment mail, when a shipment is printed via the Print button inside the shipment.
I know the right place in an extension I am using for printing. This is part of the code from the extension, I just addded the line for sending the shipment mail and the ShipmentSender in the constructor:
if ($Id) {
            $shipment = $this->shipmentRepository->get($Id);
            if ($shipment) {

                // This is the line I added...
                // $res is always false
                $res = $this->shipmentSender->send($shipment);

                return $this->_pdfHelper->downloadPDF($this->shipmentPdfFactory->create()->setRenderTemplateId($tplId), $shipment);
            }
}

What am I missing? The shipment is available here, no idea why its not sending. Any ideas?


texts: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.catalog_product_entity_integer' doesn't exist

texts:
I created custom product attributes in custom module. when Add new product is clicked it shows this error message.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2_dev.catalog_product_entity_integer' doesn't exist


texts: Listen for event after attributes are saved - Magento 2

texts:
I have a working event observer hooked to:

catalog_product_attribute_update_before

However I need the event that fires after the attributes have been saved. I had hoped that this would be:

catalog_product_attribute_update_after

but this is not firing. What event should I be listening for?

Furthermore if this event exists how should I get $product objects from the updated products. In my current class (listening for: catalog_product_attribute_update_before) I do the following:

public function execute( \Magento\Framework\Event\Observer $observer ) {

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

    foreach ($observer->getData('product_ids') as $key => $prodID) :

        $objectManager->get('Magento\Catalog\Model\Product')->load( $prodID );

        $product = $this->getProduct( $prodID );

    endforeach;

}


texts: How to Find the Number of Orders from Specific Country

texts:
I tried using following method. But it's not working

$total = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('country_id', array('eq'=>'SA'))
->getSize();

echo '
Total: ' . $total . '
';


texts: Magento Connect: Console output frame missing? after 1.9.2.4 update attempt

texts:
I recently installed a new Magento-1.9.2.3 store and I went to update to the latest 1.9.2.4 releases.  I decided to start with the Mage_Downloader first, and upon committing to the install this is what it looks like at the bottom of the page along with errors of course.

  CONNECT ERROR: Package community/Mage_Downloader 1.9.2.4 conflicts with: community/Mage_All_Latest 1.9.2.3

Has anyone seen this?


texts:
In Magento 2.2.2, clicking of custom admin gives the this error.

How to fix it.


texts: Display Products from External db in Magento

texts: I have a database in which some products and its categories. I would like to create a Magento site using this database with all Magento functionalities. I am using Magento 1.9.x and MySql database. How can I do this? Does anyone have any ideas how I could do that?


texts: I want to hide tax price details in order_email_template.How to do it in Magento-2.1?

texts:
I want to hide tax details from order_email_template in Magento-2.1. For comment this code in \vendor\magento\module-sales\view\frontend\layout\sales_order_email_items.xml:

<block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="order/tax.phtml">
    <action method="setIsPlaneMode">
        <argument name="value" xsi:type="string">1</argument>
    </action>
</block>

I want to override it. Please help me to override this file.


texts: magento 1.9.2.4 new order email not working

texts:
I am using Magento 1.9.2.4 version and email not working I also set complete cron in my CPanel with .sh and .php but not working how can I resolved the issue.

php cron :- php -f /home/username/public_html/cron.php

sh cron :- sh /home/username/public_html/cron.sh


texts:
Is it possible to use PHP class constants as values in the config.xml file?

For example, if we have this config.xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <custommodule>
            <settings>
                <is_active>1</is_active>
                <mode>MODE</mode>
                <send_notification_email>0</send_notification_email>
            </settings>
        </custommodule>
    </default>
</config>

I would like to use a PHP class constant to output the value for the "mode". Is there a way to achieve this?


texts:
I am trying to create my own category menu.

If I use getChildrenCategories(), it shows the categories by position in the admin but can't sort if the category is included in the navigation or not

$category->getIncludeInMenu() is not working

However if I use the getChildren(), it can sort if it is included in the navigation but can't sort the position in the admin.

What is the difference between getChildrenCategories() and getChildren()?

How can I use them in order to achieve these following:

Sort category by position in the admin.
Check if included in the navigation.


texts:
I want to create a cart rule with the following conditions:

  Buy 3 products at £50 (Price of each product must be equal to £30).

How to do that.

Thanks.


texts: Breadcrumbs are not appearing because they are null

texts:
I am trying to move the breadcrumbs to inside a category page, and Ive been struggling. I have been looking at the following resources, but they have not helped:

http://forum.azmagento.com/magento-users-guide/breadcrumbs-are-not-showing-in-magento-cms-pages-745.html
http://www.magenshop.com/how-to/breadcrumbs-right-of-category-name.html

I have added the following to remove the breadcrumbs from root and then add them as a child of category.products. Like so:

<catalog_category_layered translate="label">
    <reference name="root">
        <remove name="breadcrumbs"/>
    </reference>
    <reference name="category.products">
        <block type="page/html_breadcrumbs" name="onlybreadcrumbs" as="onlybreadcrumbs" template="page/html/breadcrumbs.phtml"/>
    </reference>
</catalog_category_layered>

This is at the top of catalog/category/view.phtml I am adding the breadcrumbs file with this:

<?php echo $this->getLayout()->getBlock('onlybreadcrumbs')->toHtml(); ?>

At the top of page/html/breadcrumbs.phtml I have this:

Crumbs:<?php var_dump($crumbs); ?>

The output at the top of a category pages is this:

Crumbs:NULL

My problem here is that after moving the breadcrumbs into the category view file, the $crumbs variable is NULL, and as a result none of the breadcrumbs appear.

In the end I used code from this page to get around the problem: http://awebtech.blogspot.co.uk/2011/04/magento-add-breadcrumbs-in-pages-where.html

However this solution is basically to just rebuild the breadcrumbs from scratch, and it feels like a bit of a hack.

Can someone explain to me, after moving the breadcrumbs into another file, why $crumbs is now NULL - and most importantly, how to fix this issue properly.


texts: How to use code migration toolkit in magento2?

texts:
Below is the Github link for Code migration toolkit magento2.
https://github.com/magento/code-migration

I need to migrate my magento1 modules to magento2 standards. Does this supports it? If it supports please anyone suggest how to start using this tool?

inside < src > what files do we need to put? the full code fodler? or only the local directory? I have 5 custom modules of m1 what are the files to be included in < src > directory?


texts: Magento custom column in quote table not store value

texts:
im creating new column in quote table by using this line

$installer->run("ALTER TABLE `{$installer->getTable('sales/quote')}` ADD `excl_price` int(1) NOT NULL DEFAULT 1 ;");

im saving value to column excl_price

$quote->setExclPrice(0);

but it not store value

can anyone help?


texts:
I want to get the store url in Magento 2. I follow this tutorial and other tutorials have the same answer as well
https://www.rootways.com/blog/magento-2-get-base-url-in-phtml-file
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();

$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$store = $storeManager->getStore();
echo $store->getBaseUrl();

The getStore function will return StoreInterface. However, I can see that there is NO getBaseUrl function in the StoreInterface
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Store\Api\Data;

/**
 * Store interface
 *
 * @api
 * @since 100.0.2
 */
interface StoreInterface extends \Magento\Framework\Api\ExtensibleDataInterface
{
    /**
     * @return int
     */
    public function getId();

    /**
     * @param int $id
     * @return $this
     */
    public function setId($id);

    /**
     * @return string
     */
    public function getCode();

    /**
     * @param string $code
     * @return $this
     */
    public function setCode($code);

    /**
     * Retrieve store name
     *
     * @return string
     */
    public function getName();

    /**
     * Set store name
     *
     * @param string $name
     * @return $this
     */
    public function setName($name);

    /**
     * @return int
     */
    public function getWebsiteId();

    /**
     * @param int $websiteId
     * @return $this
     */
    public function setWebsiteId($websiteId);

    /**
     * @return int
     */
    public function getStoreGroupId();

    /**
     * @param int $isActive
     * @return $this
     * @since 101.0.0
     */
    public function setIsActive($isActive);

    /**
     * @return int
     * @since 101.0.0
     */
    public function getIsActive();

    /**
     * @param int $storeGroupId
     * @return $this
     */
    public function setStoreGroupId($storeGroupId);

    /**
     * Retrieve existing extension attributes object or create a new one.
     *
     * @return \Magento\Store\Api\Data\StoreExtensionInterface|null
     */
    public function getExtensionAttributes();

    /**
     * Set an extension attributes object.
     *
     * @param \Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes
     * @return $this
     */
    public function setExtensionAttributes(
        \Magento\Store\Api\Data\StoreExtensionInterface $extensionAttributes
    );
}

How can I get the store name and store URL in Magento2?


texts: Products tagged as 'out of stock' regardless of admin settings

texts:
When our site was created for us, it was set to manage inventory levels.  When the developers handed it off to us, I turned inventory off in the System Configuration.  Since then, the items I've added don't display the 'Add to Cart' button.  Using the debugger, I found that the items not displaying that option had an 'Out of Stock' status.

Availability: Out of stock

I've tried reverting the global setting and changing the individual items to 'In Stock'.  I flushed the cached after making each change.  It seems like there's a  setting the database that's not getting changed when I revise the settings.  Anyone know where this might be?

Edit: On further testing, this issue is only on items I've already created.  Newly created items don't have an issue when inventory is turned on.  I still need to fix the batch of items I had already created, though.


texts: Variable @button__shadow-active is undefined while running deploy static content in Magento 2

texts:
I am getting this error whenever running php bin/magento setup:static-content:deploy.

It showing variable @button__shadow-active is undefined in file en_US/css/source/_extends.less in _extends.less. How to solve this. Kindly help me.


texts:
I'm having some troubles with images in one cms page.

Using

The result on the frontend is

I guess the %7D is for "}" and %22 for the quotation mark, but no idea why it happens here !?

Does someone have any idea how to solve it?


texts: Get Additional information in the order view payment information section

texts:
I created a payment method and added 2 fields vendor name and vendor voucher and save field in the database using observer.
It's working fine. Now, I want this to show additional information in the order view payment information section.
Any help please on how to do it.
Thanks


texts: How to override Interface of Other custom module?

texts:
I have tried with preference to override interface as below in di.xml file

<preference for="Custom\Module\Api\Data\AccountInterface" type="Override\Module\Api\Data\AccountInterface" />

<preference for="Custom\Module\Model\Account" type="Override\Module\Model\Account" />

And My Interface file is like as below

  Override\Module\Api\Data\AccountInterface.php

<?php

namespace Override\Module\Api\Data;

interface AccountInterface extends \Custom\Module\Api\Data\AccountInterface {

    const AFFILIATE_ID = 'custom_id';

    /**
     * @return string|null
     */
    public function getCustomId();

    /**
     * @param string $custom_id
     *
     * @return \Custom\Module\Api\Data\AccountInterface
     */
    public function setCustomId($custom_id);
}

Override Model File with new method Logic as below

  Override\Module\Model\Account.php

<?php

namespace Override\Module\Model;

use Custom\Module\Api\Data\AccountInterface;
use Magento\Framework\Model\Context;
use Magento\Framework\Model\ResourceModel\AbstractResource;

class Account extends \Custom\Module\Model\Account {
   /**
 * {@inheritdoc}
 */
public function getCustomId() {
    return $this->_getData('custom_id');
}

/**
 * {@inheritdoc}
 */
public function setCustomId($customId) {
    $this->setData('custom_id', $customId);
    return $this;
}
}

But it's not save the value of custom_id using setter and getter methods...

If use same  setter and getter method and Model logic in Custom_Module directly then it's working fine.

Any solution of add custom method in Interface ?

  note :- extension_attribute method is not available inside
  Custom\Module\Api\Data\AccountInterface so how we can use it ?


texts:
I am using Apptrian Image Optimizer. The extension for Magento1. I have given all the necessary permission to the files which are responsible for optimizing. Still, I am getting the following error when turn on the error logs:-

DEBUG (7): optipng is not executable.

Please let me know if I have to install the utilities on the server as well. Or is there any way out to get this done, by not using the exe files

  P.S:- I have also checked the files and they are not corrupted


texts: How to "reset" or reinstall Magento 2 without data loss

texts:
While working in Magento 2 somehow I have managed to either corrupt some files or permissions.
I haven't been messing with xml files but jumping from development to production and back to development. This caused some errors that I have tried to fix and somehow switching back to production seemed to work, but in admin I am getting this error on login:

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 5

Element 'resource': The attribute 'title' is required but missing.
Line: 6

Element 'resource': The attribute 'title' is required but missing.
Line: 7

Element 'resource': The attribute 'title' is required but missing.
Line: 8

I am certain that I haven't done anything with those elements in any xml file.

Some of the commands that I have been running in various orders most of the time are:

find var/view_preprocessed vendor pub/static app/etc generated/code var \( -type f -or -type d \) -exec chmod u+w {} +

/usr/bin/php71 bin/magento deploy:mode:set developer -s

/usr/bin/php71 bin/magento setup:di:compile

/usr/bin/php71 bin/magento setup:static-content:deploy hr_HR -f

/usr/bin/php71 bin/magento setup:static-content:deploy -f

/usr/bin/php71 bin/magento cache:flush

Now I am wondering is there a way to "redeploy" Magento 2 without causing data loss with idea to fix whatever is broken?

If not - can I make clean install, add components I need, move template and simply connect to "old" database?

Thank you all for help and time...


texts: add script right after opening body tag in magento 1.9

texts:
how can i add a script right after opening body tag in magento 1.9 ?

i aready tried this
How to add code after opening <body> tag in Magento?


texts: How to get increment id on current page?

texts:
I need to redirect to get data relevant to current increment ID of Order entity? So how I find current increment ID?

public function viewAction() {
    $this->loadLayout();
    if($increment_id = $this->getRequest()->getParam('increment_id')) {
        Mage::register('current_increment_id',$increment_id);
        $this->_setActiveMenu('casestation');
        $this->_addContent(
            $this->getLayout()->createBlock('casestation/adminhtml_print')
        );
    }
    return $this->renderLayout();
}

Page page directed according to above function. I need to add button here and want to get order details on current increment ID.


texts: Client could see another (very old) client's order?

texts:
A client reported that she could see another person's name in the Recently Placed Orders area in her account.

That other persons name is from a very old order...

Why can that be?

Context:

we upgraded the site from 1.4 to 1.9
we removed (regretably) all our customers accounts due to a russian
spam attack, but we plan to rebuild them.

Thanks for any hint.


texts: How to create a custom product attribute where i can upload as many PDFs as needed, and upload the thing as a whole?

texts:
I need to complete a task which i have been struggling with since last week.
If i "Go to Seller Store" and then into editing a product (both a new product or one that is already uploaded), in the attributes section i have this:

Not only it looks bad (i cant manage to deal with the bootstrap classes so that the white spaces dissapear), but its not practical.. What i need is something like this:

Bassically. Instead of being separate inputs, i need to be able to "Add or Remove" the inputs based on how many PDFs i need to upload, and then have only one button to let me upload all my documents.
Is this possible? How can i do it as close as the example in the second picture as possible.
Thank you very much.


texts: Disable Onepage Checkout and Multishipping Checkout

texts:
I'm using Magento CE 1.9.2

For a while I was trying to disable OnePage and multishipping.

Shipping Settings => Options => Allow Shipping to Multiple Addresses value to 'No'

and

Checkout => Checkout setting = > Enable OnePage Checkout value to 'No'

The problem is that if these two options are set to No, there is no button Proceed to Checkout display on the cart page.

All I want a multi-step checkout and not want to allow multi-shipping.


texts:
I have Magento 1.9.2.1 installed and ran the script to install the latest security patch, SUPEE-6788. I got a fail message because of the .htaccess file. I uploaded the .htaccess file from the clean files of the saved copy of 1.9.2.1 that I have, and was able to successfully run the patch install.

When I compared the patched version of .htaccess with the original clean version, I saw that no changes were actually made to the file.

When I compare the clean/patched version of .htaccess to my working .htaccess file that was causing the script to not run, I see another 200 lines of code + that were added by the install process that my host used when they installed magento to my folders.

Question is: Since no changes were made to the core .htaccess file, am I safe to upload my host's version of .htaccess back to the server now that the patch has run successfully?


texts: Validate composer requirements from modules in app/code

texts: Is there a way to validate the version constraints from modules in app/code during updates?


texts: Product share on Facebook does not show image

texts: I am trying to share my product on Facebook but my product image is missing on Facebook share page. Any help is appreciated.


texts: Catalog + Shopping cart rule, discounting wrong fields when applied

texts:
I currently have an issue where I have a catalog rule of 10% for a specific type of members A. Additionally, I have a shopping cart coupon of 100% off which applies to a product in it's own category: 387. However, it seems when there are instances where member A is trying to buy an item in category 387, initially the shopping cart coupon is applied (-$x) and the grand total should just be the shipping. However, the catalog rule takes the Original subtotal and discounts 10% and updates the grand total as 0.9*$x which is in correct as it should only show the shipping cost
I have set up the catalog rule as follows:

rule info

Customer group: A
Priority 2:

conditions

if Any of the conditions are true: category is not 387

actions

Apply: by % of orig price

discount amt: 10.00

enable disc to subprd: yes

Apply: by % of orig price

discount amt: 10.00

stop further rule process: no

I feel like my shopping cart rule is set almost correctly as the issue only occurrs when member A has a product that fits the 100% discount code in cart. Here is my shopping cart rule with priority 1:

rule info

customer grp : A

Specific coupon

condition

if All the cond are true:
 if an item found in cart w/ ALL cond true:
   category is 387

action

Apply (% of product price discount)

Discount amt: 100

Max Qty to discount : 1

Discount qty stp by x : 1

apply to ship amnt : no

free ship: no

stop further rules processing: no

Apply the rule only to cart items matching:
if ALL the cond are true:
category is 387

However, I am getting the following behavior:

Any help is much appreciated as Im new to this forum and new to Magento.


texts: I want to make full width of all cms page. now it is max-width of 1280px. i want to make it to 1720px. how can i change

texts:
I want to change max-width, but it is not overriding in custom-theme. how can i change
Here is the css style .
@media (min-width: 768px), print
.navigation, .breadcrumbs, .page-header .header.panel, .header.content, .footer.content, .page-wrapper > .widget, .page-wrapper > .page-bottom, .block.category.event, .top-container, .page-main {
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    max-width: 1280px;
    padding-left: 20px;
    padding-right: 20px;
    width: auto;
}


texts: How to add comment box to an existing Shipping method

texts:
I am currently working with Magento 1.9.0.1

I am searching information about how can i add a custom comment box bellow an existing shipping method in the checkout page where you can put any text.

After that when the user submits the order, you can see that text reviewing the order in the admin panel bellow the name of the chosen shipping method.

For example i am trying to add that to the default Table Rates method which comes with Magento. Yes i know it is not good to modify a default modules but i want to add this feature to exactly this module.

So can you help me out, step by step guide to how must be done with code examples or any links with information regarding my question.

Thanks in advance!


texts:
I have an issue that I don't understand. I never did some code changes about it.

Problem is,  a normal magento site must go www.site.com/xyz when I type site.com/xyz in the address bar right?

Well its not working for me. I'm having 404 page I recently changed web-server to apache from nginx.

When I tried that on nginx site.com/xyz always redirected just site.com

its very confusing for me.


texts: Mail Munch: paste the code right before the  tag on every page?

texts: I want add Mail Munch in our website and they say that I have to paste the code on every page. How can do this? In CMS>static block>footer links don't work cause this is not enabled.


texts: No user and password boxes when trying to login to Magento 2 admin

texts:
After successfully installing Magento 2.3.0, I tried to login to the admin panel for the first time.
The background color of the page that came up is grey like the Magento page, but it was a blank page. The User and Password fields don't appear.

I tried uninstalling and reinstalling 4 times.
I am using WAMP on windows 10.

How do I get my login fields?
Thanks


texts: Unable to get file to load in child theme

texts:
I took the file located at
vendor/magento/module-catalog/view/frontend/templates/product/view/type/default.phtml

and moved it to
app/design/frontend/Mycompany/luma_child/Magento_Catalog/template/product/view/type/default.phtml

I then redeployed and cleared the cache but no matter what I do I can not get this file in my child theme to load. Other files work/load just fine in my child theme.
I am not sure even where to begin to trouble shoot this?


texts: Is that OK to use Klevu with ElasticSearch in Magento 2

texts:
We are using Klevu on our site. Here is their site https://www.headcovers.com/

The search autocomplete runs really fast. See here - https://prnt.sc/qpe7w6 but it's really slow with the Ajax filtering in the category page. See here - https://prnt.sc/qpe8qn

We tested and saw that the filtering process is using MySQL to search which is why it's slow and it causes MySQL to be down sometimes. Does anyone have any suggestions to improve this?

As far as I know, if we use ElasticSearch, everything will be directed to the ElasticSearch server and the search will be very fast so we won't have ever need to worry about MySQL being down. Based on the release note here https://marketplace.magento.com/klevu-module-search.html I think we can use Klevu and ElasticSearch together. Can anyone here confirm that this is the next step for us?

Any help here is much appreciated.

Thank you.


texts: How to create 3-column layout file. I want to show 3-columns(content left and right sidebar) in cms page, in backend i select layout 3-column but its not showing


texts:
How can I get a configuration value for a specific website?

There is Mage::getStoreConfig() but no Mage::getWebsiteConfig().

edit:

I am exporting configuration data on website level - so somehow I want the website scope setting ...


texts: Magento 2.3 Add Multiple tabs after product description

texts:
I need to add custom multiple tabs after product description. Could you please help me.
Thanks in advance.


texts: Why Magento2 uses Store Manager outside of Presentation layer?

texts:
As per Technical Guidelines

6.2.2. Request, Response, Session, Store Manager and Cookie objects MUST be used only in the Presentation layer.

But if we check here in this file path Store Manager is declared

vendor/magento/module-translation/Model/Source/InitialTranslationSource.php

Which belongs to a domain layer?


texts: How to set a product to only ship one method

texts: My website sells some products that can not go regular shipping and instead I want to use table rates for those specific items. I have looked under shipping methods and have found that it says " show if not applicable" how do you make it applicable?


texts: white page after entering "payment methods"

texts:
I installed the extension: "delete order's". when it comes to this module everything works as it should be, so I do not know if it has anything to do with it.

I go to stores ---> configuration  ---> Sales  and try to config "payment methods"then  I get a white page.

Does anyone know what can be the reason and how to solve it?


texts: Magento 2 : How to Change Form encoding?

texts:
I would like add multipart-form/data to Magento2's Admin Form.

  Vendor/Module/etc/di.xml

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

 <preference for="Magento\Customer\Block\Adminhtml\Group\Edit\Form"
 type="Vednor\Module\Block\Adminhtml\Group\Edit\Form" />

 </config>

I've override below file

  magento-customer/Block/Adminhtml/Group/Edit/Form.php

TO

  Vendor/Module/Block/Adminhtml/Group/Edit/Form.php

 <?php
 namespace Vivek\ShopAsGroup\Block\Adminhtml\Group\Edit;

 use Magento\Customer\Controller\RegistryConstants;
 use Magento\Backend\Block\Widget\Form\Generic;
 use Magento\Framework\Data\Form as DataForm;

 class Form extends \Magento\Customer\Block\Adminhtml\Group\Edit\Form
 {
protected $formFactory;

public function __construct(

    \Magento\Framework\App\ResponseFactory $responseFactory,
    \Magento\Framework\UrlInterface $url,
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Data\FormFactory $formFactory,
    \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer,
    \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory,
    \Magento\Tax\Helper\Data $taxHelper,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\UrlInterface $urlInterface,
    \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory,
    \Magento\Customer\Api\Data\GroupInterfaceFactory $groupDataFactory,

    array $data = []
) {
    $this->_responseFactory = $responseFactory;
    $this->_url = $url;
    $this->_taxCustomer = $taxCustomer;
    $this->_taxHelper = $taxHelper;
    $this->_storeManager = $storeManager;
    $this->uploaderFactory = $uploaderFactory;
    $this->_urlInterface = $urlInterface;
    $this->formFactory = $formFactory;
    $this->groupDataFactory = $groupDataFactory;
    $this->_resultLayoutFactory = $resultLayoutFactory;
    parent::__construct($context, $registry, $formFactory, $data);
}

protected function _prepareForm()
{
   parent::_prepareForm(); //add this
    /** @var \Magento\Framework\Data\Form $form */
   $form = $this->_formFactory->create(
    [
    'data' => [
           'id' => 'edit_form',
           'action' => $this->getData('action'),
           'method' => 'post',
           'enctype' => 'multipart/form-data'
          ]
    ]
);
    $form->setUseContainer(true);
    $this->setForm($form);
    return $this; //chnage this
   }
   }

I did upgrade  and Deploy but it not seems to be working for me.

Took reference from Magento StackExchange

What i am missing ? Any Guide..

Thanks in Advance.


texts:
I created a new custom page_layout that I want to make full width.

My fullwidth-layout.xml file looks currently like this. But I want to make the main content full width. So that I can set this layout for some cms pages.

I want to keep the header and footer as default, but only the main content of the specific CMS page full width.

How can I achieve this?

<?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>


texts:
I'm trying to set a custom shipping method in the cart by ajax. Using magento 1.9.0.1

It's sending an ajax-call to a new controller to set the new shipping method and returns the result and the updated cart totals.

Thats working but after an pagerefresh it's again showing the default shipping method. I have tested it with another shipping method that should work but it's the same, always back to default after an refresh.

I tried already all kind of ways to set the method. And It's updating the entries in the db 'sales_flat_quote_address' to the new shipping method. Basicly it's working...

I haven't found any observer or other call thats overriding the shipping method. It's changing back while loading the base grand totals in the quote.

    $cart = Mage::getSingleton('checkout/cart');
    $quote = $cart->getQuote();

    $shippingAddress = $quote->getShippingAddress();
    $shippingAddress->setCollectShippingRates(true)
        ->collectShippingRates()
        ->setShippingMethod($method);

    $quote->setTotalsCollectedFlag(false)->collectTotals()->save();

or

    $result = $this->getOnepage()->saveShippingMethod($method);
    $this->getOnepage()->getQuote()->collectTotals()->save();

and similar ways.


texts: How to add same product with different price in cart?

texts:
I want to add Y free product to cart if user buy X product.

I have changed code of Mage_Sales_Model_Quote

public function addProductAdvanced(Mage_Catalog_Model_Product $product, $request = null, $processMode = null){
.............
............
$specialPrice = 0;
$item->setCustomPrice($specialPrice);
$item->setOriginalCustomPrice($specialPrice);
$item->getProduct()->setIsSuperMode(true);
...............
..............
}

it's work fine.

but when user add Y product from product page it's add with price 0.
but i want to add only one qty. with 0 and other with regular price.
Please help me.


texts: magento 2 minicart remove item message with product name

texts:
I want to add the product name along with this message:

  Are you sure you would like to remove this item from the shopping cart?

How can i achieve this ?


texts: Magento Tax issue on checkout using Rest API

texts:
I am facing issue with tax on the checkout using magento 2 rest API. API always return tax amount 0 for all cart items. On web everything is working fine but getting issue with API.

My magento version is 2.3.1

Magento Rest API
rest/V1/carts/mine/totals


texts:
I want to add a custom button in checkout page through my module without affecting any core functionalities of checkout module.

http://i.prntscr.com/b2500547a0a747e5883be2a84fa43545.png


texts: Magento 2: Deleting all products via SQL

texts:
Is it still possible to delete all producs in Magento 2 using:

DELETE FROM `catalog_product_entity`;

Will it still clean all other tables that have product data because of the foreign key constraints? What about the URL rewrites, will that also be cleaned?

https://stackoverflow.com/questions/8899366/deleting-all-products-on-magento describes how to do it for Magento 1.


texts: Magento2: How to show tax rules for logged users?

texts:
Magento 2.x

Now, Tax rules are showing guest and logged users. But I want to show only logged users.


texts:
My all installed extension folder's  and File's  stored in this location

/domain/includes/src

If i delete any problem will come or why it's storing in this folder.


texts: Two grouped products are listed on other grouped product as simple products

texts:
I faced a issue that two specific grouped products are listed on other grouped product as simple products

There is a grouped product called LOW t.By the way, it is shown like other items, which called LOW2, LOW3 are assigned to the simple ones of LOW. They are even grouped products tho.

It doesn't make sense as far as i know.
Are there guys who faced this problem and fix it? Thank you so much


texts: Term and Conditions Not working error "Please agree to all the terms and conditions before placing the order" before placing order magento 2.2.2

texts: Term and Conditions Not working error message "Please agree to all the terms and conditions before placing the order" before placing order magento 2.2.2 custom theme.If anyone have faced this type issue please guide me,thanks.


texts: Can't Login to Admin after Installing Extension

texts:
Apologies in advance for the thin details on this one.

I sell a Magento extension.  With the latest release, I've started getting an odd bug report from a few users.  Specifically, after installing the extension, they report being unable to login to the admin, with login requests being redirected back to the login page, and without any error message displaying.

So, this sounds like the classic "can't set a cookie/instantiate a session" problem.  Where this gets weird is they are able to login after 3 - 12 hours (that's an estimate).  In other word, they encounter the problem, contact me for support, I write back, they report the problem has vanished. I also assume  clearing their cookies and establishing a new session id will fix the problem, and recommend the same to users encountering it.

Has anyone here run into something similar, or can think of a reason this happens? I can't recreate the problem locally, but I've gotten enough reports that I'm convinced it's a legit problem.


texts: magento 2 how to update stock using import csv

texts:
I need to update my stock everyday in magento 2 but i dont know how it works.

Do i have to import the same full stock with all columns of my stock.csv and set the qty,is in stock columns with new values ?

or a csv file with only sku,qty,stock availabilty columns?

or a full csv file with all column but only the sku,qty, stock availablity filled ?

Hope somebody could help me.


texts: Catalog Price Rules not applying to products until product is saved

texts:
We cannot seem to get price rules to apply to products without saving the product. I have tried various methods of resetting, reindexing, truncating tables, checking and manually running cron, but for some reason although products have some rules applied, they don't get all of the rules until the product is saved again.
I have tried adding a new attribute and then mass-updating all of the products to change the attribute, and while I see the indexers update to show them processing an equivalent number of items in their backlogs, the price never updates - it must be saved individually from the product's CMS edit page.
Looking in the catalogrule_product and catalogrule_product_price tables I can see the rules and calculated prices being applied after saving the product.
In my investigation I found that I needed to raise certain innodb settings such as the buffer pool and data file sizes, as we appeared to be getting warnings about the pool size being too small and temp tables being full, but now those warnings appear to have ceased.
Magento 2.2.5, PHP 7.1.32


texts: Magento 2 : How Can I get All Active Offline Payment Methods?

texts: I want to get the list of all active offline payment methods like cashondelivery, checkmo, banktransfer etc.


texts: Magento 2 How to remove shipping method in checkout page

texts:
I want to remove shipping method from the cart page and checkout page.

I am trying to remove the shipping method from checkout page but seems it's loading from the Knockout.js file.

How can i remove the shipping method from the checkout page or hide it and show my custom message "For shipping Call ME" instead of shipping method.
Also, my store is multi language so message should display in multi language.


texts: Magento 2: Replacement for Mage::log method?

texts:
In Magento 1, if you wanted to send a message to the logs, you'd use a static method on the global Mage class.
Mage::log($message, Zend_Log::DEBUG, "my-log-file.log");

Is there an equivalent in Magento 2?  I've googled through the dev docs site and haven't seen anything obvious that pops out. There's this Inchoo article, but it's from almost a year ago and so much has changed since then.
As a Magento 2 module developer, if I want to replace code like the following in Magento 1
Mage::log($message, Zend_Log::DEBUG, "my-log-file.log");

What's the bare minimum I need to do?


texts: Magento New Product Attribute Not Saving

texts:
I am having an issue in Magento where custom product attributes are not updating.

When setting the new attributes under Catalog->Manage Products->Product->General, the post data for that specific attribute of the product contains a null value. As such, the attribute is set to 0 in the case of one attribute, and null in the case of the second attribute. Here is the code I used to add the attributes.

$installer->addAttribute('catalog_product','sigis_gtin', array(
    'group' => 'General',
    'type' => 'text',
    'label' => 'SIGIS GTIN',
    'input' => 'text',
    'required' => false,
    'user_defined' => 1,
));

$installer->addAttribute('catalog_product','sigis_eligible', array(
    'group' => 'General',
    'type' => 'int',
    'label' => 'Sigis Eligibility',
    'input' => 'select',
    'required' => 0,
    'user_defined' => 1,
    'unique' => 0,
    'default' => 0,
    'source' => 'eav/entity_attribute_source_boolean',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

My question is: Why is the Manage Product page sending null data, which in turn makes it so my changes don't save?


texts:
I'm using magento 2.0.7, and I've loaded a video for all my products.
Now what I'm trying to do, is to add a button on the product page, under the image gallery(cause that's where you find the video if you slide) that sends me to the slide with the video.

The video is not allways in the same slide, for some products might be the second slide, some other third slide ecc.


texts: Magento 2.1.3: Store view config doesn't inherit website config

texts:
As an example - currency config. I setup currency configuration on a website, the currency setup for a store view is set "Use Website". But it shows the config from a default.

The same happens with other settings as well.

Question: Am i missing some setting?

Setup

Website - Store - Store view

Sweden

Sweden

Svenska
English

Finland

Finland

English

Currency setup

1) Catalog Price Scope (Stores -> Configuration -> Catalog -> Catalog -> Price)

Catalog Price Scope = website

2) Currency Setup (Stores -> Configuration -> General -> Currency Setup)

Default Config: Base Currency = SEK, Default Display Currency = SEK, Allowed Currencies = SEK, EUR
Sweden(Website): Base Currency = SEK, Default Display Currency = SEK, Allowed Currencies = SEK
Finland(Website): Base Currency = EUR, Default Display Currency = EUR, Allowed Currencies = EUR

Result:
In Finland-English store view the currency is SEK


texts: How to override js functions which is inside the return in magento 2(mixins)

texts:
I need to override the setPaymentMethods() function in below js using mixins. Please provide me a solution to override the function which is the return value of the js

magento/module-checkout/view/frontend/web/js/model/payment-service.js

define([
    'underscore',
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/model/payment/method-list',
    'Magento_Checkout/js/action/select-payment-method'
], function (_, quote, methodList, selectPaymentMethod) {
    'use strict';

    /**
    * Free method filter
    * @param {Object} paymentMethod
    * @return {Boolean}
    */
    var isFreePaymentMethod = function (paymentMethod) {
            return paymentMethod.method === 'free';
        },

        /**
         * Grabs the grand total from quote
         * @return {Number}
         */
        getGrandTotal = function () {
            return quote.totals()['grand_total'];
        };

    return {
        isFreeAvailable: false,

        /**
         * Populate the list of payment methods
         * @param {Array} methods
         */
        setPaymentMethods: function (methods) {
            var freeMethod,
                filteredMethods,
                methodIsAvailable,
                methodNames;

            freeMethod = _.find(methods, isFreePaymentMethod);
            this.isFreeAvailable = !!freeMethod;

            if (freeMethod && getGrandTotal() <= 0) {
                methods.splice(0, methods.length, freeMethod);
                selectPaymentMethod(freeMethod);
            }

            filteredMethods = _.without(methods, freeMethod);

            if (filteredMethods.length === 1) {
               // selectPaymentMethod(filteredMethods[0]);
            } else if (quote.paymentMethod()) {
                methodIsAvailable = methods.some(function (item) {
                    return item.method === quote.paymentMethod().method;
                });
                //Unset selected payment method if not available
                if (!methodIsAvailable) {
                    selectPaymentMethod(null);
                }
            }

            /**
             * Overwrite methods with existing methods to preserve ko array references.
             * This prevent ko from re-rendering those methods.
             */
            methodNames = _.pluck(methods, 'method');
            _.map(methodList(), function (existingMethod) {
                var existingMethodIndex = methodNames.indexOf(existingMethod.method);

                if (existingMethodIndex !== -1) {
                    methods[existingMethodIndex] = existingMethod;
                }
            });

            methodList(methods);
        },

        /**
         * Get the list of available payment methods.
         * @return {Array}
         */
        getAvailablePaymentMethods: function () {
            var allMethods = methodList().slice(),
                grandTotalOverZero = getGrandTotal() > 0;

            if (!this.isFreeAvailable) {
                return allMethods;
            }

            if (grandTotalOverZero) {
                return _.reject(allMethods, isFreePaymentMethod);
            }

            return _.filter(allMethods, isFreePaymentMethod);
        }
    };
});


texts: How can I output data from an install script during upgrade?

texts:
I am trying to create an install script to overwrite some bluefoot configurations. I am trying to figure out what is in the $buttonItemBlock variable so that I can pass that to another class. However I can not get anything to print during upgrade in the console.

<?php

namespace vender\module\Setup;

use Gene\BlueFoot\Model\Installer\File as InstallerFile;
use Magento\Framework\Filesystem\Io\File as IoFile;
use Magento\Framework\Module\Dir\Reader;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Gene\BlueFoot\Model\Attribute\ContentBlockRepository;

/**
 * Class to install data for list builder BlueFoot block
 */
class InstallData implements InstallDataInterface
{
    /**
     * @var Reader
     */
    protected $moduleReader;

    /**
     * @var IoFile
     */
    protected $ioFile;

    /**
     * @var InstallerFile
     */
    protected $fileInstaller;

    /**
     * @var Bluefoot content block repository manager
     */
    protected $contentBlockRepository;

    /**
     * InstallData constructor.
     *
     * @param Reader $moduleReader
     * @param IoFile $ioFile
     * @param InstallerFile $fileInstaller
     */
    public function __construct(
        Reader $moduleReader,
        IoFile $ioFile,
        InstallerFile $fileInstaller,
        ContentBlockRepository $contentBlockRepository
    ) {
        $this->moduleReader = $moduleReader;
        $this->ioFile = $ioFile;
        $this->fileInstaller = $fileInstaller;
        $this->contentBlockRepository = $contentBlockRepository;
    }

    /**
     * Installs data for a module
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $buttonItemBlock = $this->contentBlockRepository->getByIdentifier('button_item');
        var_dump($buttonItemBlock);exit;

        //Install the blocks and attributes
        //$this->installData($setup);

        $setup->endSetup();
    }
}


texts: Declare 'instance variables' in knockoutjs component?

texts:
I'm trying to create a variable in my knockoutjs component that I can reference later on, and it's not really working, and i'm not sure why, can anyone give me some tips on how to access the "text" attribute, or add any other sort of local variable i can access in my script?

Here's what i'm working with:

define([
    'ko',
    'uiComponent',
    'Magento_Customer/js/customer-data',
    'Magento_Ui/js/modal/confirm',
    'jquery',
    "jquery/ui"
], function(ko, component, customerData, modalold, $){
    'use strict';
    return component.extend({
        text: "Hello World",
        initialize: function(){
            this._super();
            $("#add_motorcycles").modal({
                class: 'garage-modal',
                clickableOverlay: true,
                buttons: [
                    {
                        text: 'Add Motorcycle',
                        class: 'action-primary action-accept',
                        click: function () {
                            console.log("Added motorcycle!");
                        }
                    },
                    {
                        text: 'Cancel',
                        class: 'action-secondary action-dismiss',
                        click: function () {
                            this.closeModal();
                        }
                    }
                ],
                closed: function () {
                    $("#add_motorcycles").html("");
                }
            });
        },
        addMotorcycle: function () {
            console.log(this);
            console.log(self);
            console.log(text);
            console.log("Opened!");
        }
    });
});

How can I access the text variable?

Inside of addMotorcycle, console.log(this) outputs the following JSON

{
  "ignoreTmpls": {
    "templates": true,
    "childDefaults": true
  },
  "_requesetd": {},
  "containers": [],
  "exports": {},
  "imports": {},
  "links": {},
  "listens": {},
  "name": "garage",
  "ns": "garage",
  "provider": "",
  "registerNodes": true,
  "statefull": {},
  "template": "ui/collection",
  "tracks": {},
  "storageConfig": {
    "provider": "localStorage",
    "namespace": "garage",
    "path": "localStorage:garage"
  },
  "maps": {
    "imports": {},
    "exports": {}
  },
  "modules": {
    "storage": "localStorage"
  },
  "_elems": [],
  "component": "Revival_Garage/js/view/garage",
  "extendProvider": true,
  "index": "garage",
  "dataScope": "",
  "parentName": "",
  "parentScope": ""
}


texts: How to use Renderer in UI Component in Magento 2

texts:
In my custom module grid i have to use custom grid column which render a field and create custom html content

how to implement it in Magento 2


texts: What is the maximum limit for a product attribute value?

texts:
If I create a new attribute as text area, what is the maximum character limit that I can put there? Is it possible to increase that limit?

I want to create a product attribute of type LONG TEXT. Is it possible?


texts: How to edit / remove tabs in search result page Magento 2

texts:
How can I edit or remove the tabs on top of the search result page?
I want to show the categories just above the results grid without inside of a tab.


texts: Expected Shipping Date - Is it possible to get from magento 2 ? If yes then which table?

texts:
Is it possible to get the expected shipping date to get it from some magento table.
I need to show this information in my invoice. Which table shows this information.
Shipped by: FedEx
Expected by: 2-Jan-2021
Please let me know any help is appreciated.


texts: Modify "added to cart" notification to include HTML link? - coming from 3rd party extension via PHP (controller), not standard mage notification

texts:
I have an extension installed that add's a "quote" cart to my Magento 2.3.4 site.

It looks similar to how the default cart works, but it allows customers to add products to a quote-cart and submit it to us so we can send them current pricing.

When a customer adds a product to their quote-cart, the extension creates a mage notification (inside of the green bar) that says:

"You have added "x" product to your quote"

I'd like to change that notification to include a static link that will take them to their quote-cart ("static" as in, one, common URL work's the same for all customers/sessions).

However, this notification comes from a PHP file within the extension's controller folder. (not the standard magento template .phtml file that the default cart notification message does).

Here's the bit of code that creates the notification:

protected function getSuccessMess($hasError, $product)
    {
        if (!$hasError) {
            $message = __(
              'You added %1 to your quote.',
              $product->getName()
          );
            $this->messageManager->addSuccessMessage($message);
        }
    }

When ever I try to add the HTML link to the message, it will actually print out the escaped HTML code as plain text inside of the notification!

How can I get it to include HTML code that will be rendered and shown in the customers notification bar as an actual link (like the default magento cart notification does).

I'm a PHP n00B so please go easy on me! :)

Thank you SO much for your help.


texts: Magento 2 - Configurable product - Get parent product ID from child product ID

texts:
I have a configurable product with two virtual products as children. I have the child product ID. How can I the parent product ID from the child product ID?

I have tried this but it is not working

// the $parent is always empty
$parent = $childProduct->getTypeInstance()->getParentIdsByChild($childProductId);


texts: Change Magento Shipping Method from 'Custom' to Courier's Name

texts:
at the moment we only use a single courier 'Australia Post'. When we go to Order list view, select an order, paste in the tracking number and then go to 'Actions>Ship Selected' the customer receives an email saying the Carrier is 'Custom Value'. Where and how can I change the default carrier value from 'Custom Value' to 'Australia Post'?

Thanks for your help!


texts: Magento 2 how to validate customer registration form on keyup event

texts:
I am working on a project where I need to validate customer registration form as customer types. I want to use the event keyup for inputs. I want to change the default messages also. Right now I am doing validation like below

$("#firstname").keyup(function(){
    $('input[name="firstname"]').validation();
    if(!$('input[name="firstname"]').validation('isValid')){
        $("#firstname-error").remove();
        $("#firstname").after('
Please enter your firstname
');
    }else{
        $("#firstname-error").remove();
    }
});

Not a good way of doing that I think. But I will need to do this for all fields.Then I was looking at this file
vendor\magento\magento2-base\lib\web\mage\validation.js
at around line no 1735 I saw below code

$.widget('mage.validation', {
        options: {
            meta: 'validate',
            onfocusout: false,
            onkeyup: false,
            onclick: false,
            ignoreTitle: true,
            errorClass: 'mage-error',
            errorElement: 'div',
    ...

Seeing this I thought maybe there is a better way to do this. So if there is any simple way please let me know.


texts:
This is my code:

$fieldset->addField(
            'pdf_url',
            'file',
            ['name' => 'custom_url', 'label' => __('Custom Url'), 'title' => __('Custom Url'), 'required' => true]
        );

It's not show any value just show choose file.


texts: Magento 2: update individual custom option value programmatically

texts:
I'm using a script to programmatically update some products, bootstrapping Magento. I've had a lot of luck saving attributes using the product repository, when it comes to customizable options, I'm confused about the best way to update existing values.

I'm able to load up all of the options I need to update using Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory, but not sure how to save them from there.

Do you have to save option data as an array, or is it possible to update an individual field?


texts:
I want to set a custom row total.
I am using 'checkout_cart_product_add_after' event.
And want to update Row total.
I going to add an extra amount in an item row total.
like,

$item->setRowTotal($item->getRowTotal + 100);
$item->save();


texts:
I have created a custom layout for my homepage, now when I refresh the page I get an empty page (this is good I assume).

I was wondering how do I put in custom content?

let's say I want to created a hero area with a subscribe form in it, how do I go around doing that?

here's my folder structure:


texts: Parsing html code with html error problem

texts:
I am getting this kind of exceptions in my exception.log . i have no idea where it comes from.

main.CRITICAL: DOMDocument::loadHTML(): Unexpected end tag : br in Entity, line: 1

{"exception":"[object] (Exception(code: 2): DOMDocument::loadHTML(): Unexpected end tag : br in Entity, line: 1 at /home/beta_angara/public_html/vendor/magento/framework/Escaper.php:71)"}

Anyone have any idea how can i handle these kind of errors?


texts: Configurable Product Qty not working in magento2?

texts:
I want change qty box in dropdown .So I'm override template file./vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml

<referenceBlock name="product.info.addtocart">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Www_QtyDropdown::product/view/addtocart.phtml</argument>
            </action>
        </referenceBlock>

addtocart.phtml

    <?php $_product = $block->getProduct(); ?>
<?php $qty = $block->getStockMaximumQty(); ?>
<?php $buttonTitle = __('Add to Cart'); ?>
<?php if ($_product->isSaleable()): ?>

            <?php if ($block->shouldRenderQuantity()): ?>

                    <?= /* @escapeNotVerified */ __('Qty') ?>

                        <select name="qty" id="qty" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>"
                                class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>">
                                    <?php if ($qty > 4) { ?>
                                <option value = "0"></option>
                                <?php $i = 1; ?>
                                <?php while ($i <= 4) {
                                    ?>
                                    <option value="<?php echo $block->getProductDefaultQty() * $i; ?>"><?php echo $block->getProductDefaultQty() * $i; ?></option>
                                    <?php $i++; ?>
                                <?php } ?>
                            <?php } else {
                                ?>
                                <option value = "0"></option>
                                <?php $i = 1;
                                ?>
                                <?php while ($i <= $qty) { ?>
                                    <option value="<?php echo $block->getProductDefaultQty() * $i; ?>"><?php echo $block->getProductDefaultQty() * $i; ?></option>
                                    <?php $i++; ?>
                                <?php } ?>
                            <?php } ?>
                        </select>

            <?php endif; ?>

But is not working for configurable  product.If I need any modification in my code.


texts: How to include external JS in adminhtml using requirejs-config.js

texts:
I try to include external JS (fabric.js) in my custom module.

I try so many different way but still not getting success. i don't understand what i missing below is my code.

Add external JS (fabric.js) under <Vendor>/<Module_Name>/view/<adminhtml>/web/js/fabric.js
Create requirejs-config.js under <Vendor>/<Module_Name>/view/<adminhtml>/requirejs-config.js

Add following code to requirejs-config.js

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

var config = {
 map: {
    '*': {
        fabric: 'Namespace_Modulename/js/fabric'
    }
 }
};

I followed below link to achieve my thing but still not get success.

magento.stackexchange.com/questions/131056
magento.stackexchange.com/questions/101671
magento.stackexchange.com/questions/85851

Any other way to include external JS.

Any help would be appreciated! Thanks.


texts: Custom module creates 'Invalid template file in module' error

texts:
I wanted to have a product's brand name shown next to it's product name, so I created a module for this. I extended the Magento\Theme\Block\Html\Title block in order to obtain the brand name and use this in the template.

The module works as expected, but for some reason my system.log becomes filled by the following error:
main.CRITICAL: Invalid template file: 'title.phtml' in module: 'Kyegil_ProductBrand' block's name: 'page.title'

What have I left out here? Why I'm I getting this error?

etc/di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Theme\Block\Html\Title" type="Kyegil\ProductBrand\Block\Html\Title" />
</config>

Block/Html/Title.php

<?php
namespace Kyegil\ProductBrand\Block\Html;

use Magento\Framework\View\Element\Template;

class Title extends \Magento\Theme\Block\Html\Title
{

protected $_coreRegistry = null;
protected $_product = null;
protected $_brand = '';

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Registry $registry,
    array $data = []
) {
    $this->_coreRegistry = $registry;

    $this->_product = $this->_coreRegistry->registry('product');

    if(is_object($this->_product)) {
        $this->_brand = $this->_product->getData('brand');
    }

    parent::__construct($context, $data);
}

public function getBrand()
{
    if (is_array($this->_brand)) {
        return implode(", ", $this->_brand);
    }
    return strval($this->_brand);
}

}

view/frontend/templates/html/title.phtml

<?php

$cssClass = $block->getCssClass() ? ' ' . $block->getCssClass() : '';
$title = '';
if (trim($block->getPageHeading())) {
    $title = 'getAddBaseAttribute() . '>'
        . $block->escapeHtml($block->getPageHeading()) . '';
}
?>
<?php if ($title): ?>
<div class="page-title-wrapper<?php /* @escapeNotVerified */ echo $cssClass; ?>">
    <?php if($block->getBrand()):?>

<?php echo $block->escapeHtml($block->getBrand()); ?>

    <?php endif;?>
    <h1 class="page-title"
        <?php if ($block->getId()): ?> id="<?php /* @escapeNotVerified */ echo $block->getId();?>" <?php endif; ?>
        <?php if ($block->getAddBaseAttributeAria()): ?>
            aria-labelledby="<?php /* @escapeNotVerified */ echo $block->getAddBaseAttributeAria(); ?>"
        <?php endif; ?>>
        <?php /* @escapeNotVerified */ echo $title ?>

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

<?php endif; ?>

UPDATE: My module doesn't have a layout xml, but even if I make one and change the template to eg 'custom.phtml', it doesn't make any difference.
A new entry is still created in my system.log asking for the 'title.phtml', funnily enough every time I load a page in the admin area.
This could be a clue though, since the only mentioning of 'page.title'  that I can find anywhere is in the default.xml of the Magento_Backend module.


texts: Image is getting broken when called at frontend

texts:
In magento1.9.2.4 when I created multiple select attribute with options and images for those options are placed in skin/frontend/<my_package>/<my_theme>/images/ and called the attribute in list.phtml like

 <?php
  $Feature = explode(",",$_product->getResource()
  ->getAttribute('feature')->getFrontend()
  ->getValue($_product));

 foreach($Feature as $key => $value): ?>

<?php echo "<img src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)."frontend/<package_name>/<theme_name>/images/".$value.".png'/>"; ?>

<?php endforeach; ?>

Now only the first image of the option is displaying. Other images are broken. When I Inspected the element in browser there was space before the image name.
am not able to figure out the mistake. Kindly help me please.

Also when the image is clicked it should redirect to the respective product details page.


texts: Magento Quick View Cart - Content of Cart Product name formar gone Wrong

texts: Anyone have a clue why is this Product name in top right ajax cart quick view LIKE THIS as you can see on the picture?


texts: Magento 2.1.1 not compatibile with PHP 7.1.0

texts:
I've a new server with PHP v7.1.0RC3 installed. According to DevDocs Magento 2 is compatible with 7.0.2 up to 7.1.0, except for 7.0.5 which makes PHP 7.1.0 compatible with M2 however when tried to install repo I get following error:

  Problem 1
      - Installation request for magento/product-community-edition 2.1.1 -> satisfiable by magento/product-community-edition[2.1.1].
      - magento/product-community-edition 2.1.1 requires php ~5.6.0|7.0.2|~7.0.6 -> your PHP version (7.1.0RC3) does not satisfy
  that requirement.


texts: Magento 2.3 - How set custom options title by store view programmatically?

texts:
I would like to be able to translate the title of the customizable options.
The following code works correctly and adds the options in all store views. How to adapt it to have a translated title in each store view which would be like unchecking the "Use Default Value" box?
$opValues = [
        '0' => [
            'default_title' => 'Option 1',
            'title' => 'Option 1',
            'price' => '0',
            'price_type' => 'fixed',
            'sku' => '',
            'sort_order' => '0',
            'is_delete' => '0',
        ],

        '1' => [
            'default_title' => 'Option 2',
            'title' => 'Option 2',
            'price' => '0',
            'price_type' => 'fixed',
            'sku' => '',
            'sort_order' => '1',
            'is_delete' => '0',
        ]
    ];

    $customOption = $objectManager->create('Magento\Catalog\Api\Data\ProductCustomOptionInterface');

    $customOption
        ->setTitle('Title')
        ->setType('radio')
        ->setIsRequire(false)
        ->setSortOrder(1)
        ->setPriceType('fixed')
        ->setValues($opValues)
        ->setProductId($product->getId())
        ->save();

    $product->addOption($customOption);

Thank you for your help!


texts: Can't show products on Magento 1.9 home page

texts:
I'm trying to show a list of all products on the Magento 1.9 home page but all I see is "There are no products matching the selection". I've added the following block into CMS>Home Page>Content:

{{block type="catalog/product_list" name="home.catalog.product.list"
        alias="product_homepage" template="catalog/product/list.phtml"}}

Tried adding the following with no change:

column_count="6" products_count="13"

I've also fixed the RWD problem described here:
https://stackoverflow.com/questions/24049034/show-a-category-and-its-products-on-homepage-magento1-9

I've set the product to be Enabled, set the New range from Nov 2010 to Nov 2020 and I've flushed the cache. The home page still shows:

There are no products matching the selection.

Update

Added the category_id as suggested but no change in the result.

{{block type="catalog/product_list" category_id="2"
        name="home.catalog.product.list" template="catalog/product/list.phtml"}}

Here's category 2:


texts: Update customer password directly in database

texts:
If I have access to my database, can I manually override a customer password? This is my local development environment.

I have little knowledge of password encryption but I would like to be able to log out on a previously setup customer account and my forgot password link is not working.

As far as I can see this is stored in the customer_entity_varchar table.


texts: No Static Content on Category Pages in Magento 2.1

texts:
I am using Magento 2.1 CE in production mode. When going to a category in the backend and either adding a description and/or a static block then saving it, the changes are not seen on the front end. It does not work for any category that I have tried.

When adding a static block I changed the display setting from products only to display static block and products. This did not make a difference.

Is anyone else experiencing this issue?

Edit: Running the indexers:reindex command twice from the CLI after making a change in the backend to the content of a category makes the changes visible on the front end. It appears reindexing is not working as it should automatically. Cron jobs are setup and running without errors.

Edit 2: I am seeing some lines show up in the debug.log file after trying to update a category and it not working. The actual store URL has been replaced with "STORE URL" in the block below.

[2016-07-25 12:17:34] main.DEBUG: cache_invalidate:  {"method":"POST","url":"STORE URL","invalidateInfo":{"tags":["catalog_category_21","catalog_category","catalog_category_product_21"],"mode":"matchingTag"},"is_exception":false} []
[2016-07-25 12:17:34] main.DEBUG: cache_invalidate:  {"method":"POST","url":"STORE URL","invalidateInfo":{"tags":["catalog_category_21","FPC"],"mode":"matchingTag"},"is_exception":false} []
[2016-07-25 12:17:34] main.DEBUG: cache_invalidate:  {"method":"POST","url":"STORE URL","invalidateInfo":{"tags":["catalog_category","FPC"],"mode":"matchingTag"},"is_exception":false} []
[2016-07-25 12:17:34] main.DEBUG: cache_invalidate:  {"method":"POST","url":"STORE URL","invalidateInfo":{"tags":["catalog_category_product_21","FPC"],"mode":"matchingTag"},"is_exception":false} []

I setup an additional cron job to reindex every minute with the other cron jobs and that seems to work. For some reason the indexes are not being reindexed by the regular cron jobs though.

* * * * * /usr/bin/php /var/www/magento2/bin/magento indexer:reindex


texts: Custom category attributes are not getting set

texts:
I have created a custom category attribute in my install script by using:

$installer = Mage::getResourceModel('catalog/setup','catalog_setup');
$installer->startSetup();

$installer->addAttribute(
    'catalog_category',
    'my_custom_attribute',
    array(
        'label' => 'My Custom Attribute',
        'group' => 'Custom Attributes',
        'type'  => 'int',
        'class' => 'validate-number',
        'required' => false,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible'       => true,
        'visible_on_front' => true,
    )
);

$installer->endSetup();

This works fine, the category attribute is created in the database.
Now, I want to set the attribute to a specific value in a stand alone script:

    <?php
    require_once('app/Mage.php');
    Mage::app('default');
    umask(0);

    $process = Mage::getModel('index/process')->load(5); //category EAV
    $process->reindexAll();  // Re-index

    $cat = Mage::getModel("catalog/category")->load(1);

    $cat->setData('my_custom_attribute',   10);

    $cat->save();

    $process = Mage::getModel('index/process')->load(5); //category EAV
    $process->reindexAll();  // Re-index

    $cat = Mage::getModel("catalog/category")->load(1);

    $val = $cat->getData('my_custom_attribute');

    var_dump($val); // NULL <- should be 10

I have tried many different variations of setting / getting the value. As you can see I am re-indexing twice because we are using Flat Data.

I have been trying to work this out for ages - how do I simply set the custom attribute value so I can re-call it in the same script?


texts: Magento 2 : How to Get Product SKU Quantity Displayed on Details Page

texts: Magento 2, How to get the product SKU quantity displayed on product details page。


texts: I am trying to create auto generated coupon codes for a specific rule programmatically. But facing problems continuously. Can you please help me out?


texts: Set default configurable selection in Magento 2.1

texts:
In Magento 2.1, there is no default selection for configurable products (swatches, etc).

I would like to automatically select when there is only one option currently available, to make the process less confusing for customers.

There is a resolution already for Magento 2 with edit of Magento_Swatches/templates/product/view/renderer.phtml, but it does not apply to version 2.1.


texts: How to remove footer links in magento 1.9

texts:
Can anyone tell me how to remove footer links?
I edited "default.xml"  in theme folder.
But it did not work fir me.


texts: Magento 2: Add product attribute to product by SQL

texts:
I am trying to add a product attribute to a product in Magento 2 by SQL, but its there is some issue in it.
product id is = 244992
product attribute code is = 70


texts: API soap v1: Cannot use object of type stdClass as array?

texts:
I am testing called by SoapUI 5.2.0 software creating xmls, and as I have extra options for my call customer.create using the SOAP V1 and the code:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">    <soapenv:Header/>    <soapenv:Body>
      <urn:call>
         <sessionId>6df66fd6fd6fd6f6df6df6d6fd</sessionId>
         <resourcePath>customer.create</resourcePath>
         <args SOAP-ENC:arrayType="ns2:Map[1]" xsi:type="SOAP-ENC:Array">
            <item xsi:type="ns2:Map">
              <item>
              <key xsi:type="xsd:string">email</key>
              <value xsi:type="xsd:string">my_email@hotmail.com</value>
            </item>
            <item>
              <key xsi:type="xsd:string">firstname</key>
              <value xsi:type="xsd:string">Matheus</value>
            </item>
            <item>
              <key xsi:type="xsd:string">lastname</key>
              <value xsi:type="xsd:string">Silva</value>
            </item>
            <item>
              <key xsi:type="xsd:string">password</key>
              <value xsi:type="xsd:string">pass123456</value>
            </item>
            <item>
              <key xsi:type="xsd:string">website_id</key>
              <value xsi:type="xsd:int">1</value>
            </item>
            <item>
              <key xsi:type="xsd:string">store_id</key>
              <value xsi:type="xsd:int">1</value>
            </item>
            <item>
              <key xsi:type="xsd:string">group_id</key>
              <value xsi:type="xsd:int">1</value>
            </item>
            <item>
              <key xsi:type="xsd:string">dob</key>
              <value xsi:type="xsd:string">14081991</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[tipopessoa]</key>
              <value xsi:type="xsd:int">1</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[cpf]</key>
              <value xsi:type="xsd:string">23039210823</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[rg]</key>
              <value xsi:type="xsd:string">478251075</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[cnpj]</key>
              <value xsi:type="xsd:string">01234567000110</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[ie]</key>
              <value xsi:type="xsd:string">110042490114</value>
            </item>
            <item>
              <key xsi:type="xsd:string">account[razaosocial]</key>
              <value xsi:type="xsd:string">ItepNess Ltda</value>
            </item>
            </item>
         </args>
      </urn:call>    </soapenv:Body> </soapenv:Envelope>

These new options such as <key xsi:type="xsd:string">account [rg]</key> created the module and am calling, however the results call me the error:

  Cannot use object of type stdClass as array

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">    <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring>Cannot use object of type stdClass as array</faultstring>
      </SOAP-ENV:Fault>    </SOAP-ENV:Body> </SOAP-ENV:Envelope>

How This error works and how can I fix? Thanks in advance


texts: Apply Filter not working on Magento 2 for custom column Sales Order

texts:
I have save my custom data in quote and sales_order table and show data in Admin grid but filter is not working in this as it is search in sales_order_grid table in Magento 2.
my view/adminhtml/ui_component/sales_order_grid.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="sales_order_columns">
    <column name="export_status" class="[COMPANY]\[MODULE]\Ui\Component\Listing\Column\Status">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="visible" xsi:type="boolean">true</item>
                <item name="label" xsi:type="string" translate="true">XML Exported</item>
            </item>
        </argument>
    </column>
</columns>

Then created the UI class under [COMPANY]/[MODULE]/Ui/Component/Listing/Column/Status.php
namespace [COMPANY]\[MODULE]\Ui\Component\Listing\Column;

use \Magento\Sales\Api\OrderRepositoryInterface;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Ui\Component\Listing\Columns\Column;
use \Magento\Framework\Api\SearchCriteriaBuilder;

class Status extends Column
{
protected $_orderRepository;
protected $_searchCriteria;

public function __construct(ContextInterface $context, UiComponentFactory $uiComponentFactory, OrderRepositoryInterface $orderRepository, SearchCriteriaBuilder $criteria, array $components = [], array $data = [])
{
    $this->_orderRepository = $orderRepository;
    $this->_searchCriteria  = $criteria;
    parent::__construct($context, $uiComponentFactory, $components, $data);
}

public function prepareDataSource(array $dataSource)
{
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as & $item) {

            $order  = $this->_orderRepository->get($item["entity_id"]);
            $status = $order->getData("export_status");

            switch ($status) {
                case "0":
                    $export_status = "No";
                    break;
                case "1";
                    $export_status = "Yes";
                    break;
                default:
                    $export_status = "Failed";
                    break;

            }

            // $this->getData('name') returns the name of the column so in this case it would return export_status
            $item[$this->getData('name')] = $export_status;
        }
    }

    return $dataSource;
}
}

But my Filters are not working how to get it worked.
Any help is appreciated.


texts:
This isn't a question about why do my catalog price rules disappear after midnight, that's usually to do with the cron not being setup correctly.

My query is just that a query.

Do catalog price rules refresh when product prices are updated (using magmi) and reindexed?

Thanks.


texts: How to give add product option directly in cart in magento

texts:
I came across a requirement in one of my project where we need to accomplish the same.

Requirement:- Even though the user has not added any products to the cart, they should be able to open cart and click on a custom “Add product” to manually enter the product sku or product name with a type ahead feature to select the required product.

Note : We don't want the candidate to create a totally new custom cart functionality, requirement is to customize out of the box shopping cart of Magento so as to retain the inbuilt features.

Any suggestions/thoughts over this.


texts: Magento 2 : On clicking swatches, thumbnail images are hiding

texts: On product page, On clicking swatches Size and color. Thumbnail images are hiding.Why is it so happening. I used custom theme. Please help somone.


texts: Custom customer attribute are throwing error at Customer edit Page - Magento2

texts:
Using,Magento 2.1.3.

Created an attribute using installer file..

<?php

namespace [Devamitbera]\[ApplyCode]\Setup;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;

class InstallData implements InstallDataInterface{

    /**
     * Customer setup factory
     *
     * @var CustomerSetupFactory
     */
    protected $customerSetupFactory;

    public function __construct(CustomerSetupFactory $customerSetupFactory
          ) {
            $this->customerSetupFactory = $customerSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {

        /* @var customer Magento\Customer\Setup\CustomerSetupFactory */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);
        $setup->startSetup();
        $customerSetup->addAttribute(
                Customer::ENTITY,
                'codes_for_apply',
                [
                    'type' =>'varchar',
                    'label' => 'Group code',
                    'input' => 'text',
                    'required' => false,
                    'sort_order' => 100,
                    'visiable' => true,
                    'position' => 100,
                    'system' =>  false,
                    'is_used_in_grid' => true,
                    'is_visible_in_grid' => true,
                    'is_filterable_in_grid' => true,
                    'is_searchable_in_grid' => true,
                    'backend' => '[Devamitbera]\[ApplyCode]\Model\Attribute\Backend\codes'
                ]
                );

        /* Assign the attribute into form */
        $group_codeAttribute = $customerSetup->getEavConfig()
                                ->getAttribute(Customer::ENTITY, 'group_code');
        $usedInForms = ['customer_account_create', 'checkout_register',
                        'adminhtml_customer'];
        $group_codeAttribute->setData('used_in_forms',$usedInForms);
        $group_codeAttribute->save();
        /* Assign Group id  to Form */
         $group_IdAttribute = $customerSetup->getEavConfig()
                                ->getAttribute(Customer::ENTITY, 'group_id');
        $usedInForms = ['customer_account_create', 'customer_account_edit',
                        'adminhtml_customer'];
        $group_IdAttribute->setData('used_in_forms',$usedInForms);
        $group_IdAttribute->save();

        $setup->endSetup();
    }
}

At Customer edit phtml files... I tried to call

<?php echo $block->getCustomer()->getCodesForApply(); ?>

then  i am getting the error:

Fatal error:  Call to undefined method Magento\Customer\Model\Data\Customer::getCodesForApply() in
C:\xampp\htdocs\magesample213\app\code\[Devamitbera]\[ApplyCode]\view\frontend\templates\customer\form\edit.phtml

  on line 32

Why i getting this error  Fatal error:  Call to undefined method Magento\Customer\Model\Data\Customer::getCodesForApply() ??


texts:
i am using Magento 2  , in my case i want to change the default value for the page limit in  section Product in Category, the default value for me is "20 per page" so i want to change it to 100 per page
PS : i want to do it programmatically
PS : the value 100 is already existed in the options i want just to make it the default value instead of 30
thanks in advance :)


texts: script files are not calling in porto theme in magento2.2.4?

texts:
I created multi website in my website.

Main website is working fine. But, second website is not working.

Main website:https://www.depoto.com/

Sub website:http://multistore.depoto.com/


texts:
I am currently trying to send an email from an observer.

This is the code:

  /app/code/UO/CustomerAdressChange/Observer

if(!empty($isModified)) {
    //Liefer- oder Rechnungsadresse ist veraendert worden -> eMail schicken

    $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
    $transportBuilder = $objectManager->get('\Magento\Framework\Mail\Template\TransportBuilder');
    $storeId = $storeManager->getStore()->getId();

    $transport = $transportBuilder->setTemplateIdentifier('adress_change_template')
        ->setTemplateOptions(['area' => 'frontend', 'store' => $storeId])
        ->setTemplateVars(
            [
                'store' => $storeManager->getStore(),
            ]
        )
        ->setFrom('general')
        // you can config general email address in Store -> Configuration -> General -> Store Email Addresses
        ->addTo('myemail@mail.com', 'Customer Name')
        ->getTransport();
    $transport->sendMessage();              }

This is causing an error sadly.

Is there any standard email template identifier which I can set here:

$transport = $transportBuilder->setTemplateIdentifier('adress_change_template')

Any help is welcome.
Thanks!

Edit:

  /app/code/UO/CustomerAdressChange/etc/email_templates.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:Magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="adress_change_template" label="AdressChange" file="adresschange.html" type="html" module="UO__CustomerAdressChange" area="frontend"/>
</config>

  /app/code/UO/CustomerAdressChange/view/frontend/email/adresschange.html

<div>

Das ist ein Test

</div>

It seems like it doesn't find my email template?

Update: This line is causing an error:

$email = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('trans_email/ident_general/email');

->setFrom($email, 'Service')


texts: Magento2: How to send order status change email programmatically?

texts:
I am working on custom extension and i need to use the default feature of Magento 2 to send the email once order status is being changed by admin from the backend.
What file i need to look it for?
Please see the screenshot


texts: Clear the sub-blocks while reserving the frame of parence layout?

texts:
i mean remove all the sub blocks but keep the space of their parent block .
 i write in the custom layout of the admin panel.

<reference name="header">
<remove name="-" />
</reference>

but this seems don't work, i change the "-" with "*" ,still no luck, what should it be ?


texts:
Do we need to include the class  in the constructor?

In Magento 1, we simply use zend_debug::dump()->debug to debug object, how about for Magento 2?


texts: Footer-switch-currency in Magento 2 don't show select

texts:
I have a codazon Unlimited theme , but when i add the selector in footer this don't work.
I tried to talk with the support but no answers.

{{block name="footer-top" class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/footer-top.phtml" child_blocks="footer-switch-language,footer-switch-currency"}}

but on the front page i have this.

Please help me guys, I need to deliver it.

Thanks


texts: There is an issue on captcha button on create-customer/registration page. Please see attached picture. How can I change the position for Reload captcha button?


texts:
I need to change more than 200 words like ( good ) to ( best ) in all files on my hosting.
I have SSH access.


texts: Query string to select configurable variation

texts:
I want to select the configurable variation on page load based on the query string parameter. I cannot find anything on google for this so I am guessing it is not core magento functionality.

Does anybody know of a simple way to do this?

Example URL: test.com/test-product?p=3245643243254


texts: Error getting shipping quotes in Magento Admin for Fedex when shipping origin is in Canada

texts:
I have a shop with two Websites 1)US 2)Canada. The default currency is USD and the Canadian website is CAD.

The US website has a US shipping origin and the Canadian website has a Canadian shipping origin.

The issue is that Magento always passes the currency as USD (default currency) to the Fedex API when placing orders in the Admin. Even if the orders are for the Canadian website. The Fedex API rejects the call because the currency must match shipment origin currency.

I found that this function gets called in Mage_Usa_Model_Shipping_Carrier_Fedex to specify which currency to use

/**
 *  Return FeDex currency ISO code by Magento Base Currency Code
 *
 *  @return string 3-digit currency code
 */
public function getCurrencyCode ()
{
    $codes = array(
        'DOP' => 'RDD', // Dominican Peso
        'XCD' => 'ECD', // Caribbean Dollars
        'ARS' => 'ARN', // Argentina Peso
        'SGD' => 'SID', // Singapore Dollars
        'KRW' => 'WON', // South Korea Won
        'JMD' => 'JAD', // Jamaican Dollars
        'CHF' => 'SFR', // Swiss Francs
        'JPY' => 'JYE', // Japanese Yen
        'KWD' => 'KUD', // Kuwaiti Dinars
        'GBP' => 'UKL', // British Pounds
        'AED' => 'DHS', // UAE Dirhams
        'MXN' => 'NMP', // Mexican Pesos
        'UYU' => 'UYP', // Uruguay New Pesos
        'CLP' => 'CHP', // Chilean Pesos
        'TWD' => 'NTD', // New Taiwan Dollars
    );
    $currencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
    return isset($codes[$currencyCode]) ? $codes[$currencyCode] : $currencyCode;
}

As you would guess by looking at the code, it works on the frontend because the user's current store in under the correct website, but in the admin it always takes the default currency. I think the fix is the pull the currency off the store that is associated to the quote.

Am I missing something or is this a bug in Magento?

Thanks!

Chuck


texts: Magento 2 : How to create custom GraphQl to Access Customer Data?


texts: Can i set reply to to customer email in order copy?

texts:
I would like to set the reply to address for order confirmation copy to the customer's email address.

I magento backend you can configure to send order confirmation copy as a separate email. Is there a way to set the reply to for the copy to the customer's email address?


texts: Get Magento second image in product view page

texts:
I want to display image 2 from a product in the product view page next to the description. I need some help putting this code together.

I found some code online, but it gives me image 1 (base image). I need the second image displayed.

Ho can I do this?


texts: can we use current version magento2 in production mode with full stack development work

texts:
I will need  make e-commerce site . I know  that magento is best e-commerce platform but   I have confusion that  magento2 is stable development for production.

I need make website like

Recruitments My site

-product listing
-blog
-costume  functionality
-event management
-multi vendor


texts:
Is it possible to let my customers to choose if they want installation
yes / no at check-out.

I made it like this:

All orders under ex. 2000,- cost 150 in delivery.
orders over 2000,- are free.

However, the installation should always cost ex. 200

It is designed so that the customer must decide whether they want installation or not. (customers just need to be able to select it)

How is that possible?
(I am using flatrate rules to control my delivery amount)


texts: How to call function Clean cache in magento2?

texts: I have custom module add  data to core_config_data.i want after save can auto clean cache. Any help? thks.


texts: Last class is not setting on last category in Array

texts:
We have an If statement which sets a class name to categories in the array, The first category has the class of "first" and the last category has the class of "last" however the Last class name is not being set and i assume it is because it doesn't think it is the end of our array and i don't understand why

this is the code

$store_categories = $this->getLeftCategories();
if ($count = count($store_categories)) {

$block_title = $this->getBlockTitle();
if ( empty($block_title) ) $block_title = 'Categories';
?>

        <?php echo $this->__($block_title1) ?>

        <?php
        $i=0;
        foreach ($store_categories as $_category) {
            $class = array();
   if (!$i) {
                $class[] = 'first';
            }
            if($i == $count) {
                $class[] = 'last';
            }

            echo $this->drawOpenCategoryItem($_category, 0, $class);

            $i++;
        } ?>

</div

If anyone can see the reason it isn't setting the Last class or if i have wrote the IF statement wrong could you let me know as i have been looking at this for hours and cant see anything

Thanks


texts:
my magento custom controller not display on browser .I installed Alan Storm: A Better Magento 404 Page extension for get idea ..I gives following details

 Original Path Information /srinathtest/.
Module/Front Name

Module/Front Name: srinathtest.

The Module/Front Name [srinathtest] is claimed by the Magento module Testnewa_Testnewb.
Controller Name

Controller Name: index

The controller name index uses the controller class Testnewa_Testnewb_IndexController, defined in the following file.
/var/www/magento/app/code/local/Testnewa/Testnewb/controllers/IndexController.php
Action Name
Action Name: index

here is my files

IndexController.php

<?php
class Testnewa_Testnewb_IndexController extends  Mage_Core_Controller_Front_Action{

    public function indexAction()
   {
     echo 'test index';
   }
}

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <frontend>
    <routers>
        <Testnewa_Textnewb>
            <use>standerd</use>
            <args>
                <module>Testnewa_Testnewb</module>
                <frontName>srinathtest</frontName>
            </args>
        </Testnewa_Textnewb>
    </routers>
    </frontend>
</config>

url

http://localhost/magento/index.php/srinathtest/index/


texts: Magento 2 Attribute Sets and Attributes optimization

texts:
In terms of optimization and speed improvement, is it better to use:

many Attribute Sets with few Attributes.
few Attribute Sets with many Attributes


texts: Getting error for ezyparcels API for Malaysia country

texts:
In my Magento 1.9 project, we are using  Ezy2shipApi for creating shipments and returns.
We have admin configurations for Ezy2shipApi with WSDL Link, customer Id, username, password, AES encryption key. and other details.
The Ezy2shipApi details are working fine with Singapore country, I am using the same code and configurations for Malaysia country.
I am getting the following error code  (Response from Ezy2shipApi)
STATUS_ERROR_SERVICE_NOT_MAPPED_TO_COUNTRY
Selected service is not valid for the country.
Why I am getting this error
Does anyone work on this or facing the same issue?
Thank You.


texts: Magento 2: Factory initialization before foreach / after foreach

texts:
Which of the following is correct and what is the difference between these?

foreach($productIds as $id)
{
    $product = $this->_productFactory->create()->load($id);
    $product->save();
}

or

$productFactory = $this->_productFactory->create();
foreach($productIds as $id)
{
    $product = $productFactory->load($id);
    $product->save();
}


texts: Option: false for configurable associated products imported with Magmi

texts:
I have three custom attributes that allows me to make configurable products and create simple products to associate with them when I use the admin interface.

However using Magmi I see the following problem after import.

(Magmi plugins used: AttributeCleanup, Magmi_OptimizerPlugin, Magmi_ReindexingPlugin, CategoryImporter,ValueTrimItemProcessor, Magmi_ConfigurableItemProcessor)

In the Super product attributes configuration section I see a lot of Option: false where I would normally expect to see the option values of the associated simple products. E.g. Option: Red or Option: S42

As you can see the simple products has proper values assigned for the custom attributes:

If I scroll up to the Quick simple product creation and create a new product it shows up correctly in the Super product attributes configuration section.

What am I doing wrong?

UPDATE: I noticed, that despite that the grid states that the value is set to Red and Dotted for all my simple products, that when I click edit on one of them it shows that the attributes are actually not set on the products. How can it be set and not set at the same time?

I've noticed that on the rendered page there is a difference in the JSON embedded in the hidden input for each row. The imported rows has a value_index value corresponding to the value column in eav_attribute_option_value whereas the one I created in the admin interface has a value_index value corresponding to the value_id column in eav_attribute_option_value. But I would assume that the Magmi plugin would import this correctly?

UPDATE 2: It seems that the attributes created for the simple products during import are linked incorrectly. See the table catalog_product_entity_varchar. The value should contain the option id but it contains the actual option value S40 unlike the second row that is created through the UI:

UPDATE 3: I found the problem and a solution. See answer.


texts: How to Load Model data joining 2 tables?

texts:
Suppose I have a simple Model A that target table A now I have to add some extra info so I decide to create a Model B and save those extra info in a Table B with a foreign key pointing to Table A index key.

Usually Joins are done in collections but if I load a model the collection is not called, instead only the resource model is used.

How can I modify Model A to load also data from Table B on load()?


texts: How to wrap a div around the logo in Magento 2?

texts:
I am trying to wrap a div around the logo image in Magento 2. I have tried the below but no luck. Thanks for any help!

    <referenceContainer name="header-wrapper">
        <block class="Magento\Cms\Block\Block" name="logo.wrapper" after="-">
            <arguments>
                <argument name="block_id" xsi:type="string">logo.wrapper</argument>
            </arguments>
        </block>
    </referenceContainer>