texts: Custom Attribute's Value Null at Frontend

texts:
I am new with Magento. Now I'm using magento 1.9
So I add new attribute for my products via backend magento admin. I already assigned that attribute to my product's Attribute sets.
the attribute code is
full_bertahap_price
It appeared at edit product page. And the value can saved. No problem at all

But when I try to get the attribute's value in Frontend, it returned NULL.
this is my code

<?php
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        $cart = $quote->getAllVisibleItems();
?>
<div class="row">
    <?php foreach($cart as $_item): ?>

        <?php
             $the_item = $_item;
        ?>

    <?php endforeach ?>
    </div>
    <?php

            $value = Mage::getModel('catalog/product')->load($the_item->getProductId());

            echo $value->getFullBertahapPrice();    ?>

I try to use

Zend_Debug::dump($value->getFullBertahapPrice());

And the result is

NULL

Can someone help me to solve this? Where I went wrong? In the admin backend that attribute has value but in Frontend its NULL?
Please help !

  Edit : My cache is disabled and I also already Reindex Data but
  nothing work.


texts: Easiest way of adding a script to the order confirmation page in Magento 1?

texts:
I need to add a script that tracks orders on a Magento shop. This script is to be inserted onto the order confirmation page. What is the easiest way of inserting this script onto the order confirmation page in Magento?

The script looks like this: <script>_mktz.push(['_Goal','sale','VALUE',{transaction:'REPLACE_WITH_YOUR_ID'}]);</script>

Is it possible to do this through the backend, or is it necessary with FTP access?

And further more i need to insert variables for the total order value (VALUE) and the transaction ID (REPLACE_WITH_YOUR_ID). How would i go about extracting these two variables the easiest way possible?

I apologize if similar questions have been answered before, but I did not quite find them to any use in regards to my specific case.

Thank you in advance.


texts: Authorize.net not redirect to success or failure page magento 2.2.5

texts:
I am using magento latest version 2.2.5 and configured the Authorize.net direct post method as payment method. I tried to placed an order it saves the order in admin with pending state but didn't redirect to success or failure page please any one can advice on this issue.

I am getting below response after place the order.
Thanks

{success: true, authorizenet_directpost: {,…}}
authorizenet_directpost: {,…}
fields: {x_version: "3.1", x_delim_data: "FALSE", x_relay_response: "TRUE", x_test_request: "TRUE",…}
controller_action_name: "directpost_payment"
is_secure: "1"
x_address: "8778 High Ridge Drive"
x_amount: 1329.31
x_city: "Brooklyn"
x_company: "Test Company"
x_country: "US"
x_currency_code: "USD"
x_cust_id: ""
x_customer_ip: "111.11.11.111"
x_customer_tax_id: ""
x_delim_data: "FALSE"
x_email: "test@yopmail.com"
x_email_customer: "0"
x_fax: ""
x_first_name: "Jag"
x_fp_hash: "d4594a75aab8b43f31136e3699409363"
x_fp_sequence: "51"
x_fp_timestamp: 1536640689
x_freight: "0.00"
x_invoice_num: "000000034"
x_last_name: "Ram"
x_login: "48nL9pR49pEb"
x_merchant_email: "xxx@xx.com"
x_method: "CC"
x_phone: "01234567890"
x_po_num: ""
x_relay_response: "TRUE"
x_relay_url: "https://domain.com/authorizenet/directpost_payment/response"
x_ship_to_address: "8778 High Ridge Drive"
x_ship_to_city: "Brooklyn"
x_ship_to_company: "Test Company"
x_ship_to_country: "US"
x_ship_to_first_name: "Jagdish"
x_ship_to_last_name: "Ram"
x_ship_to_state: "New York"
x_ship_to_zip: "11206"
x_state: "New York"
x_tax: "101.31"
x_test_request: "TRUE"
x_type: "AUTH_CAPTURE"
x_version: "3.1"
x_zip: "11206"
success: true

Below are the settings which I have setup in admin


texts: Magento 2 : Minicart customization - add 2 attribute in minicart

texts:
I followed this link for minicart customization but i did not work for me href "I want to customize my minicart in Magento 2. I need to add 3 attributes  "

I followed above link but my minicart not working as before follow above link... i just want to add sku and product id into the minicart.

<?php
namespace Matech\Minicart\Plugin; //use Magento\Quote\Model\Quote\Item;

class DefaultItem
{
    public function aroundGetItemData($subject, \Closure $proceed, Item $item)
    {
        $data = $proceed($item);
        $product = $item->getProduct();

        $atts = [
            'product_id' => $product->getAttributeText('product_id'),
            'product_sku' => $product->getAttributeText('sku')
        ];

        return array_merge($data, $atts);
    }
}

default.html


texts: Magento 2.3 - extending layouts in custom theme

texts:
In Magento 2.* we could extend core layouts using custom theme, for instance, (assuming our custom theme is named Custom/our_theme) if we want to remove header & footer in customer login page we did

app/design/frontend/Custom/our_theme/Magento_Customer/layout/customer_account_login.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="footer" remove="true"/>
        <referenceContainer name="header.container" remove="true"/>
    </body>
</page>

However, in Magento 2.3 that way to extend layouts seem to have no effect. The strange thing is we can load CSS changes, override templates, etc... with no problem, so it is clear custom theme is well registered & it is working

But the only way to change layout structure seem to be doing it in a custom module (using layout_load_before event, for instance)

Is this a common issue? I mean, have you faced this in Magento 2.3 here? Or should we assume there is something wrong in our project?

UPDATE

We've seen that applying changes as layout updates then it does work

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <referenceContainer name="footer" remove="true" />
    <referenceContainer name="header.container" remove="true" />
</layout>

What I don't understand is why the first way (including page & body tags) has stopped working


texts: How can we migrate the data and settings from one magento 2.3.0 to another 2.3.0

texts:
There is some functionality issue with my site. And, I want to be sure that Is this issue in default Luma or not?

I want to migrate admin data on fresh Magento2.3.0


texts: On custom module form submission success, index is appended to page url

texts:
I have a custom module for contact us in my Magento site.

1) config.xml is like following

<?xml version="1.0"?>
---
---
---
<frontend>
    <routers>
        <requestcatalogue>
            <use>standard</use>
            <args>
                <module>Namespace_Requestcatalogue</module>
                <frontName>requestcatalogue</frontName>
            </args>
        </requestcatalogue>
    </routers>
    <layout>
        <updates>
            <requestcatalogue>
                <file>requestcatalogue.xml</file>
            </requestcatalogue>
        </updates>
    </layout>
</frontend>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <adminrequestcatalogue before="Mage_Adminhtml">Namespace_Requestcatalogue_Adminhtml</adminrequestcatalogue>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

2) There is a link in the phtml file as following

    <a title="<?php echo $this->__('Contact Us') ?>" href="<?php echo $this->getUrl('contact') ?>"><?php echo $this->__('Contact Us') ?>

3) Form action is as following

<form method="post" id="ContactusForm" action="http://localhost/mymagento/contactus/index/post/">

4) controller post action is like following

public function postAction()
{
    -----
    -----
    -----
    $this->_redirect('*/*/');  // on successful submission
    return;
    ----

5) There is a url rewrite in admin as following

My question is when I submit the form successfully the page url in the browser is appended with index.

before form submission page url

http://localhost/mymagento/contactus

after submission page url

http://localhost/mymagento/contactus/index/

How do I remove this index appended in the last from the url?

Update : Recently I applied SUPEE-6788 patch to site, before that it was working correctly.


texts: Magento1 - How to migrate different table name using Data migration tool?

texts:
I have a table in Magento1.9 named monitoring in Magento2.0 this table is modified and the table name become monitoring_base with some of the table column  renamed, how can I map this table with modified table name and column name ?

monitoring            monitoring_base
----------            ---------------
id                    monitoring_id
status          =>    state
record_date           created_at


texts: How to get current store ID in async controller

texts:
I have an AJAX request POSTing data to a controller in my Magento module.

$.ajax({
    url: "/page/section/profile?isAjax=true",
    type: "POST",
    data: "profileId=" + profile.id,
    success: function (result) {}
});

Starting at http://my-website/store2 I post to the /profile endpoint, where I'm trying to access the current store ID in the following (simplified) controller code:

use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\App\Action\Action;

class Profile extends Action
{
   /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    private $storeManager;

   /**
    * Profile constructor
    *
    * @param Context $context
    */
    public function __construct(
        Context $context,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->storeManager = $storeManager;
        parent::__construct($context);
    }

    public function execute()
    {
        $storeId = $this->storeManager->getStore()->getId(); // returns 1
        $websiteId = $this->getRequest()->getParam('website', 0); // returns 0

        return [$storeId, $websiteId];
    }
}

however this always returns store ID 1 (default) instead of the expected store ID 2.

I am not currently logged in to Magento admin.

I have tried to obtain this data via e.g. $this->getRequest()->getParam('website'), in the controller, but that doesn't seem to help either.


texts: Magento 2.2.3 - Can't get the URL of logo from core_config_data

texts:
I was trying to pull the logo_src from the database table core_config_data but can't return it on the frontend. I was trying to do this via objectManager and know that this is not the correct way. However I want to test if the idea that I have works. The odd thing is I can get all other values except this one.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$conf = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('design/header/logo_src');

What I eventually want to achieve is to combine this with the storeswitcher and do something like this. In this way I can get the uploaded logo's from each store and display it in an overview.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$conf = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('design/header/logo_src', $block->getCurrentStoreId()

I know the Magento 1 equivalent (see the code below), but find it hard to translate this to Magento 2. Does anybody have a solution for me?

Mage::getDesign()->getSkinUrl(Mage::getStoreConfig('design/header/logo_src', $storeId));

