texts:
I've been trying to track down this issue for a bit now for a client, but because of it not showing up all the time, it's been tough. Essentially when an image is being uploaded, it's says "Uploading...", but gets stuck there & doesn't proceed with finishing the upload process.

It's never done this for me, but for my client, it's both been successful & failed in IE/Firefox/Chrome/Safari on different computers on both PC/MC platforms on multiple different internet connections (at home & office).

I tried simulating heavier backend usage (was logged-in in multiple browsers & attempted to do multiple backend functions while an image upload was taking place & it uploaded fine). I also looked at the server usage logs & at all of the times they were having issues, there were no traffic spikes. They also have decently high speed internet. So I think it's safe to say we can rule out these things.

Not sure what else to check. Any ideas?

They're on Magento 1.9.0.1


texts:
I'm new to Magento and I have a config.xml which stands for a module configuration as far as I've learned.

I have problems to understand (also to locate some sort of documentation for that, Magentos config.xml Reference is totally no-saying to me) on this very basic level already. For example the following excerpt from config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <My_Mage>
            <version>1.0.0</version>
        </My_Mage>
    </modules>
    <global>
        <models>
            <My_Mage>
                <class>My_Mage_Model</class>
            </My_Mage>
            <!-- ... --->
        </models>
    </global>
</config>

What is the part in config/globals/models about?

I guessed it was about some file on disk, however I can not find any file related to the <class> "My_Mage_Model".

For what does that part stand for?:

        <models>
            <My_Mage>
                <class>My_Mage_Model</class>
            </My_Mage>

Any hints greatly appreceated.


texts: Could anyone give a quick overview of the new Enterprise_MView in Magento EE 1.13?


texts: Order Created Date is displaying today date

texts:
I am displaying Cusomters , Customer's Orders , Order Created Date in excel sheet.

Issue :

If there is no order created by customer, than Order created date is displaying today date, but i dont want to display that, means that field should be blank....

Example :

In above image in 3rd row , Customer [Nawab] Created order, so its displaying correct order date. but in 2nd row , customer did not created order, so its displaying today's date, but it should be blank....

<?php

$newordercollection = Mage::getModel("sales/order")->getCollection()->addFieldToFilter('customer_id',$customerArray['entity_id']);
$collection->setOrder('entity_id', 'ASC');
$firstItem = $newordercollection->getFirstItem();
$orderID = $firstItem->getIncrementId();

$data = $newordercollection->getData();
$createdAt = $firstItem->getCreatedAt();

$myTimezone = new \DateTimeZone("Asia/Kolkata");
$UTC = new DateTimeZone("UTC");
$newDate = new \DateTime( $createdAt, $UTC );
$newDate->setTimezone( $myTimezone );
$createdAt = $newDate->format('Y-m-d H:i:s');

$customerREquiredArray['order date']= $createdAt;

Full code : https://pastebin.com/2bHGSZiw


texts: how to set advanced search on an static page

texts:
Searching by attributes is enabled and working fine.
The case is that we made some changes in the main nav bar, by using url rewrite so we can use static pages or static blocks in the main nav bar.

Under this nav link, say "products" we have a category sublink "camera". Under the link "camera" we attached the right products.

The products are showing at the page as mentioned. But before these adjustments (when you clicked right at the category cameras) there is also the search engine to search a product by its attributes. Now it is not showing it anymore.

How can we get it back again?


texts:
I have added a plugin which should be triggered when a coupon code is applied. Sadly nothing happens, no errors too.

Where did I go wrong?

<?php

namespace Zygis\TestModule\Plugin;

class CheckoutCouponApply {

    public function beforeSet(\Magento\Quote\Model\CouponManagement $subject, $cartId, $couponCode)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $logger        = $objectManager->create('\Psr\Log\LoggerInterface');
        $logger->debug('test before set');
    }

    public function afterSet(\Magento\Quote\Model\CouponManagement $subject, $cartId, $couponCode)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $logger        = $objectManager->create('\Psr\Log\LoggerInterface');
        $logger->debug('test after set');
    }
}

And obviously I got it registered in Zygis\TestModule\etc\frontend\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Quote\Model\CouponManagement">
        <plugin name="CheckoutCouponApply" type="Zygis\TestModule\Plugin\CheckoutCouponApply" sortOrder="1" />
    </type>
</config>

Any help is appreciated! Thanks!


texts: Transactional Email Styling not displaying on preview

texts:
I'm trying to style the content of the email example is the New Ordern or the Order Confirmation Template. Now I selected this template and added some css styling on this field under the Template Style field. But upon saving and when I clicked the preview button the style that I made does not take effect or not being displayed (Note: I'm using an ID and I'm sure the ID selector is correct). Now since It didn't work and I thought it's just a cache issue I placed the styling within the element itself. Upon viewing the style show up.

Is there a reason why my styling does not show up when I place it in the Template Style?

Below is the screenshot of the NEW ACCOUNT template I made

Now below is when I click the preview of the template

I don't really understand why I can't view the changes? I also added the styling in the app/design/frontend/<VENDOR>/<MODULE>/web/css/email-inline.less but upon clicking preview I don't see the changes. Any idea on how to make this work?


texts:
I installed this template http://magento2.flytheme.net/themes/sm_shop4u/default/ and i can't find my menu (categories names ) in the top menu.

How can i get them back ?


texts: 500 Internal Server Error when installing magento2.2.2

texts:
I am trying to install Magento 2.2.2 on my local Windows environment with WAMP. But it gives me a 500 Internal Server Error. When I replace the previous version of htaccess file it does work. Would that be the issue?

Rewrite engine is on and the module is loaded.

Error log:

Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration

I have tried to enable LoadModule version_module modules/mod_version.so to make it work but now when the installation runs, in between it responds in my console that it's false after a few seconds. When I try to refresh, it starts the remaining installation but I have to refresh several times to complete the installation. I don't know if Magento is installed successfully or not during this process.

When I go to the admin it works, but I get console JS errors. The front-end still loads without CSS.

I tried to install it several times but every time I wind up with this error


texts: Is there any way to add the related products simultaneously?

texts:
i have added a products in the magento store. and now i want to add the related products in each of the products. problem is that, i am adding the products one by one for each product and it is taking a lot of time as i have hundreds of products in the store.
Is there any way to add the related products directly on each and every products. any help will be grateful.


texts: how to overwrite the renderlayer.php in magento 2

texts:
When i try to overwrite the Renderlayer.php of module-swatches I am getting error

[2018-09-24 06:48:41] report.CRITICAL: Warning: Declaration of Kygo\Swatches\Block\LayeredNavigation\RenderLayered::getOptionViewData(Kygo\Swatches\Block\LayeredNavigation\FilterItem $filterItem, Kygo\Swatches\Block\LayeredNavigation\Option $swatchOption) should be compatible with Magento\Swatches\Block\LayeredNavigation\RenderLayered::getOptionViewData(Magento\Catalog\Model\Layer\Filter\Item $filterItem, Magento\Eav\Model\Entity\Attribute\Option $swatchOption) in /opt/lampp/htdocs/kygolife/app/code/Kygo/Swatches/Block/LayeredNavigation/RenderLayered.php on line 14 [] []

How to overwrite that file.


texts: Magento 2 : Remove “Settings” Tab in Mobile Menu

texts:
How Can We Remove “Settings” Tab in Mobile Menu ?

Waiting for the reply!


texts: How to forbid access to .htaccess File in Magento 2?

texts:
If I call the .htaccess file in the browser e.g. https://www.mycompany.com/.htaccess, then it is getting downloaded. Is there a way to fix this?

I added this block to my .htaccess file, but it does not help:

<Files "\.htaccess">
    Order allow,deny
    Deny from all
</Files>

This is obviously a security hole.


texts: Custom controller reuses Magento front name

texts:
I've added custom controller under magento frontName and it works.

My routes.xml:

    ...
        <router id="standard">

            <route id="customer" frontName="customer">
                <module name="[Vendor]_[ModuleName]"/>
            </route>

        </router>
    ...

Path to controller is [Vendor]/Customer/Controller/Address/EditAjax and path in url is /customer/address/editajax. Is there any drawback or possibility of errors with native magento controllers


texts: Error during upgrade to Magento 2.1 from 2.0.7

texts:
Since a couple of days i try to upgrade my "native" Magento 2.0.7
I use composer as suggested by documentation :

composer require magento/product-community-edition 2.1.0 --no-update;
composer update;
php bin/magento setup:upgrade;

But when Magento try to update "Magento_Cms" native extension, I got a :

The page URL key contains capital letters or disallowed symbols.

Any help ?

EDIT : Here the solution I use to by pass the problem :

Edit file vendor/magento/module-cms/Setup/UpgradeData.php
Search for method public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context){}
And just comment the content of the :

if (version_compare($context->getVersion(), '2.0.1', '<')) {
    /*
    [...]
    */
}

I don't know why setup is entering in this condition, because my current version is 2.0.7 !
Maybe this post will help someone... (you can reset the updated file after installation).


texts: Extending Recently Viewed & Recently Compared Grids

texts:
I am struggling to extend the following two files in Magento 2.3.1

\vendor\magento\module-reports\view\frontend\templates\widget\viewed\content\viewed_grid.phtml

and

\vendor\magento\module-reports\view\frontend\templates\widget\compared\content\compared_grid.phtml

I tried extending them at:

\ME\THEME\Magento_Reports\templates\widget\compared\content\compared_grid.phtml

and

\ME\THEME\Magento_Reports\templates\widget\viewed\content\viewed_grid.phtml

I then ran setup:upgrade  and setup:static-content:deploy -f
But no changes took place.
To troubleshoot I then tried editing the files in their original location. Ran setup:upgrade  and setup:static-content:deploy -f
But still no changes?
Are these files no longer used?
To clarify it is the blocks that are inputted into the TinyMce Editor as below image.

Any Help much appreciated.


texts:
I was Using same EC2 for database and Magento files, and My site got Mysql Issue. So I decided to Use AWS RDS for Mysql

