texts: Magento2 how to update order summary in checkout when choosing a different shipping method

texts:
I'd like to update shipping price and cart subtotal when choosing a different shipping method in the checkout page

Any hint on involved files and the right approach would be very helpful


texts: Using collection filters on frontend templates in magento 2

texts:
is it possible to use in the frontend templates the same filters we use in the backend grids for example?
I'm using magento 2.1.5.


texts: Issues with Magento 1.9.x and cached images frontend permissions

texts: We are trying to get a magento to run on a cpanel server, main issue right now is actually that all the generatet cache images for the front end ends up with 0640 and folders with 0750 this is an issue, is there some sort of way to fix this ?


texts: Hardware requirements for a multi-tenant or Multi domain magento installation

texts:
I am exploring to replicate the multi-tenant model using Magento. Currently, I am looking at how to select and the hardware as we scale. Based on my guestimation I would have the following

500 Magento installations / Instances
550,000 SKUs
21,633 average visitors per day
56,600 maximum visitors per day

What type of CPU would I require for this?

As per my calculations, I would require, 14 x 12Core @2.3Ghz

Please help.

Regards


texts: Magento2: Add Manufacturer image to details page

texts:
In Magento 2.1, I need to add manufacturer's logo in product detail page. Now, I added an attribute manufacturer from the backend.

I did that by going to Stores -> Attribute set then choosing Default. then there was two Unassigned Attributes, Color and Manufacturer. I dragged manufacturer into Product Details under Groups. Now I have a dropdown list at the backend's product catalog page (Product -> catalog -> edit/add the product ).

Now I need to implement when I choose a manufacturer from that dropdown, in that product's, product detail page manufacturer image should be displayed.

How do I accomplish that?


texts: I want to disable Magento 2 default fotorama image slider and need to set slick slider. How to disable the slider? How to get images for the custom slider.


texts: Magento2 product url displaying with category and product id

texts:
Product urls are displaying with category and product id

Now url is displaying like below http://localhost/magento2/catalog/product/view/id/1234/category/12/

But i want http://localhost/magento2/test-product


texts: How can I set the theme/package just for a custom module?

texts:
I have a module that adds some custom content that I would really like to display with a different theme to that used for the main store.

The main store theme has a theme that knocks out the CSS etc for things like toolbars, rather than fix this awful theme I would prefer to revert back to a version of the default theme, just for this one module.

I have seen on the category pages that there are options to set a different theme, however, I do not know where to begin when it comes to doing this for myself with one particular module.

Any pointers will be greatly appreciated.


texts: Dealing with "Lock wait timeout exceeded; try restarting transaction" error in Percona Server

texts:
I recently upgraded our magento 1.7 database server from MySQL 5.4 to Percona 5.6 in the interest of performance.

As expected, the site and general performance of magento has increased vastly, but at the cost of these errors occurring more frequently than before:

  Lock wait timeout exceeded; try restarting transaction

So, I begun a research into this error & issue and it has been frequently discussed. One point that interests me are the following:

https://www.percona.com/blog/2012/08/28/differences-between-read-committed-and-repeatable-read-transaction-isolation-levels/