Current code

    <?php foreach ($block->getGroups() as $_group): ?>
    <?php if (!($_group->getId() == $block->getCurrentGroupId())): ?>
        <a href="#" data-post='<?= /* @noEscape */ $block->getTargetStorePostData($_group->getDefaultStore()) ?>'>
            <?= $block->escapeHtml($_group->getName()) ?>
        <?
            $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
            $logo = $objectManager->get('\Magento\Theme\Block\Html\Header\Logo');
            echo $logo->getLogoSrc();
        ?>
        </a>
    <?php endif; ?>
    <?php endforeach; ?>


texts: magmi - generic sql datasource 1.0.2 usage

texts:
Some questions arises when using MAGMI generic SQL datasource. Magmi 0.7.18 displays the following input information when using that plugin:

I tried several times with two approaches.
-the first one as described on the image was a direct query to the mysql database containing all rows to feed magento database using magmi. (no files on genericsql/requests)
-the second one using .sql file exported from my database and placing that file into (genericsql/requests).

in both cases I received the following statement: 1 warning(s) found Hide Details -> "No Records returned by datasource"

I read that some folks suggest to use input DB Initial Statement: SELECT COUNT(*) AS cnt FROM tablename but in my case it was the same.

question one: using mysql I can query mysql databse directy using the input db information (type, host, name, user, password) or I have to place the sql file in genericsql/requests too? is that my error?

question two: based on the fact that mysql cannot attach files - as MS sql can - which information do I have to place when magmi request user- pass for that sql file?

any help appreciated, I´m stuck with this issue and CSV is not suitable for my needs. brgds


texts: magento2.3.3 and "Amazon Elasticsearch Service” - "Connection failed! Test again?"

texts:
I have encountered the same problem in magento 2.3.3 and 2.3.5. My server is aws ec2 and "Amazon Elasticsearch Service" version 7.1. When I configure the magento backend, it always prompts "Connection failed! Test again? ", I followed your suggestion and checked the relevant information. I tried to ping "Endpoint" in ec2 ssh, and the connection timed out.
Endpoint can be accessed through the webpage normally, prompting me to enter http password authentication.
I use apache 2.4, do I need to configure a proxy?
Thanks, can you help me?
magento2.3.3 and "Amazon Elasticsearch Service" "Connection failed! Test again?"


texts: Magento 2: 10% off on first purchase but only for one product

texts:
We're using Magento CE v2.2.3 and we're selling a single product (with multiple options) which at the moment only has two prices.

I need to set a promotion where a customer can get a discount of 10% of their first purchase but only to one product even if there are multiple products in cart. I also need to exclude gift cards from discounts.

On my first attempt, I have set a rule that applies a discount to entire cart, which does not work as desired:

Coupon: No Coupon
Uses per Customer: 1
Conditions:
  - If ALL of these conditions are TRUE:
    - If an item is NOT FOUND in the cart with ANY of these conditions true:
      - SKU IS Gift Card
Actions:
  - Apply Percent of product price discount
  - Discount Amount 10
  - Maximum Qty Discount is Applied To 1
  - Discount Qty Step 0
  - Apply to Shipping Amount No
  - Discard subsequent rules Yes

My second attempt was in hope that I could set two rules that would apply either one or second to entire cart, but when adding two products with different prices to cart, both rules are applied, which again is not correct:

Rule 1:

Coupon: No Coupon
Uses per Customer: 1
Conditions:
  - If ALL of these conditions are TRUE:
    - If an item is NOT FOUND in the cart with ANY of these conditions true:
      - SKU IS Gift Card
Actions:
  - Apply Fixed amount discount for whole cart
  - Discount Amount 36.5
  - Maximum Qty Discount is Applied To 1
  - Discount Qty Step 0
  - Apply to Shipping Amount No
  - Discard subsequent rules Yes
Apply the rule:
  - If ALL of these conditions are TRUE:
    - Price in cart is 365.00

Rule 2:

Coupon: No Coupon
Uses per Customer: 1
Conditions:
  - If ALL of these conditions are TRUE:
    - If an item is NOT FOUND in the cart with ANY of these conditions true:
      - SKU IS Gift Card
Actions:
  - Apply Fixed amount discount for whole cart
  - Discount Amount 42.5
  - Maximum Qty Discount is Applied To 1
  - Discount Qty Step 0
  - Apply to Shipping Amount No
  - Discard subsequent rules Yes
Apply the rule:
  - If ALL of these conditions are TRUE:
    - Price in cart is 425.00

Is it even possible to do the above with default Magento or do we need an extension for that?


texts: Same problem... Magento Admin Sidebar menu is broken and have not being able to fix it

texts:
I have followed all responses to the issue posted on this Blog but still unable to fix the web Admin Sidebar...
any other ideas?


texts: How to show/hide custom tab in Product page from Magento 2

texts:
I have created a custom tab and which is working and showing fine on the product page. Here how can I show/hide the custom tab based on product type (simple, bundle etc...).

my code is

Block

<?php
namespace Test\CustomCart\Block;

use Magento\Catalog\Model\Product;

class CustomTab extends \Magento\Framework\View\Element\Template{

    /**
     * @var Product
     */
    protected $_product = null;

    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry = null;

    /**
     * @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
     */
    protected $productRepository;

    /**
     * @var \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
     */
    protected $dataObjectHelper;

    /**
     * @var \Magento\Catalog\Model\ProductFactory
     */
    protected $_productFactory;

    /**
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
     * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
     * @param \Magento\Catalog\Model\ProductFactory $productFactory
     * @param \Magento\Framework\Registry $registry
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
        \Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        \Magento\Framework\Registry $registry,
        array $data = []
    ) {
        $this->_coreRegistry = $registry;
        $this->productRepository = $productRepository;
        $this->dataObjectHelper = $dataObjectHelper;
        $this->_productFactory = $productFactory;
        parent::__construct($context, $data);
    }

    /**
     * @return Product
     */
    public function getProduct()
    {
        if (!$this->_product) {
            $this->_product = $this->_coreRegistry->registry('product');
        }
        return $this->_product;
    }

}

view/frontend/layout/catalog_product_view.xml

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

        <referenceBlock name="product.info.details">
            <block class="Test\CustomCart\Block\CustomTab" name="mycustom.tab" as="mycustom" template="Test_CustomCart::kit.phtml" group="detailed_info">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Custom Tab</argument>
                    <argument name="sortOrder" xsi:type="string">0</argument>
                </arguments>
            </block>
        </referenceBlock>

</page>

/view/frontend/templates/kit.phtml

Hey I'm here!!!


texts: Magento 2 saving custom attribute to sales_order_items

texts: I have a custom attribute of a product, that I want to have it's value stored in sales_order_items. I have added an extra column in the table sales_order_items. But How can I store the value of that custom attribute into this extra column in sales_order_items?


texts: Magento2 : Unable to serialize value while importing product description from CSV for configurable products

texts:
Hi, I was trying to add description to products using CSV file for configurable products but when I tried to import the CSV i got the error regarding Unable to serialize value but if I tried to import product one by one then the error don't pops up.

I have added description to the simple products only according to their store code wise and else description remains blank.


texts: Magento2: How to fix Uncaught TypeError: $(...).bxSlider is not a function in Magento2

texts:
In my main.js file I have included code for slider

   $(".main-slider").bxSlider({
            //mode:'fade',
            controls:false,
            pager: 'true',
            auto:false,
            onSlideBefore:function($slideElement, oldIndex, newIndex){
                var newBg = $slideElement.find("span.banner-bg  img").attr("src");
                $slideElement.css( 'background-image', 'url(' + newBg+ ')');
            },
            onSliderLoad: function(currentIndex){
                $(".main-slider li").each(function(){
                        var newBg = $(this).find("span.banner-bg  img").attr("src");
                        $(this).css( 'background-image', 'url(' + newBg+ ')');
                });

            }
        });

and I get this error. Can someone help to fix it.


texts: Magento 2.3 - TinyMCE4 Toolbar and Plugin Configuration

texts:
Updated to Magento 2.3 which includes the TinyMCE v4 editor, but the default layout does not include options like "Color Picker" or "Code".

How should I appropriately modify the tinymce.init config to include these features? I tried modifying di.xml as the devdocs described, but I did not see any changes after setup:upgrade and clearing cache. (https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/wysiwyg/configure-tinymce-editor.html)

Perhaps I need to override this file?

From: lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js
...
plugins: this.config.tinymce4.plugins,
toolbar: this.config.tinymce4.toolbar,
...

Any guidance or feedback would be greatly appreciated. Thank you!


texts: Magento 2 - How can I set the image url for a category? Programatically, not through admin, off course.


texts: Invoice creation display 'Requested product does not exist' error

texts:
I have created a product after that place order. I remove that product and create a new product with the same SKU.

Now I create an invoice for that order it displays 'Requested product does not exist' error.

Can someone help me how can I resolve this issue?

Thanks in advance.


texts: how to over right catalog/category/view.phtml

texts:
I try to change the category page by overloading catalog/category/view.phtml.

In my module, I added in mymodule.xml :

<catalog_category_view>
        <reference name="category.info">
            <action method="setTemplate">
                <template>mymodule/catalog/category/view.phtml</template>
            </action>
        </reference>
</catalog_category_view>

but it does not work...


texts:
Catalog URL Rewrites Index process is working now.

Please try run this process later.

While i do index management this is the error i am getting

What i have tried

Give 777 permission to var/locks folders
Delete all file of var/locks folder.
migrated to another database

But still i cant solve the problem.
How to resolve this issue? its almost 3 days


texts: Checkout shipping additional hidden field validation

texts:
I've added hidden field to shipping section of checkout.
If field is visible - validation works, but if I make it hidden - any validation is missing.

Need to prevent going further from shipping to payment by clicking "Next" button and display some error message or alert to user.

