texts: How to get Login or Create Account into a BLOCK?

texts:
I want to add this code in block in this way <block type=""> so that I can call this code using blocks in my local.xml file actually this code is called in header.phtml the below code outputs this see the image but I don't want to display it there but only in particular pages

<div class="right clearfix <?php echo ($cart_pos == 'top' && $switcher_pos == 'top') ? 'header-top-both' : '' ?>">
                <?php if ($cart_pos == 'top') echo $cart_html; ?>
                <?php if ($switcher_pos == 'top') echo $switcher_html; ?>
                <div class="<?php echo $c1 ?>">
                <?php $helper = Mage::helper('customer'); ?>
                    <p class="login-link <?php if ($switcher_pos != 'top' && $cart_pos != 'top') echo 'static' ?>">
                        <?php if ($helper->isLoggedIn()): ?>
                            <a href="<?php echo $helper->getLogoutUrl(); ?>"><?php echo $this->__('Logout');?>
                        <?php else: ?>
                            <a href="<?php echo $helper->getLoginUrl(); ?>"><?php echo $this->__('Login');?> <?php echo $this->__('or') ?> <a href="<?php echo $helper->getRegisterUrl(); ?>"><?php echo $this->__('create an account');?>.
                        <?php endif; ?>
                         <?php echo $this->getAdditionalHtml() ?>

<?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?>


texts: Magento ver. 1.3.1 with MySQL 5.6.35 and PHP 5.6.30. Could it work?

texts:
Magento ver. 1.3.1
Apache Version  2.4.25
PHP Version 5.6.30
MySQL Version   5.6.35 or possibly php55

I had a website running on an old server (with lower pHp and mySQL versions) but I needed to discontinue that server and so I migrated everything to a new server which has the specifications listed above. Now it gives me the Error below:

SQLSTATE[HY000]: General error: 145 Table './mySTORE_shop/log_visitor' is marked as crashed and should be repaired
Trace:
#0 /home/mySTORE/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/mySTORE/public_html/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array)
#2 /home/mySTORE/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
#3 /home/mySTORE/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(259): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
#4 /home/mySTORE/public_html/lib/Zend/Db/Adapter/Abstract.php(535): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#5 /home/mySTORE/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(349): Zend_Db_Adapter_Abstract->insert('log_visitor', Array)
#6 /home/mySTORE/public_html/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor))
#7 /home/mySTORE/public_html/app/code/core/Mage/Log/Model/Visitor.php(157): Mage_Core_Model_Abstract->save()
#8 /home/mySTORE/public_html/app/code/core/Mage/Core/Model/App.php(1167): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#9 /home/mySTORE/public_html/app/Mage.php(301): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#10 /home/mySTORE/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(410): Mage::dispatchEvent('controller_acti...', Array)
#11 /home/mySTORE/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(45): Mage_Core_Controller_Varien_Action->preDispatch()
#12 /home/mySTORE/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(356): Mage_Core_Controller_Front_Action->preDispatch()
#13 /home/mySTORE/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(247): Mage_Core_Controller_Varien_Action->dispatch('index')
#14 /home/mySTORE/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /home/mySTORE/public_html/app/Mage.php(457): Mage_Core_Controller_Varien_Front->dispatch()
#16 /home/garden/public_html/index.php(69): Mage::run('gardenflowerpro...', 'website')
#17 {main}

I have a MultiPHP Manager on the server and it lets me go down all the way to php55.


texts: Magento2: How can We add multiple customer billing address?

texts:
I want to add multiple customer billing address and fetch all customer billing address programmatically.

Please help me in this.


texts: Adding UI for Third Party Category Attributes in Magento 2.1?

texts:
Is there a standard/best practices way to add UI for third party category attributes in Magento 2.1?

In previous versions of Magento 1 and Magento 2, the user interface at

Products -> Categories

would respect the frontend_input values set on the attribute object of the EAV Category object.  However, Magento 2.1 seems to have the UI rendering code with a formal ui_component/category_form.xml that ignores (or seems to ignore?) the frontend_input setting of the EAV objects.

Is there a standard "best practice" way for third party developers to add fields for their custom category attributes?  Or is this an area where we're left to glop around on our own for a solution?


texts: How to write rewrite url for index.php as a request path

texts: I want to write URL rewrite for index.php as a request path and it should be redirected to the home page


texts: In Magento 2.2, How to Place the order after GrandTotal is Rs. 0?

texts:
I have added custom Checkbox under Payment section in Checkout Page for My WalletAmount. When i click the checkbox wallet amount is added in totals section and calculated with GrandTotal (Grandtotal = Grandtotal - Walletamount). After applying WalletAmount, GrandTotal is Rs.0.00. Same time when i click my checkbox, i have Customly Refreshed Payment Section. Now I am getting a message (No Payment Information Required). Then, When i Place the Order, I am getting the ErrorMessage The requested Payment Method is not available.

How to Place the Order using WalletAmount when GrandTotal is Rs.0.00 ?


texts: How to add a custom javascript to theme in Magento 2?

texts:
I have experience with Magento 1, and there adding a custom javascript file was very straightforward and logical.

But when it comes to Magento 2, I can't figure out how to add a new js file, where I would put little code snippets that affect different places around the page.

For example, I want to modify 'last viewed items' block on the home page, and use jQuery there and then maybe another script that changes some CSS dynamically somewhere (for example).

I find it very comfortable to do it in one single file like I used to do in Magento 1. Also, Magento official docs didn't help me since it didn't provide information clear enough.. I guess it has something to do with requireJS but is there another way? If not then can someone explain it a little clearer than Magento official docs did?

PS. Tried adding my custom.js file to head block trough XML, but then I didn't get access to jQuery.

Thanks!


texts: Error 404 not found : when save product in backend with large content data

texts:
I am having a problem saving the product.
Product have 4 attribute input text, when i fill large text ( ~ 5000 line ) to 4 textarea field and click save button, controller response 404 not found.

but if i delete text in 2 or 3 of 4 textarea field, save working.

I have searched a few articles about this and have been told that with php, when posting big data, the server will respond with 404. i increase value memory_limit,post_max_size,max_input_vars but issue still happening .!
sorry my english is not good. please help me. thank you very much!


texts:
Is there a way to mass delete tax rates from Magento backend?

The Magento documentation shows that in Magento GO, each tax rate has a checkbox that you can use to mass delete rates. http://www.magentocommerce.com/knowledge-base/entry/deleting-tax-rates. This checkbox doesn't appear next to tax rates on my Magento Community edition.

When I import new tax rates, they don't overrwite the current tax rates, they create new ones. This has resulted in thousands of tax rates. I want to clear them all out and start from scratch.

Is there a way to edit the database to clean out the tax rate information?


texts: How do I get just the product additional information in the view.phtml template?

texts:
Ho do I do this? I tried this bit of code from the attributes.phtml but it doesn;t output anything.

<?php if($_additional = $this->getAdditionalData()): ?>ewfawef

<?php echo $this->__('Additional Information') ?>

            <col width="25%" />
            <col />

            <?php foreach ($_additional as $_data): ?>

                    <?php echo $this->escapeHtml($this->__($_data['label'])) ?>
                    <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

            <?php endforeach; ?>

    <?php endif;?>

All I want to display is the "additional attributes" table, no description or anything else.

thanks.


texts: If a product is listed in multiple categories, can I track through which category was it added to cart /sold?

texts:
In my Magento 2.1.8 installation, I have few special categories like recommended-by-site-owner AND prices-soon-to-increase. I add few products to these categories on my site every week and remove few others.

I need to track in my orders which product was added to cart from each of these categories or was it added outside of these categories.

If a customer adds a product let's say 'iPhone Darth Vader' casing to a single cart from each of these categories and a third addition from outside of these two special categories. I need to track each category's share in the cart item's quantity.

Can anyone suggest a solution a close-to-requirement extension that I can purchase and customize further.

EDIT :

I also need to track the category if a customer goes to the product detail page from the category page and then adds the product to cart.
I also have a mobile app that is built some another team. I need to provide an API for them as well for this functionality.


texts: Is there any free extension available for designing products label or cover in magento?

texts:
I am looking for a free product designer extension to design personalized photo covers for products like Bags,iPhone,Laptop,Mugs and tablets etc. If anyone knows free extension available in magento store or any other places, please provide me the link or if anyone has extension for designing product cover or label please provide with documentation or if any tutorial available for creating an extension like that?
Thanks in advance.


texts: UpgradeData.php Insert and Delete not working on Magento Cloud

texts:
I wrote a section in UpgradeData.php to insert and delete some values in tables directory_country_region_name and directory_country_region.  Code below,

if (version_compare($context->getVersion(), "1.0.6", "<")) {
    $connection = $setup->getConnection();
    $disallowed = implode(',',[6,7,8,9,10,11,17,30,50]);
    $caFrLocalization = array(array('fr_CA',66,'Alberta'),
        array('fr_CA',67,'Colombie-Britannique'),
        array('fr_CA',68,'Manitoba'),
        array('fr_CA',69,'Terre-Neuve-et-Labrador'),
        array('fr_CA',70,'Nouveau-Brunswick'),
        array('fr_CA',71,'Nouvelle-Écosse'),
        array('fr_CA',72,'Territoires du Nord-Ouest'),
        array('fr_CA',73,'Nunavut'),
        array('fr_CA',74,'Ontario'),
        array('fr_CA',75,'Île-du-Prince-Édouard'),
        array('fr_CA',76,'Québec'),
        array('fr_CA',77,'Saskatchewan'),
        array('fr_CA',78,'Yukon'));

    // Add Canadian localized regions
    $connection->insertArray($connection->getTableName('directory_country_region_name'),array('locale', 'region_id', 'name'),$caFrLocalization);

    // Remove extra US states
    $connection->delete($connection->getTableName('directory_country_region_name'),['region_id IN (?)'=>$disallowed]);
    $connection->delete($connection->getTableName('directory_country_region'),['region_id IN (?)'=>$disallowed]);
}

