dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/06/2020 : 07:40:02
Hi Richard, sure apply the updater and there is a new feature we want to use. You can now set custom css classes on products. https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=112425 quote: You can now add custom CSS classes to a product on a per-product basis. The classes can be added through the Admin Products Quick Entry and can be used, for instance, to set a class for products which are on sale so an overlay image can be used, or anything else you like really.
Once the update is installed, you can use the quick entry feature to add a unique class to the products that need to use this feature. Let's just use the following - hasmap I'll get to rewriting the new code and testing that here. Once this is all setup, they will just add that class to any products that need to have the ask a question feature for the price, on the products pages. Thanks, David
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/06/2020 : 07:49:12
thanks Dave - I have opted for the last stabke release on the updater - ill get it done later this evening / tomorrow morning
Many thanks Dave
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/06/2020 : 21:28:08
Hi Richard, I believe I have the new code worked out. I am testing it now, and before I hand it off to you, I want to get a look at the updated store. This new code will be much more reliable.
Thanks, David
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/07/2020 : 04:19:21
excellent Dave
I have version 7.1.10 now applied - just taking a full back up and have a few tweaks to make and ill message as sioon as I have finished and your welcome to whatever info you need
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/07/2020 : 05:09:53
excellent Dave
I have version 7.1.10 now applied -
All done and waiting now for further instructions :)
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/07/2020 : 06:15:09
Hi Richard, I sent a message and asked for a reply, and I will email the code. Here is a screen shot of what you need to do in the admin. Just add that custom class to any products that require this feature on the products page. Here is a demo where you can see it working. https://www.floridasurpluswarehouse.com/dev/products.php Thanks, David
Edited by - dbdave on 07/07/2020 06:16:32
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/07/2020 : 06:24:54
Thank you Dave reply just sent :)
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/07/2020 : 06:44:11
Hi Richard, I've sent the email with the code after testing this on the search page to be sure it's working there https://www.floridasurpluswarehouse.com/dev/search.php?pg=1&stext=1+dozen+doughnuts
Thanks, David
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/07/2020 : 13:01:17
Hi Richard, looking at the product pages, it looks like you go it going...
Let me know if you have any questions or issues.
Thanks, David
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/07/2020 : 23:56:45
Thank you Dave
looks fine to me - I have tweaked the language file so it says what is needed on the popups :)
Ill let the customer try and break it now
Have a great day
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 07/08/2020 : 07:42:16
Hi Richard, speaking of breaking it, I think what became the issue was a product with options having a configure button instead of an add to cart button. I had warned about that in an older post in this thread back in July 2018. quote: You would also have a problem if a product had options because the buy button does not show, instead it's a configure button that will show.
The new code handles that just fine. I don't think you will will have any issues at all now. Just instruct the client to add that class to any products that need to use that feature and that's it. Thanks, David
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 07/08/2020 : 07:50:10
Thanks Dave
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 09/19/2020 : 04:38:36
Okay this site keeps ruimbling on with odd errors running latest version of shopping cart its using Daves fantastic email for price tweak using the css - BUT randomly on both the search and the product listings it will show some with a add to cart buttons and others without -
http://www.baby-barn.co.uk/products.php?cat=40 looking through the products listed there you will see what I mean
Any suggestions?
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 09/19/2020 : 07:33:48
Hi, have you confirmed that the "hasmap" class has been assigned to those products that are not working as expected?
Thanks, David
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 09/19/2020 : 07:44:13
Hi Dave
Thanks for taking the time to reply. - especially at a weekend.
Sorry I am not explaining myself correctly - the email for price works perfectly.
This issue is when a "normal" product is listed for sale - its add to cart button has randomly gone - if you look at the link http://www.baby-barn.co.uk/products.php?cat=40 the last 2 products on that page are available to buy but the add to cart button isn't there as expected. I have checked and there is no css code on those 2 products
Looking at the site as a whole it appears fairly randomly and I can't for the life of me see what ids different on those products to not have them show add to cart
|
dbdave
ECT Moderator
USA
10398 Posts |
Posted - 09/19/2020 : 08:35:57
I believe that should be a "configure" button there because those products have options. Using inspect in my browser, I see div.configbutton { display: none; } Can you check to see if you have that set in the page. It shows as "inline" so it's not coming from your css file. :::Edit::: Yes, I see it in the source of the page. quote: <style type="text/css"> div.configbutton{display:none;} div.sccheckout input{display:none;} </style>
Thanks, David
Edited by - dbdave on 09/19/2020 08:37:24
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 09/20/2020 : 03:27:58
thanks Dave
As you say it comes from the page search.php and the products.php have the following extra coding on the page directly following the
<?php include "vsadmin/inc/incsearch.php";?>
<script> function efformvalidator(theForm){ if(document.getElementById('yourname').value==""){ alert("Please enter a value in the field \"Your Name\"."); document.getElementById('yourname').focus(); return(false); } if(document.getElementById('youremail').value==""){ alert("Please enter a value in the field \"Your Email\"."); document.getElementById('youremail').focus(); return(false); } if(document.getElementById('askq').value!='1'){ if(document.getElementById('friendsemail').value==""){ alert("Please enter a value in the field \"Your Friends Email\"."); document.getElementById('friendsemail').focus(); return(false); } }else{ } return(true); } function dosendefdata(){ if(efformvalidator(document.getElementById('efform'))){ var ajaxobj=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP"); var yourname=document.getElementById("yourname").value; var youremail=document.getElementById("youremail").value; var friendsemail=(document.getElementById('askq').value=='1'?'':document.getElementById("friendsemail").value); var yourcomments=document.getElementById("yourcomments").value; var efcheck=document.getElementById("efcheck").value; postdata="posted=1&efid=" + encodeURIComponent(document.getElementById('efid').value) + (document.getElementById('askq').value=='1'?'&askq=1':'') + "&yourname=" + encodeURIComponent(yourname) + "&youremail=" + encodeURIComponent(youremail) + "&friendsemail=" + encodeURIComponent(friendsemail) + "&efcheck=" + encodeURIComponent(efcheck) + (document.getElementById("origprodid")?"&origprodid="+encodeURIComponent(document.getElementById("origprodid").value):'') + "&yourcomments=" + encodeURIComponent(yourcomments); for(var index=0;index<10;index++){ if(document.getElementById('askquestionparam'+index)){ var tval,ob=document.getElementById('askquestionparam'+index) fieldtype=(ob.type?ob.type:'radio'); if(fieldtype=='text'||fieldtype=='textarea'||fieldtype=='password'){ tval=ob.value; }else if(fieldtype=='select-one'){ tval=ob[ob.selectedIndex].value; }else if(fieldtype=='radio'){ for(var ii=0;ii<ob.length;ii++)if(ob[ii].checked)tval=ob[ii].value; }else if(fieldtype=='checkbox') tval=ob.value; postdata+='&askquestionparam'+index+'='+encodeURIComponent(tval); } } ajaxobj.open("POST",'emailfriend.php?lang=',false); ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajaxobj.send(postdata); document.getElementById('efrcell').innerHTML=ajaxobj.responseText; } } if (document.getElementsByClassName("hasmap")[0]) { var prodcount = document.getElementsByClassName("hasmap"); for(var i = 0; i < prodcount.length; i++) { var idcheck = document.getElementsByClassName("hasmap")[i] var idresult = idcheck.getElementsByTagName("input")[0].value; var askque = ('<input value="Email for Price" class="askaquestion " onclick="openEFWindow(\''+idresult+'\',true)" type="button">'); if (idcheck.getElementsByClassName("price")[0]) {idcheck.getElementsByClassName("price")[0].innerHTML = askque;} if (idcheck.getElementsByClassName("configbutton")[0]) {idcheck.getElementsByClassName("configbutton")[0].style.display = "none";} if (idcheck.getElementsByClassName("buybutton")[0]) {idcheck.getElementsByClassName("buybutton")[0].style.display = "none";} }} </script>
In that case should this be edited?
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 09/20/2020 : 03:38:02
ok have removed <style type="text/css"> div.configbutton{display:none;} div.sccheckout input{display:none;} </style>
and now pops up with a configure option to take to product details
Thanks Dave - was a little slow off the mark this morning :)
|
webspaceunlimited
Advanced Member
United Kingdom
189 Posts |
Posted - 11/20/2020 : 10:06:33
Hi
Well this has been working fine now with the hasmap css for the email for price
One the other items we have been getting an intermittent "configure" appear instead of add to cart
I have looked at the entries in the admin and I can't immediately see any difference between a correct entered product showing add to cart and ones that will show configure
So wondering if you have any ideas?
https://www.baby-barn.co.uk/products.php?scri=11 that shows an example of when it displays configure
Many thanks
|
1818charlie
ECT Moderator
United Kingdom
1192 Posts |
Posted - 11/20/2020 : 11:26:08
I think the Configure (Add to Cart) button shows like that if you have product options, which does make sense, although I'm not sure when that change came about. Vince may know the answer.
Steve Egerton Village, Bolton, UK
Edited by - 1818charlie on 11/20/2020 11:27:45
|
|