Is there way to make this via LayoutProcessor?

Or to extend magento validation in my module for this purpose?

Other versions will be helpful also.

UPD: Maybe this will be helpful for answer. Right now trying to do validation similar to email field at checkout.
The idea is next. Create custom form (like email field located inside separate form) and validate it according to this doc http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_form.html#template

<?php

namespace Modules\Deliverydate\Model\Checkout;

class LayoutProcessorPlugin
{

    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {

        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_slot'] = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                'customScope' => 'shippingAddress',
                'template' => 'ui/form/field',
//                'elementTmpl' => 'ui/form/element/date',
                'options' => [],
                'id' => 'enteredSlot'
            ],
            'dataScope' => 'shippingAddress.enteredSlot',
            'label' => 'Delivery Slot',
            'provider' => 'checkoutProvider',
            'visible' => false,
            'validation' => [
//                'required-entry' => true,
                'validate-no-empty' => true,
            ],
            'sortOrder' => 1,
            'id' => 'enteredSlot'
        ];

        return $jsLayout;
    }
}


texts: How to add navigation menu in a custom landing page

texts: I am trying to create a Landing Page for my Magento site. I created this by creating a new CMS page through Admin/Content/Pages. I'm wondering if I can add a custom sticky navigation menu to this page? This custom sticky navigation will be different and in addition to my default website header.


texts: Integrity constraint violation when trying to move Magento from Production to Local environment

texts:
The problem

I can't access the store front but I can enter the backend.

What I want to achieve and what I did

I installed WAMP and wanted to create a local environment which has a copy of the Magento shop on the Production environment.

I have followed these steps:

Backuped files
Created a database dump of the production server
Moved every file from "public_html"  to the local webserver
Created the database and imported the database dump on the local MySQL Server.
Made sure if I had every permission needed.
Updated the database-settings in app/etc/local.xml
Update the URLs in core_config_data:
Checked the .htaccess file.
Emptied the var/cache, var/session, var/report, var/log.
Logged in the backend. Reindexed  the data.

Now I have the following problem.
I can log in to the backend. But when I try to get the store front then I get an error message: "There has been an error processing your request". So I went to "var/report" and red the error log number.

It said "a:5:{i:0;s:96:"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '275374' for key 'PRIMARY'";i:1;s:2648:"#0 D:\wamp\www\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)".

What does this mean? And why can I log into the backend but the storefront isn't displayed?


texts: Magento 2 Call product/price/amount/default phtml in product/view/addtocart phtml file?

texts: How Can I call product/price/amount/default.phtml file in product/view/addtocart.phtml in Magento 2.


texts: Additional price increase and decrease in configurable option magento2

texts:
I am working with Magento 2.2.6. I want to add an additional price to the configurable option's label.

For Ex.
If there are three configurable options

Red - $400(Main price)
white - $850(Main price)
black - $1700(Main price)

let's assume main product price as $400.

Now, select options menu have to show like this:

Red
white + $450
black + $1300

Now if i select white option label, then it needs to be update like this:

Red - $450
white
black + $850

So the price should be increase and decrease as per option selection.

Magento 1 has this feature by default coded in configurable js. But, it is not available in magento2. I need a quick solution for this.


texts: Change package.xml of extension and generate tgz file

texts:
I need to edit a package.xml file of a extension.

There is a php restriction to that module and I need to increase it, so that I can install it on my store. I know it works well with that php version.

But when changing the package.xml file, how can I regenerate a tgz file, so that I can upload the module again in the Magento Downloader?


texts: Magento 2 is losing customer session when returning from payment gateway

texts: When i try to place an order in magento 2 website.At that time order is place successfully.But second time order is place its automatically redirected to cart page


texts: Sales Order Item qty_backordered not being set when creating order via admin

texts:
Steps to reproduce:

Click create order button in sales -> orders.
Add product to order that has a stock qty of 0 and has its backorder setting that allows backorders.
Complete order

Expected result:

The sales_order_flat_item qty_backordered field for the item ordered is set to the appropriate backordered value.

Result :
The sales_order_flat_item qty_backordered is NULL.

Any suggestions on how to fix this. We rely on the qty_backordered field for order management.


texts: Can i add grid template to custome widget magento2 ? I have an Blog menu in admin panel magento2 and i want to create an custom widget for this menu manage post here, purpose of this widget is i add some config in form and need an grid to check some posts to your slider.Give me some idea, it's not a proplem.Tks!


texts: Magento 2 Get Product Price excluding tax in phtml

texts:
I've custom block phtml and I'm loading Product in it.

So how can I get Product price with including tax as well as excluding tax...

Rightnow I'm displaying price as

<?php echo $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(); ?>

And for special price

<?php echo $product->getPriceInfo()->getPrice('special_price')->getAmount()->getValue(); ?>

But I want to display price with excluding tax and including tax, In backend it's setting is enabled.


texts: CE 1.9.2.4 - Custom Address adminhtml field input

texts:
I'm working on a Magento site meant for employees from different departments within a company to purchase goods. I've created an installer to create the address attributes which shows correctly in the Admin Customer Create/Edit screen as depicted:

The idea here is that the admin person should start typing in the Department field, and it should bring up an auto-suggest list. Selecting the appropriate option should auto-populate the Department ID field, which is what is required by the Stores Office to deliver internally.

I already have the Departments and associated data set up via a module which created my database table for me.

I can do the jQuery auto-suggest and JSON data lookup required, but I'm totally unsure how to customize the Department field (jQuery function triggered for keyUp event) and to make the Department ID input read-only.

Would someone be kind enough to point me in the right direction? Thank you!

EDIT:
I was contemplating editing the app/design/adminhtml/default/default/template/customer/tab/addresses.phtml file and injecting my jQuery in there, but I don't think that would be the proper way to do it.


texts: How to display company name on checkout page in Magento 2.1?

texts:
I want to display the company name from customer address on checkout page in Magento2.1

It should be visible in shipping address section as well as side bar.

How can I do it?


texts: Is it possible to have street 1 as required but not street 2 on a single store?

texts:
I've a complex registration form on a Magento website, which is on a Magento installation with around 30 sites on it.

For just one store I require the street 2 to be optional, but on all the other sites it needs to remain required.

Is this possible, and if so how would I go about achieving this?


texts: How does magento product image caching works?

texts:
I uploaded some images to my products and they were visible fine on frontend. I then went and deleted those images from pub/media/catalog/product folder and also deleted pub/media/catalog/product/cache folder. When I open the media cache link of product I now see the default placeholder image. The path I use in my browser is media/catalog/product/cache/ca230af9a56e172d8d63e4842d175bbe/k/a/kars.jpg This is no way the path for the placeholder image. So now the question is:

How is magento replacing the deleted image with placeholder image, instead of showing 404?
How is the path not showing 404 since I had deleted those folders?

Thank you for your help.


texts: How to debug vsprintf() "Too few arguments" error in my log files?

texts:
I keep seeing the following report in my system.log file:

2015-10-20T12:34:07+00:00 DEBUG (7): Array
(
    [type] => 2
    [message] => vsprintf(): Too few arguments
    [file] => app\code\core\Mage\Core\Model\Translate.php
    [line] => 416
)

I suspect it comes from the extension I wrote but I'm not sure.
what's the best way to debug this? how do I know where it comes from? looking at the code at Translate.php doesn't help much.


texts: Magento 2 visual swatch not working from changing attribute from drop down?

texts:
I have created an attribute "color" with drop-down, now as per our customer request we have changed to visual swatch.
and did re-index and flush.

but color not displaying at front end as we expected.

AdminEnd Settings:-

Fronted:-

Could you please suggest.

Magento 2 version:- 2.2.3 CE

Thanks


texts: Magento 2 : Add Custom Validation After Shipping Address Has Been Entered

texts:
When a customer enters their shipping address (in standard Magento 2 checkout process), I need to look at each of items in their shopping cart and call an External REST API to validate that item is not excluded from shipping to their state. If item is not valid in their state, then I need to redirect them back to their shopping cart and display a validation message explaining why they cannot place their order.

The external REST API is already built and works, but I have not been able to figure out where to inject this validation at. I want to do this by using an observer that observes when the user completes the first step of the checkout process (where they enter their shipping address information). What I need to  know is, is there an event triggered at that time and if so what event should I attache the observer too. Or is there another way of accomplishing the same objective?

Any help would be greatly appreciated!


texts:
Magento 2 upload category image with the same name but different image

I am trying to compress the category images and upload with the image with the same name but it's adding "_2.jpg" to it.
Ex: "image_2.jpg"

is it possible to upload a different image with the same name?


texts:
Our aim is to reduce page size. How can we remove White spaces from HTML output so page size can be reduced?

Remove inline css and javascript is one method to reduce page size which we have done already.


texts: Indexing problem 2 different sites on same server. One site breaks other

texts:
We are facing a problem with indexing.
There are two magento 2 installations, (diferent hosting, different domains, running different fpm pools with different users , different and independant databases with different users and restricted access to its own databases).
When we run a user1# php bin/magento indexer:reindex, the category-product indexes of the other site is emptied. (and viceversa) other indexes like search,... seems fine...
Did someone have a hint of where to look at?


texts: How to filter collection and still keep the original collection in Magento 1

texts:
I've created a custom module that allows you to add custom labels on product page. So I have a collection of custom objects and I want to filter it but I want to keep the original collection too.

This is my code to understand better:

The model:

class Company_ModuleName_Model_Label extends Mage_Core_Model_Abstract
{
    private $_collection;

    public function __construct()
    {
        $this->_collection = $this->getCollection();
    }

    public function filterByNew()
    {
         $collection = $this->_collection;
         $collection->addFieldToFilter('type', 'new')->addFieldToFilter('status', 1);

         return $collection;
    }