And module.xml,

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

When I deploy this to the local Magento environment the changes are made as expected.

However when I deploy to the Magento Cloud I do not see the results of this code executing.

This is the script I use to deploy these changes to Magento Local,

rm -rf var/di var/generation
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_CA fr_CA -f
php bin/magento weltpixel:less:generate
php bin/magento cache:flush
sudo chmod 777 var/cache

On the Magento Cloud I just deploy the changes with a git push.


texts:
I am getting error after installing the extension extension link

Error follows

Fatal error: Call to a member function getReadConnection() on a non-object in /home/ppdeec/public_html/bigzaar.com/includes/src/__default.php on line 31647

Anybody knows how to fix this. any help will be appreciable


texts: Full reindex process is already running even after rebooting SQL

texts:
I have tried this solution:

Full reindex process is already running

But that does not work, I still get the same error. The error started because the client server was full.

I have cleared space on the server and removed the lock files. I even tried rebooting the SQL server. (No help)

I cleared my var/ directory of everything.

I restarted Apache

I restarted MySQL (It's on a separate box)

I have tried via command line and Magerun

Here is some output

magerun index:reindex catalog_product_attribute

  Reindex

Full reindex process is already running.

I have tried running the command as root as well

 php indexer.php reindexall
Full reindex process is already running.


texts:
When I add a product to cart , It is not added it throws an error
        "No Such entity with customerId ="
  This Error also shown in My Account page when try to login.


texts: So I'm on Magento 1.6.2 and I am having issues with checkout. For some reasons I am stuck on the first step(Billing) on checkout. Whenever I try and click the continue button checkout will not go to the next step. Can anyone help please?


texts: How to show multiple attribute swatches on product listing page?

texts:
Magento allows showing only a single swatch attribute on the product listing page.
Is there a way to show more than 1 swatch attribute on the  product listing page?


texts: Changing "add to wishlist" to "add to cart" , functionality and text EVERYWHERE GLOBALLY

texts:
What is the best way to change ALL "add to wishlist" in a magento webshop? I want to REPLACE it with "add to cart"

Thanks!


texts: How to force root categories to be collapsed by default when adding new product on Magento 1.7

texts:
Is it possible to have the category tree collapsed when adding new products?

Now the root categories are expanded.

Subcategories are collapsed (this is ok).

How to force root categories to be collapsed by default?

Thank you!


texts: Billing form is not updating in magento 2

texts:
I am trying to updating the checkout forms telephone field validation. I have achieved this for shipping form but in billing form it is  not working.

For this I have done in my di.xml:

<type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
    <plugin disabled="false" name="phone_validation_in_billing_form" sortOrder="100"
        type="vendor\module\Plugin\LayoutProcessor"/>
</type>

And in my LayoutProcessor:

<?php
        namespace vendor\module\Plugin;

        use \Magento\Checkout\Block\Checkout\LayoutProcessor as MagentoLayoutProcessor;

        class LayoutProcessor
        {

            public function afterProcess(MagentoLayoutProcessor $subject, $jsLayout)
            {
            if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                ['payment']['children']['payments-list']['children']
            )) {

                foreach ($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                     ['payment']['children']['payments-list']['children'] as $key => $payment) {

                /* telephone */
                if (isset($payment['children']['form-fields']['children']['telephone'])) {
                    $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                    ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
                    ['telephone']['validation'] =  [
                                    'validate-number' => 1,
                                ];
                }

                }

                }
                return $jsLayout;
            }

            }

But nothing happened. My pluging is invoking because when I var_dump the variables it was showing but not doing anything.

Thanks


texts:
I have created new folder for storing product images and i am trying to store image directly in "product" folder but it is saving in "cache" folder. I dont want to store images in "cache" folder.

Any solution for this ?


texts: Flushing Magento Cache Changes Page Titles

texts:
Here's the objective: Have the site name at the end of page titles using System > Configuration > Design > HTML Head > Title Suffix “- mysitename.com”.

Saving works fine. Changes are live and all is working as it should. Code looks like:

<title>Best products that I have are now in the house. - mysitename.com</title>

Here's the problem: The “Flush Magento Cache” button when selected removes the preferred page titles and the site name becomes the Title Prefix. Code looks like:

<title>mysitename.com: Best products that I have are now in the house.</title>

Thoughts?


texts: How can I add a custom field to an admin form in Magento 2?

texts:
I've created a form in the admin using UI components, so in my view/adminhtml/ui_component/[module]_[entity]_form.xml I have the following:

<field name="configuration">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Configuration</item>
            <item name="formElement" xsi:type="string">textarea</item>
            <item name="source" xsi:type="string">form</item>
            <item name="sortOrder" xsi:type="number">30</item>
            <item name="dataScope" xsi:type="string">configuration</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>

Now I don't want this value to be a textarea, but I want to create my own HTML magic in the backend for this value. This 'HTML Magic' will eventually be a lot of JS/KnockOut that under water still sends some hidden data when posting the form, so it needs to be part of the form. I tried adding a rendered by adding:

<item name="renderer" xsi:type="object">Vendor\Module\Block\Adminhtml\Renderer\Configurator</item>

But this still renders the textarea. Then I tried replacing the formElement with a custom class like so:

<item name="formElement" xsi:type="object">Vendor\Module\Component\Form\Element\Configurator</item>

But then I get the error:

The requested component ("Vendor\Module\Component\Form\Element\Configurator") is not found. Before using, you must add the implementation.

So 2 questions here:

Is this the right way to add a custom form element to an admin form? (and if so: how?)
Regardless of anything: how can I add the implementation? I'm digging through the UI-module to see how they did it, but I can't find anything.


texts: Override the private function getConfiguredUsedProductCollection()

texts:
I'm trying to override a private function in Magento\ConfigurableProduct\Model\Product\Type\Configurable.

I want to remove the line:

->addFilterByRequiredOptions()

private function getConfiguredUsedProductCollection(\Magento\Catalog\Model\Product $product)
{
    $collection = $this->getUsedProductCollection($product);
    $collection
        ->setFlag('has_stock_status_filter', true)
        ->addAttributeToSelect($this->getCatalogConfig()->getProductAttributes())
        ->addFilterByRequiredOptions()
        ->setStoreId($product->getStoreId());
    $requiredAttributes = ['name', 'price', 'weight', 'image', 'thumbnail', 'status', 'media_gallery'];
    foreach ($requiredAttributes as $attributeCode) {
        $collection->addAttributeToSelect($attributeCode);
    }
    foreach ($this->getUsedProductAttributes($product) as $usedProductAttribute) {
        $collection->addAttributeToSelect($usedProductAttribute->getAttributeCode());
    }
    $collection->addMediaGalleryData();
    $collection->addTierPriceData();
    return $collection;
}

Any idea how to achieve this?


texts: Magento2: How to Modify DropDown Country options on the fly?

texts:
I need to create a restriction for the
Billing [Country_Id] options

Based on a new Config. Setting that Pairs a Customer-Segment with specific
Billing Country options.

I found:

  vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php::process()

I tried Testing on this code directly before making a plugin to hook into it at line:

$elements = $this->convertElementsToSelect($elements, $attributesToConvert);

I then logged the results of $elements I can see the list in the log gets trimmed to only the options I need. (Yikes!)

However when it renders on the frontend (After cache/generated folder cleared) It does render the default options selected originally in admin panel country allowances and ignore all my changes.

Any help is appreciated.


texts: Magento 2 Get Email to Friend URL using Product ID

texts:
I have to get Email to Friend URL using Product ID Using Object Manager.

Can anyone any idea of it?


texts: The best way to replace die and echo magento 2.1.8

texts:
I'm running phpcs which is code sniffer for magento 2. and I got this error from it :

 ERROR | Use of echo language construct is discouraged.
 ERROR | Use of die language construct is discouraged.

When I looked into the code I found that the class controller has echo and die like this :

public function execute()
    {
        $json_encode = array();
        $itemId = (int)$this->getRequest()->getParam('item_id');
        $error = 0; $msg_error = "";
        try {
            $this->sidebar->checkQuoteItem($itemId);
            $this->sidebar->removeQuoteItem($itemId);
            $json_encode["sub_total_html"] = $this->_blockCart->renderTotals();
            $json_encode["items_count"] = $this->_blockCart->getQuote()->getItemsCount();

            /* render Order Total block on checkout/cart  */
            $grand_total = $this->_blockCart->displayBaseGrandtotal();
            $json_encode["grand_total_html"] = $this->_layoutFactory->create()
                        ->createBlock('Magento\Checkout\Block\Cart\Totals')
                        ->setData('grand_total', $grand_total)
                        ->setTemplate('Cmsmart_Ajaxcart::module-checkout/cart/totals/grand-total.phtml')
                        ->toHtml();

            /* return $this->jsonResponse(); */
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            $error = 1;
            $msg_error = $e->getMessage();
           /*  return $this->jsonResponse($e->getMessage()); */
        } catch (\Exception $e) {
            $error = 1;
            $msg_error = $e->getMessage();
            /* $this->logger->critical($e);
            return $this->jsonResponse($e->getMessage()); */
        }
        $json_encode["error"] = $error;
        $json_encode["error_msg"] = $msg_error;
        echo json_encode($json_encode);
        die;
    }

