texts:
Magento doesnt seem to save any info for failed transactions to the database (e.g. sales_order) nor do they appear in the logs when I set the Braintree module to Debug but I am trying to get the IP address for failed transactions. Is there any other way?
Background: my client has recently been experiencing episodes of hundreds of spam transactions. The attackers seem to try different credit card numbers over and over my guess is to validate stolen numbers. What I want to do is find the IP address(es) of the attacks and ban them but its proving difficult to try and match timestamps etc. to server logs, I'd like to get the IP directly.
Thanks


texts: Crob Job Warning: proc_open(): fork failed

texts:
i running this cron job

php bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule"

but getting this message, how can i do? thank you

Warning: proc_open(): fork failed - Cannot allocate memory in /home/XXX/public_html/vendor/symfony/console/Application.php on line 993#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'proc_open(): fo...', '/home/XXX/...', 993, Array)
#1 /home/XXX/public_html/vendor/symfony/console/Application.php(993): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /home/XXX/public_html/vendor/symfony/console/Application.php(786): Symfony\Component\Console\Application->getSttyColumns()
#3 /home/XXX/public_html/vendor/symfony/console/Application.php(747): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /home/XXX/public_html/vendor/symfony/console/Application.php(681): Symfony\Component\Console\Application->getTerminalWidth()
#5 /home/XXX/public_html/vendor/symfony/console/Application.php(135): Symfony\Component\Console\Application->renderException(Object(Exception), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /home/XXX/public_html/bin/magento(23): Symfony\Component\Console\Application->run()
#7 {main}


texts: Blank page after installation and admin 404

texts:
I have installed Magento 2 on a CentOS 7 server with PHP 7.0.9 and NGINX 1.11.3 using the command line.
After running the installation, when we try to load the home page we get nothing but a blank page.
I do see a 500 error in the browser console, but i cant find anything in the PHP or NGINX logs.
On top of this, when I try to go to the admin, I am getting a 404 error.

Any help would be much appreciated!

Thanks


texts: Order Details are not displaying in admin Panel of magento 1.9

texts: The Order Menu Displays a Blank white screen. I can't see any order detail. please tell me suitable solution. Thanks.


texts: Why Magento making too much issues with SSL

texts:
I've installed my SSL cert and everything is wrong starting with "The page at 'XXX' was loaded over HTTPS, but ran insecure content from 'YYY': this content should also be loaded over HTTPS."

and then: "XMLHttpRequest cannot load XXX. The request was redirected to 'YYY', which is disallowed for cross-origin requests that require preflight."

Can anyone help me please?


texts: JS not added to head loaded and phtml not loaded

texts:
I am creating a very simple custom module to display an inline popup in my store.

The problem is that the my additional JS doesn't seem to be added, and the phtml file is not loaded. Both are in newsletterpopup.xml.

What am I missing?

\app\etc\modules\Mav_NewsletterPopUp.xml

<?xml version="1.0" ?>
<config>
      <modules>
            <Mav_NewsletterPopUp>
                  <active>true</active>
                  <codePool>local</codePool>
            </Mav_NewsletterPopUp>
      </modules>
</config>

\app\code\local\Mav\NewsletterPopUp\etc\config.xml

<?xml version="1.0" ?>

<config>
      <modules>
            <Mav_NewsletterPopUp>
                  <version>0.0.1</version>
            </Mav_NewsletterPopUp>
      <modules>
      <frontend>
            <layout>
                  <updates>
                        <newsletterpopup>
                              <file>newsletterpopup.xml</file>
                        </newsletterpopup>
                  </updates>
            </layout>
      </frontend>
</config>

\app\design\frontend\MY_THEME_HERE\default\layout\newsletterpopup.xml

<?xml version="1.0" ?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addJs"><script>mav/cookie/jquery.cookie.js</script></action>
        </reference>
        <reference name="before_body_end">
            <block type="core/template" name="newsletter_popup" as="newsletter_popup" template="mav/newsletter-popup.phtml" />
        </reference>
    </default>
</layout>

\app\design\frontend\MY_THEME_HERE\default\template\mav\newsletter-popup.phtml

<!-- HTML for popup shall appear here -->

\js\mav\cookie\jquery.cookie.js

//taken from http://www.demacmedia.com/wp-content/uploads/2013/08/jquery-files-for-popup1.zip


texts:
I am creating a new custom module in Magento 2. I want to add new custom text on listing page. I've attached a screenshot for reference.

Create a di.xml file in a folder Magenticians/Mymodule/etc:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Product\ListProduct" type="Magenticians\Mymodule\Block\Product\ListProduct" />
</config>

The next step to overriding Magento 2 block is to create a ListProduct.php block file in the folder Magenticians/Mymodule/Block/Product:

<?php
/**
* Rewrite Product ListProduct Block
* @category    FME
* @package     FME_Test
* @author      Fme Extensions Development Company
*/

namespace Magenticians\Mymodule\Block\Product;
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
    {
        public function __construct()
            {
                echo "you can do this in block"; die();
            }
    }

Create checkout_cart_index.xml inside app/code/Magenticians/Mymodule/view/frontend/layout:

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

Now, create cart.phtml file at location app/code/Magenticians/Mymodule/view/frontend/templates:

Shopping Cart

//write your stuff here

Please suggest me


texts: Magento 2 table rate works on cart page but not on checkout page

texts:
When I check the shipping via table rate for products ordered in the cart page in my magento 2.3.4 site, it comes out fine  but on the checkout page, I get the errors in the image below.

I have reviewed the table rates and the configuration , all  checks out fine. the cart rules are all fine.
In the checkout page, when I insert the post code and the rest of the address fields, I keep getting the same error for both the FLAT RATE and TABLE RATE.
I need your assistance.


texts:
I'm having problems applying a default sort order to the product collection for the listing page. When some conditions are met I want to sort by 'region' and then by 'price'. I have added the following in app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php.

  public function setCollection($collection)
{
    $this->_collection = $collection;

    $this->_collection->setCurPage($this->getCurrentPage());
    $limit = (int)$this->getLimit();
    if ($limit) {
        $this->_collection->setPageSize($limit);
    }
    if(Mage::registry('current_category')->getName() == 'France'){
        $this->_collection->setOrder(array('region', 'price'), $this->getCurrentDirection());
    }else{
        if ($this->getCurrentOrder()) {
            $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
        }
    }
    return $this;
}

This sorts by region successfully but not by price. I did read somewhere that different resources are used by price than other attributes when using them for sorting. If this is the case it makes sense because when I substituted price with name - $this->_collection->setOrder(array('region','name'), 'asc'); I get the collection sorted by region and then by name.

To confirm, both attributes are set yes to - Used in Product Listing and Used for Sorting in Product Listing.
Any suggestions on getting price to work with region?


texts:
I wanted to try working with Magento, so I downloaded the Magento 2.1.5 Community version from the website and installed in on my localserver from XAmpp (php 7.0.15).
Magento installed successfully (after changing some small php things), but after I logged in the adminpanel the buttons (on the left) weren't working and some logo's weren't loaded. I tried different things but they all didn't help. (cleared the cache)

So I tried again to download Magento but this time Magento 2.0.15. Same problem. I even have tried to install both with php 5.6 but then the installation wasn't successful.

So my question is, why isn't it working? and can it be solved easily? (if so, how?)

This are the console errors, it may be usefull:

<i>
require.js Failed to load resource: net::ERR_CONNECTION_RESET
mixins.js Failed to load resource: net::ERR_CONNECTION_RESET
http://127.0.0.1/magento2/pub/static/version1490356509/adminhtml/Magento/backend/en_US/extjs/resources/css/ytheme-magento.css Failed to load resource: net::ERR_CONNECTION_RESET
http://127.0.0.1/magento2/pub/static/version1490356509/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css Failed to load resource: net::ERR_CONNECTION_RESET
requirejs-config.js:58 Uncaught TypeError: require is not a function
    at requirejs-config.js:58
    at requirejs-config.js:63
    at requirejs-config.js:398
magento-icon.svg Failed to load resource: net::ERR_CONNECTION_RESET
(index):39Uncaught TypeError: require.config is not a function
    at (index):39
(index):87Uncaught TypeError: require is not a function
    at (index):87
(index):286Uncaught TypeError: require is not a function
    at (index):286
(index):418Uncaught TypeError: require is not a function
    at (index):418
(index):463Uncaught TypeError: require is not a function
    at (index):463
(index):504Uncaught TypeError: require is not a function
    at (index):504
(index):527Uncaught TypeError: require is not a function
    at (index):527
(index):550Uncaught TypeError: require is not a function
    at (index):550
opensans-700.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-600.woff2 Failed to load resource: the server responded with a status of 404 (Not Found)
opensans-400.woff2 Failed to load resource: net::ERR_CONNECTION_RESET
admin-icons.woff2 Failed to load resource: net::ERR_CONNECTION_RESET
opensans-600.woff Failed to load resource: net::ERR_CONNECTION_RESET
opensans-700.woff Failed to load resource: net::ERR_CONNECTION_RESET
opensans-400.woff Failed to load resource: net::ERR_CONNECTION_RESET
admin-icons.woff Failed to load resource: net::ERR_CONNECTION_RESET
opensans-600.ttf Failed to load resource: net::ERR_CONNECTION_RESET
opensans-700.ttf Failed to load resource: net::ERR_CONNECTION_RESET
opensans-400.ttf Failed to load resource: net::ERR_CONNECTION_RESET
admin-icons.ttf Failed to load resource: net::ERR_CONNECTION_RESET
ytheme-magento.css Failed to load resource: the server responded with a status of 404 (Not Found)
ext-all.css Failed to load resource: the server responded with a status of 404 (Not Found)
</i>


texts:
I'm trying to pass the data between 2 classes. One of them called via ObjectManager.
Here's the schema and short explanation.
ParseFormstackForm class called from the frontend form (Block) with regular construct() method. ParseFormstackForm calls API of 3rd party service, receive data which is used in the form and also needed to be saved (field mapping) and to be reused later in another class. Form renders in the frontend. The user fills it in and clicks submit. Controller Save calls DataTransmitter class (via ObjectManager) to pass the data for another service. And at that moment I need to use saved mapping. However, the registry is empty at that moment.
What could be the issue?


