Pulse Script ex-vat and 3 decimal places

Open to all! Ask other shopowners for help.
cbs
Member
Posts: 53
Joined: Tue Oct 26, 2021 9:42 am
Phoenix Version: v1.1.0.7
Has thanked: 9 times
Been thanked: 6 times

Pulse Script ex-vat and 3 decimal places

Post by cbs »

Why does our pulse script code show the prices ex-vat and with 3 decimal places?

Code: Select all

<script>
  window.pulse = window.pulse || [];
</script>
<script>
  window.pulse = window.pulse || [];
  window.pulse.push({
    event: 'product_view',
    payload: {
      product_name: "product_name",
      sku: "sku",
      price: 29.158,
      currency: "GBP",
      product_id: product_id
    },
    page_url: window.location.href,
    referrer: document.referrer,
    domain: window.location.hostname,
    timestamp: new Date().toISOString()
  });
</script>



Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4791
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 288 times
Been thanked: 487 times

Re: Pulse Script ex-vat and 3 decimal places

Post by burt »

That's the price of that particular product, right? Check it out (in your admin product editing/adding page, or direct in the DB).

I'd be more worried about `product_name: "product_name",` but I'm guessing you changed this for privacy?
I am not here to build for you.
I am here to build with you. Let's help each other.

cbs
Member
Posts: 53
Joined: Tue Oct 26, 2021 9:42 am
Phoenix Version: v1.1.0.7
Has thanked: 9 times
Been thanked: 6 times

Re: Pulse Script ex-vat and 3 decimal places

Post by cbs »

Sorry, yea I've removed the product name, SKU and product id. They are all correct.

That's price without VAT but it really should be with VAT.

cbs
Member
Posts: 53
Joined: Tue Oct 26, 2021 9:42 am
Phoenix Version: v1.1.0.7
Has thanked: 9 times
Been thanked: 6 times

Re: Pulse Script ex-vat and 3 decimal places

Post by cbs »

Looked in the database and 29.158 is the price there, would I need to edit the pulse file to add VAT or is there another way of doing it?

User avatar
burt
Core Team
Posts: 4791
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 288 times
Been thanked: 487 times

Re: Pulse Script ex-vat and 3 decimal places

Post by burt »

I'm probably missing something obvious here, apologies if so...

What/where is the price used, and why would having it incl tax make a difference ?

It's only stored in the `payload` blob, right?
I am not here to build for you.
I am here to build with you. Let's help each other.

cbs
Member
Posts: 53
Joined: Tue Oct 26, 2021 9:42 am
Phoenix Version: v1.1.0.7
Has thanked: 9 times
Been thanked: 6 times

Re: Pulse Script ex-vat and 3 decimal places

Post by cbs »

I have no clue what pulse is or what it's used for but it's on every product page.

It just seems like having all the prices in the code on the page matching using the same format would be best practice.

User avatar
burt
Core Team
Posts: 4791
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 288 times
Been thanked: 487 times

Re: Pulse Script ex-vat and 3 decimal places

Post by burt »

Inbuilt Analytics, see report page in your admin area (I don't recall which menu), maybe "reports".
I am not here to build for you.
I am here to build with you. Let's help each other.

User avatar
burt
Core Team
Posts: 4791
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 288 times
Been thanked: 487 times

Re: Pulse Script ex-vat and 3 decimal places

Post by burt »

@cbs
After you've had a look to see what Pulse is, post back if you still need prices with VAT.
It'll be a hook override and fairly straightforward, I think.
I am not here to build for you.
I am here to build with you. Let's help each other.



Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply