texts: Overriding function from the modal.js file

texts:
How can I override a function from the modal.js file in the path vendor/magento/module-ui/view/base/web/js/modal/modal.js ?

In this file, line 307, is a function with name closeModal() that I want to overwrite in my module app/code/VendorName/ModuleName/view/frontend/web/js/model/modal.js

This is the original function:

 closeModal: function () {
            var that = this;

            this._removeKeyListener();
            this.options.isOpen = false;
            this.modal.one(this.options.transitionEvent, function () {
                that._close();
            });
            this.modal.removeClass(this.options.modalVisibleClass);

            if (!this.options.transitionEvent) {
                that._close();
            }

            return this.element;
        },

In my modal.js file I tried to write the following code so that the function is overwritten but unfortunately does not work.

define([
    'jquery',
    'Magento_Ui/js/modal/modal',
    'mage/translate'
], function ($, modal, $t) {
    'use strict';

    return {
        closeModal: function (element) {
            console.log("override works");
        }
    };
});

Can you tell me please where is wrong and how can I override this function?

Thank you!

UPDATE:

My requirejs-config.js has the following code:

var config = {
    map: {
        '*': {
            'Magento_Ui/web/js/modal/modal':'Bhavin_GDPR/js/view/modal/modal'
        }
    }
};

I create a file with name modal.js in the following path app/code/Bhavin/GDPR/view/frontend/web/js/view/modal/modal.js

Content modal.js

define([
    'jquery',
    'Magento_Ui/js/modal/modal',
    'mage/translate'
], function ($, modal, $t) {
    'use strict';

    return {
        closeModal: function (element) {
            console.log("override works");
        }
    };
});


texts: Create identical custom product options for thousands of products

texts:
I'm trying to recreate a custom image licensing site with Magento 2 and needs some advice in the proper way to structure the image license calculator. I need to recreate the functionality of the existing site like this page. Essentially this is several custom product options that affect the price of a downloadable product. The main difference is every option in the calculator applies to every product on the site. Also most options are dependent on which parent option is selected.

My question is how should I go about implementing this in Magento? I am very experienced with PHP development but not with Magento. My first inclination is to create a custom Modal with all the usages and how they affect the price than backend page for the CRUD operations on this modal. Then some sort of front end page which would read the options form the model and build the price that way.

Actually seems like a lot of work so I'd be very interested in existing modules paid or free that can do similar things. I'd also be very interested in which specific classes to extend to calculate the price and record the options in the cart. Also an example of a simple CRUD page for a custom module which uses Magento's UI and form components would be very helpful.

Thanks.


texts: Sorting by Rating when using Solr on product listing

texts:
We are using Solr on Magento Enterprise. We original had sort by rating working on the product listing page, when using normal Magento search, with a Modification we made, but it doesn't work when searching with Solr.

We can't find any good information out there on how to pass data like ratings over to Solr, so I figured to post and see if anyone has any experience passing custom data from a non product table over to Solr and associating that to product data.


texts: Problem with the shopping cart, adding an item on the frontend, makes the inventory on the backend turn zero

texts: This is a Magento 1.7, I need some help or hints on where to look to solve this issue please, on the frontend of the store I add an item to the shopping cart, it take a while and shows the product as Out of stock and "Cannot add the item to shopping cart.". I look in the backend for the product and the inventory shows number 0 and out of stock, even when a few mins ago there was plenty of items and in stock. Any ideas on where to find a solution please? thanks.


texts:
I am trying to begin developing two custom shipping methods for Magento but have become stuck.

I would like to create one for "Standard" delivery which will be calculated using Weight Vs Distance.

The second module will be "Priority processing" which will also be calculated using weight Vs distance but needs to have an additional charge.

I quess my question is are there any tutorials or skeleton modules that I can use for this? i have created custom methods in the past but I have never been able to add the ability to add an additional fee or calculate weight and distance as most are based on the "Flat fee" type of method.

I would be grateful for any tips and I will gladly share the module(s) once I get them working.


texts: Magento2 checkout page refresh gets blank and shows only "Estimate Shipping and Tax"

texts:
Hi guys when i am at the checkout page in the payment section and i refresh the browser the checkout page gets blank and only shows "Estimate Shipping and Tax".

i have checked the logs but nothing appears.

Please guys i really need help to get this fixed as we are waiting for this bug to get live.


texts: The site ahead contains malware Attackers currently on magento

texts: My Website is not working from 3 days boheco.org(magento version- 1.9.3.4)


texts: Magento Error after transferring onto a different computer localhost

texts:
after importing my magento project to a different localhost, i've received the following error:

There has been an error processing your request
Item (Mage_Core_Model_Store) with the same id "0" already exist

Trace:
#0 C:\xampp\htdocs\magento\lib\Varien\Data\Collection\Db.php(576): Varien_Data_Collection->addItem(Object(Mage_Core_Model_Store))
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Store\Collection.php(174): Varien_Data_Collection_Db->load(false, false)
#2 C:\xampp\htdocs\magento\lib\Varien\Data\Collection.php(752): Mage_Core_Model_Resource_Store_Collection->load()
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(635): Varien_Data_Collection->count()
#4 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(477): Mage_Core_Model_App->_initStores()
#5 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#6 C:\xampp\htdocs\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#7 C:\xampp\htdocs\magento\index.php(83): Mage::run('', 'store')
#8 {main}

i am not sure how to fix it, any help is much appreciated

database:

im not sure what value i should change

core_store:

INSERT INTO `core_store` (`store_id`, `code`, `website_id`, `group_id`, `name`, `sort_order`, `is_active`) VALUES
(0, 'admin', 0, 0, 'Admin', 0, 1),
(1, 'default', 1, 1, 'English', 0, 1),
(2, 'french', 1, 1, 'French', 0, 1),
(3, 'german', 1, 1, 'German', 0, 1);

core_store_group:

INSERT INTO `core_store_group` (`group_id`, `website_id`, `name`, `root_category_id`, `default_store_id`) VALUES
(0, 0, 'Default', 0, 0),
(1, 1, 'Demand Fitness', 2, 1);

core_website:

INSERT INTO `core_website` (`website_id`, `code`, `name`, `sort_order`, `default_group_id`, `is_default`, `is_staging`, `master_login`, `master_password`, `visibility`) VALUES
(0, 'admin', 'Admin', 0, 0, 0, 0, NULL, NULL, NULL),
(1, 'base', 'Main Website', 0, 1, 1, 0, NULL, NULL, NULL);


texts:
I'm trying to define constant in an helper of my module :

here's my Data.php :

class Data extends AbstractHelper
{
    const base = "my/url";

    public function getBase(){
        return $this->scopeConfig->getValue(
            self::base,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }

}

And my block, I create a function to get my constant :

public function getBaseAPIT(){
   return $this->_helper->getBase();
}

But the result of getBaseAPIT() is null. Where am I wrong ?

PS : to do this, I've follow that https://www.maximehuran.fr/creer-un-helper-sous-magento-2/


texts: How to disable the declared value on Fedex?

texts: When I estimate on Fedex website show a value, when I use my store is another. Seems like my store is using a declared value, how can I remove this?


texts:
I'm looking at creating a Magento based solution to detect bots, specifically on search forms.

I have a bot searching a very specific long tail string and it shows on the dashboard of admin as being searched around 4000 times.

Can I observe the search to limit or strip characters out of the search string before Magento processes it, or at least truncate the length of the query? I tried searching the query myself and it just crashes my session. No other users seem to be affected by it, but I'm sure there is a performance hit elsewhere on the system.

For now I've created a honeypot that renders on the template, then I detect it in index.php and simply kill the script. Trying to find a more bullet-proof solution. Any help is greatly appreciated.


texts: is it possible to create a popup contact form from a product button

texts:
How would I go about creating a simple popup from a 'view.phtml' on a product page that would popup 'form.phtml' from template/contacts.

I am trying to create a free quote button on a product page, so I would like the the form to have the basic contact form, but also have the submit email the address link that the user was left off on, or the product image.

Is this easily done? or is there a paid solution somewhere?

Thanks


texts: Add a class or id when changing the language magento 2.3.1

texts: pls help me! How to Add a class or id to html or body when changing the language magento 2


texts: Magento 2 Configurable product with multiple color swatches

texts: I'm creating a configurable product, each simple product has multiple colors, how can I create multiple swatches for each simple product of its configurable one?


texts: Magento 2 Speeding up apache response time

texts:
Hi i am customizing a magento theme Porto on my local machine. I am using wamp 2.4.23 on PHP 7.

Apache is working very slow and its taking 4-5 mins to load a single page. i have to develop the module that why i disabled the configuration and layout cache and set the mode to developer. any recommendation/suggestion regarding how i can speed up the apache server to run the magento 2 application on developer mode ?


texts:
I need to create form with fields
using Varien_Data_Form and Varien_Data_Form_Element_*

Filds of my form:

  name
  email
  firstname
  lastname
  password
  confirm_password

stucture my file
      webinse_test.loc  - my project folder

           -index.php   - magento file
            ...
            ... another magento files and folders...
            ...
            -Webinseform.php  - this is my form
            -Webinseprocess   - here are must be located all logic with
                                saving customer to db

Code in  Webinseform.php

<?php

include_once 'app/Mage.php';
Mage::init();
class Webinseform  {
public function _conctruct(){
        $form= new Varien_Data_Form(array(
    'id'=> 'webinseform',
    'action'=> $this->getUrl('webinse-test.loc/Webinseprocess.php',
                array('id'=> $this-    >getRequest()->getParam('id'))),
    'method'=> 'post',
    'enctype'=> 'multipart/form-data'));
        $form->addField('name','text', array('label'=>'Name'));
        $form->addField('email','text',array('label'=>'Email'));
        $form->addField('firstname','text',array('label'=>'Firstname'));
        $form->addField('lastname','text',array('label'=>'Lastname'));
        $form->addField('password','text',array('label'=>'Password'));
        $form->addField('confirm_password','text',array('label'=>'Confirm_password'));
        echo $form->toHtml();
}
}

when I enter the URL   http://webinse-test.loc/Webinseform.php   I do not see anything on the display.

Why? Where is form with fields? what am I doing wrong?

Can I create a form without creating a module? only form


texts: Programmatically adding images to products

texts:
I am trying to create a system which automatically creates a configurable product and creates and associates simple products to it.
It is all working well but a lot of the simple products will be using the same images, by using the following code :

$product->addImageToMediaGallery('/var/www/test.jpg', $mediaAttribute, false, false);

It duplicates the image which is not what I wanted so I tried to do it this way:

$mediaGalleryData['images'][] =   array(
        'file'     => 'filepath here located in media/catalog dir',
        'position' => 0,
        'label'    => 'label',
        'disabled' => 0
    );