    public function filterByOld()
    {
         $collection = $this->_collection;
         $collection->addFieldToFilter('type', 'old')->addFieldToFilter('status', 1);

         return $collection;
    }
}

And the controller:

class Company_ModuleName_Adminhtml_LabelController extends Mage_Adminhtml_Controller_Action
{
     public function dosomethingAction()
     {
         $model = Mage::getModel('module/model'); //the collection is defined in __construct

         $new = $model->filterByNew();

         //do something with $new

         $old = $model->filterByOld();

         //do something with $old
     }
}

The problem is that after filtering by new, the original collection is not kept. $this->_collection is now filtered by new, even if I put this line $collection = $this->_collection;. So now if I want to filter by old, it returns nothing because it's already filtered by new.

Is there a way to filter the original collection by both types, new and old, but not in the same filtration, without loading the collection again?

Thanks a lot!


texts: After Flush Catalog Images Cache order email product image not showing

texts:
Am using Magento 1.8 after Flush Catalog Images Cache order email product image not showing for simple product but image show for configurable product. Following email

And this my code in app/design/frontend/base/default/template/email/order/items/order/default.phtml

if ($_item->getProductType() !== Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    $parentIds = Mage::getModel('catalog/product_type_configurable')
                       ->getParentIdsByChild($_item->getProductId());
    $_product = Mage::getModel('catalog/product')
                       ->setStoreId($_item->getOrder()->getStoreId())
                       ->load($parentIds[0]);
} else {
    $_product = Mage::getModel('catalog/product')
                       ->setStoreId($_item->getOrder()->getStoreId())
                       ->load($_item->getProductId());
}

<img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>"  width="135" height="135" alt="<?php echo $_item->getName() ?>" />

How can I fix this error...? ANd thanks in advance


texts: Enabling Varnish gives 500 error on CMS page like Home Page, About Us, Contact Us. Other pages are working fine

texts:
I installed Varnish on my Magento 2 store. All pages such as cart page, product pages, category pages, account pages are working fine and served by Varnish perfectly. The issue is in CMS page such as Home Page, About Page etc. Its giving me 500 errors (Internal Server Error).

Note: This is not the 503 Guru Meditation Page.

I have also checked magento logs which is not giving any hint. The Apache log throws "Premature end of script headers: index.php". Varnishlog also gives nothing except 500 Response.


texts: Magento image to permanently display by external url

texts:
My client's site is using Magento version ce-1.9.2.0.

Now he wants the product's(and probably category's also in future) images to be fetched and displayed by external URL instead of traditional way of storing images in site directories.

Can anybody suggest any way/plugin for achieving this along with resize image working ?

Resized image can be stored on site folders.


texts: Replace logo.svg in default.xml not working Magento2

texts:
OK, so I want to change the logo.svg with my own logo which is .jpg file (should be supported by Magento 2.0.7)
Created my new theme with all directories and files, selected the theme in the admin page.
Theme is working and but still using the logo.svg so far:

Now I added my logo under the web/images folder and made the following change to the default.xml under Magento_theme/layout which is in my theme folder (/app/design/frontend/espressoplaza/standaardep/Magento_theme/layout):

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header.container">
        <container name="header.panel.wrapper" htmlClass="panel wrapper"   htmlTag="div" before="-"/>
        </referenceContainer>
        <referenceBlock name="logo">
    <arguments>
    <argument name="logo_file"  xsi:type="string">images/testlogo480x170.jpg</argument>
    <argument name="logo_img_width" xsi:type="number">480</argument>
    <argument name="logo_img_height" xsi:type="number">170</argument>
</arguments>
</referenceBlock>
        <move element="header.panel" destination="header.panel.wrapper"/>

I cleared all static content per script:

#!/bin/bash
rm -R ~/public_html/pub/static/frontend/
rm -R ~/public_html/var/view_preprocessed/css/frontend/
rm -R ~/public_html/var/view_preprocessed/source/frontend/
rm -R ~/public_html/var/cache
rm -R ~/public_html/var/generation

And cleaned the cache.
Still Magento is picking up the logo.svg from Blanc

What am I overlooking or doing wrong here.....

Thanks,
Ron


texts: what is the best approach to build magento 2 application?

texts:
what is the best approach to building Magento 2 application?
what are the advantages/disadvantages?
what is the language I should use in order to build the application, of course, the application should be compatible with IOS/ANDROID.


texts: Magento 2: Regarding Initialling Interface

texts:
As per object oriented programming concept, an interface can not be initialised directly but can be used to implement in other class and the instance of that class can be created. So my question is how Magento allows to create instance of interface in DI(constructor) ?

For example StoreManagerInterface in following sample code

public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
)
{
    $this->_storeManager = $storeManager;
    parent::__construct($context, $data);
}


texts: Magento 2: Multiple Observer Affects Speed?

texts:
In My custom module, I have created 10 Observer Events. Which affects while clicking on "Add To Cart", "Check Out".

At single level user & development level, it's fine. My worry is when site gonna live. Have more than 2K SKU's.

Is it gonna affect performance? Because in general, I'm putting Blocks in Magento Simple Checkout Process, to achieve functionality.

Following standard procedure to create observers.


texts: Magento 2 : Admin category products getting wrong count

texts:
I am using the Magento 2.1.8 version.

Facing an issue of products count next to the category name.

The categories of Anchor is enabled.

I did reindex and flush the Magento cache.

In addition, some products are shown in the frontend, which are not assigned for that category.

Can anyone advise on this?


texts: Show filter attributes on non-category page with custom PHTML content that includes a product collection

texts:
I want to show specific products on a custom page. The products on the desired page are gathered with a custom attribute.

Now I want a category-page-like sidebar with filterable attributes, just like the normal category page has.

Or, simpler said:
I want another category page, but not for a configured category but a custom attribute, including sidebar.

How do I achieve this?


texts: How to call helper method in .phtml file

texts:
Trying to develop something in magento 2. But, I didn't find how to call a Helper method in template(.phtml) file.

I want a replacement of below code:

$this->helper('modulename/helpername')->methodname();

If anyone knows please help me.


texts: Mage::getSingleton('checkout/session') ->getLastRealOrderId(); is not working

texts:
I'm using paypal standard as a payment system and want to get the last order id and for that I'm using age::getSingleton('checkout/session') ->getLastRealOrderId();

But this is not giving me the last placed order ID., I've checked in the modal app/code/local/Mage/Paypal/Model/ipn.php in method _registerPaymentCapture I've tried saving the order into a session so that I can get it on success page...but that is also not working.

Any help is much appreciated.


texts: Global messages on product compare list?

texts:
What do I have to do to show the global messages on the compare list template? I tried calling

$this->initLayoutMessages('catalog/session');

in the Mage_Catalog_Product_CompareController::indexAction but this gives me an error that initLayoutMessages is undefined. Just adding

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

is not enough as it seems.

Thanks!


texts: Magento 2 - How can I change product visibility value using plugin afterSave or beforeSave method?

texts:
I have created a plugin and I want to change product visibility value on product save but it's not working.

ProductAfterSave.php

namespace Vendor\Module\Plugin;

class ProductAfterSave {

    public function afterSave(\Magento\Catalog\Model\Product $subject, $product)
    {
        $productModel = $this->objectManager->create('Magento\Catalog\Model\Product\Action');
        $productModel->setVisiblity(2);
        $productModel->save();

        return $product;
    }
}

Can anyone please help me, Thanks.


texts: Success Page is not appearing for Configurable - simple product

texts:
I'm using configurable product for my stores. i have multiple simple products under a configurable product. All functionalities is working except when i go and book a configurable simple product , the success page is not displayed when i hit place order ( but the order is placed in the admin panel, customer receive's the order confirmation message).

The scenario is

When i order a simple product , the everything runs smoothly
When i go to configurable product will select the color and size attribute for my product and checkouts. Till the Place order everything is fine, when i hit the Place order it just shoes "Submitting Order Information" GIF and nothing happens. The products are still in cart and i am not redirected to the success page.
But the order is placed in the Backend admin panel

Note:

Mb_string is enabled
I have used sales_quote_item_set_product event to change the cart name and sku according to the configurable simple product in cart page

Below is the Observer i have written for the event

$event      = $observer->getEvent();
$quote_item = $event->getQuoteItem();
$storeId    = $quote_item->getStoreId();
$item       = $observer->getQuoteItem();
$product    = $observer->getProduct();
$sku        = $product->getSku();

$productDetails =  Mage::getModel('catalog/product')
            ->setStoreId($storeId)
            ->loadByAttribute('sku', $sku);
$price      = $productDetails->getPrice();
$sprice     = $productDetails->getFinalPrice();

$item->setOriginalCustomPrice($sprice);
$item->setOriginalPrice($price);
//$item->getProduct()->setName($productDetails->getName());

Can someone please guide why im not getting the success page when the configurable product is ordered??


texts: Magento 2: Migrate only Customer and orders

texts:
I want just migrate customer and orders from Magento 1 to Magento 2 how can I ignore other data like cms page, block, products, etc.
where do I need to change in config.xml?
Magento 1 Version : 1.9.3.1
Magento 2 Version : 2.3.1


texts: We have a general group and a wholesale group. Is it possible to automatically put all orders that come from the wholesale customer group on HOLD? We need to approve those purchases before the shipping department processes them and to avoid mistakes we'd like the order to be on hold.


texts: Disable International Countries Dropdown in Shipping Quote within Shopping Cart

texts:
I am managing a website that needs to disable international shipping. I have done this in the admin and the options are gone from checkout but within the cart there is a place to get a shipping quote and it is still showing the dropdown of all the international locations. Can anyone point me to where in the admin I can disable the shipping quote for international locales? I have turned off all countries but the United States in System > Configuration > Sales > Shipping Methods but the countries are all showing in the shipping quote drowpdown: http://minnewyork.com/checkout/cart/

