texts:
Magento 1.9.1 OR 1.3

I had a running website on my old server but it never got any orders so I didn't worry about it much back then. After migrating to a new server I didn't even check it but now I want to use it again but it gives the Error message (below).

There is a chance this is Magento version 1.3 - How can I check that? And if so - it would likely not run with the mySQL and pHp versions on the new server, correct? Can anything be done to make it run somehow? I am interested in the exact same version of what I had before.

Here is the Error:

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


texts: Magento 2 Jalali datepicker component not working

texts:
I want to use persian datepicker in adminpanel and replace with Gregorian datepicker everywhere,
this plugin is built over jquery ui, bootstrap .
This is my adminhtml/requirejs-config.js
var config = {
    paths: {
        'persianDatepicker': [
            'Netweb_Shamsi/js/persian-datepicker'
        ]
    },
    shim: {
        'Netweb_Shamsi/js/persian-datepicker' : {
            deps : ['jquery']
        }
    },
    map: {
        '*': {
            'Magento_Ui/js/grid/columns/date':'Netweb_Shamsi/js/grid/columns/date',
            'Magento_Ui/js/grid/columns/column':'Netweb_Shamsi/js/grid/columns/column'
        }
    }
};

and this is my calendar.phtml file
                        $.datepicker.regional['ir'] = {
                            calendar: JalaliDate,
                            closeText: "بستن",
                            prevText: "قبل",
                            nextText: "بعد",
                            currentText: "امروز",
                            monthNames: ["فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دي", "بهمن", "اسفند"],
                            monthNamesShort: ["فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دي", "بهمن", "اسفند"],
                            dayNames: ["يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
                            dayNamesShort: ["يک", "دو", "سه", "چهار", "پنج", "جمعه", "شنبه"],
                            dayNamesMin: ["ي", "د", "س", "چ", "پ", "ج", "ش"],
                            weekHeader: "ه",
                            dateFormat: "mm/dd/yy",
                            firstDay: 6,
                            isRTL: false,
                            showMonthAfterYear: false,
                            yearSuffix: "",
                            calculateWeek: function(b) {
                                const c = new JalaliDate(b.getFullYear(), b.getMonth(), b.getDate() + (b.getDay() || 7) - 3);
                                return Math.floor(Math.round((c.getTime() - new JalaliDate(c.getFullYear(), 0, 1).getTime()) / 86400000) / 7) + 1
                            }
                        };

                        $.datepicker.setDefaults($.datepicker.regional['ir'])

This JS code is only apply button and date translates and dates is still remains in gregorian


texts: Unable to delete product entry in catalog flat tables on deleting product from admin in Magento2

texts:
I have enable catalog flat tables configuration.
I try to delete product from admin but still it is displaying in frontend with message "Out of stock".
Also i checked database entry for table catalog_product_flat_1 it still showing in it.
It get remove from table as well as frontend only after reindex.
Is there any other solution to delete product from catalog flat tables without reindex ?


texts: Only logged in admin should access frontend

texts:
I want to set restriction to access frontend for users that are not logged-in to admin panel (same browser or not).
Means user who is not logged in admin panel should not access frontend and should be redirected maintenance page.

I think it's possible by IP Address by editing index.php.


texts:
Load more PRODUCT not working

js

<script type="text/javascript">

    jQuery(document).ready(function() {
    jQuery.ias({
        container : ".category-products",
        item : "ul.products-grid",
        next : "a.next",
        pagination : '.pages',
        loader : "<img src='/skin/frontend/default/default/images/opc-ajax-loader.gif' />",
        triggerPageThreshold : 9999
    });
});

</script>

XML

 <action method="addItem"><type>skin_js</type><name>js/jquery-ias.min.js</name></action>

                <action method="addCss"><stylesheet>css/jquery.ias.css</stylesheet></action>

BROWSER CONSOLVE ERROR

TypeError: jQuery.ias is not a function

jQuery.ias({

I followed this `

  http://astrio.net/blog/loading-products-with-ajax/

`


texts: Get all products collection which have 5 star review

texts:
I need to get all the products from my magento store, Which have

  5 Star

reviews and rating.


texts: Magento 2 Get Currency Symbol from Currency Code

texts:
I have below code

$currencyManager        = $_objectManager->create('Magento\Directory\Model\CurrencyFactory')->create()->getResource();
echo $currencySymbol    = $currencyManager->getCurrencyCodeFromToCurrency('USD');

It gives fatal error

  Fatal error: Call to undefined method Magento\Directory\Model\ResourceModel\Currency::getCurrencyCodeFromToCurrency()

Can anybody guide me to get Currency Symbol from Currency Code?


texts: Different product prices for existing customers

texts:
Our website sells the same products in two different areas of the site,
Buyer side and Existing Customer Side.

If we add a product "Product_1" = 100€
and are running a 10% discount,
We want to show users on the Buyer Side 90€
AND our existing customers 100€

Is that at all possible?
Our existing customers will be loggin in users.


texts: In magento 2.4.1 datepicker issue, Uncaught TypeError: observable is not a function at datepicker.js:79


texts:
I see this error when i am checking out.

  Unable to communicate with the PayPal gateway.

Step to produce error: When i reach on payment information tab of checkout. This error comes. What can be reason.
Magento: 1.9

---- Error Log ----

ERR (3): exception 'Exception' with message 'PayPal NVP CURL connection error #35: SSL connect error' in /path-to-file/app/code/core/Mage/Paypal/Model/Api/Nvp.php:983
Stack trace:
#0 /path-to-file/app/code/core/Mage/Paypal/Model/Api/Nvp.php(616): Mage_Paypal_Model_Api_Nvp->call('SetExpressCheck...', Array)
#1 /path-to-file/app/code/core/Mage/Paypal/Model/Express/Checkout.php(381): Mage_Paypal_Model_Api_Nvp->callSetExpressCheckout()
#2 /path-to-file/app/code/core/Mage/Paypal/Controller/Express/Abstract.php(108): Mage_Paypal_Model_Express_Checkout->start('http://dev.XXXX...', 'http://dev.XXX...', false)
#3 /path-to-file/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Paypal_Controller_Express_Abstract->startAction()
#4 /path-to-file/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('start')
#5 /path-to-file/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /path-to-file/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#7 /path-to-file/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#8 /path-to-file/index.php(86): Mage::run('', 'store')
#9 {main}


texts: Magento 2: Why is \Magento\Framework\Mail\Template\TransportBuilder Using Luma Theme And How to Change it?

texts:
Why is the transport builder using Magento Luma as the theme for emails, (logo, style, etc) as opposed to Magento Sales / Magento Checkout? And how can this be changed?

Custom email:

    $transport = $this->_transportBuilder
        ->setTemplateIdentifier($code) // this code we have mentioned in the email_templates.xml
        ->setTemplateOptions([
            // this is using frontend area to get the template file
            'area' =>  \Magento\Framework\App\Area::AREA_FRONTEND,
            'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
        ])
        ->setTemplateVars(['data' => $data])
        ->setFrom($sender)
        ->addTo($to)
        ->getTransport();

    $transport->sendMessage();


texts: How to remove SKU from product name in search results?

texts:
How can I remove SKU from product name in search results?
In category view, product name is without SKU but when I search for some product, the results is including SKU in product name.


texts: This seems like a basic request but I can't find it in the documentation. I'm using a from-scratch template(.phtml) and need to pull the CMS content onto the page. So how do I show the "content" field within my custom template?


texts: How to use fonts in Magento from fonts-family installed in theme/fonts?

texts:
I added the code line below in local.xml with link to google, but we do not want to rely on an external url.

    <action method="addLinkRel"><rel>stylesheet</rel><href>//fonts.googleapis.com/css?family=Open+Sans</href></action>

So, we installed the "Open Sans" fonts-family (10 fonts) in skin/frontend/default/(our theme)/fonts.
What are the code lines we must add in local.xml to call multiple fonts from our local theme?


texts: Magento2 does not automatically update changes

texts:
I am developing a magento module. I did set the mode to developer, clear cache. However, everytime I changed the template files or js files, I cannot see the changes reflecting on my webshop.
I can only see the changes after running this command. I think it is not relevant but only when running this command, I can see the changes
 bin/magento setup:upgrade

Do you guys have any idea why that happened?


texts: How to remove ?___from_store=fr on the url? in Magento ver. 2.2.2

texts:
How to remove ?___from_store=fr on the url?
It seems bug or missing something in magento 2.2.2
while switching to different language at frontend , it's
showing url like ?___from_store=fr
please help


texts: Magento 2 Custom Top header Link is not Showing

texts:
I want to create a custom top link in magento  2 for my custom module, but when i load the home page, the custom top link doesn't show up, here's my view/frontend/layout/default.xml:

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

     <referenceBlock name="header.links">
         <block class="Lime\Confirmation\Block\Link" name="add-new-header-link">
             <arguments>
               <argument name="label" xsi:type="string" translate="true">Confirm Payment</argument>
               <argument name="path" xsi:type="string" translate="true">confirmation</argument>
             </arguments>
         </block>
     </referenceBlock>

My Block/Link.php:

namespace Lime\Confirmation\Block;

class Link extends \Magento\Framework\View\Element\Html\Link
{
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
    {
     if (false != $this->getTemplate()) {
     return parent::_toHtml();
     }
     return '
getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '
';
    }
}


texts: How to solve class not found error in magento 1.9?

texts:
I have try to install stamped.io extension, after install back-end showing following error if i click stamped.io setting.

  Fatal error: Uncaught Error: Class
  'Stamped_Core_Block_Adminhtml_System_Config_Form_Button' not found in
  /home/abc/public_html/app/code/core/Mage/Core/Model/Layout.php:590
  Stack trace: #0 /home/abc/public_html/app/Mage.php(533):
  Mage_Core_Model_Layout->getBlockSingleton('\n ...') #1
  /home/abc/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(310):
  Mage::getBlockSingleton('\n ...') #2
  /home/abc/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229):
  Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset),
  Object(Mage_Core_Model_Config_Element),
  Object(Mage_Core_Model_Config_Element)) #3
  /home/abc/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(164):
  Mage_Adminhtml_Block_System_Config_Form->_initGroup(Object(Varien_Data_Form),
  Object(Mage_Core_Model_Config_Element),
  Object(Mage_Core_Model_Config_Element)) #4
  /home/abc/public_html/app/code/core/Mage/Adminhtml/Block/System/Confi
  in /home/abc/public_html/app/code/core/Mage/Core/Model/Layout.php on
  line 590

