Categories
CMS Magento Mastering Development

Preference is not working while a method called from child class

I created a preference for the method _applyOptionsPrice() in Magento/Catalog/Model/Product/Type/Price.php class. The preference is working while the _applyOptionsPrice() was called from the same class but the Price.php class was inherited by two class. They are : Magento/Bundle/Model/Product/Price.php Magento/ConfigurableProduct/Model/Product/Type/Configurable/Price.php While the _applyOptionsPrice() was called from the above two classes my preference method didn’t worked. I declared […]

Categories
CMS Magento Mastering Development

Delete all products and categories Magento 2

I am using those requests to delete all products and categories and reset databases tables, it works fine and everything is cleared correctly but problem when I import products using csv products are not showing in the frontend, already reindexed, cleared cache … the view inventory_stock_1 existe but with nothing inside. Have I missed something […]

Categories
CMS Magento Mastering Development

Magento 2 product import website id not updating

I’m importing products using csv. Using default method of magento. My csv file is below. sku,store_view_code,attribute_set_code,product_type,categories,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id testimport2,,Default,simple,Default Category/Kitchen Appliances,test import,"<ul><li>Shape: Tapered towards the point</li><li>Double cut, single cut and spiral cut</li><li>Uses: For filing holes, mouldings and half round grooves</ul>",File Round Bastard 100 mm Sleeve,1,1,Taxable Goods,"Catalog, Search",10,,,,testimport2,,,,sale.png,,sale.png,,sale.png,,,,,,,,Block after Info Column,,,,Use config,,,,,,,,,1000,0,1,0,0,1,1,1,10000,1,1,1,1,1,1,1,1,1,0,0,1 Product import working properly but website […]

Categories
Mastering Development

unexpected type, expecting name

i have try to use golang. iam new for this golang. when i try to connect to mysql i got some error like this : ./testCOnnection.go:9:35: syntax error: unexpected type, expecting name ./testCOnnection.go:15:1: syntax error: non-declaration statement outside function body ./testCOnnection.go:36:5: syntax error: non-declaration statement outside function body i have run using root. here my […]

Categories
Mastering Development

Printing Data on RDLC Report Without showing preview

I was working with my POS project, and I was able to print the invoice, but sadly It requires to manually click the print button on the RDLC Reportviewer. can anyone please help me. Here’s my code. `Imports MySql.Data.MySqlClient Imports Microsoft.Reporting.WinForms Public Class frmReceiptPrint Private Sub frmReceiptPrint_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.ReportViewer1.RefreshReport() […]

Categories
CMS Magento Mastering Development

Magento 2: How to Show different quantity for specific product type in product grid?

I have a custom table for specific product type to store the product qty, the query to select the qty is like this for example: SELECT a.qty FROM custom_product_table WHERE product_id = 1; i noticed the qty column is rendered in this file vendor/magento/module-catalog-inventory/Ui/DataProvider/Product/AddQuantityFieldToCollection.php public function addField(Collection $collection, $field, $alias = null) { $collection->joinField( ‘qty’, […]

Categories
CMS Magento Mastering Development

Magento 2.3 Update Stock via Database – Multi Source Inventory

I was hoping to get a grasp on the how Stock levels(Qty of a sku in stock) are stored in the database with the changes to MSI. Now that we have stocks and sources I’m unsure what all tables we need to update when making direct stock changes to the database. My understanding is that […]

Categories
Mastering Development

How to run Javascript code after $.post regardless if it succeeds or not?

I have the following function to check whether a product can be added to cart and do things after // Add item to cart function add_cart_item(variant_id, qty, callback) { $.post(‘/cart/add.js’, { quantity: qty, id: variant_id }, null, "JSON") .done(function() { // Do stuff after product is added to cart // Update cart product count refresh_cart(‘add’, […]

Categories
CMS Magento Mastering Development

I want to get enabled configurable products which has associate products without inventory? [Magento 2] [closed]

My Query is: I want to get enabled configurable products which has associate products without inventory OR child products of enabled config products have inventory zero. Use below code for filter out of stock Simple/Config products [magento 2 out of stock enabled configurable products] $objectManager = $bootstrap->getObjectManager(); $state = $objectManager->get(‘Magento\Framework\App\State’); $state->setAreaCode(‘frontend’); $productCollection = $objectManager->create(‘Magento\Catalog\Model\ResourceModel\Product\CollectionFactory’); $collection […]

Categories
CMS Mastering Development Wordpress

Jquery not working in code, but working in console cart page pop up

Jquery not working in woocommerce cart page. I have made the pop up product on cart page and displayed some products. Now selecting the quantity but it’s not working. But when i am running the jquery code in console, it’s working fine but when i am adding the code inside my file. it’s not working […]