Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

Vous parlez français ? par ici !
[Solved] Modified bankwire mod - ALMOST works - need help
#1
Posted 17 November 2008 - 01:44 PM
It basically works 99%, but the problem is I can only get it to work if I keep all the core variables and methods named the same as in the bankwire module, plus it has to reside in a directory called "bankwire". These two modules can not co-exist obviously so I had to delete the real "bankwire".
Now if I try renaming the module to "westernunion" it will generate a not found in config error on the Modules page. I then tried to rename the Class and all the other variables named "bankwire" into "westernunion", then it will at least appear in the install list but it still fails at install.
Like I said, the module is functional as long as it remains named "bankwire". Agghh!
It seems like the file name of the module appears to be very closely tied to the module objects, but I don't understand the logic, nor do I understand how to overcome this.
Can anyone give me some pointers?
#2
Posted 17 November 2008 - 02:54 PM
1) Rename the module directory to the module name (lowercase) e.g. "westernunion"
2) Rename the main php file containing the module class definition to the module name (lowercase) e.g. "westernunion"
3) In the main php file name the class e.g. "WesternUnion" (must be the same, but can be mixed lower and upper case)
4) In function __construct(), set the class name member variable to the module name (lowercase) e.g. $this->name = 'westernunion';
5) Modify the name of any setting in the module so that they're unique
I thinks that's them all :)
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#3
Posted 17 November 2008 - 07:17 PM
Can I post the code here, or offsite, for someone to look at ?
#4
Posted 17 November 2008 - 07:24 PM
Otherwise upload a zip file here, and we can take a look.
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#5
Posted 17 November 2008 - 08:24 PM
Take a look at it. In its current state is silently fails to install. Prior to my renaming everything it was working nearly 100%.
I've gone back to square one and renamed bits and pieces of this module a dozen times already - it's getting quite frustrating.
FWIW, I'm building this on prestashop_1.1.0.1
#6
Posted 17 November 2008 - 09:01 PM
$os->send_mail = 0; //This should be 1, however it fails, perhaps for the same reasons this entire module fails
$os->template = ""; //This should be "westernunion", however it fails, perhaps for the same reasons this entire module fails
$os->template is a multi-lang field so is an array, you'll need to use the same technique as the status message to fill all 10 elements with the template name. That way you should be able to set $os->send-mail = 1;
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#7
Posted 18 November 2008 - 03:36 AM
Thing is, that particular function is trivial and you can comment it out of the module and it makes no difference - still fails.
So are you saying you were otherwise able to install the module and run it ??
#8
Posted 18 November 2008 - 07:01 PM
http://rapidshare.co...sternunion_.rar
This code functions correctly as long as it is called "bankwire".
I've tried countless times to rename it to "westernunion" and it always fails in different ways. Should be easy right? Why can't I do it??
BTW, I commented out the custom idOrderState functions in this module, which still has a couple bugs, just so that the focus can be on getting the darn module renamed.
If someone can assist I will be forever grateful, not to mention I'll freely share the working code once it works.
#9
Posted 23 November 2008 - 02:52 PM
#10
Posted 04 December 2008 - 08:06 AM
http://rapidshare.co...sternunion_.rar
#11
Posted 10 December 2008 - 04:57 PM
It all boiled down to a single line of code!!
The original code:
$this->displayName = $this->l('Bank Wire');
which I had changed to
$this->displayName = $this->l('Western Union');
Seems innocuous, no?
Turns out the word "Union" within the displayName variable completely screws up Prestashop!! I have changed it to this for the time being:
$this->displayName = $this->l('Western Onion');
And it works just fine.
Can ANYONE explain why this is a bug????
#12
Posted 11 December 2008 - 01:40 AM
Guides Performance Guide | Installation Guide | Development Guide
Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu
All free and paid software, modules, themes and modifications are subject to the terms and conditions here.
#13
Posted 11 December 2008 - 02:40 AM
I tried this, it nearly worked but it failed at the final payment step :
Western Union
#14
Posted 11 December 2008 - 03:02 AM
Guides Performance Guide | Installation Guide | Development Guide
Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu
All free and paid software, modules, themes and modifications are subject to the terms and conditions here.
#15
Posted 11 December 2008 - 11:49 AM
Neither does "Western_Union".
#16
Posted 11 December 2008 - 04:06 PM
Commercial PrestaShop Modules Available:
Bundle Discounts, Dropshipping, CSV Order Export, Product Feature Comparison Module, Canonical SEO Module - Prevent Duplicate Content, Events Module, Save My Cart Module, Forum Module
#17
Posted 13 December 2008 - 09:03 AM
#18
Posted 13 December 2008 - 11:17 AM
am not using the check module so I made it a western union module by changing lang variables only
now if someone chooses it it says:
name - mobile phone - location
is that the same you are aiming at??
+
Sexy Lingerie
World Wide
#19
Posted 14 December 2008 - 05:06 PM
From 1229007983:
Just tried and both ideas failed!
So apart from renaming to "Onion" or some such thing, it seems like removing UNION from the blacklist in db.php is the only solution. Really??? However that requires user modifying core code, which could make the module break during an upgrade. Also, it's in the blacklist for a reason, so it must be a security concern.
#20
Posted 15 December 2008 - 05:37 AM
Guides Performance Guide | Installation Guide | Development Guide
Modules AJAX Sliding Categories | AJAX Dropdown Categories | Carousel | Image Gallery | Sliding Menu
All free and paid software, modules, themes and modifications are subject to the terms and conditions here.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