By default, percona uses REPEATABLE READ isolation level.
However, during my research there has been numerous recommendation (for e.g. https://stackoverflow.com/a/23799980/2332336) that favours READ_COMMITED isolation level combined with binlog-format = ROW over the default.

I wanted to ask; if I were to change the percona server's isolation level as per recommendation, are there any serious implications? Like, will it work? Will it help? Will it break magento?

The changes I am considering for the percona56 are the following:

isolation-level = READ_COMMITED
binlog-format = ROW
innodb_lock_wait_timeout = 120 (currently default value 50)

Should I also be considering other changes to prevent these lock wait timeout errors?

P.S. the magento has a cron job that runs every 15 minutes to load stock level/product updates from a FTP server (third party warehouse software) and imports it into magento, I believe this is what's causing the timeout (and sometimes deadlocks) to occur.


texts: Where / how do versions work with pub static content?

texts:
I am debugging a JavaScript problem and I am confused as to how the static files and versions work...  I see the following in a stacktrace and can open this in a new tab:

https://example.com/static/version1577121673/vendors/ModuleVendor/adminhtml/en_US/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js

but I know this file to actually be as listed but without version1577121673 (I know because I've directly edited it with a couple of console.log commands):

https://example.com/static/vendors/ModuleVendor/adminhtml/en_US/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js

Where/how is it that the URL with version1577121673 is linked, mapped or otherwise to the actual file on the server?


texts: Magento 2 : When to use Object Manager in Unit tests?

texts:
So I recently stumbled upon a problem while writing a unit test in Magento 2. You can read more about the problem in question here.

Vinai told me it is generally bad practice to use the object manager in unit tests:

  In Unit tests, don't use the ObjectManager at all. Just instantiate your class with new, since all dependencies are test doubles anyway.
  Less magic makes for easier debugging. Especially like in your case where there is only a single dependency.

Now... I did what he suggested, and I changed my Object-Manager based constructing of the class to a vanilla new-statement and it worked:

So instead of this:

$this->sourceModel = (new ObjectManager($this))
    ->getObject(
        \Custom\Shipping\Model\Config\Source\ProductTypes::class,
        [
            'Config' => $this->configHelperMock
        ]
    );

I did this:

$this->sourceModel = new \Custom\Shipping\Model\Config\Source\ProductTypes($this->configHelperMock);

But I also have another test that needed to stub a helper. This I did like this:

$this->configHelper = (new ObjectManager($this))
    ->getObject(
        \Custom\Shipping\Helper\Config::class,
        [
            'scopeConfig' => $this->scopeConfigMock
        ]
    );

Now if you look at Magentos' AbstractHelper-class, you'll note that it has one constructor argument: Magento\Framework\App\Helper\Context. So I figured what the Object Manager does with above constructor call, is it sets the scopeConfig-parameter of my Context-object to my mocked object. I hope this assumption is correct.

But... to get back to Vinais' statement to not use the Object Manager, how would you do this without the Object Manager? Mock the entire Context object? Or is the Object Manager the correct strategy to use in this particular scenario?

I'm really trying to understand what's the correct way to write unit tests for Magento, because for now it seems to me that:

You need to use the Object Manager when you want to mock the content of the context-object
You don't need to use the Object Manager in all other scenarios.

Can anyone shine a light on this? The Magento 2 documentation is lacking of a more in-depth explanation on how to write proper unit tests.


texts: Magento2: Contact us CMS block not showing up

texts:
I'm working on a Magento 2 template, based on Luma and I've run into an issue with the Contact Us page.

The content of the CMS block (contact-us-info) isn't showing up in my template. All I get is the contactform on the right side of the page. See the partial screenshot:

When I activated the Luma template to check, lo and behold, there it was, neatly above the contact form...

Can anybody shed some light on the issue? It's probably something very small and stupid...


texts: How can i get total view count of a product in Magento2?

texts:
I would like to load product view hit count for a specific product , i found that Magento database stores some counting in table e.g.

report_viewed_product_aggregated_daily
report_viewed_product_aggregated_monthly

How can I load this value for showing in frontend?  Do I need to set date range on it?

Updates:

I try to use:

$collection = $objectManager->create('\Magento\Reports\Model\ResourceModel\Report\Product\Viewed\Collection')

to get the collection according to what it can be done on Magento 1.

Magento\Reports\Model\ResourceModel\Report\Product\Viewed\Collection

is extending:

\Magento\Sales\Model\ResourceModel\Report\Bestsellers\Collection

which is extending:

\Magento\Sales\Model\ResourceModel\Report\Collection\AbstractCollection

where there is a method setDateRange(), but when I call it, it shows error "unknown method". Anyone have any idea about this?


texts: Disable Categories with no Products Magento 2.2

texts:
I am looking to disable any categories with no products assigned and have no idea where to begin? I can run mysql queries or run from SSH. I just don't know what to enter exactly.

I have over 800 categories in my setup and it takes the homepage 25 seconds to load. I wanted to try turning off unnecessary categories to see if it speeds it up.


texts: How to solve Magento CE 2.3.3 Re-index Issue - SQLSTATE[23000]: Integrity constraint violation error?


texts: Tier price for customer group does not automatically apply after logging in

texts:
I have a store with customer groups for different customer "levels". Each level has discounted pricing that is set up using tier pricing.

My problem is the tier pricing does not apply if a customer first adds an item to their cart and then logs in. I expect that when they log in their cart would update with their customer group discounts.

I want the cart pricing to apply immediately when the user logs in, including using the ajax login on the checkout page.

How can I write a module to update the pricing after a user logs in? I'm looking for a particular event to hook into for user login and the right command to 'refresh' the cart programatically. This would ideally include refreshing the pricing on the checkout page if the user logs in from there.

Update (first attempt)

I have tracked down a bit of code that refreshes the cart items' prices. In order to test this I made a simple controller that runs this code:

/** $this->checkoutSession \Magento\Checkout\Model\Session **/
$quote = $this->checkoutSession->getQuote()->collectTotals()->save();

When I log in and load a page that runs the above code, cart prices are properly refreshed. However, when I try this code inside of an Observer, I have no luck. For my observer I have tried a few different events in order to test, here is a list of those events:

customer_customer_authenticated
customer_login
customer_data_object_login
controller_action_postdispatch_customer_account_loginPost

I know the code works but I none of the above events are doing it. I think if I get the correct event I'll be close to figuring this out.


texts: Admin form action to another admin controller can not reach

texts:
In Magento2, I create a form by phtml file in admin, but when I submit it, it always redirect to admin homepage, not reach another admin controller, how to fix it?

I guess the problem is in the action url, but I don't have a idea to fix it.

form codes

<form action="<?php echo $block->getUrl('migration/index/post') ?>" method="post" style="text-align: center;">
    <label for="sku">Sku: </label>
    <input type="text" name="sku" id="sku" size="40">
    <input type="submit" value="Submit">
</form>


texts:
I noticed that lots of people put in a space after their email address (autocomplete) i.e. " test@test.com "
I use to use this code in M1:
$(':input').change(function() { $(this).val($(this).val().trim()); });
and it was working for all fields.
Is there a way to do this in M2?


texts: remove sharp edged circles on product images

texts:
Here you can see category image occupied more space although it is a small image.

i want to decrease the image occupying space.

another thing is on same link, you can see 2 sharp edged circles on product images .

I want to remove 2 sharp edged circles. 2 sharp edged circles will display only if we use "product labels".

[here "Ideal for laptop" is product label.]

please help me to find solution.

thanks in advance.


texts: Magento 2 - CMS Pages, Blocks and Layouts

texts:
I am fairly new to Magento, I read trough the documentation and everything I could find explaining the frontend developement process. But I still do not get some of the basics.

Here is a simple layout of a single page ("Home" for example):

I get that I configure the parts of my layout which are constant for every page in my default.xml (in this case the header, footer and a container for my main content)

But what I don´t get:

Do I create a seperate layout (.xml) for every single page even if my content blocks and the content inside of them are the only thing that is changing?
Or do I create blocks via the backend, put those blocks inside of a widget and assign that widget to a page?
Or do I put my content directly into the page? (via the content tab in backend->pages->home->Content)


texts: I can't make any change in my table rates section.


texts: magento uncheck same as billing in checkout

texts:
I would like to uncheck all shipping methods. When a customer is on a checkout page, radio button is not preselected (all circles are empty).

I use now a onepage extension: http://store.lotusbreath.com/magento-extension/lotusbreath-one-step-checkout.html

I already tried to contact them, but they dont give a reaction. It should not that hard, just uncheck it.. But searching for 2 days now :(

Regards..


texts: Magento2 : IncrementId value not resulting in an order

texts:
I want to load the data of an order with the incremental id after placing an order. I am getting the incremental id in the data array after placing an order, but cant load any orders with it.

My Observer:

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder()->getData();
        $incrementId = $order['increment_id'];
        $this->helper->writeShp($incrementId);
    }

WriteShp():

public function writeShp($incrementId){
        try {
            $this->logger->info($incrementId);
            $order = $this->orderFactory->create()->loadByIncrementId($incrementId);
            $this->logger->info('order', array('order', $order));
        } catch (\Exception $e) {
            $this->logger->critical($e->getMessage());
        }

The following is getting logged:

[2019-03-07 14:54:02] main.INFO: 000000040 [] []
[2019-03-07 14:54:02] main.CRITICAL: No such entity with orderId =  [] []

The weird thing is the [ ] [ ] behind the incrementId. Could this be the problem?

I have tried this:

$onlyId = preg_replace("/[^0-9]/", '', $incrementId);

but still there would be [ ] [ ] behind the incrementid. Imploding also didn't work, it said it wasnt an array.


texts: How to move category title above products column in Magento 2

texts:
In Blank theme the category name is located to the left just above the layered navigation sidebar.
I'd like to move the category name to the right, above the products column, so the side bar goes up.


texts: Magento 1.9 blank search page: Fatal error with getEntityTablePrefix() in EAV: Attribute/Abstract.php

texts:
Search results page on magento showing up blank. HTML ends here:

  Fatal error:  Call to undefined method
  Mage_Catalog_Model_Resource_Product_Flat::getEntityTablePrefix() in
  /home/mysite/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
  on line 510

The line in question is in the magento core files which was probably changed by a bad extension. I have recently tried out a couple of plugins to help with bundle items. I added them manually but they didnt work. Now this happens, I try to remove them manually but it doesnt seem to help. Here's the offending section in Abstract.php - what should it look like?

 /**
     * Get attribute backend table name
     *
     * @return string
     */
    public function getBackendTable()
    {
        if ($this->_dataTable === null) {
            if ($this->isStatic()) {
                $this->_dataTable = $this->getEntityType()->getValueTablePrefix();
            } else {
                $backendTable = trim($this->_getData('backend_table'));
                if (empty($backendTable)) {
                    $entityTable  = array($this->getEntity()->getEntityTablePrefix(), $this->getBackendType());
                    $backendTable = $this->getResource()->getTable($entityTable);
                }
                $this->_dataTable = $backendTable;
            }
        }
        return $this->_dataTable;
    }

This is the offending line:

if (empty($backendTable)) {
                    $entityTable  = array($this->getEntity()->getEntityTablePrefix(), $this->getBackendType());

EDIT:
I ran a debug as outlined by the below answer and just got this back:

Fatal error: Class 'Mage_Core_Model_Abstract' not found in .../Abstract.php on line 36


texts: What does __EAV_COLLECTION_LOAD_ENT_ mean?

texts:
I am using the AOE Profiler, which can be downloaded for free from http://www.fabrizio-branca.de/magento-profiler.html. Now, when I profile some pages of my store, it says stuff like:

__EAV_COLLECTION_LOAD_ENT_
__EAV_COLLECTION_LOAD_ATTR_

I an wondering what that means exactly? It also mentions the template file where that occurs, in my case it options.phtml. Can anybody tell me how to read those expressions?

Thanks!


texts: Adding the same product image path to multiple products through csv import issue

texts:
I am trying to add products by duplicating them in a CSV file.

It seems to work fine but when I update the product image path with the same path to multiple products it doesn't seem to update.

When I export again and look at the data it has reverted to it original state.

What is the problem here...?


texts: Is there a way to import product information via TXT files into Magento? Supplier has only TXT files and no CSV available. I have the impression that MAGMI does not support TXT file type.


texts: Controller 404 Page Not Found [Extension Dev]

texts:
I am learning from tuts+ premium tutorials.
i am using this link to get some output

http://127.0.0.1/folder/mage3/index.php/demo/index/sayHello

my xml file in config.xml

<frontend>
    <routers>
        <tutsplus_demo>
            <use>standard</use>
                <args>
                    <module>TutsPlus_Demo</module>
                        <frontName>demo</frontName>
                </args>
            </tutsplus_demo>
        </routers>
</frontend>

IndexController.php file code

<?php

class TutsPlus_Demo_IndexController extends Mage_Core_Controller_Front_Action {

    public function sayHelloAction() {

        echo "Hello World!";
    }
}

I want Hello world! in output but its showing me 404 page.


texts: How send order confirmation mail after only Payment success?

texts: I'm using Magento 2.2. Order confirmation mail was sent when checkout button trigged. So, I disabled Order mail from the Backend. I only need to send order confirmation mail/invoice from my website itself automatically when payment is done. But I'm only getting mails from PayU about credit and debit payment details.


texts:
I installed Magento2.3 and got greeted with the usual style not loading errors. I looked at the url it was trying to load and it was going to en_GB, which was 404'ing. Inspecting the pub/static directory showed that the deploy command worked for the en_US directory.

So I tried this command to resolve the issue:

$ php bin/magento setup:static-content:deploy -f en_GB

and inspecting the en_GB directory in the pub/static directory shows that the generation worked. I then went to my site and it still 404s.

I've tried:

$ rm -rf var/

and

$ php bin/magento cache:flush
$ php bin/magento indexer:reindex
$ chmod -R 777 pub/

but still the same result. What am I doing wrong? (fresh install so no code changes thus far)


texts: Remove default page title suffix from home page (or any specific page)

texts:
I have been scouring the forums for the right way of changing the page title for a specific page or layout in Magento 2 but many answers rely on action methods which are now deprecated.

Essentially, I have set the store up so the suffix for each page title is "- CompanyName" but I would like to know how to create an exception for this for the home page (and other specific landing pages). I have changed the page title in a custom layout file successfully but the suffix is still appended to the end. Is there a sensible way of stopping this from happening on a specific page, like the home page?

Thank you.


texts: How can i redirect from 1 page to product detail page?

texts:
I want when i click on the anchor(a) tag means image it redirect me the product detail page what should i do for it?

Here is my code.

 <?php
    include 'app/Mage.php';
    Mage::app();
    $resource = Mage::getSingleton('core/resource');
    $readConnection = $resource->getConnection('core_read');
    $writeConnection = $resource->getConnection('core_write');

$hint = "hp";
$sql = "SELECT p.entity_id, pv.value as name, pt.value as description, pm.value as imagesPath
                FROM catalog_product_entity as p
                INNER JOIN catalog_product_entity_varchar as pv on pv.entity_id = p.entity_id and pv.attribute_id = 71
                INNER JOIN catalog_product_entity_text as pt on pt.entity_id = p.entity_id and pt.attribute_id = 72
                LEFT JOIN catalog_product_entity_media_gallery as pm on pm.entity_id = p.entity_id and pm.attribute_id = 88
                 WHERE pv.value like '%".$hint."%'";

               foreach($readConnection->fetchAll($sql) as $orders)
                  {

                     $id1 = $orders["entity_id"];
                     $result = $orders['name'];
                     $result1 = $orders['description'];
                     $result2 = $orders['imagesPath'];

                     echo "

$result

$result1

";

                    ?>
                    <a href="#?id=<?php echo $id1 ?>"><img src="media/catalog/product<?php echo $result2; ?>" width="50px" height="50px;" />

                     <?php

                  }

 ?>


texts: Extension attribute 'neighborhood' not working when payment method is PayPal standard

texts:
I have added an extension attribute via

extension_attributes.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\AddressInterface">
        <attribute code="neighborhood" type="string"/>
        <attribute code="reference" type="string"/>
    </extension_attributes>
    <extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
        <attribute code="neighborhood" type="string"/>
        <attribute code="reference" type="string"/>
    </extension_attributes>
</config>

It shows up when using other payment methods such as OpenPay, I can even see it when making a mock order (extension attribute is at the bottom):

Does anyone know if the process to read that attribute is any different when using PayPal as a payment method?


texts: Magento 2 What are the Custom Attributes Node when Creating a new Product Type?

texts:
I've had a look at how to create new product types in magento. Looking through the core code I found the following:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="simple" label="Simple Product" modelInstance="Magento\Catalog\Model\Product\Type\Simple" indexPriority="10" sortOrder="10">
        <customAttributes>
            <attribute name="refundable" value="true"/>
        </customAttributes>
    </type>
</config>

What exactly does the customAttributes do? And Where is the refundable attribute store?

EDIT:
I've had a look at the attributes both in the database and admin panel, I can't find a reference to the refundable attribute. One of my colleagues told me its probably some kind of "virtual attribute".


texts: Magento : How to Get Output in Phtml File From $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result))?

texts:
In controller file I put this,

$result = "success";
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

How to fetch output in phtml file?


texts: Product Page is Blank pointing to non existant template frontend/base/default/template/page/column.phtml

texts: I am going a little mad trying to figure out why the product page for my site is pointing to frontend/base/default/template/page/column.phtml which does not exist.  Any help here will be greatly appreciated.


texts: ConnectManager shows No upgrades available but there is?

texts: I've a Magento 1.9.2.1 store and want to upgrade to the latest version (1.9.2.2). After pressing CHECK FOR UPGRADES in the ConnectManager it shows no available upgrades but I know 1.9.2.2 is available. What am I doing wrong?


texts: Configurable Swatches on Listing Page: Show Multiple Color Attributes

texts:
Currently Magento 1.9.1.0 allows to show only a single attribute on the listing page as a swatch (product details page can have multiple attributes showing).

Since I've 30+ manufacturers (and each has about 20+ colors), I've a separate color attribute for each manufacturer. I would like that all of my different color attributes will show on the listing page.

How can I make it happen?

Thank you in advanced for any tip.


texts: Braintree 3D Secure 2 implementation on magento 2.2 Error Class League\ISO3166\ISO3166 does not exist

texts:
Has anyone from magento community upgraded the Braintree module to version 3.4.1 . i tried to install it through composer via the following command ,

composer require paypal/module-braintree:3.4.1 --no-update

but got the following error

[InvalidArgumentException]
  Could not find a matching version of package paypal/module-braintree. Check the package spelling, your version constraint and
   that the package is available in a stability which matches your minimum-stability (stable).

so i downloaded the module from the magento marketplace instead
https://marketplace.magento.com/paypal-module-braintree.html

and placed the module to vendor/magento/module-braintree
The module has been installed alright but when payment is made on frontend , it throws error Class League\ISO3166\ISO3166 does not exist

can anyone suggest how to proceed further ?


texts: Mage registry key "_singleton/magenotification/observer" already exists

texts:
I am facing a serious problem when I enter the URL in the browser. Firstly the site, not shown then I enable the error log from local.xml in errors file then I found this problem. Help me someone to get rid of this problem.
thank you.


texts: Magento - I need the corresponding code for magento2. This is magento1 code

texts:
$shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($itemQty);

$shipment = new Mage_Sales_Model_Order_Shipment_Api();
$shipmentId = $shipment->create($orderId);


texts: Showing cart products on frontend in Magento CE 1.9

texts:
I am adding products to cart from admin to customer account like this:

$quote = Mage::getModel('sales/quote')->loadByCustomer($customer_ID);
$quote->addProduct($product, $qty);

from this product is adding successfully in sales_flat_quote table with customer details but on frontend product is not showing in customer's cart. From little search I found that to show product in frontend side I have to add product to cart like this:

$quote = Mage::getSingleton('checkout/session')->getQuote();
$quote->addProduct($product, $qty);

But this is not working in my case as I have to use them from mobile apps.

So my queries are following:

My first query is obvious how I can show products to fronted?
Magento using oauth system for rest api's but that is not good(my perception) for android/ios applications. So what is best way to make api's for such of type of apps.
When I am creating rest api for customer I am noticing that always in customer details it shows created from Admin and Associate to Website is Admin Even I after hardcode the website id value like:$customer->setWebsiteId(2); Really we can not change?
Is it good to create customer from admin side always?

If you find some corrections, please update them.


texts: Magento with Turpentine - Per session/connection speed issue

texts:
Magento CE 1.9.0.1 with Varnish 4.0.3 & Turpentine 0.6.8

When I load the page or inner pages for the first time those are slow(as First bite is always slow) and on second attempt it becomes quicker coming from Varnish, now since page has been stored in Varnish cache is should be served faster(coming from Varnish) no matter which connection or network I use, but in my case if at same time I go to another PC/network(or sometimes even different browsers on same PC) and try to load the same page it becomes slow. I am using all the default settings of Turpentine in my VCL config.

Here is my /etc/varnish/varnish.params

# Varnish environment configuration description. This was derived from
# the old style sysconfig/defaults settings

# Set this to 1 to make systemd reload try to switch vcl without restart.
RELOAD_VCL=1

# Main configuration file. You probably want to change it.
VARNISH_VCL_CONF=/home/www/vhosts/example.org/httpdocs/var/default.vcl

# Default address and port to bind to. Blank address means all IPv4
# and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted
# quad, or an IPv6 address in brackets.
VARNISH_LISTEN_ADDRESS=99.25.55.148
VARNISH_LISTEN_PORT=80

# Admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082

# Shared secret file for admin interface
VARNISH_SECRET_FILE=/etc/varnish/secret

# Backend storage specification, see Storage Types in the varnishd(5)
# man page for details.
VARNISH_STORAGE="malloc,12G"

# Default TTL used when the backend does not specify one
VARNISH_TTL=120

# User and group for the varnishd worker processes
VARNISH_USER=varnish
VARNISH_GROUP=varnish

# Other options, see the man page varnishd(1)
DAEMON_OPTS="-p thread_pool_min=5 -p thread_pool_max=500 -p thread_pool_timeout=300 -p cli_buffer=16384 -p feature=+esi_ignore_other_elements -p vcc_allow_inline_c=on"

Could it be because I am storing everything in RAM as VARNISH_STORAGE="malloc,12G" and there might be a default behavior of memory to just wipe out after every minute or second and I also need to save in SSD? or there could be another issue?
If you say "First bite is always slow" than does it mean it will be slower for each different browser, and each session/connection? this is what is actually happening with me.
Almost all the stores I have seen which are providing page in like milliseconds(having Varnish) does not encounter the same issue. When I browse those sites from various connections it all looks same with pretty much same speed. How can I achieve this?

Please also look at Admin > System > Configuration > Caching Options which may help to answer


texts: How to change the price in quote while adding product to cart?

texts:
I want to apply a custom price for the current order. I read that I should use sales_quote_add_item, But its looks like I am doing something wrong. I found some tutorials for magento1 but not for Magento 2. So please let me know what I am doing wrong.

app/code/Myvendor/HelloMagento/etc/adminhtml/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_quote_add_item">
        <observer name="change_hello_magento_display" instance="Myvendor\Addtocart\Observer\Change" />
    </event>
 </config>

app/code/Myvendor/HelloMagento/Observer/Change.php

<?php
namespace Myvendor\Addtocart\Observer;

class Change implements \Magento\Framework\Event\ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $event = $observer->getEvent();
        $quote_item = $event->getQuoteItem();
        $new_price = 987;
        $quote_item->setOriginalCustomPrice($new_price);
        $quote_item->save();
    }
}

