Categories
CMS Magento Mastering Development

How to make categories checkbox mandatory in Magento2

I am using webkul multi-vendor extension. Categories should be mandatory customer can choose minimum one category, Please see below code: <div class="field required"> <label class="label"><?= $block->escapeHtml(__(‘Product Category’)) ?>:</label> <?php if ($product_hint_status && $helper->getProductHintCategory()) : ?> <img src="<?= $block->escapeUrl($this->getViewFileUrl(‘Webkul_Marketplace::images/quest.png’)); ?>" class=’questimg’ title="<?= $block->escapeHtml($helper->getProductHintCategory()) ?>"/> <?php endif; ?> <?php if ($helper->getIsAdminViewCategoryTree()) { ?> <div data-bind="scope: ‘sellerCategory’"> <!– […]

Categories
Mastering Development

Have I constructed this multiple JOIN Correctly?

"SELECT * FROM `wpet_woocommerce_order_items` a LEFT JOIN `wpet_woocommerce_order_itemmeta` b ON a.order_item_id = b.order_item_id LEFT JOIN `wpet_users` f ON f.ID = b.meta_value AND b.meta_key = ‘seller_id’ LEFT JOIN `wpet_dokan_orders` c ON a.order_id = c.order_id LEFT JOIN `wpet_posts` d ON a.order_id = d.ID WHERE a.order_id = " + value.OrderNum + " AND a.order_item_type = ‘line_item’;"; I am […]

Categories
Mastering Development

Standard deviation with groupby(multiple columns) Pandas

I am working with data from the California Air Resources Board. site,monitor,date,start_hour,value,variable,units,quality,prelim,name 5407,t,2014-01-01,0,3.00,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,1,1.54,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,2,3.76,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,3,5.98,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,4,8.09,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,5,12.05,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach 5407,t,2014-01-01,6,12.55,PM25HR,Micrograms/Cubic Meter ( ug/m<sup>3</sup> ),0,y,Bombay Beach … […]

Categories
Mastering Development

Why can’t our GAN load the weights saved from previous training epochs?

We have another problem with our GAN: We build a model (with help of a toutorial) and trained it a lot of times. you can take a look at the code here: https://colab.research.google.com/drive/1JKj7z1V9okh0oOMaJHbGD-XjQb60SvKz#scrollTo=i3DXtjMXRfeo Everything was running perfect until last week, but now we have the problem that we can’t load our weights anymore. It’s very […]

Categories
Cryptocurrency Ethereum Mastering Development

How to determine the return address when we use CALL opcode?

I’m try to understand each opcode defined in Ethereum Virtual Machine. As for the opcode ‘CALL’ I find that it needs 7 arguments from the stack: gas, addr, value, argument addr, argument offset, return addr and return offset. My question is that, how the evm determine the return addr and offset for a CALL opcode. […]

Categories
Mastering Development

TypeScript: Mapping object entries to types

As a novice typescript user, I am having trouble even formulating the question, so please bear with me. I am trying to create a key => [string + valueObject interface] map of strings and valueObjects (as a type) and then have a function, which enforces the valueObject interface, based on the passed key. I feel […]

Categories
Mastering Development

converting error messages from mongoose validation to user friendly messages

Hello I am a beginner trying to learn node I am trying to validate the data users entered in a registration page This is my mongoose schema const schema = mongoose.Schema({ fname:{type:String, required:[true,"enter a first name"]}, lname:{type:String, required:[true,"enter a last name "]}, email:{type:String, required:[true,"email is required"], unique:true, trim:true, lowercase:true, validate(value){ if(!validator.isEmail(value)){ throw new Error("Email is […]

Categories
CMS Magento Mastering Development

Custom Attribute not saving on Product

I’ve created two custom attributes, but when i create a simple product, just saves one attribute. Using postman,the request has both attributes fields, but the response just has one. Any help is appreciated. Color Attribute, this one works. "is_wysiwyg_enabled": false, "is_html_allowed_on_front": false, "used_for_sort_by": false, "is_filterable": true, "is_filterable_in_search": false, "is_used_in_grid": true, "is_visible_in_grid": false, "is_filterable_in_grid": true, "position": […]

Categories
Mastering Development

I have made a login system, however, I don’t know how to style some of it

So, I have been working on a login page, and it has been working beautifully so far. However, I cannot style where the error message appears. Here is the code: — The login.php file — <?php include_once ‘../resources/session.php’; include_once ‘../resources/database.php’; include_once ‘../resources/utilities.php’; if(isset($_POST[‘loginBtn’])){ // array to hold errors $form_errors = array(); // validate $required_fields = […]

Categories
Mastering Development Software

When designing an API in Javascript with closures, should I provide singletons or factories for directly creating objects to clients?

I’m designing an API in Javascript part of an Angular with typescript project. I have involved later in this project implemented. There is a DataStorageService which I checked from git logs that essentially like this in the beginning. @Injectable({ //Injected an instance of it to DI container in startup by angular. providedIn: ‘root’ }) export […]