I found somewhere that to replace echo and die use setBody() so I changed it the code above replacing echo and die like this :

$this->getResponse()
    ->clearHeaders()
    ->setHeader('Content-Type', 'application/json')
    ->setBody($json_encode);

This is solution from this link

But it breaks the behavior in the front-end because I'm using Ajax.
Any idea ? I also added exit at the of the setBody() but still it freezing.

Note that this code is snippet from cmsmart


texts: How to remove base url from layout argument

texts:
I am using layout argument in path but it display with base url like

<block class="Magento\Framework\View\Element\Html\Link"  name="search-mini-text">
                    <arguments>
                        <argument name="label" xsi:type="string" translate="false">Search Products..</argument>
                        <argument name="path" xsi:type="string" translate="false">javascript:void(0)</argument>
                        <argument name="class" xsi:type="string" translate="true">search-mini-text</argument>
                   </arguments>
                </block>

When I add this it display like this

Search Products..

Expected result should be

Search Products..

But i woluld like to display javascript:void(0) instead.

How can i exclude baseurl in path argument


texts: Skip a column in CSV import (multisite data)

texts:
I need to import products from a CSV which contains multiple prices for different stores. This is an example of my CSV structure:

store,websites,sku,name,price,wholesale_price,cost,...
admin,"base,usa",testproduct1,"Test Product 1",100,50,30,...
usa,,testproduct1,,120,70,50,...
admin,"base,usa",testproduct2,"Test Product 2",50,30,20,...
usa,,testproduct2,,60,40,30,...

This imports the products correctly, along with the different prices for each product, but it also sets each attribute in my second store (USA) to an empty string rather than leaving it as "use default". I could resolve this by including all of the product data on the second line, where I include the pricing for the USA store, but this could cause problems if an attribute like the product name needs to be changed - the change would need to be made for each store view which could get very annoying!

I'm wondering if there's any way I can tell Magento to skip importing a certain column - so for the lines where I'm just bringing in the pricing info for the USA store, all other attributes are left as "use default".

I'm on Magento CE 1.7.0.2.

Thanks!


texts: Can't update product value after update attribute's label

texts:
So, I updated the "product_length" label attribute and now I can't save a new product value to this attribute.
I can't save this value by admin or programatically.

$_product = Mage::getModel('catalog/product')->load(12448);
$_product->getData('product_length'); // '195'
$_product->setData('product_length', '29');
$_product->save();
//
$_product = Mage::getModel('catalog/product')->load(12448);
$_product->getData('product_length'); // '195'

New products (that are created after the attribute update) works fine.

I already tried reindex all, disable and enable flat tables, clear cache (redis and files) and nothing works. There's nothing in exception.log or system.log.

Somebody help me, please! =)


texts:
I made a product script import and I can't add images for products.
I used this to import images:

    $product = Mage::getModel('catalog/product');
     try{
       .....
    ->setMediaGallery (array('images'=>[], 'values'=>[])) //media gallery initialization
    ->addImageToMediaGallery('/media/catalog/product'.$image,['image','thumbnail','small_image'], false, false) //assigning image, thumb and small image to media gallery
     ......

    $product->save();

}catch(Exception $e){
    echo '<pre>';var_dump($e);

}

I used this: $path='media/catalog/product'.$image; for testing and it returns me this path:  media/catalog/product/1/3/131-kio-6913_1.jpg and this is the real location, where my pictures are saved.

When I run the script, I received this message: "Images does not exist", even the image it's there.

My machine run on windows and I checked the permissions and everything looks fine.
Does anyone why I have this issue?


texts: Overriding Product Image on Product Detail without overriding media.phtml

texts:
I am using magento 1.9.2.1

I am working on functionality in which I need to change Product Image Dynamically from third Part extension, It can be easily done using overriding media.phtml file.

But I am seeking for another method that can override block Mage_Catalog_Block_Product_View_Media or something like that can avoid me to change or interact with .phtml files.

EDITED

Actually, I want to give more about my Question, actually I want to change on Product Detail page without any changes in template section, or without adding or overriding any phtml file.

please let me know, Is this possible? if yes, then,Iin what way i can do this?


texts: Magento 2 - Grunt Watch in Vagrant Environment

texts: I'm running into this issue where when I ssh into my Vagrant VM and run grunt watch while editing css, it totally boggs down my system.  I hear the fan speed up and if left running, my VM grinds to a halt.  The workaround I've been using is to only run the task when I need to make a change, and then when it completes, I end the task.  My question is, is there any way I can just run grunt watch on my host machine?  I try to do this and it doesn't see any changes at all.  Part of me thinks it has something to do with the symlinks from pub/static to my working files.  Has anyone ever ran into this issue?


texts: Change placeholder text color in Magento 2 search box

texts:
Attempting to change the placeholder text color found in the search input box of Magento 2. The solution listed below worked properly for Magento 1, however I havent found any documentation on how Magento 2 handles this.

#search::-webkit-input-placeholder { color: #0000ff; }
#search::-moz-placeholder { color: #0000ff; }
#search:-ms-input-placeholder { color: #0000ff; }


texts: Cookie to display popup only one time on homepage

texts:
I want to set a cookie to display my popup only one time on the homepage. Any suggestions how can I do that?
Here is the code of , my newsletter popup

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"><body>
<referenceBlock name="head.components">
    <block class="Magento\Framework\View\Element\Js\Components" name="newsletter_head_components" template="Magento_Newsletter::js/components.phtml"/>
</referenceBlock>
<referenceContainer name="footer">
    <block class="Magento\Newsletter\Block\Subscribe" name="form.subscribe" as="subscribe" before="-" template="subscribe.phtml"/>
</referenceContainer></body>


texts: Persist customer session addSuccess message to second screen

texts:
I have created a module that is listening to the customer registration event 'customer_login'. This event is dispatched after the customer has registered on the site and the site is revving up to redirect them to the customer dashboard.

My module is then logging the customer out and setting a success message:

Mage::getSingleton('core/session')->addSuccess('Thank you for registering with %s. Your account needs to be activated by an administrator.', Mage::app()->getStore()->getFrontendName());

When the site then redirects the dashboard, it checks if the customer is logged in (false) so redirects the user to the registration form again. What appears to be happening is that the success message above is being cleared in the customer dashboard so not surviving back to the registration page.

How do I get my success message to persist to the second page?

As well as the above, I have also tried customer/session but that did not work either.


texts: how to override prepareform in adminhtml folder using magento 2.1?

texts: I want to override protected prepareform() method because I want to add new fields so how to override it.


texts: How to create empty collection in magento 2

texts:
Cannot find it anywhere.

Basically, I try to pass empty collection to my view if query parameters are not sufficient without actually querying database. I mean for example if my custom search requires parameter s to have more than three characters. If parameter is shorter I can return empty collection.

I don't want to do stupid thing like adding where statements like entity_id==1 && entity_id1!=1


texts: How to create table database and data saving into the table in Magento 2

texts: I want to add a table into the database and get input from a custom form


texts:
I've been having an issue lately when trying to save products in Magento, we run into a max execution time error. The error gives one of two lines that it errors out on, either:

$ids = $ids + $this->_getTagIds($tag);

or

return explode("\n", $ids); - which is within the function _getTagIds

within the file /lib/Mage/Cache/Backend/File.php

Does anyone know where to begin troubleshooting this? This didn't happen before about a week ago. I've been bumping up the max_execution_time to see what the limit is but haven't reached it yet and putting an excessive max_execution_time on the server isn't a great solution. Additionaly, this product that I'm trying to save has no tags associated with it, so there shouldn't be an overload getting tag IDs for the product.


texts: Order "Items to ship" not displaying items cannot submit shipment

texts:
Having a problem with orders where if I select an order & then go to the ship page it does not display the product at the bottom & I cannot submit shipment.
Was ok until I turned off Redis cache & went back to Magento cache because of a separate problem.  Flushed Magento cache, logged out/in, deleted var/cache & var/sessions, turned Redis back on but still the same.
Cant seem to find anything similar so could really do with some help.
Thanks

Any One?


texts: Yaad Payment Gateway Development for Magento 1.9.2

texts: Can any one know about Yaad Payment Gateway for magento?


texts: Magento is looking for front end files in the install directory instead of pub/static/

texts: I am at a loss on how to fix this. This is after an upgrade to 2.1.16, setup:upgrade , setup:di:compile, and static-content-deploy. I've also done cache clears and flushes.


texts: Sure post in Magento's built in UPS Integration

texts:
Last Year our company decided to offer UPS Surepost as a discreet shipping option before UPS got around to adding it as an option in their Rating API.

To work around this, and still give customers accurate shipping rates i ended up having to use WebShopApps MatrixRates extension to build a massive cumbersome csv file mapping destination zip code (generalized to the first 3 or 2 digits) to price.

This is not an ideal long term solution.  To keep it up to date with UPS's rate and fuel surcharge changes requires a good deal of work every few months.

It looks like UPS has finally added surepost into their api.

Is Enterprise 1.13 able to display surepost rates without any additional custom development?


texts:
In magento checkout page, under "shipping address", we can see textfield "ZIP/POSTAL CODE"

I want to display that "ZIP/postal code" textfield in product view page.


texts:
I installed Magento2 trough Composer. I'm running a OS - Ubuntu16.04 with Nginx + MariaDb + php7. Database 'cb100' is already created in MariaDb;