Let me know please what I am doing wrong. I want to achieve the same thing for Magento 2 given on below link for magento1.

https://stackoverflow.com/questions/9721583/changing-the-price-in-quote-while-adding-product-to-cart-magento


texts: Magento 2 : Override Template From "module-theme"

texts:
I want to override sections.phtml file from vendor/magento/module-theme/view/templates/html/

I am using default magento theme

I have created structure,

app/design/frontend/Magento/Magento-Theme/templates/html/sections.phtml

But it is not running, the default one is getting loaded.


texts:
please help
Magento version 2.0.9
I am trying to add categories programmatically .
And here my code

    $categoryFactory=self::getObjectManager()->get('\Magento\Catalog\Model\CategoryFactory');
    $categoryTmp = $categoryFactory->create();
    $categoryObj = $categoryTmp->load((int)$categoryDTO->getParentId());
    $categoryTmp = self::getObjectManager()->create('Magento\Catalog\Model\Category');
    $categoryTmp->setPath($categoryObj->getPath())
        ->setParentId((int)$categoryObj->getId())
        ->setName($categoryDTO->getDescription())
        ->setUrlKey($categoryDTO->getUrlKey())
        ->setIsActive(true);
    $createdCategoryId = $categoryTmp->save()

Which is working and at some point I get

 Fatal error: Uncaught PDOException: SQLSTATE[08004] [1040] Too many connections

But I got  categories (not all ) added to magento database with parent-child relationship.
After refreshing page it inserts all categories (there is not much left after)
,I am trying to get rid of annoying error
so I followed this link this  link
 which is working but again at some poing I get connection error **Besides no category is added to database **.
Any tip is welcomed

EDIT 1

  self::getObjectManager()

is this function

 protected static $cachedObjectManager;

public static function getObjectManager()
{
    if(!self::$cachedObjectManager){
        $bootstrap = Bootstrap::create(BP, $_SERVER);
        return $bootstrap->getObjectManager();
    }

    return self::$cachedObjectManager;
}


texts: Magento 2 custom configuration value not saving?

texts:
I am new to Magento 2.
I tried to create custom admin configuration section with simple text, drop-down and color picker fields. When I tried to save the values, the configuration is not saved in database.
I referred this link


texts: Magento 1.9.1.0 remove Sort By and Show per page

texts: How can I remove completely Sort By and Show per page from toolbar on product listing with grid view in Magento 1.9.1.0. I have only a few products on my shop so now I don't need sorting. What file should I edit and how to change code in this file.


texts: How to disable Zip/Postal Code validation Notice Magento 2

texts:
I want to disable this notice in the checkout from Magento:

  Provided Zip/Postal Code seems to be invalid. Example: 1234 AB. If you
  believe it is the right one you can ignore this notice.

I don't want to get an notice. Just want it to be required.
Can anybody help me how to do that?

I think this is special for Dutch shippingplaces.


texts: One website with different store views on different domains

texts:
I found some solutions but none complete or working for me.