I have created new EC2 ( Amazon Linux HVM SSD ).Installed PHP , Httpd24 ( didn't install MySQL ).Also created AWS RDS. Selected Mysql. Now able to Log in Database Using Mysql Workbench

Don't Know What Should I Do now. Anyone Please Help me What should i do now to Live my Site . Confused about How RDS and EC2 Will Connected and Live my Site

let me know I will have to Install MySql in EC2 Instance Though i have Setup MySql in RDS Instance


texts: Custom uploader in Ui component not working

texts:
<item name="blutbildhochla" xsi:type="array">
    <item name="component" xsi:type="string">
        Magento_Ui/js/form/element/file-uploader
    </item>
    <item name="sortOrder" xsi:type="string">400
    </item>
    <item name="config" xsi:type="array">
        <item name="additionalClasses"
              xsi:type="string">blutbildhochla
        </item>
        <item name="template" xsi:type="string">
            Magento_Ui/form/field
        </item>
        <item name="elementTmpl" xsi:type="string">
            Magento_Ui/form/element/uploader
        </item>
        <item name="preview" xsi:type="string">
            Magento_Ui/form/element/preview
        </item>
        <item name="label" xsi:type="string">Upload</item>
        <item name="visible" xsi:type="boolean">true</item>
        <item name="formElement" xsi:type="string">fileUploader</item>
        <item name="uploaderConfig" xsi:type="array">
            <item name="url" xsi:type="url" path="wizard/index/upload"/>
        </item>
    </item>
</item>

I've added a custom uploader for frontend but once added the component, field was not rendering and the Controller was not hitting.


texts:
in our online shop we use a fullsize slider.
I would like to provide 3 links in the same slider using the same image. So that one time a customer clicks on the slider is referred to categorie a and the next customer to categorie b. So I'm searching for an alternating href store url.

a href="{{store url='onlineshop/categorie-a.html''}}"
a href="{{store url='onlineshop/categorie-b.html''}}"
a href="{{store url='onlineshop/categorie-c.html''}}"

First of all: Is that possible? What do I have to do so that it is alternating?

Thanks a lot!


texts: How to get current product id and quantity on view.phtml

texts: I want to know how to get current product id and quantity on view.phtml.


texts: Magento add custom attribute programmatically in a specific fieldset

texts:
I've created a custom attribute through an upgrade script and I saw that I can only add it to specific groups. If I for example try to add it to 'Inventory' it will create a new fieldset and not add it to the main inventory fieldset.

I've discovered the file where I need to put the code to load the custom var: /app/design/adminhtml/default//template/catalog/product/tab/inventory.phtml but I don't know how to load the custom var and make it savable at submit.

My upgrade script (this part works):

$installer->addAttribute(
Mage_Catalog_Model_Product::ENTITY,
'warehouseStock',
array(
    'label'                      => Mage::helper('My_HELPER')->__('Warehouse Stock'),
    'group'                      => 'General',
    'type'                       => 'text',
    'input'                      => 'text',
    'global'                     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'user_defined'               => true,
    'required'                   => false,
    'visible'                    => true,
    'source'                     => 'eav/entity_attribute_source_table',
    'backend'                    => null,
    'searchable'                 => false,
    'visible_in_advanced_search' => false,
    'visible_on_front'           => false,
    'is_configurable'            => false,
    'is_html_allowed_on_front'   => false,
    'sort_order'                 => '50',
)

This is what I did in /app/design/adminhtml/default//template/catalog/product/tab/inventory.phtml

        <?php
            $_item = $this->getProduct()->getId();
            $_resource = $this->getProduct()->getResource();
            $optionValue = $_resource->getAttributeRawValue($_item, 'warehouseStock', Mage::app()->getStore());
        ?>
        <?php echo Mage::helper('catalog')->__('Warehouse Availability');?>

            <?php if (!$_readonly):?>
                <input type="hidden" id="original_warehouse_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][original_warehouse_qty]" value="<?php echo $optionValue*1 ?>"/>
            <?php endif;?>
            <input type="text" class="input-text required-entry validate-number" id="warehouse_qty" name="<?php echo $this->getFieldSuffix() ?>[stock_data][qty]" value="<?php echo $optionValue*1 ?>" <?php echo $_readonly;?>/>

        <?php echo Mage::helper('adminhtml')->__('[GLOBAL]') ?>

but of course it's not savable, it only shows the current value that has been set through the custom attribute in general field.


texts: How to get a URL of configurable product in product feed manager

texts:
I am new to Magento and cannot seem to get simple thing right.

We use "Data Feed Manager" to automatically create product feeds. We only include configurable products, thus each URL have to be of a configurable product.

As said, we only filter the configurable products, but the {url} variables always end up in 404.

If there is any information that should have been provided, just ask.

Any help or guidance is much appreciated in this case.

UPDATE

The url variable is generated as following:

$url = $product->getProductUrl(). '.html' ;

However, getProductUrl() returns domain name + url key of its parent product.


texts: Magento2.3 - How to create dropdown for states from italy country?

texts:
I am new in Magento2.3. I want to create a Drop down for states for Italy country.

In Magento1 we have used below code:

INSERT INTO  `magento1.6`.`directory_country_region` (
`region_id` ,
`country_id` ,
`code` ,
`default_name`
)
VALUES (
'0',  'IN',  'IN-DL',  'New Delhi'
);

What is the code in Magento2?


texts: Reset Customer password through Database

texts: I want to reset one of my customer's password through database. What is the query for this in magento 2.


texts: Adding custom fields in the cms - Magento

texts:
I am new to Magento and I have some static pages that I am trying to integrate into the CMS.

I have been looking for days for a way to add custom fields to the CMS in a similar way to how Wordpress has this feature.

I found a couple of links:

http://www.atwix.com/magento/adding-custom-attribute-to-a-cms-page/ <- Too confusing/not clear on what I need to do in this tutorial.

http://mrpalvinder.wordpress.com/2014/05/30/how-to-add-custom-fields-in-cms-edit-page-admin-panel/ <- Not helpful

I need this feature because some of my content sits in different places on the site and adding it all into one content editor isn't enabling me to split the content up like I want it to. I then want to be able to call this content in my template files.

Whether I can do this programmatically or using an extension any help would be appreciated.

Thanks.


texts: Extending adminhtml controller from another module in Magento 1

texts:
this is my config.xml from my module:

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mynamespace_mymodule> before="Adyen_Subscription_Adminhtml">Mynamespace_Mymodule_Adminhtml</mynamespace_mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

This is my controller from my module:

<?php
require_once Mage::getModuleDir('controllers', 'Adyen_Subscription'). DS .'Adminhtml'. DS .'SubscriptionController.php';
class Mynamespace_Mymodule_Adminhtml_SubscriptionAddressController extends Adyen_Subscription_Adminhtml_SubscriptionController
{
    public function updateSubscriptionAction()
    {
echo 1; exit();
    }
...
}

This is the path to the controller that I want to extends:

app/code/community/Adyen/Subscription/controllers/Adminhtml/SubscriptionController.php

Im not getting the echo 1; exit(); Any idea what did I do wrong ?
Thx


texts:
I am looking for validate the city field in checkout page. The validation rules are city name must be chennai.

I follow this

I have add below lines in <magento-root>/vendor/magento/module-ui/view/base/web/js/lib/validation/rules.js :

"chennai_text_value": [
        function (value, params) {
            return value != params;
        },
        $.mage.__('This product only applicable for chennai people')
 ],

I have add below lines in <magento-root>/vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml  after company field validation(name="company" find in layout for easy understand)

<item name="city" xsi:type="array">
    <item name="validation" xsi:type="array">
        <item name="chennai_text_value" xsi:type="string">chennai</item>
    </item>
</item>

but nothing can happen, I expect chennai only accept in city field.

any help?


texts: how to get custom attribute into header.phtml in magento

texts:
I'm trying to get a custom attribute >> type "text field" into the header.phtml.

To get a custom attribute into a product page it is (view.phtml)

<?php echo $_product->getAttributeText('medium');?>

What is it for getting it into header.phtml?


texts: Magento 1.9 Localhost first request Wait Time very high

texts:
I know there had been many queries regarding the topic and I went through almost all of it.

The point where my query is slightly different from the rest is that my magento website runs pretty well in the production.

But my localhost is painfully slow. A point I would like to mention is that the magento project is created by me, and I have started working on it recently. I am not sure if its a magento thing or there had been some fault on my part during setting up of the project in my system.

So, in the project everytime I open a new page, the first request takes a lot of time as shown below:

Since the production website runs well, that removes the possibility of any optimisation in the server side. Also, the localhost I saw running in other system in the organisation was loading pretty fast (some of the systems being a mac).

The data in my localhost is being fetched from the test database not having as many tuples as that of the production database.
My system that I am using currently is Ubuntu 16.04, 8GB RAM and i5 8th gen. I am using PHP version 5.6.

Considering following scenarios mentioned, it will be really helpful if someone can point me to the reason why its happening. I am trying my level best so that the question is not a broad one, so if any details is required from my end which I missed to give, please ask for that.


texts: Magento 2 Hide Billing Address from Invoice email and print

texts:
I get some unique case that force me to hide billing address on the invoice print and invoice email in the magento 2.

may I know, how to do that ?

any help will be appreciated


texts: Magento, different shipping address - simplification of process on default magento checkout

texts:
I would like to simplify the first checkout step in the default Magento checkout.

The way it works now, when someone logs in and selects "Ship to Different Address" they are presented with an extra step. This extra step gives the user an option to select "Add New Address" from the drop down, then they are shown fields for entering a new address.

I would like to simplify it like this: When the user clicks "Ship to Different Address" they immediately get the fields for entering the new address without having to select the option from the dropdown.

Is this possible to do? I know it contains Magento functionality but I'm unsure on how to do it.


texts: Magento 2: Unable to Get Cart Information

texts:
In addition of Magento 2: How to show/hide payment method on basis of amount

Below code i have

namespace Vendor\Module\Model;

class Express extends \Magento\Paypal\Model\Express {

    public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) {
        $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $quote = $_objectManager->get('Magento\Checkout\Model\Cart');
        $quoteitems = $quote->getQuote()->getData();

        echo "<pre>";
        print_r($quoteitems);
        exit;
    }
}

Output

Array

(
    [is_checkout_cart] => 1
    [store_id] => 1
    [remote_ip] => ::1
    [x_forwarded_for] =>
)

It's not giving my any Cart related information, Items, Base Total, Grand Total, etc..

Also referred http://www.ibnab.com/en/blog/magento-2/magento-2-useful-snippets-for-frontend-developers also not working

If i put any kind of Constructor it's not allowing me to do so.


texts: Not showing sub-categories in category tree in Manage Products page

texts:
I am using magento copy category extension, this extension copies categories successfully.

But on Manage Product page in Categories tab, sub-categories of the original category (that i copied) disappears from the category tree. The copied categories are ok. But when i add a sub category manually to the original category, it solves the problem and subcategories appears.

It shows that sub-categories were not disturbed by the module but problem arises from somewhere else.

Any Suggestions?

Edit

Thanks in advance for your help


texts: custom add to cart button using ajax not rendering top minicart in magento 2

texts:
I have created quick order functionality on custom page layout .

Process like below:

customer find product in textbox and display matching products in autocomplete.In autocomplete result displays product-name,image and add to cart button.when I click add-to-cart button ,ajax call in custom created controller and I created code for programmatically add-to-cart product.Product add to cart successfully via my ajax code but mincart not render on top but when I refresh page then it displays products in minicart.

Anything missing in this process ?
And How to render minicart in controller OR Anyone tell me where is code in magento 2 of minicart render after add to cart ajax  ?
I need a hint for this.please suggest me


texts: Magento2 : Use of echo language construct is discouraged

texts:
I have my RSS feed from controller returned /displayed on frontend using echo , how do I replace echo any alternate method availabale?

  MEQP1.Security.LanguageConstruct.DirectOutput

public function execute()
{
        $shopUri = $this->_storeManager->getStore()->getBaseUrl();
        $posts = $this->collectionFactory->create()->addFieldToFilter('is_active', 1);

    $this->output .= '<?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
        <channel>
            <title><![CDATA['.$this->myHelper->getFinalIdentifier().']]></title>
            <description>Some Title</description>
            <link>'.$shopUri.'</link>
            <webMaster>'.$this->myHelper->getStoreEmail().'</webMaster>

            <image>
                <title><![CDATA['.$this->myHelper->getStorename().']]></title>

                <link>'.$shopUri.'</link>
            </image>';
    if (isset($posts) && $posts) {
        foreach ($posts as $post) {
            $url = $post->getIdentifier();
            $blog_link =  $shopUri.$this->myHelper->getDetailIdentifier($url);

            $this->output .= '
            <item>
                <title><![CDATA['.$post->getTitle().']]></title>
                <pubDate>'.date('r', strtotime($post->getPublishDate())).'</pubDate>
                <description>';
            if ($post->getImage()) {
                $this->output .= '<![CDATA[<img src="'.$this->myHelper->resizeImage($post->getImage(), 100, 75).'" title="'.$post->getTitle().'" alt="'.$post->getTitle().'" width="120"/>]]>';
            }
            $this->output .= '<![CDATA['.$post->getShortSummary().']]></description>';
            $this->output .= '
                <link>'.str_replace('&amp;', '&', htmlspecialchars($blog_link)).'</link>
                <guid isPermaLink="true">'.str_replace('&amp;', '&', htmlspecialchars($blog_link)).'</guid>
            </item>';
        }
    }
    $this->output .= '
        </channel>
    </rss>';
    echo $this->output;
 }


texts: Magento 2: Add unique attribute value programmatically

texts:
I'm trying to insert a value for a unique text value attribute programmatically to assign it to a product. All my others attributes have options so I can't use the same functions. If I try to insert them as an option attribute it gives an error that says "Attribute %id% doesn't work with options".

Is there a way to assign a value to this attribute and them assign it to a product?

Here is how I add a new value to an existing attribute. If value already exits, it returns the id.

/**
 * Find or create a matching attribute option
 *
 * @param string $attributeCode Attribute the option should exist in
 * @param string $label Label to find or add
 * @return int
 * @throws \Magento\Framework\Exception\LocalizedException
 */
public function createOrGetId($attributeCode, $label)
{
    if (strlen($label) < 1) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('Label for %1 must not be empty.', $attributeCode)
        );
    }

    // Does it already exist?
    $optionId = $this->getOptionId($attributeCode, $label);

    if (!$optionId) {
        // If no, add it.

        /** @var \Magento\Eav\Model\Entity\Attribute\OptionLabel $optionLabel */
        $optionLabel = $this->optionLabelFactory->create();
        $optionLabel->setStoreId(0);
        $optionLabel->setLabel($label);

        $option = $this->optionFactory->create();
        $option->setLabel($optionLabel);
        $option->setStoreLabels([$optionLabel]);
        $option->setSortOrder(0);
        $option->setIsDefault(false);

        $this->attributeOptionManagement->add(
            \Magento\Catalog\Model\Product::ENTITY,
            $this->getAttribute($attributeCode)->getAttributeId(),
            $option
        );

        // Get the inserted ID. Should be returned from the installer, but it isn't.
        $optionId = $this->getOptionId($attributeCode, $label, true);
    }

    return $optionId;
}

/**
 * Find the ID of an option matching $label, if any.
 *
 * @param string $attributeCode Attribute code
 * @param string $label Label to find
 * @param bool $force If true, will fetch the options even if they're already cached.
 * @return int|false
 */
public function getOptionId($attributeCode, $label, $force = false)
{
    /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */
    $attribute = $this->getAttribute($attributeCode);

    // Build option array if necessary
    if ($force === true || !isset($this->attributeValues[ $attribute->getAttributeId() ])) {
        $this->attributeValues[ $attribute->getAttributeId() ] = [];

        // We have to generate a new sourceModel instance each time through to prevent it from
        // referencing its _options cache. No other way to get it to pick up newly-added values.

        /** @var \Magento\Eav\Model\Entity\Attribute\Source\Table $sourceModel */
        $sourceModel = $this->tableFactory->create();
        $sourceModel->setAttribute($attribute);

        foreach ($sourceModel->getAllOptions() as $option) {
            $this->attributeValues[ $attribute->getAttributeId() ][ $option['label'] ] = $option['value'];
        }
    }

    // Return option ID if exists
    if (isset($this->attributeValues[ $attribute->getAttributeId() ][ $label ])) {
        return $this->attributeValues[ $attribute->getAttributeId() ][ $label ];
    }

    // Return false if does not exist
    return false;
}


texts:
What is the best way to version control Magento 2 store on Git?

How should I set up the repo/s to be flexible and reliable in a long run?

I use composer to install all third party modules (when that’s possible) so should I just VC the composer.lock file and then VC the app directory with all custom modules and theme?

Should I have one repository containing the whole store as it stands?

Or should I version control every single module on its own repository?

Any suggestions? I want to set that up right from the beginning.


texts: add product grid in customer tab in magento 2

texts:
I want to add product grid in customer tab and save product id save product id,
I got product grid in customer tab but i can't save, because i can't get product ids on save action (ids not add in form)


texts: How to create a vhost for magento store in xampp

texts: How do I create a vhost in xampp for multiple websites?


texts:
I wanted to add a custom block in my account page after account information.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceBlock name="page.main.title">
            <action method="setPageTitle">
                <argument translate="true" name="title" xsi:type="string">My Account</argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="Magento_Customer::account/dashboard/info.phtml" cacheable="false"/>
            <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="Magento_Customer::account/dashboard/address.phtml" cacheable="false"/>
        </referenceContainer>
        <block class="Magento\Framework\View\Element\Template" name="new_info" as="new" template="Magento_Customer::custominfo.phtml"/>
        <move element="new_info" destination="content" after="customer_account_dashboard_info"/>
    </body>
</page>

I want custominfo.phtml file should run after account information section.


texts:
I wrote this little Javascript to hide .price-box:

jQuery(document).ready(function(e) {
var visible = window.localStorage.getItem("visiblestate");
if (visible != null){
    var el = $('.price-box');
    if (visible == "true"){
        el.show();
    }else{
        el.hide();
    }
}
});
function ToggleState(){
var el = $('.price-box');
el.fadeToggle(500,"swing",function(){
    window.localStorage.setItem("visiblestate",el.is(":visible"));
});
}

I put this button in: toolbar.phtml:

input type="button" value="Toggle" onClick="ToggleState()"

And I use this CSS:

.hide {visibility:hidden}

I tested it with everything in one HTML and it is working. But when I use it together with Magento by adding:

<action method="addItem"><type>skin_js</type><name>js/toggleprice.js</name></action>

to local.xml

I get this error:

  Uncaught TypeError: Cannot read property 'fadeToggle' of null

Could anybody please tell me why it is working when I test it but not if I use it in Magento?

Thank you very much

Edit: This is my complete test-page:

<meta charset="utf-8">
<title>Test</title>

<input type="button" value="Toggle" onClick="ToggleState()" />


texts: How to Give Custom URL in the Order View Page in Admin Pannel

texts:
I have added the new button in the order view page in the back-end, Now i want to when i click on the button my custom URL "www.google.com" page will open in the new window.

I am using the below code:

$this->_addButton('order_reorder', array(
              'label'     => Mage::helper('sales')->__('Generate'),
              'onclick'   => "setLocation('".$this->getUrl('CUstome URL LINK')."')"

));


texts:
How to change js and css order in xml file? i want add js and css in footer or last in header.?

I want to change js order in product view page?

 <reference name="head">

    <action method="addItem">

            <type>skin_js</type>

            <name>js/jquery.js</name>

        </action>

        <action method="addItem">

            <type>skin_js</type>

            <name>js/cloud-zoom.1.0.2.min.js</name>

        </action>

i want to chanage order of this js this js added last or footer can any idea of to change order to js


texts: REST API : Magento 2 : Without admin token how i can registered new user?

texts: I am using bearer token for rest API authentication in Magento2.3.2 but I am facing one issue, while registering the new user, admin authentication token is required while registering New user by API. So my question is how I can register new user with authentication?


texts: Magento Switcher languages not working correctly

texts:
I have changed languages for flags in Magento. But now for example I change language home page localhost/website/ I click in French flag page goes localhost/website/fr make translation now I select product go to localhost/website/index.php/fr/productname now here I change language for example Italian it goes to the home page and give me this url localhost/website/index.php/fr/it

Do this for all languages

I can not solve this problem if you can help me thank you.

Here is the code languages.phtml