texts: "Transaction declined, please try later"- Error while placing order using eWAY payment method in Amasty checkout extension

texts: While placing order using eWAY payment method we are getting an error message : "transaction declined, please try later". When we contacted eWAY support they informed us that transaction was declined as card expiry month/ year was not received in checkout. In the Amasty checkout there is no field for card expiry month/ year. How to solve this issue in payment?


texts: M 2.3.4 - "Infinite loop detected..." exception on OPC, how to get items in the cart?

texts:
I'm trying to get quote on checkout and this exception is thrown in

vendor\magento\module-checkout\Model\Session.php:241

exception.log

Message: Infinite loop detected, review the trace for the looping path
{"exception":"[object] (Exception(code: 0): Report ID: webapi-
6e4533bg2n381; Message: Infinite loop detected, review the trace for the
looping path at /public_html/vendor/magento/framework/Webapi
/ErrorProcessor.php:208, LogicException(code: 0): Infinite loop detected,
review the trace for the looping path at /public_html/vendor/magento
/module-checkout/Model/Session.php:241)"} []

The problem is in overridden \Magento\Tax\Model\Config getShippingTaxClass() where I use

$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
$quote = $cart->getQuote();
$itemsCollection = $quote->getItemsCollection();

and this triggers the exception. There is no loop around it.

What would be to correct way of getting cart items in 2.3.4?


texts: Magento 2 : How To Customize Validation Error Message

texts:
Is there a way to add a custom error message to a custom validator?

I use already the default rule required-entry, can I define my own rules? and where exactly?

I found something with overwriting the validation.js, but I find this too cucumbersome. Isn't there a simpler way to do that?

LE:

Just to add more insight into the question:
the validation works, but when I get an error (from my logic) the field doesn't show any message (when no values in the input field are given then appears the required field text - but this is the default rule).

Meanwhile, I've tried this, but somehow the javascript part doesn't respond at all.


texts: Magento2: How to disable password autofill on store-configuration?

texts:
I have 2 fields on my system.xml.
The first one is an authentication key (obscured).
The second one is an email.
The thing is, because I use my email & it's also saved in my browser with a password, Chrome autofills my password into the first field, even after I save the right key it loads the form with the saved password from the browser.
Here is an example screenshot of what I mean:

-- Any idea?


texts: Delete 'Up-sells' link from Magento Backend- Catalog - Manage Products - Product Information - Up-sells

texts: Magento 1.9.0.1, After numerous attempts to remove this link via files in the Mangento file system I'm at a total loss as how to proceed. I have attempted to comment out lines of code in .php files, .xml files, removed rows from the DB based on tutorials online, altered/deleted functions and outright tried every possible variation of these steps. This is the culmination of 2 months hard work and I'm stuck! I simply don't want 'Up-sells' in my product information as a link when I'm setting up a product. The link that I don't want is pictured below. Please help, any suggestions will be greatfully received.


texts: Magento 2 add custom attribute to container in layout.xml

texts:
I would like to add more than one "Schema.org" to a Magento 2 Product-Layout.

In default Magento 2 the attribute for "Product-Schema" is added to body-tag, I would like to move this attribute to a container-div.

I found this thread: Magento 2 container custom attribute

But I don't think jQuery is a solution for a valid schema-structure.

So is the only solution to override the "_renderContainer" function, or can I replace a container with a template block?

Thanks


texts: Magento 2 - Move block or container only for specific Device

texts:
Is it possible to move block or container in Magento 2 only for specific device?

For example, I want to move minicart like that

<move element="minicart" destination="header.panel" before="-"/>

but this code should apply only for Desktop and Table device. But not for Mobile device.

Thanks very much


texts: Wrong customer group is assigned for the customer while creating an order via backend in magneto2.3(EE)

texts:
The customer group set as wrong for the customer while creating an order via backend.
See the difference in the screenshots. Please, anyone, guide me regarding this
Customer information

Create order


texts: Override price renderer on listing pages via XML

texts:
I am trying to override a price template, namely price_final.phtml.

etc/di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Pricing\Render\PriceBox" type="Project\ProductPriceSaving\Block\Pricing\Render\PriceBox" />
</config>

etc/module.xml:

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

view/frontend/layout/catalog_product_prices.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceBlock name="render.product.prices">
        <arguments>
            <argument name="default" xsi:type="array">
                <item name="default_render_class" xsi:type="string">Project\ProductPriceSaving\Block\Pricing\Render\PriceBox</item>
                <item name="prices" xsi:type="array">
                    <item name="final_price" xsi:type="array">
                        <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                        <item name="render_template" xsi:type="string">Project_ProductPriceSaving::product/price/final_price.phtml</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</layout>

I also have a block at Block/Pricing/Render/PriceBox.php, which extends Magento\Framework\Pricing\Render\PriceBox and adds some extra methods, and my template exists at view/frontend/layout/templates/product/price/final_price.phtml.

I don't get any errors, but the final price for a simple product still renders using module-catalog/view/base/templates/product/price/final_price.phtml. As far as my understanding goes, Magento should be picking up my override, but I must be missing something.


texts: Magento 2: Is deploying static content necessary in developer mode?

texts: Some threads say compilation is not necessary in developer mode, what about static-content:deploy? When I working on magento 2 modules, I often have problems getting my changes updated in the front end, I sort of leaned to clear different types of cache, generated files and static files, but I'm not sure whether deploy static content is necessary in developer mode. Any comments would be appreciated, thanks!


texts: Magento 2 move reviews form inside list.phtml file

texts:
By default magento 2 review structure is like this -

/templates/review.phtml and inside it you have -
/product/view/list.phtml and Magento_Review/templates/form.phtml files.

form.phtml file is called using <?= $block->getChildHtml() ?> in review.phtml file

What I want to do -
remove that getChildHtml part from review.phtml file to make form disappear. So far I get it to work. I have successfully removed my review form. Now I want to add my form back but inside list.phtml file and call it using getChildHtml. How can I do this? So far what I have tried ended with no luck.

Final result should be that in list.phtml file I call my form like this - <?= $block->getChildHtml('review_form') ?> and it should appear in place I put him

Thank you for any advice! :)


texts:
I installed magento 2 in amazon linux(centos) successfully. After doing styling and deploying, product images are not loaded. Add to cart is not working. it redirects to cart page without adding any item. There is knockout js issue

Error

ReferenceError: customer is not defined
  path.../en_US/knockoutjs/knockout.js line 2624 > Function
  Line 1

I copied this installation and installed in my windows 10 machine, it works fine. There is no js issue.

========================Update 1====================================

I followed this document.

I suspect that I have permission issue in the server.
my root folder permission

Inner folder permissions

var folder permission

pub folder permission

=======================Update 2==================================

I have executed command and attached screenshot herewith.

sudo chown -R ec2-user:apache var

suod chmod -R 777 var

Is there anyone who has this kind of experience will be helpful to solve this problem.

Thanks.


texts:
I have trouble figuring out whats wrong with my rewrite. I have used the answer of this question as a reference.

I'm trying to rewrite the core block:

app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Header.php

Here's my module's config.xml:

<config>
<modules>
    <MyNameSpace_MyModule>
        <version>1.0.0</version>
    </MyNameSpace_MyModule>
</modules>

<global>
    <blocks>
        <Adminhtml>
            <rewrite>
                <Sales_Order_Create_Header>MyNameSpace_MyModule_Block_Header</Sales_Order_Create_Header>
            </rewrite>
        </Adminhtml>
    </blocks>
</global>

This is the path to my block where i want to rewrite the function in Header.php:

app\code\local\MyNameSpace\MyModule\Block\Header.php

Content of Header.php:

<?php

class MyNameSpace_MyModule_Block_Header extends Mage_Adminhtml_Block_Sales_Order_Create_Header {
    //My rewrite
}


texts: Is this the correct way to add a custom block to before_body_end only on homepage?

texts:
Working with Magento CE 1.9.1.0.

I have written some custom code which I have placed here:

app/design/frontend/mypackage/mytheme/template/page/html/custom_code.phtml

I also created a new XML reference to this file here:

app/design/frontend/mypackage/mytheme/layout/page.xml

This is the reference I added within the layout block:

<cms_index_index>
  <reference name="before_body_end">
      <block type="core/template"  name="my_custom_code" template="template/page/html/custom_code.phtml" />
  </reference>
</cms_index_index>

However after clearing cache and verifying there are no errors anywhere on the system, I still can't get the block to show before_body_end anywhere on the homepage. What am I doing wrong?


texts: Magento 2 Navigation - Products Categories

texts: I'm using magento 2 , and I'm trying to create the product categories this way : basicly I want a parent category called CLOTHING that will appear in the navigation , and a subcategory called DRESSES in the CLOTHING category , and at the same level as CLOTHING I also want to see DRESSES , as it is a category , even if is a subcategory , and I want it to link same as clothing/dresses.. I don't know if I explained myself well..


texts: Getting lots of Error Debug Information emails

texts:
I'm getting a lot of emails from Magento with content that looks like this:

URL: http://www.mydomain.com/my-product-slug/reviews/+Result:+chosen+nickname+%22egegsduy01%22;+success+%28from+first+page%29;
IP Address: 173.208.194.13
First Name: sybjfgsu43
Last Name: wbmtblmp54CA
E-mail Address: totttiayao@sina.com
Telephone: 123456
Comment: &lt;a href=http://www.hodescenter.com/mk/&gt;&lt;b&gt;michael kors outlet online&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.razorlocator.com/michaelkors/&gt;&lt;b&gt;cheap michael kors purses&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.hodescenter.com/mk/&gt;&lt;b&gt;cheap michael kors purses&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.evanstour.com/mk/&gt;&lt;b&gt;michael kors outlet online&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.razorlocator.com/michaelkors/&gt;&lt;b&gt;michael kors purses&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.outbackphoto.org/cheapjerseys/?q=cheap-jerseys.html&gt;&lt;b&gt;cheap nfl authentic jerseys&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.stormchasehomepage.com/jerseys/?q=cheap-nfl-jerseys.html&gt;&lt;b&gt;cheap nfl authentic jerseys&lt;/b&gt;&lt;/a&gt; On its website, Palcohol says aspect plans to learn more about provide six varieties about dust alcohol, including vodka,rum and four cocktails  &lt;a href=http://www.outbackphoto.org/cheapjerseys/?q=nike-nfl-jerseys.html&gt;&lt;b&gt;cheap nfl nike jerseys&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.evanstour.com/mk/&gt;&lt;b&gt;michael kors purses&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.stormchasehomepage.com/jerseys/?q=cheap-nfl-jerseys.html&gt;&lt;b&gt;cheap nfl jerseys free shipping&lt;/b&gt;&lt;/a&gt;  &lt;a href=http://www.hodescenter.com/mk/&gt;&lt;b&gt;michael kors handbags&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.evanstour.com/mk/&gt;&lt;b&gt;michael kors purses&lt;/b&gt;&lt;/a&gt; Dehqan said blankets and tents had seen and heard and about 400 it is certainly plausible from nearby villages had gathered to learn more about facilitate so that you have going to be the rescue effort  &lt;a href=http://www.razorlocator.com/michaelkors/&gt;&lt;b&gt;cheap michael kors&lt;/b&gt;&lt;/a&gt; &lt;a href=http://www.evanstour.com/mk/&gt;&lt;b&gt;cheap

Where mydomain.com/my-product-slug is fictitious.

Is there anything that I can do to prevent this from happening? It looks like unsuccessful spam posts.


texts: How to get current category name by current category url in observer magento2

texts:
I want to get category name by current url in the observer. I have tried most common code but not working, so I am trying to get category name or id by current url.
For example, current url is : http://example.php/food.html.
Here I want category id by this url.

I have tried this in my observer :

namespace Mymodule\Event\Observer\Logger;
use Magento\Framework\Registry;

class GlobalLogger implements ObserverInterface
{
    protected $registry;

    public function __construct(
        \Magento\Framework\Registry $registry
) {
        $this->registry = $registry;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

        $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
        echo $category->getId();
        echo $category->getName();
    }
}

Anyone have an idea for that, please?


texts: Why order item quantity is not decreased after order placed

texts:
I am facing a strange issue in our live site order item quantity is not decreased after order placed from the frontend.

(i.e) if a successful order has 5 products, 4 products quantity has been decreased successfully and remaining one product's inventory still same.

Since it's strange behavior looking forward to hearing for a better solution.


texts: which are best method to get collection in magento 2

texts:
I am creating a custom module. which is preferred method to get collection. i need to know the advantage and disadvantage these method?

objectManager

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$productCollection->load();

Factory

protected $_productCollectionFactory;

    public function __construct(
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    ) {
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($data);
    }

    public function getProductCollection()
    {
        /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
        $collection = $this->_productCollectionFactory->create();
        return $collection;
    }


texts: Add checkbox to shipping method for extra charge

texts:
I would like to add checkbox in shipping method for extra charge if selected.

for that I have overrided checkout/cart/shipping.phtml, it displays correctly on shipping method like this Screencast

But how to make ajax call on it and add charge to shipping method.

also is there any core method to do like this so that it can be available globally like when order create from admin interface.

EDIT

Get this work only for cart. But anyone know how to make it globally available. For cart I have to overwrite cart controller updatepostaction and set flag to set price based on selected shipping.

How do I make available this on onepage, create order from admin.

Coz there is diffrent method called in onepage controller to set shipping method.


texts:
If I add this to a CMS page then it pull in the javascript to the page correctly:

<script type="text/javascript">
    requirejs(['jquery', 'bootstrap'], function (jQuery, jQueryBootstrap) {

    });
</script>

But if I try it with data attribute like so:

<div data-mage-init='{"bootstrap": {}}'>

</div>

Then the javascript is not pulled into the page.

Do data attributes only work in phtml files?  Docs seem to say I can use either.


texts: Attribute value shows 'no' when it is 'yes' on category listing frontend Magento 2

texts:
I have a very strange issue with my store. I have an attribute (yes/no value) and when I echo the value on the listings page on the frontend of my Magento 2 store all products show the value as 'no'.

Some of them are certainly set to yes and I have confirmed this in the admin panel.

List.phtml

<?php $i=0; foreach ($_productCollection as $_product): $i++ ?>
            <?php $clearClass = $themeHelper->getClearClass($perrow, $i) ?>
            <li class="item product product-item <?php if($viewMode == 'grid'): ?> grid-template-<?php echo $grid_tp ?> <?php echo $colClass ?> <?php echo $clearClass ?><?php endif ?>">
                <?php $swatches = $block->getProductDetailsHtml($_product); ?>
                <?php $wlDataPost = $block->getAddToWishlistParams($_product); ?>
                <?php $fk = $block->getBlockHtml('formkey') ?>
                <?php $postParams = $block->getAddToCartPostParams($_product); ?>
                <?php $review = $block->getReviewsSummaryHtml($_product, $templateType); ?>
                <?php $prdPrice = $block->getProductPrice($_product) ?>

                <?php echo $this->getLayout()
                                ->createBlock('Magento\Framework\View\Element\Template')
                                ->setProduct($_product)
                                ->setThemeHelper($themeHelper)
                                ->setImageHelper($_imagehelper)
                                ->setCatalogHelperOutput($_helper)
                                ->setQuickViewHelper($quickViewHelper)
                                ->setRatio($ratio)
                                ->setSize($size)
                                ->setCustomAttribute($ct_attr)
                                ->setPadding($padding)
                                ->setLazyLoadBaseImage($baseImage)
                                ->setCompare($showCompare)
                                ->setFk($fk)
                                ->setPostParams($postParams)
                                ->setReview($review)
                                ->setPrdPrice($prdPrice)
                                ->setWishList($showWishList)
                                ->setLazyLoad($lazyLoad)
                                ->setHoverChange($change_img)
                                ->setWishListPost($wlDataPost)
                                ->setTemplate($templateFile)
                                ->setSwatches($swatches)
                                ->setPos($pos)
                                ->toHtml(); ?>

               //This is the specific piece of code to get the attribute

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

            </li>
        <?php endforeach; ?>

Can anyone please suggest what may be happening here a fix?


texts:
I am Using a third party Module and going to customize a model file in it.
I have tried by overriding the model class but it is not showing any effect.
What i am doing is, just taking one method that is.
private function getPrice() {
        return 123455;
}

File that i want to override placed at in thirdparty Module:
ThirdPartyCompany\ThirdPartyModuleName\Model\Carrrier.php
The Structure of my module is as follows:
Model file placed at:
MyCompany\MyModule\Model\Carrier.php
And it has the following code in it:
namespace MyCompany\MyModule\Model;

class Carrier extends \ThirdPartyCompany\ThirdPartyModuleName\Model\Carrier
{
   private function getPrice() {
       return 10000;
   }
}

My di.xml file has the following code in it:
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="ThirdPartyCompany\ThirdPartyModuleName\Model\Carrier" type="MyCompany\MyModule\Model\Carrier"/>
</config>

And i have module.xml with the following code in it:
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MyCompany_MyModule">
    <sequence>
        <module name="Magento_Quote"/>
        <module name="ThirdPartyCompany_ThirdPartyModuleName"/>
    </sequence>
</module>
</config>

When i directly change getPrice() function in thirdparty module file and change the return value it is changed on frontend but after overriding in my custom module it making no effect.
What wrong i have doing is there any issue with my code or file structure?


texts: how to SET FOREIGN_KEY_CHECKS = 0 in phpMyAdmin

texts: I am trying to truncate some mySQL tables from phpMyAdmin web interface, but for foreign keys constraint I am not able to do it.  Is there a way to SET FOREIGN_KEY_CHECKS = 0 in phpMyAdmin?


texts: When i enable solr,the magento layered navigation not working

texts:
The issue is when i enabled solr (i successfully configured solr and tested successfully) in magento enterprise,the layered navigation filter is not working properly.

i.e displaying all category products not filter with attributes value.

If i set "No" in Enable Solr Engine for Catalog Navigation in admin panel it's working fine.

Path -> System -> Configuration -> Catalog -> Catalog Search -> Enable Solr Engine for Catalog Navigation -> set to "No"

I analysed magento enterprise search module,but they not adding custom attributes into solr params.like attr_nav_select_"custom_attribute"

ex : http://localhost.com:8080/solr/test/select/?q=wine%0D%0A&version=2.2&start=0&rows=10&indent=onq=test&qt=magento_en&fq=
%28visibility:3+OR+visibility:4%29+AND+store_id:13+AND+in_stock:true

Any one tell me is this magento issue or i need to configure any other matter.

Anything i would appreciate.Thanks in advance.


texts: I have magento 2.0 C.E. And I want to override a few core template files. But, I do not have anything inside app/design/frontend/magento/ and my luma theme is installed somewhere in the vendor/ directory. I have not created any custom theme also. Please, let me know how this can be achieved.


texts: Reference email template within template

texts:
I am attempting to reference a newly created custom template via the admin panel within another email template. The template I am trying to access is called 'footer' when I change the standard line to '{{template config_path="design/email/footer"}}' it gives me errors. Any assistance in getting this to work would be great.
Thanks


texts: Can I continuously run cron jobs for magento if I am using windows?

texts: What I am trying to do is to make cron jobs run automatically, for example I got more jobs, and when I hit www.mylink.com/cron.php, it executes the cron jobs once, and after that I have to press the refresh button or go again to that site in order to execute the cron job again. Is there a way to do that on windows automatically? Thanks for your help.


texts: Missing commit changes button in Magento connect

texts:
Recently I have tried to update or install some extensions with Magento 1.9.1.0 this was all working fine. now Im not able to find the commit changes, and Im not also able to submit and uninstall or update.

I have tried clear cache and uploaded a new copy of the app folder, js folder.


