Post by mauprik » Wed Apr 21, 2021 7:48 pm

I'm using OpenCart V 3.0.2.0 (default an MyTheme) and PHP V 7.2 with 15 active Extensions/modifications and a lot of selfmade adjustments in several files.
Link to site: www.maupertuus.net
Multi language: (Dutch / English).

I have modified the file:
storage..../modification/admin/view/template/catalog/product_form.twig

Code: Select all

105	<div class="tab-pane" id="tab-data">
106	              <div class="form-group required">
107	                <label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
108	                <div class="col-sm-10">
109	                  <input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control" />
110	                  {% if error_model %}
111	                  <div class="text-danger">{{ error_model }}</div>
112	                  {% endif %}</div>
113	              </div>
114	<!--              <div class="form-group">
115	                <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>
116	                <div class="col-sm-10">
117	                  <input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control" />
118	                </div>
119	              </div>
120	              <div class="form-group">
121	                <label class="col-sm-2 control-label" for="input-upc"><span data-toggle="tooltip" title="{{ help_upc }}">{{ entry_upc }}</span></label>
122	                <div class="col-sm-10">
123	                  <input type="text" name="upc" value="{{ upc }}" placeholder="{{ entry_upc }}" id="input-upc" class="form-control" />
124	                </div>
125	              </div>
126	              <div class="form-group">
127	                <label class="col-sm-2 control-label" for="input-ean"><span data-toggle="tooltip" title="{{ help_ean }}">{{ entry_ean }}</span></label>
128	                <div class="col-sm-10">
129	                  <input type="text" name="ean" value="{{ ean }}" placeholder="{{ entry_ean }}" id="input-ean" class="form-control" />
130	                </div>
131	              </div>
132	              <div class="form-group">
133	                <label class="col-sm-2 control-label" for="input-jan"><span data-toggle="tooltip" title="{{ help_jan }}">{{ entry_jan }}</span></label>
134	                <div class="col-sm-10">
135	                  <input type="text" name="jan" value="{{ jan }}" placeholder="{{ entry_jan }}" id="input-jan" class="form-control" />
136	                </div>
137	              </div>
138	              <div class="form-group">
139	                <label class="col-sm-2 control-label" for="input-isbn"><span data-toggle="tooltip" title="{{ help_isbn }}">{{ entry_isbn }}</span></label>
140	                <div class="col-sm-10">
141	                  <input type="text" name="isbn" value="{{ isbn }}" placeholder="{{ entry_isbn }}" id="input-isbn" class="form-control" />
142	                </div>
143	              </div> -->
144	              <div class="form-group">
145	                <label class="col-sm-2 control-label" for="input-mpn"><span data-toggle="tooltip" title="{{ help_mpn }}">{{ entry_mpn }}</span></label>
146	                <div class="col-sm-10">
147	                  <input type="text" name="mpn" value="{{ mpn }}" placeholder="{{ entry_mpn }}" id="input-mpn" class="form-control" />
148	                </div>
149	              </div>
150	              <div class="form-group">
151	                <label class="col-sm-2 control-label" for="input-location">{{ entry_location }}</label>
152	                <div class="col-sm-10">
153	                  <input type="text" name="location" value="{{ location }}" placeholder="{{ entry_location }}" id="input-location" class="form-control" />
154	                </div>
155	              </div>
156	
and further

Code: Select all