app/code/community/Stamped/Core/Block/AdminHtml/System/Config/Form/Button.php

<?php
class Stamped_Core_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    /*
     * template
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('stamped/system/config/button.phtml');
    }

    /**
     * return html
     *
     * @param  Varien_Data_Form_Element_Abstract $element
     * @return string
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        return $this->_toHtml();
    }
}

How to solve the class missing error?


texts: Magento 2: Add CSS / JS to custom layout - only applied to single page

texts:
I have a custom page layout for Home Page.
I created this custom layout this way:
app/design/frontend/Vendor/yourtheme/Magento_Theme/layouts.xml
<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="custom">
        <label translate="true">custom layout</label>
    </layout>
</page_layouts>

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

How can I add CSS only to this layout? (not through default_head_blocks.xml). This has to show up only on that page and only on that layout?
The only way that worked for me was through Admin interface via:

But, I would like to do this via XML. Is this possible?
You used to be able to do this in Magento 1 with add css with actions
<action method="addCss">
    <stylesheet>css/javcustom.css</stylesheet>
</action>

Is there something like that in Magento 2?


texts: Deployment fail for magento 2.3 for php version 7.1.22 and 7.2.10

texts:
When I am trying to upload the Magento 2 module for Magento 2.3 it will fail to check in PHP version 7.1.22 and 7.2.10. it will not give even any error, I have attached screenshot please check it. How to resolve this issue or how can I avoid this PHP version check(I will not give support to these two versions)

Any help appreciated resolving this issue

I have checked in both PHP version. It will enable production mode in my local environment but getting an above error while uploading at Magento marketplace.

Still not resolved my issue, also generated ticket in Magento. They are not giving any solution to this issue.
Any help appreciated a lot.


texts: Magento 2 - How to change position of Sign in and My Account link?

texts:
How can i move account creation link and sign in link after the search box.

Need Help


texts: Minicart - Html text showing raw , required formatted text in magento 2

texts:
In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.

Using Magento 2.2.4.

I expect html formatted text but the actual output raw text on minicart


texts: Allowing customer groups with identical name

texts:
I have special case where I need to allow to create customer groups with a name that already exists.

This is done through an import where we're able to differentiate between groups with the same name by extending table customer_group with a new column for external_id.

Does anyone know how this can be accomplished?

Many thanks!


texts:
I updated Magento to the latest version via Magento connect , it was success but after the update I get blank screen for admin and frontend.

When I put

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE']) || true) {
  Mage::setIsDeveloperMode(true);
}

at my index.php

I get below error:

Fatal error: Class 'Mage' not found in
how can i solve it please help i want urgent fix .


texts:
I run a webstore selling automotive products. In the automotive industry, it is very common for a single letter in a vehicle's badge to indicate a significant difference (e.g., AWD indicated by an "X" in the badge). For these types of situations, we'd like to be able to disclude the latter products from the search results.

For example, if a user searches "G35", only products containing "G35" should be returned and NOT products containing "G35X".

Is this possible with built-in Magento tools, or will I have to find a 3rd party solution or develop my own? If anyone has experience a plugin that may offer such functionality I'd very much welcome the input!


texts:
I'm trying to join two tables but it's returning wrong result could you please suggest me how to write it.

Data: From my custom table(product_id,email,id) have Product_id.

Expecting Result : join the two tables (custom_table and catalog_product_entity) to display the Product Name, Sku and Email_id

Could you please tell me how to write it?


texts: issue with show image of products in multi website different domains

texts:
I am using Magento 2.2.3 and have multi-website with different  domains
now it is working fine.
but my problem now is the image of products doesn't show on the second website the products associated correctly to the second website and view store and
showing as info but without the photo ?

I try to make force re-indexing and flush cache but not solve this issue


texts: Magento 2 add parent ID as class on children in Topmenu

texts:
I made a theme in magento 2.2 based on Luma, and I have to make a design for the Topmenu like in the picture below.

This is the category structure in backend.

I already made a plugin that displays only the children in the menu but how can I add the parents ID as a class on the children so I can make different design for categories in "Iarna" (Winter) and different design for "Vara" (Summer).

Or what is the recommended way to achieve that design.

This is the code from plugin.

class Topmenu
{
protected $storeManager;
public function __construct(
    \Magento\Store\Model\StoreManagerInterface $storeManager
)
{
    $this->storeManager = $storeManager;
}

public function beforeGetHtml(
    \Magento\Theme\Block\Html\Topmenu $subject,
    $outermostClass = '',
    $childrenWrapClass = '',
    $limit = 0
) {
    $storeIds = [1];//replace with the id of your store.
    $currentStoreId = $this->storeManager->getStore()->getId();
    if (in_array($currentStoreId, $storeIds)) {
        $menu = $subject->getMenu();
        $newMenuItems = [];
        $firstLevel = $menu->getChildren();

        foreach ($firstLevel as $menuItem) {
            /** @var \Magento\Framework\Data\Tree\Node $menuItem */
            //check if menu is a category
            if (substr($menuItem->getId(), 0, strlen('category-node-')) == 'category-node-') {
                //get all child nodes (second level) and save them in an array
                $subItems = $menuItem->getChildren();
                foreach ($subItems as $subItem) {
                    $newMenuItems[] = $subItem;
                }

            } else { //if menu item is not a category, leave it in place
                $newMenuItems[] = $menuItem;
            }
        }
        //remove all menu items
        foreach ($firstLevel as $childNode) {
            $menu->removeChild($childNode);
        }
        //put new menu items back;
        foreach ($newMenuItems as $newMenuItem) {
            $menu->addChild($newMenuItem);
        }
    }
  }
}


texts:
I'm using a module of Amasty that adds a block to my catalog product view's content reference. This puts in on the top of the page, but I want to move it just above the upsell in the product.info block.

I'm trying to unset this using unsetChild and inserting it just above product.info.upsell, but I can't get it to work. The block keeps appearing above the whole product.info block or below it.

This is my code:

<catalog_product_view>
        <reference name="content">
            <action method="unsetChild"><name>amprevnext_prevnext</name></action>
            <action method="insert">
                <blockName>amprevnext_prevnext</blockName>
                <siblingName>product.info.upsell</siblingName>
                <after>0</after>
            </action>
        </reference>
    </catalog_product_view>

How do I do this?


texts: How to create a static block which displays all categories

texts:
I want to create a static block which displays all of my categories and displays them in a list. I don't need an image and I don't need the sub categories.

Then I want to add this block to my home page.


texts:
I'm running version 1.9.3.2 of Magento Community with the compilation disabled.

Cache folder has been renamed to completely replace it. When I try to delete a Custom Option for a simple product I get the following Warning and nothing appears to happen.

Warning: array_key_exists() expects parameter 2 to be array, null given in /home/devhillcountry/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 507

I upgraded this past weekend. This problem was occurring before the upgrade in version 1.9.3.1.  Any idea what is causing this and how to fix it?


texts:
I have tried to update the core functionality,
<?php echo $this->getBlockHtml('formkey'); ?>(after form tag begun)
and also added this too:

<form method="post" action="<?php echo $this->getBaseUrl('checkout/cart/updatePost')?>">
         <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" >
</form>

Did the updations in this location:

  /var/www/html/app/design/frontend/rwd/default/template/checkout/cart.phtml


texts: Conf swatches dont switch the product images

texts: even though I've copied all the files needed from rwd theme to my theme, and swatches are displaying and are clickable, they do not switch the product images, and I've already compared conf swatches files from rwd and my theme and they are the same. I presume that java script is needed here.


texts: How to insert fastly an attachment as a pdf file in a product page?

texts:
Magento 1.9.0.1

I would like to add a pdf file to download in a product page.

In the product description (long or short) there's WYSIWYG editor. In this editor there are command to insert:

images
embedded videos
attributes

I could arrange uploading the file via ftp in a folder and then linking a text to that URL.

Anything to insert fastly an attachment (as a pdf file)?


texts: Magento 2 how can i limit character (max.40) for shipping Address street in Checkout?

texts:
We have the Problem, some Customers add a too long Shipping Address Street.
How can i limit this in Checkout Step 1?


texts: How can i create a anchor from categories?

texts:
How can i do an anchor with categories?

I want a menu that when I click on the subcategory send me a page created by me where all the subcategories are shown and the page takes you in the part of the page where the subcategory that I had clicked

I use Magento 2 v.2.2.4


texts:
I currently have 2 payment methods Terms & Credit Card Saved (only available to a my wholesale customer group) that I have $150 minimum order threshold set. However, if a customer from that group gets to checkout with an order less than $150, it doesn't show a notification or anything telling them to order more, it just leaves the payment field blank (doesn't offer any methods) and the customer gets confused.

I use a one-step checkout module from magestore.com and was told to place the message into  and to have it check the subtotal before showing the message.

Unfortunately that's a little over my head with php.

Anyone have insight on how to implement this or suggest any other methods?


