Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2]

Author Topic: [MOD] ButtonCart - simple shopping cart for sNews (1.5)  (Read 9414 times)

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #15 on: October 08, 2007, 03:04:26 pm »

did you place JS code into sNews 1.6? If yes, try to remove it...
Logged
I like sNews!

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #16 on: October 08, 2007, 03:12:41 pm »

When the error message points to the last line in a PHP file... it usually means that an opening or closing curly-bracket is missing or duplicated somewhee within a mod location. Syntax errors are easier to locate if you comment out the un-modded block of script... copy it and mod the copy... and put the same exact comment string before each location where the mods (for a given mod) are located. Then you can simply search for the same comment throughout the file and review your work... checking it closely with the original mod parts... or disable them all reverting back to the un-modded parts.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Simple

  • Newbie
  • *
  • Karma: 2
  • Posts: 40
    • Simple webDesign
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #17 on: October 08, 2007, 03:18:20 pm »

Good to know that, thank you. I'm new in php and I still have a lot to learn, so I'm back to the drawing board :)
Logged

Simple

  • Newbie
  • *
  • Karma: 2
  • Posts: 40
    • Simple webDesign
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #18 on: October 08, 2007, 04:34:53 pm »

Pali, in your code there is a missing } at the end in the biiig and loooong code (before the JS button)  :). The small cart and also the button in the admin section doesn't work (for now), only if I enter the form directly, as you gave it before.
Logged

Simple

  • Newbie
  • *
  • Karma: 2
  • Posts: 40
    • Simple webDesign
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #19 on: October 08, 2007, 09:48:04 pm »

I managed to make the Add to cart button work, but the it doesn't show the order form. Could this be becauze i'm using a modified snews 1.6? It's the 1.6 ML (Multilingual) version and so far, i didn't manage to figure it out how to change your script to work with this version of sNews :(. But i'll keep trying :)

By the way, the test site is here if you wanna take a look and maybe give me some hints: hungant.ro/site


Thank you.
Logged

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #20 on: October 08, 2007, 10:26:39 pm »

ok, I fixed mising }

order form... try to change return to echo in last line of function html_input()... dont know what kind of side effect this can have... in any case - you will see if this will work ;)
Logged
I like sNews!

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #21 on: October 08, 2007, 11:18:38 pm »

ok, I fixed mising }

order form... try to change return to echo in last line of function html_input()... dont know what kind of side effect this can have... in any case - you will see if this will work ;)
Don't do this - You will simply break 1.6 ;) Instead try this: go through mod code and everywhere You find line that starts with html_input( ... make sure that You put an echo before it. Like from this:
Code: [Select]
        html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', l('cart_sef_cart'), '');to this:
Code: [Select]
        echo html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', l('cart_sef_cart'), '');
P.S. IMHO most evil and useless change introduced from 1.5 to 1.6 - basically breaks up everything that's using html_input() calls across versions and gives no gains the way it was introduced.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #22 on: October 08, 2007, 11:54:33 pm »

P.S. IMHO most evil and useless change introduced from 1.5 to 1.6 - basically breaks up everything that's using html_input() calls across versions and gives no gains the way it was introduced.
And... now that you've pointed out another area that might need improvement... do you have a practical, applicable solution to share with us?  ;)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jared351

  • Sr. Member
  • ****
  • Karma: 4
  • Posts: 276
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #23 on: October 09, 2007, 06:21:04 am »

Hey Pali, Just wondering if there would be any chance of this mod being upgraded to 1.6 and have more dynamics for it such as a mysql backend for products? Cheers!
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #24 on: October 09, 2007, 08:28:30 am »

P.S. IMHO most evil and useless change introduced from 1.5 to 1.6 - basically breaks up everything that's using html_input() calls across versions and gives no gains the way it was introduced.
And... now that you've pointed out another area that might need improvement... do you have a practical, applicable solution to share with us?  ;)
I pointed out solution to coding problem posted above and emphasized common cause for similar ones. As for area of improvement ... what exactly are You talking about and what are the problem that needs a practical, applicable solution to share with You?
Logged

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #25 on: October 09, 2007, 08:36:34 am »

Sorry guys,

i have no time for this right now... im working on multilanguage sNews...

cheers

pali
Logged
I like sNews!

Simple

  • Newbie
  • *
  • Karma: 2
  • Posts: 40
    • Simple webDesign
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #26 on: October 09, 2007, 09:59:28 am »

Pali, a multi language sNews with a shopping cart integrated would be perfect :)
Logged

Simple

  • Newbie
  • *
  • Karma: 2
  • Posts: 40
    • Simple webDesign
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #27 on: October 09, 2007, 10:21:04 am »

Instead try this: go through mod code and everywhere You find line that starts with html_input( ... make sure that You put an echo before it. Like from this:
Code: [Select]
        html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', l('cart_sef_cart'), '');to this:
Code: [Select]
        echo html_input('form', '', 'post', '', '', '', '', '', '', '', '', '', 'post', l('cart_sef_cart'), '');

Thank you, that did it :).

The only problem that i have now is that after sending the order i get this:
"Requested contents could not be found. Please go back or use the search feature."
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] ButtonCart - simple shopping cart for sNews (1.5)
« Reply #28 on: October 09, 2007, 11:00:07 am »

That comes from 404 handling in snews_startup(). As 404 handling isn't present in default 1.5 the MOD doesn't deal with. You should make sure that action sent by this MOD using $_GET is recognized at snews_startup(). Sorry, no time to look into this - but there can be found examples at this forum how non-default things like sitemap.xml MOD were added to 1.6.

P.S. IMHO this one could be final roadblock; so, hammer ahead ;)
Logged
Pages: 1 [2]