texts: Optimization of faceted navigation and pagination

texts:
I recently launched a store under Magento and I would like to improve both faceted navigation and pagination.

Faceted navigation : Do you know a module that avoids reloading the page each time a filter is activated and disables the generation of url with parameters?

Pagination: Do you know a module that allows to suppress navigation, display products as the user scrolls and that makes accessible all the products urls from the source code of the page to optimize the crawl of robots such as Google?

Thank you in advance for your help.


texts: I have two questions, about the two buttons are unresponsive,  not work...why??why cant send email ? who can help me ~i am using 1.9.1 thank you!


texts:
I am not able to flush the cache properly. I am using Magento 2.1.4, Redis and Varnish.

I have tried flushing the cache in the Magento admin: Admin > System > Cache Management > Flush Cache Storage/Flush Magento Cache and disabled all the caches.

I have purged my Varnish cache for my site: curl –X PURGE http ://www.mysit e.com/.

I have purged the Redis cache and FPC:

telnet redisxx.x xxxx
select 1
flushdb

Changed the mode to developer: php-7.0 bin/magento deploy:mode:set developer (from default)

Ran commands: php-7.0 bin/magento setup:upgrade, php-7.0 bin/magento setup:di:compile and php-7.0 bin/magento setup:static-content:deploy.

I have removed the content of the pub/static/* except the .htaccess file but still have the problem.

I have cleared my browser cache, used incognito mode, different browser and even a different machine.

Changes done in the code are not showing. I have even deleted a part of my site to see if that works but still nothing. If there anything else I can do? Why is the caching not flushing?


texts:
I'm learning Magento 2 and can see that Magento has two index.php files. One is in the root folder and another one is in Pub folder. While reading many of the posts regarding webroot of Magento, I can see that we have to set the webroot to Pub folder for security.

Currently, I have installed the Magento in Xampp.

Can anyone please tell me how to set the webroot to Pub in Magento 2?


texts: How to remove the cart link from homepage of magento 2?

texts: I am trying to remove the cart link and icon from the homepage of Magento 2. But making any changes to default.xml of Magento_Theme is removing the cart icon from every page, as expected. Is there any way of removing it just from the homepage?


texts: Magento EE 2.1 : error of parameter type in Unit Test

texts:
Using this post, I tried my first Unit Test. The goal is to test a repository. However, despite mocking all required dependancies of the repository, I get this error:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Mybusiness\Retailers\Model\AssignmentRepository::__construct() must be an instance of Mybusiness\Retailers\Model\ResourceModel\Assignment, instance of Mock_Assignment_5b102d69 given, called in /var/www/testEric/mybusiness/mybusiness/app/code/Mybusiness/Retailers/Test/Unit/AssignmentRepositoryTest.php on line 23 and defined in /var/www/testEric/mybusiness/mybusiness/app/code/Mybusiness/Retailers/Model/AssignmentRepository.php:54

Here is my Test class:

<?php
namespace MyBusiness\Retailers\Test\Unit;

use MyBusiness\Retailers\Model\AssignmentRepository;

class AssignmentRepositoryTest extends \PHPUnit_Framework_TestCase {

    private $assignmentRepository;

    public function __construct() {
        $resourceMock = $this->getMockBuilder(MyBusiness\Retailers\Model\ResourceModel\Assignment::class)
            ->disableOriginalConstructor()
            ->getMock();

        $assignmentInterfaceFactoryMock = $this->getMockBuilder(MyBusiness\Retailers\Api\Data\AssignmentInterfaceFactory::class)
            ->disableOriginalConstructor()
            ->getMock();

        $assignmentCollectionFactoryMock = $this->getMockBuilder(MyBusiness\Retailers\Model\ResourceModel\Assignment\CollectionFactory::class)
            ->disableOriginalConstructor()
            ->getMock();

        $this->assignmentRepository = new AssignmentRepository(
            $resourceMock,
            $assignmentInterfaceFactoryMock,
            $assignmentCollectionFactoryMock
        );

        parent::__construct();
    }

    public function testGetById() {
        $id = 4731;
        $retailer = 1;
        $zipcode = 13001;
        $city = "MARSEILLE - 13001";

        $theAssignment = $this->assignmentRepository->getById($id);

        $this->assertEquals($retailer, $theAssignment->getRetailer());
        $this->assertEquals($zipcode, $theAssignment->getZipCode());
        $this->assertEquals($city, $theAssignment->getCity());
    }

EDIT:

I tried the second part of the linked answer, and now, the message is different:

...does not have a constructor, so you cannot pass any constructor arguments in /var/www/testEric/mybusiness/mybusiness/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php:246


texts: Uploading php.ini file breaks Magento (front end and back end)

texts:
When I click the link to edit a customer's details just get a blank page. The error log shows

  PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 3072 bytes) in /data02/username/public_html/buyonline/app/code/core/Mage/Paypal/Model/Payflowpro.php on line 534

I uploaded a php.ini file to increase the memory_limit - php_info() shows that the memory limit was successfully increased to 256M, but doing anything on the site gives the error

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

I deleted it and re-uploaded the php.ini file after clearing caches and disabling the compiler following advice at Correct Method of Flushing Caches & Managing the Compiler.
When I try to enable the compiler again I get a similar error:

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

Changing the memory limit setting in the htaccess file has no effect.

Has anyone any further ideas as to how to fix this?


texts:
When a product is assigned to a category, Its relation is save is catalog_category_product table.

But on searching for setPostedProducts() it seems like a magic method. So how the data is saved in catalog_category_product table.


texts:
I'm setting up a Multi-store in English, French and German. I'd like to enable Name Prefix as an optional field but Customer Configuration > Name and Address Options is only editable at the website level. So I cannot translate Mr, Mrs etc to Herr, Frau or Mr, Mme.

I saw a solution to a similar problem in M1 here but, being an average store owner, I don't know to adapt it to M2.

Has anyone found a way around this ? I can't be the first to run into this problem.


texts: Page Not Found when click on category link?

texts:
Unable to get Products when click on category.

Code:

<?php
    $_categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('is_active', 1);

    foreach ($_categories as $_category)
        {
            if($_category->getImageUrl())
                {
                    $catimg     = $_category->getImageUrl();
?>

<img src="<?php echo $catimg ;?>" alt="" />
  <a class="cate_btn" title="View the products for this category" href="<?php echo $_category->getUrl($_category) ;?>">View

<?php } } ?>

when i click on view,it leads to following url:

rtd/index.php/catalog/category/view/s/cat1/id/3/

This Page gives error Message as Following:

Whoops, our bad...

The page you requested was not found, and we have a fine guess why.

        If you typed the URL directly, please make sure the spelling is correct.
        If you clicked on a link to get here, the link is outdated.

What can you do?
    Have no fear, help is near! There are many ways you can get back on track with Magento Store.

        Go back to the previous page.
        Use the search bar at the top of the page to search for your products.
        Follow these links to get you back on track!
        Store Home | My Account

Help me out guys  ,I'M new To Magento ??


texts: Magento problem in login and product view

texts:
I m new in magento and I have installed magento. It's working fine.

When I installed some themes, its getting problem, like when I am login my admin panel at that time i have to type index.php between my wesite name and admin.

I want to resolve it. Even when I open any product at that time also I have to include index.php after that it will open like example http://ulogin.co.uk/admin this will not work but when I type http://ulogin.co.uk/index.php/admin at this time it work. Same thing happen in product open


texts: Run Magento and DB repair tool at the same time

texts:
I have a client who is intolerant of downtime but we need to run the DB Repair tool.

What are the ramifications of running the tool at the same time people are on the website?

I can run it from a non-public server but of course everything goes through the database.


texts: Jump to an anchor after "Sort By" is changed on category page in Magento 2

texts:
I'm developing a custom theme where the category page starts with some content and the list of products is below such content.

I would like to keep the view anchored to the product list when the user change the "Sort By" option. But it is executed some javascript and the page reload with an url like this:

http://example.com/plants?product_list_order=position

bringing the user back to the page top.

Would be enough for me to add an anchor in the url, like this:

http://example.com/plants?product_list_order=position#my-page-anchor

But I have no control on the url that is generated when the "Sort By" option change.

Is there a way to do this?


texts: require.js error on magento fresh installation

texts:
I am deploying Magento for first time locally, XAMPP on windows, with PHP 7.4.8
I have run php bin/magento setup:install and all seems to go smooth but now I am trying to access the admin and I have a huge list of console errors that stop my interface of loading at all, I just got a brown dead screen :(
It seems there is a problem with the require.js scrips but as I mention it is a 100% fresh installation, I did not have the chance to modify any file yet. The documentation of require.js says:
a JavaScript syntax error or other execution problem running the script


texts:
I have created a custom field in cart page named "t_price". NOw i need to calculate this price in cart page.
I am using an extension "SSTech_Extracharge" to calculate extra price in cart and checkout page.
Now i want to use that that custom field(t_price') in this extension.

This extension defines a constant variable in it's model, how i use the value from post.

class SSTech_Extracharge_Model_Extracharge extends Varien_Object{
const FEE_AMOUNT  = 10;
const XML_PATH_ENABLED = "extracharge/extracharge/enabled";

public static function getExtracharge(){
    if(Mage::getStoreConfigFlag(self::XML_PATH_ENABLED)){
        $extracharge = Mage::getStoreConfig(self::FEE_AMOUNT);
        return $extracharge;
    }
}
public static function canApply($address){

    return true;

}
}

Some one explain it, i am using const FEE_AMOUNT = Mage::app()->getRequest()->getParam('t_credit'); but it's not getting result.

Observer :

<?php
class Excellence_Fee_Model_Observer{
    public function invoiceSaveAfter(Varien_Event_Observer $observer)
    {
        $invoice = $observer->getEvent()->getInvoice();
        if ($invoice->getBaseFeeAmount()) {
            $order = $invoice->getOrder();
            $order->setFeeAmountInvoiced($order->getFeeAmountInvoiced() + $invoice->getFeeAmount());
            $order->setBaseFeeAmountInvoiced($order->getBaseFeeAmountInvoiced() + $invoice->getBaseFeeAmount());
        }
        return $this;
    }
    public function creditmemoSaveAfter(Varien_Event_Observer $observer)
    {
        /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
        $creditmemo = $observer->getEvent()->getCreditmemo();
        if ($creditmemo->getFeeAmount()) {
            $order = $creditmemo->getOrder();
            $order->setFeeAmountRefunded($order->getFeeAmountRefunded() + $creditmemo->getFeeAmount());
            $order->setBaseFeeAmountRefunded($order->getBaseFeeAmountRefunded() + $creditmemo->getBaseFeeAmount());
        }
        return $this;
    }
    public function updatePaypalTotal($evt){
        $cart = $evt->getPaypalCart();
        $cart->updateTotal(Mage_Paypal_Model_Cart::TOTAL_SUBTOTAL,$cart->getSalesEntity()->getFeeAmount());
    }
}

Model :

 class Excellence_Fee_Model_Sales_Quote_Address_Total_Fee extends Mage_Sales_Model_Quote_Address_Total_Abstract{
    protected $_code = 'fee';

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        parent::collect($address);

        $this->_setAmount(0);
        $this->_setBaseAmount(0);

        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this; //this makes only address type shipping to come through
        }

        $quote = $address->getQuote();

        if(Excellence_Fee_Model_Fee::canApply($address)){
            $exist_amount = $quote->getFeeAmount();
            $fee = Excellence_Fee_Model_Fee::getFee();
            $balance = $fee - $exist_amount;
            //          $balance = $fee;

            //$this->_setAmount($balance);
            //$this->_setBaseAmount($balance);

            $address->setFeeAmount($balance);
            $address->setBaseFeeAmount($balance);

            $quote->setFeeAmount($balance);

            $address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
            $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());

        }
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $amt = $address->getFeeAmount();
        $address->addTotal(array(
                'code'=>$this->getCode(),
                'title'=>Mage::helper('fee')->__('Fee'),
                'value'=> $amt
        ));
        return $this;
    }
}


texts: Magento 2.1.7 Data Migration Tool - Exception in [step: EAV Step]

texts:
Migrating from 1.9.2.1 to 2.1.7 ce to ce

at around 58% ..

Notice: Undefined index: dest in ..../vendor/magento/data-migration-tool/src/Migration/Step/Eav/InitialData.php on line 156

This is line 156

public function getAttributes($type)
    {
        return $this->attributes[$type];  <<<< HERE
    }

Any clues how to work around this?
Please.


texts: Magento2 Upgrade Readiness Check Error - Check Cron & Check Component dependency

texts:
unable to upgrade Magento 2.3.1 to 2.3.2 on CentOS, Apache2, php7.2, webuzo control panel

currently in developer mode
file permissions as https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html#Production-file-system-ownership-for-private-hosting-two-users-%3E
/var/.htaccess permission tried with 666 also, but nothing happening.
database also connected.


texts: Theme does not apply to Reset Password page at Admin: Magento 1.9.3.6

texts:
I applied new theme to Magento Admin. All the pages and new modules have this new theme / css. But the Reset Password page does not has this new theme / css.
Can anybody help me why theme does not apply to Reset Password page?

Thanks in advance


texts: how to write collection query in magento 1.9

texts:
i have this custom collection which is taking much time to load, so want to change into sql query how can I achieve it?

$delayedcollectioncount = Mage::getModel("customer/customer")
        ->getCollection()
        ->addAttributeToSelect('firstname, entity_id')
        ->addAttributeToFilter('grisk_college_new_id', array('in' =>$college))
        ->addFieldToFilter('group_id', array('in' => array(4,5)))
        ->addAttributeToFilter('assigned_campus_manager', array('null' => true), 'left')
        ->addAttributeToFilter('physical_verify', array('null' => true), 'left')
        ->addFieldToFilter('grisk_pv_upload_date', array('lt' => date("Y-m-d H:i:s", strtotime($configValue))))
        ->addAttributeToSort('grisk_pv_upload_date', 'DESC')
        ->count();


texts: magento get Applied RuleIds in flatrate page

texts: Can anybody tell me how to get applied rule ids in Flatrate.php page (shipping/Model/Carrier)? Actually I want get Rule_id which is applied for the order (table:salesrule) in Flatrate.php. In Flatrate.php page there is a function public function collectRates(Mage_Shipping_Model_Rate_Request $request) if I print the $request it shows a long result which is impossible for me to find out the rule id but I m sure it consists all the information of applied ruleids. So if anyone knows Please help me.


texts: Magento2: How to remove created eav attribute for which is added through InstallData

texts:
I have created one product attribute which is not implemeted correctly giving error while add new product in admin , so I want to remove it , I have uninstalled , deleted the module but attribute is still there error is still coming.

I have wriiten for installing :

namespace Vendor\Sorting\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        /**
         * Add attributes to the eav/attribute
         */

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'sorting_attribute',
            [
                'type' => 'int',
                'backend' => '',
                'frontend' => '',
                'label' => 'Sorting Attribute',
                'input' => '',
                'class' => '',
                'source' => '',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'used_for_sort_by' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );
    }
}


