Jump to content

Recommended Posts

hi,

I have BS Edge on PHP 7.2 and, ...I have a custom template layout. I am trying to figure out if there is a way to call individual modules within the oscTemplate block into different parts of my template.

I know how the modules within a oscTemplate block can be managed via sort order and BS row width, but this does not work for my template structure.

I could create a new module block and move those individual modules that I want in a different part of the template into that folder and then call that block into the template, but I would rather not create more module folders and instead, just pull individual modules out of the same module block and place them where I need them in my custom template. Is that possible?

 

So, ..for example: the checkout_success.php page calls a block of modules in the /includes/modules/content/checkout_success/ folder using this code:

$oscTemplate->getContent('checkout_success')

In that content module folder are five individual modules and their related templates. I'm looking for a way to call each of these individually instead of as a whole block.

Any help would be greatly appreciated.


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Share this post


Link to post
Share on other sites

@burt has an example of applying certain modules on pages that they are meant to be working. He calls it "good_pages". I think this is a good reference for anyone who wants to DIY.

 

 

Share this post


Link to post
Share on other sites

Alternatively, one can also adopt the scripts in this module. The scripts enable modules to be active on selected pages only:

image.png.8ca5372884cc816d20604641a84cb009.png

Share this post


Link to post
Share on other sites

@kgtee

hi KG, thank you for the reply.

I read Burt's post and both, his array of good_pages and the option of selecting the pages for the modules to be activated on, do not address the challenge I have with calling the individual modules from a module block.

So, what I want to do is call each of the five modules within that /includes/modules/content/checkout_success/ folder, one at a time. That would allow me to place them where I want on the "same" page. I'm not trying to get these module to display on other pages. I want them all on the checkout_success.php page. However, to position them according to my custom template I need to call them individually.

 

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Share this post


Link to post
Share on other sites

Hi @Demitry, now I understand more clearly what you are trying to get at. However, I regret that I am not able to help as I am not yet good in programming. I am still learning and always hope to see some good code written by others so that I can learn from them.

Your idea seems similar to the shopping cart module which was once a single module. It was broken down to a few different smaller modules by raiwa and these modules can be called individually from the module content admin.

So, you may want to decide what modules you want to be included in the checkout_success.php and then develop them as modules.

 

@Demitry

Edited by kgtee

Share this post


Link to post
Share on other sites

@Demitry  I've never played around with that but I wonder if Gary's new Product Information system might point you in the right direction?

Dan

Share this post


Link to post
Share on other sites

I don't quite understand why you would need to call them individually?  Can you explain more that?


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
6 hours ago, Demitry said:

I want them all on the checkout_success.php page. However, to position them according to my custom template I need to call them individually.

I think/presume  @Demitry  tries to implement the modules into a bought template and uses the template page as a start skeleton and then wants to call the modules one-by-one in the template.

I made this mistake myself in the past .. Did not understand you have to take eg checkout_success.php as the start skeleton and then move the different bits of the (bought) template into modules template file ...

Share this post


Link to post
Share on other sites

Thank you all for your response.

ok, so a bit more clarity on what I'm doing. I have a site where there are no left or right columns, so the center column stretches the width of the page. I added a simple template to some of the pages that breaks up that center column into two sections; the left is 8 col and the right is 4 (on desktop), ..along with a 1px border that separates them. See screenshot below. The yellow and green areas are part of this template.

Calling the oscTemplate module block would place all the modules in either left or right sections. So, to break up these individual modules I could either create a new module folder (lets say call it checkout_success_rc .."rc" for right column) and place those modules in that folder. Then call it in the page template for that right side (see code structure below the image).

However, I was wondering if there is a way to just call the individual modules instead of the entire set. If that was possible, then I would not need to create an additional module folder. I could just call individual modules from the same set into either the left column or the right column.

template-layout.thumb.png.ecd9244bc19c3314007d0a5ecca2c938.png

 

<div class="contentContainer">
  <div class="contentText row">
    <div class="col-xs-12 col-sm-8 split-page-8-4-cs-left">
      <?php echo $oscTemplate->getContent('checkout_success'); ?>
      <div class="clearfix"></div>
    </div>
    <div class="col-xs-12 col-sm-4 split-page-8-4-cs-right">
      <?php echo $oscTemplate->getContent('checkout_success_rc'); ?>
    </div>
</div>

 


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites

Would the pi functionality not be the place to start for this? Combined with module control it could make the system extremely customisable.

Share this post


Link to post
Share on other sites

@Dan Cole

I think the Product Information System that you’re referring to is part of the Phoenix release. I’m not familiar with it and this is the first I’m hearing of it. Though out of curiosity I’d love to know more about it.

 


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites
Quote

Would the pi functionality not be the place to start for this? Combined with module control it could make the system extremely customisable.

Lee, I believe that you’re referring to the same Product Information System that Dan mentioned. I’m currently in the dark when it comes to that particular topic. However, I completely support any and all initiatives that would make this software easier to customize …and especially, for the non-technical user.


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites
11 hours ago, Demitry said:

@Dan Cole