Thanks in advance.


texts: Magento 2 : How to disable input refund adjustment

texts:
Can anyone help me, how to disable input refund shipping, adjustment refund and adjustment fee when we create credit memo on Magento 2?

I can disable it on Magento 1, but I am confused how to disable it for Magento 2.

[edit]
in my case, I need to validate a condition. I need to delete that field for payment by certain methods only. so not all orders get disabled/


texts:
I am not a developer, but working on my own web site. I would like to increase the number of text formats ( header Texts ) in Magento 2.2. Can anyone assist with the following.

Can this be done and what file would need to be altered and with what code


texts: How to search for product by name or sku programatically?

texts:
Need search by name "or" sku

$connection = Mage::getSingleton('core/resource') -> getConnection('core_read');

$products = Mage::getModel('catalog/product')
                    ->getCollection()
                    ->addAttributeToFilter('sku', array('like' => '%'.$search.'%'))
                    ->addAttributeToFilter('name', array('like' => '%'.$search.'%'))
                    ->load();

This code works but only by name


texts: Get pending orders for a specific customer using REST API Magento 2

texts:
I am trying to get the pending orders for a specific customer using :

  https://{domain.com}/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=pending&
  searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][0][filters][0][field]=customer_email&searchCriteria[filter_groups][0][filters][0][value]=aaa@gmail.com

But I got this error :

  Report ID: webapi-58e37396d92a8; Message: Property "FilterGroups"
  does not have corresponding setter in class
  "Magento\Framework\Api\SearchCriteria". in
  /var/www/html/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:195

How can I fix it?

-Another question, This API forces me to use an Admin token. I see it is not security wise. How can I use a customer token ?


texts: Move tool bar in category page to the top in magento2

texts:
I need to move toolbar section to the column.top, I have used below code in my catalog_category_view.xml file.

 <?xml version="1.0"?>
 <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
    <move element="product_list_toolbar" destination="columns.top" after="category.cms"/>
 </body>
 </page>

Its not moving throwing error like below,

  Uncaught Error: Call to a member function getSize() on null in /vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar.phtml:18

How to move tool bar to the top section. Because i am looking for tool bar to be in full width rather than into the category product section. Is that can be done. Please anyone help me. Thanks.


texts: How to display a database table in .phtml file

texts:
I have created a custom module and created a database table using install schema like below:

id      color     price_component
1       white     0
2       red       4
3       green     8
4       black     12

How can I display this table in my .phtml file?

I'm new to Magento. If someone can explain this step by step that would be really helpful.


texts: variable passed from controller to phtml template and turned into hyperlink suddenly prefixes w/ controller's url

texts:
I'm passing a url string variable from a controller to a phtml file where i'd like to then display it as a hyperlink.

unfortunately, magento seems to prefix the variable data with the controller's url.

so a variable that's passed like this www.something.com is converted to www.mydomain.com/my_controller/www.something.com when calling this in the phtml to create a hyperlink.

 <?php echo "myVar . "'>html link in php
";?>

if i make a simple call this, it displays the text correctly:

 <?php echo $this->myVar?>

i've tried calling this to strip the added url:

$newURL = str_replace("www.mydomain.com/my_controller/", "", $this->myVar, $count);

but php doesn't seem to find the substring and count = 0.

seems like magento is adding the controller's url automatically, which is not what i need.

this is how i'm rendering the page.

    $this->loadLayout();
    $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');

    $block = $this->getLayout()->createBlock(
        'Mage_Core_Block_Template',
        'blockname',
        array('template' => 'NamespaceName_ModuleName/links.phtml')
    )
    ->setData('var', 'www.something.com');

    $this->getLayout()->getBlock('content')->append($block);
    $this->_initLayoutMessages('core/session');
    $this->renderLayout();

Any ideas?


texts:
I followed this tutorial:

To add a comment box to each product in cart. The data gets posted but it is never filled into the database. I also have the feeling that the function update items in cart.php never gets executed.

Any ideas what it could be?


texts: Sorting Attribute (with custom source model) by dropdown label

texts:
I have a custom attribute called collection (in retrospect, a horrible name all things considered,) with a custom attribute source model. The important part is here:

public function getAllOptions() {
    if (is_null($this->_options)) {
        $this->_options = array();

        $rootCatId = Mage::app()->getStore(1)->getRootCategoryId();
        $rootCat = Mage::getModel('catalog/category')->load($rootCatId);

        $categories = Mage::getModel('catalog/category')->getCollection()
            ->addAttributeToSelect('name')
            ->addFieldToFilter('level', array('eq'=>3))
            ->addFieldToFilter('parent_id', array('in'=>explode(',', $rootCat->getChildren())));

        foreach ($categories as $category) {
            /** @var Mage_Catalog_Model_Category $category */
            $children = $category->getChildrenCategories();

            if ($children) {
                $subOptionArray = array();

                foreach ($children as $child) {
                    $subOptionArray[ $child->getId() ] = array(
                        'label' => trim($child->getName()),
                        'value' => $child->getId()
                    );
                }

                if (!empty($subOptionArray)) {
                    $this->_options[ $category->getId() ] = array(
                        'label' => trim($category->getName()),
                        'value' => $subOptionArray
                    );
                }
            }
        }
    }

    return $this->_options;
}

This gets a list of all level 4 categories, and lists them in <optgroup>'s under their parent category's name. Like so:

A
    1 => A1
    2 => A2
    3 => A3
B
    4 => B1
    5 => B2
    6 => B3

This works great in the Admin when selecting values for this attribute. The problem comes with sorting a collection by this attribute's value.

I'm using the following snippet to try and sort by collection:

->addAttributeToSelect('*')
->addAttributeToSort('collection', 'asc')

The problem is that this ends up sorting by the attribute's value, and not it's label. (The value here being the category IDs.) I need to be able to sort by the attribute's label, without having to convert the collection to an array and usort, or some post-load reflection sorting.

Any ideas what I'm missing? I feel like I'm missing something simple.


texts:
I put my cronjobs to every minute, but i think there is still someting wrong. I still have some cronjobs who stay's on pending...

My pending cronjobs:

I migrate my Magento from 1.7 to 2.3


texts: Bestselling products data is not gettting saved in its Table.

texts: I am using magento 2.2.0 and I am trying to fetch bestselling products, but the problem is that there is not even a single product in the sales_bestsellers_aggregated_monthly table. As I purchased many products from it but none of them is saved in the table.


texts: Magento2 System Upgrade from 2.0.5 to 2.0.7 Check Component Dependency issue

texts:
I have started on upgrading the magento2.0.5 enterprise system to latest Magento2.0.7 from web interface.

Initially I faced the issues related cron setup, once I completed the cron setup all the errors were cleared, except Check Component Dependency issue.

"Problem 1
- The requested package magento/product-enterprise-edition could not be found in any version, there may be a typo in the package name."

Please anyone can help me out!!


texts: Magento 2 - Custom error and exception handling?

texts:
In Magento 1, I was able to trap all exceptions and errors within custom handler functions at the class level in order to reliably perform some final tasks before the script ended.

Has anyone been able to get this to work within Magento 2?  Did something change in the way that handlers work in M2?

If I throw an exception to force it, the exception is reported, but the custom functions are not fired.  I've confirmed that the handlers are being set properly, and I'm also using the appropriate use \Exception line at the top of my script.

Handlers:

register_shutdown_function(array($this, "customFatalErrorHandler"));
set_exception_handler(array($this, "customExceptionHandler"));
set_error_handler(array($this, "customErrorHandler"));

Functions:

private function customFatalErrorHandler() {

    echo "custom fatal error handler fired\n";

}

private function customExceptionHandler($exception) {

    echo "custom exception handler fired\n";

}

private function customErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) {

    echo "custom error handler fired\n";

}

Trigger:

throw new Exception('My Test Exception');

Output:

[Exception]
My Test Exception

Expected Output (either order):

custom exception handler fired
[Exception]
My Test Exception

OR

[Exception]
My Test Exception
custom exception handler fired


texts: Customized field got disappeared in catalog_product_flat_1 table

texts:
I added new field in catalog_product_flat_1 table. By using below code:

$installer = $this;
$installer->startSetup();
 if (!$installer->getConnection()->tableColumnExists($installer->getTable('catalog_product_flat_1'), 'most_clicked'))
    {
       $installer->getConnection()->addColumn($installer->getTable('catalog_product_flat_1'), 'most_clicked', "INT( 25 ) int(25) default (0)");
    }

$installer->endSetup();

This code works fine in localhost. In live site new field got added to table but after indexing or flushing cache, new field got disappeared.

Is this not the right way to add new field in table?

What is the correct way to add new field in catalog_product_flat_1 table and sales_flat_order_item table?

Is above code is only applicable to sales_flat_quote_item table?


texts: Change in files but nothing will be happen!

texts:
I transfer my site from windows server to Linux. after this transfer when i change some files codes and then save the file and clear cache, nothing will be happen and the changes don't apply!!!

While before this transfer everything work good.

Where is the problem?


texts: Adding an input file when creating a payment method

texts:
It's been a while since I want a way to add file upload system when creating a payment method.

In a custom module , I created a new method of payment. When declaring my fields in the file "system.xml" I'll wish to add an input to upload a PDF.
Here is part of my code :

<bvr translate="label" module="paygate">
   .......
   ....
   <fields>
      <bvrfile translate="label">
         <label>BVR file</label>
         <frontend_type>file</frontend_type>
         <sort_order>2</sort_order>
         <show_in_default>1</show_in_default>
         <show_in_website>1</show_in_website>
         <show_in_store>0</show_in_store>
      </bvrfile>
    </fields>
    .......
    ....
