Forums / Setting Up Categories, Products, Attributes / Creating an add-on "product type book" for ZC 1.5

Creating an add-on "product type book" for ZC 1.5

Views: 111,146

Results 321 to 340 of 427
6 Sep 2015, 7:10 PM
#321
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Creating an add-on "product type book" for ZC 1.5

Wound't be better to use git instead ?
Well, most of my use of git is downloading :) , but I see that some functionality like diffs, are available, that could simplify the updates.
This because to change stuff in zencart, we are oblige to mess with core files, etc...

In drupal for modules, there is a stable (recommended release) , and a dev one.

Something like that

Best regards

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

6 Sep 2015, 7:12 PM
#322
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

I have only recently started using git, so I will look into creating a project page for BookX as well...
p.

6 Sep 2015, 7:14 PM
#323
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Good news ! :smile:

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

7 Nov 2015, 11:29 AM
#324
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi

I'm getting this errors on install

[07-Nov-2015 11:11:48 UTC] PHP Warning:  sprintf(): Too few arguments in /home/daniel/public_html/zen154.dev/zenadmin/includes/init_includes/init_product_type_bookx.php on line 247
[07-Nov-2015 11:11:48 UTC] PHP Fatal error:  1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /home/daniel/public_html/zen154.dev/zenadmin/includes/init_includes/init_product_type_bookx.php on line 903 <== in /home/daniel/public_html/zen154.dev/includes/classes/db/mysql/query_factory.php on line 155

I've check some older threads about the init_product_type_bookx.php , but It looks that I have the updated files :

I have this on line 631, and 903.
Or my eyes are messed up, or they look the same

Line 631

while (!$profile_ids->EOF) {
					         	$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct'");
					         	$profile_ids->MoveNext();
					         }

Line 903

$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct'");
	         	$profile_ids->MoveNext();

About line 247 , it's something about languages..... Now, I had just my language. Now I place English again, but I still get this warning

if (!empty($files_missing)) {
			$messageStack->add('' . sprintf(BOOKX_MS_SOME_LANGUAGE_FILES_MISSING, $language) . '<br />'.implode(', ', $files_missing), 'caution');
		}

help ?

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

7 Nov 2015, 12:59 PM
#325
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi

It was really my eyes :)

As it was mention before there's a missing bracket.

So this is wrong :
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct'");

This is wright :

$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct**')");**

But reading the other threads, I thought the this was fixed .... I've downloaded from sourge and zencart....I guess it's was not

Best Regards

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

8 Nov 2015, 2:30 PM
#326
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

Hi mesnitu,

thanks for tracking down this error. I was convinced too that I had uploaded the fixed installation file, but indeed I had not.
I will do it right away, and yes you are correct, it is missing the closing bracket on both lines as you have indicated.

best regards,
p.

11 Dec 2015, 8:53 PM
#327
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi
Me again :)

I'm having a litle issue with authors listing images....

If I enable the "require image" in zen config , I get the existing authors images, but the ones that dont' have a image , I get this

<td class="bookxAuthorListingImageCell"><img src="" alt="" width="200" height="120"></td>

Is this the way it should work ?
I not going to enable the image require, but, probably, if there is no image, some default image should be given....

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

13 Dec 2015, 1:07 PM
#328
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

Hi mesnitu,

this is good point. Here is what I will implenet, in case you want to use it now:
in file "[ZEN_CART]/includes/modules/pages/bookx_authors_list/header_php.php"
change line 83 from

,'author_image' => (!empty($bookx_authors_listing->fields ['author_image']) ? DIR_WS_IMAGES . $bookx_authors_listing->fields ['author_image'] : '')

to this (adjust filename or extension jpg in case you want something different):

,'author_image' => (!empty($bookx_authors_listing->fields ['author_image']) ? DIR_WS_IMAGES . $bookx_authors_listing->fields ['author_image'] : [B]DIR_WS_IMAGES. 'bookx_authors/author_image_missing.jpg'[/B])