I think the Product Information System that you’re referring to is part of the Phoenix release. I’m not familiar with it and this is the first I’m hearing of it. Though out of curiosity I’d love to know more about it.

 

 

@Demitry You'll find additional information about it in the Phoenix club...sign up there if you haven't already and you'll find a thread describing what it does and an explanation of how it works.   Basically Gary has split the product information pages up into modules that you can control the placement of from the admin side....in addition to the normal sort order you can select whether something is placed at the top, left, right, perhaps center and bottom of the page. You can also control the width the item occupies.   It in effect gives you total control over the placement of items on the product information page.   It's a must have and should give you a good idea of how to achieve what you want.   You'll need to become a supporter to get the actual code but you can at least have a look to see if it is the sort of thing you're trying to achieve. Supporting Phoenix is something everyone using osC, in it's various forms, should do.  If it's not in a shop owners budget it needs to be.

Dan 

Share this post


Link to post
Share on other sites

@Demitry

Just a quick, off-the-top-of-my-head thought ... could you do something like this:

<div>
  <?php
    include module_1.php
    include module_2.php
    include module_3.php
  ?>
</div>
<div>
  <?php
    include module_4.php
  ?>
</div>

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@Dan Cole

Dan, thank you for the explanation and yeah, it does seem like something I could use. Though is that something I can integrate with BS Edge?, ..because I am really not up to starting from scratch with a newer version of osC.

 

@ArtcoInc

hi Malcolm,

Actually, I thought of doing the same thing, but only after I created this page post, lol.

I have not tried it yet and my thoughts were that the modules have to be ran through the oscTemplate.

However, I am not sure if that makes any difference in terms of security or anything else. I just don't know how calling the module block contents through the oscTemplate actually works. Perhaps I need to explore that first.

Edited by Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites
1 minute ago, Demitry said:

Dan, thank you for the explanation and yeah, it does seem like something I could use. Though is that something I can integrate with BS Edge?, ..because I am really not up to starting from scratch with a newer version of osC.

If you join the club and look through that thread someone might have commented about using it on EDGE...I'm just not sure.  You could always ask there as well.  Phoenix is just an improved version of EDGE so my guess is that it would work or could be made to do so fairly easily.

Dan

Share this post


Link to post
Share on other sites

Ok, so a quick update,...

I downloaded Phoenix v1.0.2.0 (Community Edition) and looked at the product_info.php page and related pi modules. It's pretty much the same as the BS Edge. So, I assume the new Product Information System is not in the "Community Edition."

I also looked at the oscTemplate class (something I should have done from the start) and now understand it far better than I did before.

After that I decided to test what Malcolm referred to and include the individual modules and their related language files in the Left Column and Right Column of my template. That did not work either and there were no errors in the error log.

So, unless one of the Sr. developers has a quick working solution, I think my alternative is (as mentioned before), to just create another module block for the Right Column and move the individual modules I want to display in the Right Column to that module group folder.


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites

I'd suggest to read your own signature :D 

Quote

osCommerce: made for programmers, ...because store owners do not want to be programmers.

Are you a store owner or a programmer?

If the former, support the programmers.  If the latter, support the shopowners.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
7 hours ago, Demitry said:

I downloaded Phoenix v1.0.2.0 (Community Edition) and looked at the product_info.php page and related pi modules. It's pretty much the same as the BS Edge. So, I assume the new Product Information System is not in the "Community Edition."

@Demitry That is correct Demitry and the reason I suggested joining the Phoenix club and having a look through that thread.  You can then decide if you want to become a supporter, which I'd highly recommend.

Dan

Share this post


Link to post
Share on other sites
Quote

That is correct Demitry and the reason I suggested joining the Phoenix club and having a look through that thread.  You can then decide if you want to become a supporter, which I'd highly recommend.

Cool, thanks man. I figured this was likely the case as soon as I saw "Community Edition."

 


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites
Quote

  If the latter, support the shopowners. 

I am supporting the shop owners,.. that's why I have a ton of contributions and am one of less than a handful of people still spending their personal time on releasing new ones.


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites
On 10/21/2019 at 4:49 PM, Demitry said:

I am supporting the shop owners,.. that's why I have a ton of contributions and am one of less than a handful of people still spending their personal time on releasing new ones.

<?php if ( !defined ( MODULE_THEME_SWITCHER_STATUS ) || MODULE_THEME_SWITCHER_STATUS != 'true' ) { ?>

    <link rel="stylesheet" type="text/css" href="ext/bootstrap/css/bootstrap.min.css">

<?php } ?>

 

 

you can put it in your head

Share this post


Link to post
Share on other sites
Quote

<?php if ( !defined ( MODULE_THEME_SWITCHER_STATUS ) || MODULE_THEME_SWITCHER_STATUS != 'true' ) { ?>

    <link rel="stylesheet" type="text/css" href="ext/bootstrap/css/bootstrap.min.css">

<?php } ?>

you can put it in your head

Thanks Kevin, but I don't use the Theme Switcher addon. And, I actually do need BootStrap for that page.

I resolved this topic's issue by doing what I originally said,.. via separating the modules into two cm-folders and calling them each as a block in the related parts of my template.

 


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×