liqiusheng / silverstripe-ecommerce

Automatically exported from code.google.com/p/silverstripe-ecommerce
0 stars 0 forks source link

CartTinyInner.ss problem #323

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
eCommerce version affected: trunk 1.0 r2613
SilverStripe version: 2.4.7
Browser/Operating System used: Firefox 12 /Windows 7

Hi Nicolaas!

I can not make a new template file in themes for overloading CartTinyInner.ss
In ecommerce\code\control\CartResponse.php (Line 122) you put:
------------
        $js[] = array(
            "t" => "class",
            "s" => $ajaxObject->TinyCartClassName(),
            "p" => "innerHTML",
            "v" => $currentOrder->renderWith("CartTinyInner")
        );
------------
Apparently, the renderWith() function searches the template only on the path:
ecommerce\templates\Includes\
when used from an AJAX call, so ecommerce module can not find the new 
CartTinyInner.ss file that I put in
themes\mysite\templates\Includes

Perhaps your have to use a different function, instead of renderWith.

Thanks,
Regards,
Jose

Original issue reported on code.google.com by supp...@sendasoft.com on 6 May 2012 at 9:22

GoogleCodeExporter commented 8 years ago
Hi Jose

I dont think that is correct... but I am not 100% sure. Can you do the 
following:

1. create a "themed" version of "CartTinyInner" ... let me know if you are 
unsure on how to do that.

2. do a ?flush=all ... let me know if you are unsure on how to do that.

3. open /shoppingcart/showcart/?flush=all to see if it is working.

If you still have the problems then we will look into it.

Original comment by nfranc...@gmail.com on 6 May 2012 at 10:48

GoogleCodeExporter commented 8 years ago
Hi Nicolaas!

I see that if I do not put pictures for you, you do not believe me. :)
I always do flush=all :)

I put some screenshots in order that you believe me. :)

Thanks,
Regards,
Jose

Original comment by supp...@sendasoft.com on 7 May 2012 at 10:59

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Nicolaas!

I have done further research on this problem.
I'll explain the following to see if I can help to solve the problem.

For some reason (that I do not know), if the file jquery.js is placed third, 
the problem disappears.
-------------------
<script type="text/javascript" 
src="http://127.0.0.1/ecommerce/javascript/EcomCart.js?m=1335876831"></script>
<script type="text/javascript" 
src="http://127.0.0.1/ecommerce/thirdparty/simpledialogue_fixed/jquery.simpledia
log.0.1.js?m=1335876831"></script>
<script type="text/javascript" 
src="http://127.0.0.1/themes/mysitebootstrap/js/jquery.js?m=1328047222"></script
>
-------------------

However, this causes other errors, such as fixed in Issue 286.

Regards,
Jose

Original comment by supp...@sendasoft.com on 10 May 2012 at 6:33

GoogleCodeExporter commented 8 years ago
Hi Nicolaas!

I've found the problem.
My theme is set by CMS and is mysitebootstrap.
However in _config.php I have SSViewer::set_theme('mysite');
SilverStripe, when we use renderWith, not use the current theme in the CMS, use 
the indicated in _config.php, so it can not find the new template CartTinyInner 
that I have put in my mysitebootstrap theme.
Obviously this is a SilverStripe problem.
The theme indicated in the CMS should be, for all purposes, used internally.

Regards,
Jose

Original comment by supp...@sendasoft.com on 15 May 2012 at 1:13

GoogleCodeExporter commented 8 years ago
ok - so just double checking, this is not a bug we need we fix?

Original comment by nfranc...@gmail.com on 10 Jun 2012 at 4:39