    $product->setData($attrCode, $mediaGalleryData);
    $product->save();

This does add an image to the product but somehow the filepath is changed to the one I provide extended by '_1', resulting into referring to a non existent file..

Is there any way to do this without getting the automatically asigned '_1' at the end of the file path?

Thanks!


texts: How to call a social login block to header login popup in magento 2

texts:
I installed the social login extension, It works fine in registration page & registration page sign-in popup. But in others pages it's not displaying social logins block in sign-in popup. Here is the url for reference

Here is the xml layout file which was working in registration page

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Webkul_SocialSignup::css/socialsignup.css"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Webkul\SocialSignup\Block\Active" name="socialsignup_block">
                <action method="setTemplate" ifconfig="socialsignup/sociallogin/enabled" ifvalue="1">
                    <argument name="template" xsi:type="string">Webkul_SocialSignup::socialsignup/block.phtml</argument>
                </action>
            </block>
        </referenceContainer>
    </body>
</page>

Can anyone guide me how to call the social login block in popup for other pages too


texts: Attribute price should fetch on frontend on currency change

texts:
By default in magento for multiple currency a conversion factor is used to convert price to particular currency, But I want there should be three static price for three currency, attribute price should get fetched in front end when selecting a currency.

Please help

Thank You


texts:
I want to display 3 or more type of footer in my theme, but the condition via XML not working properly. If i select Footer Default ( condition 0 ) don't show anything, if i select Footer Type 1 ( condition 1 ) i see Footer Type 1. But if is select Footer Type 2, Footer Type 3, etc i see only Footer Type 1. The "condition" work only for 0 and 1, or for all value ( 0,1,2,3,4,etc ) ?

<action method="setTemplate" ifconfig="footer/footer_type" condition="0">
   <template>page/html/footer/footer_type_default.phtml</template>
</action>
<action method="setTemplate" ifconfig="footer/footer_type" condition="1">
   <template>page/html/footer_type_1.phtml</template>
</action>
<action method="setTemplate" ifconfig="footer/footer_type" condition="2">
   <template>page/html/footer_type_2.phtml</template>
</action>

New Helper/Data.php

<?php

    class ThemeAdmin_Helper_Data extends Mage_Core_Helper_Abstract
    {
        public function getTemplate()
            {
                $footerType = Mage::getStoreConfig('footer/footer_type');
                switch ($footerType) {
                    case 0:
                        return "page/html/footer_tp_1.phtml";
                        break;
                    case 1:
                        return "page/html/footer_tp_2.phtml";
                        break;
                    case 2:
                        return "page/html/footer_tp_3.phtml";
                        break;
                    default:
                        break;
                }

            }

    }

System.xml

<config>
    <tabs>
        <admin translate="label">
            Admin Theme
            <sort_order>00</sort_order>
        </admin>
    </tabs>
    <sections>
        <themeadmin translate="label">
            Theme Admin
            <tab>Admin</tab>
            <frontend_type>text</frontend_type>
            <sort_order>1000</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>

            <groups>

                        Footer
                        <frontend_type>text</frontend_type>
                        <sort_order>02</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                        <fields>

                            <footer_type translate="label">
                                Footer Type
                                <frontend_type>select</frontend_type>
                                <source_model>themeadmin/system_config_source_footer_select</source_model>
                                <sort_order>01</sort_order>
                                <show_in_default>1</show_in_default>
                                <show_in_website>1</show_in_website>
                                <show_in_store>1</show_in_store>
                            </footer_type>
                        <fields>

             </groups>
        </themeadmin>
    </sections>
</config>

Config.xml :

<helpers>
    <themeadmin>
        <class>Admin_ThemeAdmin_Helper</class>
    </themeadmin>
</helpers>


texts:
I am trying to get a secure url like this:

$this->storeManager->getStore()->getUrl('someurl', ['_secure' => 'true']);

I still get an insecure url with http://...

What am I doing wrong?


texts: Magento 2.1.3 : How can I add extension attributes to a product attribute?

texts:
I'm trying to add an extension attribute to a product attribute (\Magento\Catalog\Model\ResourceModel\Eav\Attribute). I've tried the documentations' examples and various articles on Magento Stack Exchange, but I can't get it to work.

Currently I have the following:

etc/extension_attributes.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="\Magento\Catalog\Api\Data\ProductAttributeInterface">
        <attribute code="additions" type="array"/>
    </extension_attributes>
</config>

Now if I understand it correctly, this should already return something other than NULL when I call $attribute->getExtensionAttributes() right? Because currently it doesn't, and I'm clueless to why.

I'm using an event to load additional data and put it into the extension attribute but with no success.

I've also tried applying it directly to the attribute class, rather than the interface, but with no success.

Does anyone has more experience with extension attributes?


texts: Magento2 : I want to get the Bundle Product Id from Bundle product detail page

texts:
I created a bundle product and when I try to get that Bundle product id on product detail page I am getting simple product id of that bundle product instead of Bundle product id.
I used this function to get bundle id but its giving all the parent bundle products id instead of current bundle product id :

    $model = \Magento\Framework\App\ObjectManager::getInstance()->get('\Magento\Bundle\Model\Product\Type');
    $product = $this->product;
    $parentIds = $model->getParentIdsByChild($product->getId());


texts: magento 2 swagger set in my staging server with my custom APIs

texts:
I tried to access swagger using the below URL:

[domainname]/swagger

  curl -X POST 'https://example.com/index.php/rest/V1/integration/admin/token' \
       -H 'Content-Type:application/json' \
       -d '{"username":"admin", "password":"admin123"}'

i get api_key and apply But still getting the below error

  500 : {"message":"Internal Error. Details are available in Magento log file. Report ID: webapi-59fb1f6faeb4d"}


texts: Override specific block in new order email

texts:
How are we supposed to override the "Payment method" info block in a new order email?
Overriding this payment info block in the email seems to be more complicated than doing it in other places around M2.

Thanks a lot for your answers.


texts: How to display products in expiry date ending before one month in Magento programmatically?

texts: I have created an expiry_date attribute in admin. I have chosen expiry date some products 31-12-2017.My requirement is expiry date ending before one month(30-11-2017) products display.I don't know how to implement this task.Can you please help me?


texts: Disable or hide Paypal on specific store view

texts:
I want to use Paypal on English store view but not on some other store view.

How to make disable or hide Paypal on specific store view?


texts: Magento 2 - Get Categories by Custom Category Attribute

texts:
In Magento2 - I've created a yes/no toggle category attribute named is_featured, its shown as "Homepage Category" in the screenshot below.

I'd like to be able to display (on the homepage cms page) all categories with this category attribute set to yes, I'd need to grab the category title, url, thumbnail etc, does anyone have any recommended steps on how to achieve this?


texts: Magento 2.3.2 Error XML declaration allowed only at the start of the document

texts:
I need for a programm to (webwinkelfacturen.nl) to read my taxrates so I can be pushed in an accountingsystem. But I am getting this error when I want to call domainname/ndex.php/rest/V1/taxRates

I am getting this error:

   This page contains the following errors: error on line 2 at
  column 6: XML declaration allowed only at the start of the
  document Below is a rendering of the page up to the first error.

The programm is using this to get the taxrates:

  https://www.bakmina.com/index.php/rest/V1/taxRates/search?searchCriteria%5Bpage_size%5D=100

And that gives the same error. What is this ? And how can I FIX it ?


texts: Magento 2: How can i auto update attribute value base on change of other attribute product admin?

texts:
I need to add an extra attribute in the product edit page but that attribute value auto fillup the same as SKU when updating the product name.

Please check the screenshot link: https://prnt.sc/qwuebe
Basically, I need an attribute the same as SKU which value is auto-filling base on the product name.

Any idea please share.


texts: Magento EE 1.14.4.4 Upgrade - Console error on Place Order in IE

texts:
We have upgraded our Magento EE 1.14.4.4.

After upgrade, Place order functionality not working as expected in IE 11. When we click the Place Order Button, It throws a console error review is not defined.


texts: magento bestseller block: product collection contains only old hardly ever sold products

texts:
We are creating a bestseller block and use the code below. With the code below we get a nice list of products. The only problem is that many of these products are either very old - and hardly ever sold. It almost seems that, either:

a. reports/product_collection contains very old, not actual data

b. the results are sorted the wrong way around (doesn't seem so)

c. something else? UPDATE: it seems the output is SIMPLE producs only - and we sell configurable products in our fashion store. This is why only some products are showing: these are the only simple products we have.

question: How can we get the 'real' bestsellers in the code below?

help appreciated (Magento 1.9.2.4)

public function getCollection()
{
    $storeId = Mage::app()->getStore()->getId();
    $collection = Mage::getResourceModel('reports/product_collection')
        ->addOrderedQty()
        ->setStoreId($storeId)
        ->addStoreFilter($storeId)
        ->setOrder('ordered_qty', 'desc');

    if (Mage::helper('catalog/product_flat')->isEnabled()) {
        $collection->getSelect()
            ->joinInner(array('e2' => 'catalog_product_flat_' . $storeId), 'e2.entity_id = e.entity_id');
    } else {
        $collection->addAttributeToSelect('*')
            ->addAttributeToSelect(array('name', 'price', 'small_image'));
    }

    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
    Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);

    $_limit = (int)$this->getLimit() ?: 3;
    $collection->setPage(1, $_limit);
    return $collection;
}


texts: Magento 1.9.2 get customer address using soap api

texts:
following is my code

$client = new SoapClient('My api url');
$session = $client->login('username', '*********');
$result = $client->customerAddressInfo($session, $address_id);

Following is the error

Uncaught SoapFault exception: [102] Address not exists.

Can anyone explain where am i going wrong.


texts: Magento 2 : Customer Edit Shows Double Links After Upgrade

texts:
After upgrade my magento2 from Magento 2.1.7 to latest version Magento 2.3.5, when I go to admin customer edit page that shows all links double.
Does anyone have idea how i can solve this issue.


texts: String "none" in the small description - Luma Theme

texts: I noticed this string in the small description. This "nessuno" string is seen only in Italian view while for other views it does not go out. How can I remove it? What is this string?


texts: If the primary magento site folder is deleted and replaced with a backup will there be any issues?

texts:
I need to completely restore my magento 2 folder using a local backup I have. Will I face any issues if I completely remove the magento 2 folder on the server and reupload the backup folder to replace it?

What is the best way to go about doing this?


texts:
I'm interested in creating an accordion layout just like the main system configuration pages. This means I want to have sections which you can expand vertically and then see its content, basically the same as in the System > Configuration page, but on a different page of course and with my own content.

What I have:

the page in the backend
an accordion block with child elements but without content

What I need to know:

what is the standard way of creating content for the accordion block compareable to the system > config page (a descriptor on the left and a content field on the right, depending on the type of content needed)?

Any help is greatly appreciated!


texts: getTierPriceHtml of Product without loading it entirely

texts:
I have a page where where I am trying to show the tier pricing block for multiple products

I am currently loading the tierpricehtml for each product using this code...

<?php
    $loadedChild = Mage::getModel('catalog/product')->load($childId);
        if ($loadedChild->getTierPrice()){
            echo $this->getTierPriceHtml($loadedChild)
        }
?>

The issue is I have many options / customizations so loading a product entirely using the catalog/product model is very slow.  It adds about a second of load time.

Is there any way that I can use ->getTierPriceHtml with only a productID? My only other hope besides finding a way to use it without loading the product is to rip the functionality straight from tierprices.phtml and put it in my template but that feels wrong.


texts:
I noticed all of a sudden that any operation that has to do with sending email on my site returns with 504 server timeout page. Fortunately, the email gets sent but returns a 504 error.
I went further to create a php script in the root of my application just to send email
<?php
try{
    mail('name@email.com', 'Testing Magento mail', 'Hello user. Did you get the mail?');
    echo 'Mail sent';
}catch(Exception $e){
    echo $e->getMessage();
}

but got the same effect of timeout.
Mails were going fine prior to today and nothing was changed on the server.
What could be wrong?


texts: How to show related queries on a query page?

texts:
I am a bit new to Magento but I already have a question and I couldn't find an answer anywhere on Internet (crazy, isn't it? :))

So here's my question:

I'm on a magento given website and I search for this word: "shirts"

I already know that inside the queries db I already have related query strings similar to the one above like: blue shirts, wide collar shirts, etc.

I would like to display on the search results page for "shirts" similar search queries to this from the db with a custom link like: $link = "http://www.website.com/catalogsearch/result/?q=".$query_text;

This is useful for SEO so that a given query would pass link juice to other let's say 5 similar queries, based on the fact that google loves relevancy. So shirts would show links to blue shirts, wide collar shirts, etc.

Can this be done inside the search results sidebar or result.phtml ?


texts:
How to display estimated delivery date in order email template in Magento-2.3.5
Exp: "Wed, December 2nd, 2020 - Fri, December 4th, 2020" like this


texts: Allowing users to upload images they want on the product at checkout

texts:
With the Magento site being built, users need to be able to upload their selected images for graphics on the product.

I need to be able to offer, on checkout, an upload option which they can select how many images to upload and leave information. These images then need to go into a folder relating to the order ID so the client can go to that folder for the images.


texts: Breakdown discount at checkout cart and order summary

texts:
I have 2 applied discount, but at checkout cart and order summary it only shows one discount name with the total of the discount

How can I breakdown the discount, so it will show each discount name and total?


texts: where and when will it call email order_new.html file

texts:
My Simple question is:
When and where call this order_new.html file in core file ?

this file in app/locale/en_US/template/email/sales/order_new.html

 {{layout handle="sales_email_order_items" order=$order}}

If call order_new.phtml file then it automatically call this above handle ?

this code located in app/design/frontend/base/default/layout/sales.xml

   <!--
    Email layouts section
    -->
        <sales_email_order_items>
            <block type="sales/order_email_items" name="items" template="email/order/items.phtml">
                <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
                <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
                    <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
                    <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
                    <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
                        <action method="setIsPlaneMode"><value>1</value></action>
                    </block>
                </block>
            </block>
            <block type="core/text_list" name="additional.product.info" />
        </sales_email_order_items>


texts: Does Mage::app()->cleanCache(); clear Magento Enterprise FPC?

texts:
Does Mage::app()->cleanCache(); functionality clear Magento Enterprise Full Page Cache too or does another function/method have to be setup in our cache.php script? Here is what is in the script currently.

<?php
require_once '/home/website/website.com/html/app/Mage.php';
Mage::app()->cleanCache();
?>


texts: I'm unable to upload product images on upload if I inspect developer tool I get 404 on /media/catalog/product/b/s/website_draft_160204-2_11.jpg Failed to load resource: the server responded with a status of 404 (Not Found)


texts: MessageManager messages get lost for registration/login forms

texts:
Magento version: 2.1.8, problem occurred also in 2.1.5

Basically the problem is:

I try to create a new account on the default /customer/account/create/ page
I input an email with invalid TLD (example@email.invalid)
the validation throws an exception because it's invalid, it gets caught in Magento\Customer\Controller\Account\CreatePost.php and the message is added to the _$messageManager_
after the redirect there's no messages

Until the return of the execute method the message is inside the $messageManager but after that it gets lost somewhere because I don't receive it on the frontend.

To try and debug, I injected the messageManager into the Register.php block, created a function to retrieve messages as such

public function getMessages()
{
    $messages = array();
    $collection = $this->messageManager->getMessages(true);
    if ($collection && $collection->getItems()) {
        foreach ($collection->getItems() as $message) {
            $messages[] = $message->getText();
        }
    }
    return $messages;
}

and then I print it in the form (in register.phtml)

echo print_r($block->getMessages(), true);

but it's always an empty array

I am using a custom template, but I also tried with the default one and still same situation and all the backend part is default, so I believe the problem is somewhere in Magento.

I also added

<referenceContainer name="page.messages">
    <block class="Magento\Framework\View\Element\Template" name="ajax.message.placeholder" template="Magento_Theme::html/messages.phtml"/>
    <block class="Magento\Framework\View\Element\Messages" name="messages" as="messages" template="Magento_Theme::messages.phtml"/>
</referenceContainer>

to the customer_account_create.xml layout, but of course doesn't work if there are no messages. Simply adding this to other pages inside the site works fine


texts:
I am starting the development of a new custom theme for Magento 2.1.x. I would like to commit on my git repository only the files related to the theme and to the custom module which I will create for this theme, not the entire Magento project.

This because at certain point a colleague of mine will install a new copy of Magento 2.1.X locally in his machine and pulling from our shared git repo.He will also contribute to the development of the theme.

The .gitignore file shipped with Magento CE 2.1.X works for the purpose I just described or do I need to add some other directories/files to the .gitignore?

Please suggest for using Git.


texts: What Programmatically Triggers Magento 2's Shipping Rates to Update

texts:
When you're filling out the Shipping Address form in Magento 2, periodically Magento will make an ajax request for the URL

http://magento.example.com/rest/default/V1/guest-carts/[hash]/estimate-shipping-methods

and use this data to update the shipping methods section of the UI.

Programmatically speaking, which RequireJS modules setup the events and/or Knockout observables or data-bindings that enable this functionality.   Tracing backwards through the code from the URL manager

#File: vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js
        getUrlForEstimationShippingMethodsForNewAddress: function(quote) {
            var params = (this.getCheckoutMethod() == 'guest') ? {quoteId: quote.getQuoteId()} : {};
            var urls = {
                'guest': '/guest-carts/:quoteId/estimate-shipping-methods',
                'customer': '/carts/mine/estimate-shipping-methods'
            };
            return this.getUrl(urls, params);
        },

has branched too many times for this to be an easy thing to figure out.  I'm hoping someone here already has the solution in hand.


texts: Magento-2 : How to display custom field just after payment method list and save on place order

texts:
I want to display one text area, just after payment method list, on checkout page.

Text area value should be saved on place order.
Saved value also need to be displayed in Admin >> sales >> order >> view >> payment method.

In which table should I add the custom columns, so the values can be  easily displayed on the admin-side.

UPDATE

I have displayed text-area to checkout step, How to save value on place order?

Thanks


texts: Extension_attribute value save in DB in magento 2

texts:
I am using Magento 2.3.4, and i created custom attibute in quote_item 'up_flag'. and throgh rest api i am passing the value of "up_flag":
Post request Body for V1/carts/mine/items:
{"cartItem": {"sku": "xxxx", "qty": "1", "quote_id": 28981,"up_flag": "1"}}

and i am getting the error "Message: Property "UpFlag" does not have accessor method"
or if i try through Extension attribute method like:
{"cartItem": {"sku": "xxxx", "qty": "1", "quote_id": 28975,
"extension_attributes": {

  "up_flag": "1"
}

 }}

And Plugins Code:
public function afterGet(
    CartRepositoryInterface $subject,
    CartInterface $resultEntity
) {

    //$logger->info(print_r($result->getProductId()));

     foreach ($resultEntity->getItems() as $item) {

    $extensionAttributes = $item->getExtensionAttributes();

    if (!$extensionAttributes) {
        $extensionAttributes = $this->totalsItemExtensionInterfaceFactory->create();
    }

    $getupflag = $extensionAttributes->getUpFlag();

    $extensionAttributes->setUpFlag($getupflag);

   $item->setExtensionAttributes($extensionAttributes);

}

    return $resultEntity;
}