texts: How do I move all the elements of the header to the navigation menu

texts: I need to move all the items in the header to the navigation menu and have the navigation menu before the header


texts: Magento tries to load resources from non existing folder pub/static/version1562677664/

texts:
I copied a working magento installation 1:1 from one server to another, but many important files can't get loaded and the site is broken.

I only deleted the folder pub/static and executed php bin/magento setup:static-content:deploy on the clone after copying the clone to the new server.

I get this in my log (snippet):

Refused to apply style from 'http://entwicklung.m2/pub/static/version1562677664/frontend/Magento/luma/de_DE/css/styles-m.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

GET http://entwicklung.m2/pub/static/version1562677664/frontend/Magento/luma/de_DE/requirejs/require.js net::ERR_ABORTED 404 (Not Found)

...

(index):44 Uncaught TypeError: require.config is not a function
at (index):44


texts: Saving OrderID received from Payment Gateway

texts:
I'm working with a payment gateway from where after successful payment a OrderId is received. It is similar to transaction id in Paypal. I'm confused on how to make use of this information because this will be needed for refunding purpose.

Should I add any column to order model? Or there exists such feature where we can save such transaction key of a payment gateway?


texts: Magento column grid default filter value

texts:
I want to have a default value in a column on sales grid, the value will be the actual day.

$this->addColumn('created_at', array(
        'header' => Mage::helper('sales')->__('Purchased On'),
        'index' => 'created_at',
        'type' => 'datetime',
        'width' => '100px',
        'filter_index' => 'main_table.created_at',

        'value'=>array(
            'from'=>date('Y-m-d', time())
        )
    ));

But its not working and I don't know why.

How can I do that?


texts: Where is the admin path located in database?

texts:
I want to find out where does Magento2 keeps it's admin path in the database?

Any suggestions will be appreciated.


texts:
I have a custom grid in my custom backend module.

$this->addColumn('quota_item_id', array(
    'header' => $helper->__('quota_item_id@sales_flat_quota_item'),
    'align' => 'left',
    'width' => '10%',
    'index' => 'quota_item_id',
));

$this->addColumn('Actions', array(

    'header' => $helper->__('Actions'),
    'align' => 'left',
    'width' => '10%',
    'index' => 'quota_item_id',
    'type' => 'action',
    'getter' => 'getQuota_item_id',
    'actions' => array(
        array(
            'caption' => 'check order',
            'url' => 'javascript:void(0)',
            'field' => 'id',
            'href' => "javascript:void(0)",
            'target' => '_blank',
            'class' => 'checkOrder',
            'id' =>                       // how to get quota_item_id here?
        )
    ),
));

The id attribute, I want to assign quota_item_id to it, anyone knows how to do that?


texts: Modify Html for Additional Information Tab

texts:
I am trying to modify how the additional information is displayed for a theme:

http://prntscr.com/47t6uk

I want to wrap the information in span tags so I can access them with jquery and also potentially move the whole thing to be rendered elsewhere but am not sure where this is actually being rendered. Where can I find the files generating this html?


texts: Magento 2: can't use materialize.js on my custom module

texts:
I'm trying to use materialize slider in my custom module, my try was:

Vendor/Module_Name/view/requirejs-config.js:

var config = {
map: {
    '*': {
        materialize: 'SliderHome/js/materialize'
    }
}};

materialize.js file is in Vendor/Module_Name/view/web/js/materialize.js

then in my template view (.phtml file) I put at the end this script:

<script type="text/javascript">

require(['jquery', 'materialize'], function ($) {

$(function () {
    var height = setHeightSlider();
    var buttonHeight = 40;
    $('.slider-arrow').css('top', (height/2)-(buttonHeight/2));
    $('.slider').slider({
        indicators: false,
        height: height,
        interval: 10000
    });

    $('#prev-photo').click(function () {
        $('.slider').slider('prev');
    });
    $('#next-photo').click(function () {
        $('.slider').slider('next');
    });
});

function setHeightSlider() {
    var width = $(window).width();
    var height = 550;
    if (width > 1824) {
        // larger screens

        height = 700;
    } else if (width > 1224 && width < 1824) {
        // Desktops and laptops

        height = 500;
    } else if (width < 1224) {
        // tablet

        height = 350;
    }
    return height;
} });</script>

When the page is loaded I get this error:

  Error: Script error for: materialize

Can anyone help me? Thanks


texts:
Here's one for the gurus here.

By default, Magento's WSDL provides a single endpoint (mainstore.com).
The issue is, for multisite installs, there's no way to provide localized info (different prices, info etc.).
How can one configure Magento to provide an endpoint per site (secondstore.com/api/soap) if the wsdl was requested from it (secondstore.com/api/soap/wsdl=1)?


texts: How to update subtotal after changing price with observer

texts:
I am using observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update product's price but subtotal remains same. In my case Price is 50 and Subtotal is 18.

Observer code (checkout_cart_save_after):