When I type the url cb100.com I dont have any error. I'm just being redirected to cb100.com/setup/. I have a white page and a Magento favicon in the tab.

So I assume that something is working good, and something don't.

When I check my Nginx Log file this is what I have:

could not find named location "@handler", client: 127.0.0.1, server:
cb100.com, request: "POST /setup/index.php/session/prolong HTTP/1.1",
host: "cb100.com", referrer: "http://cb100.com/setup/"

I have no more clues.

Any missed configuration to Nginx ?

Note: NginX uses www-data group to run files inside the server. So I sit all files and folders inside bc100.com/ to be at the same group.

chown -R ila:www-data /cb100.com.


texts: M2.3 - Customer has a product in their basket that is out of stock Now unable to add any product to cart

texts:
Magento 2.3.3
If the customer has a product in their cart that is out of stock (gone out of stock since they added it to their cart) they can not add other products to their cart. When they try to add other products to the cart they just get the error that says the (other) product is out of stock and nothing is added to the cart.
Example:
So the customer already has "Product 1" in their cart which is now gone out of stock, then they try to add "Product 2" to their cart. They get this:

We don't have as many "Product 1" : "Size" - "6" as you requested (available qty: "0").

Product 2 is not added to the cart.
Any one seen this before?


texts:
We have number of categories/sub-catgories and products assigned to them in our Magento store.

Is it feasible to make sure that specific category landing pages / product detail pages cannot be indexed by search engines ?

For ex:

http://mysite.com/category_1/sub-category_1.html

is indexed by search engines, while

http://mysite.com/category_2/sub-category_2.html

cannot be indexed by search engines.

The same goes for product details page.

We do not want specific list pages or product detail pages to show up in Google, Bing, etc search results.

How can I achieve this ?

Thanks in advance.


texts: Load custom js when user reach payment information in magento 1.9 checkout

texts:
I'm working developing a Magento 1.9 extension and I'm having a hard time trying to load/include a Javascript file in a specific checkout step.

I'm able to include the javascript file in the footer, but I need it to be included when the user reach the "Payment Information step", more precisely, when the payment methods are loaded, as shown in the below print screen.

I added this code in my extension hoping it would show an alert message when I reach the "Payment Information", but nothing happens...

<checkout_onepage_paymentmethod>
    <reference name="head">
        <action method="setText">
            <text><![CDATA[<script type="text/javascript">alert('hello')</script>]]></text>
        </action>
    </reference>
</checkout_onepage_paymentmethod>

Thanks for any help


texts: Magento 2, How to create API for customer forget password?

texts: Using Magento, API. I need to create an API for customer send forget password. I found the page that allows to customer send e-mail for request change password but I don't how to use this page for web service.


texts: Unable to get access_token for Magento2.0

texts:
I am doing OAuth1 authentication for Magento2.0. I am referring this doc: https://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-oauth.html.

I am trying to do this using Postman. I have followed steps mentioned in : Magento 2: Where does the oAuth verifier token come from

1. Get request token: I could get it using Consumer key and consumer secret generated by integration and POST /oauth/token/request.

Response was: oauth_token=xxxxx&oauth_token_secret=xxxxx

2. Get oauth_verifier: Got the oauth_verifier using POST http://mywebsite.com/rest/V1/integration/admin/token.
Used consumer key,consumer secret, request token and request token secret along with payload: { "username":"myemail@domain.com", "password":"mypassword" }

3. Get access token: When I try to get the access token I face some issues. Added oauth_verifier to Authorization Header.

Authorization: OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="your_consumer_key", oauth_version="1.0", oauth_timestamp="1482575080", oauth_nonce="2142790194", oauth_verifier="THE_OAUTH_VERIFIER_YOU_RECEIVED", oauth_token="your_oauth_request_token", oauth_signature="HMAC-SHA1_SIGNATURE_GENERATED_BY_POSTMAN_CLIENT"

I tried POST /oauth/token/access by 2 ways:

1. Using online curl tool: I got "oauth_problem=OAuth+version+%5C%221.0%5C+is+not+supported" error.

2. Using Postman: I got "oauth_problem=Token+verifier+and+verifier+token+do+not+match" error.

I searched for these errors but could not get much information.

Any help on this would be appreciated.


texts: I can't find any endpoint to update / change the MSRP of a product, am I missing something ?


texts: Get the shipping method of each order for a customer

texts:
I am trying to get a list of all the shipping methods a customer (by ID) has chosen for each order.

So if a customer has made 3 orders, I want to return:

  1)  Check / Money
  2)  Credit card
  3)  Check / Money

(For example)

I am getting lost in the resource models and collections...
I tried this:

$orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect('*')
        ->addFieldToFilter('customer_id', $customer->getId())
        ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
        ->setOrder('created_at', 'desc');

    foreach ($orderCollection as $_order){
        $shipping_method = $_order->getShippingMethod();
    }

But its not working


texts: Different Product Pages Displayed when I Change URL Key From admin panel

texts:
I am using Magento 2.2.2 and facing an issue and trying to resolve it,While creating a new product or editing already added product when i change URL key of the Product from SEO block i get two different views On frontend on product page.

For e.g.:-1)If i enter my URL KEY as:-Alive - Fine Quality Cotton Mens Collared Neck T-Shirt it gives me following view on product page:
Case 1)Url:-https://www.fabrikaa.com/alive-fine-quality-cotton-mens-collared-neck-t-shirt

which is correct.

Case 2)But,If i enter any other URL KEY let's Say alive then it gives me following view:- Url:-https://www.fabrikaa.com/alive which is

incorrect.

Now what i want to do is whatever i enter in Url key i should get view as i am getting in Case 1,how to fix this?
Any help would be appreciated.


texts: When loading product by id how to handle invalid product id error

texts:
What is the best way to check whether product id is incorrect/not available?

Currently I'm doing it this way,

$product       = Mage::getModel('catalog/product')->load($productId);
$productIdMage = $product->getId();
if ( !isset($productIdMage) || $productIdMage == "" ) {
    Mage::getSingleton('core/session')->addError('This Product is not available.');
    $this->_clearShopingCart();
    $this->_redirect('checkout/cart');
    $errorStatus = false;
}


texts:
My script is working "fine" ... almost, quiet often skipping orders created around 00:00 -> 01:00
Asked server administrator, he confirmed the time (correct), checked timezone etc.
What can cause this issue ? there is no magic in it so i'm confused ...

$torders = Mage::getModel('sales/order')
        ->getCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToSort('increment_id', 'DESC')
        ->addAttributeToFilter('created_at', array('from' => $from,'to' => $now))
        ->addAttributeToFilter('status', array('nin' => array('canceled')));

time:

$fr = Mage::getModel('core/date')->date('Y-m-d');
$om = ' 00:00:00';
$from = $fr.$om;
$time = Mage::getModel('core/date')->timestamp(time());//-3600
$now = date('Y-m-d H:m:i', $time);

definitely everything is ... ok;


texts:
I found how add my custom attribute "dispname" on the product page but I would like to put it above the attribute "name". Can you help me?

catalog_product_view.xml :

Product page :


texts: Magento 2 Frontend Controller that does not register customer URL

texts:
In Magento 2 I am attempting to setup a controller I can retrieve after page load via Ajax that does not register as a URL in the admin panel for "Customers>Now Online"

I have a route.xml setup as

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..
/../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="mymodule" frontName="mymodule">
            <module name="Testing_Mymodule" />
        </route>
    </router>
</config>

And a controller such as:

namespace Testing\Mymodule\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{

    public function execute()
    {
        $jsonData = json_encode(array('test1', 'test2', 'test3'));
        $this->getResponse()->setHeader('Content-type', 'application/json');
        $this->getResponse()->setBody($jsonData);
    }
}

This results in a json result of the json array. Now if one checks the "Customers>Now Online" It shows the controller as the last URL visited. Is there a way to access this controller without registering the URL.


texts:
I like to design my own skin of the website. I created 2 new folders with the
name examplefolder in the directory, the path is:

1) app/design/frontend/default/examplefolder
2) skin/frontend/default/exmaplefolder

In the configs->design->Themes->standart I put my folder (examplefolder).

In the frontend my website should appear only in text. No formattings.

But this not works, there is no ajustment to my modification. I cleard the caches in magento and in the browser.

Has anyone an idea whats wrong ?

Many thanks for reply

Thanks but it still does not work. I can adjust the config as you mentioned. But all of my changes I try to do in the folder comicworld (see picture) has no affect to the fronted. I try to change again the current Package Name to comicworld but the following mistake message appeared: magento theme package with this name does not exist and cannot be set.

Thanks for further assistance


texts: Need resource to configure my magento REST Apis

texts:
I am here to know the step by step configuration of magento RESTful apis.
I have basic idea of how it works. But Still I dont know to configure the api to produce the results.
Help me to configure it from scratch.


texts: Magento2: How to merge tab (description and additonal details)

texts:
I want to merge these 2 tabs because is an issue in mobile view (too wide):

https://prnt.sc/o2a0be

https://prnt.sc/o2a0dj

Anyone help how can I do it?


texts: Session data lost in custom magento module

texts:
I have a custom module with two controllers.

In the first controller (SetupController), if I were to set some session data like this:

Mage::getSingleton('core/session')
    ->setData('BuyerCookie', 'A1B2C3');

var_dump(Mage::getSingleton('core/session')->getData()); // I see the session value

Then, in another controller (TestController), if I try to retrieve the value from session like this:

var_dump(Mage::getSingleton('core/session')->getData()); // My session value is not there