So I have a main website, let's call it www.main1.com that has different views translated in different languages: german, italian and english.

What I would like is to redirect the german domain www.germandomain.com to the german view from www.main1.com.

Also I want to keep the views under one website so that the flags can appear in the header.


texts: Abandoned cart reports email to admin in magento2

texts: Can I configure the abandoned cart report email to admin. Can I achieve this functionality.


texts: Call a controller method without loading a new page

texts:
I have a button that I'd like it to create an order :

<button id="" title="Create order" type="button" onclick="setLocation('<?php echo Mage::getUrl('ajax/index/createOrder') ?>')" >Create order</button>

This is the controller method, it's calling a function from the block :

public function createOrderAction()
    {
        $order = $this->getLayout()->getBlockSingleton('recentproducts/recentproducts')->createOrder();
        return $order;
    }

And the block is calling the business method from the model:

public function createOrder() {
    $order = Mage::getModel('recentproducts/recentproducts')->createOrder();
    return $order;
  }

All is working fine, the order is created, but I don't like when pressing the button to be redirected to another page. I want to click on the button, it stays on the actual page, it created the order, and it gives me a confirmation message .


texts: Magento 2.2.5 : Add custom field in product attribute add form

texts:
Go to : Store -> Attributes -> Product -> Edit attribute

I want to add custom dropdown as like Used in Product Listing dropdown.

I added it. But, It's display in Properties tab instead of Storefront Properties tab.

Please help me how to add that in Properties tab.

I upload my code and screenshot here.

  CompanyName\ModuleName\Block\Adminhtml\Product\Attribute\Edit\Tab\Front.php

<?php

namespace CompanyName\ModuleName\Block\Adminhtml\Product\Attribute\Edit\Tab;

class Front extends \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front
{
    protected function _prepareForm()
    {

        parent::_prepareForm();
        $attributeObject = $this->_coreRegistry->registry('entity_attribute');
        $form = $this->_formFactory->create(
            ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
        );

        $yesnoSource = $this->_yesNo->toOptionArray();
        $fieldset = $form->addFieldset(
            'front_fieldset',
            ['legend' => __('Storefront Properties'), 'collapsable' => $this->getRequest()->has('popup')]
        );
        $fieldset->addField(
            'used_in_custom',
            'select',
            [
                'name' => 'used_in_custom',
                'label' => __('Used in Custom'),
                'title' => __('Used in Custom'),
                'note' => __('Depends on design theme.'),
                'values' => $yesnoSource,
            ]
        );
        $this->setForm($form);
        return \Magento\Backend\Block\Widget\Form\Generic::_prepareForm();
    }
}

  CompanyName/ModuleName/view/adminhtml/ui_component/product_attribute_add_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
     <fieldset name="front_fieldset">
        <field name="used_in_custom" sortOrder="130" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="default" xsi:type="number">1</item>
                </item>
            </argument>
            <settings>
                <notice translate="true">Depends on design theme.</notice>
                <dataType>boolean</dataType>
                <label translate="true">Used in Custom</label>
                <dataScope>used_in_custom</dataScope>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="number">0</map>
                            <map name="true" xsi:type="number">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
     </fieldset>
</form>


texts: Retrieve encrypted data from config but the data is Garbled text

texts:
I'm trying to retrieve a encrypted data from config data by external script,

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//ini_set('memory_limit', '8192M');

require_once('app/Mage.php');
$app = Mage::app();

$secure_secret = Mage::getModel('core/encryption')->decrypt(Mage::getStoreConfig(
                   'payment/migs_hosted/secure_secret',
                   Mage::app()->getStore()
               ));

var_dump( $secure_secret)."<BR>";

?>

But the output is Garbled text "string(24) "� �m��zJ}�G�H6��R��6"" .

Do anyone know what is the problem?


texts: Magento 2: Get Product via url with sku number in url

texts:
I have a magento 2.2.9 based site and wondering if its possible to get a product via url by having the sku in the url?

so something like https://www.domain.com/shop/?sku=123

Wanted to know if there is a default way to do this that wouldn't require building any custom module.


texts: So i want to add the pintrest and G+ icon to the RWD package on the , i am guessing it will involve adding some code to sharing.phtml in the rwd directory? and something in the skin as well as the style sheet. I know my way around magento but could use some help. As i said I am looking for very detailed instructions to accomplish this task.  Thanks in advance.


texts: How to add default telephone field in customer registration form in Magento 2.3.6

texts:
I want to add default telephone field in our website Create and Account form.
I enable Telephone field under Store >> Configuration >> Customer >> Customer Configuration >> Name & Address Option >> Show Telephone (Required). But not show Telephone field in create customer account page.
How can i show for it?
http://devmag.visibleone.io/phom236/customer/account/create/


texts: magento 2 : logo image file could not be selected / uploaded

texts:
In content > design > configuration theme , I try to upload new logo by click on the Upload button. However, after select the image from PC, the ajax icon only spin a couple of times and then nothing happens, no file is selected for uploaded, no error in log file. I totally have no clue how to debug this error. I already tried to set permission 777 on localhost environment but it doesn't help.

The strange thing is product image upload works just fine. Any other section in admin that has file select field still works. Only this design section has problem.

Magento version 2.3.0 & Php 7.2


texts: How do I prevent customer to log in until their account has been activated by the admin

texts: After new customer registration, the customer account should be approved by the admin and then a customer can log into their account.


texts:
I was searching throughout net i have not found complete tutorial.
The case is I need complete configuration for newly added attribute (for product) and explantation of use of each one, adding it with use of sqlk script. If you have some notes somewhere about it, it would be extremely useful for me to can look at them.

Of course if I can find it somewhere in core, it will be ok, but so far I have not found complete sql script.

For now I have gathered:

$eavSetup->addAttribute(
            Product::ENTITY,
            'licensed_soft',
            [
                'type' => 'int',
                'input' => 'select',
                'frontend_class' => 'required-entry integer',
                'label' => 'Licensed software',

                'group' => 'License details',
                'sort_order' => 10,

                'backend' => '',
                'frontend' => '',
                'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',

                'default' => 0,

                'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
                'visible' => true,
                'required' => true,
                'user_defined' => true,

                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'unique' => false,
                //'apply_to' => ''
            ]
        );

Some of attributes I have to add are connected only with backend and some of them should be visible on front etc. Is it only visible_on_front? Or comparable or filterable mean something on front? What is product listing?

If anyone knows frontend class to validate min length of provided content of input it would be also useful.

Thanks in advance!


texts: Copy paste transaction emails but not working

texts:
I have edited the template for new_orders and it all seems to work nicely. The same part that required editing I paste into the template for new_shipments but the needed fields stay blank. I don't get it as its the same code as for new orders. Did the code somehow corrupt when doing the copy paste?

Hello, {{htmlescape var=$order.getCustomerName()}}

                        Thank you once more for your order from {{var store.getFrontendName()}}.
                        Your package has been shipped by Vendor {{var vendor.vendor_id}}.
                        You can always check the status of your order and shipment by logging into your account.
                        If you have any questions about your order or shipment please email the Vendor here.  Email Us or give them a call at {{var vendor.telephone}} Sunday - Thursday, 8am - 5pm.
                        You could also try the chat function on the Vendor home page. Click here to go to their home page.  {{var vendor.vendor_id}} In case you need additional support you may contact the customer support group of tee3sports.com.

                        Your shipping confirmation is below. Thank you again for your business.


texts:
I upgraded my Magento 1.4 to Magento 1.9.2.2. Upgrade completed successfully but after upgrading, admin panel is too slow. Sometimes, up to 1.3 minutes.

I enabled Magento profiler. Most time consuming calls were these:

Code Profiler                                   Time     Cnt Emalloc   RealMem
mage                                            33.0621  1   0         0
mage::dispatch::routers_match                   32.9778  1   0         0
mage::dispatch::controller::action::predispatch 25.1045  1   9,281,168 9,175,040
DISPATCH EVENT:controller_action_predispatch    25.0586  1   3,260,744 2,621,440

I read some articles about speeding up Magento admin panel. Enabling cache and disabling extensions are done. When I disabled extensions, the speed significantly grow. But disabling them one by one didn't make any difference.

What should I do to find the bottleneck(s)?


texts: How secure is the server if someone has access to the magento admin panel

texts:
How secure would the server that magento runs in be if someone was to have access to the magento admin panel.

Is there a way through extensions installed or similar techniques to install malware on the server?

Is it a good idea to trust a freelancer with the admin panel login info to make any installs or adjustments?


texts: Magento 2.1 - Load Product in External Script

texts:
I'm porting over a little web service developed by a previous developer that pulled product data from an older Magento 1.9 install and spits it out as a json response.

They bootstrapped Magento 1.9 with this:

$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
require_once $_SERVER['DOCUMENT_ROOT'].'/app/Mage.php';
umask(0);
\Mage::app('default');

And they loaded product data with:

$productHelper = \Mage::getModel('catalog/product');
$product       = $productHelper->load($product_id);

With Magento 2.1 I'm bootstrapping with:

require getenv('MAGENTO_PATH') . 'app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$app = $bootstrap->createApplication('MagentoApp');
$bootstrap->run($app);
return $app->getObjectManager();

Here's the MagentoApp code:

class MagentoApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
    protected $objectManager;

    public function launch()
    {
        $this->_state->setAreaCode('frontend');
        return $this->_response;
    }

    public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception)
    {
        return false;
    }

    public function getObjectManager()
    {
        return $this->_objectManager;
    }
}

When I go to get the Magento Product in the little web service's product model, I'm using

$objectManager = $app->getObjectManager();

$product = $objectManager
        ->get('Magento\Catalog\Model\ProductRepository')
        ->getById($product_id);

and getting the error Call to a member function get() on null (referring to the $objectManager as null) . What's weird is if I exit(var_dump($product->getData()) after that method call, I get the actual product data just fine.

If anyone could shed any light on this, it would be much appreciated.

Thanks very much.


texts: Translate direct SQL query into collection model usage

texts:
I've got this query:

SELECT * FROM 'catalog_category_product' WHERE 'product_id' IN ('.$IDs.')

where $IDs I get the following way: $IDs = implode(',', $products); and $products is an array of product ids.

Now I want to do the same thing, but through the use of a model collection. I've got so far with these examples:

$collection = Mage::getModel('catalog/product')->getCollection();
        $collection->addAttributeToSelect('product_id');
        $collection->addAttributeToSelect('category_id');
        $collection->addAttributeToSelect('position');
        $collection->addFieldToFilter(array('attribute'=>'product_id','in'=>array($products)));

and

$collection = Mage::getModel('catalog/product')->getCollection();
        $collection->addAttributeToSelect('product_id');
        $collection->addAttributeToSelect('category_id');
        $collection->addAttributeToSelect('position');
        $collection->addFieldToFilter(array(
                array('attribute'=>'product_id','in'=>array($products)),
        ));

But I get exception on the last function call, in both cases.

P.S. I need to acquire these 3 attributes at once (as the SQL query would do), but not iterating for each value in $products because I am dealing with thousands of products.


texts:
I'm trying to add some functionaltiy after generating invoice by magento store owner for orders. I'm using the following code

<sales_order_invoice_save_after>
    <observers>
        <sales_order_invoice_save_after_handler>
            <type>model</type>
            <class>invoice/observer</class>
            <method>saveinvoiceno</method>
        </sales_order_invoice_save_after_handler>
    </observers>
</sales_order_invoice_save_after>

Issue

Above code is also working PayPal payment, but i want to execute it for admin only.
Any suggestion or help?

Thank you in advance.


texts: Magento2 How to get customer group from sales order item collection

texts:
I want to get customer group from sales order item collection.
How do i get that?

In Magento 1 it is like this

  $customer_group =
  Mage::getModel('customer/group')->load($order->getCustomerGroupId());

how can i get it in magento 2.

I have item collection and i want customer group for each item.

How to get please answer.


texts: What's the correct way to add a CMS block to a template file

texts:
I know of two ways to add a static block to a template.  I'm wondering which correct method, I suspect the second method is, but why?  Are both correct?

METHOD 1:  $this->getLayout()->createBlock()

Create a static block in Magento admin and call it from within your template file with the code below.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('something_custom')->toHtml() ?>

Method 2: $this->getChildHtml()

Similarly create a static block in Magento admin but first declare it in your layout xml with:

<block type="cms/block" name="something_custom">
    <action method="setBlockId"><block_id>something_custom</block_id></action>
</block>

And then call it from within your template file with the code below.

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


texts: Bestseller report in admin display products twice

texts:
I am facing a strange issue.
Bestseller yearly report in admin is showing product twice for the year in "to"  field.
If I am changing the year from 2012 to 2013 then issue is for product listing for year 2013 only and if year in to field is 2014 then issue is with product listing for year 2014 only and so on.

For daily and monthly it is working fine.

Please help me in fixing this issue.


texts:
O.K my site is on a demo server, and I am trying to link an image on a product page to a separate specific Product. I am trying a simple...

productname

However its not working, any ideas?


texts: Problem with Javascript on Product View Page

texts:
I've installed the Ultimo theme and it works great but there is a javascript error on the product view page which effects the dropdown navigation, image zoom and tabs for the product description, reviews etc,etc.

I have no idea how to debug the problem to fix it.
Example = http://goo.gl/uajKTY


texts:
TL:DR;
How can I rebuild (automatically) the modules sequence stored in app/etc/config.php in Magento 2.
Long version:
I have 2 modules I'm working on.
I installed them in the order "Module 1", "Module 2".
So in my app/etc/config.php they appear at the bottom like this:

'Magento_Wishlist' => 1, //core module
'Namespace_Module1' => 1, //my first module
'Namespace_Module2' => 1, //my second module

But after I installed both of them, I realized that Module2 must be loaded before Module1 so that some config settings from Module 2 can be overwritten through Module 1.  (don't ask why, just bear with me).

So I edited the etc/module.xml file of "Module1" and added the "Module 2" inside the <sequence> tag.
But that has no effect, because the list of modules from config.php remains the same.
Is there a way to rebuild the sequence from config.php? I know that for 2 modules it should be easy because I can just edit it manually, but I'm curious if there is an automated way of doing it, in case I will need it in the future.


texts: Discount code not working on mobile in Magento 1.9

texts:
I have implemeted discount code section on cart page. Design for Discount Code section is different for both desktop and mobile. I have called discount code block two times on single page for desktop and mobile.

Functionality for mobile is working fine, But not working in desktop.

Please find the below code for mobile :

<?php echo $this->getChildHtml('totals'); ?>
<?php if (!$this->hasError()): ?>

        <?php echo $this->getChildHtml('methods'); ?>

<?php endif; ?>
<?php //echo $this->getChildHtml('coupon'); ?>

Find the below code for desktop: -

       <?php echo $this->getChildHtml('totals'); ?>
       <?php if (!$this->hasError()): ?>

                <?php echo $this->getChildHtml('methods'); ?>

        <?php endif; ?>
        <?php echo $this->getChildHtml('coupon'); ?>

Where am doing wrong?


texts: How to get the list of applied filters using getActiveFilters?

texts:
I am working on the layered navigation. i am trying to get the list of applied filters using getActiveFilters of the block Mage_Catalog_Block_Layer_State.

I am trying to understand how getActiveFilters function works but not getting.

Please Help me how can i get getActiveFilters in magento.

I am trying this on the custom cms page.which is not working.

This code is working on the category page.


texts: Magento2 : which event just after order has been saved

texts:
I would like to run a function after an order has been placed.

I then tried to trigger on the event sales_order_place_after but at this step of the order process, order_id and item_id seems not to be defined yet.

I need to get these ids for my process. what is the next event after order_id and item_id are defined?

Thank you for your help


texts:
While checkout out, It again asks me to login. But user is already logged in. Even after loggin again and again, still it askes me to login. Website Link Kiabzanew.site.

This problem suddenly strated, I didnt even take the backup. But I checked online everyone is saying its a common Magento 2 problem. Please if anyone know any solution let me know.


texts:
I am using magento 1.9

In default theme when i Add 4 qty of product although total qty is 3. this error msg shows on product page "The requested quantity is not available."

But in Jumbo theme Error msg not showing on product page.

how to fix this issue


texts: Execute magento commands in php shell without SSH

texts:
My webserver host does not provide access to SSH.

I want to run commands like:

php bin/magento setup:static-content:deploy

I have tried to do this in the shell terminal using:
- phpFileManager
- eXtplorer
But none of them seem to work.

When I run the command nothing happens, and there is no output to the console:

Can this even work in a shell, or do I need to have SSH access?


texts: Magento2 - controller redirect using plugins

texts:
Doing url redirects is an easy thing rewriting a controller class, as $this->resultRedirectFactory is accessible as it is one of default injected objects

But, can we use this in plugins? I've been trying different ways, with no success

For instance... let's say I want to write plugin for \Magento\Multishipping\Controller\Checkout\Addresses controller execute() method, ignoring all logic & just redirecting to checkout/cart

Can someone provide how we could do this in a plugin with the 3 possible approaches (before, around & after)? Full code of the plugin class would be great, as my main problem is I haven't understand yet about how plugin parameters work

UPDATE

Not 100% sure, but I believe I tried same code as kirby solution yesterday, but using before plugin and saw constructor errors in frontend...


texts: Restricting access to /rss not working NGINX

texts:
My Magento install keeps getting bombarded with traffic to /rss/catalog/notifystock which I read is a security issue in my current version of Magento.

This is causing to many concurrent sessions and therefore slowing the site right down or eventually taking it offline until they stop.

As a quick fix to combat this I wanted to deny all access to the /rssdirectory but alas my code doesn't snippet doesn't seem to have the desired affect and the url is still accessible.

I am using:

    location ~ /\rss* {
    # deny access to rss directory
    deny        all;
}

I though I may have incorrectly added this replacing rss  with media for example does stop access to the media directory.

Any thoughs on why this could be and how to fix it?

Thanks!


texts:
I want to add license to magento2 modules.
I am magento2 developer. i want to set license to my modules for free or sell. but don't know how can i add domain license to my modules.
Want to set domain license mean that when some one wants to buy or download my module, should give me his domain to activate the module.
Anybody can help me?


texts: how to increase the width of date field in admin grid

texts:
How to increase the width of date field in admin grid while searching the value is cut-off.
Please See the image below


texts: How to move this Container to the top of the page

texts:
All I've just finished reading http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_rearrange. Trying my best to answer this question before I come back here but nothing it tells me to do on there is working. I'm trying to move topbar.wrapper to the top of the page above everything. My current code is

<referenceContainer name="topbar.wrapper">
    <container name="topbar.container" as="topbar_container" label="Page topbar Container"  htmlTag="topbar" htmlClass="page-topbar" before="-"/>
 </referenceContainer>
<referenceContainer name="page.wrapper">
     <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
    <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
</referenceContainer>

I dont know if i am missing something but i just cant get this to play ball.

Many Thanks


texts: How to update data custom table in Magento 2

texts:
I want to update data by id, I tried this code but it adds new data, not update data, how to update it? please help me

My code

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $data = $this->getRequest()->getParam('general');
    $model = $this->dailyOffers->create();
    $model->load($data['id']);
    $model->setData([
            "product_id" => $data['product_id'],
            "product_name" => $data['product_name'],
            "product_sku" => $data['product_sku'],
            "placement" => $data['placement'],
            "start_date" => $data['start_date'],
            "end_date" => $data['end_date'],
            "offer_price" => $data['offer_price'],
            "is_active" => $data['is_active']
            ]);
    $saveData = $model->save();


texts: Magento 2 - How to add custom values from custom table to product custom attribute?

texts:
I want to get the locations from custom_location table values to custom product attribute multi-select box.

custom_location values like:

1 - location_1

2 - location_2

3 - location_3

4 - location_4

How can i get these values to magento 2 product attribute multiple select box?Thanks for helping


texts: Integrity constraint violation error when saving product (google experiments on)

texts:
I am trying to edit configurable product and getting error. I am using Magento version 2.1.2

Steps to reproduce:

Go to admin -> Stores -> Configuration -> Sales -> Google API section
Change the configuration Enable Content Experiments to "Yes"
Save a configurable product and its child product consecutively.

Expected result:

Product should be save successfully with any number of times.

Actual result:

failed to save product
getting bellow error:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '0-402-product' for key
  'GOOGLEOPTIMIZER_CODE_STORE_ID_ENTITY_ID_ENTITY_TYPE', query was:
  UPDATE googleoptimizer_code SET entity_id = ? WHERE (code_id='136')

Anyone can help me to fix this issue?


texts: Wrong number of products even after reindex?

texts:
I was meet a very strange issue with Magento 2 number of products. There has a question here on Magento StackExchange: Wrong number of products in category. But my situation is different to him.

In my categories, there are no subcategories nor any products. But the number inside brackets is 1xxx. I tried to reindex (clear cache...) millions of millions times, but there is no luck, still same result.

Anyone here ever met this before me? Or better if you knew what was happened.


texts: layout over riding in account page affecting category page

texts:
I am building a custom magento theme in magento 2.1. While developing I noticed that whatever change I am making to app/design/frontend/vendor/theme/Magento_Customer/layout/default.xml is affecting on category listing page and home page also. The changes supposed to be happen only in account sections, right? here I am attaching my app/design/frontend/vendor/theme/Magento_Customer/layout/default.xmlfile.

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

<body>

    <referenceContainer name="content" htmlTag="div" htmlClass="container myaccount">
        <referenceContainer name="content.inner" htmlTag="div" htmlClass="test-class-4">
        </referenceContainer>
    </referenceContainer>

   <move element="sidebar.main" destination="content" before="account.content.inner"/>
    <referenceBlock name="sidebar.main" htmlTag="div" htmlClass="col-md-3 col-xs-12 account-left"/>
    <referenceBlock name="category-sidebar" remove="true"/>
    <referenceBlock name='customer-account-navigation-downloadable-products-link' remove='true'/>
     <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
    <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>

</body>

Any idea why is it so?


texts:
I need to allow to use numbers in quick search to differentiate products that are called like this examples :

box 1800
box 1100
box 5500

But it looks like the numbers are ignored in the search. Do you know how to fix this problem?


texts: Madison Island View details and Add to cart

texts:
I am new to Magento so please forgive me if my question sounds foolish.
I have the default Madison Island template which was there when i installed magento. I noticed that if you are looking on product list under men/ women section than it shows (View Details) on the listing

 where as if you look under Accessories it shows (Add to Cart).

I turned on Template Path Hints to check which file controls the Display ( with google's help)

and the file is

frontend/rwd/default/template/catalog/product/list.phtml

So my question is how does the same file show two different displays( View Products and Add to Chart )??

Or is there any thing else that controls such output ?


texts: How to refresh summary articles in checkout

texts:
I made a module (override Discount.php in Magento_SalesRules) which adds a free product when entering a specific coupon code. So far it is working and in the summary the totals are all correct and updated.
But the view of the added product is not correct. Thubnail is not shown and the count of articles in the cart is not correct.
Have a look to the screen shot:

As you see, the image is not there and the total count of products in the cart still says one, not two as it should.
Does somebody have an idea how I can trigger the udate of this part of the summary?
As well, minicart is not showing the correct stuff.
Would be great if somebody does have an idea how to achieve this.
Best regards,
Chequille


texts: Magento 2 : I need to move coupon form in checkout page to the page top

texts:
How to move the coupon form in checkout before the Payment method details.
I tried through override of vendor\magento\module-checkout\view\frontend\web\template - payment.html

But it didn't affected ,is there any other ways to solve this requirement ?


texts: Magento 2 - Catalog Layer has been already created

texts:
I have upgraded my Magento from 2.3 to 2.4 and i am getting Catalog Layer has been already created error. Everything was working fine on 2.3.
Anyone have any idea what could be the issue?
Any help is appreciated. Thanks


texts: Magento Customer Registration Notification Email Sent to Admin

texts: Is there an easy solution for the admin to receive a notification email every time someone registers to the store?


texts: Shopping cart price rule percent discount

texts:
I would like to give a family & friends 40% discount with a max. subtotal of €250

Actions:
Apply: percent of product price discount
Discount: 40
Apply the rule: if all of these conditions are true
Price in Shopping cart is equal or smaller than €250

(Also tried it without € ) but it still is giving after €250 the 40% discount.

Please tell me what I am doing wrong.


texts:
how can I add Magento functions to a php site? (For example: How can I add that the users have to sign in, if they want to view the page?)

Thanks!


texts: How to create simple product using direct SQL queries?

texts: I know direct SQL query is not good practice, but I need to insert product using direct SQL query.Also they do not want to use REST API for that.Anyone has SQL queries to create a simple product with all the fields.


texts: Default Attribute Set has been populated with 'non default' Attributes - how to restore the factory default?

texts:
I'm practicing on a test shop (1.9.1.0) which has seen others taking first steps in Magento before. So, things are not in any sort of 'clean page' status any longer. One example: The default Attribute Set has been populated with many attributes which are pretty particular, so it seems someone has changed the default Attribute Set.

Is it possible to create a new attribute set and set it to the 'Magento default' (if such a thing exists) somehow? Coppying the existing `defaulta´ Set does not help due to hat I've mentioned before.


texts: How to show product labels on Thumbnails

texts:
Have labels that show on product images on the category page and product page but they do not show on thumbnail images when doing a product search.
How can get the product labels to show on the thumbnails as well?


texts: Magento pagination query different to list.phtml file collection

texts:
I have tried to filter the magento product result according to stock and all color and etc. so i have wrote some query, but instead of query my pagination page numbers are different, when i debug this then i got that my pagination 'pager.phtml' file load any other collection from any where but not loading my custom filter collection so how i can load my custom collection in pager.html file..

$_productCollection = $_productCollection->joinField('is_in_stock',
                         'cataloginventory/stock_item',
                         'is_in_stock',
                         'product_id=entity_id',
                         '{{table}}.stock_id=1',
                         'left')->addAttributeToSort('updated_at','desc')->addAttributeToFilter('is_in_stock', array('gt' => 0));

abover query return 134 results but below file query retrieving 230 results /app/design/frontend/default/MAG090181/template/catalog/product/list/toolbar.phtml

$this->getCollection()

Thanks


texts: add to cart button for product list page

texts: .what steps should I consider the description of ADD TO CART BUTTON  for category page and product list page step by step.


texts: Attaching an event to configurable product changes

texts:
I need to inject a JS script into product pages than when changing the configurable option dropdown will give me the new simple products SKU inside the JS.

This is going to be added into an existing module.

Getting the SKU information programatically is ok, and originally I thought about extending configurable.phtml but then looked at how many sites I've build that have overwritten configurable so I don't want to do this.

Where would be the best place to inject this where I can get the product information I need and watch for the select box change?


texts: How to Add Custom Field (Not an Attribute) in Magento Add/Edit Product Price Tab?

texts:
I want to add new custom field, it is not an attribute, in Magento add/edit product price tab, but I didn't found the template file for it.

I found the template file for categories tab in app/design/adminhtml/default/default/template/catalog/product/edit/categories.phtml

So how does Magento generating the price tab? And how to add new custom field into it?


texts: Looking for someone who has done Magento 1.9 + Fishbowl API Gift cards

texts:
We are currently having issues with giftcard transactions inside fishbowl coming from magento.

Magento processes the order, then sends the order over to fishbowl. In which fishbowl classifies the giftcard as a discount. Fishbowl then believes it is an underpayment and then double charges for shipping and causes a mess.

Is there anyone who has developed a magento site that has fishbowl inventory as a connection, and also who has gift cards working properly? Fishbowl Inventory has nothing to say and said to seek outside help.

We are using the WebTex giftcard, but can easily switch to Amasty or anything like that if we are able to get any ideas on what to do to fix this.


texts: Filter the back-end products by category

texts:
I've inherited a Magento-based website for another developer, and I was wondering if there was a way to filter the "manage products" list in the back-end by category? Basically, there's a "second-hand" category that I don't want to see in my product list.

A Google search was fruitless, and the answers on here all seem to involve changing code for the front-end, which isn't what I want.


texts: Static blocks in transactionals email for multilingual stores

texts:
we have got a multilingual stores which has been translated into Polish, Italian, French and German. We used several static blocks e.g. to display our general business terms and I succeeded in including this content in the different languages for the different store views. The identifier of the different blocks is the same for the different languages.

Now I would like to translate also Magento's transactional emails. In some of the mails, we also use static blocks, e.g. to display our general business terms.

I would like to know, how this has to be managed. If the identifier is the same for all languages, how is it possibile to display e.g. the Italian general business terms in the Italian transactional emails? Or do I have to change the identifier? Can the identifier be the same of different languages / different store views?


texts:
i would like to create a banner on product view page and move this banner
AFTER the short description and before the tab content.

I user this code under catalog_product_view.xml

<move element="product.info.banner" destination="content" after="product.info.description" />

but it's not working and i cannot resolve my problem.
Can someone help me solving this problem?
Best regards

The results should be the same in this picture

TEST1:

gave me this result

EDIT2: My xml

<?xml version="1.0"?>

<referenceBlock name="product.info.review" remove="true"/>

<referenceContainer name="content">
  <container name="product.info.banner" htmlTag="div" htmlClass="product banner permuta">
    <block class="Magento\Catalog\Block\Product\View" name="product.banner_tradein" template="Magento_Catalog::banner_tradein.phtml">
      <arguments>
        <argument translate="true" name="title" xsi:type="string">BannerTradin</argument>
      </arguments>
    </block>
  </container>
</referenceContainer>

<referenceBlock name="product.info.details">

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

<referenceContainer name="product.info.extrahint">
  <referenceContainer name="product.info.social">
    <referenceBlock name="product.info.addto" remove="true"/>
    <referenceBlock name="product.info.mailto" remove="true"/>
  </referenceContainer>
</referenceContainer>

<referenceContainer name="product.info.stock.sku" remove="true"/>
<move element="product.info.banner" destination="content" as="banner_tradein" after="product.info.media" before="product.info.overview"/>


texts: How to show product label sale only on products that are on sale?


texts:
I have my custom module on Magento 2.3 and my custom module should send email from frontend.
On this code, the module stops working

            $transportToStore = $this->transportBuilder
                ->setTemplateIdentifier('send_pro_email_store_template')


texts: Avs FastSimpleImport - Super Attribute Option Price

texts:
i have setup an product import with AVS fastsimpleimport and have some trouble to get  the right fields or syntax for configurable option value prices. What i want to do is price changes to the options similar to this:

so, how can i set the option price thruh the import array?

my importdata so far (just for e.g):

....
$data[$key] = array(
                'store'                   => array('default'),
                '_product_websites'       => array('base'),
                'sku'                     => isset($information[0]) ? $information[0] : null,
                '_attribute_set'          => 'Default',
                '_type'                   => 'configurable',
                '_category'               => isset($information[39]) ? explode(',',$information[39]) : null,
                'price'                   => isset($information[22]) ? str_replace(',', '.', $information[22]) : null,
//                'special_price'           => isset($product['special_price']) ? $product['special_price'] : null,
                'weight'                  => isset($information[16]) ? $information[16] : null,
                'name'                    => (isset($information[0]) && isset($information[4])) ? utf8_encode($information[4]." - ".$information[0]." ".$information[5]." ".$information[6]) : null,
                'description'             => isset($information[7]) ? $information[7] : null,
                'short_description'       => (isset($information[5]) && isset($information[6])) ? utf8_encode($information[5]." ".$information[6]) : null, /
                'status'                  => '1',
                'visibility'              => '4',
                'tax_class_id'            => '1',
                'qty'                     => '99',
                'is_in_stock'             => '1',
....

thanks in advance

EDIT ----

i edited my code but get errors. here is it:

        // create variants first
        $simples = $this->createVariants($data, $additionalInformations);
        $simple_sku = array();

            // create the values for each simple product
            foreach($simples as $simple)
            {

                $data[$key]['_super_products_sku'] =  $simple['sku'];
                $data[$key]['_super_attribute_code'] =  array('material','schirme');
                $data[$key]['_super_attribute_option'] =  $simple['schirme'];
                $data[$key]['_super_attribute_price_corr'] =  $simple['price'];

        }

    // merge the data arrays
    array_unshift($data, $simple);
                print_r($data);

log output:

[_super_products_sku] => AF4125-780.RK25
            [_super_attribute_code] => Array
                (
                    [0] => size
                    [1] => size
                )

            [_super_attribute_option] => label
            [_super_attribute_price_corr] => 340

but seems to not bee right


texts: How to include custom javascript to admihtml edit form in Magento 2?

texts:
I have created custom model and backend for it (grid and create/edit form). Now I need to add ajax autocomplete to one of the input fields of this form.
How can I add custom javascript to edit/create form?

Any examples or links to examples would be appreciated.


texts:
I want to sort alphabetically the manufacturers images list.
I'm using this code and  it generate the order that I have on magento admin

get(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class)
    ->get('manufacturer');

 foreach ($attribute->getOptions() as $option) {

    $src = $this->getViewFileUrl('images/' . $option->getLabel() . '.png');

    ?>

 " alt="getLabel() ?>" onerror="this.onerror=null; this.remove(); " style="padding: 10px 20px;"  width="200" height="200"/>

Please help


texts:
I have a table represented in backend with two rendered fields, but when I try to make a CSV export from this grid, those two fields are not included.

So I tried to make a join from the initial collection but I would have to make a join with a query / select like this:

SELECT main_table.*, art.artworks_uploaded
FROM mage_artist_details AS main_table
    LEFT JOIN (
        SELECT artist_id, COUNT(*) AS artworks_uploaded
        FROM mage_art_works
        GROUP BY artist_id
    ) AS art
    ON main_table.user_id = art.artist_id

Any ideas of how can I obtain this?

If I try and use directly this query for my collection, I lose pagination in grid.

If I try and replace a table with a query in the next line I get errors:

$collection->getSelect()->join(
    array('art' => 'mage_art_works'),
    'main_table.user_id = art.artist_id',
    array('artworks_uploaded' => 'COUNT(*)')
)


texts: How to get collection from two tables and show in Admin grid using Union query Magento2.2.5?

texts:
I want to show two table values in Admin grid using UI Component (which has no relation) so using union query it can be achieved.
How to get the collection from two tables?

Table structure 1

Table structure 2

Please, someone, help me with this.


texts: Magento TAF - Cannot find page with mca "staging" in "frontend" area

texts:
I keep getting: Errors: 221, Skipped: 1349 when running the automated tests..

The logs are reporting (for example):
Core_Mage_Wishlist_Wishlist::preconditionsForTests
OutOfRangeException: Cannot find page with mca "staging" in "frontend" area

'staging' being my admin url.

As far as I can see everything is properly configured in config.yml

Can anyone help?


texts: Magento 2 : How to add custom meta tag in head

texts:
How to add custom meta tag in head tag of page-layout-2columns-left

custom meta tag l want to add is

<meta property="og:image" itemprop="image" content="url"/>

P.S.

I want this url to be dynamic which change on page to page.


texts: upgrade to newer version manage categories not showing in admin menu

texts:
upgrading to newer version now we do not have the manage categories in the menu I tried hard to find where I should insert or change anything for example adminhtml.xml or config.xml
I thought maybe some modules made this to happen but I disabled all modules and still I cannot see it in the menu the magento upgrade version is from 12 to 13
is there anyone experiencing the same?


texts:
I am using Magento 2.2.2. A few days ago, several guests (not all guests) could not log in to my website. After entering the username and password, the guest has been waiting for about 10 minutes. Then there was a 503 error.
How can I solve this problem, thank you


texts: Magento 2.0.7 to 2.1.0 System Upgrade Status: Update application is running Update is already in progress

texts:
shall i wait more or its hanged????

[2016-06-05 16:35:03 CEST] Job "maintenance_mode {"enable":true}" has been started

[2016-06-05 16:35:03 CEST] Magento maintenance mode is enabled.

[2016-06-05 16:35:03 CEST] Job "maintenance_mode {"enable":true}" has successfully completed

[2016-06-05 16:35:03 CEST] Job "update {"components":[{"name":"magento/product-community-edition","version":"2.1.0-rc1"}]}" has been started

[2016-06-05 16:35:03 CEST] Starting composer update...

[2016-06-05 16:35:03 CEST] ./composer.json has been updated

[2016-06-05 16:36:02 CEST] Update is already in progress.

[2016-06-05 16:37:03 CEST] Update is already in progress.

[2016-06-05 16:38:05 CEST] Update is already in progress.

[2016-06-05 16:39:03 CEST] Update is already in progress.

[2016-06-05 16:40:03 CEST] Update is already in progress.

[2016-06-05 16:41:03 CEST] Update is already in progress.

[2016-06-05 16:42:03 CEST] Update is already in progress.

[2016-06-05 16:43:03 CEST] Update is already in progress.

[2016-06-05 16:44:02 CEST] Update is already in progress.

[2016-06-05 16:45:03 CEST] Update is already in progress.

[2016-06-05 16:46:02 CEST] Update is already in progress.

[2016-06-05 16:47:03 CEST] Update is already in progress.

[2016-06-05 16:48:03 CEST] Update is already in progress.

[2016-06-05 16:49:02 CEST] Update is already in progress.

[2016-06-05 16:50:03 CEST] Update is already in progress.

[2016-06-05 16:51:02 CEST] Update is already in progress.

[2016-06-05 16:52:02 CEST] Update is already in progress.

[2016-06-05 16:53:03 CEST] Update is already in progress.

[2016-06-05 16:54:03 CEST] Update is already in progress.

[2016-06-05 16:55:03 CEST] Update is already in progress.

[2016-06-05 16:56:03 CEST] Update is already in progress.

[2016-06-05 16:57:02 CEST] Update is already in progress.

[2016-06-05 16:58:04 CEST] Update is already in progress.

[2016-06-05 16:59:03 CEST] Update is already in progress.

[2016-06-05 17:00:03 CEST] Update is already in progress.

[2016-06-05 17:01:02 CEST] Update is already in progress.

[2016-06-05 17:02:03 CEST] Update is already in progress.

[2016-06-05 17:03:04 CEST] Update is already in progress.

[2016-06-05 17:04:02 CEST] Update is already in progress.

[2016-06-05 17:05:03 CEST] Update is already in progress.

[2016-06-05 17:06:03 CEST] Update is already in progress.

[2016-06-05 17:07:03 CEST] Update is already in progress.

[2016-06-05 17:08:03 CEST] Update is already in progress.


texts: PHTML Uncaught TypeError: $(...).lazy is not a function

texts:
After installing this module I get an error sometimes:
Images won't load and the next error will show on console:
Uncaught TypeError: $(...).lazy is not a function
With a link to this section of code in the scripts.phtml
require(['jquery', 'lazyLoad', 'lazyLoadPlugins'], function($) {
    window.mgzLazyload = function(config) {
        var settings = {
            bind: "event",
            delay: <?= $delay ? $delay : '-1' ?>,
            threshold: <?= $threshold ?>,
            effect: "<?= $effect ?>",
            effectTime: <?= $effectTime ?>,
            afterLoad: function(element) {
                $(element).removeClass('lazy-loading').removeClass('lazy-blur').addClass('lazy-loaded');
            }
        };
        if (config) settings = $.extend(settings, config);
        $('.lazy').lazy(settings);
    }
    window.mgzLazyload();
    $(document).on('ajaxComplete', function (event, xhr, settings) {
        window.mgzLazyload();
    });
    $(document).ready(function($) {
        $('.owl-carousel').on('changed.owl.carousel', function(event) {
            window.mgzLazyload();
        });
    });

I tried to fix it on my own, but can't seem to force the module to load lazy before this section.
Here is an example:
https://jobbooz.com/hombres/indumentaria/todos-los-modelos.html?sale=1&size=168
NOTE: It's not always, most of the time it will load correctly, so you have to load it a couple of times.


texts: Magento 2 script errors when running MAGE_MODE=production

texts:
I've installed Magento 2 and set MAGE_MODE=production. However, I'm receiving a lot of JavaScript errors when visiting the home page (requireJS).

I tried flushing the cache and reploying static content files, to no avail.

I'm on the master branch of m2.


texts:
I need to set images from the Magento media folder but index.php keeps getting in the way and since I'm going to be moving this dev site to another production URL, I can't just use hard paths in this case.

In Wordpress/Drupal I can set a link like <img src="<?php echo home_url(); ?>/media/image-name.jpg" /> but I can't find anything similar to that for Magento.

I'm needing this for the static blocks section if that makes a difference. When I try to set relative links to http://mysite.com/media/image-name.jpg I end up with http://mysite.com/index.php/media/image-name.jpg which of course results in 404.

What do I need to put in static blocks that will reference the main site without the index.php?


texts: magento 2 multi-website This site can’t be reached

texts:
I have setup Magento 2 in WAMP stack.

I have created two virtual hosts.

magento230.com
wateroff-test.net

# magento230.com
<VirtualHost *:80>
   ServerName magento230.com
   ServerAlias www.magento230.com
   DocumentRoot "C:/wamp/www/magento230"
   <Directory "C:/wamp/www/magento230">
       Options +Indexes +Includes +FollowSymLinks +MultiViews
       AllowOverride All
       Require all granted
   </Directory>
</VirtualHost>

# wateroff-test.net
<VirtualHost *:80>
   ServerName wateroff-test.net
   ServerAlias www.wateroff-test.net
   DocumentRoot "C:/wamp/www/magento230"
   SetEnv MAGE_RUN_CODE "wateroff_net"
   SetEnv MAGE_RUN_TYPE "website"
   <Directory "C:/wamp/www/magento230">
       Options +Indexes +Includes +FollowSymLinks +MultiViews
       AllowOverride All
       Require all granted
   </Directory>
</VirtualHost>

Now created two websites in Magento admin.

default website
wateroff website

Wateroff website configuration in admin.

Website name - Water Off (wateroff.net)

Website code - wateroff_net

Default store - Wateroff store
Store Information

Store name - Water Off Store

Store code - water_off_store

Root Category - Water off

Default Store View - US-English(WF)
Store View Information

Name - US-English(WF)

Code - wateroff_us

Status - enabled

When I run url http://magento230.com/ its working fine and http://magento230.com/customer/account/create/ working fine.

BUT

When I run url http://wateroff-test.net/ its not working fine and http://wateroff-test.net/customer/account/create/ gives error like This site can’t be reached.

When i see issue in console it gives me same error for all css and js.

      Failed to load resource: net::ERR_NAME_NOT_RESOLVED

I already run below command in same manner.

      php bin/magento cache:flush
      php bin/magento setup:upgrade
      php -dmemory_limit=5G bin/magento setup:static-content:deploy -f

What is the issue here I don't know.

Please help me.


texts: how to filter configurab;e product by using child product attribute for REST API in searchcriteria

texts:
How to filter parent product by its child product attribute in REST API
v1/products/- endpoint
How can I add a custom search endpoint in this endpoint (v1/products)
Please guide me. Thanks


texts: What's the reason for sql-updates being triggered multiple times?

texts: When an existing extension is updated either manually or using Magento-Connect, in some occasions the sql-updates are triggered multiple times right away or again after a short while, although the version is correctly saved in the table "core_resource".


texts: Admin not receiving orders - no record of order yet customer received confirmation email

texts:
I'm hoping you all could help me with a troubling issue.  It seems that certain orders are not being received by the Magento backend for certain customers.  They receive a confirmation email, yet on our Admin backend there is no record of the order.

The strangest part is that their order is out of sync with our order numbers.  While orders normally go upwards in chronological order (we're currently on 100001273) - the orders not on record are totally out of sync with where we are now (ex. one of the customer's emails showed 100000301 as their order number)

Looks like the store is running on Magento 1.5.1.0.

Any help is tremendously appreciated.  Thank you!


texts:
I have fairly simple REST API request to get guest country code by his ip.
In my block file this works perfectly fine when using curl:

    $url = "http://........./".$guestIp."?access_key=".$access_key.$jsonOutput;
    $this->_curl->get($url);
    $response = $this->_json->unserialize($this->_curl->getBody());
    $countryCode = $response['country_code'];

    return $countryCode;

Now when should I create Api/Data interfaces, repository interfaces in this case if it is needed?


texts: Setting up shopping cart price rule on product (with options) for a customer group?

texts:
I have a customer group who has been promised a special price on two sizes exercise balls. Currently the product is set up as a drop-down according to size.

For example, the 55 cm ball is $15.95, but the promised price is $13.97.
Likewise in the drop-down, the 65 cm ball is $20.15 and promised price is $17.79.

Can you use a shopping cart rule to discount the price, or do I have to break apart the listing into individual SKUS in order to achieve the promised price?

Thanks!


texts:
I have used C# to call magento rest API to create a new product (magento version 2.2.5)

this is the body data:

{
  "product": {
  "id": 0,
  "sku": "MS-Champ11",
  "name": "Champ Tee11",
  "attribute_set_id": 9,
  "price": 110,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": null,
  "updated_at": null,
  "weight": 5,
  "extension_attributes": null,
  "product_links": null,
  "options": null,
  "media_gallery_entries": null,
  "tier_prices": null,
  "custom_attributes": [
      {
        "attribute_code": "description",
        "value": "Test Description"
      }
    ]
  },
  "save_options": false
}

this is my C# code:

public string CreateProduct(Product product)
    {
        try
        {
            var request = CreateRequest("/rest/V1/products", Method.POST, Token);
            var prod = new ProductModel();
            prod.Product = product;
            string json = JsonConvert.SerializeObject(prod, Formatting.Indented);
            request.AddParameter("application/json", json, ParameterType.RequestBody);

            var response = Client.Execute(request);
            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return "Succeed";
            }
            else
            {
                return "Failed";
            }
        }
        catch (Exception ex)
        {
            return ex.ToString();
        }
    }

I tried many time but it was always responding error "BadRequest"

{"message":"Invalid product data: %1","parameters":["Invalid attribute set entity type"]}

what was i doing wrong? please help me.


texts: Remove “Choose an Option…” in Configurable Attribute Dropdown Menu

texts:
I'd like to COMPLETELY REMOVE Choose an Option… line from the dropdown menu in the configurable product page as in the pic and select the first option by default.

What I already tried:
I already overrode the app/design/frontend/MyTheme/default/Magento_ConfigurableProduct/templates/product/view/type/options/configurable.phtml file with my custom code:
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>

<?php
/** @var $block \Magento\ConfigurableProduct\Block\Product\View\Type\Configurable*/
$_product    = $block->getProduct();
$_attributes = $block->decorateArray($block->getAllowAttributes());
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
    <?php foreach ($_attributes as $_attribute): ?>

            <label class="label" for="attribute<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>">
                <?= $block->escapeHtml($_attribute->getProductAttribute()->getStoreLabel()) ?>

                <select name="super_attribute[<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>]"
                        data-selector="super_attribute[<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>]"
                        data-validate="{required:true}"
                        id="attribute<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>"
                        class="super-attribute-select">
                    <option value=""><?= /* @escapeNotVerified */ __('Choose an Option...') ?></option>
                </select>

    <?php endforeach; ?>

<?php endif;?>

and this allowed me to select the first option by default (as discussed here and here) but Choose an Option line is still there.
Any ideas?


texts: How to change the product detail page to a 2 column layout in Magento 2.3?

texts:
I have created a layout XML file for a custom theme which inherits from the default Magento Blank theme:

app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/catalog_product_view.xml

and set the layout to 2columns-left:

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

Also the setting under: "Stores > Configuration > General > Web > Default Layout" doesn't seem to have any effect.

Magento version: 2.3.2 CE


texts: How to write Nested Query in Grid Collection _initSelect method

texts:
I want to Apply this Query using $this->getSelect() method

SELECT *

FROM
    (SELECT * FROM customer_grid_flat ORDER BY enroller_id, entity_id) customer_grid_flat, (SELECT @pv := '$id') initialisation

WHERE
FIND_IN_SET(enroller_id, @pv) > 0 AND @pv := CONCAT(@pv, ',', entity_id);

Func _initSelect() under Collection

protected function _initSelect()
{
    parent::_initSelect();
    $id = $this->helperdata->getCurrentId();

$this->getSelect()->reset(\Zend_Db_Select::FROM)
->from(
['maintable' => new \Zend_Db_Expr('(SELECT enroller_id, entity_id FROM customer_grid_flat) customer_grid_flat, (SELECT @pv := "$id") initialisation')],
['customer_grid_flat.entity_id', new \Zend_Db_Expr('COUNT(*)')]
)
->where('FIND_IN_SET(enroller_id, @pv) > 0 AND @pv := CONCAT(@pv, ",", entity_id)');

return $this;

}

Result

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
  error in your SQL syntax; check the manual that corresponds to your
  MySQL server version for the right syntax to use near

  'AS maintable WHERE (FIND_IN_SET(enroller_id, @pv) > 0 AND @pv :=
  CONCAT(@pv, "' at line 1,

  query was: SELECT COUNT(*) FROM (SELECT enroller_id, entity_id FROM
  customer_grid_flat) customer_grid_flat, (SELECT @pv := "2")
  initialisation AS maintable WHERE (FIND_IN_SET(enroller_id, @pv) > 0
  AND @pv := CONCAT(@pv, ",", entity_id))