texts: Prevent to empty cart after failed/canceled payments in magento 2

texts:
I am using PayuBiz as a online payment method in our website, in which cart is getting empty on failure /canceling of order and my code is:

 public function execute()
    {
        $arrParams = $this->getRequest()->getPost();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $objectManager->create('\My\Payment\Model\Standard')->getResponseOperation($arrParams);
        $objectManager->get('Magento\Checkout\Model\Session')->clear();
        return $this->resultRedirectFactory->create()->setPath('checkout/onepage/failure');
    }


texts: Magento 2 Sort product in cms page widget block

texts:
I want to insert multiple products in a cms page using SKU . So i did using blocks . So please see my code

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" show_pager="0" products_count="10" template="Magento_CatalogWidget::product/widget/content/grid.phtml" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`,`operator`:`==`,`value`:`ab-54, ab-12, abc-45, ab-76, abs-09`^]^]"}}

Now the products are showing in the frontend .

But here the problem is the products are not showing based on this order ab-54, ab-12, abc-45, ab-76, abs-09 . Actually i want to show the product exact this order .

Currently sorting based on ascending order of id  . see this is the order of ids that i getting for the products in front end 342, 526, 638 , 672, 1109

But i need to display product as per the given sku order .

Please help


texts:
I have noticed that images can take forever to load using the fotorama image loader on Magento 2 product pages after a user has used the website to view many products.

Clearing product_data_storage and recently_viewed_products from Local storage seems to dramatically speed this up and so feel these need cleaning every once in a while but I might just clear these out or stop them populating as am not really using recently viewed products.

What are these used for and are they required?


texts: Why does adding constructor parameters require my to clear /generated

texts:
I'm using Magento 2.2 in development mode.

I have a controller class

class MyController
{
   public function __construct(
      \Magento\Framework\App\Action\Context $context,
      \Magento\Framework\Message\ManagerInterface $messageManager)
   {
      // stuff
   }
}

That works correctly.  However, if I add an additional constructor parameter like this:

class MyController
{
   public function __construct(
      \Magento\Framework\App\Action\Context $context,
      \Magento\Framework\View\Result\PageFactory $resultPageFactory,
      \Magento\Framework\Message\ManagerInterface $messageManager)
   {
      // stuff
   }
}

I get the error

PHP Fatal error: Uncaught TypeError: Argument 2 passed to
Ben\Testing\Controller\Test::__construct() must be an instance of
Magento\Framework\View\Result\PageFactory, instance of
Magento\Framework\Message\ManagerInterface given, called in
/magento-dev/magento2/generated/code/Ben/Testing/Controller/Test/Interceptor.php
on line 7 and defined in /magento-dev/magento2/app/code/Ben/Testing/Controller/Test.php:7
...

If I clear the /generated folder and refresh the page, it works.

My question is about how Magento handles caching and generated code.  I can add additional code to non-constructor functions without needing to clear /generated, and it works.  Why does that work, but adding additional constructor parameters requires me to clear the /generated folder?


texts: What are the best practices for Magento CRON (& cache cleaning)?

texts:
I finally got CRON scheduling working properly (no thanks to Bluehost), and discovered a dizzying array of options--even more after I installed Aoe Scheduler and CacheCleaner.

Are the default CRON settings optimal/sufficient for most sites?

How beneficial is it to utilize CRON to regularly clear caches, or is this generally not necessary? Which caches would benefit most from regular renewal?


texts: Set product visibility on observer at store level before product save

texts:
I have 2 websites, each of which has 2 stores.

When I create a product from a store(say, Store 1) of a website(say, Website 1), and if I set the websites for this product as Website 1 and Website 2, the product's visibility is set as catalog, Search only for the store from which I created it(Store 1). As for the other stores, the visibility is set to Not Visible Individually.

I have an observer for catalog_product_save_before, in which I want to set this visibility at store level.

Tried this code:

Mage::getModel('catalog/product_action')->updateAttributes(
                    array($productId),
                    array('visibility'=>4),
                    1
                );

and it works. But for this, I need to get the productId, which I wont get since the product is not yet saved in my observer function.

How do I set this product visibility for a particular store(say Store 3 of Website 2) to catalog, Search in the catalog_product_save_before observer?


texts:
I got multiple input types in my form based on positions.

<input type="file" name="file" id="file" data-positionid="<?php echo $positionId; ?>" class="inputfile" />

Now i want on change the correct data-positionid to show.
If i got multiple positions the jQuery i got responds only to the first every time.

        $('input[type=file]').change(function () {

        var positionId = $(this).data('productid');
        alert(positionId);
    });

So i think that $(this) is not realy getting the changed input type.


texts: List out admin user id who add the product in magento 1

texts: I have created user1 and user2 only to add the product and I want to show there ID in a new column I want to add new column in catlog/Manage Product  before name column.


texts: KnockoutJS cannot read property 'fromJS' of undefined

texts:
I have tried bind json file with knockoutjs into my custom template. But i got this error in browser console:

  Uncaught TypeError: Cannot read property 'fromJS' of undefined

How to avoid this error? Here some following script that i have:
view/frontend/web/js/view/main-component.js

define(['jquery','uiComponent','ko'], function($, Component, ko){
  'use strict';
  return Component.extend({
    defaults: {
      template: 'My_Module/index'
    },
    initialize: function(){
      var json = {
        "id": 9,
        "fullName": "John Doe",
        "firstName": "John",
        "lastName": "Doe",
        "referenceNumber": "BUY-08",
        "position": "Buyer",
        "type": "Buyer",
        "telephone": "028 82 240780",
        "email": "m@email.com",
        "departmentId": 3,
        "departmentName": "DEPT B",
        "country": "United Kingdom"
      };

      var viewModel = {};

      function success() {
        viewModel = ko.mapping.fromJS(json);
        ko.applyBindings(viewModel);
      }

      success();
    },
  });
});

view/frontend/web/template/index.html

  Full Name: <input data-bind="value: fullName" />

  Ref: <input data-bind="value: reference" />

  Position: <input data-bind="value: position" />

  Email: <input data-bind="value: email" />

  Dept: <input data-bind="value: departmentName" />

  Country: <input data-bind="value: country" />


texts: M2-2.3.1 - Is it possible to get the special price or final price value by loading the configurable product in a plugin?

texts:
I am trying to get the configurable product's special price or final price inside a plugin class. I already tried the below methods but it will not fetch any special price or final price of the configurable product's data. Also, I tried to view configurable product's simple product data using its type instance used products but I couldn't find any special or final price data in its simple products as well.
Tried methods:
1. Using \Magento\Catalog\Model\Product $product

$product = $this->product->load($item['product_id']);
$specialPrice = $product->getSpecialPrice();
$finalPrice = $product->getFinalPrice();

2. Using \Magento\Catalog\Model\ProductRepository $productRepository

$product = $this->product->getProductById($item['product_id']);
$specialPrice = $product->getSpecialPrice();
$finalPrice = $product->getFinalPrice();

FYI - Also, I checked in $product->getData() as well but only available the price value which doesn't have the special price or final price
Expected result: Get the special or final price value and passed it to an email template content variables inside the plugin class function. This special price value correctly showing on the configurable product details page.
Actual result: null or 0 shows as the get data
Could you please let me know your thoughts? Is there any other way to get the special or final price of the configurable product inside a plugin class?
Thanks!


texts: Magento - Please specify the product required option(s)

texts: There is a problem with my Magento store. When I try to add products variable product into the cart it says please specify the product required option(s) but I have already selected the options. But when I try to add simple products then it is added successfully. I want to know what is the problem. I have previously hosted this website on AWS and now migrated this to SiteGround. Is this server migration cause some problem. I use the same URL.


texts: Two item category coupon code with fixed amount for whole cart

texts:
Magento version, 1.9.2.4

How do I generate a coupon where a person puts in there cart one item each from two different categories and then gets a fixed discount off the whole cart.

But, if only one item is in the cart from one category, then it won't allow the coupon to be validated?

For example, customer orders one vacuum (from category 4) and one bag (from category 5), then they get a fixed off amount.  But if they only order the vacuum the coupon is invalidated.

I ask because if I just say

If ALL  of these conditions are TRUE :
Category  is  4, 5

It will work if only 4 is in the cart and 5 is missing.  There has got to be a step that I am missing.

ANy help is appreciated.

Thanks,
Joe


texts:
I am a new Magento and I have forgotten my Magento two admin URL. earlier I was getting an issue with blank admin page which I have fixed but now I have forgotten my admin URL how to get it back.
I know Magento stores it somewhere but am not able to find it.
Please can anyone help me to get back to my URL!
enter link description here


texts: Should observer code always been wrapped in try catch

texts:
Just as the title asks, should code inside an observer always be wrapped in a try catch?

I read this somewhere a long time ago and have always written observers in such this way since.

Is this considered good practice for magento modules?


texts:
Yes, I've read Alan Storm's suggestion, but I can't really call it a solution. My Gzip compression is configured correctly, only the merged css and js files aren't compressing (according to Google PageSpeed Insights). Does anyone have a solution?

The linked suggestion also notes that you should configure Gzip  for the media/css and media/js folder too. I don't really understand this, because those files seem nowhere excluded from the global Gzip htaccess rule (Magento rule which is commented by default.)

edit: additional information:

Gzip

gzip compression => enabled

Zlib

zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value

.htaccess

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# Netscape 4.x has some problems...
#BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

</IfModule>

Response headers merged JS file 1 (Magento core JS)

Accept-Ranges: bytes
Connection: Keep-Alive
Content-Length: 547528
Content-Type: application/javascript
Date: Fri, 10 Jul 2015 09:51:35 GMT
Etag: "23f7c0-85ac8-51a6e0082dfbb"
Keep-Alive: timeout=1, max=100
Last-Modified: Thu, 09 Jul 2015 09:37:20 GMT
Server: Apache
Vary: User-Agent

Response headers merged JS file 2 (skin JS)

