Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Delete Line in Cart "Applicable Diccounts..."
Author « Topic »  

Mooseman
Advanced Member

166 Posts

Posted - 04/30/2021 :  09:23:13  
In the 2nd cart page, I need to delete/hide the line:
---
Applicable Discounts Discounts applicable to login: (name)
---
(screen shot of same)


Thanks in advance

Vince
Administrator

42428 Posts

Posted - 05/01/2021 :  01:25:28  
Hi Mooseman
There isn't a way to remove that row as it's not really something that has come up before. If it's important then I could add a class to the row so it could be hidden in CSS but it would mean updating the inccart.php page. Just let me know if you'd like me to make the change.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Phil
ECT Moderator

United Kingdom
7609 Posts

Posted - 05/01/2021 :  01:38:16  
Hi Bill,
You could add these entries to your includes and set the font to white perhaps?

$GLOBALS['xxAppDs']='Applicable Discounts';
$GLOBALS['xxLIDis']='Discounts applicable to login: ';

But you would still have the login name displayed, so that would require an edit



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

Mooseman
Advanced Member

166 Posts

Posted - 05/03/2021 :  12:34:57  
Hi Vince,

The content in question was simple enough to comment-out myself in 'inccart.php' without messing-up anything else.

I do understand it will get over-written with my next upgrade, so I added a comment to 'cart.php' reminding me what I did.

+++
FYI... The whole issue in this instance is to avoid raising any questions whatsoever about any discounts because products may be subject to insurance reimbursement. As such it may be something you want to consider making optional.
+++

Thanks for pointing me in the right direction.

dbdave
ECT Moderator

USA
10245 Posts

Posted - 05/03/2021 :  13:14:07  
I can show you how to hide that without hacking the code if you like.
I would just use javascript to target it.
David

Mooseman
Advanced Member

166 Posts

Posted - 05/03/2021 :  14:06:45  
Absolutely David. That would be terrific!

What do you need from me, if anything?

dbdave
ECT Moderator

USA
10245 Posts

Posted - 05/03/2021 :  14:43:06  
I may need to see it working on your site, but before we do that, I'll see if I can work it out on my php test site.
I just want to make sure your site is setup the same as my test site.

I'll reply back with something soon.

David

dbdave
ECT Moderator

USA
10245 Posts

Posted - 05/03/2021 :  17:57:13  
Ok, so place this code in your cart.php page somewhere after the include line <?php include "vsadmin/inc/inccart.php" ?>

<script>
//Hide Applicable discounts line in cart
if (document.getElementsByClassName("cart3details")[0]) {
var cartrows = document.getElementsByClassName("cart3row");
for (i = 0; i < cartrows.length; i++) {
var loccrtrow = cartrows[i].innerHTML;
if (loccrtrow.includes("Discounts applicable")) {
cartrows[i].style.display = "none";
}}}
</script>


This is my ideal solution because the cart3row class might show up in multiple lines in your cart and we don't want to hide the wrong one.
This code is fairly simple. It starts by checking that you are on the 3rd page of checkout, then runs. It loops through all elements that use the cart3row class, looking for a match for the string "Discounts applicable", if found, it sets that div to not show, using css.
To me, as the code is now, this is the surest way to hide the correct div.

Thanks,
David

Edited by - dbdave on 05/03/2021 17:59:20

Mooseman
Advanced Member

166 Posts

Posted - 05/04/2021 :  10:37:46  
Your script worked perfectly David!

Thank you for the assist.

dbdave
ECT Moderator

USA
10245 Posts

Posted - 05/04/2021 :  10:46:04  


No worries.
I tend to lean on Javascript for these things in favor of mods to the core files.

Thanks,
David
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000