Response in Postman:
NULL
NULL
string(1) "1"
NULL
string(1) "1"
{
"item_id": 5222,
"sku": "PGKFMT1",
"qty": 9,
"name": "XXXXX",
"price": 237.29,
"product_type": "simple",
"quote_id": "28981",
"extension_attributes": {
    "discounts": [
        {
            "discount_data": {
                "amount": 126,
                "base_amount": 126,
                "original_amount": 135,
                "base_original_amount": 135
            },
            "rule_label": "5% discount for prepaid",
            "rule_id": 20
        },
        {
            "discount_data": {
                "amount": 239.4,
                "base_amount": 239.4,
                "original_amount": 257.4,
                "base_original_amount": 257.4
            },
            "rule_label": "discount",
            "rule_id": 6
        }
    ],
    "image_url": "http://localhost/default/pub/static/version1604919926/webapi_rest/_view/en_US/Magento_Catalog/images/product/placeholder/.jpg"
}
  }

Now i always getting first the value fo $getupflag = Null and its not showing in response. even  how i can save "up_flag" value in DB?


texts: Store Logo Protection - How is this website doing it?

texts:
https://uk.rs-online.com/web/

If you right click the RS logo there is no 'save image as'. I'd like to do the same on my Magento 2.2 site. Is it some js magic? I can't pick up what CMS they're using but it looks like Magento to me.


texts: How to get order collection filter with customer_is_guest and email (Magento 2)

texts:
How to get order id from collection with filter customer_is_guest = 1 and customer email

$order_collection = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->addAttributeToFilter('customer_email', $customer_email)->addAttributeToFilter('customer_is_guest',1);

Above code will give me order collection. How to only get order id/ids


texts: Cash on delivery payment method should visible only for some zip codes magento module

texts: How to make magento module for Cash on delivery payment method should visible only for some zip codes/pin codes and it can be check in product page also.


texts: Custom Shipping Method - Retrieve Shipping address in collectRates

texts:
I'm currently working on a custom shipping method for Magento 2 and I'm facing a problem : I don't know how to retrieve the shipping address.

I tried first with something like this in the collectRates method :

$city = $request->getDestCity();
$street = $request->getDestStreet();

But it didn't worked ($city and $street are empty).

That's strange because I don't have any issue whit the getDestPostcode() method.

Is there a another way to retrieve the shipping address ?

Thanks.


texts: Magento 2 Ups shipping method for Germany origin country?

texts:
I am trying to enable Magento 2 default UPS shipping methods for Germany origin country but I am getting an error as UPSOnLine5%Unsupported country specified%6920. Please check this screenshot

Is there anyone who has enabled Magento 2 UPS shipping methods for Germany Origin Country then can you please guide me?


texts: How to connect Magento different instances to a central database in an development environment

texts:
We have Magento community edition in our office. The DB server is separate ; we would like to connect a single Magento DB  to multiple instances on separate machines (within LAN network)
Currently each developer has to get a separate DB on his own machine
Any suggestions?


texts: so when I click on Register on my site, it leads me to a registration page. And some of the things there are in English (I would like them translated). But I don't see this page in Pages in CMS in Magento. Where can I find this page to edit it? Is there a place where the rest of the pages is, like when you try to order something and you go through the shipping and so on? Where can I find these?


texts: Adding customer account layout to custom page

texts:
I add new link to customer account sidebar like in the image below.

Customer account sidebar :

And i create new page for Reset Employee Password link, and it's done like in the image below.

Custom page :

Then, my question is, how can i made my custom page like in the customer account page? (There's sidebar, and other things). Or for example, like in image below.

Example :


texts: magento 1 domain name change causes COrS errors and site breaks

texts:
I have two magento 1 sites on separate servers - this is doubltless the wrong way to have gone about doing this and i'm still on a (steep) learning curve with changin themes in M1
https://www.petrolthreads.co.uk  (old site) (M1 1.9.2.1 php5.6)
https://www.petrolmugs.com (development/new site M1 192.4.2  php7.2)
they both work just fine - old site is slow and, well, old and the new site is ready to replace the old site so this is what I've done:-

changed the domain for the whm/cpanel account for petrolmugs to petrolthreads.co.uk

edited the base-urls in the cor_config_data table to be http://www.petrolthreads.co.uk/ and https://www.petrolthreads.co.uk/ for unsecure and secure respectively.

pointed the petrolthreads.co.uk dns to the new server.

i can browse to the new site via petrolthreads.co.uk but the site doesn't work - it has lots of CORS errors (for fonts) and 404 not found (for the slider) and the currency switch stops working.
I have no idea where to look and any suggestions/help would be appreciated. images show the problems - i've undone my doings and sites are back to working now.


texts: Adding Custom PHTML file in List.phtml (Category View)

texts:
I have a custom PHTML file

custom_theme/default/template/catalog/product/colors.phtml

I have edited

custom_theme/default/layout/catalog.xml

I have added

<block type="catalog/product_colors" name="colors" template="catalog/product/colors.phtml"/>

Right under list.phtml as follows

<reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
            <block type="catalog/product_colors" name="colors" template="catalog/product/colors.phtml"/>

I have added

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

to

custom_theme/default/template/catalog/product/list.phtml

Nothing is showing on the category page.

What am I doing wrong?


texts: Add static prefix to the product and category url

texts:
I have followed this tutorial Add a static URL prefix for product and category Magento 2

to create custom prefix for my store but i dont know why this is not working in my case

I am sharing all the details here :

etc/di.xml

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

    <preference for="Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator" type="Demo\Mod\Model\CatalogUrlRewrite\ProductUrlPathGenerator"/>

    <type name="Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator">
      <plugin name="my_category_url_path_generator" type="Demo\Mod\Plugin\Model\CategoryUrlPathGenerator" sortOrder="15"/>
    </type>

  </config>

/Model/Model\CatalogUrlRewrite\ProductUrlPathGenerator.php

<?php
    namespace Demo\Mod\Model\CatalogUrlRewrite;

    class ProductUrlPathGenerator extends \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator
    {

        // CHANGE THESE FOR CUSTOM STATIC PREFIX ROUTE of PRODUCT and PRODUCT CATEGORY
        const PRODUCT_PREFIX_ROUTE = 'product';
        const CATEGORY_PREFIX_ROUTE = 'product-category';
        public function __construct(
            \Magento\Store\Model\StoreManagerInterface $storeManager,
            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
            \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator $categoryUrlPathGenerator,
            \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
        ) {
            parent::__construct($storeManager, $scopeConfig, $categoryUrlPathGenerator, $productRepository);
        }

        public function getUrlPath($product, $category = null)
        {
            $path = $product->getData('url_path');
            if ($path === null) {
                $path = $product->getUrlKey()
                    ? $this->prepareProductUrlKey($product)
                    : $this->prepareProductDefaultUrlKey($product);
            }

            if ($category !== null) {
                $categoryUrl = str_replace(self::CATEGORY_PREFIX_ROUTE .'/','',$this->categoryUrlPathGenerator->getUrlPath($category));
                $path = $categoryUrl . '/' . $path;
            }

            return self::PRODUCT_PREFIX_ROUTE . '/' . $path;
        }
    }

\Plugin\Model\CategoryUrlPathGenerator.php

<?php
namespace Demo\Mod\Plugin\Model;

class CategoryUrlPathGenerator
{

    public function afterGetUrlPath(\Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator $subject, $path)
    {
        if (strpos($path, \Demo\Mod\Model\CatalogUrlRewrite\ProductUrlPathGenerator::CATEGORY_PREFIX_ROUTE) === false)
            $path = \Demo\Mod\Model\CatalogUrlRewrite\ProductUrlPathGenerator::CATEGORY_PREFIX_ROUTE . $path;

        return $path;
    }
}

also i want to remove .html from url end.
can i get some help here thanks in advance


texts: Trying to fetch the discount and tax amount item-wise: Magento 2

texts:
I am facing issue when we add configurable product of virtual item. The price, tax and discount shows in parent item only.

How can I fetch that for child?

foreach ($order->getAllVisibleItems() as $itemv)
{
    $itemid = $itemv->getProductId();
    $DiscountRate = $itemv->getDiscountAmount();
    $UnitTax = $itemv->getTaxAmount();
    $price = $product_data->getPrice();
}


texts: How to move reviews tab to the last in Magento 2?

texts: I have a problem moving this reviews tab to the last. Sorry I'm new to magento 2. I did all my best searching the web for solutions. but I was hoping someone can help me here.


texts: Magento 2 - quick installing host or scripts with sample data

texts:
I need to quickly setup 3 different Magento 2 demo sites with sample data.

After trying:

DigitalOcean, Justhost, Ampps and Mamp and having installation problems with all of them, I've decided to look for either an installer script that will install Magento 2 with sample data or a host or software or something that I can just run and it installs Magento 2 with the sample data or something that I can use as after weeks of nightmares I'm about to just give up on Magento 2.

Any advises on my options?


texts:
I'm currently running a Magento store version 2.3.0 and trying to upgrade it to version 2.3.2.

If I try to update on the Magento admin I receive the message bad credentials after entering the access keys. I believe the keys are correct.

And, if I try the update on the CLI when I run composer update command I get the 'Killed' message.

I've read that the killed message can occur if the server runs out of memory.

Our Magento store is hosted on a remote server which package includes unlimited SSD disk space and 2GB of RAM.

Any suggestions?


texts: Only index.php shows up through proxy pass

texts:
<Directory "/Users/pathto/Sites/">
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>

<VirtualHost *:80>
  ServerName developersite.dev
  ServerAlias developersite.dev
  DocumentRoot "/Users/pathto/Sites/app/"
  ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9070/Users/pathto/Sites/app/$1
  DirectoryIndex /index.php index.php
</VirtualHost>

I'm having trouble viewing any page on my Magento 2 site outside of the main page.  Everything shows up fine on index.php(images, cms details etc).  When I go to any other page I get a message saying the requested URL was not found on server.

Not Found The requested URL /catalogsearch/result/ was not found on this server.

I'm using php70 and httpd with homebrew.  My httpd.conf has the proxy_fcgi_module uncommented, as well as rewrite_module.

My working theory is that the proxy is only handling the index.php site - not any other iterations of that. Any suggested issues with how to resolve or insights on where to look would be great.  Thanks.

UPDATE

I have discovered that if I go to developersite.dev/catalogsearch/result/ I get the error as described above.  However if I go to developersite.dev/index.php/catalogsearch/result/ -- it works.  I still am not sure how to work around this problem.  web/seo/use_rewrites are set to YES.


texts: Generate xml file of all products fields in Magento2 programmatically

texts:
I need to Generate XML file of all products fields in Magento2 programmatically.

How it possible? please advise


texts: How to call the getId() function on an instantiated resource Model

texts:
this is how i used to get an Id from a model:
 /** @var \Top\ExampleModule\Model\example $object */

 $object = $this->modelFactory->create()->load(1,'custom_field');

$object->getId()

I am aware that the load method of the model will be deprecated.
I understand that the correct way to load is to use the Resource Model. My issue however is that the resourceModel does not have  getData() or getId() methods.
How then can I get the Id of the instantiated model if there is no
$this->getId() method.
This is how I now call it:
/** @var \Top\ExampleModule\Model\example $object */
$model = $this->modelFactory->create();
$object =  $this->viewResource->load($model, $id,'custom_field');

$object->getId()


texts: Magento 2 custom cron job is not getting scheduled

texts:
I am adding custom Cron job but it is not getting scheduled even after I run:php bin/magento cron:run.
and I have also tried with Cron custom groups and ran by command still not getting generated in cron_schedule table, Please help.
thanks in advance.


texts: Magento 2: specify jquery version for external js library

texts:
I'm trying to use a jquery plugin for a flipbook on magento 2 but it's not working with my version of jquery.
On magento 2 i'm using v1.12.4 and the jquery plugin is using v1.11.0.

Is there a way to specify which version of jquery is required?

thanks!


texts: How to use same image for configurable and simple product?

texts: When a image is selected to be displayed for configurable product it is saved (xyz.png)  in the media. Now when I select the same image for another simple product It is getting saved in media with different name ( as xyz(1).png ). Like this way it is takin more amount of space in magento media.I want to use same image for a configurable product and simple product. What should be done for that?


texts: Magento 2 : Extending layout xml wont work

texts:
I'm struggling to extend some layout XML.

I want to add a custom subs.phtml o=in catalog_category_view.xml.

I created app/design/frontend/Template/Template/Magento_Catalog, modifications in templates folder work fine but I can't change anything in the layout folder.

I created catalog_category_view.xml and added this:

<block class="Magento\Catalog\Block\Category\View" name="category.subs" template="Magento_Catalog::category/subs.phtml"></block>

But it is not working.

I created another file in layout/override/base/catalog_category_view.xml
but it removes every phtml from the template.

Thanks for the help.


texts: Magento 2 How to close Dropdown Dialog on click

texts:
I have added dropdown dialog using bellow code
<div class="block block-demo-dialog empty"
     data-role="dropdownDialog"
     data-mage-init='{"dropdownDialog":{
        "appendTo":"[data-block=demo-dialog]",
        "triggerTarget":".showdialog",
        "timeout": "2000",
        "closeOnMouseLeave": false,
        "closeOnEscape": true,
        "triggerClass":"active",
        "parentClass":"active",
        "buttons":[{"text":"x","class":"close-dialog-popup","click":"close"}]}}'>