</bvr>

Here is a screenshot of my admin panel:

Do you know if it is possible to add this type of field and how I can retrieve the file's URL upload?


texts: calling magento module class from external php file

texts:
i have module in my magento

1: config.xml
code of config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <helpers>
            <catalog>
                <rewrite>
                    <product_view>Inic_Catalog_Helper_Product_View</product_view>
                </rewrite>
            </catalog>
        </helpers>
        <blocks>
            <catalog>
                <rewrite>
                    <product_view_attributes>Inic_Catalog_Block_Product_View_Attributes</product_view_attributes>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

2:view.php
community\Inic\Catalog\Helper\Product\view.php

code of view.php

class Inic_Catalog_Helper_Product_View extends Mage_Catalog_Helper_Product_View
{
    public function gevalnow($param)
    {
      return $param
    }
}

now i have written custom code in my root folder say test.php

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

$helper = Mage::helper('inic_catalog/product_view')->gevalnow('Standard');
print_r($helper);// get value from function in view.php

i get below error:

Fatal error: Class 'Mage_Inic_Catalog_Helper_Product_View' not found in /home/keviainc/public_html/app/Mage.php on line 546

how can i do it pls guide ??..


texts:
I have created plugin for elasticSearch to set the size of the page

<?php

namespace Devall\ElasticsearchPlugin\Plugin\Checkout\Controller;

class EmptyProducts
{
 public function afterResolve($subject, $result)
 {

     $result->setPageSize(30);
     return $result;
 }
}

code Looks something like this.
the problem is that when I use pagination and go to the next page there are no products until I reload that page.
Any suggestions ? how Can I fix this?


texts: Magento 2: need to change round-up to TWO decimals ONLY on Checkout page -- completely stuck

texts:
I have a weird and painful-to-work-with installation of Magento 2 for a client. He's using a custom theme (based on the standard Magento Theme) and currently has https://github.com/lillik/magento2-price-decimal installed to manage decimals store wide.

The client asked to have all price mentions round off to three decimals, with the Grand Total on the checkout page only needing 2. I'm not terribly familiar with Magento but I've been searching for hours trying to make some progress and alas.

I'm desperately in need of some help -- and I'm hoping StackExchange can. I don't know what to provide, code-wise, so let me know.


texts: Magento 2.3.5 - Inline Translate within a CMS Block

texts:
I'm running a multi website and store setup.
I'm trying to use inline translation within a CMS block so I don't have to create multiple blocks for different stores.

For example I'm using this within a CMS block to enable inline translation.

<?php echo __('Welcome to this website') ?>

However it doesn't appear on the page, when I inspect element it shows as

Is there anyway text can be inline translated in a CMS Block?


texts:
I'm looking for the authorize.net 1.1.1 module for magento 2 but I cannot see to find the module and authorize.net tech support does not seem to know where it can be downloaded.  If anyone has the link to this module please share it.
Thanks


texts: Magento media wysiwyg image browser broken in 1.8.1 (only storage root)

texts:
when we are editing a CMS page and want to add an image in Magento 1.8.1 we only see storage root in the image browser ... All wysiwyg and subfolders are chmod 777

update: The strange thing is that it does show the files in the root of media/wysiwyg but not the directories or the files in the subdirectories

Did anyone encounter this also. Any suggestions to fix?

thx


texts:
I have a large number of products I need to add different qty increment values for.  I cannot find this value in the database, nor do I see a way to upload this value in the admin.  What am I doing wrong, How can I add Qty Increment values for a large number of products at once.

Hint: My increments vary per product.


texts: Magento 2 Product Detail Page Not Loading/Showing

texts:
After upgrading to Magento 2.3.2, the product detail page is not loading or showing anymore. It gives error This page isn’t working. www.mywebsite.com is currently unable to handle this request.
HTTP ERROR 500

When I checked the log I see Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/.../public_html/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []

I have ran the commands, updated, granted permission, deployed static content, compiled, reindexed, flushed cache... Etc, but still the problem is not solved.

Product Detail Page Error Screenshot: http://prntscr.com/pgj0v9

Any suggestions?

Thank you!


texts: 'Yes/No Attribute' in magento - how to get text value for a store view

texts:
I wonder how I can get value of an yes/no attribute for a specifical store view in magento.

I've tried that way:

$store_vies_val = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'store_view_attr', $store_id);

but it returns nothing on displaying.

Thanks a lot for your answers!


texts: Magento 2 : How can I load an admin grid with pre-defined filter values?

texts:
I want to create a link to a custom grid in my admin with pre-defined filters. The grid is made with a UI Listing Component (XML) and it has a column called form_id that is setup like this:

<column name="form_id">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">textRange</item>
            <item name="label" xsi:type="string" translate="true">Form id</item>
        </item>
    </argument>
</column>

The grid works just fine. I can apply the filter and everything works well. The grid gets nicely updated with a XHR request.

However... I want to be able to have a filters' value pre-defined at some point. For example, I want to be able to open the grid when it's filtered on ID=3.

So I already tried loading the page with the same URL parameters as the XHR-request, as well as simply adding the only required parameters:

?namespace=form_response_listing&search=&filters[placeholder]=true&filters[form_id][from]=3&filters[form_id][to]=3&paging[pageSize]=20&paging[current]=1

As well as:

?filters[form_id][from]=3&filters[form_id][to]=3

Both with no success. So how Can I pre-fill filters by using the URL?

Edit:

I'm not sure if this is a duplicate of the other question (as mentioned in the comments below). In my case, I'm using a virtual type as collection for my grid:

<virtualType name="Vendor\Module\Model\ResourceModel\Response\Grid\Collection"
             type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">vendormodule_form_response</argument>
        <argument name="resourceModel" xsi:type="string">Vendor\Module\Model\ResourceModel\Response</argument>
    </arguments>
</virtualType>

So it's not that I have a physical Block class for my grid widget, it's purely created with a UI Component listing XML.

Nevertheless, I'll check anyway if the question referred to will help my use case.


texts: Google API - Google AdWords conversion tracking feature

texts:
I have set up a purchase conversion in Google Ads, and selected the Place tag myself option.
I’ve then put the Conversion ID and Label into the Magento Google API Google AdWords settings and saved.
However no tags or tracking is running on website. No conversions being tracked. It doesn’t do anything.
I’ve flushed cache. I’ve re compiled redeployed content.
Am I missing something?


texts: How to find out package and theme name of our magento project?

texts: I am facing difficulty in finding my package name and theme name in app/design/Frontend/ path


texts: How to display customizable option in magento 2 product page

texts:
I have added custom options for products referring https://docs.magento.com/user-guide/catalog/settings-advanced-custom-options.html

How can i display these options on product page in magento 2?
Any idea?


texts: Cron job creates loads of records in database

texts:
When running the following command, about 20 of the same record gets created in the database.

php bin/magento cron:run

I think it's also making my plugins run the same amount of times as the record exists.

Any ideas on what could be causing this?

This is the screeshot of my cron_schedule table

https://imgur.com/a/phOgn


texts:
I am looking for the magento 2 extension contribution steps.

I have tried but it is not available any where,can somebody guide me on this.


texts: How to allow user to apply a special discount base on quantity , three times

texts:
I have created from Cart Price Rules a new Rule.
The rule says: if the user buys 3 of these products ( based on SKU ) will get 5$ off
it's possible to allow the user if buy these products two times ( 6 products) will get 10$ off, three times (9 products) will get 15$ off with the same rule?
This is my rule
If ANY  of these conditions are TRUE :
If total quantity  is  3  for a subselection of items in cart matching ALL
of these conditions:
SKU is one of  10593,10597,10595,PR/...

Here is the action


texts: Magento 2 : What is  and  element in data migration tool config file?

texts: In data migration tool config file we have<bulk_size> and <direct_document_copy> elements. What values are expected for these tags and what are their purpose?


texts:
I have code to preview html before sending email.
Here is the code i am using it was working fine for previous version like2.2
But using this in 2.3.5-p2 getting weird html when print it.So how can i get proper html also invoice item is also not printing i have passed invoice object and order object as well in template variable parameter.Please guide.
public function geneatePreview(
    $templateParams
) {
    $this->inlineTranslation->suspend();
    $templateId = 1;//$this->getConfigValue($template, $this->getStore()->getStoreId());
    $sender = ['name' => 'fakename', 'email' => 'fakename@gmail.com'];
    $transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
        ->setTemplateOptions(
            [
                'area' => Area::AREA_FRONTEND,
                'store' => 1,
            ]
        )
        ->setTemplateVars($templateParams)
        ->addTo('faketo@gmail.com')
        ->getTransport();

     echo '<pre>';print_r($transport->getMessage()->getBody()->generateMessage());exit;
    //$transport->sendMessage();
    //$this->inlineTranslation->resume();

    //return $this;
}

Output Image

But when i tried to print Body content using $transport->getMessage()->getBody() it is showing like this


texts: "magento2/sitemap.xml" is always and automatically added to my robots.txt

texts:
I don't know how and why I find the following in my robots.txt

Sitemap: http://www.[mySite].com/magento2/sitemap.xml

worse the link opens to a "404 page not found".

I have tried to remove it from my robots.txt (under Stores\General\General\Design) but just the next day and I can see it down at the end of my http://www.[mySite].com/sitemap.xml

Note that at the top of my http://www.[mySite].com/magento2/sitemap.xml there is a correct link to my sitemap.

How can I remove that permanently?


texts: I am new to Magento. I have cloned a repository of an existing website on my local machine using Sourcetree. The repository was on Bitbucket. I also have WAMP installed and have imported the database also. How do I launch my website on local machine? Do I need to install Magento 2.0 first and then merge the clone files with it? Any help/guidance will be much appreciated.


texts: Magento 2 : How to get current product programmatically in a helper?