227	              <div class="form-group">
228	                <label class="col-sm-2 control-label" for="input-stock-status"><span data-toggle="tooltip" title="{{ help_stock_status }}">{{ entry_stock_status }}</span></label>
229	                <div class="col-sm-10">
230	                  <select name="stock_status_id" id="input-stock-status" class="form-control">
231	                    
232	
233	                    {% for stock_status in stock_statuses %}
234	                    {% if stock_status.stock_status_id == stock_status_id %}
235	
236	                    
237	                    <option value="{{ stock_status.stock_status_id }}" selected="selected">{{ stock_status.name }}</option>
238	                    
239	
240	                    {% else %}
241	
242	                    
243	                    <option value="{{ stock_status.stock_status_id }}">{{ stock_status.name }}</option>
244	                    
245	
246	                    {% endif %}
247	                    {% endfor %}
248	
249	                  
250	                  </select>
251	                </div>
252	              </div>
253	              <div class="form-group">
254	                <label class="col-sm-2 control-label">{{ entry_shipping }}</label>
255	                <div class="col-sm-10">
256	                  <label class="radio-inline"> {% if shipping %}
257	                    <input type="radio" name="shipping" value="1" checked="checked" />
258	                    {{ text_yes }}
259	                    {% else %}
260	                    <input type="radio" name="shipping" value="1" />
261	                    {{ text_yes }}
262	                    {% endif %} </label>
263	                  <label class="radio-inline"> {% if not shipping %}
264	                    <input type="radio" name="shipping" value="0" checked="checked" />
265	                    {{ text_no }}
266	                    {% else %}
267	                    <input type="radio" name="shipping" value="0" />
268	                    {{ text_no }}
269	                    {% endif %} </label>
270	                </div>
271	              </div>
272	              <div class="form-group">
273	                <label class="col-sm-2 control-label" for="input-date-available">{{ entry_date_available }}</label>
274	                <div class="col-sm-3">
275	                  <div class="input-group date">
276	                    <input type="text" name="date_available" value="{{ date_available }}" placeholder="{{ entry_date_available }}" data-date-format="YYYY-MM-DD" id="input-date-available" class="form-control" />
277	                    <span class="input-group-btn">
278	                    <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
279	                    </span></div>
280	                </div>
281	              </div>
282	<!--              <div class="form-group">
283	                <label class="col-sm-2 control-label" for="input-length">{{ entry_dimension }}</label>
284	                <div class="col-sm-10">
285	                  <div class="row">
286	                    <div class="col-sm-4">
287	                      <input type="text" name="length" value="{{ length }}" placeholder="{{ entry_length }}" id="input-length" class="form-control" />
288	                    </div>
289	                    <div class="col-sm-4">
290	                      <input type="text" name="width" value="{{ width }}" placeholder="{{ entry_width }}" id="input-width" class="form-control" />
291	                    </div>
292	                    <div class="col-sm-4">
293	                      <input type="text" name="height" value="{{ height }}" placeholder="{{ entry_height }}" id="input-height" class="form-control" />
294	                    </div>
295	                  </div>
296	                </div>
297	              </div> -->
298	              <div class="form-group">
299	                <label class="col-sm-2 control-label" for="input-length-class">{{ entry_length_class }}</label>
300	                <div class="col-sm-10">
301	                  <select name="length_class_id" id="input-length-class" class="form-control">
302	                    
303	
304	                    {% for length_class in length_classes %}
305	                    {% if length_class.length_class_id == length_class_id %}
306	
307	                    
308	                    <option value="{{ length_class.length_class_id }}" selected="selected">{{ length_class.title }}</option>
309	                    
310	
311	                    {% else %}
312	
313	                    
314	                    <option value="{{ length_class.length_class_id }}">{{ length_class.title }}</option>
315	                    
316	
317	                    {% endif %}
318	                    {% endfor %}
319	
320	                  
321	                  </select>
322	                </div>
323	              </div>
324	              <div class="form-group">
325	                <label class="col-sm-2 control-label" for="input-weight">{{ entry_weight }}</label>
326	                <div class="col-sm-10">
327	                  <input type="text" name="weight" value="{{ weight }}" placeholder="{{ entry_weight }}" id="input-weight" class="form-control" />
328	                </div>
329	              </div>
330	              <div class="form-group">
331	                <label class="col-sm-2 control-label" for="input-weight-class">{{ entry_weight_class }}</label>
332	                <div class="col-sm-10">
333	                  <select name="weight_class_id" id="input-weight-class" class="form-control">
334	                    
335	
336	                    {% for weight_class in weight_classes %}
337	                    {% if weight_class.weight_class_id == weight_class_id %}
338	
339	                    
340	                    <option value="{{ weight_class.weight_class_id }}" selected="selected">{{ weight_class.title }}</option>
341	                    
342	
343	                    {% else %}
344	
345	                    
346	                    <option value="{{ weight_class.weight_class_id }}">{{ weight_class.title }}</option>
347	                    
348	
349	                    {% endif %}
350	                    {% endfor %}
351	
352	                  
353	                  </select>
354	                </div>
355	              </div>
356	              <div class="form-group">
357	                <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
358	                <div class="col-sm-10">
359	                  <select name="status" id="input-status" class="form-control">
360	                    
361	
362	                    {% if status %}
363	
364	                    
365	                    <option value="1" selected="selected">{{ text_enabled }}</option>
366	                    <option value="0">{{ text_disabled }}</option>
367	                    
368	
369	                    {% else %}
370	
371	                    
372	                    <option value="1">{{ text_enabled }}</option>
373	                    <option value="0" selected="selected">{{ text_disabled }}</option>
374	                    
375	
376	                    {% endif %}
377	
378	                  
379	                  </select>
380	                </div>
381	              </div>
382	              <div class="form-group">
383	                <label class="col-sm-2 control-label" for="input-sort-order">{{ entry_sort_order }}</label>
384	                <div class="col-sm-10">
385	                  <input type="text" name="sort_order" value="{{ sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control" />
386	                </div>
387	              </div>
388	            </div>
I have excluded some unused variables (Lines 114 - 143 and 282 - 297).

