Closed (won't fix)
Project:
Drupal.org CVS applications
Component:
new project application
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Jun 2010 at 20:44 UTC
Updated:
17 Apr 2019 at 16:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
raphael apard commentedAsking for create my own project : Module "UC Cart extra settings"
------------
Description
------------
This module provides extra settings for UC Cart.
- Alter cart columns order
- Overwrite cart columns titles
- Add "Unit price" column
- Replace items remove checkboxes by text or image
- Freeze cart items quantity inputs text
- Hide update cart button
------------
Requirements
------------
- Drupal 6
- UC Cart
------------
Installation
------------
- Copy uc_cart_extra into your drupal modules directory
- Enable the module on the Modules admin page:
Administer > Site building > Modules
- Go to UC cart settings page to alter default settings
Administer > Store administration > Configuration > Cart settings
Best regards,
Raphael
Comment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
Comment #3
raphael apard commentedHello and thanks too.
I made some corrections about a multilangual variable and add some check_plain(), so i post the new version.
Sorry for this duplicate upload but i can't edit the first one.
I have a question for volunteers :
I use a reverse function of t() because of cart column default titles which are defined as t('Some text') before i get them.
May i use i18n multilingual variables for those values to avoid that ? But i saw that Order workflow do not use them so i'm not sure ?
This will be probably more easy to understand reading code.
Regards
Raphael
Comment #4
raphael apard commentedHello,
I update my module. Now it use i18n multilingual variables for cart column titles, and i remove the reverse t() function.
Regards
Raphael
Comment #5
raphael apard commentedA screenshot of what does this module
Comment #6
joachim commentedModule looks pretty good on a read of the code.
Some minor points could do with addressing:
- DEFINE('CART_REMOVE_IMG', base_path() . drupal_get_path('module', 'uc_cart_extra') . '/delete-icon.gif');
You're only using this twice, and in the same function too. You don't need this as a constant.
- uc_cart_extra_init
Do you really need to run this on every single page load? I am not entirely sure what it does, but could it be run more selectively?
- it's good practice when you define variables to delete them all in your module's hook_uninstall().
- code formatting points to bear in mind: space after foreach and switch; space after comma in function calls; space before opening a block brace; space after semicolon in C-style foreach; space either side of comparison operators. Hence this:
should be:
- keywords like TRUE, FALSE, and NULL should be in capitals.
I'm going to recommend this for a CVS account, as I see good attention to detail in general (bonus points for doxygen headers on all functions!) and I'm confident the module author will address the above points before making a release :)
Comment #7
avpadernohook_init()is executed for not cached pages; depending from the module, that can create problems.There is a Drupal theme function to use in this case.
hook_uninstall().Comment #8
raphael apard commentedHi,
Thanks to joachim & kiamlaluno for your replies.
I fixed issue from joachim message, but i don't know what to use :
1. for
Do I have to use an implementation of hook_boot() ?
I need to set these i18n variables.
2. And for :
I use a themable function as :
Is that correct ?
Thank you for your time
Regards
Raphael
Comment #9
joachim commenteduc_cart_extra_init() -- my point about this was do you actually need to do all this on *every single loaded page of the site*? It seems to me you probably don't. Thus hook_boot() would be just as bad!
Also -- though these are moot --
- global $conf; -- namespace globals! don't assume your module will be the only one to want to call a global variable $conf ;)
- $table = uc_cart_view_table(null); -- NULL, not null.
$pattern = '
Comment #10
raphael apard commentedThanks for helping me. I fix all issues except the big for i18n_variables.
I don't see antoher way to define them, ubercart module use hook_init(), and i find this :
http://drupal.org/node/313272#comment-2786004.
Maybe i will have to remove i18n_variables and use regular variables or somebody knows a way to do this.
Comment #11
raphael apard commentedHy,
Here a new version of my module.
I'm using regular vars, translated as usual with t() function.
Hope everything is fine now.
Regards
Raphael
Comment #12
tr commentedI'm a little disturbed that you would go off and spend time writing your own module and trying to get a CVS account instead of helping out and contributing to issues like #529110: Users misunderstand "Remove” checkbox on cart page and #930770: Display unit price in cart, which are addressing the functionality you are "adding" with your module. Drupal and Ubercart are community projects, which means they rely on the community to participate and make these improvements happen. Maybe you are unaware of these efforts in the Ubercart issue queue, in which case I would suggest that CVS privileges be withheld so that you don't inadvertently keep on creating more modules that duplicate or invalidate what's going on in the community.
Comment #13
raphael apard commentedI understand you but i'm thinking that write again some diff file is not the best way to contributing to ubercat project. Writing this module will give an alternative to customize easily ubercat cart table.
Are you sure that diff file is a good way for this ?
Comment #14
joachim commented> some diff file is not the best way to contributing to ubercat project
Actually, patches are the main way of contributing to module development.
I don't know enough about this proposed module, or those UC issues to comment on the specifics, but submitting patches to modules is (nearly) ALWAYS better than writing a new module to hack it.
Comment #15
avpadernoI agree with joachim; to contribute to the development of an existing module is generally preferable to creating a new module that duplicates the functionality of the first module.
Comment #16
raphael apard commentedYou ve got right, i was thinking patches (on basic drupal user view) like something getting drupal hard to update.
I did'nt realize that patches could be included on main projects.
I just checked link #529110: Users misunderstand "Remove” checkbox on cart page, the last patch is a better than mine (i use javascript).
So it's ok for this part. I will see if i can be useful on the other one.
Sorry for spent time and for my english
Comment #17
avpadernoComment #18
avpaderno