public function apply_customprice(Varien_Event_Observer $observer)
{

    $quote= $observer->getCart()->getQuote();
    foreach ($quote->getAllItems() as $bundleitems) {
        $parentProductId = $bundleitems->getProduct()->getId();
        if($bundleitems->getProduct()->getTypeId() == 'bundle')
        {
            $storeId = Mage::app()->getStore()->getStoreId();
            $Custom_price= 50;
            $item = Mage::getModel('sales/quote_item')->load($bundleitems->getId());
            $product_id = $item->getProductId();
            $product = Mage::getModel('catalog/product')->load($product_id);
            $item->setStoreId($storeId);
            $item->setCustomPrice($Custom_price);
            $item->setOriginalCustomPrice($Custom_price);
            $item->setProduct($product);
            $item->save();

            //for updating the totals
            $quote = Mage::getModel('checkout/session')->getQuote();
            $quote->collectTotals()->save();
        }

    }

}


texts: Invalid AdWords gclid error in analytics

texts:
I am running adword campaign and getting gclid error along with less sessions then clicks coming to site.
My magento version is 1.9.0.1

somehow the gclid is maintained on home page but redirects and remove it on products and inner pages, even the CMS and category and product pages.

I have tried all the solutions available online like https://community.magento.com/t5/Programming-Questions/Magento-Redirect-Loses-URL-Querystring/td-p/4608
but without luck.

I also tried adding a query string like ?mytag=123 and hat too redirects and removes it

Any help will be highly appreciated


texts:
somebody know if I can see the wishlist but just the view.phtml without the left account navigation.

I supossed is something in wishlist layout.


texts: how can i get a url helper for the contact us (contacts) page of my magento 1.9.2 site?

texts:
Hi I have sucessfully added a link to top links in the customer.xml file in my theme.

I added this code to <reference name="top.links" />

    <action method="addLink" translate="label title" module="contacts"><label>Contact Us</label><url helper="customer/getContactsUrl"/><title>Contact Us</title><prepare/><urlParams/><position>60</position><liParams/><aParams>class="header_contactUs"</aParams></action>

the link just points to the main page of my website not to www.website.co.uk/english/contacts

I have tried to avoid using <url helper="??" />
and just use <url>contacts</url> but this does not prepend the word english to the target. And if I insert the word english it breaks for the german store (obviously).

Any help would be greatly appreciated.


texts: Best way for product export for a list of skus

texts:
Is there a best practice for a product export in Magento (1.9.0.1 CE) for a given sku list? It should be a full export with all attributes. It's required for an import into another Magento shop.

The dataflow profile doesn't provide this feature. So, I guess I have to do the export programmatically?

Any ideas are welcome.


texts: Magento 2 > cannot login to admin area (php7) but php 5.6 gives Fatal error: Class 'Locale' not found in

texts:
I installed Magento 2.0.2, via installatron service (automated on Direct Admin), but I cannot access admin area. CSS/JS looks ok, but admin cannot login on php 7.0.6. When I switched to php 5.6 I'm getting

Fatal error: Class 'Locale' not found in /vendor/magento/framework/Locale/Bundle/DataBundle.php on line 64

Where to fix it? Since any other options are not working so far. Thanks


texts: Magneto displaying tax but taking tax off the tax :S

texts:
So I have tax set up at 20%. The actual rate it’s taking off is about 14%
I noticed that the figure it’s showing is actually the correct Tax figure minus the tax.
Which is crazy.
Here’s what it’s doing.
Subtotal : £100
Tax : 16.68 (which is 20 - 20%)
Total without tax : 83.32
It’s deducting tax from the tax figure before it displays it.
I can’t imagine this would be a setting, who would ever want to do this.
I have all the setup correct, it’s applying the correct rule, it’s just deducting tax from the tax figure.
Any thoughts?


texts: Roles Resources | What is "My Account" for

texts:
I found this in the role resources but am not sure what it is responsible for. Enabling and disabling this seems to make no difference. Can someone shine some light on it?

Magento ver. 2.1.8


texts: Magento2: How to serve cookie-less cached version for crawlers on Varnish cache

texts:
As far as i know; magento assign a X-Magento-Vary cookie to each visitor first you visit website. So your first request always be non-cached version. After you got a X-Magento-Vary you see cached version served by Varnish.
Is there anyone knows about how to define static X-Magento-Vary for only crawlers, in this way crawlers always get cached version on first attempt ?


texts: How to get quantity of simple product on configurable product page

texts:
I'm searching the way to preload quantity of each simple product on configurable product detail page.
The reason is I want to dynamically show to client "In Stock", "Out of stock" or "Only 1 left" notification for each size+color config which was selected by client.

P.S.: I used color swatches as dropdown and I saw one hidden field which was dynamically change with selected simple product ID. But then I changed to text swatch+image swatch and this field no more changing.

Can anybody show example how to implement this functionality in Magento 2?
Thank you


texts: Currently I have my store in magento 2.2.7 from the beginning I configure an API to present amazon and waltmart products, so far everything is ok, but now it is required that magento own products be uploaded, they are created without problem, but at the moment Adding them to the cart gets the error "We cannot add this item to your shopping cart at this time." This work was done by an expert in magento, I am a newbie, where I can see the configuration of the cart for review


texts: Custom attribute, show it about everywhere?

texts:
I have a Donut webshop and would like to add a custom attribute and to show this attribute at many places.

I want to add the text: "Box à 8 peeces" or "Box à 12 peeces" etc. underneath the title.

How can I do this the easiest way? There would be many files to be changed and I wonder if there is a better way to do this?

At the moment I search the phtml files and add the attribute by using:

<?php echo $_product->getAttributename() ?>

Before going on with this I would like to know if there are better ways to do this. I'm a designer and not a great coder. Any tips are very welcome!


texts: How to create child html for checkout.cart.item.renderers

texts:
i am recently try to create child html form checkout.cart.item.renderers so i will add my custom text on each product in cart page. i have tried all  solution but not got correct solution or my bad luck.

i have try following code

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.cart.item.renderers">
            <block class="Magento\ConfigurableProduct\Block\Cart\Item\Renderer\Configurable" as="configurable" template="Magento_Checkout::cart/item/default.phtml">
                <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.configurable.actions" as="actions">
                    <block class="DD\DeliveryDate\Block\Index\Index" name="deliverydate_index_index" template="DD_DeliveryDate::deliverydate_index_index.phtml"/>
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.configurable.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
                    <block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.configurable.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
                </block>
            </block>
        </referenceBlock>
    </body>
</page>

Any one have solution for this.


texts:
A product has Base Price $30 and Special Price $25. Tiered price discount for this product is $20 for 5 products and there is also a catalog rule active of 25% discount for this product. What will be the product price shown on product page?

a) $15
b) $22.5
c) $25
d) 18.75

Can anyone please help to explain how answer ends as $15
my understanding is 25% discount should be applied on Special Price i.e $25 as it is active price, which should result  as 18.75


texts: Deleted over 1,000 customers from my magento 2 backend- how do I get them back

texts:
HELP!! I thought I was just deleting a few customers, but instead it deleted over 1,000 is there a way to get them back into the database- I use magento 2 platform
thank you SO much for help

merle


texts: product price as multiplier of cost price

texts:
i had put cost price of product now i want to change price of product based on some multiplication like 2.5, 3 for all products.

How can i do it via magento admin or some custom code , is that possible to do change at one place in admin


texts:
I'm trying to create my first Magento module, and I have a strange error.
I have this method in my model (it extends Mage_Core_Model_Abstract) :

public function getAllProducts() {
        $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->setOrder('entity_id', 'DESC')->setPageSize(5);
        return $products;
    }

And I'm calling this method from a block:

public function getAllProducts() {

    $arrayOfProducts = array();
    $products = Mage::getModel('recentproducts/recentproducts')->getAllProducts();

    foreach ($products as $product) {
      var_dump($product);
      $arrayOfProducts[] = array('id' => $product->getId(),'name' => $product->getName(),'url' => $product->getProductUrl());
    }

    return $arrayOfProducts;
  }

On my phtml, when doing this :

<?php
$products = $this->getAllProducts();
?>