If I edit a product, the error log contains the following errors:

2021-04-20 14:19:20 - PHP Notice: Undefined index: sku in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: upc in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: ean in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: jan in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: isbn in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: length in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: width in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146
2021-04-20 14:19:20 - PHP Notice: Undefined index: height in /home/maupertu/domains/maupertuus.net/storage.../modification/admin/model/catalog/product.php on line 146

File storage.../modification/admin/model/catalog/product.php on line 146 contins the following:

Code: Select all

146		$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = empty('" . $this->db->escape($data['sku']) . "'), upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");
How (which syntax) can I adjust the code on line 146 (here above), so the error doesn't occur? As far as I know I need to adjust the code with "empty()", but I don't know how.
If tried this:
sku = empty('" . $this->db->escape($data['sku']) . "')
and then I get an error page in the browser (see attachment)
and tried this:
sku = '" . empty($this->db->escape($data['sku'])) . "'
and this gives the same error in the error log.

Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.

Thanks in advance...

Attachments

Modifications list.jpg

Modifications list.jpg (438.84 KiB) Viewed 399 times

error page after empty().jpg

error page after empty().jpg (369.72 KiB) Viewed 399 times

Last edited by mauprik on Wed Apr 21, 2021 11:25 pm, edited 1 time in total.

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by straightlight » Wed Apr 21, 2021 7:55 pm

Please use [ code ] and [ /code ] (without spaces) instead of code: and End of Code.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by OSWorX » Wed Apr 21, 2021 8:08 pm

mauprik wrote:
Wed Apr 21, 2021 7:48 pm
I have modified the file ..

If I edit a product, the error log contains the following errors:

PHP Notice: Undefined index: sku .. etc. ..

As far as I know I need to adjust the code with "empty()", but I don't know how.
If tried this:

Code: Select all

sku = empty('" . $this->db->escape($data['sku']) . "')
and then I get an error page in the browser (see attachment)
and tried this:

Code: Select all

sku = '" . empty($this->db->escape($data['sku'])) . "'
and this gives the same error in the error log.

Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.
First of all, when you are "not a programmer", why you are doing so?
Don't want to spend a few bucks for a real professional?
Think it is cheaper at the end if you try it by yourself?

Just a hint: learn what empty(..) is and how to use: https://www.php.net/manual/en/function.empty.php

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by mauprik » Wed Apr 21, 2021 10:50 pm

OSWorX wrote:
Wed Apr 21, 2021 8:08 pm
mauprik wrote:
Wed Apr 21, 2021 7:48 pm
I have modified the file ..

If I edit a product, the error log contains the following errors:

PHP Notice: Undefined index: sku .. etc. ..

As far as I know I need to adjust the code with "empty()", but I don't know how.
If tried this:

Code: Select all

sku = empty('" . $this->db->escape($data['sku']) . "')
and then I get an error page in the browser (see attachment)
and tried this:

Code: Select all

sku = '" . empty($this->db->escape($data['sku'])) . "'
and this gives the same error in the error log.

Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.
First of all, when you are "not a programmer", why you are doing so?
Don't want to spend a few bucks for a real professional?
Think it is cheaper at the end if you try it by yourself?

Just a hint: learn what empty(..) is and how to use: https://www.php.net/manual/en/function.empty.php
If you aren't willing to help me with my problem, why do you bother to respond in this way? Are you frustrated, or so, for someone just trying...? Stupid me.

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by JNeuhoff » Wed Apr 21, 2021 11:26 pm

You have posted a lot of stuff, but not enough details to really help you.

Your errors are caused because you wrongly modified the admin/controller/catalog/product.php. It uses this for e.g. the sku:

Code: Select all

		if (isset($this->request->post['sku'])) {
			$data['sku'] = $this->request->post['sku'];
		} elseif (!empty($product_info)) {
			$data['sku'] = $product_info['sku'];
		} else {
			$data['sku'] = '';
		}
Hence, it would be impossible to get your error unless you wrongly modified or removed this code, which you shouldn't have done.

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by mauprik » Wed Apr 21, 2021 11:29 pm

straightlight wrote:
Wed Apr 21, 2021 7:55 pm
Please use [ code ] and [ /code ] (without spaces) instead of code: and End of Code.
Thank you, I've adjusted the posting, like you mentioned.
And can you also help me with my question?

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by OSWorX » Wed Apr 21, 2021 11:47 pm

mauprik wrote:
Wed Apr 21, 2021 10:50 pm
..for someone just trying ..
Trying is something you can do in your Garden.
Or cooking, or something similiar.

But, here we are dealing with real people, real data .. in sumary sensitive data you have to wotk with!
There is nothing to "try" with that.

After learning how to work and use php, this should be a lesson you should learn before all of that.
A "Playground" could be a "personal" website with a CMS, but NOT a Webshop!

So after said this, when you do not know how to code and make such stupid mistakes at the beginning, what will you do later?
Maybe when your Webshop is running, have orders - then you may think: "hey, good Idea, make a new shipping method or add a new payment method".
No, better not - hire for such a professional.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by mauprik » Thu Apr 22, 2021 6:25 pm

JNeuhoff wrote:
Wed Apr 21, 2021 11:26 pm
You have posted a lot of stuff, but not enough details to really help you.

Your errors are caused because you wrongly modified the admin/controller/catalog/product.php. It uses this for e.g. the sku:

Code: Select all

		if (isset($this->request->post['sku'])) {
			$data['sku'] = $this->request->post['sku'];
		} elseif (!empty($product_info)) {
			$data['sku'] = $product_info['sku'];
		} else {
			$data['sku'] = '';
		}
Hence, it would be impossible to get your error unless you wrongly modified or removed this code, which you shouldn't have done.
I've verified the code above in my files (the default and also the modified one) and it is the same is you placed it here. So that can't be the issue.
You say I posted not enough details, so which details do you need to help me out? Maybe I can at the needed details to the post?!

What I really want to do, is hide the input fields and tabs in the product data, which I don't need (This is more functional for me). Thought that, by changing the code (where the input field is placed on my screen) into comment lines, I could adjust the fields on my product screen. That's why I made the changes in the file "Product-form.twig", because, as far as I now, this only handles the interaction with the screen and leaves all the other code correct.
Now I understand that in the input part of the program the variable is defined and by placing comment tags I also commented the variable definition?
Conclusion: I'm looking for a way to adjust the code, so my product page in the Admin catalogue has the right functionality for my products. If I find a way to adjust this fot 1 input field, I can adjust this also for the others I don't need.

Can you help me out with the right adjustment in the right file? And which other details do you possibly need?

Thanks in advance.
(Going on now with designing for my 3D printer..., one of the many other thinks I do)

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by mauprik » Thu Apr 22, 2021 6:28 pm

OSWorX wrote:
Wed Apr 21, 2021 11:47 pm
mauprik wrote:
Wed Apr 21, 2021 10:50 pm
..for someone just trying ..
Trying is something you can do in your Garden.
Or cooking, or something similiar.

But, here we are dealing with real people, real data .. in sumary sensitive data you have to wotk with!
There is nothing to "try" with that.

