Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Heres something else I did... I went in and changed out journal2 as the theme and back to default... and I edited the default template to include the new call for the discounted price. Refreshed all caches etc. And still did not show on the default page.
WTF? How do you guys get so good at this stuff. This drives me crazy.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Angelina
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I can easily modify the templates and it shows what I want it to on the client side. My cache issue is not with the templates. So I was thinking I can make a whole new template... lets call it... product-discounted.twig in the same directory as product.twig. So I will have 2 product templates. This new template I can put in the pricing as I need it... as this feature will just be used for one style of products... and I will not be using the discounts on other products. So essentually I wanna make a second template just for that group of products... which will already have a nice little table with pricing built in for showing on clients side and will not reply on the controller file for pricing. understand ?
In the product admin... the last tab is for design. Could i use that somehow to select the design I want to use so for this product I would wanna call in that second template. Is that possible?
For testing purposes, you'd save a lot of time using this approach.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Angelina
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
See: http://wrappedcandybars.com/1234
It was very easy using PHP.
Code: Select all
<?php
$first = substr($discount['price'],1);;
$second = .80;
$operation = "*";
$answer = eval('return '.$first.$operation.$second.';');
echo $answer;
?>
And then figure out how to convert to twig. lol
Yea I will try a new install fresh on a new sub-domain.straightlight wrote: ↑Wed Oct 25, 2017 9:52 amA fresh install means that no extensions at all are installed (including Journal2) as well as using Opencart the way the features are currently handled from the core once the files have been deflated from the ZIP file and the database being successfully added on the database.
Code: Select all
<?php
$first = substr($discount['price'],1);
$second = .80;
$operation = "*";
$answer = eval('return '.$first.$operation.$second.';');
echo round($answer, 2);
?>
Is there a way for me to add PHP code into a twig template?... while using twig variables?
Something like:
Code: Select all
<?php
$first = substr({ $discount.price },1);
$second = .80;
$operation = "*";
$answer = eval('return '.$first.$operation.$second.';');
echo round($answer, 2);
?>
Code: Select all
$first = substr($discount['price'], 1);
$second = .80;
$operation = "*";
$answer = eval('return ' . $first . $operation . $second . ';');
$data['answer'] = round($answer, 2);
Code: Select all
{% if answer %}
{{ answer }}
{% endif %}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I then reverted the changes back to standard file and test and the changes were no longer there as to be expected. So i then loaded journal2 and turned it on. Then i went to edit the controller file again and could not get the changes to take effect no matter what i tried. clearing cache, changing browsers, changing devices etc.
So Straightlight... you were correct in thinking that journal was messing something up. I messaged the developer and they are saying that there's nothing wrong.... so I bought hosting on a totally different server from a different company... and did a fresh install of opencart. Again was able to play with the controller file and changes took effect. again when i put on journal2 changes no longer took effect. Its wierd cause the file shows the changes but you dont see the effects of the changes on the front end.
So yes... journal has a weird cache thing going on.
As for the code... It took me a while to play with it and I figured out what I had to do to get it to work in the controller:
Code: Select all
'after_discount' => number_format((($discount['price']) * 0.80), 2)
Now I know if I start all over again with my website... I can change the controller file prior to installing journal... but then after I do I cant change it... so if the discount changes... Im basically screwed. So I gotta try to figure out a way to do this within the template file like I did on my 1.5.6 install.
Angelina
Users browsing this forum: No registered users and 135 guests