texts:
I get this error in browser  Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 48 bytes) in D:\xampp5\htdocs\m2\final\vendor\magento\module-eav\Model\Entity\AbstractEntity.php on line 216

Basiclly from block i getCollection like this

protected function getProductCollection()
{
    $limit = $this->getProductLimit();

    // @var Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollection
    $collection = $this->productCollection->create()
        ->addMinimalPrice()
        ->addFinalPrice()
        ->addTaxPercents()
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('image')
        ->addAttributeToFilter('is_featured', 1)
        ->setPageSize($this->getCollectionSize())
        ->setCurPage(1)
        ->load();

    return $collection;
}

Entire code here github

This extension only show featured products

What happens with my code? how to fix it

Iam using magento 2 stable version


texts: Magento 1.9: How to delete a wrong URL pointing to a product review on a different website (same server)?

texts:
I am running two independent websites on a Magento 1.9.3.9 installation. Today I discovered when searching for a product which is sold in one Magento website, that the Google search result returns a URL pointing to the other website on the same server, which is completely wrong and I want to delete it, but how?

To my bad surprise the wrong URL (Google search result) really opens a product review page on Magento:

https://kuul.jp/en/review/product/list/id/3/category/4/

however the product is in another website on the same server:

https://gizzet.com/review/product/list/id/3/category/4/

How is it possible that I can see a product review from a unrelated second website which is for a different company webshop with a completely independent product range. How can I delete that URL? I do not want to show any connection between the two websites. The URL is not listed in URL Rewrite Management. Moreover in the product definition only the "Gizzet" website is selected.

Any help would be highly appreciated!


texts: How can I get the coupon code block to work on custom cms page?

texts:
I've been trying to get the coupon block from the cart to show up on a custom cms page:

{{block type="core/template" title="Coupon" template="checkout/cart/coupon.phtml"}}

The Coupomn Block is displayed, but submitting a coupon code does not seem to work? I was expecting it to direct me to the cart and let me know that the code has been used.

Alternatively I have tried adding the block to the template/checkout/cart/noItems.phtml page using this code:

<?php echo $this->getLayout()->createBlock("core/template")->setTemplate("checkout/cart/coupon.phtml")->toHtml();?>

and trying to have it pop up in fancybox2 on pageload, but again, submitting a working coupon code does not seem to apply any discounts if in a fancybox2 modal or in the page content.

Any help would be greatly appreciated.

--- EDIT:

I've tried Amit Bera's suggestion below, however this gives me a 302 error on the POST form-action.

Here is the content of my noItems.phtml file:

<?php echo $this->__('Shopping Cart is Empty') ?>

    <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <?php echo $this->getChildHtml('checkout_cart_empty_widget'); ?>

<?php echo $this->__('You have no items in your shopping cart.') ?>

<?php echo $this->__('Click here to continue shopping.', $this->getContinueShoppingUrl()) ?>

<?php echo $this->getLayout()->createBlock("checkout/cart_coupon")->setTemplate("checkout/cart/coupon.phtml")->toHtml();?>

    <?php echo $this->getChildHtml('shopping.cart.table.after'); ?>

and here is what the console is telling me:

--- EDIT 2:

As Amit rightly pointed out, this is not allowed by the magento system and even with a bit of core function hacking i couldn't get a coupon code to work without already having a product in your cart.


texts: Redirect all https requests to http except for checkout

texts: I want to redirect all https requests to http on frontend except for checkout. I am using nginx as my web service. Please let me know how can I do this.


texts: How to manage timezone difference in order created date while creating order programatically

texts:
I am creating order programmatically on magento 2.2 and using this

$order = $this->orderRepository->get($order_id);
$order->setCreatedAt($orderData['created_at']);
$order->save();

where $this->orderRepository referes to
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository

The created_date comes from an excel and has the
date (2019-01-11 18:43:08)
 , but created_at coloumn under sales_order it is saved as  2019-01-12 00:13:07 .

. Here are the timezone settings that i have in backend

I need to have the same dates  in order that i have in csv and and same need to be reflected on other places like order grid. Please advice


texts: Magento 2.3: Klarna + Coupon Code results in "main.ERROR:Order line totals do not total order_amount"

texts:
Klarna Payment method is activated in the checkout. It works fine as long as you don't use a coupon code. If you do, the checkout page breaks with the following error:

  main.ERROR:Order line totals do not total order_amount - 530 != 490

Here is what I did already:

Deactivated ALL third party modules
Activated Luma Standard Theme
Deactivated all other payment methods
Went through the database in the hope to find anything
Tested different tax and pricing settings
Updated from 2.3.3 to 2.3.4

Does anybody have an idea what I could have missed?
Or what I should test next?

Using Magento 2.3.3 (live) and 2.3.4 (dev). Happens on both instances. Live and Dev are located on different servers.


texts: Magento not creating images in 2nd store

texts:
I've just added a 2nd store to my Magento installation. Any new product that is uploaded to the backend only displays in the primary store and not in the 2nd one - While images for products that were created before the 2nd store was enabled display perfectly in both stores.

Magento is calling the placeholder image url in the 2nd store, which suggests that the images aren't being created. I have created symlinks between the two directories and the files are part of the www-data group.


texts: What is the benefit of assigning null to some parameters in construct?

texts:
Not sure if it is Magento related question. But need to understand this.

I have seen some of the parameters in construct are assigned to null value.

For example:

/**
 * Initialize dependencies.
 *
 * @param \Magento\Framework\Model\Context $context
 * @param \Magento\Framework\Registry $registry
 * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
 * @param AttributeValueFactory $customAttributeFactory
 * @param \Magento\Sales\Model\OrderFactory $orderFactory
 * @param \Magento\Store\Model\StoreManagerInterface $storeManager
 * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
 * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
 * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
 * @param array $data
 * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
 * @SuppressWarnings(PHPMD.ExcessiveParameterList)
 */
public function __construct(
    \Magento\Framework\Model\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
    AttributeValueFactory $customAttributeFactory,
    \Magento\Sales\Model\OrderFactory $orderFactory,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
    \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
    array $data = [],
    \Magento\Framework\Serialize\Serializer\Json $serializer = null
) {
    parent::__construct(
        $context,
        $registry,
        $extensionFactory,
        $customAttributeFactory,
        $resource,
        $resourceCollection,
        $data
    );
    $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
        ->get(\Magento\Framework\Serialize\Serializer\Json::class);
    $this->_orderFactory = $orderFactory;
    $this->_storeManager = $storeManager;
    $this->productRepository = $productRepository;
}

\Magento\Framework\Serialize\Serializer\Json $serializer = null is assigned to null. And in the function it is assigned to object.

$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
            ->get(\Magento\Framework\Serialize\Serializer\Json::class);


texts: Creating Magento Extension For Admin Products

texts:
I need some experience-based advice please. Using Magento CE 1.7.0.2.

I'm writing a custom extension to store featured products. I need to be able to create simple lists, store them in the database and then assign products to each list. I need to know the following:

Do I need to create a custom table to hook into or should/could I use an existing table?
If the above answer is 'yes', which one(s)?

Any other helpful advice would be gratefully received. Thanks.


texts: Could not get custom attribute in product listing

texts:
I have custom price attribute called wholesale_price.

The wholesale_price is only needed for one of the store view. So i choose specific store view, then update the wholesale_price.

The problem is:
    I can get the wholesale_price variable through $_product->getWholesalePrice() in product view page but not in product listing page.
In product listing page, the $_product->getWholesalePrice() is empty.

Eventually, after i tried to save it from default store view. The wholesale_price is available in the product listing page.

So everytime i need to update the price, i need to go by saving from default store, and it is annoying.

Could you please tell me what is the code difference between saving from default store view and the others store view?

Thank you!


texts: Access input field values from form template in helper/controller classes

texts:
In a Magento checkout template there is a html tag for payment form:

     <input class="checkbox" type="checkbox" id="<?php echo $_code ?>_cc_save" name="payment[cc_save]" title="Test" value="1" /> ...

From the helper class I'm trying to access this input field by:

$payment = Mage::app()->getRequest()->getParam('payment');
$cc_save = $payment['cc_save'];

When the tickbox is ticked and posted, $payment & $cc_save are empty when logged.

This also returns empty data:

$payment = Mage::app()->getRequest()->getPost();

Why does this not work?
How can one access values of input fields from template into helper/controller classes in Magento?


texts:
I have setup Cm_RedisSession module on magento version 1.11.2.0. I added this section of code in app/etc/local.xml

<session_save>db</session_save>
    <redis_session>                       <!-- All options seen here are the defaults -->
        <host>127.0.0.1</host>            <!-- Specify an absolute path if using a unix socket -->
        <port>6379</port>
        <password></password>             <!-- Specify if your Redis server requires authentication -->
        <timeout>2.5</timeout>            <!-- This is the Redis connection timeout, not the locking timeout -->
        <persistent></persistent>         <!-- Specify unique string to enable persistent connections. E.g.: sess-db0; bugs with phpredis and php-fpm are known: https://github.com/nicolasff/phpredis/issues/70 -->
        <db>0</db>                        <!-- Redis database number; protection from accidental loss is improved by using a unique DB number for sessions -->
        <compression_threshold>2048</compression_threshold>  <!-- Set to 0 to disable compression (recommended when suhosin.session.encrypt=on); known bug with strings over 64k: https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/issues/18 -->
        <compression_lib>gzip</compression_lib>              <!-- gzip, lzf or snappy -->
        <log_level>1</log_level>               <!-- 0 (emergency: system is unusable), 4 (warning; additional information, recommended), 5 (notice: normal but significant condition), 6 (info: informational messages), 7 (debug: the most information for development/testing) -->
        <max_concurrency>6</max_concurrency>                 <!-- maximum number of processes that can wait for a lock on one session; for large production clusters, set this to at least 10% of the number of PHP processes -->
        <break_after_frontend>5</break_after_frontend>       <!-- seconds to wait for a session lock in the frontend; not as critical as admin -->
        <break_after_adminhtml>30</break_after_adminhtml>
        <bot_lifetime>7200</bot_lifetime>                    <!-- Bots get shorter session lifetimes. 0 to disable -->
    </redis_session>