using above code dialog popup, not opening ... if I removed buttons content

("buttons":[{"text":"x","class":"close-dialog-popup","click":"close"}])

then all working but I want Close Button using data-mage-init anyone has an idea how to use buttons with data-mage-init.


texts: Setting Custom Session in index.php - Problems

texts:
Creating a custom session in a store view's index.php in a subdirectory of the main magento installion.

The code I added is as follows:

require_once $mageFilename;
Mage::init();
Mage::getSingleton('core/session')->setRefer("access");
$refer = Mage::getSingleton('core/session')->getRefer();
echo $refer;

I added the code under require_once $mageFilename; in index.php otherwise I would get Mage errors.

I want to use the session for something more complex but I can't get even this basic code to work!

This causes the mantenance page to display for some reason with access echod at the top of the page. Maintenance displays even when I take out the code which displays the maintenence page inside the index.php.

Any advice is greatly appreciated!

EDIT1:

When moving my code to bottom of file:

$mageRunCode = 'mystore';
$mageRunType = 'store';
Mage::run($mageRunCode, $mageRunType);
Mage::getSingleton('core/session')->setRefer("denied");
$refer = Mage::getSingleton('core/session')->getRefer();
if($refer == "access") {
}else{
    include_once 'XXXXXXXXX/503.php';
    exit;
}

This makes my store view appear and then stacks the maintenance page below it!


texts: I've successfully created a magento 2 module with custom payment method using mage2gen.com, the problem is i need to show dynamic payment information at order email and pdf. I try check the app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php turns out the $transport['payment_html'] is being rendered by block layout in app/code/Magento/Payment/Helper/Data.php but i don't know how to define this payment information block layout for email in my custom module


texts: Get the email address from the identity name

texts:
I have a special form that when filled needs to send a notification mail to the admin. I used a system.xml to have it selected and stored in the database :

    <field id="identity" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
        <label>Sender</label>
        <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model>
    </field>

Then I can retrieve it like that :

    $this->scopeConfig->getValue(
            'mysection/mygroup/identity',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        )

And I get e.g. the string "Sales" that correspond to the entry in vendor/magento/module-email/etc/config.xml :

    <trans_email>
        ...
        <ident_sales>
            <email>sales@example.com</email>
            <name>Sales</name>
        </ident_sales>
        ...
    </trans_email>

Is there a way to easily retrieve the email corresponding to the name ?

In the example, I told "Sales" but it can be changed as there is a dropdown so I need to be able to map the name to the email rather that hardcode the sales email address.


texts:
I am using Marketplace in My Website i used to delete product from order

public function deleteproductAction()
{
    $order_id = $this->getRequest()->getParam('order_id');
    $product_id = $this->getRequest()->getParam('product_id');

     $_order = Mage::getModel('sales/order')->load($order_id);
     $items = $_order->getAllItems();
     $updateQty = 0;
     foreach ($items as $item){
        $base_grand_total = $_order->getBaseGrandTotal();
        $base_subtotal = $_order->getBaseSubtotal();
        $base_tva = $_order->getBaseTaxAmount();
        $grand_total = $_order->getGrandTotal();

        $subtotal = $_order->getSubtotal();
        $tva = $_order->getTaxAmount();

        $base_subtotal_incl_tax = $_order->getBaseSubtotalInclTax();

        $subtotal_incl_tax = $_order->getSubtotalInclTax();

        $total_item_count = $_order->getTotalItemCount();

        if($item->getProductId()==$product_id){
            $marketplaceSales = Mage::getModel('marketplace/saleslist')->getCollection()
                ->addFieldToFilter('mageproid',$product_id)
                ->addFieldToFilter('mageorderid',$_order->getId());

            $item_price = $item->getPrice();
            $item_tva = $item->getTaxAmount();
            $item->delete();
            $updateQty =  $updateQty+1;
            if($id = $marketplaceSales->getFirstItem()->getAutoid()) {
                $saleslist = Mage::getModel('marketplace/saleslist')->load($id);
                $saleslist->delete();
            }

            $_order->setBaseGrandTotal($base_grand_total-$item_price-$item_tva);
            $_order->setBaseSubtotal($base_subtotal-$item_price);
            $_order->setBaseTaxAmount($base_tva-$item_tva);
            $_order->setGrandTotal($grand_total-$item_price-$item_tva);
            $_order->setSubtotal($subtotal-$item_price);
            $_order->setTaxAmount($tva-$item_tva);
            $_order->setBaseSubtotalInclTax($base_subtotal_incl_tax-$item_price);
            $_order->setSubtotalInclTax($subtotal_incl_tax-$item_price);
            $_order->setTotalItemCount(count($items)-1);
            $_order->save();
        }
        }

    $orderModel = Mage::getModel('sales/order')->load($_order->getId());
    $orderModel->setTotalQtyOrdered($orderModel->getTotalQtyOrdered()-$updateQty);
    $orderModel->setBaseTotalQtyOrdered($orderModel->getBaseTotalQtyOrdered()-$updateQty);
    $orderModel->save();

Mage::getSingleton('adminhtml/session')
                           ->addSuccess('Order Updated Successfully');
        $this->_redirect('adminhtml/sales_order/view', array('order_id' => $_order->getId()));
}

Let us Assume I have 1 order that order contain 2 Seller Product assume Seller A & Seller B  I delete Seller B product after that i go to Seller A Dashboard i try to process order but i can't process because that seller B order id Store Some where how to find that in Database there is no table i cross checked.


texts: jquery plugin error "Uncaught TypeError: $(...).[plugin function] is not a function"

texts:
I am using Magento 2.2.6 and I am trying to include a jquery plugin (stickybits, in this case). The jquery plugin file is successfully called in my requirejs-config.js file and I can see that the file is correctly loaded in the head

When I try to call the particular plugin in my standard js file where I call many other jquery functions, I get the error:

  Uncaught TypeError: $(...).stickybits is not a function

This does not even seem to be a jquery issue as I cannot even call the regular js version of that function and I get the error:

  Uncaught ReferenceError: stickybits is not defined

I have tried clearing the caches but it did not help.


texts: Magento 2 Catalog search result customize

texts:
I am facing one issue in catalog search in Magento 2.2.2
I have one attribute called custom_name and value is like 'n12-n13-n15'. This attribute is searchable and if  I search this in quick search then Magento consider it as a separate value like 'n12' and 'n13' and 'n15'.

Is there anyway so that I can prevent Magento to explode this string with '-'?

edit :
Can I achieve this for specific(SKU) attribute?


texts: magento2 add display default value for column on admin grid

texts:
I have created a custom module to display the sale product details.
The columns are as follow, Product_id, name, quantity and Status.
I got the output.

My question is,
I need to display completed order details by default but now it's displaying the pending order details by default.

Could anyone give me suggestions to sort it out


