Jump to content

Using Mailto: Javascript clash


Guest ballesdegolf.fr

Recommended Posts

Guest ballesdegolf.fr

Hi there again!

I am trying to adapt a piece of script from a MOD (which in the interests of not advertising I have removed the details of in the below) which replaces the stand OUT OF STOCK text on a ")" stock item and creates a popup if you try and add it to the cart:

<?php

$lang['front']['viewProd']['variant_out_of_stock'] = "Cette catégorie du STOCK est actuellement épuisée. Veuillez vérifier les autres qualités ou NOUS CONTACTER ";

$lang['front']['viewProd']['variant_not_available'] = "Cette catégorie du STOCK n'est pas disponible. Veuillez vérifier les autres qualités ou NOUS CONTACTER ";

?>

What I would ideally like to do is to make the NOUS CONTACTER into some kind of mailto: link. If I insert a simple <A HREF etc then firstly it dislikes the "" - so I changed them to '' - however this doesn't create the parse error the "" does - but now the text including the <A HREF=........../A> all appears on the page.

Having fiddled around it appears that the HTML tags are not being recognised at all - which I am led to believe is a Javascript related thing, although having not enough experience myself I don't know! If anyone can think of a way of doing this I'd love to hear from them!!

Thank you again to everyone who has read my previous questions. I am nearly there and will look forward to hearing your feedback when I post it in the Show Off section. This is my first attempt so - be prepared to be underwhelmed!!!

Cheers

Jim

Link to comment
Share on other sites

No, html and js can be used there, but of course you cannot use a double quote unless you comment it, otherwise the script thinks it has hit the end-of-string marker which is a double quote.

Something like this should be fine:

$lang['front']['viewProd']['variant_out_of_stock'] = "Cette catégorie du STOCK est actuellement épuisée. Veuillez vérifier les autres qualités ou <a href=\"mailto: [email protected]\">NOUS CONTACTER</a> ";

Do note that stock CubeCart uses an XHTML 1.0 transitional doctype declaration, and for the code to be valid your html tags need to be lowercase not uppercase.

escape inside double quotes with \ like \"

Link to comment
Share on other sites

Guest ballesdegolf.fr

Hi Mark

Thanks for your reply - I have tried your suggestion - unfortunately I have still had no luck!

Ahhhhhhhhhhh

Jim

Link to comment
Share on other sites

OK, well there is more to the story then. I have no idea where you are trying to put this code etc. etc.

Since you are talking about mods and can't give full info, I would suggest you not post here. Use a third-party forum, or contact the mod author.

If this were a line in the correct php file, for instance, the lang.inc.php file, the code I gave you should work just fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...