Of course you then need to place a default image "author_image_missing.jpg" in directory "[IMAGES]/bookx_authors/".

Best regards,
p.

13 Dec 2015, 3:47 PM
#329
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Done :thumbsup:

Thanks !

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

2 Feb 2016, 5:37 PM
#330
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi

This mod is definitely the route I want to go down - I have installed it with v1.5.4 but when you enter an Author's webpage (which it specifically says do not enter the http://) it gives me a link of http://mydomain.com/catalog/index.php?main_page=redirect&action=url&goto=AUTHORWEBPAGE.com

Clicking on it just takes me back to http://mydomain.com/catalog/index.php?main_page=index

Have I missed a setting somewhere please?

Thanks in advance

2 Feb 2016, 6:20 PM
#331
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

Hi Digi,

this issue is new to me, but I think ZC is translating the link, rather than Bookx.
Do I understand correctly, in the author URL field in the backend you enter:

AUTHORWEBPAGE.com
```  and in the html code you get the URL:

http://mydomain.com/catalog/index.php?main_page=redirect&action=url&goto=AUTHORWEBPAGE.com


where "mydomain.com" is the domain of your website?

Posts around the web with similar issues of a "redirect" instead of proper link URLs suggest, that this may have to do with some other problem. Could you see if you there is something helpful in your errorlog in the cache folder? 

On what page are you seeing this problem? product_info (detail ?) or product_listing or ...?

Regards,
p.
2 Feb 2016, 6:42 PM
#332
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

philou:

Hi Digi,

this issue is new to me, but I think ZC is translating the link, rather than Bookx.
Do I understand correctly, in the author URL field in the backend you enter:

AUTHORWEBPAGE.com

> 
> ```
http://mydomain.com/catalog/index.php?main_page=redirect&action=url&goto=AUTHORWEBPAGE.com

where "mydomain.com" is the domain of your website?

Posts around the web with similar issues of a "redirect" instead of proper link URLs suggest, that this may have to do with some other problem. Could you see if you there is something helpful in your errorlog in the cache folder?

On what page are you seeing this problem? product_info (detail ?) or product_listing or ...?

Regards,
p.

Ok I have an 11,000 strong books site which I wish to convert to the BookX system so at this point in time I have a brand new v1.5.4 system installed along with the BookX plugin so it's completely clean.

I have entered the Author: A J Carella as my first author (under BookX Authors) and entered her webpage as: https://www.facebook.com/ajcarella - on the v1.5.1 site under the Author Info sidebox this works because she is treated as a Manufacturer.

On the test site if I use the Author Drop-Down field in the sidebox (we won't be using the Author Type field) and select A J Carella I get a centre box with her description and the Webpage Author link. That link is my domain with a url redirect to her Facebook page. When I click the link it opens up a new browser tab but my Index page.

Please feel free to try it it out:

http://digibooks.org.uk/DB_Library_2018/ and select A J Carella from the author drop-down. It's all very basic as you will see but I want to get BookX cracked before I even attempt a massive update of our existing site :)

2 Feb 2016, 6:49 PM
#333
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Just going to check the cahe folder and error logs as well

2 Feb 2016, 6:51 PM
#334
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

I have the same behaviour here in my installation, so no need for cache error log from you at this time. Not sure with what ZC version this was introduced, since it was working back in 1.5.1 I think. Anyway, I will let you know what I find out.

Regards,
p.

2 Feb 2016, 6:53 PM
#335
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

DigiBooks:

Just going to check the cahe folder and error logs as well

Nothing obvious that I can see .. delete all error logs and tried again biut no new logs created

2 Feb 2016, 6:57 PM
#336
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

philou:

I have the same behaviour here in my installation, so no need for cache error log from you at this time. Not sure with what ZC version this was introduced, since it was working back in 1.5.1 I think. Anyway, I will let you know what I find out.

Regards,
p.

Much appreciated .. sorry to cause you a problem ;)