Any ideas what might be happening? How do you set global session data and retrieve it?

I tried using cookie by utilising Mage::getSingleton('core/cookie') and it's doing the same thing.


texts: Magento 2 : Install & configure , use redis in custom script

texts: How to (install,configure) & use redis cache in magento 2 custom script ?


texts: Lock wait timeout causing subsequent saves to fail

texts:
But of an odd one this, wondering if anyone else has come across it.  I am running into strange behaviour when saving a number of new models in a row.  If the first model fails to save due to a lock wait timeout on the database (and the exception is caught), all subsequent saves on the other models then fail even with the lock removed.  There is no indication that data has not been saved and the transaction appears to finish completely normally and successfully, but no data is inserted into the database.

Now the auto increment id column is incremented in line with the number of failed saves on the models suggesting rolled back transactons, but there doesn't appear to be any transaction roll back occurring but no data is inserted into the database.  Additionally when doing exactly the same with identical data for all models but with no lock, everything is saved fine and appears in the database as you would expect.

I'm sure I'll get to the bottom of this but thought I would ask in case anyone else can put there finger on the problem.


texts: Create magento extension using localhost

texts:
I create my first magento extension .In that extension we replace core edit.phtml in checkout module by custom edit.phtml.
It works properly in my localhost.
I have some following question:-

1)can i make extension in localhost that i upload in magento store.

2)I have some little bit info about it may also non approved by magento team.so which precaution should i take during creating extension.

3)magento team should check code during approval process?

4)i used magento version 1.8.1.0.

Please suggest something...
Thanks,


texts:
Is there an API reference or documentation for Magento that I can refer to find out the methods available in the different Mage classes?

Let's say I want to find out more about the method getBeforeAuthUrl(). Other than digging into the actual implementation, is there a documentation where I can find out where this method is available, what are its parameters, what does its boolean argument do, etc? How can I find out what other methods I can use in a certain Mage class?

I've been searching everywhere but I can't find one. I'm not sure if I'm missing out something, but digging into the Magento code just to find out what methods I can use and how I can use those methods is quite a pain for a beginner to learn, especially when Magento is massive.


texts: Magento 2 - How to regenerate url_rewrite table?

texts:
I truncated the whole url_rewrite table from phpMyAdmin.
I thought that it will regenerate if I execute php bin/magento indexer:reindex but it doesn't.
How can I fix it?


texts:
We are using 1.9.3.1 installations on 3 different domains. On one installation the quick simple product creation form disappeared suddenly. I have no clue why. Some modules are different. I can not define which module is causing the trouble. I didn't install them.

No error message. The configurable products and attributes looking correct. It was working previously.

Any idea how and where I can start debugging the issue?

Thanks
Markus


texts:
https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/debug-theme.html

I am following the magento docs to create a theme for practicing, it shows me how to find these things but I would like to know what is the difference between templates and layouts in magento before I start overriding them


texts: Cant access Magento 2.4.0 backend Could not create an acl object: Invalid Document

texts:
I'm testing Upgrade to Magento 2.4  but getting the error below. I've read that this error can relate to a missing title attribute in a custom extension. To try and isolate teh issue I have remove all the extensions from /app/code/ folder and then ran upgrade , compile process again  but the issue still remains even with all extensions removed.
Any idea how to debug?
1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 13

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

<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:229]
#2 Magento\Backend\Model\Auth\Session->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#3 Magento\Backend\Model\Auth->login() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Model\Auth\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Backend\Model\Auth\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:26]
#7 Magento\Backend\Model\Auth\Interceptor->login() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#8 Magento\Backend\App\Action\Plugin\Authentication->_performLogin() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#9 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#10 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#11 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#12 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:39]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#14 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]
#15 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#18 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#19 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#20 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#21 Magento\Framework\App\Bootstrap->run() called at [sitemaps/speedcrete/htdocs/index.php:44]


texts:
On an order, there was an error when pressing the "ship" button.
No shipment was created, yet the order went to complete status.
The order was reverted to "Processing" but there is still no option to ship the order, the ship button does not exist.
How can I fix this?
Can I edit this order in the database to restore the ship button?


texts: site not loading properly after adding ssl certificate

texts:
we are trying to add a ssl certificate for magento site.

we we are following this link:

https://docs.nexcess.net/article/how-to-change-magento-base-urls.html

I did "base secure url to start with https ", means

in system->configuration->web, i changed http://demosite.com to

https://demosite.com

but than site is not loading properly, seems css and js is not loading properly as like in following image

http://prntscr.com/86spu6

please help me to find solution

thanks in advance


texts:
I have designed my email and have added the following code to get the order information but two problems

It doesn't show product image?
How do I edit the style? It doesn't appear right

{{if order.getEmailCustomerNote()}}
{{var order.getEmailCustomerNote()}}
{{layout handle="sales_email_order_items" order=$order}}


texts: How To Create Custom Grid in Product View?

texts:
How to create a grid under custom tab in product View/Edit Page in Magento2?(like Product Review grid)

If anyone knows Please explain me ..

Thanks.


texts: How to empty cart or clear session "externally"

texts:
I have a unique workflow for redeeming vouchers on our site through Magento. I have a form that users use for inputting a series of vouchers to get products. It isn't "in" Magento as a CMS page or anything of that nature. The code I am using to achieve access to Magento's resources/models is as followed:

<?php

require_once('../app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

// Now you can run ANY Magento code you want

/**
* Get the resource model
*/
$resource = Mage::getSingleton('core/resource');

I have several codes that can be used to clear session or cart contents but for whatever reason, I can't get them to work by just calling on Mage.php. Here are my codes:

Version 1:

// Empty shopping cart
Mage::getSingleton('checkout/cart')->truncate();

Version 2:

// Clear session data
Mage::getSingleton('checkout/session')->clear();

Version 3:

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

None of these will work with the method I listed above. I am placing it after the "$resource..." line. Is there a better way to do this?

The Goal: Everytime a user visits this "voucher form", which is the landing page - I want their shopping cart to be emptied. Thanks.


texts: Magento 2 - what is "at_call" for in layout file?

texts:
I often see "at_call" in the  tag of a layout like below, what is this for? what it functions as? Thank you.

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" template="product/view/attribute.phtml" after="product.info.type">
    <arguments>
        <argument name="at_call" xsi:type="string">getSku</argument>
        <argument name="at_code" xsi:type="string">sku</argument>
        <argument name="css_class" xsi:type="string">sku</argument>
        <argument name="at_label" xsi:type="string">default</argument>
        <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
    </arguments>
</block>


texts: Why do my 'small' images appear poor quality and of low resolution when they aren't

texts: I am trying to figure out the optimal size for the 'small' images (the one that will appear on a category page) but no matter what size or resolution I make them, they appear as low resolution - I have tried them from as high as 2000 x 2000 px - down to 250 x 250 px and they are always saved as optimized for web through Photoshop


texts: How to get a simple product id from configurable option in magento 2


texts: Magento 2 Mini Cart is not working with production version

texts:
I have developed custom theme on the top of local installation of https://github.com/magento/magento2 version and it works fine. I installed magento production version (2.0.2) https://www.magentocommerce.com/download on my server and installed my theme. But the issue is minicart is not collapsing in browser console there is an error which responsible for this

Uncaught ReferenceError: Unable to process binding "css: function (){return { empty:!!getCartParam('summary_count') == false} }"
Message: getCartParam is not defined

due to this error other knockoutjs scripts also not working which are below to above line . could you please help me to resolve this


texts: Add html tags in note field of product attribute

texts:
eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'sample_attribute',
            [
                'type' => 'text',
                'backend' => '',
                'frontend' => '',
                'label' => 'Sample Atrribute',
                ...
                'note'=>'Product Attribute Info'
            ]
        );

But the strong tags appearing as string. How to get it printed as HTML?


texts: How can I call models and helpers in magento 2

texts:
In magento 1 if we want to call a helper or a model we can do like below if we use Mage::app();

Mage::all();
$exampleModel1 = new Company_Module_Model_Example;

if we add a config file we can use like below

$exampleModel = Mage::getModel("model/test");
$example helper = Mage::helper("helper/test");

  How can I do those things in Magento 2


texts: Not able to add Custom phtml file on Product Page - Magento 2.3.6 CE

texts:
Not able to add/include my custom phtml file on product detailed page. Also I'm not able to remove any of the blocks.
If I remove or add any new phtml the alignment will become clumsy and reviews tab will disappear


texts: Bing API for Create Update Delete/Close Places in Bing Using PHP

texts: Can we create update and delete places from Bing API?


texts: Is there any way to nest config path variables in static blocks? I'm trying to access the logo image and figured that the best way to do so would be something like {{skin url='{{config path="design/header/logo_src"}}'}}, but doestn't seem to work. Should I hard code the skin path or is there any other way to do this? Thanks!


texts: Magento 2: Is there any way for me to know that my extenstion has been removed by the shop owner

texts: I have an extension deployed to some Magento stores. Is there any way for me to know when the shopowner uninstalls/ removes my extension?


texts: how to add one column in order in admin panel

texts:
I want to add one column in order page which is show in admin panle
i update my database in sales_order and sales_order_grid by using upgrade scheme but i does not show in order in admin panel please help me thank you
xml file here

                    text
                    true
                    newcoll


texts:
Has Magento 2 supported varnish 6?

Have anyone tried this?


texts: Fresh Magento 2.2.4 not showing product images on product page

texts:
On our fresh installed Magento 2.2.4, we created a new product and uploaded images.