texts: Could someone advise what's the best way to get the current product in a custom helper? Basically if I am a product page I need to get it's sku


texts: Magento 2.4.1 If shopping cart is not empty place a Go To Shopping Cart button next to Add To Cart on Product Detail page

texts:
When the shopping cart is NOT empty, I want a button next to the Add To Cart button on the product detail page and have it go to the Shopping Cart
File using to override is:
/app/design/frontend/THEME/default/Magento_Catalog/product/view/addtocart.phtml
Below is my current code without the check shopping cart for items code. I want to only show the Go To Cart button if something is in the cart.

        <button type="submit"
                title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
                class="action primary tocart"
                id="product-addtocart-button"
                 style="width:50%;" disabled>
            <?= $block->escapeHtml($buttonTitle) ?>
        </button>
        <button type="button" onclick="location.href='/checkout/cart/'" class="action secondary tocart"
                id="product-addtocart-button"
                 style="width:49%; margin-right:0;">
            Go To Cart
        </button>
        <?= $block->getChildHtml('', true) ?>

I've tried the various solutions out there including Magento 2 add custom button next to cart button and even checking it using the cart helper like https://www.mageplaza.com/devdocs/how-get-data-shopping-cart-items-subtotal-grand-total-billing-shipping-address-magento-2.html and
$helper = $this->helper('\Magento\Checkout\Helper\Cart');
$helper->getItemsCount(); ?>

Definitely not working.


texts: How to increase default file upload limit in magento 2.1?

texts:
I am integrating file uploader in admin form. It's working fine. but it has default 2MB upload file size limit.

This is my uploader class

public function __construct(
    ....
    \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory,
    ....
) {
    ....
    $this->_fileUploaderFactory = $fileUploaderFactory;
    ....
}

public function uploadFile($scope)
{
   try {
        $uploader = $this->_fileUploaderFactory->create(['fileId' => $scope]);
        $uploader->setAllowRenameFiles(true);
        $uploader->setFilesDispersion(true);
        $uploader->setAllowCreateFolders(true);

        if ($uploader->save($this->getBaseDir())) {
            return $uploader->getUploadedFileName();
        }

    } catch (Exception $e) {
        throw new \Exception('The file was not uploaded.', $code);
    }
    return '';
}

How we increase file uploader limit?


texts:
I am trying to create a page that looks like any category page and lists all my new products, this seems like it should be simple what would i need to do to do this?
a similar question was asked here
New products list dedicated page
I am trying to make a url that has the new products listed their, the question i have linked to does not explain how this is done what would i need to do to create that page?


texts:
I installed magento 2 on my computer and I copied the   code of the theme in the app\design and pub\ that works on the server but it does not work properly on my computer.
Help


texts:
In product listing page (catalog/product/list.phtml) the toolbar.phtml is getting called, which is for two things.

For sorting option
For pagination

For pagination I have called $this->getPagerHtml() in the toolbar.phtml.
I want to display the sorting option before the product list (i.e. top) and the pagination in the bottom of the list.
So how to divide it in proper way so that I can call it at any location ?


texts: Is there a way to change the Shipping option of an order(already placed order) from the Backend

texts: Is there a way to change the Shipping option of an order(already placed order) from the Backed, ie change the Fedex option from Standard Overnight to Home Delivery.


texts: Unable to save blank multiselect value in system configuration in Magento 2

texts:
I have created multiselect in system.xml with backend_model and customize afterSave function and return parent::afterSave().

<field id="populatavailablebanknetbanking" translate="label" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Available Bank for Netbanking (Popular)</label>
    <source_model>Vendor\Module\Model\Config\Availablebanknetbanking</source_model>
    <backend_model>Vendor\Module\Model\Config\Backend\Popularbanknetbanking</backend_model>
    <comment>This selected depends on the Available Bank for Netbanking options. You can only select from the selection made above for the popular bank.</comment>
</field>

It's working fine with saving multiselect value in the database but when I unselect all the options from multiselect, it saves recently saved options from the database instead of clear the options from the database.


texts:
I have to get helped in some parts of my website with a friend who is a developer, so he asked me the access to the backend.

Being that I don't want to give the full access, I have created a new user and a new role just for him.

When I started to customize the resources, I have selected everything without the Permissions > User section.

And then came the issue: opening the backend with the new user, I don't see some sections. They just disappeared.

Going back to the resources tree, I discovered that they never been there, so I can't select the sections. But if I select Resource access > All, the sections are shown again in the left backend panel.

How do I solve this? Thanks in advance!

Edit:
These are some pics, as you can see if the admin has full roles I can see the Porto Icon (in this example)

But if I manage admin roles, putting custom and deflagging in that case the User permissions

I lose the Porto icon section, as you can see.

I think that probably it happens because when I choose "Select all" Magento selects all the sections - even the ones that I can't see in the Role Resources tree, so if I put "Custom" I am not able to select everything because I don't see some sections.


texts:
trying to have a go at magento 2, I have the latest PHP.

Error message:

  Vendor autoload is not found. Please run 'composer install' under application root directory

Where do you install composer, on the root of your server/in root magento directory or in the magento setup directory?


texts:
I have taken over a Magento 2 website and I have noticed quiet a few tables with no foreign keys e.g. a table is missing CONSTRAING 'CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID_STORE_ID' FOREIGN KEY ('store_id') REFERENCES 'store' ('store_id') ON DELETE CASCADE.

I haven't come across this issue before and I am not sure if simply adding the missing foreign keys back would fix all of the issues (assuming I could find all of the missing keys). I know there is a database repair tool for Magento 1.9 and I've seen one or two suggestions to run from the CLI the database scheme update. The keys have been missing for the last few months and quiet a few records would have been added/deleted since then.

I am a bit unsure how to start fixing this issue. Create blank magento site and import the current database data to it, or add the missing keys.


texts: What happens when I close the browser window during import?

texts: I'm having an issue due probably to the import interruption and I would like to know what might go wrong in order to handle it.


texts: How to Use Absolute Pricing for Custom Options Magento 1.9

texts:
Please open below link and check "Interested in Embroidery" checkbox.

http://superbuniforms.com/magento/medical-lab-coat-unisex-sky-blue.html

Some options will show which are product custom options. Here, two options have price "Logo Creation Fee" and "Embroidery Logo Charge". When I select all options and add to cart. On cart page, If I increase product quantity, all option's price increase with quantity. But I want that when product quantity increase, only "Embroidery Logo Charge ($35)" custom option is vary with quantity not "Logo Creation Fee($300)".

Example  : If product price is $50 and product have two custom options like- "Logo Creation Fee ($300)" and "Embroidery Logo Charge($35)". When we add product(quantity 1) in cart with both custom options (subtotal is $385).

Subtotal is: (product price ($50) + Logo Creation Fee ($300) + Embroidery Logo Charge($35)) * 1 = $385

Now, we increase product quantity (2) then subtotal is :

Subtotal is: (product price ($50) + Logo Creation Fee ($300) + Embroidery Logo Charge($35)) * 2 = $770

But I want to change in subtotal. I want subtotal like this :

Subtotal is: ((product price ($50) + Embroidery Logo Charge($35)) * 2) + Logo Creation Fee ($300) = $470 ($170 + $300)

"Logo Creation Fee ($300)" not vary with quantity, add only one quantity for one product.

Means Product's "Unit Price" display without custom option's price.

Reference URL (Opencart) : https://www.superbuniforms.com/hospital-uniforms/lab-coats/medical-lab-coat-women-sky-blue

Please add product with options and check cart.

Please suggest.


texts: Magento 2: Invalid customer attribute in collection filtering

texts:
I'm getting a strange error after filtering through customerFactory.

  Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid attribute name: is_active.

private function getCustomerDetails()
{
    $collection = $this->_customerFactory->create()->getCollection()
        ->addFieldToSelect('*')
        ->addAttributeToFilter('is_active', array('eq'=>'1'));
    return $collection->getSelect();
}

If I replace is_active with something else (e.g. lastname) then it works just fine. I googled a lot, but could not find a solution to this problem.

Any ideas :?


texts: Add button to bundle options in adminhtml with UI components

texts:
I seem to be unable to add a button to the bundle options in the product edit screen in the backend.

The goal ist to have a button before or after the option title (position is not really important).

I have tried to add a new button to this form using ui-components in XML and PHP. Here is my code:

XML

File:

app/code/[Vendor]/[Namespace]/view/adminhtml/ui_component/bundle_product_listing.xml

Code:

<?xml version="1.0" encoding="UTF-8"?>
    <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
        <listingToolbar name="listing_top">
            <argument name="data" xsi:type="array">
                <item name="buttons" xsi:type="array">
                    <item name="my_button" xsi:type="string">[Vendor]\[Namespace]\Block\Path\To\My\Button\Class</item>
                </item>
            </argument>
        </listingToolbar>
    </listing>

Result:
Nothing happens

PHP

File:

app/code/[Vendor]/[Namespace]/Plugin/Bundle/Ui/DataProvider/Product/Form/Modifier.php

Code:

<?php
namespace Vendor\Namespace\Plugin\Bundle\Ui\DataProvider\Product\Form\Modifier;

use Magento\Ui\Component\Form;
use Magento\Ui\Component\Control\Button;
use Magento\Ui\Component\Container;

class BundlePanelPlugin
{

    public function afterModifyMeta(\Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel $model, $result)
    {
        $result['bundle-items']['children']['bundle_options']['children']['record']['children']['product_bundle_container']['children']['option_info']['children']['copy_button']['arguments']['data']['config'] = [
            'component' => 'Magento_Ui/js/form/components/button',
            'title' => __('Do something please'),
            'label' => __('Do something please'),
            'sortOrder' => 1,
            'on_click' => 'alert("yep")',
            'formElement' => Container::NAME,
            'componentType' => Container::NAME,
            'provider' => null

        ];
        return $result;
    }
}

