Closed (fixed)
Project:
Ubercart AJAX Cart
Version:
6.x-2.0-alpha5
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Apr 2009 at 14:15 UTC
Updated:
16 Dec 2009 at 09:50 UTC
In the hook uc_ajax_cart_block you are using:
//Only a wrapper to uc_cart_block
$content = uc_cart_block($op,$delta,$edit);But what about to make a new hook to make a chance to override standard Ubercart block? (e.g. to integrate with my own Pictured cart block).
The draft of the code:
$contents = module_invoke_all('ajax_cart_viewblock');
if (!empty($contents[0])) {
$content = $contents[0];
}
else {
$content=uc_cart_block($op,$delta,$edit);
}
Comments
Comment #1
erik seifert commentedThis is not my intend to make a new cart. I only want to extend uc_cart for ajax capabilities. But this functionality, what you want, should go directly to uc_cart.
But i will have an look on your module. Because there could be a better way ?
Comment #2
erik seifert commentedHa how about this. We could make a 'template' support.
So any module can make a new theming function for display cart. So a administrator can change a cart view like
* Normal view ( uc_cart )
* With images ( uc_pic_cart_block )
Sounds good ?
Comment #3
Vetkhy commentedWell, maybe...
In the ajax cart module?
Sorry, I little bit confused... I'll try to describe how I understand your idea.
I will implement
cart_templatehook that return name of theme function (and, of course, theme function also). Then administrator should change a cart view in the settings of your block (module), shouldn't he?Comment #4
erik seifert commentedYeahh ;- ). That was my intention . So i can make a default implementation for uc_cart. That could also override this cache for anonymous user ( click here to see cart ).
But this should be go in 2.0 ;- ) . But i will make a proof of concept.
Comment #5
Vetkhy commentedOK! Why not? Please let me know, when I can try to implement it!
Comment #6
erik seifert commentedI will make an proof of concept and give you a special version till next week. So you can try it out ;- )
Comment #7
Vetkhy commentedHello! What about our idea?..
Comment #8
erik seifert commentedSorry, im very busy these days. But on the other side. Do you know how i can make only a development release without a official release ?
Comment #9
Vetkhy commentedOh, I'm sorry too.
Do you mean "development snapshot", something like your "alpha1" or something else?
Comment #10
erik seifert commentedYeah but without a official release .
Comment #11
Vetkhy commentedUmm... No...
Comment #12
erik seifert commentedHave a look in 2.0-Alpha5 with template support.
Comment #13
Vetkhy commentedOK, I'll see it.
Comment #14
Vetkhy commentedHello again!
The UI is very beautiful now, but the idea:
seems to be unrealized.
Is the custom theming (override theme
uc_ajax_cart_block_content) only way to change templates by another module?Comment #15
erik seifert commentedNow you have two options to override layout.
(1) Write your own 'preprocess' hook ( see "uc_ajax_cart_preprocess_uc_ajax_cart_block_content" in see in uc_ajax_cart.theme.inc .
(2) Write your own template for example uc_ajax_cart_block_content.tpl.php
I think the best way, for making better theming, is to have a view for cart contents. This should be very nice for building your own cart and give you an complete control over layout and data.
Comment #16
Vetkhy commentedThank you! So I'll think about 'preprocess' hook.
Comment #17
erik seifert commentedI think this is now possible to have a custom layout for cart. But next step is to create a view for cart content.