The product images are displayed well on category overview, but not on the productpage.

The loading gif is keeping displayed and images are not loaded.
Also the tabs are broken, so it seems to be a JS error.

In the browser console we get the following JS error:

Uncaught SyntaxError: Unexpected number in JSON at position 146
    at JSON.parse (<anonymous>)
    at getData (main.js:58)
    at Array.map (<anonymous>)
    at HTMLDocument.apply (main.js:74)
    at fire (jquery.js:3232)
    at Object.add [as done] (jquery.js:3291)
    at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
    at jQuery.fn.init (jquery.js:2967)
    at new jQuery.fn.init (jquery-migrate.js:225)
    at jQuery (jquery.js:75)

EDIT:

The problem was occurred by the product name, the product name contains the sign ' which broken the JSON string. Is there a way to solve this?

How can we solve this?


texts: Magento 2 - Obtain attribute values in template phtml file

texts:
Is there a proper method of getting an attributes list of values (drop down list) within a template phtml file that is being called from a CMS block?

I currently have a file mytemplate.phtml and I'm calling it within a CMS block using

{{block class="Magento\Framework\View\Element\Template"  template="mytemplate.phtml"}}

mytemplate.phtml has the following code

require_once($_SERVER['DOCUMENT_ROOT'].'/app/bootstrap.php');
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

function getExistingOptions( $object_Manager,$option) {

    $eavConfig = $object_Manager->get('\Magento\Eav\Model\Config');
    $attribute = $eavConfig->getAttribute('catalog_product', $option);
    $options = $attribute->getSource()->getAllOptions();

    $optionsExists = array();

    foreach($options as $option) {
        $optionsExists[] = ["value"=>$option['value'],"label"=>$option['label']];
    }
return $optionsExists;
}

$options=array();
$options['custom_option1']=getExistingOptions($obj,"custom_option1");

After reading other peoples comments on the matter, I appreciate that I may get flogged to death for using getObjectManager, so it there a better way of doing this, or calling the loaded Magento instance from within the template file, as I cant see how else I can obtain the attribute values to display in the page?

On another note, how do i find out the attributes default selected value as this isn't given when using $attribute->getSource()->getAllOptions();?

Edit
I found how to get the default value $attribute->getDefaultValue()


texts: Magento 2 Production mode still showing Developer Tab

texts:
On one of my Magento 2 websites I noticed while in Production mode, the Developer tab is still showing in Stores > Settings -> Configuration > Advanced.
The store seems to be running fine but something has to be wrong as it's not hiding the developer tab.
Has anyone come across this before?


texts:
We are seeing an increase in customers saying they have not received notifications of the order places or the shipment & tracking has been received even though we do all the steps.

Is there a way to or update that would provide proof the customer received any email we sent?


texts: Change the city to dropdown in Edit Order Billing Address admin

texts:
I want to change the city to dropdown in Edit Order Billing Address admin.

I try to update table eav_attribute in database. I changed frontend_input='select';  and copy the source model of country customer/entity_address_attribute_source_country. It change my textbox to dropdown but when I tried to duplicate the code of country in below path.

app\code\core\Mage\Customer\Model\Resource\Address\Attribute\Source\Country.php
app\code\core\Mage\Customer\Model\Entity\Address\Attribute\Source\Country.php

and create a file
app\code\core\Mage\Customer\Model\Resource\Address\Attribute\Source\City.php
app\code\core\Mage\Customer\Model\Entity\Address\Attribute\Source\City.php

just replace the Country to City in the code and update again the table and change the value customer/entity_address_attribute_source_city. I already encountered error.

I already found the form in app\design\adminhtml\default\default\template\sales\order\address\form.phtml but the code is hard to change because it is just a single line.. see below.

 getForm()->toHtml() ?>

Anyone can help me on this requirements.


texts: Magento 2 : Add csv file upload field in magento backend (custom module)

texts:
What are the steps included in adding a custom field
"Csv upload" in custom module into magento admin & then on upload process some data in controller ?
Any thoughts ?


texts: White screen after customer login/post or creation of new account

texts:
I have just moved from a new server and updated from Magento 1.9.2.4 to 1.9.3.8.

Everything is working as expected except for when a customer logs in on the front end.

It gets stuck on a white screen, if I click back it then redirects to teh account.

It also does the same on new account creations.

In the logs there are errors for

  "HEADERS ALREADY SENT:"

I have tried clearing cache and sessions several times.


texts: Display custom product option in onpage checkout

texts: i want display custom option product in onepage checkout page, what i need do? and what i need add.


texts: How to set required Gender field in magento 2

texts: I'm working with magento 2. when i want to set required for Gender field in Admin. It required me to config something.


texts: How to include fpdf library in magento 2 controller file?

texts: How can I include "fpdf" files in magento 2 controller.I am implementing product details as pdf functionality for that i am going to use fpdf library but unable to include that library in my controller file.Please help me on this.


texts: How to update Schedule Update in product in magento 2.3?

texts:
I have few question to ask for my understand about Schedule Update

What is Save as New Update Option?
What is the Update name should add here ? attribute code or just a name?

3.What is Assign to existing Update option?

Any kind of resource please suggest me or explain little about this.

Thanks.


texts:
I am trying to setup account sharing globally on our Magento 2 installation.
The setting, under STORES-> Configuration-> Customers-> Customer Configuration, for Account Sharing Options is set to Global.
I created a user on site A, shared@account.com, and I am able to login to site A successfully.  Once logging out of site A, I open site B in a new tab (also tried different browser) and try to login with the shared@account.com credentials, but get the "Invalid login or password" error.
Any thoughts on why this is not working properly?


texts: Add custom css class to backend grid cell under certain conditions

texts:
I am looking for a way to add a custom css class to a backend grid cell when it has a specific value.

I know I have the option to use a renderer and I also could use the frameback_call options in addColumns (and of course if I would like to change every row in a column I would just use column_css_class option within addColumn()) but my problem is that these would only give me the possibility to add a div wrapper or something like that.
What I really like to do is to add the custom css class to the surrounding td tag.
What is the best way to do this?

It seems the problem is that

app/design/adminhtml/default/default/template/widget/grid.phtml

calls

_column->getCssProperty()

which leads to

\Mage_Adminhtml_Block_Widget_Grid_Column::getCssProperty

which calls

$this->getRenderer()->renderCss();

This leads to

\Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract::renderCss

This has no parameter for $row or similar und does not seem to be able to use row-specific data.

Any ideas?

Thanks in advance! :)


texts: Transferring Magento website, admin panel URL gives 404

texts:
I'm having a problem which I've never experienced before when moving a Magento website to a new server.

The transfer was complete and the website is working fine, the only problem is that the admin URL gives a 404 page.

The URL for the admin panel was suppose to be:

http://mysite.com/admin

I've also tried:

http://mysite.com/index.php/admin

However the 404 is still there.

I've had a look at the local.xml and the  tag is set to 'admin'.

var session/cache was all deleted. The rest of the site seems to work fine apart from this 404 error.

Any help is much appreciated.

Thanks.


texts: Magento 2.3 add body class to product page if custom options

texts:
I want to add a body class "custom-options" to the product page, when the product got some custom options.

How can I achieve that?


texts:
Our client wants us to make the state field as an optional one in the Checkout. In order to do this, we have removed all the countries from the required state option and set to "Yes" for allowing to choose the state and make it an optional one through State option in Magento admin panel.

Now, we can see that the state field showing in the checkout but not as a mandatory field as per our client requirement. Here, we have a doubt, our client using an API to fetch the school address into the checkout. There, we can see that in some of the schools, the state field is showing as not mandatory but also there are schools which are omitting the state field.

  how the state options work in Magento 2?

Could anyone please help me with this?


texts: Can / Should I Use The Admin Session in Frontend

texts:
For some use cases it would be nice to know, when on frontend, if an admin is logged in and to fetch the user's ACLs.

I know that this is not "easily" possible, i.e. the frontend and admin sessions are separated on the abstraction level.

I think it should be possible to dig some levels deeper and still access the session.

Additionally I saw work around that pass some tokens from the backend to the frontend - but basically I am not talking about such.

Are there any obvious problems to expect? Or might that just be impossible for any structural reason?
I saw shops that log you out from the backend when you browse the store front - what could be the reason for such security measures? (obviously in this case my whole approach would not work).


texts: How to get Category Collection per Store in Magento 2?

texts:
I want to get all categories names from a specific store. I'm trying:

$categoryFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
$categories = $categoryFactory->create()
    ->addAttributeToSelect('*')
    ->setProductStoreId($store->getId());

    foreach ($categories as $category){
        $category->getName();
    }

But it shows all the categories in the same language (same-store view).

So ->setProductStoreId($store->getId()) doesn't work.

I'm also tried $category->setStoreId($store->getId())->getName().

How can I get all the categories names for specific store view?


texts: How to show specific product on cart page?

texts:
How do i show one specific product in the cart page for promotion and want that product be able to add to the cart?

Can anyone please help me on this?


texts: Translate Tier Price and Group Price wording in Admin

texts:
How can i translate Tier Price and Group Price wording in Admin Section -> New Product?

With inline translate it doesn't work.


texts: Add multiple products to cart programatically - magento 2.1

texts:
I have created a custom module and add multiple products in cart on Ajax request. I follow a default Magento code for adding product to cart. But every time Magento throws below error.

Cart %1 does not contain item %2

This error is throws from

vendor/magento/module-quote/Model/Quote/Item/CartItemPersister.php