Result:

My plugin gets executed and adds the button to the page. However, it leads to a Javascript error saying knockout.js:3012 Uncaught ReferenceError: Unable to process binding "if: function (){return $data.label }".
I also tried to add 'actions' to the button, but that just led to another error.

Thanks for your time & help!


texts: Magento2 get Shipping Rates Programmatically

texts: Let me know how to get Shipping rates Programmatically, I tried with default collectrates(), Still it's not working.


texts:
I have installed and configured SSL correctly in magento 1.9 but https not loaded correctly in front-end though loading correctly back-end.

In front-end, it throws mixed content error. Please help me to solve this issue.


texts: Custom Edit Action in Customer Grid(Custom)

texts:
How can i link this Edit action to a custom block.

Code

   class  <Namespace>_<Module>_Block_Adminhtml_Stylist_Grid extends Mage_Adminhtml_Block_Customer_Grid
   {

     protected function _prepareCollection()
     {
     parent::_prepareCollection();
     $loginUserId = Mage::getSingleton('admin/session')->getUser()->getId();
     $collection = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('stylist_id', $loginUserId);
     $this->setCollection($collection);
     return $this; } }


texts: How can i create Product Link if click Items Ordered products from Order View

texts: How can i create products link, if i click Items Ordered Products in Order View, its go to products page in website. So, i can i view directly from Order View page.


texts: Save product textarea attribute without changing updated_at field?

texts:
I'm writing a script that will be run every hour to update a field of any product updated in the last hour. The script itself works, but it also updates the updated_at field upon saving the product.

After doing some research, I found that the best way to update the single field would be to use a direct sql statement to modify that single field.

So, I have the product id, the attribute id, and the new attribute value. The attribute uses a textarea as its input. I don't know which table to write the change to.

For example, if product_id is 1234 and attribute_id is 567, what would the sql statement look like? Something like this?

$val = "Some generated value.";
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = 'UPDATE `<insert table name here>` SET `value` = ? WHERE `entity_id` = ? AND `attribute_id` = ?';
$connection->query($sql, array($val, 1234, 567));

Also, is there some kind of reference for this sort of thing that I can look at in the future?


texts: show category list bellow single product page

texts:
I want to show products in same category withing  single product page.
see bellow diagram what i want to achieve

please see this site [https://www.jackthreads.com/goodale/shirts/rutledge-navywhite-plaid-shirt/products/170189][1] for more idea. i want to know how it achieve?


texts: I have about 20 transactional emails setup for the default store. I want to be able to duplicate the emails for a few multistores I have created and assign them to be sent to customers purchasing through the multistore. I am looking for a way to duplicate the current set of emails I have created and then changing the name of the email and modifying the logo. Is there an easy way to do this or am I going to have to do this the long way?


texts:
Have a cronjob in my extension config.xml file but seems do not run and function don't load

What is wrong here??

config.xml :

<?xml version="1.0"?>
<config>
    <global>
        <models>
            <mymodule>
                <class>Mycompany_Mymodule_Model</class>
            </mymodule>
        </models>
    </global>
    <crontab>
        <jobs>
            <mycompany_mymodule>
                <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
                <run><model>mymodule/observer::myFunction</model></run>
            </mycompany_mymodule>
        </jobs>
    </crontab>
</config>

And in Observer.php

public function myFunction()
    {
        ....
        ....
        ....
    }

Also added cron to server in Directadmin panel :

  */5 * * * * /usr/bin/wget -O /dev/null http://www.mydomain.com/cron.php

and

  */5 * * * * wget -q http://www.mydomain.com/cron.php

When I run cron.php from URL directly, it work and function load!


texts: Magento 2 getting error "Broken reference: The element with the "customer" ID wasn't found. Verify the ID and try again. [] []" in system.log

texts:
I am getting lots of

Broken reference: The element with the "customer" ID wasn't found. Verify the ID and try again. [] []

errors in the error.log. I've googled around and tried to trace it with NetBeans but I can't track down what's causing it. Everything seems to be working perfectly except this error is getting written repeatedly.

Has anyone any idea what's causing it or how I might track it down?

As some background, I migrated my site from 1.8.1 to 2.3 (and have since upgraded to 2.3.1 but the error started in 2.3). I wonder if something hasn't migrated correctly. Note it occurs in both developer and production mode.


texts: What's the correct way of having two different plugins for one method?

texts:
I have this afterGetList plugin in
Vendor\Module\Plugin\Magento\Sales\Model\OrderCompanyAccount.php
public function afterGetList(
        \Magento\Sales\Api\OrderRepositoryInterface $subject,
        $orders
    )
    {
        foreach ($orders->getItems() as $order) {
        //do stuff
        }
        return $orders;
    }

And in Vendor\Module\etc\webapi_rest\di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="\Magento\Sales\Api\OrderRepositoryInterface">
        <plugin name="order_repository" type="Vendor\Module\Plugin\Magento\Sales\Model\OrderCompanyAccount"
                disabled="false"
                sortOrder="200"/>
    </type>
</config>

I want to add another afterGetList plugin.
Vendor\Module\Plugin\Magento\Sales\Model\OrderComment.php
public function afterGetList(
        \Magento\Sales\Api\OrderRepositoryInterface $subject,
        $orders
    )
    {
        foreach ($orders->getItems() as $order) {
        //do other stuff
        }
        return $orders;
    }

And this time in Vendor\Module\etc\webapi_rest\di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="\Magento\Sales\Api\OrderComment">
        <plugin name="order_repository" type="Vendor\Module\Plugin\Magento\Sales\Model\OrderComment"
                disabled="false"
                sortOrder="210"/>
    </type>
</config>

If I enable one of these modules, they are working fine. However, if I enable both, none of them are working anymore. I tried with sortOrder but it has no effect.
So, my question is: How to have more than one afterGetList plugin enabled at the same time?
Or better asked: What's the correct way of having two different plugins for one method at all?


texts: getting error Object DOMDocument sould be created in magento 2

texts:
<?php

namespace Netzwelt\Winclosepopup\Block;

use Magento\Framework\View\Element\Template;

class Windowclosepopup extends Template { public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Netzwelt\Winclosepopup\Model\Grid $gridFactory,
    array $data = array() ) {
    $this->_modelFactory = $gridFactory;
    parent::__construct($context, $data); }

public function getCollection(){
    return $this->_modelFactory->create()->getCollection(); }
    /**
     * Get base url without store code
     */
    public function getBaseUrl() {
        return $this->_storeManager
                ->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
    }

    /**
     * Return  config value by key and store
     *
     * @param string $key
     * @param \Magento\Store\Model\Store|int|string $store
     * @return string|null
     */
    public function getConfig($key)
    {
        $result = $this->_scopeConfig->getValue($key,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        return $result;
    }
    }

This error is in line parent::__construct($context, $data);

Can anyone provide me the solution for this.


texts: Image thumbnail is not displaying when sharing product URL via inbox

texts:
When we share link for any product via inbox, image thumbnail is not rendered.

This is the screenshot about issue:
https://snipboard.io/AwDtXU.jpg
https://snipboard.io/85kFXW.jpg

Anyone help me this problem.
Thank you so much!


texts: After importing products into Magento, the categories aren't being checked

texts:
No products show up because the category isn't selected

I have removed all the extra nonsense and just added what I needed to.

Here is my csv file.  I have just been adding anything to the end to make this work.

sku,category,name,store,visibility,status,_attribute_set,attribute_set,_type,_root_category,websites,_product,type,qty,is_in_stock,product_type_id
56600,"Kayak / Paddle Sports",Bulk Stick On Fish Tape Measure,admin,"Catalog, Search",Enabled,Default,Default,simple,Catalog,base,base,simple,100,1,simple

I can check the category after uploading, but when uploading 100 or so products, this isn't going to be an option.  How do I ensure the category is selected?


texts: Writeable permissions error 777 | Magento 2

texts:
I am upgrading Magento 2, and all Readiness checks are passed after giving 777 permission to pub/meda, generated folder. But during upgrade process it stops throwing error of non-writeable folder for the same folders that I provided them permissions before upgrade starts. Infact, readiness check is not passed without these permissions. Then again I provide permissions and after some time it requires again permissions.

Can we give the permissions once until the upgrade process gets complete..

I am upgrading on local server. Using Docker Image for community edition and upgrading for enterprise edition.

Here is the command that I use for writeable conditions exactly:

  chmod -R 777 /var/www/html/generated/


texts:
Digging in magento core code I found some interesting code: https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php#L93

protected function createObject($type, $args)
{
    switch (count($args)) {
        case 1:
            return new $type($args[0]);
        case 2:
            return new $type($args[0], $args[1]);
        case 3:
            return new $type($args[0], $args[1], $args[2]);
        case 4:
            return new $type($args[0], $args[1], $args[2], $args[3]);
        case 5:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4]);
        case 6:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
        case 7:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]);
        case 8:
            return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7]);
        case 9:
            return new $type(
                $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]
            );
        case 10:
            return new $type(
                $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9]
            );
        case 11:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10]
            );
        case 12:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11]
            );
        case 13:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12]
            );
        case 14:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12],
                $args[13]
            );
        case 15:
            return new $type(
                $args[0],
                $args[1],
                $args[2],
                $args[3],
                $args[4],
                $args[5],
                $args[6],
                $args[7],
                $args[8],
                $args[9],
                $args[10],
                $args[11],
                $args[12],
                $args[13],
                $args[14]
            );
        default:
            $reflection = new \ReflectionClass($type);
            return $reflection->newInstanceArgs($args);
    }
}

What purpose for such awful code? Why can't we use reflection for less then 15 args like in default section?