texts: Add a 2 character prefix to the SKU on the product detail page

texts:
I've been trying without success to prepend the the SKU on the product detail page with 2 characters - R9.

I've already added some customisations to the page using a catalog_product_view.xml but I can't seem to target the block product.info.sku

I think something like this in the theme catalog_product_view.xml should work:

<referenceBlock name="product.info.sku">
    <block class="Magento\Cms\Block\Block" name="skuPrefix">
        <arguments>
            <argument name="skuPrefix" xsi:type="string">skuPrefix</argument>
        </arguments>
    </block>
</referenceBlock>

but it doesn't. I can get the block to appear with this:

<referenceContainer name="product.info.type">
        <container name="custom.container3" before="-">
        <block class="Magento\Catalog\Block\Product\View" name="skuprefix" template="Magento_Catalog::skuprefix.phtml" />
        </container>
</referenceContainer>

but that doesn't put the block where I want it. We're using Luma and we're on 2.3.2. Ideally I'd like the SKU to look like this: SKU#: R912345


texts:
I'm using Magento 2.3 EE. In Account dashboard, I can see the account navigation links. I want to add a feature called "Refer a Friend". Is this something default in Magento 2.

Could anyone please guide me?


texts:
So i wrote this piece of code, and it works if i remove the echo and outside php. But inside php, it wont show. I suspect it has something to do with "data-mage-init="{promo_popup:{}}". Anybody has an idea what to do or to solve it?
if($Popup_enable == 1){
echo '<div class="news-popup" data-mage-init="{`promo_popup`:{}}" >

                        '.$Popup_text.'

                    '.$Popup_b_text.'

                <button type="button" class="btn btn-link btn-close inside-stroke-white-popup display-5">×</button>

';
}


texts: Knockout JS Implementation with Phtml ReferenceError: Unable to process binding

texts:
After a lot of search in this forum I have decided to write a question by myself.
I am trying to integrate my knockout page into a phtml file in way to update the input layout after a file has been uploaded, but when I try to load the page I face this error:
ReferenceError: Unable to process binding "event: function(){return {change:myFunction} }"
Message: myFunction is not defined

Actually I'm sure that the JS file is actually loaded.
Following you can find the code:
<MODULE_NAME>/widget/pending_page.phtml
<form method="post" action="" enctype="multipart/form-data">

                       <input type="file" name="file" id="file" accept="image/*" data-bind="event: {change : myFunction }">

           <button class="btn btn-default" type="submit">Submit</button>

   </form>

<MODULE_NAME>/js/pending_page
    [
        'ko',
        'jquery',
        'uiElement'
    ],
    function(
        ko,
        $,
        Component
    ){
    "use strict";

        return Component.extend({

            defaults: {
                template: '<MODULE>/widget/pending_page'
            },

            initObservable: function () {
                this._super()
                    .observe({
                        files: []
                    })

                this.files.subscribe(function() {}, this);
            },

            myFunction: function(){
                console.log("i'm hereeeeeeeeeeeeeeeee")
            },
        })

});

May someone help me? I'm going crazy about that.
Thanks!


texts: Magento 2 can't store apostrophe in manufacturer options

texts:
I tried to store a brand name with apostrophe like "nature's way",  "nature's answer" to the option values of manufacturer attribute.  But Magento CE 2.2 always store the apostrophe " ' " of them to their ASCII value &amp;#039;.

Could the core team correct this error?  I know when you show the ASCII string to apostrophe, you need to use escapeHtml() function.


texts:
I am currently transfering a magento site to a new server, and I am coming across this which i would like to remove:

Domain.com/gb/

the GB, i have located it in the manage store view, and have tried to disable it but when I do this the website will not render just to use that store as a default, can anyone give me a nudge?

Any questions please let me know and I will provide as much info as I can.


texts: Loading custom phtml file in the sales order create index issue

texts:
This is my layout from my module:

<layout version="0.1.0">
    <adminhtml_sales_order_create_index>
        <reference name="items">
            <block type="mynamespace_mymodule/adminhtml_sales_order_create_custom" name="custom_name" template="mynamespace_mymodule/sales/order/create/customtemplate.phtml"/>
        </reference>
    </adminhtml_sales_order_create_index>
</layout>

The content of the customtemplate.phtml is: customtext

This is my block:

class Mynamespace_Mymodule_Block_Adminhtml_Sales_Order_Create_Custom extends Mage_Core_Block_Template
{
 asdadasdas
}

I put that string there intentionally to see if it gets to my block, but it doesn't. So its smth wrong with my XML.

What i want to achieve is to display some data before this block Item ordered:

What did I miss? thx ?


texts: How to apply tax on custom additional charges and how to set with quote total?

texts:
I have apply below but able to set tax related amount
public function collect(
\Magento\Quote\Model\Quote $quote,
ShippingAssignmentInterface $shippingAssignment,
\Magento\Quote\Model\Quote\Address\Total $total
) {
parent::collect($quote, $shippingAssignment, $total);
    $address = $shippingAssignment->getShipping()->getAddress();
    $handlingChargestax = 0;
    $items = $shippingAssignment->getItems();
    if (!count($items)) {
        return $this;
    }
    $cartSkus = [];
    foreach ($quote->getAllItems() as $item) {
        $cartSkus[] = $item->getSku();
    }

    $ExtraCharges = 5;

    $ExtraChargestax = 1.2;

    $grandTotal = round($total->getGrandTotal(), 4);
    $baseGrandTotal = round($total->getBaseGrandTotal(), 4);

    $total->setGrandTotal($grandTotal + $ExtraCharges + $ExtraChargestax);
    $total->setBaseGrandTotal($baseGrandTotal + $ExtraCharges + $ExtraChargestax);

    $total->setTaxAmount($total->getTaxAmount() + $ExtraChargestax);
    $total->setBaseTaxAmount($total->getBaseTaxAmount() + $ExtraChargestax);

    $address->setTaxAmount($total->getTaxAmount());
    $address->setBaseTaxAmount($total->getBaseTaxAmount());

    return $this;
}


texts: Setting up cron job with custom events in magento 2

texts:
I have set up my magento 2 (2.2.0-dev) store with sample data. I am totally new to magento. I have a simple requirement where I have to add random products, customers, reviews and actions on those reviews every day. I am planning to set a cron job to do that. In went to cron (Scheduled Tasks) under Stores -> Configuration -> Advanced -> System. Figured out that one can set cron jobs for events like sending mails, updating currency rates.

  My question is, is it even possible to set up cron jobs that add random products, customers, reviews etc ? If yes, please guide me how to do that.

Any lead, reference will be much appreciated.

Thank you.


texts: how to remove phtml file from home page in magento 2 theme

texts:
How can I remove a phtml template file from my theme, but only from the home page?

My template file is "custome_home.phtml" at app/design/frontend/kalpak/ktheme/Magento_Theme/templates/html


texts: "Sign in with Google temporarily disabled for this app" in magento2

texts:
I keep getting error as shown in below link while creating new account through google sign. I verified the app but still not effect seen.

http://prntscr.com/q4vbg8

Also below given error is generated
"Endpoint: Error while trying to init Hybrid_Auth: You cannot access this page directly."
How can i solve it ?


texts: Add placeholder text to One Page Checkout street address

texts:
How do you add a placeholder input attribute to the Street Address Line 1?

In the checkout_index_index page I have the below (where I can change the visibility of all the children, so I know I'm in the right part...), however I can't work out how to access the children on the street element - I've scoured the Internet for an hour or two and can't find any info.

<item name="children" xsi:type="array">
    <item name="shipping-step" xsi:type="array">
        <item name="children" xsi:type="array">
            <item name="shippingAddress" xsi:type="array">
                <item name="children" xsi:type="array">
                    <item name="shipping-address-fieldset" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="street" xsi:type="array">
                                <item name="visible" xsi:type="boolean">true</item>
                                ...
                                ...
                            </item>
                        </item>
                    </item>
                </item>
            </item>
        </item>
    </item>
</item>


texts: How to exclude certain orders from the dashboard chart?

texts: I want to exclude orders with a certain attribute set from the chart on the dashboard. I started looking in Mage_Adminhtml_Block_Dashboard_Graph but somehow I can't find the place. Any advice?


texts: How to create Barcode in invoice can any one suggest barcode in invoice


texts:
I´ve install correctly the package Magento-CE-2.1.2_sample_data-2016-10-11-11-24-30.

I can see the test page LUMA perfectly. But when I try to enter on the admin page, I put the correct user and password and the message shows:

  There has been an error processing your request Notice: Use of
  undefined constant CURLOPT_PROTOCOLS - assumed 'CURLOPT_PROTOCOLS' in
  /home/storage/4/28/79/a7consulting2/public_html/store/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php
  on line 73

I've installed the magento on the 'store' folder...

Could you help me?


texts: How to refresh Cart using PHTML file with AJAX Magento?

texts:
In following File, there is a file "reload.php"

But i want to use "myajaxcart.phtml" in Magento, How ??

Is it possible to use .phtml there, as magento doesn't allow direct access to .phtml files ??

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(
function()
{
$('#loaddiv').fadeOut('slow').load('reload.php').fadeIn("slow");
}, 200);
</script>

I want like this :

$('#loaddiv').fadeOut('slow').load('myajaxcart.phtml').fadeIn("slow");

Thanks in Advance.


texts: Magento 2 Unable to set custom Price in cart item by API

texts:
I'm trying to add an item by API.every thing are working except item price
It's Magento Bug that not take price from API

https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/quoteCartItemRepositoryV1SavePost

POST : V1/carts/mine/items?cart_id=27333

Payload :

{
"cartItem":
    {
        "sku": "1024P270PDTS",
        "qty": 1,
        "price": 20,
        "quote_id": "27333"
    }
}

It will add item correctly but not the price it will not take a price from API it set price from magento.
How can I add product in cart with price 20 as passed in API

Even facing same problem with update item API it is not change API price which is sent in payload
PUT : V1/carts/mine/items/105287?cart_id=27333

{
"cartItem":
    {
        "sku": "1024P270PDTS",
        "qty": 1,
        "price": 20,
        "quote_id": "27333",
        "item_id" : 105287
    }
}


texts: Setting a default value for a config defined value?

texts:
How can I assign a default value to a config value, which i am defining in a system.xml file? Currently it defaults to 'no', but i want it to default to 'yes'.

Here is my current definition code:

<catalog>
            <groups>
                <my_val>
                    My Label
                    <frontend_type>text</frontend_type>
                    <sort_order>160</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <my_inner_val translate='label comment'>
                            Enable seperate cart items
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </my_inner_val>
                    </fields>
                </my_val>
            </groups>
        </catalog>


texts: Magento 2: Unable to add product to package in shipping label

texts:
Magento: 2.4
Shipping Module: https://marketplace.magento.com/laposte-magento2-colissimo-module.html
Steps to reproduce

After creating order goto admin > sales > order
Click on ship and check Create a shipping label and click on create a shipment.
Create shipment label popup will open.
Click on add product to package button.

We found that event is not properly generated and by default display: none is not available in the prototype template so multiple packages are displayed and the event does not work.

\vendor\magento\module-shipping\view\adminhtml\templates\order\packaging\popup_content.phtml

To resolve this issue I have replaced the content of this template file with  Magento 2.3.5-p1's template file content and now the console error is resolved.
in Magento 2.4
<button type="button"
        class="action-secondary"
        data-action="package-add-items">
    <?= $block->escapeHtml(__('Add Products to Package')) ?>
</button>
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
    'onclick',
    'packaging.getItemsForPack(this);',
    "button[data-action='package-add-items']"
) ?>