I am unable to check that my redis cache is setup properly or not.I read in some site that redis cache stored in server so I tried this commands in 'terminal' to check.

redis-cli monitor

After hitting this command ,it only show 'ok'. I also tried

redis-cli info

But it didn't the cache information.
How do I check that my module and server configuration setup properly or not.
Please help.


texts: Failed uninstallation, still listed in Magento Connect Manager

texts:
I experienced some errors during uninstallation of an extension.
The files of the extensions are deleted, but the extension is still listed in Magento Connect Manager.

Why?
How can I properly uninstall?


texts:
I am getting a product through CSV and importing programmatically.

My description field is having ' (Singe Quote) but this is updated as ? in description field.

If I use $description = mysql_escape_string($test[4]); this is also not fixing my problem.

How can I save description with ' (Singe Quote)?

     $sku = $test[0];
     $Shortdescription = $test[1];
     $description = $test[4];

    $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku); // LOAD PRODUCT BASED ON SKU TO CHECKED PRODUCT EXISTANCE

    if($product){
        $product->setShortDescription($Shortdescription);
        $product->setDescription($description);

        if($product->save()){
            echo '<pre>'; print_r('Product Saved successfully : '.$sku);
        } else {
            echo '<pre>'; print_r('Problem in saving data : '.$sku);
        }
    } else {
            echo '<pre>'; print_r('Product Not Found : '.$sku);
    }

My Sample Description is

  "Sweet, milk chocolate. That’s Milkmaid Gold Selection. Skilful
  selection of the finest coco milk with a full- flavoured taste for a
  perfect bitter sweet balance. A unique, full bodied cocos with a
  fragrance of milk chocolate with vanilla notes.

  Origins: Natural Arabica from Brazil, high quality washed Columbian
  Arabica and Robusta from the Island of Java."


texts: Install a downloaded Magento 2 project in Linux Mint

texts:
I am using Linux Mint. I downloaded a Magento2 project from server and tried to install in Localhost.I changed the URL in core_config_data table of Database. I changed database name, database username & password in .env file.

I executed below commands

php bin/magento setup:upgrade

php bin/magento cache:flush

php bin/magento setup:static-content:deploy

php bin/magento indexer:reindex

php bin/magento setup:di:compile

I tried with file and folder permission also. In this regard I used find . -type f -exec chmod 600 {} \; and find . -type d -exec chmod 700 {} \; command. But I am getting output like below


texts: How to use if else in x-magento-template

texts:
I want to use if, in x-magento-template, I try this code and it shows thí

Code :

<% if(fields.branche == ""){ %>

<% } %>

Bug :


texts:
I'm boginning with a startup that's based on online shops.
Something kinda shopify.
I'm investigating into wich platform better suites my needs, and Magento appears to be the first choice.
I only have one doubt, that's regarding to it's license limitations.

My project is basically a site where you can create your own online store. I provide hosting, a Magento installation with some themes and limitations, and charge a percentage of each monthly period sales.
Can I do that with a community license? Do I need an enterprise license? Is there another option?

Hope you guys can help me.


texts: From which category are products from search result

texts:
Is there any way to find out - to get in some variable, information about category from which the products that shows up from search result are.

For example my specific situation: In advance search I insert one searchable attribute and for result I get 5 products. This 5 products share same attribute  and it is also for sure from same category ( webshop have just two root category and ever category has specific and unique range of attributes ) .

So I need ( in code ) the category name or ID from which this listed products are.


texts:
I have a couple of modules that I have created and will be to consider that I may take action of selling those on Magento Connect marketplace.

Aside from only adding a license docblock and terms/conditions how can I protect my module from people using without paying for a license?

I think there are 2 things i want to cover on this question

What is the correct way to generate license keys and distribute them to customers
How can i do number 1 and make things hassle free for my customers


texts: How include the Swiper slider in Magento2?

texts:
I tried to include the swiper slider js. but not working.

  Step1:

I have placed the css and js in my theme folder and add the below code in requirejs-config.js

var config = {
    map: {
        '*': {
            'swipeslider':'js/swiper.min'
        }
    }
};

  Step2: add the template file banner.phtml in my theme folder


texts: Magento 2.2 how to move category title to above description

texts:
I'm just diving into template/block/layout customization in Magento 2.2 and I'd like to move my category title from being left aligned to being aligned above the description.

Currently it's like this:

_________________________________
|                               |
| Page Title                    |
|_______________________________|
|          |                    |
|(sidebar) | (main content)     |
|          |                    |
|          |                    |
|__________|____________________|

I'd like for it to be like this:

_________________________________
|          |                    |
|          | Page Title         |
|          |                    |
|(sidebar) | (main content)     |
|          |                    |
|          |                    |
|__________|____________________|

Thank you.


texts: Magento 2.1: Invoke urlBuilder->getUrl() in a controller in a custom module

texts:
I think my issue might have to do with dependency injection, which I'm still trying to grab the concept.

What I would like to do is to be able to get the URL using getUrl() function from Magento\Framework\UrlInterface object.

So this what I have so far.

Create a functional controller and set up route. It is accessible via web browser and has execute() function defined.
Add use Magento\Framework\UrlInterface; in a controller class
Add a protected variable $urlBuilder
Add a constructor like below

public function __construct(
    UrlInterface $urlBuilder
) {
    $this->urlBuilder = $urlBuilder;
}

The follow error is thrown when I go to the URL that the controller is mapped to.

  Fatal error: Uncaught TypeError: Argument 1 passed to Tester\ExamplePaymentGateway\Controller\Example\AbstractExample\Start::__construct() must implement interface Magento\Framework\UrlInterface, instance of Magento\Framework\App\Action\Context given, called in var/generation/Tester/ExamplePaymentGateway/Controller/Example/Start/Interceptor.php on line 14 and defined in app/code/Tester/ExamplePaymentGateway/Controller/Example/AbstractExample/Start.php:24
  Stack trace:
  #0 var/generation/Tester/ExamplePaymentGateway/Controller/Example/Start/Interceptor.php(14):
  Tester\ExamplePaymentGateway\Controller\Example\AbstractExample\Start->__construct(Object(Magento\Framework\App\Action\Context), Object(Magento\Customer\Model\Session\Interceptor), Object(Magento\Checkout\Model\Session\Interceptor), Object(Magento\Sales\Model\OrderFactory), Object(Magento\Paypal\Model\Express\Checkout\Factory), Object(Magento\Framework\Session\Ge in app/code/Tester/ExamplePaymentGateway/Controller/Example/AbstractExample/Start.php on line 24

Am I missing some step before I can inject the URL builder or any other objects (let's say quote, cart, or payment helper)?


texts: How to remove the cancel button from the billing address edit form?

texts:
As per the title, how do I remove the cancel button from the billing address edit form ?
The button is highlighted on the screenshot attached bellow.


texts: Magento2 | How to save EAV attribute in Customer Address?

texts:
I want to add 'district' field in customer address.

First, I added the EAV attribute in customer_address.
UpgradeData.php

public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    if (version_compare($context->getVersion(), '2.1.0', '<')) {

        $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer_address');
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute('customer_address', 'district', [
            'type' => 'varchar',
            'label' => 'Test',
            'input' => 'text',
            'required' => false,
            'visible' => true,
            'visible_on_front' => true,
            'user_defined' => false,
            'sort_order' => 43,
            'position' => 43,
            'system' => 0,
        ]);

        $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'district')
            ->addData([
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address'],
            ]);
        $attribute->save();
    }

    $setup->endSetup();
}

And, I tried to add the address in checkout page. (mywebsite.com/checkout)

It works. But 'district' field isn't filled.

When I tried in address book page, It works correctly.

How can I solve the problem?


texts: Can we change the order of "Period" column after any other column in magento 1 grid

texts: can we change the order of the "Period" column from first to second or any other position in the grid. Like after SKU or product name ?


texts:
I need to make my user auto connected when using a specific URL.

I look in the model at app/code/magento/customer but can't find what I need.

I suppose there is connection function somewhere, but can't find it.

Do you know if what I want is possible and so how to do it?


texts: Product URL keys reset when saving product

texts:
In our store, we are using custom product URL keys: {manufacturer}-{product-key}, so for example "lg-42lf580v".

Sometimes when I execute some code to update a few products from a script, the product URL key gets reset to the default value without the manufacturer in it, so: "42lf580v".

This only happens when I use the save() method on a product, for example:

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'SKU');

if ($product) {
        // Update the price.
        $product->setSpecialPrice(200);

        // Set the stock to not allow backorders.
        $stockItem = Mage::getModel('cataloginventory/stock_item');
        $stockItem->assignProduct($product);
        $stockItem->setData('backorders', 0);
        $stockItem->save();

        $product->save();
    }

In this case, I only want to update the backorders value, but still the product URL key gets reset sometimes. Does anyone have any idea what I might be doing wrong here?


texts:
I was trying to solve broken links problem with URL rewrite for category, but I've noticed, that it's not working well.

I've changed category link from category.html to proper-link-to-category.html

After that, I've added URL rewrite, so old link won't display 404 page. So far, so good.

Lately I got a lot of errors in Google Webmaster Tools, there's a lot of 404 links like:

category.html?___store=default&limit=30

Is there a way to add wildcard to URL rewrite, or the only solution is to add own rules into .htaccess?


texts: How do you join a column for shipment grid?

texts:
I've already been able to add my column to the sales_order_shipment_grid. Now it's time to join the data from another table so we can display it.

Approach 1:

Some articles online suggest adding a join to the Grid resource model using something like:

<virtualType name="ShipmentGridAggregator">
    <arguments>
        <argument name="joins" xsi:type="array">
            <item name="my_table" xsi:type="array">
                <item name="table" xsi:type="string">my_table</item>
                <item name="origin_column" xsi:type="string">their_column</item>
                <item name="target_column" xsi:type="string">my_column</item>
            </item>
        </argument>
        <argument name="columns" xsi:type="array">
            <item name="my_column" xsi:type="string">my_table.my_other_column</item>
        </argument>
    </arguments>
</virtualType>

The problem with this (as far as I can tell), is that this is deprecated in favor of using UIComponents and DataProviders. The ShipmentGridAggregator is not used anywhere except for Magento\Sales\Model\ResourceModel\GridPool, which in itself is not used for anything useful.

Approach 2:

So, time to dig in deeper... The shipment grid uses a data source called  sales_order_view_shipment_grid_data_source this in turn is configured to use Magento\Sales\Model\ResourceModel\Order\Shipment\Order\Grid\Collection. This class doesn't have an $_eventPrefix so we can't use an observer to join our field.

Aproach 3:

We are able to inject a custom FetchStrategyInterface into the collection listed above, but this doesn't seem to be its intended purpose. Will probably make it problematic with other modules that need to do something similar.

Approach 4:

The current plan... Just do a before-plugin on Magento\Sales\Model\ResourceModel\Order\Shipment\Order\Grid\Collection::load and add the join to getSelect() ourselves.

Anyone have any better ideas?


texts: Add coupon code only if all products are in specific category

texts:
I have magento installation on it I want to apply coupon code with following conditions:

Cart Total is >= 500
Product Category is only 92 (no product from any other category should be in cart)

Problem is coupon code is still applicable if product with any other category is in cart.

My coupon page screenshot is as follows:


texts: What is your recommended commercial template

texts: There are so many templates to choose from but I don't understand the difference between a free, a paid and a premium template. I also couldn't find any independent reviews. As I'm new to Magento I do need some help to make a decision for my sport website. Hopefully you can help.


texts: Create event and observer for customer sign up (Magento 2)

texts:
How can I create my own event and observer for customer sign up,
From this link,

  Magento2 : customer_account_create event is not triggering

I found that We can use customer_register_success for customer register success.

So I found that events.xml in /module-persistent/etc/webapi_rest/events.xml

<event name="customer_register_success">
    <observer name="persistent" instance="Magento\Persistent\Observer\RemovePersistentCookieOnRegisterObserver" />
</event>

So observer file is RemovePersistentCookieOnRegisterObserver.php
I want to make my custom event and observer for customer sign up, how to achieve that and where should I write my custom events and observer.