I have debugged Magento code and found that it creates new quote every time and it only occurs when the customer is not logged in.

When a customer is logged in its working fine.


texts: Want the additional input field above the every payment method

texts: I am working on Magento 2.4. so I want to add extra input filed above the every payment method.


texts: How to filter product collection using category id in flat mode

texts:
I have flat mode enabled and I need to filter the product collection using category id, but I am not able to. Here below is my code...

$productCollection = Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addFieldToFilter('type_id', array('eq' => 'simple'))
                ->addFieldToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED))
                ->addFieldToFilter('category_id', $brandValue['category'])
                ->addFieldToFilter('brands', $brandValue['brand']);

But, this is not filtering on the basis of the category.


texts: I see when there is no item selected to compare, the block-compare is not displaying in sidebar and after adding product to compare it is there. How to display this block always and show message"You have not selected any items to compare" for example?


texts: The components in Magento are designed in classes or objects?

texts:
I'm practicing drawing some basic diagrams in Magento. I have completed the use case diagram, I wonder how to draw a class diagram. I see some classes in the directory model in the modules so they have too many attributes and methods. So I think I cannot draw class diagram with some classes.

Can someone explain to me how the components in Magento are designed in classes or objects? Can you give me some examples?


texts: Why does one script work but not the other in require.js?

texts:
I am trying to add a live chat script to my Magento 2 site. I had previously added slick.js to my Magento 2 site and the require-config.js file looked like this-

var config = {
paths: {
    slick: 'js/slick.min',
},
shim: {
    slick: {
        deps: ['jquery']
    }
}
};

Everything worked. I took the script from the live chat company and placed it in customscript.js in the same folder that slick is in. I changed my require-cinfig.js to-

var config = {
paths: {
    slick: 'js/slick.min',
    slaask: 'js/customscript'
},
shim: {
    slick: {
        deps: ['jquery']
    }
}
};

I have cleared all the static content and the cache. But the live chat box does not display. When I look into my require-config.js linked to from the header it shows-