This code is used to bind the event with a button and not use display: none by default hide the package content.
and in Magento 2.3.5-p1
<button type="button"
      class="action-secondary"
      data-action="package-add-items"
      onclick="packaging.getItemsForPack(this);">
<?= $block->escapeHtml(__('Add Products to Package')) ?>
</button>

After update this file my issue is resolved but I want to know why Magento 2.4 use
renderEventListenerAsTag to bind the event and why this not generate on click event for the button and not work?


texts: Add product programmatically to cart through observer

texts:
Here is my questions: What is the right event to hook in for adding a product to quote programmatically (entry sales_flat_quote_item table). Also i have to catch the items/products added to cart from an user/customer, because their data informations will determine the product which will be added programmatically. So the scenario would be:

user/customer adds a product to cart
find the right event for hook in
fetch informations about the products added to cart
add additional product to cart based on a product id and modified its data

In my opinion its better to work with the quote, before the products are written to the database.

I figure out how to add it through Mage_Sales_Model_Quote::_addCatalogProduct(). But i would like to do it through an event observer instead of overwriting core classes.


texts:
On the face of it my question appears to be simple

  How do I join a collection?

but there seems to be a good amount of information on this subject (so there seemed little need for this post), which is why I was very reluctant to put this question on. Finally after a day and a half of reading and trying different alternatives I am still unable to join a two table and return related media to my grid.

I figure this inability to join a collection comes from a lack of understanding in what I am trying to achieve. I have looked at many blog posts and questions on SE and believe what I am doing to be correct. I found this, this and this to be very helpful, but I cannot seem to return only the data I am after, I get all data held in my media table or nothing.

THE WORKING SQL

SELECT      shop_locator_media.shop_id,
            shop_locator_media.is_default,
            shop_locator_media.location,
            shop_locator_shop.shop_id
FROM       `shop_locator_media`
INNER JOIN `shop_locator_shop`
ON          shop_locator_media.shop_id = shop_locator_shop.shop_id
WHERE       shop_locator_media.shop_id = 2

FAILED ATTEMPTS TO MAKE THE JOIN

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->joinTable(
                 array('shop' => 'namespace_module/shop_locator_shop'), 'shop_id = shop_id',
                 array('shop_id' => 'shop_id')
    );
    //returns PHP Fatal error:  Call to undefined method namespace_module_Model_Resource_Media_Collection::joinTable()

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->getSelect()->join(
        array('ls' => 'shop_locator_shop'),
        'main_table.shop_id = ls.shop_id',
        array('shop' => 'ls.shop_id')
    );
    //returns empty container shop_locator_shop and shop_locator_media shop_id both contain at least one row that will match
            e.g. shop_locator_shop.shop_id = 3 and shop_locator_media.shop_id = 3

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->getSelect()->join(
            array('s'=>$this->getTable('namespace_module/shop_locator_shop')),
                  'main_table.shop_id = s.shop_id',
            array('s.shop_id'));
    //returns 1103 incorrect table name

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->getSelect()->join(
            array('s'=>$this->getTable('namespace_module/shop')),
                  'main_table.shop_id = s.shop_id',
            array('s.shop_id'));
    //returns 1103 incorrect table name

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->getSelect()->join(array('shp'=>'shop_locator_shop'),'shp.shop_id = shop_id');
    $collection->getItems();
    //return 1052 Column 'shop_id' in on clause is ambiguous

    $collection = Mage::getModel('namespace_module/media')->getCollection();
    $collection->getSelect()->join(array('shp'=>'shop_locator_shop'),'shp.shop_id = main_table.shop_id');
    $collection->getItems();
    //returns all data from shop_locator_media


texts: Order confirmation email not sending to admin or customer

texts: After placing an order the order success page shows but Order confirmation email is not sending to admin or customer. When i refresh cron.php on with my site url however, i receive mail.


texts:
I'm trying to override module-sales-rule and it's not working I have successfully overwritten module-checkout. Here is what I have done.

I have copied all files from

vender/magento/module-sales-rule/view/frontend/

to

app/design/frontend/<vender>/theme/Magento_Sales_Rule/

And have tried just adding the file I want to edit and with no luck.

I have run the following commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

The command below throws an error

php bin/magento setup:static-content:deploy

Could not parse theme static file '/app/design/frontend/<vender>/theme/Magento_Sales_Rule/web/js/view/cart/totals/discount.js

Any ideas would help thanks


texts: Making shipping method unavailable if customer spends over x amount

texts:
I've been asked to basically create 3 options of shipping costs, the first is a flat rate if customers spend say $500 or less it costs $10 no matter what products or customer type they are.

The second is when the customer spends over $500 the shipping fee is now 2% of the subtotal.

The third is the customer receives free shipping when the order is over $2000.

I know how to work the free shipping but I believe I need a new shipping method to accommodate for the percentage shipping fee so the first flat rate can't be an option when the customer spends over $500, how do I go about this?

I also face the dilemma of creating a percentage cost of the subtotal of the cart when customers spend between $501 - $2000. I have found extensions with allow this but is there an option that magento offers?


texts: "Manage Products" in Admin Panel won't display and gives error

texts:
Upgraded from Magento 1.8 to 1.9.2.

When going to Catalog->Manage Products, the page displays

"There has been an error processing your request"

Looking at log shows:

  a:5:{i:0;s:167:"SQLSTATE[42S02]: Base table or view not found: 1146
  Table 'xxxx_magento.warehouse' doesn't exist, query was: SELECT
  main_table.* FROM warehouse AS main_table";i:1;s:7537:"#0
  /chroot/home/sre/xxxxxx.net/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
  Zend_Db_Statement_Pdo->_execute(Array)

Have never used/setup warehouse and not aware of warehouse table. Ideas?


texts: How to remove tool tip icon in checkout page in magento 2

texts:
I wish to remove tooltip icon in checkout page.

1) Wish to remove near email and phone number


texts: basic php test in magento using module class, driving me crazy!

texts:
I have the following class on my root magento2 directory:
test();

PHP storm can link to the MagentoU\test class, so the path is correct and the class exists, but I get the following error when I ran the file in the browser or in the command line I get the following:
Fatal error: Uncaught Error: Class 'Training\Unit2\MagentoU\test' not found in C:\xampp\htdocs\magento2\Unit1_162test.php on line 3

So it looks like phpStorm finds the class but magento/php dont?

I'm using magento EE 2.1 in an XAMPP installation

I have tried to add a '\' at the beginning of the use statement and to call directly to the class as 'new Training\Unit2\MagentoU\test', same results.


texts:
I am not able to figure out why some of the strings which I input in my i18 > bg_BG.csv are not translating. I will give a small example with Qty.

Qty,Количество,module,Magento_Catalog
Qty,Количество,module,Magento_AdvancedCheckout
Qty,Количество,module,Magento_CatalogInventory
Qty,Количество,module,Magento_Checkout
Qty,Количество,module,Magento_Customer
Qty,Количество,module,Magento_GiftRegistry

These are the occurrences in my translation file for Qty, neither of them work. I cannot understand am I doing something wrong. I've cleared cache, deployed static files, changed from production to developer. Some of the strings in the file are translated and others not.


texts: Truncate string and add "..." only if more than 40 characters

texts:
I have this code for the product description on the category page:

<?php echo substr($_product->getShortDescription(),0,40).'...'; ?>

But this code will show the ... always, even if the text length is 25 characters. How can I modify this code to show the ... only if the text is longer than 40 characters?


texts:
i changed the images directly in the coding of the home page in the panel and now its showing on the home page only before doing this it was showing on every product page any help will be appreciated.

HOME PAGE - SCREENSHOT

PRODUCT PAGE - SCREENSHOT


texts: how to display label in top of checkout page

texts: i am using magento 2.3.4 and now integrated with amasty once step checkout unfortunatly its not working.Magento once step checkout Shipping Address alignment not working


texts: How to clean magento logs in Magento 1.9?

texts: I want to create script to cleaning magento logs. How can I do this?


texts: Set a module to try to serve content over https instead of http

texts:
This part of the ogone plugin gives a person insight into his/her order history.

Problem is, this thingymijig redirects to http protocol instead of https. Other nasty sideeffect is that it redirects to main store if it's not over https.

How do I change it that it generates the url in user account information as a magento secure url instead of a magento base url?

Stupid plugin developper won't fix this within a reasonable time, so I started to fix this myself, but the snag I'm running into is that I cannot find any documentation of how to set a module page to run over https/generate links that go via the secure base url.

Anyone know any documentation about setting modules to https or how to fix this?

app/design/frontend/base/store/layout/ops.xml

<customer_account>
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="ops"><name>ops_payment_information</name><path>ops/customer/aliases</path>My payment information</action>
        </reference>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
    </customer_account>
    <ops_customer_aliases translate="label">
        My payment information
        <update handle="customer_account"/>
        <reference name="my.account.wrapper">
            <block type="ops/alias_list" name="ops_customer_aliases" template="ops/customer/alias/list.phtml" />
        </reference>
        <reference name="root">
            <action method="setHeaderTitle" translate="title" module="ops"><title>My payment information</title></action>
            <action method="setTemplate"><template>page/3columns.phtml</template></action>
        </reference>
    </ops_customer_aliases>


texts: Add Custom Link In Main Menu Magento 2.3.5

texts:
I need to add Custom Link In Main Menu Only apply Specific Text. currently i have display  menu as category. i want to add link only where to buy menu. please help me & Suggest how can i add menu?

Please See my attached files.

Thanks In Advance


texts: Add to cart button brings you to an empty cart for certain products need help troubleshooting!

texts:
So not one person in all of this section can help troubleshoot session issues?

NOTE I've completely updated my question as this was never resolved:

EDIT: I just noticed that while I set 777 on var/session new files that are created are set to 600 (rw) Could this be the culprit?

If customer A adds product "pencil" to cart - customer A can checkout

If customer B adds product "pencil" to cart - customer B, C, D gets an empty cart

After customer A adds product to cart, no one can add to cart for that product - eventually you can but I haven't figured out why yet.

So I am leaning towards cookies or a session problem.

What I've already tried:

Set cookie life time to 24 hours (86400)
Set all indexes to Update on save
Re-index all indexes
Cleared all caches
Verified that var/sessions is 777
Disk is not full
No messages in the log files

Here is a portion of my Web configuration:

Do these settings look correct?

Are there additional steps that I can take to figure this out?


texts: Redirect old page to new html page using .htaccess

texts:
We have a static HTML website having MicrosoftDynamics.html page recently we changed to MicrosoftDynamicsNav.html.

But when we searched in google the page URL is showing old one, If we clicked the link we are getting 404 error.

So we decided to write the 404-page redirects rules from the .htaccess  file. But it's not working for me. For these, I have tried below code

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RedirectMatch 404 /MicrosoftDynamics.html /MicrosoftDynamicsNav.html
</IfModule>

Please suggest me.


texts: Magento 2.3 : How to set qty for multiple sources (Multi source inventory) programmatically

texts:
I have a site with 3 inventory sources. I want to add and update product inventory to each source by product sku.
Please help me


texts: Simple question as title, Can i still use magento 1.9 module/theme at magento 2.0? Is magento 2.0 a completely new system and not compatible with 1.9?


texts: Magento 2 Adding Customer Group to Invoice Header PDF

texts: Looking to add customer group to invoice and packing slips in magento 2. having a hard time figuring it out. please help.


texts: Display end date catalog price rule on frontend

texts:
I use some catalog price rules, to display discount on frontend.
All these rules do have a end date.

I want to display the end date on frontend, so that a customer knows when the discount will end.

How can I display that?


texts: How to get entity id by SKU and ATTRIBUTE ID in magento 2

texts:
I have created an extension that creates product attribute "Is Old" after installing extension. Attribute is in drop down form with Yes and No.

Attribute value is saving in "catalog_product_entity_int" table.

The main purpose of creating this attribute is that admin can decide if current product is old or not.

Now I want to fetch all those product's entity id that is set to "YES" in "Is Old" drop down value and by specific SKU.

I have fetched product's entity id by SKU but now I want to fetch entity id by sku and is_old value "Yes" as well.

Here is my code to fetch product entity id by SKU only.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();

$select = "Select * FROM catalog_product_entity WHERE sku='123'";
$rowArray = $connection->fetchRow($select);
$enitity_id = $rowArray['entity_id'];


texts: How can I get a product's status for a store?

texts:
This really does not seem like it should be difficult. I seem to be able to change a product's status for a given store, but not read it.

Below is a test script I've been using,

<?php
// Make this a Magento app
require_once '/var/www/html/magento/app/Mage.php';
Mage::app();

echo "Loading product ".$argv[1]."\n";
$product = Mage::getModel('catalog/product')->setStore(2)->setStoreId(2)
->load($argv[1]);

echo "Product id is ".$product->getId()."\n";
echo "Product status is now ".print_r(Mage::getModel('catalog/product_status')->getProductStatus($product->getId(),2),true)."\n";
// This always prints:
// Product status is now Array
// (
//    [498] => -1
// )

echo "enabling product... ";
Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), 2, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
echo "done\n";
// This actually seems to work, and change the status of the product in that store's view.

echo "Product status is now ".print_r(Mage::getModel('catalog/product_status')->getProductStatus($product->getId(),2),true)."\n";
// This always prints the same -1 response as the first time
?>

And that's it. Pretty short and simple, and changing the product status in store 2 does appear to work, just not reading it.

Interestingly enough, both things do work if I use this:

echo "Product status is now ".$product->getStatus()."\n";

echo "enabling product... ";
$product->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)->save();
echo "done\n";

echo "Product status is now ".$product->getStatus()."\n";

Except, after running that, in the store view all the attributes that had been set to "use default" now aren't. As a last resort that might work, but definitely not what I had in mind.


texts: Reload custom options of associated products in configurable product to display extra/additional attribute

texts:
I'm using Magento 1.9 and trying to do these changes:

Create a Configurable Product and associate 5 products to it
4 products have these custom options: color and size
1 product has color, size and fabric

Now, the issue is that if I select options from the dropdown, then the product which contains the "fabric" option also that displays the "color" and "size" options only somehow fabric is not loaded

My first thought was to extend Mage_Catalog_Block_Product_View_Options and reload from configurable.js.

but I'm not sure if this is the right way as I tried to use getOptions or getCustomOptions, then it returns null.

If someone encountered this also, I would really appreciate the help and guidance.

UPDATE:

Here are some step by step screenshots that I hope it will make you understand better what I'm trying to achieve:

5 configurable products: http://screencast.com/t/yQlRNRv5
if I click on Aluminium for example, the product page will display the print size options http://screencast.com/t/sjiSC3Ic2
now, the Canvas product is the only product that has an extra option that should appear only when you select Canvas: http://screencast.com/t/7hKE0M3gIW2m

The user has the option to change from dropdown from Aluminium to Canvas and that's when the "Canvas Wrap" option should appear: http://screencast.com/t/IMbaebAs4a
and backwards, if you are on Canvas configurable product page, if you select Aluminium, the "canvas wrap" should disappear since the other associated products do not have that custom option.

Any suggestions?


texts:
i am update my stock below is my code

$product=$this->_product->getById($productId); //load product which you want to update stock
    $sku=$product->getSku();

    $sources = $this->getSourceItemsBySku->execute($sku);

        $quantity = 0;
        foreach ($sources as $index => $source) {

            if($source->getSourceCode()== $inventory_source) { //@todo load source data i.e sync with QBO

                $quantity = $receive_qty + $source->getQuantity();
                $sourceItem = $this->_sourceItemFactory->create();
                $sourceItem->setSourceCode($inventory_source);
                $sourceItem->setSku($sku);
                $sourceItem->setQuantity($quantity);
                $sourceItem->setStatus(1);
                $this->_sourceItemsSaveInterface->execute([$sourceItem]);
            }
        }

this issue is how i update stock status from out of stock to in stock by this code?


texts: Magento 2.1 : I want to Add Dropdown on Admin Grid to Switch Between Different Grids

texts: I have different grids in module. I want to add dropdown on the top of admin grid which allowed to switch between different grids like in image


texts: Magento2 : How can I share session of one magento store with another magento store with different domain?

texts: Here I have same user and data exists on abc.com and xyz.com. I want to login into abc.com at that time same session need to created for xyz.com. So once user login into abc.com he will have his login into xyz.com also. Please provide some help on this.


texts: How to change eav_attribute table's note column's datatype varchar to mediumtext using declarative schema?

texts:
I have follow this documnet https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/db-schema.html but not get success

module.xml

        <?xml version="1.0"?>

        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
            <module name="Ktpl_Test1" setup_version="1.0.0">
                <sequence>
                    <module name="Magento_Eav"/>
                </sequence>
            </module>
        </config>

db_schema.xml

                <?xml version="1.0"?>

        <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">

                <column identity="true" name="test1_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/>
                <column  name="test_name" nullable="false" padding="10" unsigned="true" xsi:type="int"/>
                <column   name="test2_id" nullable="false" padding="10" unsigned="true" xsi:type="int"/>
                <constraint referenceId="PRIMARY" xsi:type="primary">
                    <column name="test1_id"/>
                </constraint>
               <constraint xsi:type="foreign" referenceId="Test12ID" table="ktpl_test1" column="test2_id" referenceTable ="ktpl_test2" referenceColumn="test2_id"/>
               <constraint xsi:type="foreign" referenceId="Test13ID" table="ktpl_test1" column="test3_id" referenceTable ="ktpl_test3" referenceColumn="test3_id"/>

                <column xsi:type="mediumtext" name="note" nullable="false" length="500" comment="Note"/>
                <constraint xsi:type="primary" referenceId="PRIMARY">
                    <column name="attribute_id"/>
                </constraint>

        </schema>


texts: In Navigation top menu sort default and custom added links

texts:
Kindly read it out carefully because for me it is somehow confusing.
1- I have default links in navigation like (What's New, Women, Collection). I have sorted them by adding category attributes (sort order). and result is fine and oky.
2- Then I added some custom links like (Clothes, bottles etc). I have sorted these custom links too.
Problem
case: problem is that I don't know how to sort them together.
If you need more detail or you have question, do ask please I need solution as quick as possible.


texts: systemException. Unable to serialize value. in row(s): 1

texts:
Whenever I try to import bulk amount of product data, it always throws an error as following: I have 10 thousand records in the csv.

I don't know what is causing the problem. Has anybody faced these kind of problem and resolved? If I click the Download full report link, it takes me to home page of import.