<?php if(count($this->getStores())>1): ?>

    <?php foreach ($this->getStores() as $_lang): ?>
        <?php if ($_lang->getCode() != 'default'): ?>
        <a class="lang-flag" href="<?php echo $this->getCurrentUrl().$_lang->getCode();?>" style="text-decoration:none;" title="<?php echo $_lang->getCode();?>">
            <img src="<?php echo $this->getSkinUrl('images/flags/'.$_lang->getCode().'.gif');?>" alt="<?php echo $_lang->getCode();?>">

        <?php endif;?>
    <?php endforeach;?>

<?php endif;?>


texts: How to display upsell products on the checkout page in magento?

texts: I want to display the upsell products on the checkout page. can anyone suggest the solution? I am using Magento 1.9.


texts:
I need to change some logic formAddressDataToQuoteAddress() from vendor\magento\module-checkout\view\frontend\web\js\model\address-converter.js

I have referred the Magento docs and written this code and i am getting this error

  TypeError: target.extend is not a function

app\code\Module\Checkout\view\frontend\requirejs-config.js

   var config = {
          config: {
              mixins: {
                  'Magento_Checkout/js/model/address-converter': {
                      'Perficient_Checkout/js/model/address-converter': true
                  }
              }
         } };

app\code\Module\Checkout\view\frontend\web\js\model\address-converter.js

define(function () {
    'use strict';

    var mixin = {
        formAddressDataToQuoteAddress: function (addressData) {
            return addressData;
        }
    };
    return function (target) {
        return target.extend(mixin);
    };
});

Can any one share some suggestion.

Thanks in advance.


texts: Magento 2 Shipping method not working - "Sorry, no quotes are available for this order at this time "

texts:
I have enabled Free Shipping Method and Fedex in Magento 2 but during checkout I get an error as shown below -

What might be the issue ?


texts: Sales order address custom attribute value in Order Rest Api

texts:
I have added door number custom attribute to sales order address table. But I'm not able to get the vale in Order REST API.

Please help me on this


texts: Adding multiple products (csv files taking too much time)

texts:
So we have  a CRM/Accounting/Sales/Inventory system called BrightPearl. This is used as our product database and we can import and export data into it using CSV. Files. I say product database and use the term loosely, one of my objectives here is to get on top of that. If we can manage the database of products better we can save a lot of manual entry of new products etc during the year. I also want to use the product database as a auto pricing tool. We use price breaks already but I’d like the spreadsheet to work these out so we have a set price list (which we currently don’t).

Then we have a spreadsheet we use to upload products to our magento site. 70% of the products in the product database will be eligible for the website but this is where it gets tricky. Because we provide “customisation” of clothing etc, we have had to customise a lot of the website in order to offer that facility (take a look here: ) so in the spreadsheet for the site we have to add additional columns for this which we wouldn’t use in the sheet for the product database. We get csv. Files from our suppliers with product info already so most of the leg work is done but in our industry we are talking about 10s of thousands of sku’s (f you consider a certain style of polo, size large, red is one sku…you see why there is so many!!) which need to be updated at least yearly when our wholesalers add/remove products from their offering or change pricing.

So all in all, I want to find a way to combine the 2 so it is sustainable for the future and takes away a lot of the manual typing into spreadsheets that we’re doing now.

I’ve been told that you can get different spreadsheets to “talk to eachother” so I am hoping there is some way we can do this.

Currently the process of adding products to Magento is a tedious process of having to add each product individually by entering their data into a csv file, this takes time having to add these products in individually to the csv files. Surely there should be a solution where the suppliers csv file can distribute to the other csv files. I have heard FileZilla can be used as a way of performing this.

TL;DR - Adding multiple products to website is taking too long by adding data to spreadsheets. Is there an easier solution to this?


texts: How to display login on hover in magento 2

texts: In this i want to create a custom module in that one button is in header for login and on hover of that button i want to display login form with ajax.


texts: magento 2 Issue with Rest Api zero price first time any solution

texts:
Products added to cart with REST API give total prices equal to zero I added my comments in github also but no response from magento team did any one resolved this issue

https://github.com/magento/magento2/issues/2991


texts: Magento 2 - How to apply OG Tag for all products

texts:
I am update OG tag for home page,
app\design\frontend\Zero\mytheme\Magento_Theme\layout\default_head_blocks.xml
 <meta property="og:image" content="http://example.com/DEFAULTIMAGE.png" />
 <meta name="og:title" content="Printing coop is a most famous Digital Printing certer"/>
 <meta name="og:description" content="Printing coop is a most famous Digital Printing certer in Montreal Canada.Professional Printer Services."/>

How to apply for my Category, Products,  and CMS Pages &  blocks?


texts:
I am trying to implement an adjustment to the default .phtml files that are shipped with magento. I am a little confused as to how the .phtml files are altered without adjusting them directly, consequently I am failing to get this to work. The example I will use is the account dashboard heading (found on storeName.local/index.php/customer/account/index/) MY ACCOUNT, I'd like to change it to [USERSNAME]'S ACCOUNT.

To do this I have copied the contents of customer/account/navigation.phtml into the file path myNamespace/modulename/account/navigation.phtml on line 29 there is this code

<?php echo $this->__('My Account'); ?> my random text for testing

and added this to my modulename/layout.xml

    <modulename_index_index>
        <reference name="left">
            <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="namespace/modulename/account/navigation.phtml" />
        </reference>
    </modulename_index_index>

THEN

    <modulename_index_index>
        <reference name="customer_account_navigation">
            <action method="insert"><type>simple</type><block>customer/account_navigation</block><template>namespace/modulename/account/navigation.phtml</template></action>
        </reference>
    <modulename_index_index>

These methods have not worked. To be honest I didn't expect it to but the way I have read the posts is that I need to apply the code from the phtml file which I am overriding into my module, followed by the equivalent file path held in its default module.

How do I go about making adjustments

Pages viewed to try and resolve issue

try 1 try 2 try 3


texts:
We're trying to setup Klaviyo on our Zandbox/test site with nginx.

But Klaviyo cant get the data from SOAP when i have htpasswd enabled.
It needs to visit www.mytestdomain.com/api/v2_soap?wsdl=1 to get the data.

How can i disable auth_basic for the whole api folder? i already did this for some php files, but as this is not a specific php file i dont know. The code i use for php files is:

location =  /folder/file.php {
  auth_basic off;
  try_files $uri =404;
  expires off;
  fastcgi_split_path_info ^(.+\.php)(/.+)$;
  proxy_connect_timeout  2600s;
  proxy_send_timeout  2600s;
  proxy_read_timeout  2600s;
  fastcgi_send_timeout 2600s;
  fastcgi_read_timeout 2600s;
  fastcgi_pass zandbox;
  fastcgi_pass_request_headers on;
  fastcgi_keep_conn off;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root${fastcgi_script_name};
  fastcgi_param MAGE_RUN_CODE base;
  fastcgi_param MAGE_RUN_TYPE website;
  }


texts: How to put products in cart using API and finish using front end in Magento 2?

texts: I want to add items to cart using the REST API (I already know how to) and then direct customers to Magento 2's built-in front-end and load it by id or some other way?


texts: Magento 2.4.0 Duplicated Site 404 Error On Some CSS And JS

texts:
I duplicated a Magento 2.4.0 install to a dev server and I'm having a 404 issue on the CSS and JS when loading any pages on the new sub-domain and the front and back end are displaying no CSS.

So Far I have tried:

Edited my app/etc/env.php to use the correct DB credentials
Check root and pub/static for .htaccess (And replaced with fresh from Magento docs and Github)
Changed web/secure/base_url and web/unsecure/base_url to match domain name including the ending /
Ran the following commands

php bin/magento deploy:mode:set developer
php bin/magento cache:disable
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento setup:static-content:deploy en_GB -f

I feel like I've read every thread even slightly related to my problem and I still can't find any solutions


texts: Magento 2: How to Redirect from Observer to CMS Page

texts:
I want to restrict some products from add to cart and redirect to a cms page on Add to Cart action. I have used 'controller_action_predispatch_checkout_cart_add' event.
The code restrict the add to cart action,but the redirection is not working.
Here is my code

namespace NamaSpace\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class RestrictAddToCart implements ObserverInterface
{
protected $_request;

protected $_product;

protected $_responseFactory;

protected $_url;

public function __construct(
    RequestInterface $request,
    \Magento\Catalog\Model\Product $product,
    \Magento\Framework\App\ResponseFactory $responseFactory,
    \Magento\Framework\UrlInterface $url
)
{
    $this->_request = $request;
    $this->_product = $product;
    $this->_responseFactory = $responseFactory;
    $this->_url = $url;
}

/**
 * add to cart event handler.
 *
 * @param \Magento\Framework\Event\Observer $observer
 *
 * @return $this
 */
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $productId = $observer->getRequest()->getParam('product');
    $product = $this->_product->load($productId);

    if ($product->getPrescProduct()) {

        $observer->getRequest()->setParam('product', false);
        $customRedirectionUrl = $this->_url->getUrl('prescription-page');
        $this->_responseFactory->create()->setRedirect($customRedirectionUrl)->sendResponse();     exit;
        return $this;
     }

return $this;
    }
}


texts: How to get dynamic coupon code in Subscription Newsletter template in Magento1.9?

texts:
I have created a newsletter template for giving 20% discount to customers by a dynamic coupon code. I created a shopping cart price rule with dynamic coupon code but I am unable to fetch that coupon code in Newsletter template.

How to get dynamic coupon code in newsletter email ?


texts: How to access the last added element in a dynamic rows component

texts:
This is a follow up question to How to add custom Js code in a "dynamic-rows" component?

I have successfully overwritten the dynamic rows ui-component so I can call some custom js code when a new element is added.
but I cannot access the element that was last added.
I've changed the function addChild to look like this:

   addChild: function (data, index, prop) {
        this._super(data, index, prop);
        console.log('just added an element');
        console.log(this.recordData().length); //tried with this.elems().lenght also
        return this;
    },

This works partially as expected. The message 'just added an element' is logged in the console each time I add a new element, but when logging the number of added elements it turns up one short.
After the first add I get the length 0 after the second one I get 1 and so on.
How can I access the last element that I added to the list of dynamic rows.

[EDIT]
The same thing happens when I try to log the number of elements after a delete. I get one more than I should.
So I guess there is a method that updates the child elements count after the elements are added or deleted. Which is it?


texts: Magento2: How to get product collection with pagination wise using ajax?