I have Fatal error: Call to a member function getId() on null in...`

getId()is a product getter function, and when var_dump($product) I have all the product data printed . It's the same problem with getName() and all getter functions. What could be the problem ?


texts: Magento 2 category listing page mixed with static images

texts:
I am working on a Magento 2.1 site and on the category product listing page I want to display static images mixed with actual product images.

So for example I would have a row of say 4 images across but every other image would be an image that is not part of or linked to any specific product.

I know there is a platform called Olapic that will let you show user generated content inter mixed with the product listing as shown in the image below:

However I was wondering how this may be achieved. I don't necessarily want user generated content from social platforms but instead static images I would upload to our site. Ideas/suggestions?


texts: Get current cart (quote) items for not logged in users

texts:
I have such issue:
Need to change template of login page based on products (items) in cart. I tried to get current quote by checkoutSession in block class, but there was no items. However I added several products in cart.
Some more details:
Add some products in cart. There is some special product in it. Then go to checkout (not logged in, as a guest), so it redirect to checkout login page, in this page it has several additional options. If cart has special product I mentioned early, need to remove one of options on login page.
So I add in block in constructor checkoutSession and create method to check if there is special product in cart. In method I just take every item and check if it has a "special product" flag. But as I wrote above, checkoutSession return zero items, also I can't get quoteId.
$this->checkoutSession->getQuote()->getAllItems()

How can I get current cart when I am not logged in? What wrong I did?


texts: Product Description text currently not “responsive.” in magento

texts: I'm having a bit of trouble with the Shoppers theme. The Product description text is not re-sizing responsively on mobile devices. I attached HTML 5 extension in WYSIWYG editor .Any idea what I'm doing wrong?


texts: Add new field to administration orders grid

texts:
I am building my first Magento plugin that will hook into the event of when an order is placed, and export the order to a third party web service.

Now, rather than creating a separate table to store each order and its export status, I want to use the existing Magento Order table. Is this possible?

Also- I would love to be able to add a button or two to the Magento Administration Order section. Is this possible without modifying core Magento files? I want this to be a plug and play Plugin that doesn't require modification to core files.

If not, I will have to create a new section that the administrator can track the export status of orders.


texts: Add product grid in custom module using ui component

texts:
I have followed this solution Magento 2 : How to add a product grid in custom module using ui component? but i am getting this

What i am doing wrong can any one help me on this.
Edit Controller

class Edit extends Action
{

protected $resultRawFactory;

/**
 * @var \Magento\Framework\View\LayoutFactory
 */
protected $layoutFactory;

public function __construct(
    Action\Context $context,
    \Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
    \Magento\Framework\View\LayoutFactory $layoutFactory
)
{
    parent::__construct($context);
    $this->_outfitFactory = $celebrityFactory;
    $this->resultRawFactory = $resultRawFactory;
    $this->layoutFactory = $layoutFactory;
}

/**
 * Execute action based on request and return result
 *
 * Note: Request will be added as operation argument in future
 *
 * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
 * @throws \Magento\Framework\Exception\NotFoundException
 */
public function execute()
{
    try {
        $resultRaw = $this->resultRawFactory->create();
        return $resultRaw->setContents(
            $this->layoutFactory->create()->createBlock(
                'Allure\Celebrities\Block\Adminhtml\Products\Edit\Tab\Product',
                'category.product.grid'
            )->toHtml()
        );

    }
    catch (\Exception $exception) {
        $this->messageManager->addErrorMessage($exception->getMessage());
    }
    $this->_redirect("*/celebrities/index");
    return;
}

protected function _initItem($getRootInstead = false)
{
    $id = (int)$this->getRequest()->getParam('id', false);
    $myModel = $this->_objectManager->create('Allure\Celebrities\Model\Celebrity');

    if ($id) {
        $myModel->load($id);
    }

    $this->_objectManager->get('Magento\Framework\Registry')->register('item', $myModel);
    $this->_objectManager->get('Magento\Framework\Registry')->register('my_item', $myModel);
    $this->_objectManager->get('Magento\Cms\Model\Wysiwyg\Config');
    return $myModel;
}

}


texts:
I am trying to add Facebook Pixel to my Magento2 Store,

I added the Pixel code to the header, but can't find a way to add the event tracking code after <body> in selected pages (Exemple: in checkout page for Purchase tracker)

I added all the tracking code in the header (inside the Pixel code) but it gives incorrect results since all pages will be tracked for selected events

<script>
  fbq('track', 'PageView');
  fbq('track', 'Purchase');
  fbq('track', 'Lead');
  fbq('track', 'CompleteRegistration');
  fbq('track', 'AddToCart');
  fbq('track', 'InitiateCheckout');
  fbq('track', 'ViewContent');
</script>


texts: Magento2 : require('Magento_Customer/js/customer-data') not loading always

texts:
I am trying to get the cart items in phtml file (product detail page) using jquery script.
Here is the script:

require([ 'jquery', 'jquery/ui'], function($,item){
item = require('Magento_Customer/js/customer-data').get('cart')().items;
console.log(item.length);
});

It not load customer data all the time.I need this to get the item count when product added or deleted from the mini cart dynamically using ajax cart. On firefox its works but fails in chrome browser.I dont know how to initialize the require('Magento_Customer/js/customer-data') early, so that it works well for all cases.
Please help or provide other solution to get the cart item dynamically using jquery


texts: What code is responsible for inserting "Miscellaneous Scripts" / Troubleshooting

texts:
I'm troubleshooting a site that has code inserted into the "Miscellaneous Scripts" (System -> Configuration -> Design -> HTML Head)but it is not being displayed on the frontend of the site.

If I view page source there is nothing from the Miscellaneous Scripts portion, however if I edit head.phtml and insert the code directly it appears immediately.

My question is, what code is responsible for inserting the scripts  into the head portion (presumably I could copy and paste the code into the head.phtml?)and what could cause the script not to appear at all?


texts: Magento2 - How to move cart total below the cart items on checkout page?

texts: I want to show the cart totals section below the cart items on the checkout page.


texts: Empty order status in magento 2.4.1 email

texts:
I have option to load Order Update, Order Update(Magento/luma) or Order Update(Magento/Smarwave) email template. Email is sent if any of those three is selected in configuration but without order status.
If I choose in configuration to use Order Update(Default) then name is empty but order status is present, wrong but present.
Can someone tell from where magento load Order Update(Default) template or what is wrong with mine.
This is how Order Update template looks like:
    {{template config_path="design/email/header_template"}}

{{trans "%name," name=$order_data.customer_name}}

                {{trans
                    "Your order #%increment_id has been updated with a status of %order_status."

                    increment_id=$order.increment_id
                    order_status=$order_data.frontend_status_label
                |raw}}

{{trans 'You can check the status of your order by logging into your account.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}

                {{trans 'If you have questions about your order, you can email us at %store_email' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at %store_phone' store_phone=$store_phone |raw}}{{/depend}}.
                {{depend store_hours}}
                    {{trans 'Our hours are %store_hours.' store_hours=$store_hours |raw}}
                {{/depend}}

            {{depend comment}}

                        {{var comment|escape|nl2br}}

            {{/depend}}

{{template config_path="design/email/footer_template"}}


texts: which event i should call after selecting shipping methods?

texts:
i want to write some custom code after selecting shipping method(Free shipping).
I Tried with

  checkout_controller_onepage_save_shipping_method

  and

  sales_order_place_before

but its not working, can anyone help me to achieve this?


texts: sales_flat_shipment, created_at is stored with difference of 4 hours

texts:
I have this problem when I ship my order.
the date field created_at is stored with difference of 4 hours.
it's the same problem with sales_flat_shipment_track.
ex: I shipped today at 11:56AM, but in my db, I have 2015-10-07 15:56:22

Do you have an explanation?


texts:
I followed the instructions on the following page ("Remove Shipping steps in Onepage Checkout") to enable the skipping of the shipping method on the one page checkout system of Magento 1.9 CE. It works absolutely perfectly on my local non SSL dev site however when moved to our staging SSL enabled site the functionality seems to be ignored.

I can see from the console log that on local the saveBilling function returns {"goto_section":"payment","update_section":{"name":"payment-method" as the next step where on the SSL enabled site shippingMethod is returned as the next step.

Any help would be fantastic on this!


texts: Which files need to be changed after uploading Magento store from localhost to online

texts:
I am a newbie
I installed Magento on my local server XAMP in Windows 10.
But then came to know THAT Magento does not support Windows OS
Also Kindly guide me on which files include the URL which needs to be changed and also guides me on how to use the composer?


texts: Magento 2.2.3 - Sort product collection by custom price

texts:
I want to sort my product custom price instead of Magento default price. By default product price is '0'.

I overwrite /vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php.

I set my custom product price in public function setCollection($collection){ ... }.

I do not set a custom price for product collection. When I print product collection after set price. It always displays '0'.

Here is my code,

public function setCollection($collection)
{
    $this->_collection = $collection;
    $this->_collection->setCurPage($this->getCurrentPage());

    // we need to set pagination only if passed value integer and more that 0
    $limit = (int) $this->getLimit();
    if ($limit) {
        $this->_collection->setPageSize($limit);
    }
    foreach ($this->_collection as $key => $value) {
        $price = 20;
        $value->setPrice($price);
    }
    if ($this->getCurrentOrder()) {
        $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
    }

    return $this;
}

How to set custom price in product collection($this->_collection)?

And how to sort product by custom price?


texts: How to avoid using exit when redirecting from Observer

texts:
I have an observer that is triggered when a user creates an account. In the execute method I have the following code:
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $redirectionUrl = $this->url->getUrl('subscribe');
    $this->responseFactory->create()->setRedirect($redirectionUrl)->sendResponse();
    exit;
}

It does infact redirect as expected, but the user is not logged in after registration.
How can I redirect without having to use exit? If I remove exit the redirect doesn't happen.


texts: Convert Product Attribute Text to Number

texts:
I am trying to do a custom inventory check with some attributes that I populate, my thoughts would be that it could work something like this;

<?php

$_invwest = $_product->getResource()->getAttribute('inv_west');
$invwestint = (int)$_invwest;

if ($invwestint > 0) {

    echo '
In Stock
';

}

?>

However when I try to load the product page, I get this exception:

Exception #0 (Exception): Notice: Object of class Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor could not be converted to int in /app/design/frontend/TEMPLATE/FOLDER/Magento_Catalog/templates/product/view/type/default.phtml on line 30

Any idea what else I could do here?

For examples sake, the current value in the text is '10'

EDIT: For more clarity;

The attribute 'inv_west' settings;

Catalog Input Type for Store Owner: Text Field
Attribute Code: inv_west
Scope: Global
Allow HTML Tags on Storefront: Yes
Visible on Catalog Pages on Storefront: Yes


texts: Permission denied error after given 0777 permission to var/ folder in Magento 2.3.1

texts:
I am using Magento 2.3.1 and I am getting that error on my Magento after given 0777 permission on my var folder
i am using that command : -sudo chmod -R 0777 var/

Uncaught UnexpectedValueException: The stream or file
"/var/www/html//var/log/system.log" could not be opened: failed to
open stream: Permission denied in
/var/www/html/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

and my permission is
drwxr-xr-x.  5 apache apache   64 Aug 20 16:21 .
drwxr-xr-x. 17 apache apache 4096 Aug 19 21:23 ..
drwxr-xr-x.  4 root   root     36 Aug 20 16:21 cache
drwxr-xr-x.  3 root   root     34 Aug 20 16:21 composer_home
-rwxr-xr-x.  1 apache apache  124 Aug 20 16:37 .htaccess
drwxr-xr-x.  2 root   root     39 Aug 20 16:29 log

So please help me..!


texts: Unable to change layout of checkout_onepage_success?

texts:
I have a checkout_onepage_success.xml file in the view/frontend/layout directory of my module but changing the layout attribute of the <page> tag from layout="1column" to layout="2columns-right" does not change the layout of the page.

Other updates in the file work fine, I can add, modify and remove blocks as normal but the page layout will not change. If I remove the layout="1column" from the core module-checkout module, leaving it with no declared layout, my layout update then DOES work and the page is 2cols-right.

Attempted to solve this by <sequence>ing my module after the core module-checkout but it looks like the core layout is still being processed after mine and taking precedence.

What do?


texts: layered navigation category => auto set filter

texts:
we have several layered categories that contain configurable products

Now for that category we want to "auto-apply" a filter

So say: they open category X, then the page is alread "pre-filtered" for variable SIZE=12

Can this be done through XML update? or other?

many thanks, Sean

Example something like add to collection filter (but then in XML)


texts:
I have a method with create a shipping rate, but I need to add shipping tax on this specific rate, how can i do this?
My class:
$method = $this->rateMethodFactory->create();
$method->setCarrier($this->_code);
$method->setCarrierTitle($this->getConfigData("title"));
$method->setMethod("ddr");
$method->setMethodTitle($response[0]['messages']['result']['service'] . " - " . " Delivery time " . $response[0]['messages']['result']['totalTransitDays'] . " day(s)");
$shippingCost = (float)$response[0]['messages']['result']['costFreight'];
$method->setPrice($shippingCost);
$method->setCost($shippingCost);

$result->append($method);

i have already tried this, but didn't works:
$method->setBaseShippingTaxAmount(8);
$method->setTaxAmount(8);

**
I need that if the customer chooses my specific rate, the tax that I choose appears. in the summary.
**


texts: Why wasn't the Product Attributes Index Included in the Scheduled Updates in 1.13?

texts:
In 1.13 most of the indexes now use triggers in the DB to track when changes are made to entities and the indexes are updated via cron selectively for just the entities that have changed.

The Product Attributes index was left out of this scheme however (this is the index that drives the filtered navigation):

Mage_CatalogIndex_Model_Indexer_Eav

I'm just trying to figure out why this would be the case - the EAV attributes for products are tracked in the new scheme and the catalog_product_flat_* tables are updated via the cron.

Only thing I can figure is that the update of the Product Attributes seems to put a lock on the cataloginventory_stock_item table which could cause checkout issues, but I'm wondering if there was another reason why this index couldn't be kept in check dynamically?


texts: Image upload button not showing in magento WYSIWYG editor for limited access users

texts:
In magento 1.9 we have two types or users

Administrator
Content Manager

Administrator user has full rights whereas content manager users have limited access. Now if a content manager user want to add image in product description using wysiwyg then there is no image upload/browse option.
But for the administrator user who has full access can see the image upload/browse button in wysiwyg editor.
Please check the following screenshots for better understanding

Please help me to show image upload button in product description wysiwyg editor for limited access users as well.


texts: Concatenated JS/CSS Not Refreshing With Media Stored in DB

texts:
There seems to be a Magento bug with media stored in DB, FPC and refreshing concatenated JS/CSS files.  Before I dig into the code, I want to see if anyone's already encountered and/or solved this.

I can get it to refresh eventually but I'm not quite sure the combination of clearing cache, removing files manually from file-system on front-end servers and/or deleting rows from 'core_file_storage'.

Otherwise, storing media in DB has been surprisingly painless.  We're deploying to auto-scaling infrastructure (Elastic Beanstalk) and AWS doesn't yet have their shared volume technology ready for EBS at this time.

Many thanks for any insight.


texts:
Impossible run command setup:di:compile

New version of deployed files: 1538653572
    @s1:~/domains/b2bstyle.pl/public_html$ php bin/magento setup:di:compile
    The directory "/home/b2b/domains/b2bstyle.pl/public_html/var/generation/Magento"                          cannot be deleted Warning!rmdir(/home/b2b/domains/b2bstyle.pl/public_html/var/g                         eneration/Magento): Directory not empty#0 /home/b2b/domains/b2bstyle.pl/public_h                         tml/vendor/magento/framework/Filesystem/Driver/File.php(403): Magento\Framework\                         Filesystem\Driver\File->deleteDirectory('/home/b2b/domai...')
    #1 /home/b2b/domains/b2bstyle.pl/public_html/setup/src/Magento/Setup/Console/Com                         pilerPreparation.php(68): Magento\Framework\Filesystem\Driver\File->deleteDirect                         ory('/home/b2b/domai...')
    #2 /home/b2b/domains/b2bstyle.pl/public_html/vendor/magento/framework/Console/Cl                         i.php(74): Magento\Setup\Console\CompilerPreparation->handleCompilerEnvironment(                         )
    #3 /home/b2b/domains/b2bstyle.pl/public_html/bin/magento(22): Magento\Framework\                         Console\Cli->__construct('Magento CLI')
    #4 {main}

    PHP Fatal error:  Uncaught Error: Class 'Cli' not found in /home/b2b/domains/b2b                         style.pl/public_html/bin/magento:31
    Stack trace:
    #0 {main}
      thrown in /home/b2b/domains/b2bstyle.pl/public_html/bin/magento on line 31

    Fatal error: Uncaught Error: Class 'Cli' not found in /home/b2b/domains/b2bstyle                         .pl/public_html/bin/magento:31
    Stack trace:
    #0 {main}
      thrown in /home/b2b/domains/b2bstyle.pl/public_html/bin/magento on line 31
    @s1:~/domains/b2bstyle.pl/public_html$

A have try before try deploy and still this issue.

Anyone help how to solve:

PHP Fatal error:  Uncaught Error: Class 'Cli' not found in /home/b2b/domains/b2b                         style.pl/public_html/bin/magento:31
    Stack trace:
    #0 {main}
      thrown in /home/b2b/domains/b2bstyle.pl/public_html/bin/magento on line 31

    Fatal error: Uncaught Error: Class 'Cli' not found in /home/b2b/domains/b2bstyle                         .pl/public_html/bin/magento:31
    Stack trace:
    #0 {main}
      thrown in /home/b2b/domains/b2bstyle.pl/public_html/bin/magento on line 31


texts: Magento2 exception during installation: 'LogicException' with message 'Unknown module in the requested list: 'Magento_BundleSampleData'

texts:
I got this error while installing Magento2

[ERROR] exception 'LogicException' with message 'Unknown module in the requested list: 'Magento_BundleSampleData'' in setup\src\Magento\Setup\Model\Installer.php:403
Stack trace:
#0 setup\src\Magento\Setup\Model\Installer.php(364): Magento\Setup\Model\Installer->readListOfModules(Array, Array, 'enable_modules')
#1 setup\src\Magento\Setup\Model\Installer.php(323): Magento\Setup\Model\Installer->createModulesConfig(Array)
#2 setup\src\Magento\Setup\Controller\Install.php(97): Magento\Setup\Model\Installer->install(Array)
#3 vendor\zendframework\zend-mvc\src\Controller\AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#4 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 vendor\zendframework\zend-eventmanager\src\EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#6 vendor\zendframework\zend-eventmanager\src\EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 vendor\zendframework\zend-mvc\src\Controller\AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#8 vendor\zendframework\zend-mvc\src\DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#9 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 vendor\zendframework\zend-eventmanager\src\EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11 vendor\zendframework\zend-eventmanager\src\EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 vendor\zendframework\zend-mvc\src\Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 setup\index.php(31): Zend\Mvc\Application->run()
#14 {main}

Also see this screenshot:

Please help me!


texts: Magento 2 Pricing Terminology Documentation

texts:
I am currently looking at the sales_order_item table which mentions the following fields:

base_cost
price
base_price
original_price
base_original_price
tax_amount
base_tax_amount
tax_invoiced
base_tax_invoiced
discount_percent
discount_amount

As this is being used for real transactions any clear documentation on the criteria for these fields is critical. Do you know where it can be found officially, not as footnotes on QA websites?


texts: MySQL upgrade don't work in other server

texts:
I have a problem with a upgrade of a custom module.

In my local environment work fine, but when I upload this changes to the server, i have all changes in the server except the new version of module.

I try delete the module in the database in the table core_resource for force upgrade but don't work.

This is my config of versions:

<Company_Module>
        <!-- <version>1.0.0</version> // just in QA -->
        <!-- <version>1.0.1</version> // just in QA -->
        <!-- <version>1.0.2</version> // just in QA -->
        <!-- <version>1.0.3</version> // add introduction text and closing text -->
        <!-- <version>1.0.4</version> // added Postal, Region City to settings -->
        <version>1.0.5</version> <!-- added Margin in quotation_line -->
</Company_Module>

Now the module never appear in the table core_resource.

Any idea?

Thanks


texts: How to find all bundle products that contain a simple

texts: I need to find a way to programatically find all the bundle products that contain a particular simple product. I'm hoping there is a simple solution this problem as I have been unable to figure one out myself.


texts: display uploaded image in admin grid in magento2

texts:
I want to display an uploaded image in admin grid which is uploaded through a form

<column name="image">
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="filter" xsi:type="string">image</item>
    <item name="label" translate="true" xsi:type="string">Image</item>
    <item name="editor" xsi:type="array">
        <item name="editorType" xsi:type="string">text</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">false</item>
            </item>
        </item>
    </item>
</argument>


texts: How to get category only product assign in magento1.9?

texts:
How to get category only product assign?

Code:-

<?php $_helper = Mage::helper('catalog/category') ?>
<?php $categoryId = 4;?>
<?php $category = Mage::getModel('catalog/category')->load($categoryId) ?>
<?php $_categories = $category->getChildrenCategories() ?>
<?php if (count($_categories) > 0){ ?>
    <?php foreach($_categories as $_category){ ?>

<?php echo $_category->getName(); ?>

        <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) echo $_category;?>
        <?php if($_category->hasChildren()){ ?>
            <?php $_subcategories = $_category->getChildrenCategories() ?>

            <?php foreach($_subcategories as $_subcategory){ ?>

                <?php echo $_subcategory->getName(); ?>

             <?php } //endforeach; ?>

         <?php } //end if ?>
    <?php } //end foreach  ?>
<?php } //end if ?>

I am not able to how to show only product assigned category.please help me?