Connection: Keep-Alive
Date: Fri, 10 Jul 2015 09:53:04 GMT
Etag: "23f7c4-2ef94-51a6e00835cbb"
Keep-Alive: timeout=1, max=99
Server: Apache
Vary: User-Agent


texts: Force customer to log in when visiting a specific category Magento 2

texts:
I have found that https://github.com/bitExpert/magento2-force-login and I just install it but I don't know how to use it: how to force not logged in the customer to login or create an account before being redirected to /my category ??!!! I just find the whitelist and it seems that no justification for this list the force to log in is omitted but for all URL in my store. please help me I am really new in Magento 2 and this is my first project.
thanks  in advance


texts:
I have extended module-catalog block in Test_Catalog (Test is my vendor name and Catalog is module name, in which I am extending block of module-catalog). I want to add small table element on product view page for which i have created catalog_product_view.xml (location : root\app\code\Test\Catalog\view\frontend\layout\catalog_product_view.xml) But still its not displaying any content from test.phtml file . I dont want to change entire look of product view ,I just want to add small table element. Below are some things I have tried in catalog_page_view.xml:

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
      <block class="Test\Catalog\Block\Rewrite\Product\View" name="product.seller.list" as="product_seller_list" template="test.phtml" />
    </body>
</page>

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Test\Catalog\Block\Rewrite\Product\View" name="product.seller.list" template="test.phtml" />
        </referenceContainer>
    </body>
</page>

system.log

[2016-04-18 15:03:34] main.CRITICAL: Invalid template file: 'test.phtml' in module: 'Magento_Catalog' block's name: 'content_schedule_block5' [] []


texts:
I need to change contact us page email template type from "text" to "HTML". I found it is in the config.xml

 <email>
    <contacts_email_email_template translate="label" module="contacts">
       <label>Contact Form</label>
       <file>contact_form.html</file>
       <type>text</type>
    </contacts_email_email_template>
 </email>

How properly to override config.xml

[EDIT] this is for the file app/code/core/mage/contact/etc/config.xml and the below answer will work for any .../mage/ANYTHING/etc/config.xml


texts:
I think about ditching the category-tree in the frontend and let the user navigate through tags on my webshop. This would be possible since I don't have more than 100 products in simple categories.

I am looking for a solution to display products based on tag combinations, say www.myshop.com/tags/gold displays all products tagged with "gold" and www.myshop.com/gold+sale displays all products tagged with "gold" and "sale".

Is this possible?


texts: Remove newsletter just from checkout page

texts:
I want to remove newsletter just from checkout page and i search about it and try these codes but i don't get any result.

I add below code in local.xml in app\design\frontend\default\my-theme\layout\local.xml but nothing changed !!!

<checkout_onepage_index>
    <remove name="footer.newsletter"/>
</checkout_onepage_index>

Also i try this code in checkout.xml in app\design\frontend\default\base\default\layout\checkout.xml but again nothing changed !!!

<checkout_onepage_index translate="label">
<remove name="footer.newsletter"/>
</checkout_onepage_index>

thanks for help.

EDIT:

I check my code again when i add below code in checkout.xml, newsletter remove from all pages, why?

<checkout_cart_index translate="label">
    <remove name="footer.newsletter"/>
</checkout_cart_index>

EDIT2:
This is the code of local.xml that show newsletter box:

<reference name="footer">
    <remove name="cms_footer_links"/>
    <remove name="footer_links2"/>
    <block type="newsletter/subscribe" name="footer.newsletter" as="footerNewsletter"
           template="newsletter/subscribe-footer.phtml"/>
</reference>

EDIT3:

I search this subject again and understand that i should make my directory and copy files that i want to change them, but when i copy checkout.xml and change it to what i want nothing will be happen, because i should change the Current package namein admin panel but if i set my directory for current package name all things will mess!!! I really confused and don't know how can i solve this problem!

Thanks for help.


texts: custom form save and create customer in magento

texts:
Create a custom form for the registration(or creating customer account)  of customers is it possible?

Advance Thanks for help.

  app/code/local/Namespace/Customform/IndexController.php

public function saveAction()
{

    $data = $this->getRequest()->getPost();

    $firstname = $data['firstname'];
    $lastname = $data['lastname'];
    $company = $data['companyname'];
    $address1 = $data['address1'];
    $address2 = $data['address2'];
    $city = $data['city'];
    $state = $data['state'];
    $zipcode = $data['zipcode'];
    $phone = $data['phone'];
    $email = $data['email'];
    $pass = $data['password'];

    $websiteId = Mage::app()->getWebsite()->getId();
    $store = Mage::app()->getStore();

    $customer = Mage::getModel("customer/customer");
    $customer   ->setWebsiteId($websiteId)
                ->setStore($store)
                ->setFirstname($firstname)
                ->setLastname($lastname)
                ->setEmail($email)
                ->setPassword($pass);

    $customer->save();

    $address = Mage::getModel("customer/address");
    $address->setCustomerId($customer->getId())
            ->setFirstname($firstname)
            ->setLastname($lastname)
            ->setPostcode($zipcode)
            ->setCity($city)
            ->setTelephone($phone)
            ->setCompany($company)
            ->setState($state);

    $address->save();

}

how to use cURL functions for the same use in customer save and customer address


texts:
So, I was working on making my webshop IE and Edge ready an stumbled on the following problem in IE: my background would not y-repeat and would only take the height (as it seemed) of the screen. After stackoverflowing my question (because I assumed it was pure a HTML/CSS + IE issue), someone mentioned something about setting the height of my page-wrapper to auto. When I did this, it still not worked while it worked for him in IE. So, digging into the code, I saw that Magento created a .ie10 and .ie11 class to my page-wrapper with only the following style: height: 100%. I overwrote the style with height: auto and now everything works fine.

My question is: why does this happen in Magento 2 and what is the reason that the style height: 100% is applied to it?


texts:
How to created sitemap.xml last week in my production site.

Today I have created a new CMS page. How do I add this page's URL to sitemap.xml?

Please provide me a solution.


texts: How to create custom cms page layout file?

texts:
In Magento 2, is there any solution to creating a custom layout XML file for custom cms page?

I want to add XML code and CSS and Js only for my custom cms page.

I know about there is one field available at admin side. But, XML code is the little bit large. So, it's not a better way.

Can anyone guide me how to create it?

Thanks.


texts:
i created recursive function in magento which give string out at last .

i had created custom customer attributes, every time a new customer is registered he is registered using attributes from its parent customer some thing link MLM.

i created custom attribute refcode which is id of customer (refcode of customer at 0 level is admin). When i register new customer ref code is needed to already registered customer like 1 ,2 ,4

below is senario

customer | ID | Ref code
A           1      admin
B           2        1
C           3        1
D           4        3

now give customer D i want to get all parent customer id's

for customer D i want output 4->3->1->admin

i wrote below code
Case 1

function getallrefcode($id,$string){
   if($id=='admin'){
     return $string;
   }else{

     $customerObj  = Mage::getModel('customer/customer')->load($id);
     $attr = $customerObj->getData('refcode');
     $newstring=$string.'->'.$attr ;
     getallrefcode($attr ,$newstring);
   }
}

echo getallrefcode('4','');

i get blank value why so ,

but for below code
Case 2

function getallrefcode($id,$string){
  if($id=='admin'){
    return $string;
}else{

  $customerObj  = Mage::getModel('customer/customer')->load($id);
  $attr = $customerObj->getData('refcode');
  echo $newstring=$string.'->'.$attr ;
  getallrefcode($attr ,$newstring);
}
}

getallrefcode('4','');

i get output as "4->3->1->admin"

what i am missing with case I
why return is not giving output


texts: cron has started throwing and exception 'Mage_Core_Exception' with message 'Mage registry key "_singleton/admin/session" already exists'

texts:
Magento 1.9.2.1 has just started throwing the exception

'Mage_Core_Exception' with message 'Mage registry key "_singleton/admin/session" already exists'

it happens with different cron jobs - if I disable the extensions relating to the cron that triggers the error, then the error happens on a different cron job, but not all cron jobs.

Some of the cronjobs that trigger the error are successful after the 8th or 10th run.

I've spent the day googling and all i can find is reference to the compiler and clearing the cache - I've cleared the cache about a million times and the compiler has never been switched on - i've cleared it and run compiler --disable to be sure.

I'm absolutely stumped and would appreciate some help.

full exception here

Cron error while executing core_email_queue_send_all:

exception 'Mage_Core_Exception' with message 'Mage registry key "_singleton/admin/session" already exists' in /home/user/public_html/app/Mage.php:595

Stack trace:

#0 /home/user/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/user/public_html/app/Mage.php(477): Mage::register('_singleton/admi...', Object(Mage_Admin_Model_Session))
#2 /home/user/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php(546): Mage::getSingleton('admin/session')
#3 /home/user/public_html/app/code/core/Mage/Core/Model/Abstract.php(316): Aoe_Scheduler_Model_Schedule->_beforeSave()
#4 /home/user/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php(196): Mage_Core_Model_Abstract->save()
#5 /home/user/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php(609): Aoe_Scheduler_Model_Schedule->runNow(true)
#6 /home/user/public_html/app/code/community/Aoe/Scheduler/Model/Observer.php(39): Aoe_Scheduler_Model_Schedule->process()
#7 /home/user/public_html/app/code/core/Mage/Core/Model/App.php(1358): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#8 /home/user/public_html/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#9 /home/user/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#10 /home/user/public_html/cron.php(77): Mage::dispatchEvent('default')
#11 {main}


texts: Magento 2: Load invoice details by Id using object manager

texts:
I am new to Magento.I  want to get invoice details by its id using object manager but unable to get it. I tried this.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order')->load('506585');
print_r($order->getData());
$invoiceCollection = $order->getInvoiceCollection();
foreach($invoiceCollection as $invoice){
print_r(invoiceCollection);
}


texts: How to change the colors only of all email templates in M2?

texts:
I've been trying to scratch my head through this most of the day, and I seem to be running in circles.