After learning how to work and use php, this should be a lesson you should learn before all of that.
A "Playground" could be a "personal" website with a CMS, but NOT a Webshop!

So after said this, when you do not know how to code and make such stupid mistakes at the beginning, what will you do later?
Maybe when your Webshop is running, have orders - then you may think: "hey, good Idea, make a new shipping method or add a new payment method".
No, better not - hire for such a professional.
Will you please stop with your off-topic frustrated comments? I don't need that and it only costs me extra time, which I can spend in a better way...

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by JNeuhoff » Thu Apr 22, 2021 6:53 pm

In that case why don't use just change the input text fields to input hidden fields? E.g. something like this:

Old:

Code: Select all

<input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control"/>
New:

Code: Select all

<input type="hidden" name="sku" value="" id="input-sku" class="form-control"/>

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by OSWorX » Thu Apr 22, 2021 7:10 pm

mauprik wrote:
Thu Apr 22, 2021 6:28 pm
Will you please stop with your off-topic frustrated comments? I don't need that and it only costs me extra time, which I can spend in a better way...
Not really.
Why?
Your are "active" in this Forum since 2018.
Asking all few months a question.
Means, you are running a "Webshop" since then - time enough to learn something.

Your "Shop" look like it was build in the 1990's.

So, you are asking us to help you.
Want always and all for free.
I see only a lazy guy.
Not more to say.
spend in a better way
Good idea: hire a professional.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Thu Apr 22, 2021 7:50 pm

mauprik wrote:
Wed Apr 21, 2021 7:48 pm
Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.
If you can't find free help here, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by mauprik » Fri Apr 23, 2021 1:48 am

JNeuhoff wrote:
Thu Apr 22, 2021 6:53 pm
In that case why don't use just change the input text fields to input hidden fields? E.g. something like this:

Old:

Code: Select all

<input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control"/>
New:

Code: Select all

<input type="hidden" name="sku" value="" id="input-sku" class="form-control"/>
Thanks for the suggestion. I'm going to test it tomorrow in my test site. I shall let you know if this works for me.

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by mauprik » Fri Apr 23, 2021 1:52 am

paulfeakins wrote:
Thu Apr 22, 2021 7:50 pm
mauprik wrote:
Wed Apr 21, 2021 7:48 pm
Can anyone help me with the right adjustments (right syntax)? Please keep in mind I'm not a programmer.
If you can't find free help here, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.
Thanks for the offer, but when if I can't get a solution here, I'll figure it out by myself in the long run, as usual. Only need to find time in between all my other work.

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands

Post by mauprik » Fri Apr 23, 2021 5:44 am

mauprik wrote:
Fri Apr 23, 2021 1:48 am
JNeuhoff wrote:
Thu Apr 22, 2021 6:53 pm
In that case why don't use just change the input text fields to input hidden fields? E.g. something like this:

Old:

Code: Select all

<input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control"/>
New:

Code: Select all

<input type="hidden" name="sku" value="" id="input-sku" class="form-control"/>
Thanks for the suggestion. I'm going to test it tomorrow in my test site. I shall let you know if this works for me.
I tested your suggested code and the input was indeed hidden. But the name and ? (help) was still there. So I searched for your suggestion on the div level and found the following code adjustment:

Original

Code: Select all

 <div class="form-group">
                <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>
                <div class="col-sm-10">
                  <input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control" />
                </div>
              </div>
              

New

Code: Select all

 <div class="form-group" style="display:none">
                <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="{{ help_sku }}">{{ entry_sku }}</span></label>
                <div class="col-sm-10">
                  <input type="text" name="sku" value="{{ sku }}" placeholder="{{ entry_sku }}" id="input-sku" class="form-control" />
                </div>
              </div>
              
And this works as it should. The whole div is hidden, so I don't see the "sku" part in my product page. And after saving the product, there is no error in my system log.

Thanks very much for your suggestion and my problem is now solved.

New member

Posts

Joined
Sun Dec 03, 2017 10:54 pm
Location - The Hague, Netherlands
Who is online

Users browsing this forum: Majestic-12 [Bot] and 30 guests