Clear custom field data

bret_ortonbret_orton Member
in Bugs & Feature Requests edited October 2008
I have two links, one with a hidden, custom field in the URL:

1. https://[my_foxy_url]/cart?name=Male&price=1
2. https://[my_foxy_url]/cart?name=Female&price=1&h:sometimes_problematic=true

If I test link #2, I get my custom field posted back in the datafeed. I can also add such a link to the cart and check the fc_json object via Firebug and see the custom field there. However, if I clear my cart, or even come back empty after purchasing link #2 my fc_json object continues to carry that custom field. It also comes through the datafeed when I don't want it.

Any thoughts on how to get that cleared when necessary? Only way I've currently found is to kill applicable cookies. Or, would it be done via something like the fc_PreProcess() ? I've tested FF3 on linux and IE6 on windows.

Thanks as always for the help.
- bret
Comments
  • brettbrett FoxyCart Team
    Hmmm... Yeah, the h: prefix makes it a "session variable," which lasts for the entire session.

    Can you explain what you're attempting to do? I think that will help me understand how we can help you.
  • Apologies. I just rechecked the docs. I kept looking at "h:" in my code and kept thinking hidden passthru, as it's not shown in the cart and comes back in the datafeed.

    Essentially, I want to be able to differentiate the same product as being purchased by a regular user or an authenticated user (who could be the same person, just existing in a different 'state' on the site), pass it through the cart and get it on the down-low via the datafeed.

    Now that I think about it, it seems I should handle such details in this case in a preprocess javascript. But, since I'm here, is there functionality for a hidden, custom field to be sent through the cart and come back via datafeed?

    Thanks again, Brett, for being so fast in responding.
    Cheers,
    - bret
  • lukeluke FoxyCart Team
    Hey bret. I think the h: prefix should work for what you're describing. We should probably clear that out after the transaction takes place. In most cases, users won't be purchasing over and over from the same computer (like we do in testing) so it shouldn't affect that many people.
  • Thanks for the reply Luke.

    In my case, I was testing being both a CSR and a regular customer ( a CSR transaction via a back-end interface on behalf of a customer get's a flag + their login name tied to the transaction ). After a night's sleep, in the case of a CSR / regular customer, I shouldn't have an issue using regular pass-thru values when a CSR's doing the transaction. After all, it's all about how you parse that datafeed... that lovely, lovely datafeed.

    Take care guys and thanks for the input.
    - bret
  • brettbrett FoxyCart Team
    Yeah, I'd probably do it the way you described, so the flag is actually on the product and not a session variable, but you definitely have some options. Just depends on what's going to work best. Let us know what you end up with, as we always like to hear how people are using the functionality available.

    We're glad you like the datafeed ;) We like it too.
Sign In or Register to comment.