I know I shouldn't edit the default email templates at all (and I'm cool with that).  I've found the default templates in Vendor > Magento > theme-frontend-luma > web > css > source.  However, I cannot see anywhere where the colors of this theme are specified.

I don't want to change the layout of the email templates, but I just want to change the default colors (and the logo obviously).

How/Where do I create my own email template theme that doesn't interfere with the actual website theme ?

Thanks in advance


texts: Magento Error: Processing your request Exception printing is disabled by default for security reasons

texts:
I've ran php bin/magento setup:upgrade and now when I am opening localhost/admin. Here it is showing this error.

There has been an error processing your request Exception printing is disabled by default for security reasons. Error log record number: 1320359676

Here is what Log report says?

a:4:{i:0;s:664:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Mageplaza_Core data: current version - none, required version - 1.0.0
Mageplaza_LayeredNavigation data: current version - none, required version - 1.0.0
Smartwave_Core data: current version - none, required version - 2.0.0
Smartwave_Filterproducts data: current version - none, required version - 2.0.0
Smartwave_Megamenu data: current version - none, required version - 2.1.0
Smartwave_Porto data: current version - none, required version - 2.5.0
Smartwave_Socialfeeds data: current version - none, required version - 2.0.0";i:1;s:828:"#0
C:\wamp64\www\vendor\magento\framework\Interception\Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator-
>aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure),Object(Magento\Framework\App\Request\Http))
#1 C:\wamp64\www\var\generation\Magento\Framework\App\FrontController\Interceptor.php(26):
Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#2 C:\wamp64\www\vendor\magento\framework\App\Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#3 C:\wamp64\www\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#4 C:\wamp64\www\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#5 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";}

Please give me a solution. Thanks


texts: Using Google Analytics to track Persistent Shopping Conversions

texts:
When enabling Persist Shopping in Magento, is it at all possible to track the effectiveness thereof using Google Analytics.

I'm thinking somewhere along the lines of using the URL builder and appending these parameters to the URL used when activating the persistent session.

I've looked through the config.xml and can see quite a few event-observers. Would it be possible to create a local override & modify the observer model to accommodate the Analytics tracking?


texts: Magento 2.3 Fatal error: Uncaught Error: Call to undefined function mime_content_type()

texts:
Fatal error: Uncaught Error: Call to undefined function mime_content_type() in  when trying to upload image from admin blocks.
Please check screenshot


texts: Magento 2.3 - How to add custom column to customer_entity table

texts: I'm creating a Referral Program module, and I want to create a custom column inside the customer_entity table. The column is referred_by and it's a foreign key that as a relation with the customer_entity table itself. This column contains the id of the customer that sent the referral_code. How can I implement this? How can I add this field inside the customer_entity table? I try to add an attribute as static type, but the new column doesn't appear inside that table. I need to declere the db_schema.xml?


texts: Magento 2 get catalog rule for current product

texts:
I would like to get the current catalog rule for the product on the product page. I want to be able to output the name on the page.

I know this is possible in magento 1 but cannot find any function in code for magento 2.


texts: How to set Multistore url like https://mywebsite.com/ca/ in magento2

texts:
I created store in admin Now i want to hit like below urls and I created folder in magento root directory 'ca' and 'fr' and 'au' folder and also put .htaccess and index.php file Now what is the next step?
'ca', 'fr', 'au' is my stores code
How can I configure store urls like below?
Please Help it's urgent!

  Canada             https://mywebsite.com/ca/
  France              https://mywebsite.com/fr/
  Australia           https://mywebsite.com/au/

URLS GOING to 404 error: Page not found.


texts: Magento 2 REST API - How to add product custom attribute type file upload to a product when adding a product

texts:
I'm working on a project where my product has some datasheets that has to be uploaded to the website. Right now I've created one product attribute named datasheet with attribute type file upload. I'm able to create product using REST API. But the problem is I cannot able to add this files through API as I'm confused how to add this through it.
I know that we can use
"custom_attributes": [     { "attribute_code": "item_ship_day", "value": "Ships in 2 days" }, }
works for normal attributes. But what about file upload


texts: How to get customerId on sales_order_place_after observer?

texts:
I'm trying to get the CustomerId when an order is placed so that I can manipulate it before the order is saved to the DB.
Vendor/Module/etc/frontend/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_after">
        <observer name="VendorModule" instance="Vendor\Module\Observer\Order\Order"/>
    </event>
</config>

Vendor/Module/Observer/Order/Order.php
<?php

declare(strict_types=1);

namespace Vendor\Module\Observer\Order;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class Order implements ObserverInterface
{
    protected $_logger;
    protected $order;

    /**
     * Order constructor.
     * @param \Psr\Log\LoggerInterface $_logger
     * @var \Magento\Sales\Model\Order $order
     */

    public function __construct(
        \Psr\Log\LoggerInterface $_logger,
        \Magento\Sales\Model\Order $order
    )
    {
        $this->logger = $_logger;
        $this->order = $order;
    }

    public function execute(Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        $customerId = $order->getCustomerId();
        $this->_logger->info('Customer ID is' . $customerId);

        if ($customerId !== 0) {
            //do stuff
        }
    }
}

This does not even log anything to var/log/debug.log
How would I get the customerId on sales_order_place_after observer?
UPDATE
<?php

declare(strict_types=1);

namespace Vendor\Module\Observer\Order;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class Order implements ObserverInterface
{
    private $logger;
    private $order;
    private $customer;

    /**
     * Order constructor.
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Sales\Model\Order $order
     * @param \Magento\Customer\Model\Session $customer
     *
     */

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        \Magento\Sales\Model\Order $order,
        \Magento\Customer\Model\Session $customer
    )
    {
        $this->logger = $logger;
        $this->order = $order;
        $this->customer = $customer;
    }

    public function execute(Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        //$customerId = $order->getCustomerId();
        $customer = $this->customer;
        $customerName = $customer->getName();
        $this->logger->info('Customer name is' . $customerName);

        if ($customerName !== "Tom") {
            die();
        }
    }
}


texts:
I have created a custom collection factory. Now I want the sum of a column,how can I achieve it. Here is my code

$collection = $this->customFactory->create()->addFieldToFilter('status',2)  ->addFieldToFilter('customer_id',2)
->columns('SUM(total) AS total')
->group('customer_id');


texts:
I currently created an extension which does a series of works to the category and product url.

Then I need to tell Magento not to include some of the categories and products if they have certain attributes.

But I'm a bit new so I need to know where do I setup my function. Is it in Observer.php or do I need to create another observer?

How to hook the event to my function. I think that would be in the config.xml like below:

<frontend>
    <events>
        <core_block_abstract_prepare_layout_before>
            <observers>
                <updater>
                    <type>model</type>
                    <class>My_Updater_Model_Observer</class>
                    <method>beforeLoadLayout</method>
                </updater>
            </observers>
        </core_block_abstract_prepare_layout_before>
    </events>
</frontend>

Thanks.


texts: Difference between these 3 shopping cart calls?

texts:
I read these 3 snippets from the Internet of obtaining shopping cart contents.

Snippet 1

$quote = Mage::getSingleton('checkout/session')->getQuote();
$cartItems = $quote->getAllVisibleItems();
foreach ($cartItems as $item) {
    // get item details here
}

Snippet 2

$cartItems = Mage::getModel("checkout/cart")->getItems();
foreach($cartItems as $item) {
    // get item details here
}

Snippet 3

$cartHelper = Mage::helper('checkout/cart');
$cartItems = $cartHelper->getCart()->getItems();
foreach($cartItems as $item) {
    // get item details here
}

What are the difference the snippets above? All of them return the same items.


texts: Magento 2 some functions' definition does not exist

texts:
I use Magento 2.1.9, I came across these 2 that I could not find their definitions anywhere in the code:

Interface: \Magento\CatalogInventory\Api\Data\StockItemInterface

Class: \Magento\CatalogInventory\Model\Stock\Item

Method: setStockStatusChangedAutomaticallyFlag()

Interface: \Magento\Quote\Api\Data\CartInterface

Class: \Magento\Quote\Model\Quote

Method: getInventoryProcessed() and setInventoryProcessed()

Why magento hides these, or does not include documentation.

Thanks


texts: Update stock quantities via magento SOAP API v2 in C#

texts:
This an old question from the old Magento forum (http://www.magentocommerce.com/boards/viewthread/513702/#top).

I am trying to update stock quantities via magento API method (cataloginventory_stock_item.update) on my application in C#.

The callReturn I get is “true” - which means it updated successfully.

However when I go to the store and check the inventory qty value, I only get the first digit of the value I posted.
For example, when I posted with qty = 80 (or 876 or 8123), I got a stock qty of only 8.

Why am I getting only the first digit through ?

Please advise.

Thank you.


texts:
I'm trying to import PHP Libraries from SiftScience,
here is the library that i'm importing, just the lib folder https://github.com/SiftScience/sift-php

I have put this files into rootmagento/lib/internal/SiftLibrary/SiftMaster
Then inside that path, i created a registration.php file with the following code:

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LIBRARY,
    'SiftLibrary/SiftMaster',
    __DIR__
);

When I run the command  php bin/magento setup:di:compile it throws me this error:

Class \Services_JSON does not exist

Could it be because JSON.php class is inside a folder Services_JSON-1.0.3

Thank you!


texts: 5 malicious files found in Magento with a malware scan - are they for real or false positive?

texts:
Magento 1.9.x
Softaculous installer in Cpanel

A malware scan on our server has detected the following 5 malicious files - are these really problematic or could these just be false positives?

/home/mainaccountuser/ourdomain.com-old/softaculous_backups/errors/default/default.php
/home/mainaccountuser/ourdomain.com/errors/default/default.php
/home/mainaccountuser/ourdomain.com-old/softaculous_backups/errors/default/dev.php
/home/mainaccountuser/ourdomain.com/errors/default/dev.php
/home/mainaccountuser/ourdomain.com-old/softaculous_backups/media/catalog/product/watermark/default/test.gif