texts:
I want to get the product collection using ajax with pagination.

I have implement the product collection using ajax but pagination is not working.


texts:
I'm trying to get the Customer Group from the customer's order. I have the following code and I have commented the line that doesn't appear to be working;

<?php if($order->getCustomerId()):?>

    // Correctly gets the CustomerId from the $order
    <?php $customerId = Mage::getModel('customer/customer')->load($order->getCustomerId())?>

    // Here i'm trying to get the Customer Group but it's not being returned
    <?php $customer_group_id = Mage::getModel('customer/customer')->load($order->getCustomerGroupId()); ?>
    <?php $customerGroup = Mage::getModel('customer/group')->load($customer_group_id)->getCode() ?>

    <?php echo $customerGroup ?>

<?php endif; ?>

I wondered if someone could help me rectify this?

Thank you.


texts: I stuck with a problem that some of the categories won't show in the layered navigation. An anchor is enabled, re-indexation and cache clearing made many times, changed the theme to default Luma. Strange that 3 of them are showing. I thought maybe problem with the URL rewrite because I made product imports. Truncated tables and also didn't help. Magento version is 2.3.2


texts: Magento 2 - Place Order if payment is completed

texts:
I have a custom payment method. When the place order button is triggered, I want to process my payment gateway. After this, if payment is a success order should be placed successfully.

Here is a method-renderer file.

define(
    [
        'Magento_Checkout/js/view/payment/default'
    ],
    function (Component) {
        'use strict';
        return Component.extend({
            defaults: {
                template: 'Iostpay_Iostpaymagento/payment/iostpay'
            },
            getMailingAddress: function () {
                return window.checkoutConfig.payment.checkmo.mailingAddress;
            },
            getInstructions: function () {
                return window.checkoutConfig.payment.checkmo.mailingAddress;
            },
            placeOrder: function () {
                alert('heya');
                var getresp = transfer();
                console.log("transfer-resp: "+getresp);
                var form = document.getElementById("co-payment-form");
                form.submit();
            }
        });
    }
);

This is my placeOrder Button HTML.

<button class="action primary checkoutplaceorder"
        data-bind="
            click: placeOrder,
            attr: {title: $t('Place Order')},
            css: {disabled: !isPlaceOrderActionAllowed()},
            enable: (getCode() == isChecked())
            "
        type="submit" disabled>

</button>

Basically this is how I wanna do.

Click on placeOrder:-
On click of place order, a payment modal will pop up. Then the user will make the payment from the modal-popup.
After making payment the user gets the payment response.
Place the Order successfully and submit the form.

Does anyone know about this?

Thanks in advance.


texts: Magento version 1.9.2 404 on add to cart

texts:
Ok let me start from the beginning;
The site I am currently working on is Magento powered E-commmerce website. I was given the site after 3 developers took the owners money and ran once they got confused. The website was version 1.9.1 and I updated the website to 1.9.2 The owner of the website contracted ecorepay to handle the credit card purchases from the site. Ecorepay sent me a module extension which I uploaded per ecorepays instructions. Ecorepay was installed before update was made to the website. After the update is when the problem started. Once store item is selected to add to cart it goes to a 404 page not found and doesn't add to cart.

and this is the url that got me here
www.mysite.com/checkout/cart/myadd/?product=4&qty1

When a product link is clicked for selection it doesn't add the item to the cart. Before update of the website it would add to cart then take you cart page and checkout pages where you put all your billing and shipping information.
What do I need to do to fix this?


texts: Adding a field to sales_flat_order, vs. extending with a table

texts:
This is for Magento 1.4.x - I have discovered that the actual tax rate used for calculation of that order (say 8.25% for example) does not have a field to go into in sales_flat_order - which is pretty lame IMO considering the number of other detailed pieces of information this table and the _items table have.

I am considering extending the model and adding a tax_rate field to the table itself.  Another option is to extend with an EAV table and store the attribute there.  Is the former an acceptable solution, and will it survive an upgrade to version 2.0 which we are planning on doing soon?


texts: Removing services of a product using ajax request deosnt update quote total price

texts:
i have written a code to remove related services while removing a product from cart. Even though the product and its services are getting removed from quote_item table, the total price in Mage::getSingleton('checkout/cart') or Mage::getSingleton('checkout/session') isn't getting updated.

    foreach ( $quote->getItemsCollection() as $item ) {
       if ($item->getSwType() == 'service' || $item->getDeliveryParentId()) {
            $item->isDeleted(true);
            $quote->removeItem($item->getItemId());
        }
    }


texts: Magento 2: Remove 'low stock' label from product image

texts: I created a product and set 'Manage Stock' to no. But when i see a product on frontend, it shows a label 'Low Stock' on product thumbnail image. I do not want to show that label. I think there is an option in admin panel by which i can remove this label. Please help me to remove that label.


texts: 1 part of the sidebar at top, rest at bottom

texts:
Okay, so I have a sidebar in one of my CMS pages. This sidebar has 3 static blocks:

a menu (accordeon on mobile devices)
a contact block
an USP block

The HTML is roughly set up like this:

Some content

Menu

menu item

menu item

menu item

menu item

Contact us

Some text related to contacting the vendor

USP

USP

USP

The sidebar is on the right of the page. When I switch to a mobile device (770px media query), I want ONLY the menu block to be at the top of the page. The rest of the sidebar has to display at the bottom of the page. How do I do this, without changing HTML, and not using bad practice?

Structure how I want it on mobile devices:

Menu block
Content
Contact block
USP block


texts: How to hide a custom text attribute which displayed in product edit backend

texts:
I am using Magento 2.2.5
I need to hide a text attribute which I'm using to save serialized data of custom options of product.

I think this can be done using adminhtml/ui_component/product_form.xml file, but don't know how.
Thanks


texts:
I created a controller to add configurable product to cart but when i try to reload the minicart dynamically using javascript or even refresh the page in product detail page it shows the wrong price and wrong color for the product, but when i go to /checkout/cart, the mini-cart shows the right product price and color. to load the minicart dynamically using javascript, i use the minicart block from controller like this:

 if ($this->getLayout()->getBlock('minicart'))
  $minicart = $this->getLayout()->getBlock('minicart')->toHtml();

here's the wrong minicart example after i add the product to the cart in product page details:

and after i go to /checkout/cart, the mini cart shows the right price and product color:


texts: Magento 2: How do you move Catalog/CMS changes to production?

texts:
The magento 2.2 documentation, in its Pipeline Deployment Overview , states the following (brackets & emphasis mine):

  [the production system is] Your live store. You should make minimal configuration changes here and no changes to websites, stores, store views, products, or the catalog. You should make all those types of changes in your development system.

I totally agree with that statement.

My Question:

After making and testing such changes on development store, how do I get those changes onto production?

Is there a best practice, or at least a recommended approach to this? I appreciate any help/insight.

For instance, are there a selection of tables for which I can write a migration script to safely execute each time I need to push content/catalog changes to production?


texts:
I have Table Rates set up. The special postcodes are not working - they just use the default value.

I know Table rates are working because if I alter the default line below it is used.

I hope it is something to do with the format of my CSV file.

[![enter code here][1]][1]

Any ideas?


texts: Magento2 - run a site in maintenance mode showing public 503 page AND switch to developer mode

texts:
I have a custom 503 "site down for maintenance" page configured and I see this served publicly when I switch to maintenance mode as described here:
http://devdocs.magento.com/guides/v2.2/install-gde/install/cli/install-cli-subcommands-maint.html
I have run the command magento maintenance:enable --ip=<ip address>, which serves to create the var/.maintenance.flag file containing my office ip address in the whitelist. I thus have M2 running in maintenance mode and I still have full access to the site.
But wait! I now wish to do some work on the site in developer mode, i.e. make code changes in xml and php files. When I switch to developer mode, this disturbs the way maintenance mode works, as it prevents the custom 503 status page from showing and instead renders a stack trace to the public! This issue is raised here, but there are no real answers to this conundrum.
What on earth is the point in having a maintenance mode that does not allow a developer to switch into "developer mode" where the caches are bypassed and we can actually do some work?! This whole setup makes no sense to me. If I leave it in production mode, I will need to manually nuke caches/static files after every change is made, which is massively impractical!
What are people doing to work on live Magento 2 sites? What is the workflow adopted to temporarily switch a live site into maintenance mode and run it in developer mode concurrently? The official Magento 2 docs seem to make no attempt to address this. Can anyone point me in the direction of some resources that explain how to put a live site into maintenance mode, then set to developer mode while still showing custom 503 page to the public?
Note: I have custom modules and theme modules that only permit changes to be made via the admin panel when the site is switched to developer mode, so I MUST be able to go into developer mode. Many thanks.


texts: How to hide empty custom tab in magento 2?

texts:
I have added the custom attribute tab on the product page. If the tab is empty is must be hidden.

    I have created an attribute customtab.

I have added below code in the catalog_product_view.xml inside body tag:

<referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="customtab.tab" template="Magento_Catalog::customtab.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
                </arguments>
            </block>
        </referenceBlock>

How can I hide the custom attribute tab?


texts:
Is it possible to check in default.phtml file (app\design\frontend\MyNAMESpace\MY_THEME\Magento_Catalog\templates\product\price\amount\default.phtml) that catalog.product.related (block ) is loaded or not?

I want to add condition in default.phtml file if default.phtml file is called in catalog.product.related | product.info.upsell

I am curious to know if this can be possible in any method.


texts: Authorize.net error: No order id submitted

texts:
I am trying to setup Authorize.net on Magento 2.1 and got this error message when go through the checkout process.

And this is the debug information