require.config(config);
})();
(function() {
var config = {
paths: {
    slick: 'js/slick.min',
    slaask: 'js/customscript'
},
shim: {
    slick: {
        deps: ['jquery']
    }
}
};

I have contacted the chat company and the blame Magento. I have contacted Magento and they blame the chat company. How can I get this working?

Edit:
Copy of the script

!function(){var x=document.createElement("script");x.src="https://cdn.slaask.com/chat.js",x.type="text/javascript",x.async="true",x.onload=x.onreadystatechange=function(){var x=this.readyState;if(!x||"complete"==x||"loaded"==x)try{

_slaask.init('4942661a635c280f5');

}catch(x){}};var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(x,t)}();


texts:
I have created a Plugin. Registered it in di.xml All public methods execute.

Can I inject/rewrite/replace (don't know the proper title) protected methods? How?


texts: Magento 2 prevent search bar from entering mobile mode

texts: When the screen width reaches less then 768x the search bar becomes a pop menu i.e. you click the magnifying class and it pops out. How would I disable this from happening?


texts: Category page Toobar Block not get rewrite

texts:
i am trying to override block Mage_Catalog_Block_Product_List_Toolbar but its not work for me.

bellow is my config.xml code

<config>
    <modules>
        <Mymodule_Catalog>
            <version>0.1.0</version>
        </Mymodule_Catalog>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <product_list_toolbar>Mymodule_Catalog_Block_Product_List_Toolbar</product_list_toolbar>
                </rewrite>
            </catalog>
        </blocks>
</config>

and my Toolbar.php file path is app/local/Mymodule/Catalog/Block/Product/List

and code is bellow

class Mymodule_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
{
    public function setCollection($collection)
    {
        echo "111";die;
        parent::setCollection($collection);
        if ($this->getCurrentOrder()) {
            if($this->getCurrentOrder() == 'qty_ordered') {
                $this->getCollection()->getSelect()
                     ->joinLeft(
                            array('sfoi' => $collection->getResource()->getTable('sales/order_item')),
                             'e.entity_id = sfoi.product_id',
                             array('qty_ordered' => 'SUM(sfoi.qty_ordered)')
                         )
                     ->group('e.entity_id')
                     ->order('qty_ordered ' . $this->getCurrentDirection());
            } else {
                $this->getCollection()
                     ->setOrder($this->getCurrentOrder(), $this->getCurrentDirection())->getSelect();
            }
        }

        return $this;
    }
}

But my function not call when i am on category listing page.

So please let me know where i did mistacks


texts: Magento2: The meaning of '${ $.$data.(something) }' and how it works?

texts:
We will see ${ $.$data.rowIndex } in cms_page_listing.xml like below.

<item name="0" xsi:type="string">${ $.$data.rowIndex }</item>

In Magento/Cms/Ui/Component/Listing/Column/PageActions.php, we also could find a ${ $.$data.title }.

'message' => __('Are you sure you wan\'t to delete a ${ $.$data.title } record?')

I can guess it is a way to get data, but what is the detailed meaning of ${ $.$data.(something) }? And how it works?

2017-10-16

Thanks the answer of PareshaU, we know it is a Template Literals in Magento.

But, the official guide is too general, anyone could give some special instructions?

What's the content of $.$data and where its content come from?
What is the work process of $.$data? For example, the ${ $.$data.rowIndex } in cms_page_listing.xml.


texts: How to set currency depending on country's IP, means if customer selects India country on checkout step then currency should be set Indian Rupee automatically. My Default Currency is 'USD'.


texts: getConfigurableAttributesAsArray causes fatal error

texts:
I am trying to write a script that creates configurable products. Ive been using this as a guide: http://inchoo.net/magento/programmatically-create-a-configurable-magento-product/

When I get to this line:

$configurableAttributesData = $configProduct->getTypeInstance()->getConfigurableAttributesAsArray();

The script crashes and kicks out this error:

Fatal error:  Call to a member function getId() on a non-object in /home/buyfrom/public_html/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line 283

Following a comment on this page, I changed that line to the following:

$possibleAttributes = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);

But I am still getting this error. Can anyone suggest how to fix this?


texts: How can the customer erase/take out from store a product previously uploaded? HELP PLEASE

texts:
I cant believe how such an important function is not available, or how i cant find any response in the internet.
When a customer registers, then goes to seller store, and adds a product to be available, HOW CAN HE LATER ERASE IR IF WANTED? I have found NO answer to this simple action... Everyone talks about going to ADMIN... but the customer who is selling has NO access to the admin!!!! is there no way to give him access to a simple 'erase product' or 'erase publication' kind of thing?
Im sorry, i just cant understand how no one ever thought of this, (or i am a terrible solution searcher)
Thank you :)


texts: Magento 2 net::ERR_ABORTED 404 (Not Found)

texts:
when I go to the checkout page (only this page) there is an error in 2 scripts that totally disturb the store, I tried to execute all the commands, but it does not adjust this error
already executed all the commands below, but without success
rm -rf pub/static/;
rm -rf var/view_preprocessed/;
chmod -R 777 var pub;
php bin/magento setup:di:compile;
php bin/magento setup:static-content:deploy -f pt_BR;
php bin/magento setup:static-content:deploy -f en_US;
php bin/magento cache:clean;
bin/magento deploy:mode:set developer;
chmod -R 777 var pub

the two files that are in error are
pub/static/version1592851434/frontend/Magento/luma/pt_BR/tippy.js
pub/static/version1592851434/frontend/Magento/luma/pt_BR/stickyfill.js

Magento version 2.3.5

can anyone help?


texts: Media image attribute width, height and alt tag in a phtml - Magento 2

texts:
I have a custom .phtml file and I want to show a media image attribute within it.

I have the following:

$product = $block->getProduct();
$productImageAttr = $product->getCustomAttribute( 'my_image_attribute' );
$productImage = $this->helper('Magento\Catalog\Helper\Image')
->init($product, 'my_image_attribute')
->setImageFile($productImageAttr->getValue());

and display the image with:

<img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($product->getTitle()) ?>" />

However the alt tag is blank (even though it is set on the image) and I need to show the width and height of the uploaded image. Can anyone help please?

Many thanks.


texts:
I'm trying to upgrade Magento 2.3.3 to 2.4.2 community edition.
When I run composer update I got :

Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package laminas/laminas-console is abandoned, you should avoid using it. Use laminas/laminas-cli instead.
Package paypal/rest-api-sdk-php is abandoned, you should avoid using it. No replacement was suggested.
.....


texts:
Our dedicated server is running out of disk space and RAM.
We are going to upgrade both.
We currently have a basic RAID setup, two drives, first one writing to second - not sure if that counts as RAID 1 or 2.

Anyway, we have been recommended moving to RAID10 and “......separating MYSQL from the rest of the operating system to isolate DISK IO, and allow for greater performance without compromising resilience.”

Is it a good idea / possible to separate sql database from the rest of the site?
Does it make any difference?

If going ahead with separating would we need to look at pathnames in coding to check they are relative and not absolute?

(We are not putting the db on a different server, it will be on the same server.)

Or is this pointless - should we concentrate on caching for mysql?

Thanks in advance.


texts: How do I get the ship to city from a shipment?

texts:
I have been browsing http://docs.magentocommerce.com/Mage_Customer/Mage_Customer_Model_Address_Abstract.html for a while now, and I am not seeing anything about retrieving the city from the Address...

How do I retrieve the ship to city from the shipment class?

Thank you!


texts: Product Stock is not updated via Repository but works ok via Model save() method

texts:
via ProductRepository:
$product = $this->productRepository->get($product['sku']);
$stockItem = $this->stockRegistry->getStockItem($product->getId());

$stockItem->setIsInStock(true);
$this->stockRegistry->updateStockItemBySku($product->getSku(), $stockItem);
$product->setTypeId('configurable');
$this->productRepository->save($product);

StockItem is not updated!!
Product is saved. But Stock is not (or rolled back).
If comment the last line in code above (product saving) - stock will updated ok.
via Model \Magento\Catalog\Model\Product:
$productModel = $this->productFactory->create();
$product = $productModel->loadByAttribute('sku', $product['sku']);
$stockItem = $this->stockRegistry->getStockItem($product->getId());

$stockItem->setIsInStock(true);
$this->stockRegistry->updateStockItemBySku($product->getSku(), $stockItem);
$product->setTypeId('configurable');
$product->save($product);

Both - StockItem and Product updated!
How to update stock and update product in Magento way?


texts: Magento 2 Product Image not full width on page load

texts:
How to fix this issue on viewing a product in magento 2?
The image is set on that height and width on page load but when you select any color in the choices, the product size restores

this is the how it looks when you selected a color...


texts: Why my checkout form accepts Russian characters?

texts:
I had an order with the details in Russian characters, so I'd like to block the forms to Alphabetic characters only, I thought that it would be native in Magento 2.

How could I an user-friendly method to avoid Russian (Persian, etc) characters in my store?


texts:
I tried to check out the items in the cart that have more than 100.000.000 amount total.

And when I opened the View and Edit Cart, the checkout and multishipping checkout button disappeared because of the total value more than 100.000.000.

How can I change the maximum order amount so I can still check out even the total is more than 100.000.000?


texts:
I have customers from Germany, Austria, & Switzerland all using the same Store & StoreView.

Is there any way to get a sales report filtered by country?

Maybe with a short script or something?

I haven't found a way using Magento Default Reports.


texts: magento 1.9.3 exceeding stock price error

texts:
Scenario:
There is a product in the cart but it only has limited stock.  This one has only 1 item in stock.

We exceed the quantity of the product.  I set the quantity to 2.

The price changes to less than half of the original price.

I searched everywhere for a solution including editing the codes for the price to changing settings in the backend.

Then I found this in the magento forums:

https://community.magento.com/t5/Version-Upgrades/Cart-displays-wrong-price-after-exceeding-stock-value-Version-1/td-p/54002

Does anyone know where this error is stemming from?


texts: Session Cookie Management - Cookie Lifetime

texts:
Has anyone ever set the lifetime to 3 days / 259200? I know the standard is 86400.

Would this overload cache/sessions? I'm currently not using redis or and memcache/session management. I have a feeling it would be much more practical to change this setting if I was utilizing

Right now my session save is to the db:  <session_save><![CDATA[db]]></session_save>

Should i save it to a file instead?

Pros and Cons?


texts:
i want to rewrite checkout success.phtml file in my moudule currently success.phtml file coming from my theme folder like

  app/design/frontend/mytheme/Magento_Checkout/templates/success.phtml

now i want this file in my module i done this but not wroking for me

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance dc" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<referenceBlock name="checkout.success">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Mymodule_Module::success.phtml</argument>
        </action>
    </referenceBlock>
</page>


texts: Remove products url from Google search one store view

texts:
I have multiple store views.
Want to remove product url only for one store view


texts:
When I check indexer status with php bin/magento indexer:status, I got following result,

+--------------------------------------+--------+-----------+-----------------+------------------+
| Title                                | Status | Update On | Schedule Status | Schedule Updated |
+--------------------------------------+--------+-----------+-----------------+------------------+
| Aheadworks One Step Checkout Reports | Ready  | Save      |                 |                  |
| Catalog Product Rule                 | Ready  | Save      |                 |                  |
| Catalog Rule Product                 | Ready  | Save      |                 |                  |
| Catalog Search                       | Ready  | Save      |                 |                  |
| Category Flat Data                   | Ready  | Save      |                 |                  |
| Category Products                    | Ready  | Save      |                 |                  |
| Customer Grid                        | Ready  | Save      |                 |                  |
| Design Config Grid                   | Ready  | Save      |                 |                  |
| Product Categories                   | Ready  | Save      |                 |                  |
| Product EAV                          | Ready  | Save      |                 |                  |
| Product Flat Data                    | Ready  | Save      |                 |                  |
| Product Price                        | Ready  | Save      |                 |                  |
| Stock                                | Ready  | Save      |                 |                  |
+--------------------------------------+--------+-----------+-----------------+------------------+

Notice that I the column Schedule status and Schedule updated is empty, where it used to always have some information before. And When I check in the table mview_state, I can see the field mode is set to disabled, what does disabled mean?

I have never seen this before, and I never changed it to disabled, so how can it be disabled now.


texts: Custom Customer Account Link related page is not having navigation links on left side: Magento 2

texts:
I have a custom module where I have added some custom links in the customer's account.
The custom page in the customer account's links redirects to a new page on clicking a particular link. I have also created the new page, but the issue is that the new page is not a part of the customer account page anymore but instead is a completely new page in Magento frontend.

I have added the link as,

in layout/customer_account.xml

        <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-quotes-link" after="-">
            <arguments>
                <argument name="path" xsi:type="string">path/to/link</argument>
                <argument name="label" xsi:type="string">My link</argument>
            </arguments>
        </block>
    </referenceBlock>

My layout file,

<?xml version="1.0"?>
<page layout = "1column" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" 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 Title</argument>
        </action>
    </referenceBlock>
    <referenceContainer name = "content">
        <block class = "Path\To\Block\Class" name = "name" template = "Vendor_Module::my.phtml" cacheable="false"/>
        <block class = "Path\To\Second\Block\Class" name = "name1" template = "Vendor_Module::second.phtml"/>
    </referenceContainer>
</body>

So as above, when we click on "My link", it displays a custom page that directs to a new custom page. However, in the new page, there are no customer account's links.
How can I achieve this? Please help.

I have referred these links:
Magento 2 Custom Customer Account Link Created but that related phtml is coming with out navigeation links on left side?

Dashboard links not showing my Custom Form in Magento 2

But they don't seem to work for me.


texts: Is it possible to install themes without SSH, just by using FTP?

texts:
I have a vps, installed Porto theme on Magento 2, I paid the theme developers for support.

Every time I face theme installation problem, or things like that, I contact the support.

They keep saying the same thing "Please give me FTP access and I'll check that for you."

I reply: "Are you sure you don't want SSH access?"

They don't reply, they don't seem to need it and they don't seem to know much about Linux either, I asked them to give me their public key so I can put it on the server, didn't reply and insisted on ftp access. Porto is the most popular and most well reviewed Magento theme of all time, and their support team is respected.

I'm just thinking about it, what can you do with FTP access? You cannot install a theme, you still need to run commands using ssh, you cannot even check to see if the file permissions are correct.

If given nothing but FTP access, is there anything you can do?


texts: Upgrade Issue - no matching package found. zendframework/zend-stdlib ^2.7.7 not found

texts:
I am upgrading from Magento 2.1.14 to Magento 2.2.6,  when I run composer update I get the following error.  Appreciate your help.

Problem 1
    - Installation request for magento/product-community-edition 2.2.6 -> satisfiable by magento/product-community-edition[2.2.6].
    - magento/product-community-edition 2.2.6 requires zendframework/zend-stdlib ^2.7.7 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.
 - It's a private package and you forgot to add a custom repository to find it


texts: Magento 2 - How do you reorder front-end product page attributes?

texts:
I'm using the Luma theme.

On the product page, I'm trying to reorder the attributes size and prints (used to be called colors).

I want prints to be above size. I tried setting attribute sort position under storefront properties but nothing changed.

I tried reordering them in the attribute set and no luck there.


texts: Magento 2.X: Sort Product Collection by Category Product Position

texts:
I would like to sort the list of my Product Collection by its category product position. Right now I have this function

public function getProducts($category, $productFactory, $store)
{
    $collection = $productFactory->create();
    $collection->addAttributeToSelect('*');
    $anchorFlag = $category->getIsAnchor(); // Remove this if we want to include the child products within the parent category
    $collection->setStore($store);
    $collection->addUrlRewrite($category->getId());
    $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
    $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    $collection->setOrder('position','ASC');

    return $collection;
}

As you can see right now. The list of products are Ordered by its position in Catalog->Product (CMS) so meaning it's ordered by its ID? or something right?. What I want is to retrieve the product by its position in a Catalog->Categories->Products. The idea is I have 5 products and 3 of this are assigned under a certain category. So what I want to do is order them based on their position in the Categories->Product list and NOT under PRODUCT Position.

What I was thinking to solve this is to Join the Product Collection with the Category Collection using the category ID and with that, I can sort it by product position. If I were to translate it into a SQL Query I want something like this

SELECT products.*
FROM products
INNER JOIN category ON (products.category_id = category.id)
WHERE category.id = {category_id}
ORDER BY category.products.position;```


texts: Recently i had installed a custom product type (custom module),but then it is missing delivery option .Is configuration from the custom module's end? or magento's delivery method end?


texts: What event should I use for Customer delete observer in Magento 2.3?

texts:
I'm very new to Magento 2.3, so I can't find a list of all the events that are related to user accounts. I need to create observers for user deleted, user updated (any information in account) and user created. Could I get some help please? :)

I found quite old information about events customer_save_after and customer_delete_after, but I'm not sure they are still used in 2019.

Also, if you could provide a link to a list with all (current) events in Magento 2.3, it would be very useful. Thank you.