Our hosting company says: "Please review the report in question on your end with the assistance of a security expert and update us here once the malicious files have been removed or cleaned so that we can run another scan of your account and confirm if any malicious files remain." so they clearly think these are genuine malware threads.

3 of these are in the 'softaculous_backups' directory. We don't currently use backups from/through Softaculous - we just used the service being part of the Cpanel for the initial install. I should be able to just delete the 'softaculous_backups' directory, right?

What is the errors folder for? Is that part of Magento's functionality? I checked 2 other Magento installs and I don't see either default.php or dev.php so I assume these could be problematic? Is it enough just to delete these files individually? Any other thoughts on this?


texts: How to Apply Catalog Price Rule BY category

texts:
I want to apply discounts on a product by category. If product X is in multiple categories, then its discount should to be by individual category.

Example: product X is in category "men" and "accessories"

If I navigate in men then it shows 10 % discount on that product.
If I navigate accessories then it shows 20 % discount.

But in Magento its applying the same discount on both categories.

Is it possible to show different discounts for the same product?


texts: Use custom attributes in New Product Widget

texts:
I'm using the New Products widget on my home page and I'm also using a plugin that adds some flooring attributes to products. In the regular product listings, this plugin automatically will format the price by the square foot rather than the package price. However, in the New Products widget, it shows the packet price. I tried making a new template and manually checking the attribute, but I quickly discovered that most attributes are not loading with the products at all in that widget, and therefore the template sees them as non-flooring products (and it doesn't read any other standard attributes with which I wanted to enhance the display of products). How can I fix this? How can I load the attributes for the products in the New Products widget?

<?php if ($_product->getIsFlooringProduct()): ?>
    <?php $unit = Mage::getStoreConfig('bs_flooring/general/unit');?>
    <?php echo Mage::helper('core')->currency($_product->getFinalPrice() / (float)$_product->getFlooringCoverage()) ?>/<?php echo $unit ?>
    <!-- This doesn't get rendered -->
<?php else: ?>
    <?php echo $this->getPriceHtml($_product, true) ?>
    <!-- This always gets rendered -->
<?php endif ?>


texts: Save button is missing in the shipping address form at checkout page

texts: In checkout page when I click on +new address button a popup is shown with a form in it but the save button is missing. How to add the missing save button in the popup form.


texts: Magento 2 - Redirect user to specific page after register

texts:
I write an observer to observe the customer_register_success event and run the following codes to do the redirect but failed. Can anyone help?

$url = $this->url->getUrl('/');
$observer->getControllerAction()->getResponse()->setRedirect($url);
$this->logger->debug("Redirect to: {$url}");


texts: How to update cart qty using ajax Magento 2

texts:
How to update cart qty using ajax magento 2

I want to change qty on cart page.
I don't want to use the update button. It should be update automatically without reloading the page.


texts: How can i add $5 extra fee on choosing of UPS shipping if order is greater then $200 using shipping rules in Magento2?

texts:
I want to add shipping rule for ups shipping to add extra $5 if order total is greater then $200.

I want to use shipping Rules only as i will set many rules for different conditions.


texts: Remove PayPal Express Checkout from StoreView

texts:
I have two store views which share the same product category and on one of them I want to disable PayPal Express Checkout.

This cant be done in the back-end without disabling it for both store views.

What I have tried so far is:

config.xml in app/code/local/Bh/ZeroSubtotalpaymentmethod/etc

<?xml version="1.0" ?>
<config>
    <modules>
        <Bh_ZeroSubtotalpaymentmethod>
            <version>1.0.1</version>
        </Bh_ZeroSubtotalpaymentmethod>
    </modules>
    <global>
        <models>
            <zerosubtotalpaymentmethod>
            <class>Bh_ZeroSubtotalpaymentmethod_Model</class>
            </zerosubtotalpaymentmethod>
        </models>
    </global>
    <frontend>
        <events>
            <payment_method_is_active>
                <observers>
                    <paymentfilter_payment_method_is_active>
                        <type>singleton</type>
                        <class>zerosubtotalpaymentmethod/observer</class>
                        <method>filterpaymentmethod</method>
                    </paymentfilter_payment_method_is_active>
                </observers>
            </payment_method_is_active>
        </events>
    </frontend>
</config>

Observer.php in app/code/local/Bh/ZeroSubtotalpaymentmethod/Model

class Bh_ZeroSubtotalpaymentmethod_Model_Observer {

    public function filterpaymentmethod(Varien_Event_Observer $observer) {

        /* call get payment method */
        $method = $observer->getEvent()->getMethodInstance();

        if($method->getCode()=='paypal_express_checkout')
        {   $quote = $observer->getEvent()->getQuote();
            if(Mage::app()->getStore()->getCode()=='wa'){
            $result = $observer->getEvent()->getResult();
            $result->isAvailable = false;
            }
            return;
        }
        return;
    }
}

I am not sure exactly what the $method->getCode() is. does this code look right for what I want to do?


texts:
At first, this has been asked before. But no one has answered yet.

My Sales rep sometime create orders with items having 0 cost. And the problem is now, when customer return those items, magento doesn't allow us to create Credit Memo.

It throw error message:

  Credit memo's total must be positive.

I can see this function is responsible for this:

            if (($creditmemo->getGrandTotal() <=0) && (!$creditmemo->getAllowZeroGrandTotal())) {
                 Mage::throwException(
                    $this->__('Credit Memo total must be positive.')
                 );
             }

I can surely remove this condition from Save Credit Memo function.

But I want to know if it will trigger some other issue? Why magento has this condition in first place?


texts: 'Remaining Time: 5 days' then 'MySQL server has gone away' with Magento 2 data migration tool via Docker. How do I fix this?

texts:
I'm using the Magento2 data-migration-tool from https://github.com/magento/data-migration-tool-ce to migrate a Magento 1.7.0.2 database to Magento 2.0.0.

I have successfully migrated settings.

When running the data migration, all the integrity checks pass, as you can see in the output below. However, when the tool reaches [stage: data migration][step: Customer Attributes step], the output announces "Remaining Time: 5 days" and does not progress past 0%.

Eventually the tool bombs out with PDOStatement::execute(): MySQL server has gone away.

In an attempt to reduce the time estimate of 5 days, I imported the source database to the target mysql server.

Running SHOW PROCESSLIST on the Magento 2 database server while the tool is running shows no active processes.

There's not a lot of discussion around this tool available yet online. It would be very useful:

to have some confirmation that people have successfully used this tool to migrate a Magento 1.x database to Magento 2.0.0
to receive suggestions as to how I can speed up the import, or investigate what is causing it to hang

Here's the tool output from debug mode (with -vvv option), showing the point at which the tool hangs before bombing out:

[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: EAV Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Map Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Log Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: setup triggers][step: Stage]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: data migration][step: EAV Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: volume check][step: EAV Step]: started
[2015-12-09 09:24:10][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started
[2015-12-09 09:24:10][DEBUG][mode: data][stage: data migration][step: Customer Attributes Step][table: customer_entity]: migrating
100% [============================] Remaining Time: 1 sec

Further information about my Magento 2 deployment:

I'm using a docker-compose setup, with multiple docker containers for php-fpm, maria DB and app/data volumes, as per http://mageinferno.com/blog/magento-2-development-docker-os-x (but on Ubuntu)
The Magento 2 installation works as expected, and after running the data migration tool's settings step my settings are used and available
I'm running the data migration tool in a bash terminal started using docker exec.

It seems as if the docker setup might have something to do with this problem, although I haven't come across any issues during normal Magento 2 operation, or the settings step of the migration, which completes very quickly.

I've examined var/migration.log, which shows no further detail.


texts: How to override the entire product page with a new template for products which are Out of Stock?

texts:
I would like to change the way Magento 2's product page looks for products which are Out of Stock. Basically I want to replace the entire product page with a simple message (and maybe a picture of the product).

In Magento 1, this could be done easily because a single template (catalog/product/view.phtml) rendered the entire product page, and you could simply add some code at the top of that template to check if the product was Out of Stock and display a message instead of the normal product page.

However, in Magento 2, there is no equivalent of catalog/product/view.phtml (that I can see) and the whole product page is rendered via layout XML.

So how can I accomplish this in Magento 2?


texts: Disable caching of header.phtml for one template

texts:
I'm trying to stop my header from being cached on my onestepcheckout page so we can remove large amounts of content and streamline the checkout. I've added a check to see if the current page is the checkout, if not it will output the content.

This all works fine, until I enable the cache. I've tried changing my checkout.phtml to echo $this->getChildHtml('header', false); but this did not work.

I've also tried to disable the headers cache in my local.xml file, but this again has not worked.

<reference name="header">
   <action method="unsetData"><key>cache_lifetime</key></action>
   <action method="unsetData"><key>cache_tags</key></action>
   ...

I'm not sure what I'm doing wrong, these seem to be the 2 methods that I've seen online for this and can't find anything that specifically refers to the header, and a lot talk about having to make custom modules to output the template content, I am sure there must be a simpler solution.

I'm running Magento 1.9.


texts: using jQuery-ui accordion in checkout page

texts:
I can not figure out how can i add jQuery-ui accordion to the checkout page block that this sample module, what is made by @sohelrana09, creates?

.../web/template/checkout/shipping/additional-block.html

Section 1

Mauris mauris ante

Section 2

Sed non urna.

Reading Magento 2 documentation i know that magento 2 does not contain jQuery ui styles locally. Because of that i created custom css where i dropped accordion styling .css fail content. I added stylesheet to checkout_index_index.xml file head section.

I can not use require(['jQuery','tabs'].. in script section of html file because it gets the css file though the jQuery page url that does not use https. I also have found this magento.stackexchange post but don't know if and how it would help me.

What i added to .../frontend/layout/checkout_index_index.xml file:

    <css src="SR_AdditionalShippingBlock::css/accordion.css"/>


texts: Invalid template file error for overiding template using my custom theme

texts:
I m overriding result phtml template using my custom theme.

Here is what i have done

In my

   app\design\frontend\MyTheme\tagtheme\Magento_CatalogSearch\templates\

i have copied result.phtml from CatalogSearch view template folder.

I get log as :

[2016-08-18 12:54:13] main.CRITICAL: Invalid template file: 'result.phtml' in module: 'Vendor_Module' block's name: 'search.result' [] []

Should i have to override the layout file as well?


texts: PHP Fatal error on running bin/magento inventory:reservation:list-inconsistencies command

texts:
I am getting this error when running bin/magento inventory:reservation:list-inconsistencies:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\Inventory\Model\ResourceModel\IsProductAssignedToStock::execute() must be of the type string, integer given, called in /mydomain/http/vendor/magento/module-inventory-reservation-cli/Model/SalableQuantityInconsistency/FilterManagedStockProducts.php on line 56 and defined in /mydomain/http/vendor/magento/module-inventory/Model/ResourceModel/IsProductAssignedToStock.php:34
Stack trace:
#0 /mydomain/http/vendor/magento/module-inventory-reservation-cli/Model/SalableQuantityInconsistency/FilterManagedStockProducts.php(56): Magento\Inventory\Model\ResourceModel\IsProductAssignedToStock->execute(1091634, 1)
#1 /mydomain/http/vendor/magento/module-inventory-reservation-cli/Model/GetSalableQuantityInconsistencies.php(105): Magento\InventoryReservationCli\Model\SalableQua in /mydomain/http/vendor/magento/module-inventory/Model/ResourceModel/IsProductAssignedToStock.php on line 34

Any ideas on how to solve this?


texts: JS Bundling causing loading spinner issues in IE11 checkout - Magento 2

texts:
Have tried to use Magento 2's JS bundling and am running into a strange error on IE 11 only. When proceeding to the checkout the loading spinner will not disappear. The page seems to load correctly in the background, but spinner just sticks.

We have removed all checkout javascript from the js bundling and the issue persists.

We do get a strange static.js console error, this might be related?

The syntax error it is referring to is this:

Any help would be hugely appreciated! As mentioned if we turn off JS Bundling the issue disappears.

Thanks


texts: Automatically import & export of products, customers and possibly other things

texts:
I have a situation where I need to import and export a lot of information between a "central system" and Magento. Basically Magento would be a "shell" of the central system which pretty much contains all the information and creates products etc. There will be multiple "real" stores talking to the central system, which also talks to Magento.

Some of my questions and concerns. Would appreciate all answers, even those who just points me in the right direction here.

Questions

Is it possible to automatically import (and export at certain "hooks") information and match those to for example product creation. For example talking with a standardized API, spitting out XML files of products from the central system.

The extension/way of doing it would have to be able to check for new products or statuses of products (if in stock & how many are available) every 5th minute or so. Many even more.

It would look at the XML and create new products based on that. That would include ALL information needed for the product, with maybe an exception for images. So basically name, descritpion, sku, status, price, special price, special price dates, categories, related products etc.

The other half of the problem would be "exporting" the statuses from Magento back to the other system. For example if someone buys a product in the Webshop It would need to notify it back to the "central" system.

Is it possible to export all orders and all order information to the central system where it would be "taken care" of instead of using Magento for that. This would need to happen as soon as someones buys something.


texts: How to remove products from the particular store view in magento2

texts:
I have created three website view and three store views in magento2(English,French & German). I have uploaded the products through default magento2 CSV import option and mapped to all store views.

  product_websites

  french,english,german

Now I want to remove the exisiting product from the German store view. How to do it via magento import option without Replace option like below

  product_websites

  french,english

Any help on this issue please?


texts:
I'm brand new to Magento and am having trouble getting my config.xml file to load my layout file for the url: "localhost/index.php/moduleone/index/index".  Can somebody help me figure out what I'm missing?

magento/app/code/local/Test/ModuleOne/etc/config.xml:

<config>
    <modules>
        <Test_ModuleOne>
            <version>0.1.0</version>
        </Test_ModuleOne>
    </modules>
    <frontend>
        <routers>
            ...
        </routers>
        <layout>
            <updates>
                <moduleone>
                    <file>moduleone.xml</file> <!-- Our layout file name-->
                </moduleone>
            </updates>
        </layout>
    </frontend>
    <global>
        ...
    </global>
</config>

magento/app/design/frontend/default/layout/moduleone.xml:

<?xml version="1.0"?>
    <layout version="0.1.0">
    <moduleone_index_index>
        <reference name="content">
            <block type="moduleone/moduleone" name="moduleone" template="moduleone/moduleone.phtml" />
        </reference>
    </moduleone_index_index>
</layout>


texts: Magento 2.2 LESS not compiling locally on Ubuntu

texts:
I'm using Ubuntu with Magento 2.2 installed locally for development.

I'm updating my LESS, but it's just not compiling for some reason.

I have all caching turned off in Cache Management, and I run magento setup:static-content:deploy -f after any LESS modifications, but it's still not compiling and showing my changes. I just changed a css padding value from 10 to 11 to test, and it's still set to 10.

I also have caching turned off in my browser, too. And I've ran rm -rf var/view_processed then static content deploy, but that didn't work either.

Also, My Workflow Type is set to Server side less compilation, and the local install of Magento 2 is set to Developer Mode.

So I'm at a loss for what to do to get my LESS to compile into CSS. It's just not doing it for some reason.

Any ideas?

Thank you.


texts: How to change checkout page label state/province to Delivery location anyone help me


texts:
How can I edit the {{var alertGrid|raw}} for the magento 2.2.x stock alert email?

I know the template is found in vendor\magento\module-product-alert\view\frontend\email\stock_alert.html but the template references the variable.

I want to remove the product price from the grid.

It appears to be defined here: M2 Product Alert Email, however, I don't see a straightforward way of editing the layout or removing the price.

Alternatively, I could remove the variable from the template, but how do I add back the product name and link to the product?


texts:
I'm trying to display related products in the product view page. I created a collection of them but when i try to fetch them, the getName() method renders the correct name but getProductUrl() renders the url of the parent product.
Here is my code:

  $categoryId = array_shift($_product->getCategoryIds());
  $related_prods = Mage::getModel('catalog/product')
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addUrlRewrite($categoryId)
                ->addAttributeToFilter('entity_id',array('in'=>$_product->getRelatedProductIds()))->load();

  <?php foreach($related_prods as $related){ ?>
  <a href="<?php  $this->getUrl('books').$related->getUrlPath()."
";?>"><?php echo $related->getName();?>
  <?php } ?>

Thanks in advance.


texts: Add/Edit Product - Append selected attribute value to product title

texts:
I would like to Add selected attribute values to product title while adding/editing a product in admin.

eg. Product Name entered: Laptop

Attributes Selected
1) Brand - Toshiba
2) Colour- White
3) other attribute value

When a product added/edited from admin, the above selected attribute value concatenate to the title and then save in database.

Final Output: Product Name: Toshiba Laptop White (attribute sequence doesn't matter)

While writing this question: other issue, while editing product the attribute values saved in database will be shown in product name field. So while submitting the revised item, ideally it should check if product name contains attribute value if so ignore attribute values.

Basically, I want product name based on selected attributes values of a certain product.

By this, custom attributes are not required to manually add on places like catalog list/view, cart, invoices, pdf, email, customer account, breadcrumb, and other relative places.

[The other solution would be manually echo of attribute values on required locations (invoices, pdf, email, catalog and so on) which means editing lots of files which in opinion would be cumbersome!]

I am open to paid extension/work or customise code which could resolve this issue.

Please anyone who could help ?

Thank you


texts: Where to declare a magento registry value

texts:
I have a custom module, which uses the sales_order_place_before observer. I have a set of code in there which scans through the products, and adds items to the order, where necessary. However, I have found that this is running twice, so wherever it adds an item to the order, it does so twice.

I can't work out why it is running twice, so I was going to use a Magento registry value, set to false, and when it has ran once, change it to true, and wrap an if statement around my code, which check that value. In the custom module, I only have the config.xml file and the Observer.php. Where do I put the

Mage::registry('check_sales_order_before', false);

code? I don't think I can put it in the observer, or it will just reset every time, and cause the exact same issue. I'm assuming I add another file somewhere in my module, or place it in a central file somewhere.

Any ideas?

Thank you.


texts: Add new fields - prefix, suffix - magento 1,9

texts:
I need to create 2 fields in checkout.

I want not to create a new fields in db (the web site is online).

I would like to use prefix and suffix.

If in back-end this fields is set "visible", the fields is visible in checkout. I would like to set "disable" in back-end and insert this string in checkout:

<input type="text" id="billing:prefix" name="billing [prefix]" title="Prefix" class="input-text validate-email" value="<?php echo $this->escapeHtml($this->getAddress()->getPrefix())?>">

but the value is not registered in db.
The value is registered in db only the fields is set enable in back-end.

There is a way to register the value prefix and suffix with  disable in back-end?

can you help me?

Is there another way to use the fields prefix and suffix with disable in the back-end?

Thanks


texts: when the searched product does not exist in database then how to show that searched product?

texts:
In the search engine i have searched one product.that product not in the database but product is moving to add to cart page and store in the database and it will show the message not in stock but in short time will give you the product.
How to do that?


texts: Magento 2.3.3 - Add file upload field to Contact Page

texts:
what is the best way to add a File Upload field in the Contact Page? I want to give users option to upload a file. I try this module but is not work on my 2.3.3 Magento version.

Thank you


texts: Getting Error When Attaching Video URL To Product

texts:
Done With API Key Configurations:

Error Getting when entering url


texts:
I have this code for getting a list of category IDs:

$categoryModel = Mage::getModel('catalog/category')->load($id);
$allCategoryIds = $category->getResource()->getChildren($category, true);

This gives me a nice little array with a list of category IDs, like this:

Array([0] => 10, [1] => 11, [2] => 3, [3] => 4, [4] => 5, [5] => 6, [6] => 7, [7] => 14, [8] => 17, [9] => 18);

What I want to do is order this array by the position these categories appear in the Admin Panel.

To begin with I looked into these solutions:

how to sort categories as they are shown in admin?
In Magento how do I get the listing of categories in the order you see in the admin area?

However both of these solutions end up using an entire collection, and then sorting that collection. To get my array sorted as I would like, I would have to iterate through the entire collection and use that to re-order my array. This seems wrong / wasteful to me (please correct me if I am wrong here).

I am wondering if an SQL call be made to the database to get a simple array of Category IDs and their position in the Admin Panel? Would this be quicker and more efficient than using Magento's system? I would rather use Magento's system if possible, but not if it involves iterating over several large objects (this page is already doing a lot of work).

So my question is:

What is the easiest and most efficient way of getting just an array of category IDs (like above), but in order of of they are displayed in the Admin Panel?


texts:
I need to allow the customer to compare the product even if there is no stock, in fact I need my simple item to behave when out of stock as if it were normally available.
What would be the best way to approach this?
After a lot of searching on the web, I didn't find anything that could help me with this ..
I thank you for your attention :)
Magento 2.3.4