2 Feb 2016, 7:58 PM
#337
philou avatar

philou

Zen Follower

Join Date:
Jan 2006
Posts:
165
Plugin Contributions:
1

Re: Creating an add-on "product type book" for ZC 1.5

Well, don't ask me why this was working before and now it isn't, but the "redirect&goto=..." etc. link conversion was indeed part of the BookX code.
I have changed it and you can find an updated BookX distribution version 0.9.4revision8 at sourceforge. I will upload the new archive here at ZC.com as well, but it will probably take a little to show up in the download section.
The only changes are in these two files:

ZEN-CART/includes/modules/pages/product_bookx_info/main_template_vars_product_type.php
ZEN-CART/includes/classes/observers/class.bookx_observers.php

Best regards,
p.

2 Feb 2016, 10:11 PM
#338
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

Hi
I've made a extension for EP4 , the EP4Bookx , to import bookx product type by a csv file.
It still only works with the default language ( it only imports your default language). If you have a book shop with more than one language, I think there's a way to get around, but not to fancy. Anyway, soon I hope to finish this part. If you use just one language, it's ok.
Note: This is working with EP4.0.31 (or 30). EP4.0.32, will have some changes in the code, so I guess only then, there is a possibility to incorporate EP4Bookx with a zencart notifier.

Anyway, it inserts, updates and deletes bookx fields, supports multiple authors and genres, doing them as you would for EP4 categories. So :

Author A^Author B^Author C

It has the ability to assign some default values to bookx fields, so if a fields is left empty ( intentionally or not ), the default value is used.

Also about types with multiple authors : If you have a default type assign ( writer, or whatever ) , then in the file, things could go this way :
**We can fill all the fields **
Authors names: Author A^Author B^Author C
Authors Type: Writer^Illustrator^Wirter

**But also **
Authors names: Author A^Author B^Author C
Authors Type: (empty )

*So, all the authors are of type writer. *

Or
Authors names: Author A^Author B^Author C
Authors Type: Writer^Illustrator

*In this case, Author C would be writer . *

Well, hope you'll find it useful,
Do your changes in a local environment, this is still in Beta. I'll try to fix and improve issues that could come up.
For now, it's just a quick way to fill all bookx fields.

It's on git : https://github.com/mesnitu/EasyPopulate-4.0-BookX

Best regards

Edit : Just to mention: it imports the name, not the authors, publishers description and images, etc...
bookx_author_name
bookx_author_type
bookx_subtitle
bookx_genre_name
bookx_publisher_name
bookx_series_name
bookx_imprint
bookx_binding
bookx_printing
bookx_condition
bookx_isbn
bookx_size
bookx_volume
bookx_pages
bookx_publishing_date

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

2 Feb 2016, 10:29 PM
#339
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

philou:

Well, don't ask me why this was working before and now it isn't, but the "redirect&goto=..." etc. link conversion was indeed part of the BookX code.
I have changed it and you can find an updated BookX distribution version 0.9.4revision8 at sourceforge. I will upload the new archive here at ZC.com as well, but it will probably take a little to show up in the download section.
The only changes are in these two files:

ZEN-CART/includes/modules/pages/product_bookx_info/main_template_vars_product_type.php
ZEN-CART/includes/classes/observers/class.bookx_observers.php

> 
> Best regards,
> p.

Ok that is just giving me www.facebook.com%2fajcarella instead of <https://www.facebook.com/ajcarella>
2 Feb 2016, 10:37 PM
#340
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Creating an add-on "product type book" for ZC 1.5

DigiBooks:

Ok that is just giving me www.facebook.com%2fajcarella instead of https://www.facebook.com/ajcarella

In the bottom left-link of the screen it is showing correctly but linking me to www.facebook.com%2ajcarella so it looks like the the last forward slash is being interpreted as a space character (although I would have thought that to be %20) not sure what %2 is.