This is my code

 namespace YX\Customer\Observer

 class RegisterSuccess implements \Magento\Framework\Event\ObserverInterface
{

protected  $customlogger;
protected  $tempblock;
protected  $customerHelper;

public function __construct(
    \Rage\Base\Helper\CustomLogger $loggerHelper
     \YX\Catalog\Block\OrderHelper $orderHelper,
    \YX\Customer\Helper\CustomerHelper $customerHelper

)
{
    $this->customlogger = $loggerHelper->getLogger('custom');
    $this->tempblock = $this->getLayout()->createBlock('YX\Catalog\Block\OrderHelper');
    $this->customerHelper = $this->helper('YX\Customer\Helper\CustomerHelper');
}
public function execute(
    \Magento\Framework\Event\Observer $observer
) {

 \Magento\Framework\App\ObjectManager::getInstance()
        ->get(\Psr\Log\LoggerInterface::class)->debug("here in customer
 login before func " .$this->customerHelper->isCustomer());

    if (!($this->customerHelper->isCustomer())){
        $customerID = $this->customerHelper->getCustomerId();
        $orderId = $this->customerHelper->getOrderId();
        $this->tempblock->guestToCustomer($orderId,$customerID);

    }
}

}

I have put  dubgger logs but still, on the user sign up it doesn't go inside execute() function


texts:
I was updating some content the other day in my site http://www.kabayandundee.co.uk/tindahan when suddenly the product pages lost their styling.

I was not meddling with the templates or code at all, only updating content and uploading images.

After that happened I tried installing and activating new themes but the product pages remain the same no matter what I do.

I am not sure where this can be easily fixed or if it would be better to start a new installation from scratch? Also, I would like to know what has gone wrong, so I can, at least, learn from this.

Thanks a lot for your time


texts: Making selector available to ui component / philosophy

texts:
You'd think that the selector .el in

{
    ".el": {
        "Magento_Ui/js/core/app": {
            "components": .....

would be made available to the ui component.

Instead, it's just thrown away, and the core Magento ui components end up hardcoding .el inside the js files.

For example, check out minicart.phtml, and you can see the following snippet:

....

{
    "[data-block='minicart']": {
        "Magento_Ui/js/core/app": <?php /* @escapeNotVerified */ echo $block->getJsLayout();?>
    },

    ....

However, [data-block='minicart'] is never made available to the ui component, and instead in minicart.js Magento has hard-coded the selector:

miniCart = $('[data-block=\'minicart\']');

There seem to be many more instances like this in M2 CE 2.1.7..

This seems super strange to me, and is borderline misleading - what's the philosophy behind it?

Additionally, if I want to pass my selector to my ui component, without having to hardcode it - what would be the best way to do that?


texts: Magento 2.2.1: How to override recently viewed template

texts:
I want to override recently viewed template that is currently located in

vendor/magento/module-catalog/view/base/web/template/product/list/listing.html

catalog_product_view.xml

        <block class="Magento\Catalog\Block\Widget\RecentlyViewed" name="pdp.recently-viewed" template="Magento_Catalog::product/widget/viewed/grid.phtml" after="pdp.recommended-items">
           <arguments>
              <argument name="uiComponent" xsi:type="string">widget_recently_viewed</argument>
              <argument name="page_size" xsi:type="number">10</argument>
              <argument name="show_attributes" xsi:type="string">image,name,price</argument>
           </arguments>
        </block>

</referenceContainer>

The template file points to

grid.phtml

<?php
/**
 * @var $block \Magento\Ui\Block\Wrapper
 */
?>
<?= /* @escapeNotVerified */ $block->renderApp([
    'widget_columns' => [
        'displayMode' => 'grid'
    ],
    'image' => [
        'imageCode' => 'recently_viewed_products_grid_content_widget'
    ]
]);

Which then renders on the frontend later from the file I said above.

listing.html

              ...

What do I need to do to override this template?

I have tried creating a file at:

app/design/frontend/Vendor/theme/Magento_Catalog/templates/product/list/listing.html


texts: How to remove interlacing from the PNG files in magento 2?

texts:
I have added a third-party extension for XML sitemap. When I generate a sitemap, I am getting "Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.". That extension company said,
 sitemap generation error is related to your server:

  "libpng warning: Interlace handling should be turned on when using
  png_read_image"

I googled it found this solution for removing interlacing from the PNG files is using ImageMagick's 'convert' utility:

$ convert in.png -interlace none out.png

but I don't know how to apply it in Magento 2 for all images.
any help would be appreciated


texts:
JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack() error when first time lode the website after refreshing all ok every thing are working its in magento 2.2.6

please not provide solution like

marge js and css

than static:content:deploy command run

like that


texts: I am trying to change Tax to say VAT across the site. I have tried to change the en_US.csv file located in i18n in my theme, but with no result. Is this changed on database level, and if so, where?


texts:
Can anyone explain to me how color swatches work when changing images? And where it is done?
I want to know where in code it change images.


texts: My custom module suddenly stopped appearing in the admin panel and in app/etc/config.php

texts:
I'm in development stage and I have a custom module that used to be showing up in the admin panel.
Yesterday it suddenly stopped showing up in this panel.
I don't see my custom module in app/etc/config.php, which sounds like it's not being built.
I removed the custom module from my VSCode solution. Then I added it back in and ran from terminal, php bin/magento setup:upgrade
When running this command it shows me all the modules its updating and mine is not listed.

magento-store/src/app/code/Cellularisrael/Mobileplans/registration.php

 <?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Cellularisrael_Mobileplans',
__DIR__
 );

magento-store/src/app/code/Cellularisrael/Mobileplans/etc/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="Cellularisrael_Mobileplans" setup_version="1.0.0">
    <module name="Magento_Backend"/>
</module>
</config>


texts: Keep the collection always fixed to certain number

texts:
I am using the following code to get five Best sellers collection. The number five is fixed here.

// Array of Id's to retrieve from product collection
$dataArray = array(2, 8 , 17, 3, 7);
$collection = Mage::getResourceModel('reports/product_collection')
        ->addFieldToFilter('entity_id', $dataArray)
        ->addAttributeToSelect('*');
// shuffling the retrieved collection
$collection->getSelect()->order(new Zend_Db_Expr('RAND()'));
// limiting the collection to number 5
$collection->setPageSize(5);

$dataArray is a variable which holds the product ids.

In above code, the $dataArray can have less than five ids. In those cases, I am getting the collection less than five. But my requirement is that the collection must have five products even the $dataArray holds less than 5 values. I mean the remaining product collection should come from the same Bestsellers collection excluding the $dataArray values.

How should I do this?

I can do this something like this, which I think is not good for performance:

 $count = count($collection);
 if($count < 5){
     $remainingCount = 5 - $count;
     // Again run the above product collection
     // exclude the product ids which are already present in array
     // setPageSize to $remainingCount
     // and somehow merge the above specific best sellers with this
 }


texts: Magento 1.9.2.4 installation stuck in Localization

texts:
I'm installing Magento 1.9.2.4 on cPanel . During installation I'm facing problem magento stuck in "Localization" as image below:

Kindly help to sort this as soon please.


texts: Extension of adding rolling coupon expiration dates

texts:
So I've been asked to come up with a sale where each customer receives a couppon that expires 30 DAYS after they receive it...not 30 days from the beginning of the promotion.

The other limitation I have is that the email is triggered by an extension that calls a shopping card rule, so I really need an extension that modifies this in the shopping cart price rule section of Magento.

Any thoughts or suggestions on an extension for this?

Thanks!


texts: magento 2 product page gallery images not showing

texts: I am facing issue with gallery images I have images in backend but not showing in front-end product page gallery slider I have checked there is no error in the console.


texts: Limiting total qty of custom options and making checkboxes mutually excludable

texts:
what I am trying to make is a make-your-own-pizza configurator.
Basically I have setup a simple product (the pizza) and I have added a variety of custom options as toppings. The problem is that there are around 10 toppings but I would like to limit the total amount a customer can pick to about 5 (the pizza won't bake really well with 10).

Since I didn't find such function in magento I used JS to do that. Basically once you select more than 5 checkboxes you receive the following message which works perfectly.
(I used this post: how I can limit the maximum selectable simple products?)

var maxCheckedCount = <? php echo $maxCheckedCount = $this - > getProduct() - > getMaxCheckedCount(); ?> +1;
 var maxCheckedAlertMessage = "<?php echo $this->__('You have reached maximum allowed selections.'); ?>";

 jQuery('input[type=checkbox]').click(function () {
     var n = jQuery('input:checked').length;
     if (n >= maxCheckedCount) {
         jQuery(this).prop('checked', false);
         alert(maxCheckedAlertMessage);
     }
 });

The difficult part, however is making the checkboxes mutually exclusive, for example, we have two checkboxes per topping: single and double. When I click double and I have selected single before that, I would like it to get unselected. I am not using radio buttons because I would like the customer to be able to unselect his choice without clicking anything else and I think it might conflict with the script above.

I've used the following code:

$("#idofsingle").click(function() {
        if($("#idofsingle").is(':checked')) {
            $("#idofdouble").prop('checked', false);
        }
    });
    $("#idofdouble").click(function() {
        if($("#idofdouble").is(':checked')) {
            $("#idofsingle").prop('checked', false);
        }
    });

It works alright in a simple environment but in magento I reckon it should pick the ID's of the checkboxes using php which I am not able to do. Any hints?

Thanks in advance!


texts: I need to create a price rule that will decrease the product price by some percentage every day. I don't think it can be done with price rules, so any advice would be most appreciated. Thanks!


texts: Translating in html templates using i18n

texts:
I'm using i18n to translate some values in html static templates (default.html):
So this does not work:

But if I add the translation to all the "option.value" possible values, the "option.value" is correctly translated:

If the option value is on of the values ("Value 1", "Value 2" and "Value 3") it is correctly translated. Help please !!!! :)


texts:
Currently I'm trying to override the GroupController of Mage_Adminhtml_Customer so I can add some code for saving my custom field in the Customer Groups menu. As you can think it doesn't really work as I want what means that it seems that my controller is ignored by Magento so far but I don't get the mistake I've made. Here are the snippets:

<?xml version="1.0" ?>
<config>
    [...]
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mynamespace_CustomerGroupReturnable before="Mage_Adminhtml">Mynamespace_CustomerGroupReturnable</Mynamespace_CustomerGroupReturnable>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

And the controller:

require_once 'Mage/Adminhtml/Customer/controllers/GroupController.php';

class Mynamespace_CustomerGroupReturnable_GroupController extends Mage_Adminhtml_Customer_GroupController
{
    public function saveAction()
    {
        die(':D'); //just for testing
    }
}

Can anybody see what's missing? Thanks!


texts: If product is part of a bundle, display link to bundle page on product page

texts:
Product "A", Product "B", and Product "C" are all products in Product Bundle "ABC".

I'm trying to achieve the following scenario:

If a user is on the product page for any individual Product, a link will be displayed that sends them to the Product Bundle page.

If there is a way to do this programmatically so that this will apply to any and all bundled products, that'd be great (i.e. Products A,B,C link to Bundle ABC, Products D,E,F link to Bundle DEF, etc.)

Thanks!


texts: what is the difference between use of var_dump() and mage::log() to debug?

texts:
I mean when i can use var_dump() and mage::log().

I have some idea about log. if we enable log settings and for example if we use mage::log($obj).it will print $obj information in system.log file.

where as var_dump() print direclty in browser.

Please comment if i'm anything wrong.


texts: I had imported configurable product then after when open the configurable product every time it display :Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available" message.It should be not appear this window while open the configure product.


texts: Magento 2: unable to override product/view/addtocart.phtml from my module

texts:
I am trying to customize the product/view/addtocart.phtml template in my extension. I was already able to customize other templates but for this one it just won't work.

I found the template is defined in

vendor\magento\module-catalog\view\frontend\layout\catalog_product_view.xml

among much more XML is this bit:

<block class="Magento\Catalog\Block\Product\View" name="product.info" template="product/view/form.phtml" after="alert.urls">
                <container name="product.info.form.content" as="product_info_form_content">
                    <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/>
                </container>

I know the XML which determines what template is loaded for the "product.info.addtocart". Because if I change the template of in this XML to template

MyNamespace_MyModule::product/view/addtocart.phtml

It successfully overrides the template with my own. However of course I need to do this from within my module. I already tried many ways but not matter what I try it has no effect...

Among other things I have created a file

app\code\MyNamespace\MyModule\view\frontend\layout\catalog_product_view.xml

and put the following code in it:

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<referenceBlock name="product.info.addtocart">
    <arguments>
        <argument name="template" xsi:type="array">
            <item name="0" xsi:type="string">MyNamespace_MyModule::product/view/addtocart.phtml</item>
        </argument>
    </arguments>
</referenceBlock>
<referenceContainer name="content" remove="true">
</layout>

and it has no effect. Interestingly notice the

<referenceContainer name="content" remove="true">

that should actually blank the page but it does nothing either (if I put the same XML bit in the Magento_Catalog catalog_product_view.xml then it effectively blanks the page..).

So I assume the problem is not that my code is not good  but rather that my whole layout XML is not being read for some reason... I thought maybe I had a permission problem so just to be sure I chmoded the whole Module directory at 777 but still my layout XML has no effect...

How come I am unable to override anything, why is my

app\code\MyNamespace\MyModule\view\frontend\layout\catalog_product_view.xml

having no effect?? Could it have something to do with the order of loading the modules?

If yes how come I am able to overide other layout XML from the Magento Catalog module from the same module such as

app\code\MyNamespace\MyModule\view\base\layout\catalog_product_prices.xml

Thanks for your help!!


texts:
I'm trying to move blocks to different containers. I cannot seem to get them to move to the specified destination.

so in my default xml under Magento_Theme

<move element="report.bugs" destination="header.inner"/>

<referenceContainer name="abs.top.menu">
<container name="header.inner" label="Header Inner Panel" htmlTag="div" htmlClass="header-inner">

</container>
</referenceContainer>


texts: Magento 2 URL Rewrite data share to Elastic Search

texts: I want to share my Url rewrite Data to Elastic search, So is there any common function for Tracking URL when Product add/update/, Category add/update, Product import etc when URL is change or update.


texts: Magento2 REST api authentication returns 'Decoding error'

texts:
I am trying to authenticate via token based authentication. I am using 'Advanced REST client' extension in chrome to test the API.

this is my request

http://local.nomo/index.php/rest/V1/integration/admin/token
and my headers

Content-Type: application/json
Cookie: PHPSESSID=r9p1tjg450ogd6ime05jsleal0
Content-Length: 39
Source message

POST /index.php/rest/V1/integration/admin/token HTTP/1.1
 HOST: local.nomo
 content-type: application/json
 cookie: PHPSESSID=r9p1tjg450ogd6ime05jsleal0
 content-length: 39

 username='test'&password='test'

I always get this error on in response:

{
"message": "Decoding error: Decoding failed: Syntax error #0 /var/www/nomo/vendor/magento/framework/Json/Decoder.php(20): Zend_Json::decode('username='test'...') #1 /var/www/nomo/vendor/magento/framework/Webapi/Rest/Request/Deserializer/Json.php(49): Magento\Framework\Json\Decoder->decode('username='test'...') #2 /var/www/nomo/vendor/magento/framework/Webapi/Rest/Request.php(131): Magento\Framework\Webapi\Rest\Request\Deserializer\Json->deserialize('username='test'...') #3 /var/www/nomo/vendor/magento/framework/Webapi/Rest/Request.php(190): Magento\Framework\Webapi\Rest\Request->getBodyParams() #4 /var/www/nomo/var/generation/Magento/Framework/Webapi/Rest/Request/Proxy.php(127): Magento\Framework\Webapi\Rest\Request->getRequestData() #5 /var/www/nomo/vendor/magento/module-webapi/Controller/Rest.php(257): Magento\Framework\Webapi\Rest\Request\Proxy->getRequestData() #6 /var/www/nomo/vendor/magento/module-webapi/Controller/Rest.php(160): Magento\Webapi\Controller\Rest->processApiRequest() #7 /var/www/nomo/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http)) #8 /var/www/nomo/vendor/magento/framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #9 /var/www/nomo/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch() #10 /var/www/nomo/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #11 {main}"
"trace": null
}

Does somebody know what is going wrong ?


texts: Magento 1.9 - Frontend prices are not calculated

texts:
after an update to 1.9.3.7, the product prices are no longer calculated in the frontend.
We have 4 attributes in our configurable products.
Previously, the price was always calculated automatically if you changed the attributes.
This has stopped working since my last update.

I've already tried that:
I have indexed all indexes again.
As well as all caches emptied.
I have also tested this with the BaseTemplate for the product view.

Hmm. What else can I do.
Thanks in advance


texts: Magento 2: Adding a new Block to Checkout_Cart_Item_Renderer

texts:
I am trying to add a custom button next to the gift_options, edit, and remove buttons inside the Magento 2 checkout/cart page

Inside my custom theme I have created the Magento_Checkout dir. Inside Magento_Checkout/Block/Cart/Item/Renderer/Actions/NewButton.php

I then added the layout/checkout_cart_item_renderers.xml

and add this code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_item_price_renderers"/>
<body>
    <referenceBlock name="checkout.cart.item.renderers">
        <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="cart/item/default.phtml">
            <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.default.actions" as="actions">
            <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\NewButton" name="checkout.cart.item.renderers.default.newbutton" template="Mageno_Checkout::cart/item/renderer/actions/newbutton.phtml"
            </block>
        </block>
    </referenceBlock>
</body>
</page>

Then inside my block Newbutton.php I add:

<?php
namespace Magento\Checkout\Block\Cart\Item\Renderer\Actions;

class NewButton extends Generic
{
/**
 * Get item configure url
 *
 * @return string
 */
public function getConfigureUrl()
{
    return $this->getUrl(
        'checkout/cart/configure',
        [
            'id' => $this->getItem()->getId(),
            'product_id' => $this->getItem()->getProduct()->getId()
        ]
    );
 }
}

However when I load the checkout/cart page I run into an invalid block type, class does not exist.

Invalid block type:       Magento\Checkout\Block\Cart\Item\Renderer\Actions\Newbutton
Exception #1 (ReflectionException): Class    Magento\Checkout\Block\Cart\Item\Renderer\Actions\Newbutton does not     exist

Any advice on how to add this button would be greatly appreciated


texts: Magento2.2 PHP Fatar Error in config:show

texts:
I casually run php bin/magento config:show and it showed me the following PHP Fatal Error, but I don't have a clue, because the site works ok.

........
analytics/subscription/enabled - 1
PHP Fatal error:  Uncaught Error: Call to undefined method Magento\Config\Model\Config\Structure\Element\Group::hasBackendModel() in /var/www/html/vendor/magento/module-config/Console/Command/ConfigShow/ValueProcessor.php:100
Stack trace:
#0 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(197): Magento\Config\Console\Command\ConfigShow\ValueProcessor->process('default', '', 'Magento Analyti...', 'analytics/integ...')
#1 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(202): Magento\Config\Console\Command\ConfigShowCommand->outputResult(Object(Symfony\Component\Console\Output\ConsoleOutput), 'Magento Analyti...', 'analytics/integ...')
#2 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(202): Magento\Config\Console\Command\ConfigShowCommand->outputResult(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, 'analytics')
#3 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(161): Magento\Config\C in /var/www/html/vendor/magento/module-config/Console/Command/ConfigShow/ValueProcessor.php on line 100

Fatal error: Uncaught Error: Call to undefined method Magento\Config\Model\Config\Structure\Element\Group::hasBackendModel() in /var/www/html/vendor/magento/module-config/Console/Command/ConfigShow/ValueProcessor.php:100
Stack trace:
#0 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(197): Magento\Config\Console\Command\ConfigShow\ValueProcessor->process('default', '', 'Magento Analyti...', 'analytics/integ...')
#1 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(202): Magento\Config\Console\Command\ConfigShowCommand->outputResult(Object(Symfony\Component\Console\Output\ConsoleOutput), 'Magento Analyti...', 'analytics/integ...')
#2 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(202): Magento\Config\Console\Command\ConfigShowCommand->outputResult(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, 'analytics')
#3 /var/www/html/vendor/magento/module-config/Console/Command/ConfigShowCommand.php(161): Magento\Config\C in /var/www/html/vendor/magento/module-config/Console/Command/ConfigShow/ValueProcessor.php on line 100

Any ideas?


texts: Tablerates csv, When I upload csv it shows error

texts:
I want to import table rates csv, when I uploaded a csv it shows error :

The file "/tmp/opt/lampp/temp/php7efXy3" doesn't exist

why? where I am doing wrong can anyone help me.

Thanks.


texts:
In my onepage checkout I want to open all sections by default. When customer will open onepage checkout page, already could to see shipping methods and payment methods for default billing and shipping addresses.
So I think it will possible if all time I did trigger click on "continue" buttons. But this method I don't like.

Do you have any idea?


texts: Magento 2 - How to change fotorama nav shaft thumbnail image size - for grouped products?

texts:
I need to change the size of the small images below the gallery, but only for products of type grouped

Normaly you can change the size in the file THEME/etc/view.xml:
<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        <images module="Magento_Catalog">
            ...
            <image id="product_page_image_small" type="thumbnail">
                <width>110</width>
                <height>110</height>
            </image>
            ...

So I tried to change it for grouped products only like this:
<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <media>
        <images module="Magento_GroupedProduct">
            <image id="product_page_image_small" type="thumbnail">
                <width>129</width>
                <height>129</height>
            </image>
        </images>
        <images module="Magento_Catalog">
            ...
            <image id="product_page_image_small" type="thumbnail">
                <width>110</width>
                <height>110</height>
            </image>
            ...

Then I flushed the cache. But it does not work. The image size still stays 110px instead of 129px.


texts:
Need to get random review in magento 2.4
Every time refresh review will be change (as review i have call in homepage)
$reviewCollectionFactory = $objectManager->create('Magento\Review\Model\ResourceModel\Review\CollectionFactory')->create();

// Get reviews collection
        $reviewsCollection = $reviewCollectionFactory->addFieldToSelect('*')
        ->addStoreFilter($currentStoreId)
        ->addStatusFilter(\Magento\Review\Model\Review::STATUS_APPROVED)
        //->setDateOrder()
        ->addRateVotes()
        ->load();

if ($reviewsCollection && count($reviewsCollection) > 0) {
    foreach ($reviewsCollection AS $review) {
        echo $review->getTitle() . "<br/>";
  }
}

as i have try but no luck
$reviewsCollection->getSelect()->order('RAND()');
$reviewsCollection->getSelect()->order('rand()');
$reviewsCollection->getSelect()->orderRand()->limit(10);
can you please help here ,
thanks in advance


texts:
We have been having problem moving Magento 2 category. When we try to re-arrange/ move a category we get the error, "There was a category move error." We have increased PHP execution time out and reindexed Magento 2, but still these didn't help.

Any assistance would be much appreciated. Thanks in advance!


texts: Modify Tax Rule Programmatically - set Tax Rate array

texts:
Following a previous question as a simple guide:

How to programatically create tax rates

Instead of creating a tax rule programmatically, I would like to modify an existing rule, specifically the 'tax_rule' array (which should contain a list of tax rate IDs that are valid for this rule.

These rates can be found by using:

$ruleModel = Mage::getModel('tax/calculation_rule')->load($id);
Zend_Debug::dump($ruleModel->getRates());

This should return an array of tax rate IDs that apply to this rule.

Using $ruleModel->setRates($array)->save() just messes up this rule, removing other values that were previously saved (rule name, priority, etc).

How can I simply load an existing rate model and update the 'tax_rate' field to include an additional tax rate? If the existing array is array(5,7,9) I would like to update the array to include a new value as well, ie array(5,7,9,15).


texts: Can I change the urls that form the "better blog" extension?

texts:
I installed the "best blog" extension of Mageplaza, but I do not want these URLs. In my project.

I want the URLs of this extension as

'domain/blog/id_post/url_key'

now the urls are in this way

'domain/blog/post/url_key'

Thanks


texts: Magento2 AWS Disk Space is always full after some time

texts:
I have installed magento2.4 on AWS and after every 6 7 hours cache folder takes all the memory
it always has 25 30 GB of cache data on sever and I have to delete it manually or clear the cache from Magento Backend
How to solve this problem


texts: How to show layered navigation filter all time

texts:
I have seen lots of people who discussed about this issue, also given plenty of ideas, but i am still stuck at the issue. As per the answer at this link, i have written the new function to get the active filters value at view.php

app/code/local/Mage/Catalog/Block/Layer/View.php,

public function getActiveFilters()
    {
        $filters = $this->getLayer()->getState()->getFilters();
        foreach($filters as $filter){
            $active[] = $this->getChild($filter->getFilter()->getRequestVar().'_filter');
        }
        return $active;
    }

this function gives the value of the current filter name,label.

at view.phtml,

$_active = $this->getActiveFilters();

foreach ($_active as $active) {?>

   <select class="filter_box col-xs-12" onchange="filter(this.value)">
    <option value="#"><?php echo $this->__($active->getName()) ?></option>
    <?php echo $active->getHtml() ?>
    </select>
<?php }?>

In this link, @B00MER mentioned extending the filter class will solve the issue also provided the code for the Category Filter. I have checked it at my magento site, but there is no changes. It is just displaying the filter without any option.

I don't know how to achieve it, also don't know the method which i am using ,is correct or not.

Can someone point me the right solution for this issue.

Thanks.


texts:
i want to trigger my js event when variation of product get select on product and Category page?
same like when catalog sales rule event triggered.


texts: SetHasOption() to 1 on magento 2 not working

texts:
I have added the custom option programatically following this . Not everything worked but I made few changes and successfully added the custom option programatically. But I couldn't get that custom option displayed on frontend. On further checking I figure out there is a problem while setting the hasOptions().

I tried below codes to set has options

$_products = $this->_objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
$_products->setHasOptions(1);
$_products->save();

Also tried this

$_products = $this->_objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
$_products->setHasOptions(1);
$_products->getResource()->save();

But I couldn't get it working.

Can anyone help.


texts: Magento 2: How to Load Customer collections in admin panel by Using Plugin

texts:
I am using plugin to load the customer collection in admin panel,this is i have done..

di.xml

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

    <type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider">
        <plugin name="productdata" type="Learning\HelloPage\Plugin\ProductDataProvider" />
    </type>
</config>

Here is my plugin file Plugin/CustomerDataProvider.php

<?php

namespace Learning\HelloPage\Plugin;

class CustomerDataProvider
{
       public function aroundGetData(
        \Magento\Customer\Ui\Component\DataProvider $subject,
        \Closure $proceed
    )
    {

        //what to do here??

    }

}

as customer page keeps loading all the time..
here is a screenshot..


texts: How do you add a session message after session_write_close is called?

texts:
We use the excellent uRapidFlow module by Unirgy, but have ran into a bit of an annoyance. When you run one of their profiles, they call session_write_close. The problem with this is that it means if we wish to run a process from an adminhtml controller we can't set a session flash message to inform the user of success or caught exceptions.

Is it possible to restart the session after the process is complete, in order to add a session message?

I initially wasn't sure if it was possible to restart a session in PHP, but the proof of concept PHP works:

session_start();
// if this is the second run, show the value
if (!empty($_SESSION['foo'])) {
    echo $_SESSION['foo'], PHP_EOL;
}
// set an initial value
$_SESSION['foo'] = 'bar';

// start running profile
session_write_close();
// after running profile
session_start();
// set a value to see if it takes
$_SESSION['foo'] = 'foo';

I haven't been able to correctly set a flash message on the adminhtml session though. I thought I might be able to call something along the lines of:

Mage::getSingleton('adminhtml/session')
    ->init('core', 'adminhtml')
    ->addSuccess('Whoop');

But this doesn't seem to work.


texts:
I have Magento Extension Fooman_Jirafe.

What is this module for?
Is this module still used in magento 1 or 2 ?

Here is the module definition :

<config>
<modules>
    <Fooman_Jirafe>
        <active>true</active>
        <codePool>community</codePool>
    </Fooman_Jirafe>
</modules>


texts: Looking for a good color swatch extension

texts:
I am looking for advice on a good color swatch extension.

My products are apparel (tshirts) and are setup as configurable
products, with three attributes - color, size and gender.
The customer should be able to use the swatches to configure the product in BOTH the category and product pages.
Selecting a color swatch must change the product image to show the image associated with the simple product. This needs to happen on both the category and product pages.

There are lots of extensions out there, and I am not sure which one to choose. Any pointers would be welcome!
Thanks!


texts: Magento 2: add js file, but I can't find my file in static folder

texts:
I add js file in my module using the requirejs, but the requirejs can't load the file and i get this error:

  require.js:1895 GET (my_ip)/magento2/pub/static/frontend/Magento/SaturTheme/it_IT/SliderHome/js/materialize.js

If I open this link I get this stacktrace error:

The "/var/www/html/magento2/" file doesn't exist or not a file

    0 /var/www/html/magento2/vendor/magento/framework/Filesystem/Directory/Write.php(146): Magento\Framework\Filesystem\Directory\Write->assertIsFile(false)
    1 /var/www/html/magento2/vendor/magento/framework/App/View/Asset/MaterializationStrategy/Symlink.php(30): Magento\Framework\Filesystem\Directory\Write->createSymlink(false, 'frontend/Magent...', Object(Magento\Framework\Filesystem\Directory\Write))
    2 /var/www/html/magento2/vendor/magento/framework/App/View/Asset/Publisher.php(66): Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink->publishFile(Object(Magento\Framework\Filesystem\Directory\Write), Object(Magento\Framework\Filesystem\Directory\Write), false, 'frontend/Magent...')
    3 /var/www/html/magento2/vendor/magento/framework/App/View/Asset/Publisher.php(50): Magento\Framework\App\View\Asset\Publisher->publishAsset(Object(Magento\Framework\View\Asset\File))
    4 /var/www/html/magento2/vendor/magento/framework/App/StaticResource.php(109): Magento\Framework\App\View\Asset\Publisher->publish(Object(Magento\Framework\View\Asset\File))
    5 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
    6 /var/www/html/magento2/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
    7 {main}

I tried also to run this command, but nothing change:

  php bin/magento --ansi setup:static-content:deploy it_IT


texts: Magento 1.9: Copy all products of a category to another category

texts: I want to copy all products from one category to another category in Magento 1.9.2.2?


texts: I am getting this error "pdo_mysql extension is not installed"

texts: When i use php bin/magento setup:static-content:deploy in ubuntu  i am getting this error "pdo_mysql extension is not installed" so please help me?


texts: When unchecking My billing and shipping address are the same checkbox billing address is not showing magento 2

texts:
when unchecking My billing and shipping address are the same checkbox in checkout pagethe billing address is not showing.also edit button. In console these errors are showing.
require.js:1895 GET https://domainname/pub/static/version1620831580/frontend/organica/organica_default/en_GB/Codilar_Gst/js/view/billing-address/list.js net::ERR_ABORTED 404 (Not Found)
[ERROR] Failed to load the "Magento_Checkout/js/view/billing-address/list" component.
https://domainname/pub/static/version1620831580/frontend/organica/organica_default/en_GB/Magento_Ui/js/lib/logger/console-output-handler.js
knockout.js:3391 Uncaught ReferenceError: Unable to process binding "template: function(){return detailsTemplate }"
Message: detailsTemplate is not defined
at template (eval at createBindingsStringEvaluator (knockout.js:2992), :3:61)
at init (knockout.js:5464)
at knockout.js:3368
at Object.ignore (knockout.js:1480)
at knockout.js:3367
at Object.arrayForEach (knockout.js:159)
at applyBindingsToNodeInternal (knockout.js:3353)
at applyBindingsToNodeAndDescendantsInternal (knockout.js:3233)
at applyBindingsToDescendantsInternal (knockout.js:3215)
at applyBindingsToNodeAndDescendantsInternal (knockout.js:3242)
https://domainname/pub/static/version1620831580/frontend/organica/organica_default/en_GB/knockoutjs/knockout.js
How to solve this? Magento version is 2.3.2


texts: Excluding the products from being migrated by data migration tool

texts:
I have set up the migration tool and have gotten it to work well.

However, if I wanted to exclude the products from being migrated, what is the easiest way to achieve this? (aside from removing all of the mappings in map.xml). Is it possible for me to just exclude the step for products (a.k.a. the catalog) in the migration completely?


texts: Magento 2 - Delete Product Images Configurable Product

texts:
I seem to have an issue deleting all images programatically from configurable products. I know the bad practice way that works fine on simple products

 $imageProcessor = $objectManager->create('\Magento\Catalog\Model\Product\Gallery\Processor');
                        $images = $p->getMediaGalleryImages();
                        if(count($images) > 0) {
                            foreach ($images as $child) {
                                $imageProcessor->removeImage($p, $child->getFile());
                            }
                        }

                        try{
                            $existingMediaGalleryEntries = $p->getMediaGalleryEntries();
                            if($existingMediaGalleryEntries != null) {
                                foreach ($existingMediaGalleryEntries as $key => $entry) {
                                    unset($existingMediaGalleryEntries[$key]);
                                }

                                $p->setMediaGalleryEntries($existingMediaGalleryEntries);
                                $p = $this->productRepository->save($p);
                                $p->save();
                            }
                        }catch(\Exception $e)
                        {
                            $message = array('type' => 'error', 'message' => 'Error  >> cant save product '.$e->getMessage());
                            $this->getLogger()->error(print_r($message, true));
                        }

Using the above on a configurable product however is not working so i tried the below, in matching the mock tests in catalog product

   $imageProcessor = $objectManager->create('\Magento\Catalog\Model\Product\Gallery\GalleryManagement');
        foreach($p->getMediaGalleryEntries() as $key => $entry)
        {
            $imageProcessor->remove($p->getSku(), $entry->getId());
        }

        try {

            $p = $this->productRepository->save($p);
            $p->save();

        }
        catch(\Exception $e)
        {
            $message = array('type' => 'error', 'message' => 'Error  >> cant save product '.$e->getMessage());
            $this->getLogger()->error(print_r($message, true));
        }

this is causing lock waits on the database and just stopping the crons from continuing to execute.

UPDATE:

Still no joy, im going to have to assume this is a bug

Any ideas?


texts: Complete checkout in multiple currencies

texts:
I am trying to set up a multiple currency store, we are selling to the UK and Ireland and want to settle payments and taxes in both countries. We cannot have a straight up currency conversion because we need to charge differently depending on country as costs vary.

My ideal situation is that someone from Ireland will see the the Euro website, complete checkout and get charged in Euro and this will get settled in an Irish bank account, someone from the UK will see the GBP website, complete checkout and get charged in GBP and this will go into a UK bank account. We want to be able to input different values in Euro and GBP on the backend as well.

My base currency is GBP and at the moment I have just a 1:1 currency conversion so that when I go to the Euro section I can just enter the Euro price, if I change the conversion rate we will need to do calculations from euro to GBP just so we can enter it and have it display back as euro on the front end which makes no sense.

Then when users are in the Euro site and go to checkout I want them to be able to check out in that currency. Not having a euro price but getting charged in GBP.

Braintree payment gateway can take and settle multiple currencies in different countries but is this possible with Magento?