[2017-06-05 05:00:27] main.DEBUG: array (
  'request' =>
  array (
    'x_version' => '3.1',
    'x_delim_data' => 'FALSE',
    'x_relay_response' => 'TRUE',
    'x_test_request' => 'FALSE',
    'x_login' => '****',
    'x_method' => 'CC',
    'x_relay_url' => 'http://staggb.domain.com/authorizenet/directpost_payment/response',
    'x_type' => 'AUTH_CAPTURE',
    'x_fp_sequence' => '8',
    'x_invoice_num' => '000000005',
    'x_amount' => 150.530000000000001136868377216160297393798828125,
    'x_currency_code' => 'USD',
    'x_tax' => '0.00',
    'x_freight' => '10.58',
    'x_first_name' => 'Abc',
    'x_last_name' => 'Def',
    'x_company' => '',
    'x_address' => '234 140th St',
    'x_city' => 'Artesia',
    'x_state' => 'California',
    'x_zip' => '90701',
    'x_country' => '',
    'x_phone' => '0433347279',
    'x_fax' => '',
    'x_cust_id' => '',
    'x_customer_ip' => '203.219.142.34',
    'x_customer_tax_id' => '',
    'x_email' => 'support@abcd.com',
    'x_email_customer' => '1',
    'x_merchant_email' => '',
    'x_ship_to_first_name' => 'Abc',
    'x_ship_to_last_name' => 'Def',
    'x_ship_to_company' => '',
    'x_ship_to_address' => '115 170th St',
    'x_ship_to_city' => 'Artesia',
    'x_ship_to_state' => 'California',
    'x_ship_to_zip' => '90701',
    'x_ship_to_country' => '',
    'x_po_num' => '',
    'x_fp_timestamp' => 1496638827,
    'x_fp_hash' => 'a6cf6689da19d58a8367ca0bda54c42d',
  ),
) {"is_exception":false} []

Anyone please help


texts: Change quote_id(Cart) after logout in Magento CE 1.9

texts:
Brief Introduction: I am trying to make custom rest api's for magento. To add a product in customer's cart, I followed following steps:

1) Log In customer(code):

public function loginUser( $email, $password){
         require_once ("app/Mage.php");
         umask(0);
         ob_start();
         session_start();
         Mage::app('default');
         Mage::getSingleton("core/session", array("name" => "frontend"));

      //   $websiteId = Mage::app()->getWebsite()->getId();
         $store = Mage::app()->getStore();
         $customer = Mage::getModel("customer/customer");
         $customer = Mage::getModel('customer/customer')->setWebsiteId(1);
         $customer->setStore($store);
         try {
             $customer->loadByEmail($email);
             $session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
             $session->login($email, $password);
          }catch(Exception $e){

          }
    }

2) To add product to customer's cart(code):

Mage::init('default');
$id = '1';
$qty = '1';
$_product = Mage::getModel('catalog/product')->load($id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product, array('qty' => $qty));
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

3) Logout Customer:

Mage::getSingleton("customer/session")->logout();

Problem: After Login I added a product into cart, it successfully added in corresponding customer's cart after that I logged out and then added a product to cart as a guest but the product was added in same(previous) QUOTE_ID and then again logged in from different account(not previous customer) and again I added a product and it again added in same QUOTE_ID.
The Resultant carts of both user's are like this:

customer1: 3 products
customer2: 3 products

But they should be like this:

customer1: 1 product
customer2: 2 product

To Remove quote id, in logout I add reserveOrderId to null(generally it is used after checkout) but no solution:

Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null);

For more Information:

customer_id = 1 and quote_id = 5 returns after 1st add(Got customer ID from session)
customer_id = null and quote_id = 5  returns after 2nd add(after
logout)
customer_id = 2 and quote_id = 5 returs after 3rd add(logged in
from different account)


texts: Set configurable attributes + custom options via url on product page in Magento

texts:
I have a Magento shop with some configurable products. Those products have 3 configurable attributes from an attribute set and 1 custom option that is set on the configurable product itself (so not from the attribute set).

What I want to do is set the attributes and custom options via an url. So when we send that url to a customer via mail, and he clicks on it, it is already configured (but he can still change it via the dropdowns if he wants).

I know you can do this by adding values to the url. For example:

http://www.shop.com/cat/product.html#132=4&140=16&139=15&3=21

But this only works for the 3 configurable product attributes, NOT for the custom option. Is this something that can be done (but am I using the wrong syntax), or is this something that needs modification of the code?

Thanks!


texts: See less source files in chrome dev tools

texts:
How do you see the less file that is generating the style in chrome dev tools?

working in developer mode, in less.js:

var lessOptions = {
    options: {
        sourceMap: true,

and in config.less.js:

less = {
    env: "development",
    logLevel: 0,

but still the source is not present, only some style tags that are directing to the generated style.css

I have enabled sourcemaps in my devtools. I am using client side workflow.


texts:
A customer has paid yet his order is stuck in his shopping cart. I confirmed this with looking in my paypal his payment has definitely gone through.

So I tried to Create an order for him so I could give him invoice...etc. Upon trying to create an invoice it gives me error;

  Order saving error: SQLSTATE[23000]: Integrity constraint violation:
  1062 Duplicate entry '100000103' for key
  'UNQ_SALES_FLAT_ORDER_INCREMENT_ID', query was: INSERT INTO
  sales_flat_order (coupon_code, protect_code,
  shipping_description, is_virtual, store_id, customer_id,
  base_discount_amount, base_grand_total, base_shipping_amount,
  base_shipping_tax_amount, base_subtotal, base_tax_amount,
  base_to_global_rate, base_to_order_rate, discount_amount,
  grand_total, shipping_amount, shipping_tax_amount,
  store_to_base_rate, store_to_order_rate, subtotal, tax_amount,
  total_qty_ordered, customer_is_guest, customer_note_notify,
  customer_group_id, quote_id, base_shipping_discount_amount,
  base_subtotal_incl_tax, shipping_discount_amount,
  subtotal_incl_tax, weight, customer_dob, increment_id,
  applied_rule_ids, base_currency_code, customer_email,
  customer_firstname, customer_lastname, customer_middlename,
  customer_prefix, customer_suffix, customer_taxvat,
  discount_description, global_currency_code, order_currency_code,
  remote_ip, shipping_method, store_currency_code, store_name,
  x_forwarded_for, customer_note, created_at, updated_at,
  total_item_count, customer_gender, hidden_tax_amount,
  base_hidden_tax_amount, shipping_hidden_tax_amount,
  base_shipping_hidden_tax_amnt, shipping_incl_tax,
  base_shipping_incl_tax, coupon_rule_name, gift_message_id)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
  ?, ?, ?, ?, ?, ?, ?, ?, '2016-03-10 03:27:10', '2016-03-10 03:27:10',
  ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

It says the Duplicate Entry "100000103" already exists which it does when I look in my invoices. I've taken my website offline for now until I get this sorted as I don't want to tarnish my brand.

Anyone had this error before?

EDIT1: I tried to create again and it went to "100000104" then "100000105", upon the fourth try it worked as it defaulted to "100000106" which does not have a sale number.

Thanks, Steve


texts:
Is possible to change the state of the order to complete?

$order->setSate(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->save();

Programmatically : setState(Mage_Sales_Model_Order::STATE_COMPLETE) will generate Exception.

$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
$order->save();

With setData('state', Mage_Sales_Model_Order::STATE_COMPLETE) => Server Error "404 Not Found - nginx".

Thanks a lot.


texts: No customer_id in sales_flat_quote but forced login?

texts:
In our shop there are records in the table sales_flat_quote where the customer_id is NULL. If I understand correctly this is due to a customer not being logged in.

The catch is that our shop has forced login: without loggin in a customer can't enter the shop.

This issue causes several problems:

Sometimes customers receive an error when they try to place an order.
Sometimes when one account logs in on two different machines, two different shopping carts exist under the same account.

Does anybody have any idea as to why sometimes the customer_id is not recorded?

Magento version 1.9.3.7

For forcing the login we use a module. When the customer tries to place the order they One Step Checkout keeps loading and a red bar without text appears. The admin receives an email with "Payment Transaction Failed Reminder" without any more information.

Also, this problem occurs with 30-50 regular customers but not with others. This caused be to think the problem is client based, but all clients use different OS, browsers, etc.


texts: Filtering category collection producing incorrect behaviour with flat catalog enabled

texts:
I have some code to perform a basic search of categories. It works by searching the category name and description - attributes that are both core.

The code I have is as follows:

$_categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('description')
    ->addAttributeToSelect('associated_brand')
    ->addAttributeToSelect('image')
    ->setPageSize(12)
    ->setCurPage(1)
    ->addAttributeToFilter('level',['gt' => 2])
    ->addAttributeToFilter('is_active',['eq'=>true])
    ->addAttributeToFilter(
        [
            ['attribute' => 'name', 'like' => '%'.$searchterm.'%'],
            ['attribute' => 'description', 'like' => '%'.$searchterm.'%']
        ]
    )->load();

Prior to enabling the flat catalog for categories, it returned the expected results - any categories that had a match for the search term in their name or description.

With the flat catalog enabled, the name or description search does not work. If I output the underlying collection query, it is as follows:

SELECT `main_table`.`entity_id`, `main_table`.`level`, `main_table`.`path`, `main_table`.`position`, `main_table`.`is_active`, `main_table`.`is_anchor`, `main_table`.`name`, `main_table`.`description`, `main_table`.`associated_brand`, `main_table`.`image`
FROM `catalog_category_flat_store_1` AS `main_table`
WHERE (level > 2) AND (is_active = '1')

As can be seen from the above, the name and description clause are missing completely.

I've checked the generated catalog_category_flat_store_1 table and the fields are present there.

Any ideas why Magento is dropping these filters from the query, only when using the flat catalog?


texts: how to include right protocol on dynamic pages

texts:
Website can be accessed through http and https, we have http for the youtube videos as follow:

 <iframe src="http://www.youtube.com/embed/oaAfdePAWPI?autoplay=1&amp;autohide=1&amp;rel=0&amp;wmode=transparent" height="347" width="617"></iframe>

I was wondering how we can have the protocole seperated to depend on http or https I know the way to do in backend but on static blocks I am not sure.


texts: How to pull in Magento 2 dev change into standard release

texts:
I'm using Magento CE 2.1

There's a fix in the 2.2.x develop branch that looks likely not to be released until 2.2, so how do I pull it into my 2.1 installation?

What I have tried

As Magento 2 is split into modules pulled in by composer I would hope that I could just pull in an updated version of a module like module-deploy by using a version like 100.2.0-dev. I replaced using the monolithic magento/product-community-edition with the individual module requirements and changed the requested version of module-deploy. Sadly, the magento composer repo only has formal releases.

So the next thing would be to fork the module and pull in my own version for that module. However, Magento 2  seems to be a single repo, so what should I fork to just adjust a single module? Does this approach even make sense?


texts: applying layered navigation to CMS page filled with new products

texts:
Can't seem to get it to show up.

This is how it's defined in layout files:

<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>

it's located here:

  /app/design/frontend/name-space/default/template/catalog/layer/view.phtml

I'm attempting to add it to the CMS page via the Layout Update XML (Layout is 2 columns with left bar) section in the backend using:

<reference name="content">
    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"></block>
</reference>

I've also tried:

<reference name="content">
    <block type="enterprise_search/catalog_layer_view" name="catalog.content" before="-" template="catalog/layer/view.phtml">
</reference>

The former shows nothing at all and the latter shows a single category dropdown that redirects to that specific category page.

Also, the product collection on the CMS page is being loaded by a widget.  Would this have some effect?  In the CMS page Content section is found:

{{widget type="catalog/product_widget_new" display_type="new_products" show_pager="1" products_count="60" template="catalog/product/widget/new/content/new_grid.phtml"}}

The above widget calls a function called _getProductCollection() in order to generate the product Collection of new products:

protected function _getProductCollection()
{
    $todayStartOfDayDate = Mage::app()->getLocale()->date()
        ->setTime('00:00:00')
        ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
    $todayEndOfDayDate = Mage::app()->getLocale()->date()
        ->setTime('23:59:59')
        ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
    /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
    $this->_addProductAttributesAndPrices($collection)
        ->addStoreFilter()
        ->addAttributeToFilter('news_from_date', array('or' => array(
            0 => array('date' => true, 'to' => $todayEndOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->addAttributeToFilter('news_to_date', array('or' => array(
            0 => array('date' => true, 'from' => $todayStartOfDayDate),
            1 => array('is' => new Zend_Db_Expr('null')))
        ), 'left')
        ->addAttributeToFilter(
            array(
                array('attribute' => 'news_from_date', 'is' => new Zend_Db_Expr('not null')),
                array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('not null'))
            )
        )
        ->setPageSize($this->getProductsCount())
        ->setCurPage(1);
    return $collection;
}


texts: How to modify array of product collection before rendering category page?

texts: I trying to figure out how to modify some rows in product collection before it will be rendered at category page. I'm digging around getProductListHtml() (module-catalog/Block/Category/View.php) but no success.


texts: {{variable}} not working in product description

texts:
The previous code is included in products description. In frontend the result looks like this:

Does anybody know what could cause something like that?

-----------UPDATE-------------

I found that all variables work this way. They all give the same code:

{{config path="web/secure/base_url"}}

gives

{WWWWW{WWWWWconfig path="web/secure/base_url"WWWWW}WWWWW}

-----------UPDATE 2-------------

I found that this solution works, when displaying product description:

$_description = $this->getProduct()->getDescription();
$_myHelper = Mage::helper('cms');
$_processor = $_myHelper->getBlockTemplateProcessor();
echo $_processor->filter($_description);

It doesn't make sense and it's a temporary solution. But it might give you a clue of what's causing the issue here.


texts: Patch PRODSECBUG-2198 for Magento Enterprise Cloud

texts:
it has been some time after my last experience with Magento 2 and I've been asked to install a security patch, as in the title.

My problem is due to the fact that I've never used a cloud installation and dunno which steps to follow (and also last time I've been using Magento 2 I do not remember any patch to install).

In the guides it is suggested to upgrade ECE-tools  to version 2002.0.17
but trying to add them in the composer.json has not worked.

{
"name": "magento/project-enterprise-edition",
"description": "eCommerce Platform for Growth (Enterprise Edition)",
"type": "project",
"version": "2.1.7",
"license": [
    "proprietary"
],
"repositories": [
    {
        "type": "composer",
        "url": "https://repo.magento.com/"
    },
    {
        "type": "git",
        "url": "...."
    },
   .....
    {
            "type": "git",
            "url": " ...."
    }
],
"require": {
    "magento/product-enterprise-edition": "2.1.7",
    "composer/composer": "@alpha",
    "myproject/module-landingpage": "1.0.*",
     ......
    "myproject/module-advancedinventory-rewrite": "dev-master",
    "magento/ece-tools": "2002.0.17"
},
"require-dev": {....},

How can i apply the patch in this kind of environment?

I'm confused and never used cloud version of Magento. It should be actually hosted on Amazon AWS.

Thank you in advace for any hint.


texts: Magento 2 refresh checkout page clearing the cart

texts: In checkout page, if the page got refreshed on the browser (F5) or by any other way like re visiting the checkout link, it is clearing the items from the cart


texts:
When we try to print an invoice from the Magento admin panel, we get this error message:

  Fatal error: Declaration of
  Zend_Pdf_FileParserDataSource_File::__construct() must be compatible
  with Zend_Pdf_FileParserDataSource::__construct() in
  /var/www/html/includes/src/Zend_Pdf_FileParserDataSource_File.php on
  line 41

We tried to apply the changes suggested in another StackOverflow answer, but we got a blank pdf invoice file.

We are using Magento 1.8 on PHP 5.4.40.

Kindly advise us on how to resolve this issue.


texts: How do I change the sort order of the left menu blocks in the admin backend?

texts: I want to re-order the menu blocks so the ones that almost never used are far down the page. I have read numerous posts here and on other sites, however I do not see a single unified answer. The answers range from dealing with the local.xml file to adminhtml. The image below is the current sort order. I want to be able to control the location of each block.


texts: Magento2 Google analytics Conversion data on success page

texts:
I have a magento2.2.5 based website and even though I have Google analytics and adwards enabled I dont see conversion data.

So I spoke with google and was given the below code. However I do not know how to look through purchased items on the order success page and looking for suggestions??

 //getting order data
   $order = Mage::getModel('sales/order')->load($this->getOrderId());
   $grandtotalis = $oOrder->getGrandTotal();
   $grandtotalis = number_format($grandtotalis, 2, '.', '');
   $shipping = $oOrder->getShippingAmount();
   $tax = $oOrder->getTaxAmount();
   $store = Mage::app()->getStore();
   $thestorename = $store->getName();

<!-- Global site tag (gtag.js) - Google Ads: 789798816 -->

  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'abcdefg');

 <!-- Event snippet for Sales Conversion New conversion page -->
 <script>
    gtag('event', 'conversion', {
         'send_to': 'ffff',
         'value': <?php echo "$grandtotalis"; ?>,
         'currency': 'USD',
         'transaction_id': '<?php echo $block->getOrderId();?>'
    });
 </script>
 <script type="text/javascript">
    ga('require', 'ecommerce');
    ga('ecommerce:addTransaction', {
       'id': '<?php $block->getOrderId(); ?>',   //Transaction ID. Required.
        'affiliation': '<?php echo "$thestorename":?>',   // Affiliation or store name.
        'revenue': '<?php echo "$grandtotalis";?>',               // Grand Total.
        'shipping': '<?php echo "$shipping";?>',                  // Shipping.
        'tax': '<?php echo "$tax";?>'                     // Tax.
   });

    ga('ecommerce:addItem', {
       'id': '<?php $block->getOrderId(); ?>',       // Transaction ID. Required.
       'name': 'Fluffy Pink Bunnies',    // Product name. Required.
       'sku': 'DD23444',                 // SKU/code.
       'category': 'Party Toys',         // Category or variation.
       'price': '11.99',                 // Unit price.
       'quantity': '1'                   // Quantity.
    });

   ga('ecommerce:send');
</script>


texts: Magento 2 Add new Checkout Step with Checkout Cart Item table

texts:
Everyone! I hope you are doing well.

I need your help in Magento 2 Checkout page customization. I am writing down simple explanation so that I can get help from you guys.

Requirements:
I needed to add new Checkout Step 'Cart' which was supposed to have Checkout Cart Item table and Summary.

Implementation:
I have added a new step in the checkout page which has a 'Next' button to go to the next step which is 'Shipping'. I want to add the content below in the step.

Problem:
I need to display the checkout cart under the New Custom Step.

checkou-cart.html ->

`

        <form data-bind="submit: navigateToNextStep" novalidate="novalidate">

                    <button data-role="opc-continue" type="submit" class="button action continue primary">

                    </button>

        </form>

 `

I have also created mixins.

Question:
Please help me how to Add the Cart in the checkout step.

Any way of doing this?


texts: How to access the files on a Magento site

texts:
A client of mine has a Magento site set up, I've been asked to help them out with the SEO. I've never used Magento before, didn't even know that it exists. I need to find the actual files so I can start making edits to the code. There is a number of errors and faults related to SEO on the site that needs to be changed.

I thought that Magento would have some sort of file directory so I can edit them.

Any help on this would be great.

It wouldn't let me post a comment, so I'll add the version here
the version is 1.9.1.0

Thank you


texts:
I am trying to display Minicart in header but FPC (Magento Enterprise default FPC) is caching it and Minicart is not updated when I am navigating to category or CMS pages.

        <reference name="header">
            <block type="checkout/cart_minicart" name="custom_minicart_header" template="checkout/cart/minicartHeader.phtml" />
        </reference>

Then I am calling this block in my header.phtml

echo $this->getChildHtml('custom_minicart_header');

I am using EE header minicart only as I have some design changes so I have created a custom template for minicart. rest all the things are same. Even when I am switch my store to default rwd theme which has the built in minicart, then also I am getting the same issue and minicart in header is getting cached.

How can I make this block not to being cached by FPC?


texts: How to set price in proper format in email template in magento-2.2.7?

texts:
I am using magento-2.2.7. In email template, price subtotal and grandtotal is showing like that 0.5000000000045 .How to change this price in proper format. Please help me to solve it. I want to share screenshot as follow :
https://paste.pics/67A5H


texts: Creating custom module in magento2 admin grid shows fatal error

texts:
a:4:{i:0;s:562:"Recoverable Error: Argument 3 passed to yyy\xxx\Controller\Adminhtml\Items::__construct() must be an instance of Magento\Framework\View\Result\PageFactory, instance of Magento\Backend\App\Response\Http\FileFactory given, called in magento2/var/generation/yyy/xxx/Controller/Adminhtml/Items/Index/Interceptor.php on line 15 and defined in magento2/app/code/yyy/xxx/Controller/Adminhtml/Items.php on line 22";i:1;s:5398:"#0 magento2/app/code/yyy/xxx/Controller/Adminhtml/Items.php(22): Magento\Framework\App\ErrorHandler->handler(4096, 'Argument 3 pass...', '/home/exdev/dom...', 22, Array)

this is my code

    <?php

/**
 * Copyright Â© 2015 Orange. All rights reserved.
 */

namespace yyy\xxx\Controller\Adminhtml;

/**
 * Items controller
 */
class Items extends \Magento\Backend\App\Action {

    public $_coreRegistry = null;
    public $_resultPageFactory = null;
    public $_resultRedirectFactory = null;

    public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Framework\Registry $coreRegistry,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->_coreRegistry = $coreRegistry;
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }
protected function _initAction()
    {
        $this->_view->loadLayout();
        return $this;
    }

public function execute()
    {

    }
}


texts: Missing Product scope after create websites/stores/storeviews via Data/Patch - Magento V2.4 Enterprise

texts:
I faced an issue. After create script Data/Patch to create multi websites/stores/storeviews. At dropdown of Scope Product, i dont see new websites/stores/storeviews, in spite of it has in configuration tab.
Please, show me my mistake.
This is my code :

When edit a product, we can see Product Scope section, it's on the top-left screen. After all, It only show "Default" value


texts: Magento 2 : How to save database column value in a variable

texts:
Following is my table structure

How to save the 'value' column in a variable.
I used following code:

$this->_resources = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\App\ResourceConnection');
    $connection= $this->_resources->getConnection();
    $tableName = $this->_resources->getTableName('customer_entity_varchar');
    $sql2 = "SELECT value FROM customer_entity_varchar WHERE `entity_id`='$suser_id'";
    $result1 = $connection->fetchall($sql2);
    return $result;


texts: Magento 2 configurable complicated products

texts:
Is there an option that I can make a products as this example:
 - products has 4 size's
 - each size have 4 colors
 - the price depends on the size
 - the quantity depends on the color of the choosen size (meaning each size has it's own quantity depending on the choosen color by the user)

To be more clear maybe the user goes like this:
Choosing his product > choosing size from dropdown > depending on the choosen size he will see the available colors where each of them has it's own quantity and as mentioned before the price will be calculated by the choosen size and that  counts for each size.


texts: How does the offline mode works in Magestore and XPOS?

texts:
It's a big pleasure to "virtually" meet you!

Anybody of you have details regarding how Magestore or XPOS work in offline mode?
Which are the functionalities available?

Thanks a lot in advance!


texts:
How to call custom block in header any help will be appreciated .

 <referenceBlock name="logo">
     <block class="Magento\Cms\Block\Block" name="help">
        <arguments>
            <argument name="help" xsi:type="string">promo</argument>
        </arguments>
       </block>
 </referenceBlock>


texts: How can I change the menu tab title? (mobile version)

texts: I use Luma theme and I tried to figure out and manage it from default.xml but it didn't work. I need to change the name od tabs and add new links in tab. Where I can find it inside file?


texts: Magento 2: Change Error message First Name field in Shipping Address

texts:
I want to change error messages in Shipping address form to more descriptive on onepage checkout page. For example, I want to change This field is required to First Name is required.

I am not able to find where these fields are being added in the code. I do see <!-- ko foreach: getRegion('additional-fieldsets') in form.html but cant find First and last name in additional-fieldsets in layout.xml files.

I also created a Model/Layoutprocessor.php in a module but and I am able to override label but not the error messages.


texts: How to downgrade magento enterprise to community?

texts:
I want to migrate magento enterprise 2.2.7 to community 2.2.7, so anyone have steps for that.

I used this link but its not sufficient.
Link >> https://blog.magepsycho.com/migrate-downgrade-magento-2-from-enterprise-to-community-edition/


texts: How to refresh minicart section from observer?

texts:
I am moving cart items to wishlist when store is switched using below code:

etc/frontnend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch">
        <observer name="mymodule_move_cart_to_wishlist" instance="Vendor\General\Observer\MoveCartToWishlist" />
    </event>
</config>

Vendor/General/Observer/MoveCartToWishlist.php

<?php
namespace Vendor\General\Observer;
// use statements

class MoveCartToWishlist implements ObserverInterface
{
    public function __construct(
        // dependencies
    )
    {
        // variable assignment
    }

    public function execute(Observer $observer)
    {
        // logic to move cart items to wishlist
    }
}

As per my logic cart items are moved to wishlist successfully.

Now, how I can refresh minicart section from my observer ?


texts: How can I insert JavaScript into the home page upon newsletter subscription confirmation?

texts:
I'm implementing Facebook Conversion Tracking code. I've been instructed to insert the Facebook surveillance JavaScript onto the newsletter subscription confirmation page. But on the website, there is no "confirmation page", just a confirmation message that Magento displays in the header of the home page upon successful confirmation (which I've found is displayed using addSuccess() in code/core/Mage/Newsletter/controllers/SubscriberController.php).

To insert the same code on the purchase confirmation page, I've been able to able Anaraky's GPL-licensed GDRT extension, which creates a Block and uses $this->getData('pageType') on a class that extends Mage_Core_Block_Abstract to only insert the block on the desired page.

e.g. in a custom module, app/code/local/Alleyne/FCT/Block/Script.php

class Alleyne_FCT_Block_Script extends Mage_Core_Block_Abstract {
  // [snip]
  protected function _toHtml() {
    $type = $this->getData('pageType');
    if ($type == 'purchase') {
        // return JavaScript...
    }
  // [snip]
}

But for the newsletter confirmation, I can't just filter by page type -- I only want to trigger it when the newsletter subscription action is taking place (which happens to be on the home page).

Do I need to override Mage_Newsletter_SubscriberController::confirmAction() to output the desire JavaScript? If so, how? If not, what's a more reasonable approach?


texts: Magento 1.9 alert emails not being translated

texts:
I have configured price alerts for a client (which originally registered into my shop with spanish language).

The user receives the email, but it is in english.

For instance, the text: "You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:" (in ./app/design/frontend/base/default/template/email/productalert/price.phtml) is not being translated to spanish.

I have checked and the translation is present in ./app/locale/es_ES/Mage_ProductAlert.csv:
"You are receiving this notification because you subscribed to receive alerts when the prices for the following products changed:","Usted está recibiendo esta notificación porque está suscrito para recibir alertas cuando los precios de los siguientes productos cambien:"

I am using a custom theme.

I have also tried to add that translation to my theme: app/design/frontend/mytheme/default/locale/es_ES/translate.csv

I have flushed translations cache and deleted Magento cache. Still not being translated.

Is this a bug? How can I fix it? How can i debug it?

Thanks in advance.

EDIT: BUG SOLVED
Ok, I found the fix thanks to
Cron job template block not being translated, but testObserver is

What I did:
1) Edit app/code/core/Mage/ProductAlert/Model/Email.php

Replace this (line 255):

       $appEmulation = Mage::getSingleton('core/app_emulation');
       $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

With this:

        $appEmulation = Mage::getSingleton('core/app_emulation');
        $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
        //Dealing with uninitialized translator!
        Mage::app()->getTranslator()->init('frontend', true);


texts: How can I override complete or full js file in magento2

texts:
I want to override full js file instead of js components or widgets
When I try to place the file in my custom theme with the appropriate  path, still it's getting deployed from vendor not from override one.

I want it to be deploy from my custom theme,
app/design/frontend/Custom/Theme/Magento_ConfigurableProduct/js/configurable.js

After setup:static-content:deploy it's still creating from vendor

pub/static/frontend/Custom/Theme/en_US/Magento_ConfigurableProduct/js/configurable.js this is generated from vendor


texts: category url redirect to custom controller - magento 2

texts:
I have add one category from backend, I need to redirect that category url to custom module controller(chennaievent\index\index).

<?php
namespace Gworks\Chennaievent\Observer;
use \Magento\Framework\Event\Observer;
use \Magento\Framework\Event\ObserverInterface;

class Redirect implements ObserverInterface {
    protected $_responseFactory;
    protected $_url;

    public function __construct(

    \Magento\Framework\App\ResponseFactory $responseFactory,
    \Magento\Framework\UrlInterface $url
    ) {
    $this->_responseFactory = $responseFactory;
    $this->_url = $url;
    }

    public function execute(Observer $observer) {
         $category = $observer->getEvent()->getCategory();
       if($category->getId()=='115'){
     $controllerAction=$observer->getEvent()->controllerAction();
     $RedirectUrl= $this->_url->getUrl('chennaievent/index/index');
     $this->_responseFactory->create()->setRedirect($RedirectUrl)->sendResponse();
       exit();
    }
    }
}

when I click newly added category its redirect to page not found(404) without URL change,I have tried without single quotes also getId()==115

How could I achieve category url redirect to custom controller?

Thanks.


texts: how to create cart rule for buy any two at 500rs in magento 2?

texts:
I want to cart rules on purchase of any two product at 500. Please anyone suggests me how to do this.

Two product total price doesn't matter but discount amount reflect and set the final price 499


texts:
1- How do I deal with this problem

System messages

One or more indexers are invalid. Make sure your Magento cron job is running.


texts:
Just wanted to check. Regarding the revenue report under Reports > Sales > Orders, when I cancel the order, the amount refunded will show on the refunded column right? The "invoiced'' amount is the amount less the refunded amount, correct?

2nd question is if I do a partial refund via Paypal, does Magento automatically detect this and adjusts the invoiced amount on the reports accordingly? Or do I need to do anything? If I need to manually adjust the figure, how can I go about doing it?

Appreciate your help guys!

Thanks, Matt


texts: I want to upgrade Magento from version 1.5.0.1 to 1.7.0.2. How can I do this upgrade manually or via any other method?


texts: Why the bulk update attributes is showing a blank red error message?

texts:
I'm trying to bulk update visibility of all products from Actions > Update Attributes under Catalog > Products menu.

I'm getting this error. Any Idea Why?


texts: Magento 1.9.x: How to change the system so that new orders start from a specific number going up?

texts:
Magento 1.9.4

We just created a brand new Magento store and are going to switch our existing domain to that but we would like to change the order numbers in such a way that the new orders placed would start from the number where we left of on our old Magento 1.9.1 system.

Is there an easy way to do that? We have access to the database via phpMyAdmin in Cpanel.


texts: I want to add pre-defined city in magento?

texts: I want to add cities name on the checkout page so the customer can select their city, i tried searching online but no help till now.