texts:
We are currently using Magento 2 and all the images uploaded to the website are resized or modified by the system. The result is a poor image quality on all the products.

I'm not finding any configuration on the backend to change this settings and I understand that's managed directly from que PHP Image library.

That's our current env:

Container 1: MariaDB
Container 2: Redis (for Magento's cache)
Container 3: Apache 2.4 + PHP 7 (modphp and PHP GD2)
Container 4: Cron
Container 5: Varnish 4
Container 6: Redis (for autodiscovery cluster nodes)
Container 7: Nginx SSL terminator

I checked on the Settings -> Developer you can switch to Image Magick. It's this the solution?

Thanks


texts: How to initialize a block loader on an element which is being loaded by knockout.js in Magento 2?

texts:
I'm trying to implement a "block loader" animation on the cart summary element on the cart page while the cart totals are loading.

The template file which loads this is Magento_Checkout/templates/cart/totals.phtml.
It loads the totals with knockout.js and reads the html templates from checkout_cart_index.xml:

EDIT

Magento has a default loader on the cart totals when the customer clicks on the estimated shipping country, but I find this functionality useless, so I've disabled it.

I'm trying to show the loader animation when the cart page is loading. There is always a delay before the totals show up, so the my goal is to show a loader here before they are fully loaded.

I've made several attempts in Magento_Checkout::templates/cart/totals.phtml

Attempt 1 - through x-magento-init script

Attempt 2 - by triggering processStart on the element

Attempt 3 - data-mage-init

Each attempt failed. It just doesn't show the loader.

What am I missing here?


texts: Billing and Shipping Company Column on Sales Order Grid

texts:
I am able to show either the billing or shipping company for an order but I can't seem to grasp how to show both at the same time. Here are my files to show billing company name.

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Sales\Model\ResourceModel\Order\Customer" type="Trucatch\Sales\Model\ResourceModel\Order\Customer" />
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <plugin name="sales_order_additional_columns" type="Trucatch\Sales\Plugin\AddColumnsSalesOrderGridCollection" sortOrder="100" disabled="false" />
    </type>
</config>

Plugin/AddColumnsSalesOrderGridCollection.php

<?php namespace Trucatch\Sales\Plugin;

use Magento\Framework\Message\ManagerInterface as MessageManager;
use Magento\Sales\Model\ResourceModel\Order\Grid\Collection as SalesOrderGridCollection;

class AddColumnsSalesOrderGridCollection
{
    public function aroundGetReport($subject, \Closure $proceed, $requestName) {
        $result = $proceed($requestName);

        if ($requestName === "sales_order_grid_data_source") {
            $select = $result->getSelect();

            $select->join(
                ["soa" => "sales_order_address"],
                'main_table.entity_id = soa.parent_id AND soa.address_type = "billing"',
                array('company')
            )
                ->distinct();
        }

        return $result;
    }
}

view/adminhtml/ui_component/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <columns name="sales_order_columns">

        <!-- sales_order_address billing_company -->
        <column name="company">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Bill-to Company</item>
                    <item name="sortOrder" xsi:type="number">4</item>
                    <item name="align" xsi:type="string">left</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="visible" xsi:type="boolean">true</item>
                </item>
            </argument>
        </column>

    </columns>

</listing>

To show the shipping company name I simply change

soa.address_type = "billing"

to

soa.address_type = "shipping"

But I would like to show both at the same time. I was trying something like this and then rename the information to billing_company and shipping_company instead of company. This was I could call them on the sales_order_grid.xml individually.

    $select->join(
        ["soa" => "sales_order_address"],
        'main_table.entity_id = soa.parent_id AND soa.address_type = "billing"',
        array('company'),
        'main_table.entity_id = soa.parent_id AND soa.address_type = "shipping"',
        array('company')
    )

But I am not sure how to proceed in renaming the results for each.

Thanks!

EDIT

Figured out how to rename by using:

array('billing_company' => 'company')

But now I am still trying to add another join instance for the "shipping" row and not having any luck.


texts: Error occurs when I try to observer order status change in magento

texts:
An error occurs when I try to observer order status change in Magento:

Uncaught exception 'Mage_Core_Exception' with message 'Mage registry key "_singleton/" already exists' in app\Mage.php:595
Stack trace:
#0 app\Mage.php(223): Mage::throwException('Mage registry k...')
#1 app\Mage.php(477): Mage::register('_singleton/', false)
#2 app\code\core\Mage\Core\Model\App.php(1336): Mage::getSingleton(false)
#3 app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('sales_order_sav...', Array)
#4 app\code\core\Mage\Core\Model\Abstract.php(466): Mage::dispatchEvent('sales_order_sav...', Array)
#5 app\code\core\Mage\Sales\Model\Order.php(2228): Mage_Core_Model_Abstract->_afterSave()
#6 app\code\core\Mage\Core\Model\Abstract.php(319): Mage_Sales_Model_Order->_afterSave()
#7 app\code\core\Mage\Core\Model\Resource\Transaction.php(151): Mage_Core_Model_Abstract->save()
#8 in app\Mage.php on line 595

And my observer file is like this:

Class Atwix_Orderhool_Model_Observer extends Mage_Sales_Model_Order{

    public function implementOrderStatus(Varien_Event_Observer $observer)
    {
        /* @var Mage_Sales_Model_Order $order */
        $order = $observer->getOrder();

        // Only trigger when an order enters processing state.
        if ($order->getOrigData('state')!=$order->getState()) {
            Mage::app()->getResponse()
            ->setRedirect('127.0.0.1:3122/magento19/create_order.php')
            ->sendResponse();
        }

    }
}


texts: How to add correct hreflang for google like "en-gb" instead of "en_GB"

texts:
I have multiple store site in magento.
i wanted to add hreflang for my stores and thanks to one of the post here i have managed to do so.

the code i wrote in my

  app / design / frontend / mytheme / default / template / page / html / head.phtml

and the code it self is

    $website = Mage::app()->getWebsite()->getStores();
foreach ( $website as $store) {
    $lang = $store->getConfig('general/locale/code');
    echo '<link rel="alternate" href="' . preg_replace('/\?.*/', '', $store->getCurrentUrl()) . '" hreflang="' . $lang . '"/>' . "\n";
}

and the result i am getting on front end is

<link rel="alternate" href="http://www.mysite.co.uk/en/" hreflang="en_GB"/>
<link rel="alternate" href="http://www.mysite.co.uk/fr/" hreflang="fr_FR"/>
<link rel="alternate" href="http://www.mysite.co.uk/de/" hreflang="de_DE"/>
<link rel="alternate" href="http://www.mysite.co.uk/it/" hreflang="it_IT"/>

but the issue is, as you know hreflang="en_GB" is incorrect and google wont recognize it. the tag should be hreflang="en-gb" dash - instead of _ and all lower caps. how to achieve this?
and 2nd is it important to have URL parameter /en/ for English site? cant this be without /en/? if so then how to achieve this? rest EU sites are fine to have parameters but English store should be with out it.
Thanks


texts: Magento 2 how to create link_title column for the table catalog_product_link

texts:
How to create column called link_title  to the catalog_product_link table
& what are the steps, need to be followed to set the value to the respected column

Did small prototype as followed here but unable to save data.

<?php
ini_set('display_errors', '1');
ini_set('error_reporting', E_ALL);
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$sourceMaterial='24-MB01';
$productLink = $objectManager->create('Magento\Catalog\Api\Data\ProductLinkInterface')
    ->setSku($sourceMaterial)
    ->setLinkedProductSku('24-MB06')
    ->setLinkTitle("helloworld")
    ->setLinkType('required');
$linkData[] = $productLink;
$product = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface')->get($sourceMaterial);
if($product) {
    $product->setProductLinks($linkData)->save();
}
?>

The recorded data is saving without  link_title value not saving.


texts:
My local installation shows content on every existing cms page.

The remote installation show no content on  none of the cms blocks.

File basis is the same for both. Cache is off. Content is existing.
The only page showing content is the cms page.
If I analysis the blocks, everything is there and correctly nested.

Any hints what could cause the issue?


texts: Get Shipping Adress City State From Checkout page In Custom Module Magento 2

texts:
How to get city state value from onepage checkout in Magento 2 in custom module
i had use below code for Magento 1.X but cant do it for magento 2.x
have any suggestion ? how can i get these values ?

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCity();

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getRegionId();


texts: Magento 2: how to send ajax request in knockout js?

texts:
We have one button on checkout page to find address from our

API. We want to send one ajax request to that API to get some data.

How do we send ajax request from knockout js?


texts: Magento Reflection Exception Error on application homepage

texts: i recently just cloned a repo from github which is supposed to help me customize the magento city field on the checkout page. But i get the following error after installing the module. Package github repository https://github.com/EaDesgin/Magento2-City-Dropdown


texts: I am facing this error in contact form submit after Unable to submit your request. Please, try again later if anyone know reply me


texts: magento 2 Product description tab image problem gets smaller?

texts:
As shown in the image bellow im importing image in product discription with original size is (826px x 8191px) but after importing it it's getting smaller and resized to (152px x 1507px).

how can i keep the image in a big size ?


texts: Invalid block type: Magento\CMS\Block\Block (magento 2)

texts:
I have created custom CMS block with ID:headerlink

I am calling it in header/logo.phtml

with this code

<?php echo $block->getLayout()->createBlock('Magento\CMS\Block\Block')->blockId('headerlink')->toHtml();?>

but I am getting this error, as cms block class not found

2 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: Magento\CMS\Block\Block
Exception #1 (ReflectionException): Class Magento\CMS\Block\Block does not exist


texts: Magento 2 writing messages to a log file

texts:
How do enable logging in Magento 2, i'm in development mode, i've checked file permissions on all the log files and they all have write access. Magento errors are also visible. Is there anything else i need to do?

i'm just trying to write "test" to the logs for now, i've instantiated the logger class through DI and i'm calling debug as follows:

$this->_logger->debug("test");

I've checked the debug.log and the system.log and there's nothing in there?


texts: Injecting Guzzle with Parameters Magento 2

texts:
Writing some REST API bits and going to use Guzzle, which I have used many times before.

The issue I am coming across is, I know Guzzle has to take the configuration via parameters when constructing it, but when using dependency injection to instantiate Guzzle in my model, I can't then set the configuration parameters on it.

Whats the best way to handle this?

Thanks


texts: Layout handle explanation about catalog/category page

texts:
I would like to have a specific and precise explanation about the layout handle of catalog/category page.

From my knowledge i know that there are three different layout handles: catalog_category_view, catalog_category_default, catalog_category_layered

If we take a look at Mage_Catalog_Model_Category::getLayoutUpdateHandle() we will see:

public function getLayoutUpdateHandle()
{
    $layout = 'catalog_category_';
    if ($this->getIsAnchor()) {
        $layout .= 'layered';
    }
    else {
        $layout .= 'default';
    }
    return $layout;
}

So catalog_category_layered is loaded when is_anchor is set to yes, otherwise the catalog_category_default is the one who will be loaded.

And what about catalog_category_view ?

In my case, in my catalog/product page i have catalog_category_view as layout handle with a layered navigation and if I set some category to is_anchor to yes, Im still always have the same layout catalog_category_view ?


texts: Is it possible to add Facebook login/signup without using extensions? If yes, how to do? Or does anyone here know a FREE extension for that?


texts: I need to create a new custom payment module in Magento 1.9, just like cash-on-delivery. anyone can help me.


texts: M2 - Get stock quantity on product detail page

texts:
I need to get the stock quantity on the product detail page. I'm not an expert in Magento but I was being told that using the objectmanager is not a good idea, but in almost every example I find I see the use of the objectmanager.

Is there somehow another way to get the stock quantity on the product detail page?

Regards,


texts: Filtering an order collection by a custom customer attribute?

texts:
I have created a custom customer attribute, let's call it my_custom_attribute.

I need to extend an order collection to include this custom customer attribute for each order.

I have solved this by joining the customer_entity_varchar (since the attribute is of the varchar type) table into the product collection, to get the customer's ID from that:

// First I figure out the internal attribute ID of the custom attribute
$attributeId = Mage::getModel('customer/customer')->getResource()->getAttribute('my_custom_attribute')->getId();

$collection->getSelect()
    ->joinLeft(
        array('customers' => Mage::getSingleton('core/resource')->getTableName('customer_entity_varchar')),
       'customers.entity_id = `main_table`.customer_id AND customers.attribute_id = ' . $attributeId,
        array('my_custom_attribute' => 'customers.value')
)

This works for me, but I feel like it's not a very elegant solution? Is there another more elegant way that I've overlooked?


texts: M2: Setting delivery methods - exact configuration

texts:
How to configure delivery and payment methods.

1) In the first step (1/2) checkout, I can choose the form of delivery:

Courier shipment (paid in advance) - delivery cost 4€)
Courier shipment (payable on delivery) - delivery cost 6€)

2) In the last step (2/2) checkout, I can choose the payment method.

bank transfer
fast online payments
cash on delivery**

OK, just how can I do that:

When I choose the form of delivery (courier shippment payment in advance 4€) it should display only the motions of payment I pay in advance, so this:

bank transfer
fast online payments

When I choose the form of delivery (payable on delivery 6€) it should display only the motions of payment I pay on delivery, so only this one:

cash on delivery

Description issue:

The issues is that when I select whatever shipment, all payment methods are displayed.

For example:

I can choose a cheaper delivery "courier shippment payment in advance 4€" and then in last step checkout I can choose the method of payment on delivery.

How to solve it ?


texts: How do I prevent junk customer registrations on my store?

texts:
I'm going through my registered customer accounts and see tons of spammy registrations like this:

Is there something I should do to

delete the existing spam accounts
prevent future registrations like this.

Also, just out of curiosity, for what reason would these register, who is benefitting from it?


texts: how to get invoice id or details from order?

texts:
how to get invoice deatils or id by order object ?

$orderObject = Mage::getModel('sales/order')->load($orderId);

Any Method to get invoice_id from above order object ?


texts: Why the table column is not deleted after changing the db_schema.xml?

texts:
I described the table with declarative schema (Magento 2.3):

<?xml version="1.0"?>

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="mi_declarative_schema_test" resource="default" comment="Declarative schema test">
        <column xsi:type="int" name="id" identity="true" comment="ID Auto Increment" />
        <column xsi:type="varchar" name="name" length="1024" nullable="false" comment="Name" />
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="id" />
        </constraint>
    </table>
</schema>

I did setup:upgrade, the table was created, everything is ok. I add the columns,do an upgrade - they are added ok. But when I delete columns from xml, they are not deleted from the table. The instruction
https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html says it is enough to delete or comment out the column line.
Magento connects to the DB with root access


texts:
I am not able to checkout using onepage checkout. After BILLING INFORMATION "Continue" Button don't take me Further Step. In console  I can see

 http://fashionwithdeals.com/checkout/onepage/saveBilling/   200 OK
 http://fashionwithdeals.com/checkout/onepage/getAdditional/    200 OK

So what is the problem i can not find ?
can any one help me ?Any kind of Help will appreciate.
I am using magento version :1.9.3.4


texts:
I have an instance of magento and i want to put two differents websites, so i have it :

**Website 1 - Store 1 - View 1**

**Website 2 - Store 2 - View 2**

When i put compiler on, it works on Website 1 but for Website 2 i have a blank empty page.

When i disable compiler, it works for both websites.

Can you help me ?


texts: When trying to create a new customer on the frontend, Magento does not alert the user that an account already exists with that email address. I'm not seeing anything in system.log and cannot figure out what's going wrong.


texts: How to debug the "A technical problem with the server created an error" error?

texts:
I am getting following error.

  A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

Everywhere in my backend. I tried to recompile, flush cache and so on, nothing helps. Logs are empty, so no idea whats going on.

I watch the requests and figured that the call which causes the error looks like this:

  http://example.com/admin_uttzse/mui/index/render/key/cb27d93212d468adc094da6d1b861993a467057147331868d0b2a66a8f429c51/?namespace=notification_area&sorting%5Bfield%5D=created_at&sorting%5Bdirection%5D=asc&isAjax=true

Not sure if this helps any further. Anyone any ideas what might be wrong and how to fix that? I am running 2.2.3.


texts: How to import not confirmed customers via CSV import?

texts:
I'm trying to import customers via CSV Import:

  System > Import/Export > Import > Customers > Append Complex Data

I'd like to import customers which are "not confirmed" after import.

Note: You have to enable the setting System > Configuration > Customer Configuration > Create New Account Options > Require Emails Confirmation to "Yes" for this to take effect.

The values for the confirmation field in the backend are:

<select id="_accountconfirmation" class=" select" name="account[confirmation]">
  <option value="">Confirmed</option>
  <option selected="selected" value="HASH_VALUE">Not confirmed</option>
</select>

My CSV includes the confirmation field which I've set to various values (empty, 0, 1, random numbers,...) but the customers are always "confirmed" after the import is done.


texts:
My application base url is http://216.70.114.XX/~mapple/

From magento panel i've set yes to web server rewrites and my mod_rewrite module is enabled.

But unfortunately my url's are not working (getting 404 error) without index.php suffix after base url

Any guess what might be the issue is ?


texts: Sells falling down after Clear Cache - Magento 1.9

texts:
Before doing a Clear Cache Magento, I got about 3-4 sells per day, after doing a Clear Cache Magento, the sells gone to ZERO.

What's going on?

This is not the first time that I got this issue with Magento (1.9.2.1).


texts: Redirecting to /onepage/success when gateway POST to /payment/response

texts:
I'm owner of little e-shop. Platform - magento 1.9.
For integration with my acquiring provider i copy-past another's code and modified for me.
It's work, except this part:

public function responseAction() {
    if($this->getRequest()->isPost()) {

        $result = $_POST['RESULT'];

        if ( $result == "0") {

            $order = Mage::getModel( 'sales/order' );
            $order->loadByIncrementId( $order_id );
            $order->setState( Mage_Sales_Model_Order::STATE_PROCESSING, true, 'Платеж ОДОБРЕН банком' );

        //  $order->sendNewOrderEmail();
        //  $order->setEmailSent( true );

            $order->save();

            Mage::getSingleton('checkout/session')->unsQuoteId();

            Mage_Core_Controller_Varien_Action::_redirect( 'checkout/onepage/success' );
        }
        else {
            $this->cancelAction();
            Mage_Core_Controller_Varien_Action::_redirect( 'checkout/onepage/failure' );
        }
    }
    else
        Mage_Core_Controller_Varien_Action::_redirect( 'vakavaka' );
}

Gateway of my acquiring provider sending POST to /payment/response if payment verified and accept or declined: result=0 for verified and accept, result=1(2 or 3) if declined or another reason. With "result" param gateway send's many other's parameters.

Work situation:

When payment accepted by gateway and He's sent result=0 (via POST) to http://blahblah.blah/modulename/payment/response, then order is marked as PROCCESSING (with comment), magento sends email to shopper, but shopper redirects to http://blahblah.blah/vakavaka.

If gateway decline payment - order marked as canceled, and shopper redirecting to checkout/onepage/failure (code is work).

I specially mark bold "vakavaka" to attract attention. In my code no this (Mage_Core_Controller_Varien_Action::_redirect( '' );)

What wrong in code?


texts: How to remove zip/postal code in magento 2

texts: I want to know how to remove Zip/postal code from the customer checkout page form in Magento 2?


texts: How to add a Email Reminder and Follow up Email to magento?

texts: I could not find any free extensions and Please can any one help me how to create it?


texts: How to apply magento default form validation in homepage?

texts:
I have one form in hader.phtml of magento.I have added the following line after form and used class="required-entry" for applying validation. In all other pages validtaion is working.But in homepage its not working.can anyone help me.

<script type="text/javascript">
//< ![CDATA[
  var myForm= new VarienForm('new_login', true);
//]]>
</script>


texts: Important div tag commented out when on production mode

texts:
We noticed that some of our page layout has been broken. Did some debugging and found out that when in production mode there are some errors with the tags. Specifically:

Normally it should be:

We cleared all caches, switched to developer mode where the tag appears normally.
Could someone suggest how to debug this for production mode?

We tried to disable all the 3rd party modules, disable all caches, checked most recent cms blocks and pages for div errors. Maybe someone can describe what happens when Magento does the compiling for production mode?


texts: Set a limit on the maximum price of a product?

texts: is it possible to only show products £1000 or under across an entire shop?  Or is there custom XML code you can apply on a per category basis?


texts: Maximum call stack size exceeded in magento2

texts:
Uncaught RangeError: Maximum call stack size exceeded.
at HTMLButtonElement.trigger (717c7c7c456e00bb8693680c02ff88c8.js:3365)
at Object.trigger (717c7c7c456e00bb8693680c02ff88c8.js:3365)
at Object.jQuery.event.trigger (jquery-migrate.js:493)
at HTMLButtonElement.<anonymous> (717c7c7c456e00bb8693680c02ff88c8.js:3365)
at Function.each (717c7c7c456e00bb8693680c02ff88c8.js:3364)
at jQuery.fn.init.each (717c7c7c456e00bb8693680c02ff88c8.js:3364)
at jQuery.fn.init.trigger (717c7c7c456e00bb8693680c02ff88c8.js:3365)
at jQuery.fn.init.n.fn.(anonymous function) [as _focus]
at jQuery.fn.init.focus (717c7c7c456e00bb8693680c02ff88c8.js:3428)
at jQuery.fn.init.$.fn.extend.focus (jquery-ui.js:57)

I am trying to upload images, images are successfully uploaded but on click of cancel or delete button in popup it throws above error.


texts: Should the Cache automatically update after I change a CMS Page?

texts:
In my Magento 2 store, I always have to clear page cache after I update a CMS page (FPC is through Varnish).
I have been doing this for some time but recently stumbled upon another thread suggesting that Magento should know when a CMS page has been changed and automatically refresh it like it does if I change something on a product page.
So the question is quite simpe: Should I need to clear the FPC every time I make a change to a CMS page or do I have an issue?


texts: How to create custom Thank you page in Magento?

texts:
I am working for a Magento based website in which my for contact us page when I fill the form and click on the submit, i got the message of "thankyou" on same page but the url is changing from example.com/contact/ to example.com/contact/index/ (after click on the submit button).

I want to create a custom page of thank you in magento.

e.g. https://www.example.com/thank-you

How can I do this?


texts: Add custom javascript in afterRender in Magento 2 with knockout

texts:
I`m trying to load a custom script after a custom-template for minicart items is rendered.

I created a javascript file vendor\module\view\frontend\web\js\test.js:

define('jquery', function($) {

    alert('Here');

});

and added it to my requirejs-config.js:

var config = {
    map: {
        '*': {
            'Magento_Checkout/template/minicart/item/default.html':
                'Vendor_Module/template/minicart/item/default.html',
            test: 'Vendor_Module/js/test'
        }
    }
};

No I try to run it after the rendering in my default.html with:

But the console just outputs:

  test is not defined

I really would appreciate any help on this. Why is the script not loaded?

For clarification: Vendor and Module are of course placeholders here.


texts: Question of previous developers use of 's

texts:
I'm not only new to Magento, but also inheriting a project from a previous developer. The developer has a module called Adminhtml, which he used to customize the Adminhtml section, and inside the config.xml file we has defined the following re-writes:

    <blocks>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tabs>WG_Adminhtml_Block_Catalog_Product_Edit_Tabs</catalog_product_edit_tabs>
                <dashboard>Catalog_Adminhtml_Block_Dashboard</dashboard>
                <catalog_product_edit_tab_attributes>WG_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes</catalog_product_edit_tab_attributes>
                <catalog_product_edit_tab_settings>WG_Adminhtml_Block_Catalog_Product_Edit_Tab_Settings</catalog_product_edit_tab_settings>
                <catalog_product_edit_tab_attributes_create>WG_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create</catalog_product_edit_tab_attributes_create>
                <catalog_helper_form_wysiwyg>WG_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg</catalog_helper_form_wysiwyg>
                <catalog_product>WG_Adminhtml_Block_Catalog_Product</catalog_product>
                <catalog_product_grid>WG_Adminhtml_Block_Catalog_Product_Grid</catalog_product_grid>
                <catalog_product_edit>WG_Adminhtml_Block_Catalog_Product_Edit</catalog_product_edit>
            </rewrite>
        </adminhtml>
    </blocks>

My question is is this the best way to do this? My suggestion to my supervisor was breaking this into a dedicated module we would call "Showcase", which is basically assembling a customized grid. Is the second way I proposed the acceptable way?


texts:
How to add the price indicator to the custom field in Magento?

I am developing a form to add additional attributes to the product. now I am searching for this functionality for a while, can you help me how to add an icon here?

like this.

    $fieldset->addField(
        'amount',
        'text',
        [
            'name' => 'amount',
            'label' => __('Material Price'),
            'id' => 'amount',
            'title' => __('Material Price'),
            'class' => 'required-entry validate-zero-or-greater validate-number',
            'required' => true,
        ]
    );


texts: add a pdf in cms page and make it downoldable magento 2

texts: I want to add a pdf in home page and when i clck on it ,i can downold it. So how to proceed ?


texts:
I have performance problem with this query:

SELECT
    CONCAT(s.store_id, '-', p.entity_id, IFNULL(CONCAT('-', l.product_id), '')) AS store_product_parent_id,
    p.entity_id,
    s.store_id,
    l.product_id AS parent_id,
    p.type_id,
    IFNULL(sc.pcs_sold_in_period, 0) AS pcs_sold_in_period,
    IFNULL(translation.value, 0) AS translation
FROM catalog_product_entity AS p
LEFT JOIN catalog_product_link AS l ON
    (l.link_type_id = 3)
    AND (l.linked_product_id = p.entity_id)
LEFT JOIN sc ON
    sc.product_id = p.entity_id
    OR sc.parent_id = p.entity_id
INNER JOIN core_store AS s ON
    (s.store_id != 1)
    AND (s.is_active)
INNER JOIN eav_attribute AS a ON
    (a.attribute_code = CONCAT('translation_', s.code))
LEFT JOIN catalog_product_entity_int AS translation ON
    (translation.entity_id = p.entity_id)
    AND (translation.attribute_id = a.attribute_id)
    AND (translation.store_id = 0);

The sc identifier is view created by this query:

SELECT
    l.product_id AS parent_id,
    oi.product_id AS product_id,
    sum((oi.qty_ordered - oi.qty_canceled)) AS pcs_sold_in_period
FROM sales_flat_order_item oi
JOIN sales_flat_order o ON
    (o.entity_id = oi.order_id)
    AND (o.state <> 'canceled')
    AND (o.created_at > (now() - interval 30 day))
LEFT JOIN catalog_product_link l ON
    (l.link_type_id = 3)
    AND (l.linked_product_id = oi.product_id)
GROUP BY l.product_id, oi.product_id WITH rollup
HAVING (parent_id IS NOT NULL) xor (oi.product_id IS NOT NULL);

There are about 33k products and just select (1st query) performance is OK. Problem is when I add ORDER BY clause to the first query to sort the result by any column. It tooks about 45 seconds now and it slows down as there are more rows in result of 2nd query (view).

Description of queries:
The first selects products in each store with one attribute with code based on store code.
The second selects pcs sold count for simple products and for grouped products by by summing count of all their childs (done by GROUP BY WITH ROLLUP).

How to fix that problem? Thanks!


texts: How can we change grand total when payment method is cash on delivery using Magento 1.8?

texts:
How can we round up or down grand totals when payment method is cash on delivery on checkout page.
ex. If total is 50.60 then if customer selected cash on delivery payment method then grand total should be 51.00.

How can we do that please help it will be very useful.


texts: Magento 2 : What is the Use of Varien_File_Uploader

texts: What is the use of  Varien_File_Uploader while uploading images in magento 2


texts: robots.txt Disallow: /checkout/ still myweb.com/checkout/cart/ Google still crawls

texts:
robots.txt

Disallow: /checkout/

still, myweb.com/checkout/cart/ Google still crawls,
I have set robots from admin.

Thank You!


texts: Admin role automatically unchecked when role is edited Magento 1.9

texts:
I have a problem on my Magento webiste and I can't figure why is this happened.

I have 2 admin roles: administrator and shopmanager. Administrator role has all the permissions and shopmanager has custom permissions. There are two users registered, one is administrator_user and the other is shopmanager_user.

When I edit the shopmanager role (give more permissions or delete some permissions) the role of the shopmanager_user is automatically unchecked, and there is no role checked for this user, therefore shopmanager_user can't login until the administrator will check the user role again.

Did anyone has this problem because I don't know where to look? Can you help me with this please?